@oat-sa/tao-core-shared-libs 1.8.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/lib/ckeditor/.qodo/history.sqlite +0 -0
  2. package/lib/ckeditor/.qodo/indexes.sqlite +0 -0
  3. package/lib/ckeditor/ckeditor.js +384 -384
  4. package/lib/ckeditor/skins/kama/editor.css +1 -1
  5. package/lib/ckeditor/skins/kama/editor_ie.css +1 -1
  6. package/lib/ckeditor/skins/kama/editor_ie7.css +1 -1
  7. package/lib/ckeditor/skins/kama/editor_ie8.css +1 -1
  8. package/lib/ckeditor/skins/kama/editor_iequirks.css +1 -1
  9. package/lib/ckeditor/skins/moono/editor.css +1 -1
  10. package/lib/ckeditor/skins/moono/editor_gecko.css +1 -1
  11. package/lib/ckeditor/skins/moono/editor_ie.css +1 -1
  12. package/lib/ckeditor/skins/moono/editor_ie7.css +1 -1
  13. package/lib/ckeditor/skins/moono/editor_ie8.css +1 -1
  14. package/lib/ckeditor/skins/moono/editor_iequirks.css +1 -1
  15. package/lib/ckeditor/skins/moono-lisa/editor.css +1 -1
  16. package/lib/ckeditor/skins/moono-lisa/editor_gecko.css +1 -1
  17. package/lib/ckeditor/skins/moono-lisa/editor_ie.css +1 -1
  18. package/lib/ckeditor/skins/moono-lisa/editor_ie8.css +1 -1
  19. package/lib/ckeditor/skins/moono-lisa/editor_iequirks.css +1 -1
  20. package/lib/ckeditor/skins/tao/editor.css +1 -1
  21. package/lib/ckeditor/skins/tao/skin.css +1 -1
  22. package/package.json +1 -1
  23. package/lib/ckeditor/plugins/sourcedialog/icons/hidpi/sourcedialog-rtl.png +0 -0
  24. package/lib/ckeditor/plugins/sourcedialog/icons/hidpi/sourcedialog.png +0 -0
  25. package/lib/ckeditor/plugins/sourcedialog/icons/sourcedialog-rtl.png +0 -0
  26. package/lib/ckeditor/plugins/sourcedialog/icons/sourcedialog.png +0 -0
  27. package/lib/ckeditor/plugins/sourcedialog/lang/af.js +0 -1
  28. package/lib/ckeditor/plugins/sourcedialog/lang/ar.js +0 -1
  29. package/lib/ckeditor/plugins/sourcedialog/lang/az.js +0 -1
  30. package/lib/ckeditor/plugins/sourcedialog/lang/bg.js +0 -1
  31. package/lib/ckeditor/plugins/sourcedialog/lang/bn.js +0 -1
  32. package/lib/ckeditor/plugins/sourcedialog/lang/bs.js +0 -1
  33. package/lib/ckeditor/plugins/sourcedialog/lang/ca.js +0 -1
  34. package/lib/ckeditor/plugins/sourcedialog/lang/cs.js +0 -1
  35. package/lib/ckeditor/plugins/sourcedialog/lang/cy.js +0 -1
  36. package/lib/ckeditor/plugins/sourcedialog/lang/da.js +0 -1
  37. package/lib/ckeditor/plugins/sourcedialog/lang/de-ch.js +0 -1
  38. package/lib/ckeditor/plugins/sourcedialog/lang/de.js +0 -1
  39. package/lib/ckeditor/plugins/sourcedialog/lang/el.js +0 -1
  40. package/lib/ckeditor/plugins/sourcedialog/lang/en-au.js +0 -1
  41. package/lib/ckeditor/plugins/sourcedialog/lang/en-ca.js +0 -1
  42. package/lib/ckeditor/plugins/sourcedialog/lang/en-gb.js +0 -1
  43. package/lib/ckeditor/plugins/sourcedialog/lang/en.js +0 -1
  44. package/lib/ckeditor/plugins/sourcedialog/lang/eo.js +0 -1
  45. package/lib/ckeditor/plugins/sourcedialog/lang/es-mx.js +0 -1
  46. package/lib/ckeditor/plugins/sourcedialog/lang/es.js +0 -1
  47. package/lib/ckeditor/plugins/sourcedialog/lang/et.js +0 -1
  48. package/lib/ckeditor/plugins/sourcedialog/lang/eu.js +0 -1
  49. package/lib/ckeditor/plugins/sourcedialog/lang/fa.js +0 -1
  50. package/lib/ckeditor/plugins/sourcedialog/lang/fi.js +0 -1
  51. package/lib/ckeditor/plugins/sourcedialog/lang/fo.js +0 -1
  52. package/lib/ckeditor/plugins/sourcedialog/lang/fr-ca.js +0 -1
  53. package/lib/ckeditor/plugins/sourcedialog/lang/fr.js +0 -1
  54. package/lib/ckeditor/plugins/sourcedialog/lang/gl.js +0 -1
  55. package/lib/ckeditor/plugins/sourcedialog/lang/gu.js +0 -1
  56. package/lib/ckeditor/plugins/sourcedialog/lang/he.js +0 -1
  57. package/lib/ckeditor/plugins/sourcedialog/lang/hi.js +0 -1
  58. package/lib/ckeditor/plugins/sourcedialog/lang/hr.js +0 -1
  59. package/lib/ckeditor/plugins/sourcedialog/lang/hu.js +0 -1
  60. package/lib/ckeditor/plugins/sourcedialog/lang/id.js +0 -1
  61. package/lib/ckeditor/plugins/sourcedialog/lang/is.js +0 -1
  62. package/lib/ckeditor/plugins/sourcedialog/lang/it.js +0 -1
  63. package/lib/ckeditor/plugins/sourcedialog/lang/ja.js +0 -1
  64. package/lib/ckeditor/plugins/sourcedialog/lang/ka.js +0 -1
  65. package/lib/ckeditor/plugins/sourcedialog/lang/km.js +0 -1
  66. package/lib/ckeditor/plugins/sourcedialog/lang/ko.js +0 -1
  67. package/lib/ckeditor/plugins/sourcedialog/lang/ku.js +0 -1
  68. package/lib/ckeditor/plugins/sourcedialog/lang/lt.js +0 -1
  69. package/lib/ckeditor/plugins/sourcedialog/lang/lv.js +0 -1
  70. package/lib/ckeditor/plugins/sourcedialog/lang/mn.js +0 -1
  71. package/lib/ckeditor/plugins/sourcedialog/lang/ms.js +0 -1
  72. package/lib/ckeditor/plugins/sourcedialog/lang/nb.js +0 -1
  73. package/lib/ckeditor/plugins/sourcedialog/lang/nl.js +0 -1
  74. package/lib/ckeditor/plugins/sourcedialog/lang/no.js +0 -1
  75. package/lib/ckeditor/plugins/sourcedialog/lang/oc.js +0 -1
  76. package/lib/ckeditor/plugins/sourcedialog/lang/pl.js +0 -1
  77. package/lib/ckeditor/plugins/sourcedialog/lang/pt-br.js +0 -1
  78. package/lib/ckeditor/plugins/sourcedialog/lang/pt.js +0 -1
  79. package/lib/ckeditor/plugins/sourcedialog/lang/ro.js +0 -1
  80. package/lib/ckeditor/plugins/sourcedialog/lang/ru.js +0 -1
  81. package/lib/ckeditor/plugins/sourcedialog/lang/si.js +0 -1
  82. package/lib/ckeditor/plugins/sourcedialog/lang/sk.js +0 -1
  83. package/lib/ckeditor/plugins/sourcedialog/lang/sl.js +0 -1
  84. package/lib/ckeditor/plugins/sourcedialog/lang/sq.js +0 -1
  85. package/lib/ckeditor/plugins/sourcedialog/lang/sr-latn.js +0 -1
  86. package/lib/ckeditor/plugins/sourcedialog/lang/sr.js +0 -1
  87. package/lib/ckeditor/plugins/sourcedialog/lang/sv.js +0 -1
  88. package/lib/ckeditor/plugins/sourcedialog/lang/th.js +0 -1
  89. package/lib/ckeditor/plugins/sourcedialog/lang/tr.js +0 -1
  90. package/lib/ckeditor/plugins/sourcedialog/lang/tt.js +0 -1
  91. package/lib/ckeditor/plugins/sourcedialog/lang/ug.js +0 -1
  92. package/lib/ckeditor/plugins/sourcedialog/lang/uk.js +0 -1
  93. package/lib/ckeditor/plugins/sourcedialog/lang/vi.js +0 -1
  94. package/lib/ckeditor/plugins/sourcedialog/lang/zh-cn.js +0 -1
  95. package/lib/ckeditor/plugins/sourcedialog/lang/zh.js +0 -1
  96. package/lib/ckeditor/plugins/sourcedialog/plugin.js +0 -6
  97. package/lib/ckeditor/skins/tao/editor.css.map +0 -1
@@ -2,13 +2,13 @@
2
2
  Copyright (c) 2003-2025, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- (function(){if(!window.CKEDITOR||!window.CKEDITOR.dom){window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,l={timestamp:"P499",version:"4.14.1 TAO-3.1 DEV",revision:"6c5482a48",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var f=window.CKEDITOR_BASEPATH||"";if(!f)for(var g=document.getElementsByTagName("script"),h=0;h<g.length;h++){var k=g[h].src.match(a);if(k){f=k[1];break}}-1==f.indexOf(":/")&&
5
+ (function(){if(!window.CKEDITOR||!window.CKEDITOR.dom){window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,l={timestamp:"P8U8",version:"4.14.1 TAO-3.2 DEV",revision:"46ae834be",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var f=window.CKEDITOR_BASEPATH||"";if(!f)for(var g=document.getElementsByTagName("script"),h=0;h<g.length;h++){var k=g[h].src.match(a);if(k){f=k[1];break}}-1==f.indexOf(":/")&&
6
6
  "//"!=f.slice(0,2)&&(f=0===f.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+f:location.href.match(/^[^\?]*\/(?:)/)[0]+f);if(!f)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return f}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&"/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a)&&(a+=(0<=a.indexOf("?")?"\x26":"?")+"t\x3d"+this.timestamp);
7
7
  return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",a,!1),f()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),f())}catch(k){}}function f(){for(var k;k=h.shift();)k()}var h=[];return function(k){function c(){try{document.documentElement.doScroll("left")}catch(b){setTimeout(c,1);return}a()}h.push(k);"complete"===document.readyState&&setTimeout(a,1);if(1==h.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",
8
8
  a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);k=!1;try{k=!window.frameElement}catch(d){}document.documentElement.doScroll&&k&&c()}}}()},g=window.CKEDITOR_GETURL;if(g){var f=l.getUrl;l.getUrl=function(a){return g.call(l,a)||f.call(l,a)}}return l}());CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var l=CKEDITOR.event.prototype,g;for(g in l)null==a[g]&&(a[g]=l[g])},
9
9
  CKEDITOR.event.prototype=function(){function a(a){var e=l(this);return e[a]||(e[a]=new g(a))}var l=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},g=function(a){this.name=a;this.listeners=[]};g.prototype={getListenerIndex:function(a){for(var e=0,g=this.listeners;e<g.length;e++)if(g[e].fn==a)return e;return-1}};return{define:function(f,e){var g=a.call(this,f);CKEDITOR.tools.extend(g,e,!0)},on:function(f,e,g,h,k){function c(b,n,c,a){b={name:f,sender:this,editor:b,
10
- data:n,listenerData:h,stop:c,cancel:a,removeListener:d};return!1===e.call(g,b)?!1:b.data}function d(){n.removeListener(f,e)}var b=a.call(this,f);if(0>b.getListenerIndex(e)){b=b.listeners;g||(g=this);isNaN(k)&&(k=10);var n=this;c.fn=e;c.priority=k;for(var r=b.length-1;0<=r;r--)if(b[r].priority<=k)return b.splice(r+1,0,c),{removeListener:d};b.unshift(c)}return{removeListener:d}},once:function(){var a=Array.prototype.slice.call(arguments),e=a[1];a[1]=function(a){a.removeListener();return e.apply(this,
11
- arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,e=function(){a=1},g=0,h=function(){g=1};return function(k,c,d){var b=l(this)[k];k=a;var n=g;a=g=0;if(b){var r=b.listeners;if(r.length)for(var r=r.slice(0),u,p=0;p<r.length;p++){if(b.errorProof)try{u=r[p].call(this,d,c,e,h)}catch(t){}else u=r[p].call(this,d,c,e,h);!1===u?g=1:"undefined"!=typeof u&&(c=u);if(a||g)break}}c=
10
+ data:n,listenerData:h,stop:c,cancel:a,removeListener:d};return!1===e.call(g,b)?!1:b.data}function d(){n.removeListener(f,e)}var b=a.call(this,f);if(0>b.getListenerIndex(e)){b=b.listeners;g||(g=this);isNaN(k)&&(k=10);var n=this;c.fn=e;c.priority=k;for(var p=b.length-1;0<=p;p--)if(b[p].priority<=k)return b.splice(p+1,0,c),{removeListener:d};b.unshift(c)}return{removeListener:d}},once:function(){var a=Array.prototype.slice.call(arguments),e=a[1];a[1]=function(a){a.removeListener();return e.apply(this,
11
+ arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,e=function(){a=1},g=0,h=function(){g=1};return function(k,c,d){var b=l(this)[k];k=a;var n=g;a=g=0;if(b){var p=b.listeners;if(p.length)for(var p=p.slice(0),q,v=0;v<p.length;v++){if(b.errorProof)try{q=p[v].call(this,d,c,e,h)}catch(r){}else q=p[v].call(this,d,c,e,h);!1===q?g=1:"undefined"!=typeof q&&(c=q);if(a||g)break}}c=
12
12
  g?!1:"undefined"==typeof c?!0:c;a=k;g=n;return c}}(),fireOnce:function(a,e,g){e=this.fire(a,e,g);delete l(this)[a];return e},removeListener:function(a,e){var g=l(this)[a];if(g){var h=g.getListenerIndex(e);0<=h&&g.listeners.splice(h,1)}},removeAllListeners:function(){var a=l(this),e;for(e in a)delete a[e]},hasListeners:function(a){return(a=l(this)[a])&&0<a.listeners.length}}}());CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=
13
13
  function(a,l){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fire.call(this,a,l,this)},CKEDITOR.editor.prototype.fireOnce=function(a,l){a in{instanceReady:1,loaded:1}&&(this[a]=!0);return CKEDITOR.event.prototype.fireOnce.call(this,a,l,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),l=a.match(/edge[ \/](\d+.?\d*)/),g=-1<a.indexOf("trident/"),g=!(!l&&!g),g={ie:g,edge:!!l,webkit:!g&&
14
14
  -1<a.indexOf(" applewebkit/"),air:-1<a.indexOf(" adobeair/"),mac:-1<a.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode&&(!document.documentMode||10>document.documentMode),mobile:-1<a.indexOf("mobile"),iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return!1;var a=document.domain,f=window.location.hostname;return a!=f&&a!="["+f+"]"},secure:"https:"==location.protocol};g.gecko="Gecko"==navigator.product&&!g.webkit&&!g.ie;g.webkit&&(-1<a.indexOf("chrome")?g.chrome=
@@ -116,11 +116,11 @@ arguments)}catch(b){}else a.apply(this,arguments);return this}:a}(),setAttribute
116
116
  0;c<a.length;c++)this.removeAttribute(a[c]);else for(c in a=a||this.getAttributes(),a)a.hasOwnProperty(c)&&this.removeAttribute(c)},removeStyle:function(a){var c=this.$.style;if(c.removeProperty||"border"!=a&&"margin"!=a&&"padding"!=a)c.removeProperty?c.removeProperty(a):c.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)),this.$.style.cssText||this.removeAttribute("style");else{var d=["top","left","right","bottom"],b;"border"==a&&(b=["color","style","width"]);for(var c=[],f=0;f<d.length;f++)if(b)for(var e=
117
117
  0;e<b.length;e++)c.push([a,d[f],b[e]].join("-"));else c.push([a,d[f]].join("-"));for(a=0;a<c.length;a++)this.removeStyle(c[a])}},setStyle:function(a,c){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]=c;return this},setStyles:function(a){for(var c in a)this.setStyle(c,a[c]);return this},setOpacity:function(a){CKEDITOR.env.ie&&9>CKEDITOR.env.version?(a=Math.round(100*a),this.setStyle("filter",100<=a?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+a+")")):this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
118
118
  "none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,c=this.getElementsByTag("*"),d=0,b=c.count();d<b;d++)a=c.getItem(d),a.setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var a=this;"html"!=a.getName();){if("static"!=a.getComputedStyle("position"))return a;a=a.getParent()}return null},getDocumentPosition:function(a){var c=0,d=0,b=this.getDocument(),f=b.getBody(),e="BackCompat"==b.$.compatMode;if(document.documentElement.getBoundingClientRect&&(CKEDITOR.env.ie?
119
- 8!==CKEDITOR.env.version:1)){var h=this.$.getBoundingClientRect(),g=b.$.documentElement,m=g.clientTop||f.$.clientTop||0,q=g.clientLeft||f.$.clientLeft||0,l=!0;CKEDITOR.env.ie&&(l=b.getDocumentElement().contains(this),b=b.getBody().contains(this),l=e&&b||!e&&l);l&&(CKEDITOR.env.webkit||CKEDITOR.env.ie&&12<=CKEDITOR.env.version?(c=f.$.scrollLeft||g.scrollLeft,d=f.$.scrollTop||g.scrollTop):(d=e?f.$:g,c=d.scrollLeft,d=d.scrollTop),c=h.left+c-q,d=h.top+d-m)}else for(m=this,q=null;m&&"body"!=m.getName()&&
120
- "html"!=m.getName();){c+=m.$.offsetLeft-m.$.scrollLeft;d+=m.$.offsetTop-m.$.scrollTop;m.equals(this)||(c+=m.$.clientLeft||0,d+=m.$.clientTop||0);for(;q&&!q.equals(m);)c-=q.$.scrollLeft,d-=q.$.scrollTop,q=q.getParent();q=m;m=(h=m.$.offsetParent)?new CKEDITOR.dom.element(h):null}a&&(h=this.getWindow(),m=a.getWindow(),!h.equals(m)&&h.$.frameElement&&(a=(new CKEDITOR.dom.element(h.$.frameElement)).getDocumentPosition(a),c+=a.x,d+=a.y));document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||
119
+ 8!==CKEDITOR.env.version:1)){var h=this.$.getBoundingClientRect(),g=b.$.documentElement,m=g.clientTop||f.$.clientTop||0,t=g.clientLeft||f.$.clientLeft||0,l=!0;CKEDITOR.env.ie&&(l=b.getDocumentElement().contains(this),b=b.getBody().contains(this),l=e&&b||!e&&l);l&&(CKEDITOR.env.webkit||CKEDITOR.env.ie&&12<=CKEDITOR.env.version?(c=f.$.scrollLeft||g.scrollLeft,d=f.$.scrollTop||g.scrollTop):(d=e?f.$:g,c=d.scrollLeft,d=d.scrollTop),c=h.left+c-t,d=h.top+d-m)}else for(m=this,t=null;m&&"body"!=m.getName()&&
120
+ "html"!=m.getName();){c+=m.$.offsetLeft-m.$.scrollLeft;d+=m.$.offsetTop-m.$.scrollTop;m.equals(this)||(c+=m.$.clientLeft||0,d+=m.$.clientTop||0);for(;t&&!t.equals(m);)c-=t.$.scrollLeft,d-=t.$.scrollTop,t=t.getParent();t=m;m=(h=m.$.offsetParent)?new CKEDITOR.dom.element(h):null}a&&(h=this.getWindow(),m=a.getWindow(),!h.equals(m)&&h.$.frameElement&&(a=(new CKEDITOR.dom.element(h.$.frameElement)).getDocumentPosition(a),c+=a.x,d+=a.y));document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||
121
121
  e||(c+=this.$.clientLeft?1:0,d+=this.$.clientTop?1:0);return{x:c,y:d}},scrollIntoView:function(a){var c=this.getParent();if(c){do if((c.$.clientWidth&&c.$.clientWidth<c.$.scrollWidth||c.$.clientHeight&&c.$.clientHeight<c.$.scrollHeight)&&!c.is("body")&&this.scrollIntoParent(c,a,1),c.is("html")){var d=c.getWindow();try{var b=d.$.frameElement;b&&(c=new CKEDITOR.dom.element(b))}catch(f){}}while(c=c.getParent())}},scrollIntoParent:function(a,c,d){var b,f,e,h;function g(b,c){/body|html/.test(a.getName())?
122
- a.getWindow().$.scrollBy(b,c):(a.$.scrollLeft+=b,a.$.scrollTop+=c)}function m(b,a){var c={x:0,y:0};if(!b.is(l?"body":"html")){var d=b.$.getBoundingClientRect();c.x=d.left;c.y=d.top}d=b.getWindow();d.equals(a)||(d=m(CKEDITOR.dom.element.get(d.$.frameElement),a),c.x+=d.x,c.y+=d.y);return c}function q(b,a){return parseInt(b.getComputedStyle("margin-"+a)||0,10)||0}!a&&(a=this.getWindow());e=a.getDocument();var l="BackCompat"==e.$.compatMode;a instanceof CKEDITOR.dom.window&&(a=l?e.getBody():e.getDocumentElement());
123
- CKEDITOR.env.webkit&&(e=this.getEditor(!1))&&(e._.previousScrollTop=null);e=a.getWindow();f=m(this,e);var x=m(a,e),z=this.$.offsetHeight;b=this.$.offsetWidth;var A=a.$.clientHeight,w=a.$.clientWidth;e=f.x-q(this,"left")-x.x||0;h=f.y-q(this,"top")-x.y||0;b=f.x+b+q(this,"right")-(x.x+w)||0;f=f.y+z+q(this,"bottom")-(x.y+A)||0;(0>h||0<f)&&g(0,!0===c?h:!1===c?f:0>h?h:f);d&&(0>e||0<b)&&g(0>e?e:b,0)},setState:function(a,c,d){c=c||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(c+"_on");this.removeClass(c+
122
+ a.getWindow().$.scrollBy(b,c):(a.$.scrollLeft+=b,a.$.scrollTop+=c)}function m(b,a){var c={x:0,y:0};if(!b.is(l?"body":"html")){var d=b.$.getBoundingClientRect();c.x=d.left;c.y=d.top}d=b.getWindow();d.equals(a)||(d=m(CKEDITOR.dom.element.get(d.$.frameElement),a),c.x+=d.x,c.y+=d.y);return c}function t(b,a){return parseInt(b.getComputedStyle("margin-"+a)||0,10)||0}!a&&(a=this.getWindow());e=a.getDocument();var l="BackCompat"==e.$.compatMode;a instanceof CKEDITOR.dom.window&&(a=l?e.getBody():e.getDocumentElement());
123
+ CKEDITOR.env.webkit&&(e=this.getEditor(!1))&&(e._.previousScrollTop=null);e=a.getWindow();f=m(this,e);var x=m(a,e),z=this.$.offsetHeight;b=this.$.offsetWidth;var B=a.$.clientHeight,w=a.$.clientWidth;e=f.x-t(this,"left")-x.x||0;h=f.y-t(this,"top")-x.y||0;b=f.x+b+t(this,"right")-(x.x+w)||0;f=f.y+z+t(this,"bottom")-(x.y+B)||0;(0>h||0<f)&&g(0,!0===c?h:!1===c?f:0>h?h:f);d&&(0>e||0<b)&&g(0>e?e:b,0)},setState:function(a,c,d){c=c||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(c+"_on");this.removeClass(c+
124
124
  "_off");this.removeClass(c+"_disabled");d&&this.setAttribute("aria-pressed",!0);d&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(c+"_disabled");this.removeClass(c+"_off");this.removeClass(c+"_on");d&&this.setAttribute("aria-disabled",!0);d&&this.removeAttribute("aria-pressed");break;default:this.addClass(c+"_off"),this.removeClass(c+"_on"),this.removeClass(c+"_disabled"),d&&this.removeAttribute("aria-pressed"),d&&this.removeAttribute("aria-disabled")}},
125
125
  getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(c){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,c){var d=this.$.attributes;c=c||{};for(var b=0;b<d.length;b++){var f=d[b],e=f.nodeName.toLowerCase(),h;if(!(e in c))if("checked"==e&&(h=this.getAttribute(e)))a.setAttribute(e,h);else if(!CKEDITOR.env.ie||this.hasAttribute(e))h=this.getAttribute(e),null===h&&(h=f.nodeValue),a.setAttribute(e,h)}""!==this.$.style.cssText&&
126
126
  (a.$.style.cssText=this.$.style.cssText)},renameNode:function(a){if(this.getName()!=a){var c=this.getDocument();a=new CKEDITOR.dom.element(a,c);this.copyAttributes(a);this.moveChildren(a);this.getParent(!0)&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(c,d){var b=c.childNodes;if(0<=d&&d<b.length)return b[d]}return function(c){var d=this.$;if(c.slice)for(c=c.slice();0<c.length&&d;)d=a(d,
@@ -130,8 +130,8 @@ a)));c();return a},findOne:function(a){var c=l(this);a=this.$.querySelector(g(th
130
130
  f)}else b[b[a]?a:d](c)},isDetached:function(){var a=this.getDocument(),c=a.getDocumentElement();return c.equals(this)||c.contains(this)?!CKEDITOR.env.ie||8<CKEDITOR.env.version&&!CKEDITOR.env.quirks?!a.$.defaultView:!1:!0}});var h={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(a,c,d){"number"==typeof c&&(!d||CKEDITOR.env.ie&&CKEDITOR.env.quirks||
131
131
  (c-=f.call(this,a)),this.setStyle(a,c+"px"))};CKEDITOR.dom.element.prototype.getSize=function(a,c){var d=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;c&&(d-=f.call(this,a));return d}})();CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a};CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,
132
132
  insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)},getHtml:function(){var a=new CKEDITOR.dom.element("div");this.clone(1,1).appendTo(a);return a.getHtml().replace(/\s*data-cke-expando=".*?"/g,"")}},!0,{append:1,appendBogus:1,clone:1,getFirst:1,getHtml:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,
133
- CKEDITOR.dom.document.prototype,!0,{find:1,findOne:1});(function(){function a(b,a){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed)return this.end(),null;c.optimize()}var d,f=c.startContainer;d=c.endContainer;var e=c.startOffset,k=c.endOffset,h,n=this.guard,g=this.type,m=b?"getPreviousSourceNode":"getNextSourceNode";if(!b&&!this._.guardLTR){var l=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),B=d.type==CKEDITOR.NODE_ELEMENT?d.getChild(k):d.getNext();this._.guardLTR=
134
- function(b,a){return(!a||!l.equals(b))&&(!B||!b.equals(B))&&(b.type!=CKEDITOR.NODE_ELEMENT||!a||!b.equals(c.root))}}if(b&&!this._.guardRTL){var C=f.type==CKEDITOR.NODE_ELEMENT?f:f.getParent(),G=f.type==CKEDITOR.NODE_ELEMENT?e?f.getChild(e-1):null:f.getPrevious();this._.guardRTL=function(b,a){return(!a||!C.equals(b))&&(!G||!b.equals(G))&&(b.type!=CKEDITOR.NODE_ELEMENT||!a||!b.equals(c.root))}}var K=b?this._.guardRTL:this._.guardLTR;h=n?function(b,a){return!1===K(b,a)?!1:n(b,a)}:K;this.current?d=this.current[m](!1,
133
+ CKEDITOR.dom.document.prototype,!0,{find:1,findOne:1});(function(){function a(b,a){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed)return this.end(),null;c.optimize()}var d,f=c.startContainer;d=c.endContainer;var e=c.startOffset,k=c.endOffset,h,n=this.guard,g=this.type,m=b?"getPreviousSourceNode":"getNextSourceNode";if(!b&&!this._.guardLTR){var l=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),C=d.type==CKEDITOR.NODE_ELEMENT?d.getChild(k):d.getNext();this._.guardLTR=
134
+ function(b,a){return(!a||!l.equals(b))&&(!C||!b.equals(C))&&(b.type!=CKEDITOR.NODE_ELEMENT||!a||!b.equals(c.root))}}if(b&&!this._.guardRTL){var A=f.type==CKEDITOR.NODE_ELEMENT?f:f.getParent(),G=f.type==CKEDITOR.NODE_ELEMENT?e?f.getChild(e-1):null:f.getPrevious();this._.guardRTL=function(b,a){return(!a||!A.equals(b))&&(!G||!b.equals(G))&&(b.type!=CKEDITOR.NODE_ELEMENT||!a||!b.equals(c.root))}}var K=b?this._.guardRTL:this._.guardLTR;h=n?function(b,a){return!1===K(b,a)?!1:n(b,a)}:K;this.current?d=this.current[m](!1,
135
135
  g,h):(b?d.type==CKEDITOR.NODE_ELEMENT&&(d=0<k?d.getChild(k-1):!1===h(d,!0)?null:d.getPreviousSourceNode(!0,g,h)):(d=f,d.type==CKEDITOR.NODE_ELEMENT&&((d=d.getChild(e))||(d=!1===h(f,!0)?null:f.getNextSourceNode(!0,g,h)))),d&&!1===h(d)&&(d=null));for(;d&&!this._.end;){this.current=d;if(!this.evaluator||!1!==this.evaluator(d)){if(!a)return d}else if(a&&this.evaluator)return!1;d=d[m](!1,g,h)}this.end();return this.current=null}function l(b){for(var c,d=null;c=a.call(this,b);)d=c;return d}CKEDITOR.dom.walker=
136
136
  CKEDITOR.tools.createClass({$:function(b){this.range=b;this._={}},proto:{end:function(){this._.end=1},next:function(){return a.call(this)},previous:function(){return a.call(this,1)},checkForward:function(){return!1!==a.call(this,0,1)},checkBackward:function(){return!1!==a.call(this,1,1)},lastForward:function(){return l.call(this)},lastBackward:function(){return l.call(this,1)},reset:function(){delete this.current;this._={}}}});var g={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,
137
137
  "table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},f={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(b){return"none"!=this.getComputedStyle("float")||this.getComputedStyle("position")in f||!g[this.getComputedStyle("display")]?!!(this.is(CKEDITOR.dtd.$block)||b&&this.is(b)):!0};CKEDITOR.dom.walker.blockBoundary=function(b){return function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary(b))}};CKEDITOR.dom.walker.listItemBoundary=
@@ -141,10 +141,10 @@ c=c.getNext(a),d=d.isBlockBoundary()&&(!c||c.type==CKEDITOR.NODE_ELEMENT&&c.isBl
141
141
  CKEDITOR.dom.walker.ignored=function(b){return function(a){a=m(a)||h(a)||k(a);return!!(b^a)}};var d=CKEDITOR.dom.walker.ignored();CKEDITOR.dom.walker.empty=function(b){return function(a){for(var c=0,f=a.getChildCount();c<f;++c)if(!d(a.getChild(c)))return!!b;return!b}};var b=CKEDITOR.dom.walker.empty(),n=CKEDITOR.dom.walker.validEmptyBlockContainers=CKEDITOR.tools.extend(function(b){var a={},c;for(c in b)CKEDITOR.dtd[c]["#"]&&(a[c]=1);return a}(CKEDITOR.dtd.$block),{caption:1,td:1,th:1});CKEDITOR.dom.walker.editable=
142
142
  function(a){return function(c){c=d(c)?!1:c.type==CKEDITOR.NODE_TEXT||c.type==CKEDITOR.NODE_ELEMENT&&(c.is(CKEDITOR.dtd.$inline)||c.is("hr")||"false"==c.getAttribute("contenteditable")||!CKEDITOR.env.needsBrFiller&&c.is(n)&&b(c))?!0:!1;return!!(a^c)}};CKEDITOR.dom.element.prototype.getBogus=function(){var b=this;do b=b.getPreviousSourceNode();while(c(b));return b&&(CKEDITOR.env.needsBrFiller?b.is&&b.is("br"):b.getText&&e.test(b.getText()))?b:!1}})();CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=
143
143
  this.startOffset=this.startContainer=null;this.collapsed=!0;var l=a instanceof CKEDITOR.dom.document;this.document=l?a:a.getDocument();this.root=l?a.getBody():a};(function(){function a(b){b.collapsed=b.startContainer&&b.endContainer&&b.startContainer.equals(b.endContainer)&&b.startOffset==b.endOffset}function l(b,a,c,d,f){function e(b,a,c,d){var h=c?b.getPrevious():b.getNext();if(d&&g)return h;l||d?a.append(b.clone(!0,f),c):(b.remove(),m&&a.append(b,c));return h}function h(){var b,a,c,d=Math.min(I.length,
144
- J.length);for(b=0;b<d;b++)if(a=I[b],c=J[b],!a.equals(c))return b;return b-1}function k(){var a=F-1,c=K&&H&&!w.equals(v);a<L-1||a<P-1||c?(c?b.moveToPosition(v,CKEDITOR.POSITION_BEFORE_START):P==a+1&&G?b.moveToPosition(J[a],CKEDITOR.POSITION_BEFORE_END):b.moveToPosition(J[a+1],CKEDITOR.POSITION_BEFORE_START),d&&(a=I[a+1])&&a.type==CKEDITOR.NODE_ELEMENT&&(c=CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e',b.document),c.insertAfter(a),
145
- a.mergeSiblings(!1),b.moveToBookmark({startNode:c}))):b.collapse(!0)}b.optimizeBookmark();var g=0===a,m=1==a,l=2==a;a=l||m;var w=b.startContainer,v=b.endContainer,D=b.startOffset,B=b.endOffset,C,G,K,H,E,M;if(l&&v.type==CKEDITOR.NODE_TEXT&&(w.equals(v)||w.type===CKEDITOR.NODE_ELEMENT&&w.getFirst().equals(v)))c.append(b.document.createText(v.substring(D,B)));else{v.type==CKEDITOR.NODE_TEXT?l?M=!0:v=v.split(B):0<v.getChildCount()?B>=v.getChildCount()?(v=v.getChild(B-1),G=!0):v=v.getChild(B):H=G=!0;w.type==
146
- CKEDITOR.NODE_TEXT?l?E=!0:w.split(D):0<w.getChildCount()?0===D?(w=w.getChild(D),C=!0):w=w.getChild(D-1):K=C=!0;for(var I=w.getParents(),J=v.getParents(),F=h(),L=I.length-1,P=J.length-1,N=c,Y,S,Z,ha=-1,W=F;W<=L;W++){S=I[W];Z=S.getNext();for(W!=L||S.equals(J[W])&&L<P?a&&(Y=N.append(S.clone(0,f))):C?e(S,N,!1,K):E&&N.append(b.document.createText(S.substring(D)));Z;){if(Z.equals(J[W])){ha=W;break}Z=e(Z,N)}N=Y}N=c;for(W=F;W<=P;W++)if(c=J[W],Z=c.getPrevious(),c.equals(I[W]))a&&(N=N.getChild(0));else{W!=
147
- P||c.equals(I[W])&&P<L?a&&(Y=N.append(c.clone(0,f))):G?e(c,N,!1,H):M&&N.append(b.document.createText(c.substring(0,B)));if(W>ha)for(;Z;)Z=e(Z,N,!0);N=Y}l||k()}}function g(){var b=!1,a=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(f){return c(f)||a(f)?!0:d(f)&&!b?b=!0:f.type==CKEDITOR.NODE_TEXT&&(f.hasAscendant("pre")||CKEDITOR.tools.trim(f.getText()).length)||f.type==CKEDITOR.NODE_ELEMENT&&!f.is(m)?!1:!0}}function f(b){var a=CKEDITOR.dom.walker.whitespaces(),
144
+ J.length);for(b=0;b<d;b++)if(a=I[b],c=J[b],!a.equals(c))return b;return b-1}function k(){var a=F-1,c=K&&H&&!w.equals(u);a<L-1||a<P-1||c?(c?b.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START):P==a+1&&G?b.moveToPosition(J[a],CKEDITOR.POSITION_BEFORE_END):b.moveToPosition(J[a+1],CKEDITOR.POSITION_BEFORE_START),d&&(a=I[a+1])&&a.type==CKEDITOR.NODE_ELEMENT&&(c=CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e',b.document),c.insertAfter(a),
145
+ a.mergeSiblings(!1),b.moveToBookmark({startNode:c}))):b.collapse(!0)}b.optimizeBookmark();var g=0===a,m=1==a,l=2==a;a=l||m;var w=b.startContainer,u=b.endContainer,D=b.startOffset,C=b.endOffset,A,G,K,H,E,M;if(l&&u.type==CKEDITOR.NODE_TEXT&&(w.equals(u)||w.type===CKEDITOR.NODE_ELEMENT&&w.getFirst().equals(u)))c.append(b.document.createText(u.substring(D,C)));else{u.type==CKEDITOR.NODE_TEXT?l?M=!0:u=u.split(C):0<u.getChildCount()?C>=u.getChildCount()?(u=u.getChild(C-1),G=!0):u=u.getChild(C):H=G=!0;w.type==
146
+ CKEDITOR.NODE_TEXT?l?E=!0:w.split(D):0<w.getChildCount()?0===D?(w=w.getChild(D),A=!0):w=w.getChild(D-1):K=A=!0;for(var I=w.getParents(),J=u.getParents(),F=h(),L=I.length-1,P=J.length-1,N=c,Y,S,Z,ha=-1,W=F;W<=L;W++){S=I[W];Z=S.getNext();for(W!=L||S.equals(J[W])&&L<P?a&&(Y=N.append(S.clone(0,f))):A?e(S,N,!1,K):E&&N.append(b.document.createText(S.substring(D)));Z;){if(Z.equals(J[W])){ha=W;break}Z=e(Z,N)}N=Y}N=c;for(W=F;W<=P;W++)if(c=J[W],Z=c.getPrevious(),c.equals(I[W]))a&&(N=N.getChild(0));else{W!=
147
+ P||c.equals(I[W])&&P<L?a&&(Y=N.append(c.clone(0,f))):G?e(c,N,!1,H):M&&N.append(b.document.createText(c.substring(0,C)));if(W>ha)for(;Z;)Z=e(Z,N,!0);N=Y}l||k()}}function g(){var b=!1,a=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(f){return c(f)||a(f)?!0:d(f)&&!b?b=!0:f.type==CKEDITOR.NODE_TEXT&&(f.hasAscendant("pre")||CKEDITOR.tools.trim(f.getText()).length)||f.type==CKEDITOR.NODE_ELEMENT&&!f.is(m)?!1:!0}}function f(b){var a=CKEDITOR.dom.walker.whitespaces(),
148
148
  c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||a(d)?!0:!b&&h(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function e(b){return function(){var a;return this[b?"getPreviousNode":"getNextNode"](function(b){!a&&d(b)&&(a=b);return c(b)&&!(h(b)&&b.equals(a))})}}var m={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},h=CKEDITOR.dom.walker.bogus(),
149
149
  k=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,c=CKEDITOR.dom.walker.editable(),d=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var b=new CKEDITOR.dom.range(this.root);b._setStartContainer(this.startContainer);b.startOffset=this.startOffset;b._setEndContainer(this.endContainer);b.endOffset=this.endOffset;b.collapsed=this.collapsed;return b},collapse:function(b){b?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),
150
150
  this.startOffset=this.endOffset);this.collapsed=!0},cloneContents:function(b){var a=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||l(this,2,a,!1,"undefined"==typeof b?!0:b);return a},deleteContents:function(b){this.collapsed||l(this,0,null,b)},extractContents:function(b,a){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||l(this,1,c,b,"undefined"==typeof a?!0:a);return c},equals:function(b){return this.startOffset===b.startOffset&&this.endOffset===b.endOffset&&
@@ -158,16 +158,16 @@ else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b);b=b.getNext
158
158
  this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return a&&!c.is?c.getParent():c},optimize:function(){var b=this.startContainer,a=this.startOffset;b.type!=CKEDITOR.NODE_ELEMENT&&(a?a>=b.getLength()&&this.setStartAfter(b):this.setStartBefore(b));b=this.endContainer;a=this.endOffset;b.type!=CKEDITOR.NODE_ELEMENT&&(a?a>=b.getLength()&&this.setEndAfter(b):this.setEndBefore(b))},optimizeBookmark:function(){var b=this.startContainer,a=this.endContainer;b.is&&b.is("span")&&
159
159
  b.data("cke-bookmark")&&this.setStartAt(b,CKEDITOR.POSITION_BEFORE_START);a&&a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setEndAt(a,CKEDITOR.POSITION_AFTER_END)},trim:function(b,a){var c=this.startContainer,d=this.startOffset,f=this.collapsed;if((!b||f)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength())d=c.getIndex()+1,c=c.getParent();else{var e=c.split(d),d=c.getIndex()+1,c=c.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(e,this.endOffset-this.startOffset):c.equals(this.endContainer)&&
160
160
  (this.endOffset+=1)}else d=c.getIndex(),c=c.getParent();this.setStart(c,d);if(f){this.collapse(!0);return}}c=this.endContainer;d=this.endOffset;a||f||!c||c.type!=CKEDITOR.NODE_TEXT||(d?(d>=c.getLength()||c.split(d),d=c.getIndex()+1):d=c.getIndex(),c=c.getParent(),this.setEnd(c,d))},enlarge:function(b,a){function c(b){return b&&b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable")?null:b}var d=new RegExp(/[^\s\ufeff]/);switch(b){case CKEDITOR.ENLARGE_INLINE:var f=1;case CKEDITOR.ENLARGE_ELEMENT:var e=
161
- function(b,a){var c=new CKEDITOR.dom.range(k);c.setStart(b,a);c.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),f;for(c.guard=function(b){return!(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary())};f=c.next();){if(f.type!=CKEDITOR.NODE_TEXT)return!1;C=f!=b?f.getText():f.substring(a);if(d.test(C))return!1}return!0};if(this.collapsed)break;var h=this.getCommonAncestor(),k=this.root,g,m,l,w,v,D=!1,B,C;B=this.startContainer;var G=this.startOffset;B.type==CKEDITOR.NODE_TEXT?
162
- (G&&(B=!CKEDITOR.tools.trim(B.substring(0,G)).length&&B,D=!!B),B&&((w=B.getPrevious())||(l=B.getParent()))):(G&&(w=B.getChild(G-1)||B.getLast()),w||(l=B));for(l=c(l);l||w;){if(l&&!w){!v&&l.equals(h)&&(v=!0);if(f?l.isBlockBoundary():!k.contains(l))break;D&&"inline"==l.getComputedStyle("display")||(D=!1,v?g=l:this.setStartBefore(l));w=l.getPrevious()}for(;w;)if(B=!1,w.type==CKEDITOR.NODE_COMMENT)w=w.getPrevious();else{if(w.type==CKEDITOR.NODE_TEXT)C=w.getText(),d.test(C)&&(w=null),B=/[\s\ufeff]$/.test(C);
163
- else if((w.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||a&&w.is("br"))&&!w.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[w.getName()]){C=w.getText();if(d.test(C))w=null;else for(var G=w.$.getElementsByTagName("*"),K=0,H;H=G[K++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){w=null;break}w&&(B=!!C.length)}else w=null;B&&(D?v?g=l:l&&this.setStartBefore(l):D=!0);if(w){B=w.getPrevious();if(!l&&!B){l=w;w=null;break}w=B}else l=null}l&&(l=c(l.getParent()))}B=this.endContainer;G=this.endOffset;
164
- l=w=null;v=D=!1;B.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(B.substring(G)).length?D=!0:(D=!B.getLength(),G==B.getLength()?(w=B.getNext())||(l=B.getParent()):e(B,G)&&(l=B.getParent())):(w=B.getChild(G))||(l=B);for(;l||w;){if(l&&!w){!v&&l.equals(h)&&(v=!0);if(f?l.isBlockBoundary():!k.contains(l))break;D&&"inline"==l.getComputedStyle("display")||(D=!1,v?m=l:l&&this.setEndAfter(l));w=l.getNext()}for(;w;){B=!1;if(w.type==CKEDITOR.NODE_TEXT)C=w.getText(),e(w,0)||(w=null),B=/^[\s\ufeff]/.test(C);else if(w.type==
165
- CKEDITOR.NODE_ELEMENT){if((0<w.$.offsetWidth||a&&w.is("br"))&&!w.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[w.getName()]){C=w.getText();if(d.test(C))w=null;else for(G=w.$.getElementsByTagName("*"),K=0;H=G[K++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){w=null;break}w&&(B=!!C.length)}else w=null}else B=1;B&&D&&(v?m=l:this.setEndAfter(l));if(w){B=w.getNext();if(!l&&!B){l=w;w=null;break}w=B}else l=null}l&&(l=c(l.getParent()))}g&&m&&(h=g.contains(m)?m:g,this.setStartBefore(h),
161
+ function(b,a){var c=new CKEDITOR.dom.range(k);c.setStart(b,a);c.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),f;for(c.guard=function(b){return!(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary())};f=c.next();){if(f.type!=CKEDITOR.NODE_TEXT)return!1;A=f!=b?f.getText():f.substring(a);if(d.test(A))return!1}return!0};if(this.collapsed)break;var h=this.getCommonAncestor(),k=this.root,g,m,l,w,u,D=!1,C,A;C=this.startContainer;var G=this.startOffset;C.type==CKEDITOR.NODE_TEXT?
162
+ (G&&(C=!CKEDITOR.tools.trim(C.substring(0,G)).length&&C,D=!!C),C&&((w=C.getPrevious())||(l=C.getParent()))):(G&&(w=C.getChild(G-1)||C.getLast()),w||(l=C));for(l=c(l);l||w;){if(l&&!w){!u&&l.equals(h)&&(u=!0);if(f?l.isBlockBoundary():!k.contains(l))break;D&&"inline"==l.getComputedStyle("display")||(D=!1,u?g=l:this.setStartBefore(l));w=l.getPrevious()}for(;w;)if(C=!1,w.type==CKEDITOR.NODE_COMMENT)w=w.getPrevious();else{if(w.type==CKEDITOR.NODE_TEXT)A=w.getText(),d.test(A)&&(w=null),C=/[\s\ufeff]$/.test(A);
163
+ else if((w.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||a&&w.is("br"))&&!w.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[w.getName()]){A=w.getText();if(d.test(A))w=null;else for(var G=w.$.getElementsByTagName("*"),K=0,H;H=G[K++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){w=null;break}w&&(C=!!A.length)}else w=null;C&&(D?u?g=l:l&&this.setStartBefore(l):D=!0);if(w){C=w.getPrevious();if(!l&&!C){l=w;w=null;break}w=C}else l=null}l&&(l=c(l.getParent()))}C=this.endContainer;G=this.endOffset;
164
+ l=w=null;u=D=!1;C.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(C.substring(G)).length?D=!0:(D=!C.getLength(),G==C.getLength()?(w=C.getNext())||(l=C.getParent()):e(C,G)&&(l=C.getParent())):(w=C.getChild(G))||(l=C);for(;l||w;){if(l&&!w){!u&&l.equals(h)&&(u=!0);if(f?l.isBlockBoundary():!k.contains(l))break;D&&"inline"==l.getComputedStyle("display")||(D=!1,u?m=l:l&&this.setEndAfter(l));w=l.getNext()}for(;w;){C=!1;if(w.type==CKEDITOR.NODE_TEXT)A=w.getText(),e(w,0)||(w=null),C=/^[\s\ufeff]/.test(A);else if(w.type==
165
+ CKEDITOR.NODE_ELEMENT){if((0<w.$.offsetWidth||a&&w.is("br"))&&!w.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[w.getName()]){A=w.getText();if(d.test(A))w=null;else for(G=w.$.getElementsByTagName("*"),K=0;H=G[K++];)if(!CKEDITOR.dtd.$removeEmpty[H.nodeName.toLowerCase()]){w=null;break}w&&(C=!!A.length)}else w=null}else C=1;C&&D&&(u?m=l:this.setEndAfter(l));if(w){C=w.getNext();if(!l&&!C){l=w;w=null;break}w=C}else l=null}l&&(l=c(l.getParent()))}g&&m&&(h=g.contains(m)?m:g,this.setStartBefore(h),
166
166
  this.setEndAfter(h));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:l=new CKEDITOR.dom.range(this.root);k=this.root;l.setStartAt(k,CKEDITOR.POSITION_AFTER_START);l.setEnd(this.startContainer,this.startOffset);l=new CKEDITOR.dom.walker(l);var E,M,I=CKEDITOR.dom.walker.blockBoundary(b==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),J=null,F=function(b){if(b.type==CKEDITOR.NODE_ELEMENT&&"false"==b.getAttribute("contenteditable"))if(J){if(J.equals(b)){J=null;return}}else J=
167
167
  b;else if(J)return;var a=I(b);a||(E=b);return a},f=function(b){var a=F(b);!a&&b.is&&b.is("br")&&(M=b);return a};l.guard=F;l=l.lastBackward();E=E||k;this.setStartAt(E,!E.is("br")&&(!l&&this.checkStartOfBlock()||l&&E.contains(l))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(b==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){l=this.clone();l=new CKEDITOR.dom.walker(l);var L=CKEDITOR.dom.walker.whitespaces(),P=CKEDITOR.dom.walker.bookmark();l.evaluator=function(b){return!L(b)&&!P(b)};if((l=l.previous())&&
168
168
  l.type==CKEDITOR.NODE_ELEMENT&&l.is("br"))break}l=this.clone();l.collapse();l.setEndAt(k,CKEDITOR.POSITION_BEFORE_END);l=new CKEDITOR.dom.walker(l);l.guard=b==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?f:F;E=J=M=null;l=l.lastForward();E=E||k;this.setEndAt(E,!l&&this.checkEndOfBlock()||l&&E.contains(l)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);M&&this.setEndAfter(M)}},shrink:function(b,a,c){var d="boolean"===typeof c?c:c&&"boolean"===typeof c.shrinkOnBlockBoundary?c.shrinkOnBlockBoundary:
169
- !0,f=c&&c.skipBogus;if(!this.collapsed){b=b||CKEDITOR.SHRINK_TEXT;var e=this.clone(),h=this.startContainer,k=this.endContainer,g=this.startOffset,m=this.endOffset,l=c=1;h&&h.type==CKEDITOR.NODE_TEXT&&(g?g>=h.getLength()?e.setStartAfter(h):(e.setStartBefore(h),c=0):e.setStartBefore(h));k&&k.type==CKEDITOR.NODE_TEXT&&(m?m>=k.getLength()?e.setEndAfter(k):(e.setEndAfter(k),l=0):e.setEndBefore(k));var e=new CKEDITOR.dom.walker(e),w=CKEDITOR.dom.walker.bookmark(),v=CKEDITOR.dom.walker.bogus();e.evaluator=
170
- function(a){return a.type==(b==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var D;e.guard=function(a,c){if(f&&v(a)||w(a))return!0;if(b==CKEDITOR.SHRINK_ELEMENT&&a.type==CKEDITOR.NODE_TEXT||c&&a.equals(D)||!1===d&&a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary()||a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable"))return!1;c||a.type!=CKEDITOR.NODE_ELEMENT||(D=a);return!0};c&&(h=e[b==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(h,a?CKEDITOR.POSITION_AFTER_START:
169
+ !0,f=c&&c.skipBogus;if(!this.collapsed){b=b||CKEDITOR.SHRINK_TEXT;var e=this.clone(),h=this.startContainer,k=this.endContainer,g=this.startOffset,m=this.endOffset,l=c=1;h&&h.type==CKEDITOR.NODE_TEXT&&(g?g>=h.getLength()?e.setStartAfter(h):(e.setStartBefore(h),c=0):e.setStartBefore(h));k&&k.type==CKEDITOR.NODE_TEXT&&(m?m>=k.getLength()?e.setEndAfter(k):(e.setEndAfter(k),l=0):e.setEndBefore(k));var e=new CKEDITOR.dom.walker(e),w=CKEDITOR.dom.walker.bookmark(),u=CKEDITOR.dom.walker.bogus();e.evaluator=
170
+ function(a){return a.type==(b==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var D;e.guard=function(a,c){if(f&&u(a)||w(a))return!0;if(b==CKEDITOR.SHRINK_ELEMENT&&a.type==CKEDITOR.NODE_TEXT||c&&a.equals(D)||!1===d&&a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary()||a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable"))return!1;c||a.type!=CKEDITOR.NODE_ELEMENT||(D=a);return!0};c&&(h=e[b==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(h,a?CKEDITOR.POSITION_AFTER_START:
171
171
  CKEDITOR.POSITION_BEFORE_START);l&&(e.reset(),(e=e[b==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(e,a?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END));return!(!c&&!l)}},insertNode:function(b){this.optimizeBookmark();this.trim(!1,!0);var a=this.startContainer,c=a.getChild(this.startOffset);c?b.insertBefore(c):a.append(b);b.getParent()&&b.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(b)},moveToPosition:function(b,a){this.setStartAt(b,
172
172
  a);this.collapse(!0)},moveToRange:function(b){this.setStart(b.startContainer,b.startOffset);this.setEnd(b.endContainer,b.endOffset)},selectNodeContents:function(b){this.setStart(b,0);this.setEnd(b,b.type==CKEDITOR.NODE_TEXT?b.getLength():b.getChildCount())},setStart:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex(),b=b.getParent());this._setStartContainer(b);this.startOffset=c;this.endContainer||(this._setEndContainer(b),this.endOffset=c);a(this)},setEnd:function(b,
173
173
  c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex()+1,b=b.getParent());this._setEndContainer(b);this.endOffset=c;this.startContainer||(this._setStartContainer(b),this.startOffset=c);a(this)},setStartAfter:function(b){this.setStart(b.getParent(),b.getIndex()+1)},setStartBefore:function(b){this.setStart(b.getParent(),b.getIndex())},setEndAfter:function(b){this.setEnd(b.getParent(),b.getIndex()+1)},setEndBefore:function(b){this.setEnd(b.getParent(),b.getIndex())},setStartAt:function(b,
@@ -179,8 +179,8 @@ this.moveToPosition(b,CKEDITOR.POSITION_AFTER_END);return d},removeEmptyBlocksAt
179
179
  "setStartAt"](f,CKEDITOR.POSITION_AFTER_END),f.remove(1),f=e;this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(b,a){var c=a==CKEDITOR.START,d=this.clone();d.collapse(c);d[c?"setStartAt":"setEndAt"](b,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=f(c);return d[c?
180
180
  "checkBackward":"checkForward"]()},checkStartOfBlock:function(){var b=this.startContainer,a=this.startOffset;CKEDITOR.env.ie&&a&&b.type==CKEDITOR.NODE_TEXT&&(b=CKEDITOR.tools.ltrim(b.substring(0,a)),k.test(b)&&this.trim(0,1));this.trim();b=new CKEDITOR.dom.elementPath(this.startContainer,this.root);a=this.clone();a.collapse(!0);a.setStartAt(b.block||b.blockLimit,CKEDITOR.POSITION_AFTER_START);b=new CKEDITOR.dom.walker(a);b.evaluator=g();return b.checkBackward()},checkEndOfBlock:function(){var b=this.endContainer,
181
181
  a=this.endOffset;CKEDITOR.env.ie&&b.type==CKEDITOR.NODE_TEXT&&(b=CKEDITOR.tools.rtrim(b.substring(a)),k.test(b)&&this.trim(1,0));this.trim();b=new CKEDITOR.dom.elementPath(this.endContainer,this.root);a=this.clone();a.collapse(!1);a.setEndAt(b.block||b.blockLimit,CKEDITOR.POSITION_BEFORE_END);b=new CKEDITOR.dom.walker(a);b.evaluator=g();return b.checkForward()},getPreviousNode:function(b,a,c){var d=this.clone();d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);
182
- c.evaluator=b;c.guard=a;return c.previous()},getNextNode:function(b,a,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=b;c.guard=a;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type==CKEDITOR.NODE_ELEMENT){if("false"==b.getAttribute("contentEditable")&&!b.data("cke-editable"))return 0;if(b.is("html")||"true"==b.getAttribute("contentEditable")&&(b.contains(c)||b.equals(c)))break}b=b.getParent()}return 1}
183
- return function(){var c=this.startContainer,d=this.endContainer;return!(a(c,d)&&a(d,c))}}(),moveToElementEditablePosition:function(b,a){if(b.type==CKEDITOR.NODE_ELEMENT&&!b.isEditable(!1))return this.moveToPosition(b,a?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var c=0;b;){if(b.type==CKEDITOR.NODE_TEXT){a&&this.endContainer&&this.checkEndOfBlock()&&k.test(b.getText())?this.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(b,a?CKEDITOR.POSITION_AFTER_END:
182
+ c.evaluator=b;c.guard=a;return c.previous()},getNextNode:function(b,a,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=b;c.guard=a;return c.next()},checkReadOnly:function(){function b(b,a){for(;b;){if(b.type==CKEDITOR.NODE_ELEMENT){if("false"==b.getAttribute("contentEditable")&&!b.data("cke-editable"))return 0;if(b.is("html")||"true"==b.getAttribute("contentEditable")&&(b.contains(a)||b.equals(a)))break}b=b.getParent()}return 1}
183
+ return function(){var a=this.startContainer,c=this.endContainer;return!(b(a,c)&&b(c,a))}}(),moveToElementEditablePosition:function(b,a){if(b.type==CKEDITOR.NODE_ELEMENT&&!b.isEditable(!1))return this.moveToPosition(b,a?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var c=0;b;){if(b.type==CKEDITOR.NODE_TEXT){a&&this.endContainer&&this.checkEndOfBlock()&&k.test(b.getText())?this.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(b,a?CKEDITOR.POSITION_AFTER_END:
184
184
  CKEDITOR.POSITION_BEFORE_START);c=1;break}if(b.type==CKEDITOR.NODE_ELEMENT)if(b.isEditable())this.moveToPosition(b,a?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),c=1;else if(a&&b.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START);else if("false"==b.getAttribute("contenteditable")&&b.is(CKEDITOR.dtd.$block))return this.setStartBefore(b),this.setEndAfter(b),!0;var f=b,e=c,h=void 0;f.type==CKEDITOR.NODE_ELEMENT&&f.isEditable(!1)&&
185
185
  (h=f[a?"getLast":"getFirst"](d));e||h||(h=f[a?"getPrevious":"getNext"](d));b=h}return!!c},moveToClosestEditablePosition:function(a,c){var d,f=0,e,h,k=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(d=new CKEDITOR.dom.range(this.root),d.moveToPosition(a,k[c?0:1])):d=this.clone();if(a&&!a.is(CKEDITOR.dtd.$block))f=1;else if(e=d[c?"getNextEditableNode":"getPreviousEditableNode"]())f=1,(h=e.type==CKEDITOR.NODE_ELEMENT)&&e.is(CKEDITOR.dtd.$block)&&"false"==e.getAttribute("contenteditable")?
186
186
  (d.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),d.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&h&&e.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(d.setEnd(e,0),d.collapse()):d.moveToPosition(e,k[c?1:0]);f&&this.moveToRange(d);return!!f},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=
@@ -197,52 +197,52 @@ c){var d=this.getCommonAncestor(),f=this.getBoundaryNodes(),e=[],h,k,g,m;if(d&&d
197
197
  b.enlarge(CKEDITOR.ENLARGE_ELEMENT);if(c){var f=new CKEDITOR.dom.range(b.root),d=new CKEDITOR.dom.walker(f),e=CKEDITOR.dom.walker.whitespaces();f.setStart(c.endContainer,c.endOffset);f.setEnd(b.startContainer,b.startOffset);for(f=d.next();e(f)||b.endContainer.equals(f);)f=d.next();d=!f}d?c.setEnd(b.endContainer,b.endOffset):a.push(b);return a},[])}})();CKEDITOR.POSITION_AFTER_START=1;CKEDITOR.POSITION_BEFORE_END=2;CKEDITOR.POSITION_BEFORE_START=3;CKEDITOR.POSITION_AFTER_END=4;CKEDITOR.ENLARGE_ELEMENT=
198
198
  1;CKEDITOR.ENLARGE_BLOCK_CONTENTS=2;CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3;CKEDITOR.ENLARGE_INLINE=4;CKEDITOR.START=1;CKEDITOR.END=2;CKEDITOR.SHRINK_ELEMENT=1;CKEDITOR.SHRINK_TEXT=2;"use strict";(function(){function a(a){1>arguments.length||(this.range=a,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function l(a){var b=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function g(a,b,c,f){a:{null==
199
199
  f&&(f=l(c));for(var e;e=f.shift();)if(e.getDtd().p){f={element:e,remaining:f};break a}f=null}if(!f)return 0;if((e=CKEDITOR.filter.instances[f.element.data("cke-filter")])&&!e.check(b))return g(a,b,c,f.remaining);b=new CKEDITOR.dom.range(f.element);b.selectNodeContents(f.element);b=b.createIterator();b.enlargeBr=a.enlargeBr;b.enforceRealBlocks=a.enforceRealBlocks;b.activeFilter=b.filter=e;a._.nestedEditable={element:f.element,container:c,remaining:f.remaining,iterator:b};return 1}function f(a,b,c){if(!b)return!1;
200
- a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),h=CKEDITOR.dom.walker.whitespaces(!0),k=function(a){return m(a)&&h(a)},c={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var b,h,l,u,p;a=a||"p";if(this._.nestedEditable){if(b=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,b;this.activeFilter=this.filter;if(g(this,a,
201
- this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable=null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var t=this.range.clone();h=t.startPath();var q=t.endPath(),y=!t.collapsed&&f(t,h.block),x=!t.collapsed&&f(t,q.block,1);t.shrink(CKEDITOR.SHRINK_ELEMENT,!0);y&&t.setStartAt(h.block,CKEDITOR.POSITION_BEFORE_END);x&&t.setEndAt(q.block,
202
- CKEDITOR.POSITION_AFTER_START);h=t.endContainer.hasAscendant("pre",!0)||t.startContainer.hasAscendant("pre",!0);t.enlarge(this.forceBrBreak&&!h||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);t.collapsed||(h=new CKEDITOR.dom.walker(t.clone()),q=CKEDITOR.dom.walker.bookmark(!0,!0),h.evaluator=q,this._.nextNode=h.next(),h=new CKEDITOR.dom.walker(t.clone()),h.evaluator=q,h=h.previous(),this._.lastNode=h.getNextSourceNode(!0,null,t.root),this._.lastNode&&this._.lastNode.type==
203
- CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(q=this.range.clone(),q.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),q.checkEndOfBlock()&&(q=new CKEDITOR.dom.elementPath(q.endContainer,q.root),this._.lastNode=(q.block||q.blockLimit).getNextSourceNode(!0))),this._.lastNode&&t.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=t.document.createText(""),this._.lastNode.insertAfter(h)),t=null);this._.started=
204
- 1;h=t}q=this._.nextNode;t=this._.lastNode;for(this._.nextNode=null;q;){var y=0,x=q.hasAscendant("pre"),z=q.type!=CKEDITOR.NODE_ELEMENT,A=0;if(z)q.type==CKEDITOR.NODE_TEXT&&e.test(q.getText())&&(z=0);else{var w=q.getName();if(CKEDITOR.dtd.$block[w]&&"false"==q.getAttribute("contenteditable")){b=q;g(this,a,b);break}else if(q.isBlockBoundary(this.forceBrBreak&&!x&&{br:1})){if("br"==w)z=1;else if(!h&&!q.getChildCount()&&"hr"!=w){b=q;l=q.equals(t);break}h&&(h.setEndAt(q,CKEDITOR.POSITION_BEFORE_START),
205
- "br"!=w&&(this._.nextNode=q));y=1}else{if(q.getFirst()){h||(h=this.range.clone(),h.setStartAt(q,CKEDITOR.POSITION_BEFORE_START));q=q.getFirst();continue}z=1}}z&&!h&&(h=this.range.clone(),h.setStartAt(q,CKEDITOR.POSITION_BEFORE_START));l=(!y||z)&&q.equals(t);if(h&&!y)for(;!q.getNext(k)&&!l;){w=q.getParent();if(w.isBlockBoundary(this.forceBrBreak&&!x&&{br:1})){y=1;z=0;l||w.equals(t);h.setEndAt(w,CKEDITOR.POSITION_BEFORE_END);break}q=w;z=1;l=q.equals(t);A=1}z&&h.setEndAt(q,CKEDITOR.POSITION_AFTER_END);
206
- q=this._getNextSourceNode(q,A,t);if((l=!q)||y&&h)break}if(!b){if(!h)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;b=new CKEDITOR.dom.elementPath(h.startContainer,h.root);q=b.blockLimit;y={div:1,th:1,td:1};b=b.block;!b&&q&&!this.enforceRealBlocks&&y[q.getName()]&&h.checkStartOfBlock()&&h.checkEndOfBlock()&&!q.equals(h.root)?b=q:!b||this.enforceRealBlocks&&b.is(c)?(b=this.range.document.createElement(a),h.extractContents().appendTo(b),b.trim(),h.insertNode(b),u=p=!0):
207
- "li"!=b.getName()?h.checkStartOfBlock()&&h.checkEndOfBlock()||(b=b.clone(!1),h.extractContents().appendTo(b),b.trim(),p=h.splitBlock(),u=!p.wasStartOfBlock,p=!p.wasEndOfBlock,h.insertNode(b)):l||(this._.nextNode=b.equals(t)?null:this._getNextSourceNode(h.getBoundaryNodes().endNode,1,t))}u&&(u=b.getPrevious())&&u.type==CKEDITOR.NODE_ELEMENT&&("br"==u.getName()?u.remove():u.getLast()&&"br"==u.getLast().$.nodeName.toLowerCase()&&u.getLast().remove());p&&(u=b.getLast())&&u.type==CKEDITOR.NODE_ELEMENT&&
208
- "br"==u.getName()&&(!CKEDITOR.env.needsBrFiller||u.getPrevious(m)||u.getNext(m))&&u.remove();this._.nextNode||(this._.nextNode=l||b.equals(t)||!t?null:this._getNextSourceNode(b,1,t));return b},_getNextSourceNode:function(a,b,c){function f(a){return!(a.equals(c)||a.equals(e))}var e=this.range.root;for(a=a.getNextSourceNode(b,null,f);!m(a);)a=a.getNextSourceNode(b,null,f);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();CKEDITOR.command=function(a,l){this.uiItems=
200
+ a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),h=CKEDITOR.dom.walker.whitespaces(!0),k=function(a){return m(a)&&h(a)},c={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var b,h,l,q,v;a=a||"p";if(this._.nestedEditable){if(b=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,b;this.activeFilter=this.filter;if(g(this,a,
201
+ this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable=null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var r=this.range.clone();h=r.startPath();var t=r.endPath(),y=!r.collapsed&&f(r,h.block),x=!r.collapsed&&f(r,t.block,1);r.shrink(CKEDITOR.SHRINK_ELEMENT,!0);y&&r.setStartAt(h.block,CKEDITOR.POSITION_BEFORE_END);x&&r.setEndAt(t.block,
202
+ CKEDITOR.POSITION_AFTER_START);h=r.endContainer.hasAscendant("pre",!0)||r.startContainer.hasAscendant("pre",!0);r.enlarge(this.forceBrBreak&&!h||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);r.collapsed||(h=new CKEDITOR.dom.walker(r.clone()),t=CKEDITOR.dom.walker.bookmark(!0,!0),h.evaluator=t,this._.nextNode=h.next(),h=new CKEDITOR.dom.walker(r.clone()),h.evaluator=t,h=h.previous(),this._.lastNode=h.getNextSourceNode(!0,null,r.root),this._.lastNode&&this._.lastNode.type==
203
+ CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(t=this.range.clone(),t.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),t.checkEndOfBlock()&&(t=new CKEDITOR.dom.elementPath(t.endContainer,t.root),this._.lastNode=(t.block||t.blockLimit).getNextSourceNode(!0))),this._.lastNode&&r.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=r.document.createText(""),this._.lastNode.insertAfter(h)),r=null);this._.started=
204
+ 1;h=r}t=this._.nextNode;r=this._.lastNode;for(this._.nextNode=null;t;){var y=0,x=t.hasAscendant("pre"),z=t.type!=CKEDITOR.NODE_ELEMENT,B=0;if(z)t.type==CKEDITOR.NODE_TEXT&&e.test(t.getText())&&(z=0);else{var w=t.getName();if(CKEDITOR.dtd.$block[w]&&"false"==t.getAttribute("contenteditable")){b=t;g(this,a,b);break}else if(t.isBlockBoundary(this.forceBrBreak&&!x&&{br:1})){if("br"==w)z=1;else if(!h&&!t.getChildCount()&&"hr"!=w){b=t;l=t.equals(r);break}h&&(h.setEndAt(t,CKEDITOR.POSITION_BEFORE_START),
205
+ "br"!=w&&(this._.nextNode=t));y=1}else{if(t.getFirst()){h||(h=this.range.clone(),h.setStartAt(t,CKEDITOR.POSITION_BEFORE_START));t=t.getFirst();continue}z=1}}z&&!h&&(h=this.range.clone(),h.setStartAt(t,CKEDITOR.POSITION_BEFORE_START));l=(!y||z)&&t.equals(r);if(h&&!y)for(;!t.getNext(k)&&!l;){w=t.getParent();if(w.isBlockBoundary(this.forceBrBreak&&!x&&{br:1})){y=1;z=0;l||w.equals(r);h.setEndAt(w,CKEDITOR.POSITION_BEFORE_END);break}t=w;z=1;l=t.equals(r);B=1}z&&h.setEndAt(t,CKEDITOR.POSITION_AFTER_END);
206
+ t=this._getNextSourceNode(t,B,r);if((l=!t)||y&&h)break}if(!b){if(!h)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;b=new CKEDITOR.dom.elementPath(h.startContainer,h.root);t=b.blockLimit;y={div:1,th:1,td:1};b=b.block;!b&&t&&!this.enforceRealBlocks&&y[t.getName()]&&h.checkStartOfBlock()&&h.checkEndOfBlock()&&!t.equals(h.root)?b=t:!b||this.enforceRealBlocks&&b.is(c)?(b=this.range.document.createElement(a),h.extractContents().appendTo(b),b.trim(),h.insertNode(b),q=v=!0):
207
+ "li"!=b.getName()?h.checkStartOfBlock()&&h.checkEndOfBlock()||(b=b.clone(!1),h.extractContents().appendTo(b),b.trim(),v=h.splitBlock(),q=!v.wasStartOfBlock,v=!v.wasEndOfBlock,h.insertNode(b)):l||(this._.nextNode=b.equals(r)?null:this._getNextSourceNode(h.getBoundaryNodes().endNode,1,r))}q&&(q=b.getPrevious())&&q.type==CKEDITOR.NODE_ELEMENT&&("br"==q.getName()?q.remove():q.getLast()&&"br"==q.getLast().$.nodeName.toLowerCase()&&q.getLast().remove());v&&(q=b.getLast())&&q.type==CKEDITOR.NODE_ELEMENT&&
208
+ "br"==q.getName()&&(!CKEDITOR.env.needsBrFiller||q.getPrevious(m)||q.getNext(m))&&q.remove();this._.nextNode||(this._.nextNode=l||b.equals(r)||!r?null:this._getNextSourceNode(b,1,r));return b},_getNextSourceNode:function(a,b,c){function f(a){return!(a.equals(c)||a.equals(e))}var e=this.range.root;for(a=a.getNextSourceNode(b,null,f);!m(a);)a=a.getNextSourceNode(b,null,f);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();CKEDITOR.command=function(a,l){this.uiItems=
209
209
  [];this.exec=function(f){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&a.focus();return!1===this.fire("exec")?!0:!1!==l.exec.call(this,a,f)};this.refresh=function(a,e){if(!this.readOnly&&a.readOnly)return!0;if(this.context&&!e.isContextFor(this.context)||!this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&this.disable();return!1===this.fire("refresh",{editor:a,path:e})?!0:l.refresh&&!1!==l.refresh.apply(this,
210
210
  arguments)};var g;this.checkAllowed=function(f){return f||"boolean"!=typeof g?g=a.activeFilter.checkFeature(this):g};CKEDITOR.tools.extend(this,l,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!l.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},
211
211
  setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=a;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,
212
212
  language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:999999,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};(function(){function a(a,b,c,d,f){var e,k;a=[];for(e in b){k=b[e];k="boolean"==
213
- typeof k?{}:"function"==typeof k?{match:k}:K(k);"$"!=e.charAt(0)&&(k.elements=e);c&&(k.featureName=c.toLowerCase());var g=k;g.elements=h(g.elements,/\s+/)||null;g.propertiesOnly=g.propertiesOnly||!0===g.elements;var m=/\s*,\s*/,l=void 0;for(l in M){g[l]=h(g[l],m)||null;var n=g,w=I[l],q=h(g[I[l]],m),v=g[l],F=[],P=!0,r=void 0;q?P=!1:q={};for(r in v)"!"==r.charAt(0)&&(r=r.slice(1),F.push(r),q[r]=!0,P=!1);for(;r=F.pop();)v[r]=v["!"+r],delete v["!"+r];n[w]=(P?!1:q)||null}g.match=g.match||null;d.push(k);
214
- a.push(k)}b=f.elements;f=f.generic;var D;c=0;for(d=a.length;c<d;++c){e=K(a[c]);k=!0===e.classes||!0===e.styles||!0===e.attributes;g=e;l=w=m=void 0;for(m in M)g[m]=y(g[m]);n=!0;for(l in I){m=I[l];w=g[m];q=[];v=void 0;for(v in w)-1<v.indexOf("*")?q.push(new RegExp("^"+v.replace(/\*/g,".*")+"$")):q.push(v);w=q;w.length&&(g[m]=w,n=!1)}g.nothingRequired=n;g.noProperties=!(g.attributes||g.classes||g.styles);if(!0===e.elements||null===e.elements)f[k?"unshift":"push"](e);else for(D in g=e.elements,delete e.elements,
213
+ typeof k?{}:"function"==typeof k?{match:k}:K(k);"$"!=e.charAt(0)&&(k.elements=e);c&&(k.featureName=c.toLowerCase());var g=k;g.elements=h(g.elements,/\s+/)||null;g.propertiesOnly=g.propertiesOnly||!0===g.elements;var m=/\s*,\s*/,l=void 0;for(l in M){g[l]=h(g[l],m)||null;var n=g,w=I[l],t=h(g[I[l]],m),u=g[l],F=[],P=!0,p=void 0;t?P=!1:t={};for(p in u)"!"==p.charAt(0)&&(p=p.slice(1),F.push(p),t[p]=!0,P=!1);for(;p=F.pop();)u[p]=u["!"+p],delete u["!"+p];n[w]=(P?!1:t)||null}g.match=g.match||null;d.push(k);
214
+ a.push(k)}b=f.elements;f=f.generic;var D;c=0;for(d=a.length;c<d;++c){e=K(a[c]);k=!0===e.classes||!0===e.styles||!0===e.attributes;g=e;l=w=m=void 0;for(m in M)g[m]=y(g[m]);n=!0;for(l in I){m=I[l];w=g[m];t=[];u=void 0;for(u in w)-1<u.indexOf("*")?t.push(new RegExp("^"+u.replace(/\*/g,".*")+"$")):t.push(u);w=t;w.length&&(g[m]=w,n=!1)}g.nothingRequired=n;g.noProperties=!(g.attributes||g.classes||g.styles);if(!0===e.elements||null===e.elements)f[k?"unshift":"push"](e);else for(D in g=e.elements,delete e.elements,
215
215
  g)if(b[D])b[D][k?"unshift":"push"](e);else b[D]=[e]}}function l(a,b,c,d){if(!a.match||a.match(b))if(d||k(a,b))if(a.propertiesOnly||(c.valid=!0),c.allAttributes||(c.allAttributes=g(a.attributes,b.attributes,c.validAttributes)),c.allStyles||(c.allStyles=g(a.styles,b.styles,c.validStyles)),!c.allClasses){a=a.classes;b=b.classes;d=c.validClasses;if(a)if(!0===a)a=!0;else{for(var f=0,e=b.length,h;f<e;++f)h=b[f],d[h]||(d[h]=a(h));a=!1}else a=!1;c.allClasses=a}}function g(a,b,c){if(!a)return!1;if(!0===a)return!0;
216
216
  for(var d in b)c[d]||(c[d]=a(d));return!1}function f(a,b,c){if(!a.match||a.match(b)){if(a.noProperties)return!1;c.hadInvalidAttribute=e(a.attributes,b.attributes)||c.hadInvalidAttribute;c.hadInvalidStyle=e(a.styles,b.styles)||c.hadInvalidStyle;a=a.classes;b=b.classes;if(a){for(var d=!1,f=!0===a,h=b.length;h--;)if(f||a(b[h]))b.splice(h,1),d=!0;a=d}else a=!1;c.hadInvalidClass=a||c.hadInvalidClass}}function e(a,b){if(!a)return!1;var c=!1,d=!0===a,f;for(f in b)if(d||a(f))delete b[f],c=!0;return c}function m(a,
217
217
  b,c){if(a.disabled||a.customConfig&&!c||!b)return!1;a._.cachedChecks={};return!0}function h(a,b){if(!a)return!1;if(!0===a)return a;if("string"==typeof a)return a=H(a),"*"==a?!0:CKEDITOR.tools.convertArrayToObject(a.split(b));if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):!1;var c={},d=0,f;for(f in a)c[f]=a[f],d++;return d?c:!1}function k(a,b){if(a.nothingRequired)return!0;var d,f,e,h;if(e=a.requiredClasses)for(h=b.classes,d=0;d<e.length;++d)if(f=e[d],"string"==
218
218
  typeof f){if(-1==CKEDITOR.tools.indexOf(h,f))return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(h,f))return!1;return c(b.styles,a.requiredStyles)&&c(b.attributes,a.requiredAttributes)}function c(a,b){if(!b)return!0;for(var c=0,d;c<b.length;++c)if(d=b[c],"string"==typeof d){if(!(d in a))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return!1;return!0}function d(a){if(!a)return{};a=a.split(/\s*,\s*/).sort();for(var b={};a.length;)b[a.shift()]="cke-test";return b}function b(a){var b,
219
- c,d,f,e={},h=1;for(a=H(a);b=a.match(J);)(c=b[2])?(d=n(c,"styles"),f=n(c,"attrs"),c=n(c,"classes")):d=f=c=null,e["$"+h++]={elements:b[1],classes:c,styles:d,attributes:f},a=a.slice(b[0].length);return e}function n(a,b){var c=a.match(F[b]);return c?H(c[1]):null}function r(a){var b=a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];a.styles||(a.styles=CKEDITOR.tools.parseCssText(b||"",1));a.classes||(a.classes=c?c.split(/\s+/):[])}function u(a,b,c,d){var e=0,h;d.toHtml&&(b.name=b.name.replace(L,
220
- "$1"));if(d.doCallbacks&&a.elementCallbacks){a:{h=a.elementCallbacks;for(var k=0,g=h.length,m;k<g;++k)if(m=h[k](b)){h=m;break a}h=void 0}if(h)return h}if(d.doTransform&&(h=a._.transformations[b.name])){r(b);for(k=0;k<h.length;++k)w(a,b,h[k]);t(b)}if(d.doFilter){a:{k=b.name;g=a._;a=g.allowedRules.elements[k];h=g.allowedRules.generic;k=g.disallowedRules.elements[k];g=g.disallowedRules.generic;m=d.skipRequired;var n={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,
221
- allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},v,F;if(a||h){r(b);if(k)for(v=0,F=k.length;v<F;++v)if(!1===f(k[v],b,n)){a=null;break a}if(g)for(v=0,F=g.length;v<F;++v)f(g[v],b,n);if(a)for(v=0,F=a.length;v<F;++v)l(a[v],b,n,m);if(h)for(v=0,F=h.length;v<F;++v)l(h[v],b,n,m);a=n}else a=null}if(!a||!a.valid)return c.push(b),1;F=a.validAttributes;var y=a.validStyles;h=a.validClasses;var k=b.attributes,D=b.styles,g=b.classes;m=b.classBackup;var x=b.styleBackup,H,G,B=[],n=[],u=/^data-cke-/;
222
- v=!1;delete k.style;delete k["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(H in k)F[H]||(u.test(H)?H==(G=H.replace(/^data-cke-saved-/,""))||F[G]||(delete k[H],v=!0):(delete k[H],v=!0));if(!a.allStyles||a.hadInvalidStyle){for(H in D)a.allStyles||y[H]?B.push(H+":"+D[H]):v=!0;B.length&&(k.style=B.sort().join("; "))}else x&&(k.style=x);if(!a.allClasses||a.hadInvalidClass){for(H=0;H<g.length;++H)(a.allClasses||h[g[H]])&&n.push(g[H]);n.length&&(k["class"]=n.sort().join(" "));
223
- m&&n.length<m.split(/\s+/).length&&(v=!0)}else m&&(k["class"]=m);v&&(e=1);if(!d.skipFinalValidation&&!q(b))return c.push(b),1}d.toHtml&&(b.name=b.name.replace(P,"cke:$1"));return e}function p(a){var b=[],c;for(c in a)-1<c.indexOf("*")&&b.push(c.replace(/\*/g,".*"));return b.length?new RegExp("^(?:"+b.join("|")+")$"):null}function t(a){var b=a.attributes,c;delete b.style;delete b["class"];if(c=CKEDITOR.tools.writeCssText(a.styles,!0))b.style=c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}
224
- function q(a){switch(a.name){case "a":if(!(a.children.length||a.attributes.name||a.attributes.id))return!1;break;case "img":if(!a.attributes.src)return!1}return!0}function y(a){if(!a)return!1;if(!0===a)return!0;var b=p(a);return function(c){return c in a||b&&c.match(b)}}function x(){return new CKEDITOR.htmlParser.element("br")}function z(a){return a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.name||G.$block[a.name])}function A(a,b,c){var d=a.name;if(G.$empty[d]||!a.children.length)"hr"==d&&"br"==b?a.replaceWith(x()):
219
+ c,d,f,e={},h=1;for(a=H(a);b=a.match(J);)(c=b[2])?(d=n(c,"styles"),f=n(c,"attrs"),c=n(c,"classes")):d=f=c=null,e["$"+h++]={elements:b[1],classes:c,styles:d,attributes:f},a=a.slice(b[0].length);return e}function n(a,b){var c=a.match(F[b]);return c?H(c[1]):null}function p(a){var b=a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];a.styles||(a.styles=CKEDITOR.tools.parseCssText(b||"",1));a.classes||(a.classes=c?c.split(/\s+/):[])}function q(a,b,c,d){var e=0,h;d.toHtml&&(b.name=b.name.replace(L,
220
+ "$1"));if(d.doCallbacks&&a.elementCallbacks){a:{h=a.elementCallbacks;for(var k=0,g=h.length,m;k<g;++k)if(m=h[k](b)){h=m;break a}h=void 0}if(h)return h}if(d.doTransform&&(h=a._.transformations[b.name])){p(b);for(k=0;k<h.length;++k)w(a,b,h[k]);r(b)}if(d.doFilter){a:{k=b.name;g=a._;a=g.allowedRules.elements[k];h=g.allowedRules.generic;k=g.disallowedRules.elements[k];g=g.disallowedRules.generic;m=d.skipRequired;var n={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,
221
+ allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1},u,F;if(a||h){p(b);if(k)for(u=0,F=k.length;u<F;++u)if(!1===f(k[u],b,n)){a=null;break a}if(g)for(u=0,F=g.length;u<F;++u)f(g[u],b,n);if(a)for(u=0,F=a.length;u<F;++u)l(a[u],b,n,m);if(h)for(u=0,F=h.length;u<F;++u)l(h[u],b,n,m);a=n}else a=null}if(!a||!a.valid)return c.push(b),1;F=a.validAttributes;var y=a.validStyles;h=a.validClasses;var k=b.attributes,D=b.styles,g=b.classes;m=b.classBackup;var x=b.styleBackup,H,G,C=[],n=[],q=/^data-cke-/;
222
+ u=!1;delete k.style;delete k["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(H in k)F[H]||(q.test(H)?H==(G=H.replace(/^data-cke-saved-/,""))||F[G]||(delete k[H],u=!0):(delete k[H],u=!0));if(!a.allStyles||a.hadInvalidStyle){for(H in D)a.allStyles||y[H]?C.push(H+":"+D[H]):u=!0;C.length&&(k.style=C.sort().join("; "))}else x&&(k.style=x);if(!a.allClasses||a.hadInvalidClass){for(H=0;H<g.length;++H)(a.allClasses||h[g[H]])&&n.push(g[H]);n.length&&(k["class"]=n.sort().join(" "));
223
+ m&&n.length<m.split(/\s+/).length&&(u=!0)}else m&&(k["class"]=m);u&&(e=1);if(!d.skipFinalValidation&&!t(b))return c.push(b),1}d.toHtml&&(b.name=b.name.replace(P,"cke:$1"));return e}function v(a){var b=[],c;for(c in a)-1<c.indexOf("*")&&b.push(c.replace(/\*/g,".*"));return b.length?new RegExp("^(?:"+b.join("|")+")$"):null}function r(a){var b=a.attributes,c;delete b.style;delete b["class"];if(c=CKEDITOR.tools.writeCssText(a.styles,!0))b.style=c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}
224
+ function t(a){switch(a.name){case "a":if(!(a.children.length||a.attributes.name||a.attributes.id))return!1;break;case "img":if(!a.attributes.src)return!1}return!0}function y(a){if(!a)return!1;if(!0===a)return!0;var b=v(a);return function(c){return c in a||b&&c.match(b)}}function x(){return new CKEDITOR.htmlParser.element("br")}function z(a){return a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.name||G.$block[a.name])}function B(a,b,c){var d=a.name;if(G.$empty[d]||!a.children.length)"hr"==d&&"br"==b?a.replaceWith(x()):
225
225
  (a.parent&&c.push({check:"it",el:a.parent}),a.remove());else if(G.$block[d]||"tr"==d)if("br"==b)a.previous&&!z(a.previous)&&(b=x(),b.insertBefore(a)),a.next&&!z(a.next)&&(b=x(),b.insertAfter(a)),a.replaceWithChildren();else{var d=a.children,f;b:{f=G[b];for(var e=0,h=d.length,k;e<h;++e)if(k=d[e],k.type==CKEDITOR.NODE_ELEMENT&&!f[k.name]){f=!1;break b}f=!0}if(f)a.name=b,a.attributes={},c.push({check:"parent-down",el:a});else{f=a.parent;for(var e=f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||"body"==f.name,
226
226
  g,m,h=d.length;0<h;)k=d[--h],e&&(k.type==CKEDITOR.NODE_TEXT||k.type==CKEDITOR.NODE_ELEMENT&&G.$inline[k.name])?(g||(g=new CKEDITOR.htmlParser.element(b),g.insertAfter(a),c.push({check:"parent-down",el:g})),g.add(k,0)):(g=null,m=G[f.name]||G.span,k.insertAfter(a),f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||k.type!=CKEDITOR.NODE_ELEMENT||m[k.name]||c.push({check:"el-up",el:k}));a.remove()}}else d in{style:1,script:1}?a.remove():(a.parent&&c.push({check:"it",el:a.parent}),a.replaceWithChildren())}function w(a,
227
- b,c){var d,f;for(d=0;d<c.length;++d)if(f=c[d],!(f.check&&!a.check(f.check,!1)||f.left&&!f.left(b))){f.right(b,N);break}}function v(a,b){var c=b.getDefinition(),d=c.attributes,f=c.styles,e,h,k,g;if(a.name!=c.element)return!1;for(e in d)if("class"==e)for(c=d[e].split(/\s+/),k=a.classes.join("|");g=c.pop();){if(-1==k.indexOf(g))return!1}else if(a.attributes[e]!=d[e])return!1;for(h in f)if(a.styles[h]!=f[h])return!1;return!0}function D(a,b){var c,d;"string"==typeof a?c=a:a instanceof CKEDITOR.style?d=
228
- a:(c=a[0],d=a[1]);return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function B(a){return function(b){return v(b,a)}}function C(a){return function(b,c){c[a](b)}}var G=CKEDITOR.dtd,K=CKEDITOR.tools.copy,H=CKEDITOR.tools.trim,E=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a,b){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=!1;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},
227
+ b,c){var d,f;for(d=0;d<c.length;++d)if(f=c[d],!(f.check&&!a.check(f.check,!1)||f.left&&!f.left(b))){f.right(b,N);break}}function u(a,b){var c=b.getDefinition(),d=c.attributes,f=c.styles,e,h,k,g;if(a.name!=c.element)return!1;for(e in d)if("class"==e)for(c=d[e].split(/\s+/),k=a.classes.join("|");g=c.pop();){if(-1==k.indexOf(g))return!1}else if(a.attributes[e]!=d[e])return!1;for(h in f)if(a.styles[h]!=f[h])return!1;return!0}function D(a,b){var c,d;"string"==typeof a?c=a:a instanceof CKEDITOR.style?d=
228
+ a:(c=a[0],d=a[1]);return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function C(a){return function(b){return u(b,a)}}function A(a){return function(b,c){c[a](b)}}var G=CKEDITOR.dtd,K=CKEDITOR.tools.copy,H=CKEDITOR.tools.trim,E=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a,b){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=!1;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},
229
229
  generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{},cachedChecks:{}};CKEDITOR.filter.instances[this.id]=this;var c=this.editor=a instanceof CKEDITOR.editor?a:null;if(c&&!b){this.customConfig=!0;var d=c.config.allowedContent;!0===d?this.disabled=!0:(d||(this.customConfig=!1),this.allow(d,"config",1),this.allow(c.config.extraAllowedContent,"extra",1),this.allow(E[c.enterMode]+" "+E[c.shiftEnterMode],"default",1),this.disallow(c.config.disallowedContent))}else this.customConfig=
230
230
  !1,this.allow(b||a,"default",1)};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(c,d,f){if(!m(this,c,f))return!1;var e,h;if("string"==typeof c)c=b(c);else if(c instanceof CKEDITOR.style){if(c.toAllowedContentRules)return this.allow(c.toAllowedContentRules(this.editor),d,f);e=c.getDefinition();c={};f=e.attributes;c[e.element]=e={styles:e.styles,requiredStyles:e.styles&&CKEDITOR.tools.object.keys(e.styles)};f&&(f=K(f),e.classes=f["class"]?f["class"].split(/\s+/):null,e.requiredClasses=
231
231
  e.classes,delete f["class"],e.attributes=f,e.requiredAttributes=f&&CKEDITOR.tools.object.keys(f))}else if(CKEDITOR.tools.isArray(c)){for(e=0;e<c.length;++e)h=this.allow(c[e],d,f);return h}a(this,c,d,this.allowedContent,this._.allowedRules);return!0},applyTo:function(a,b,c,d){if(this.disabled)return!1;var f=this,e=[],h=this.editor&&this.editor.config.protectedSource,k,g=!1,m={doFilter:!c,doTransform:!0,doCallbacks:!0,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if("off"==a.attributes["data-cke-filter"])return!1;
232
- if(!b||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(k=u(f,a,e,m),k&1)g=!0;else if(k&2)return!1}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var l,n,w;if(h)for(n=0;n<h.length;++n)if((w=d.match(h[n]))&&w[0].length==d.length){c=!0;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);1==d.children.length&&(l=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&
233
- u(f,l,c,m);c=!c.length}c||e.push(a)}},null,!0);e.length&&(g=!0);var l;a=[];d=E[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];for(var n;c=e.pop();)c.type==CKEDITOR.NODE_ELEMENT?A(c,d,a):c.remove();for(;l=a.pop();)if(c=l.el,c.parent)switch(n=G[c.parent.name]||G.span,l.check){case "it":G.$removeEmpty[c.name]&&!c.children.length?A(c,d,a):q(c)||A(c,d,a);break;case "el-up":c.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||n[c.name]||A(c,d,a);break;case "parent-down":c.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||
234
- n[c.name]||A(c.parent,d,a)}return g},checkFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=!0},disallow:function(c){if(!m(this,c,!0))return!1;"string"==typeof c&&(c=b(c));a(this,c,null,this.disallowedContent,this._.disallowedRules);return!0},addContentForms:function(a){if(!this.disabled&&a){var b,c,d=[],f;for(b=0;b<a.length&&!f;++b)c=a[b],("string"==typeof c||c instanceof
232
+ if(!b||"span"!=a.name||!~CKEDITOR.tools.object.keys(a.attributes).join("|").indexOf("data-cke-"))if(k=q(f,a,e,m),k&1)g=!0;else if(k&2)return!1}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var l,n,w;if(h)for(n=0;n<h.length;++n)if((w=d.match(h[n]))&&w[0].length==d.length){c=!0;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);1==d.children.length&&(l=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&
233
+ q(f,l,c,m);c=!c.length}c||e.push(a)}},null,!0);e.length&&(g=!0);var l;a=[];d=E[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];for(var n;c=e.pop();)c.type==CKEDITOR.NODE_ELEMENT?B(c,d,a):c.remove();for(;l=a.pop();)if(c=l.el,c.parent)switch(n=G[c.parent.name]||G.span,l.check){case "it":G.$removeEmpty[c.name]&&!c.children.length?B(c,d,a):t(c)||B(c,d,a);break;case "el-up":c.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||n[c.name]||B(c,d,a);break;case "parent-down":c.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||
234
+ n[c.name]||B(c.parent,d,a)}return g},checkFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=!0},disallow:function(c){if(!m(this,c,!0))return!1;"string"==typeof c&&(c=b(c));a(this,c,null,this.disallowedContent,this._.disallowedRules);return!0},addContentForms:function(a){if(!this.disabled&&a){var b,c,d=[],f;for(b=0;b<a.length&&!f;++b)c=a[b],("string"==typeof c||c instanceof
235
235
  CKEDITOR.style)&&this.check(c)&&(f=c);if(f){for(b=0;b<a.length;++b)d.push(D(a[b],f));this.addTransformations(d)}}},addElementCallback:function(a){this.elementCallbacks||(this.elementCallbacks=[]);this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return!0;a.toFeature&&(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?
236
- this.check(a.requiredContent):!0},addTransformations:function(a){var b,c;if(!this.disabled&&a){var d=this._.transformations,f;for(f=0;f<a.length;++f){b=a[f];var e=void 0,h=void 0,k=void 0,g=void 0,m=void 0,l=void 0;c=[];for(h=0;h<b.length;++h)k=b[h],"string"==typeof k?(k=k.split(/\s*:\s*/),g=k[0],m=null,l=k[1]):(g=k.check,m=k.left,l=k.right),e||(e=k,e=e.element?e.element:g?g.match(/^([a-z0-9]+)/i)[0]:e.left.getDefinition().element),m instanceof CKEDITOR.style&&(m=B(m)),c.push({check:g==e?null:g,left:m,
237
- right:"string"==typeof l?C(l):l});b=e;d[b]||(d[b]=[]);d[b].push(c)}}},check:function(a,c,f){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(a)){for(var e=a.length;e--;)if(this.check(a[e],c,f))return!0;return!1}var h,k;if("string"==typeof a){k=a+"\x3c"+(!1===c?"0":"1")+(f?"1":"0")+"\x3e";if(k in this._.cachedChecks)return this._.cachedChecks[k];h=b(a).$1;var g=h.styles,e=h.classes;h.name=h.elements;h.classes=e=e?e.split(/\s*,\s*/):[];h.styles=d(g);h.attributes=d(h.attributes);h.children=[];e.length&&
238
- (h.attributes["class"]=e.join(" "));g&&(h.attributes.style=CKEDITOR.tools.writeCssText(h.styles))}else h=a.getDefinition(),g=h.styles,e=h.attributes||{},g&&!CKEDITOR.tools.isEmpty(g)?(g=K(g),e.style=CKEDITOR.tools.writeCssText(g,!0)):g={},h={name:h.element,attributes:e,classes:e["class"]?e["class"].split(/\s+/):[],styles:g,children:[]};var g=CKEDITOR.tools.clone(h),m=[],l;if(!1!==c&&(l=this._.transformations[h.name])){for(e=0;e<l.length;++e)w(this,h,l[e]);t(h)}u(this,g,m,{doFilter:!0,doTransform:!1!==
236
+ this.check(a.requiredContent):!0},addTransformations:function(a){var b,c;if(!this.disabled&&a){var d=this._.transformations,f;for(f=0;f<a.length;++f){b=a[f];var e=void 0,h=void 0,k=void 0,g=void 0,m=void 0,l=void 0;c=[];for(h=0;h<b.length;++h)k=b[h],"string"==typeof k?(k=k.split(/\s*:\s*/),g=k[0],m=null,l=k[1]):(g=k.check,m=k.left,l=k.right),e||(e=k,e=e.element?e.element:g?g.match(/^([a-z0-9]+)/i)[0]:e.left.getDefinition().element),m instanceof CKEDITOR.style&&(m=C(m)),c.push({check:g==e?null:g,left:m,
237
+ right:"string"==typeof l?A(l):l});b=e;d[b]||(d[b]=[]);d[b].push(c)}}},check:function(a,c,f){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(a)){for(var e=a.length;e--;)if(this.check(a[e],c,f))return!0;return!1}var h,k;if("string"==typeof a){k=a+"\x3c"+(!1===c?"0":"1")+(f?"1":"0")+"\x3e";if(k in this._.cachedChecks)return this._.cachedChecks[k];h=b(a).$1;var g=h.styles,e=h.classes;h.name=h.elements;h.classes=e=e?e.split(/\s*,\s*/):[];h.styles=d(g);h.attributes=d(h.attributes);h.children=[];e.length&&
238
+ (h.attributes["class"]=e.join(" "));g&&(h.attributes.style=CKEDITOR.tools.writeCssText(h.styles))}else h=a.getDefinition(),g=h.styles,e=h.attributes||{},g&&!CKEDITOR.tools.isEmpty(g)?(g=K(g),e.style=CKEDITOR.tools.writeCssText(g,!0)):g={},h={name:h.element,attributes:e,classes:e["class"]?e["class"].split(/\s+/):[],styles:g,children:[]};var g=CKEDITOR.tools.clone(h),m=[],l;if(!1!==c&&(l=this._.transformations[h.name])){for(e=0;e<l.length;++e)w(this,h,l[e]);r(h)}q(this,g,m,{doFilter:!0,doTransform:!1!==
239
239
  c,skipRequired:!f,skipFinalValidation:!f});0<m.length?f=!1:((c=h.attributes["class"])&&(h.attributes["class"]=h.attributes["class"].split(" ").sort().join(" ")),f=CKEDITOR.tools.objectCompare(h.attributes,g.attributes,!0),c&&(h.attributes["class"]=c));"string"==typeof a&&(this._.cachedChecks[k]=f);return f},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(c,d){var f=a.slice(),e;if(this.check(E[c]))return c;for(d||
240
240
  (f=f.reverse());e=f.pop();)if(this.check(e))return b[e];return CKEDITOR.ENTER_BR}}(),clone:function(){var a=new CKEDITOR.filter,b=CKEDITOR.tools.clone;a.allowedContent=b(this.allowedContent);a._.allowedRules=b(this._.allowedRules);a.disallowedContent=b(this.disallowedContent);a._.disallowedRules=b(this._.disallowedRules);a._.transformations=b(this._.transformations);a.disabled=this.disabled;a.editor=this.editor;return a},destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;
241
241
  delete this.disallowedContent}};var M={styles:1,attributes:1,classes:1},I={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},J=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,F={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},L=/^cke:(object|embed|param)$/,P=/^(object|embed|param)$/,N;N=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,
242
242
  "height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,c){c=c||b;if(!(c in a.styles)){var d=a.attributes[b];d&&(/^\d+$/.test(d)&&(d+="px"),a.styles[c]=d)}delete a.attributes[b]},lengthToAttribute:function(a,b,c){c=c||b;if(!(c in a.attributes)){var d=a.styles[b],f=d&&d.match(/^(\d+)(?:\.\d*)?px$/);f?a.attributes[c]=f[1]:"cke-test"==d&&(a.attributes[c]="cke-test")}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in
243
243
  a.styles)){var b=a.attributes.align;if("left"==b||"right"==b)a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var b=a.styles["float"];if("left"==b||"right"==b)a.attributes.align=b}delete a.styles["float"]},splitBorderShorthand:function(a){if(a.styles.border){var b=CKEDITOR.tools.style.parse.border(a.styles.border);b.color&&(a.styles["border-color"]=b.color);b.style&&(a.styles["border-style"]=b.style);b.width&&(a.styles["border-width"]=b.width);
244
244
  delete a.styles.border}},listTypeToStyle:function(a){if(a.attributes.type)switch(a.attributes.type){case "a":a.styles["list-style-type"]="lower-alpha";break;case "A":a.styles["list-style-type"]="upper-alpha";break;case "i":a.styles["list-style-type"]="lower-roman";break;case "I":a.styles["list-style-type"]="upper-roman";break;case "1":a.styles["list-style-type"]="decimal";break;default:a.styles["list-style-type"]=a.attributes.type}},splitMarginShorthand:function(a){function b(d){a.styles["margin-top"]=
245
- c[d[0]];a.styles["margin-right"]=c[d[1]];a.styles["margin-bottom"]=c[d[2]];a.styles["margin-left"]=c[d[3]]}if(a.styles.margin){var c=a.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(c.length){case 1:b([0,0,0,0]);break;case 2:b([0,1,0,1]);break;case 3:b([0,1,2,1]);break;case 4:b([0,1,2,3])}delete a.styles.margin}},matchesStyle:v,transform:function(a,b){if("string"==typeof b)a.name=b;else{var c=b.getDefinition(),d=c.styles,f=c.attributes,e,h,k,g;a.name=c.element;for(e in f)if("class"==e)for(c=
245
+ c[d[0]];a.styles["margin-right"]=c[d[1]];a.styles["margin-bottom"]=c[d[2]];a.styles["margin-left"]=c[d[3]]}if(a.styles.margin){var c=a.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(c.length){case 1:b([0,0,0,0]);break;case 2:b([0,1,0,1]);break;case 3:b([0,1,2,1]);break;case 4:b([0,1,2,3])}delete a.styles.margin}},matchesStyle:u,transform:function(a,b){if("string"==typeof b)a.name=b;else{var c=b.getDefinition(),d=c.styles,f=c.attributes,e,h,k,g;a.name=c.element;for(e in f)if("class"==e)for(c=
246
246
  a.classes.join("|"),k=f[e].split(/\s+/);g=k.pop();)-1==c.indexOf(g)&&a.classes.push(g);else a.attributes[e]=f[e];for(h in d)a.styles[h]=d[h]}}}})();(function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=!1;this.currentActive=null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);a&&(this.currentActive=a);this.hasFocus||this._.locked||((a=CKEDITOR.currentInstance)&&
247
247
  a.focusManager.blur(1),this.hasFocus=!0,(a=this._.editor.container)&&a.addClass("cke_focus"),this._.editor.fire("focus"))},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(a){function l(){if(this.hasFocus){this.hasFocus=!1;var a=this._.editor.container;a&&a.removeClass("cke_focus");this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var g=CKEDITOR.focusManager._.blurDelay;a||!g?l.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;
248
248
  l.call(this)},g,this)}},add:function(a,l){var g=a.getCustomData("focusmanager");if(!g||g!=this){g&&g.remove(a);var g="focus",f="blur";l&&(CKEDITOR.env.ie?(g="focusin",f="focusout"):CKEDITOR.event.useCapture=1);var e={blur:function(){a.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(a)}};a.on(g,e.focus,this);a.on(f,e.blur,this);l&&(CKEDITOR.event.useCapture=0);a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",e)}},remove:function(a){a.removeCustomData("focusmanager");
@@ -250,35 +250,35 @@ var l=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",l.blur
250
250
  a&&f.preventDefault(!0);return!a},g=function(f){a&&(a=!1,f.data.preventDefault(!0))};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",l,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",g,this)}}})();(function(){CKEDITOR.lang={languages:{af:1,ar:1,az:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,
251
251
  ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,oc:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,l,g){a&&CKEDITOR.lang.languages[a]||(a=this.detect(l,a));var f=this;l=function(){f[a].dir=f.rtl[a]?"rtl":"ltr";g(a,f[a])};this[a]?l():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),l,this)},detect:function(a,l){var g=this.languages;l=l||navigator.userLanguage||navigator.language||
252
252
  a;var f=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=f[1],f=f[2];g[e+"-"+f]?e=e+"-"+f:g[e]||(e=null);CKEDITOR.lang.detect=e?function(){return e}:function(a){return a};return e||a}}})();CKEDITOR.scriptLoader=function(){var a={},l={};return{load:function(g,f,e,m){var h="string"==typeof g;h&&(g=[g]);e||(e=CKEDITOR);var k=g.length,c=[],d=[],b=function(a){f&&(h?f.call(e,a):f.call(e,c,d))};if(0===k)b(!0);else{var n=function(a,f){(f?c:d).push(a);0>=--k&&(m&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),
253
- b(f))},r=function(b,c){a[b]=1;var d=l[b];delete l[b];for(var f=0;f<d.length;f++)d[f](b,c)},u=function(b){if(a[b])n(b,!0);else{var c=l[b]||(l[b]=[]);c.push(n);if(!(1<c.length)){var d=new CKEDITOR.dom.element("script");d.setAttributes({type:"text/javascript",src:b});f&&(CKEDITOR.env.ie&&(8>=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?d.$.onreadystatechange=function(){if("loaded"==d.$.readyState||"complete"==d.$.readyState)d.$.onreadystatechange=null,r(b,!0)}:(d.$.onload=function(){setTimeout(function(){d.$.onload=
254
- null;d.$.onerror=null;r(b,!0)},0)},d.$.onerror=function(){d.$.onload=null;d.$.onerror=null;r(b,!1)}));d.appendTo(CKEDITOR.document.getHead())}}};m&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var p=0;p<k;p++)u(g[p])}},queue:function(){function a(){var e;(e=f[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var f=[];return function(e,m){var h=this;f.push({scriptUrl:e,callback:function(){m&&m.apply(this,arguments);f.shift();a.call(h)}});1==f.length&&a.call(this)}}()}}();CKEDITOR.resourceManager=
253
+ b(f))},p=function(b,c){a[b]=1;var d=l[b];delete l[b];for(var f=0;f<d.length;f++)d[f](b,c)},q=function(b){if(a[b])n(b,!0);else{var c=l[b]||(l[b]=[]);c.push(n);if(!(1<c.length)){var d=new CKEDITOR.dom.element("script");d.setAttributes({type:"text/javascript",src:b});f&&(CKEDITOR.env.ie&&(8>=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?d.$.onreadystatechange=function(){if("loaded"==d.$.readyState||"complete"==d.$.readyState)d.$.onreadystatechange=null,p(b,!0)}:(d.$.onload=function(){setTimeout(function(){d.$.onload=
254
+ null;d.$.onerror=null;p(b,!0)},0)},d.$.onerror=function(){d.$.onload=null;d.$.onerror=null;p(b,!1)}));d.appendTo(CKEDITOR.document.getHead())}}};m&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var v=0;v<k;v++)q(g[v])}},queue:function(){function a(){var e;(e=f[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var f=[];return function(e,m){var h=this;f.push({scriptUrl:e,callback:function(){m&&m.apply(this,arguments);f.shift();a.call(h)}});1==f.length&&a.call(this)}}()}}();CKEDITOR.resourceManager=
255
255
  function(a,l){this.basePath=a;this.fileName=l;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}};CKEDITOR.resourceManager.prototype={add:function(a,l){if(this.registered[a])throw Error('[CKEDITOR.resourceManager.add] The resource name "'+a+'" is already registered.');var g=this.registered[a]=l||{};g.name=a;g.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",g);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var l=
256
256
  this.externals[a];return CKEDITOR.getUrl(l&&l.dir||this.basePath+a+"/")},getFilePath:function(a){var l=this.externals[a];return CKEDITOR.getUrl(this.getPath(a)+(l?l.file:this.fileName+".js"))},addExternal:function(a,l,g){g||(l=l.replace(/[^\/]+$/,function(a){g=a;return""}));g=g||this.fileName+".js";a=a.split(",");for(var f=0;f<a.length;f++)this.externals[a[f]]={dir:l,file:g}},load:function(a,l,g){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var f=this.loaded,e=this.registered,m=[],h={},k={},c=0;c<
257
257
  a.length;c++){var d=a[c];if(d)if(f[d]||e[d])k[d]=this.get(d);else{var b=this.getFilePath(d);m.push(b);b in h||(h[b]=[]);h[b].push(d)}}CKEDITOR.scriptLoader.load(m,function(a,b){if(b.length)throw Error('[CKEDITOR.resourceManager.load] Resource name "'+h[b[0]].join(",")+'" was not found at "'+b[0]+'".');for(var c=0;c<a.length;c++)for(var d=h[a[c]],e=0;e<d.length;e++){var m=d[e];k[m]=this.get(m);f[m]=1}l.call(g,k)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");CKEDITOR.plugins.load=
258
- CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var l={};return function(g,f,e){var m={},h=function(k){a.call(this,k,function(a){CKEDITOR.tools.extend(m,a);var d=[],b;for(b in a){var k=a[b],g=k&&k.requires;if(!l[b]){if(k.icons)for(var u=k.icons.split(","),p=u.length;p--;)CKEDITOR.skin.addIcon(u[p],k.path+"icons/"+(CKEDITOR.env.hidpi&&k.hidpi?"hidpi/":"")+u[p]+".png");k.isSupportedEnvironment=k.isSupportedEnvironment||function(){return!0};l[b]=1}if(g)for(g.split&&(g=g.split(",")),k=0;k<g.length;k++)m[g[k]]||
258
+ CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var l={};return function(g,f,e){var m={},h=function(k){a.call(this,k,function(a){CKEDITOR.tools.extend(m,a);var d=[],b;for(b in a){var k=a[b],g=k&&k.requires;if(!l[b]){if(k.icons)for(var q=k.icons.split(","),v=q.length;v--;)CKEDITOR.skin.addIcon(q[v],k.path+"icons/"+(CKEDITOR.env.hidpi&&k.hidpi?"hidpi/":"")+q[v]+".png");k.isSupportedEnvironment=k.isSupportedEnvironment||function(){return!0};l[b]=1}if(g)for(g.split&&(g=g.split(",")),k=0;k<g.length;k++)m[g[k]]||
259
259
  d.push(g[k])}if(d.length)h.call(this,d);else{for(b in m)k=m[b],k.onLoad&&!k.onLoad._called&&(!1===k.onLoad()&&delete m[b],k.onLoad._called=1);f&&f.call(e||window,m)}},this)};h.call(this,g)}});CKEDITOR.plugins.setLang=function(a,l,g){var f=this.get(a);a=f.langEntries||(f.langEntries={});f=f.lang||(f.lang=[]);f.split&&(f=f.split(","));-1==CKEDITOR.tools.indexOf(f,l)&&f.push(l);a[l]=g};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};
260
260
  CKEDITOR.ui.prototype={add:function(a,l,g){g.name=a.toLowerCase();var f=this.items[a]={type:l,command:g.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(f,g)},get:function(a){return this.instances[a]},create:function(a){var l=this.items[a],g=l&&this._.handlers[l.type],f=l&&l.command&&this.editor.getCommand(l.command),g=g&&g.create.apply(this,l.args);this.instances[a]=g;f&&f.uiItems.push(g);g&&!g.type&&(g.type=l.type);return g},addHandler:function(a,l){this._.handlers[a]=
261
261
  l},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}};CKEDITOR.event.implementOn(CKEDITOR.ui);(function(){function a(a,b,c){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(void 0!==b){if(!(b instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!c)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&c==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");
262
262
  if(!g(b,c))throw Error('The specified element mode is not supported on element: "'+b.getName()+'".');this.element=b;this.elementMode=c;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(b.getId()||b.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||l();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);this.focusManager=
263
263
  new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",f);this.on("selectionChange",function(a){m(this,a.data.path)});this.on("activeFilterChange",function(){m(this,this.elementPath(),!0)});this.on("mode",f);CKEDITOR.dom.selection.setupEditorOptimization(this);this.on("instanceReady",function(){if(this.config.startupFocus){if("end"===this.config.startupFocus){var a=this.createRange();a.selectNodeContents(this.editable());a.shrink(CKEDITOR.SHRINK_ELEMENT,
264
- !0);a.collapse();this.getSelection().selectRanges([a])}this.focus()}});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){this.isDestroyed()||this.isDetached()||k(this,a)},0,this)}function l(){do var a="editor"+ ++p;while(CKEDITOR.instances[a]);return a}function g(a,b){return b==CKEDITOR.ELEMENT_MODE_INLINE?a.is(CKEDITOR.dtd.$editable)||a.is("textarea"):b==CKEDITOR.ELEMENT_MODE_REPLACE?!a.is(CKEDITOR.dtd.$nonBodyContent):1}function f(){var a=this.commands,
265
- b;for(b in a)e(this,a[b])}function e(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function m(a,b,c){if(b){var d,f,e=a.commands;for(f in e)d=e[f],(c||d.contextSensitive)&&d.refresh(a,b)}}function h(a){var b=a.config.customConfig;if(!b)return!1;var b=CKEDITOR.getUrl(b),c=t[b]||(t[b]={});c.fn?(c.fn.call(a,a.config),CKEDITOR.getUrl(a.config.customConfig)!=b&&h(a)||a.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(b,function(){c.fn=
264
+ !0);a.collapse();this.getSelection().selectRanges([a])}this.focus()}});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){this.isDestroyed()||this.isDetached()||k(this,a)},0,this)}function l(){do var a="editor"+ ++v;while(CKEDITOR.instances[a]);return a}function g(a,b){return b==CKEDITOR.ELEMENT_MODE_INLINE?a.is(CKEDITOR.dtd.$editable)||a.is("textarea"):b==CKEDITOR.ELEMENT_MODE_REPLACE?!a.is(CKEDITOR.dtd.$nonBodyContent):1}function f(){var a=this.commands,
265
+ b;for(b in a)e(this,a[b])}function e(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function m(a,b,c){if(b){var d,f,e=a.commands;for(f in e)d=e[f],(c||d.contextSensitive)&&d.refresh(a,b)}}function h(a){var b=a.config.customConfig;if(!b)return!1;var b=CKEDITOR.getUrl(b),c=r[b]||(r[b]={});c.fn?(c.fn.call(a,a.config),CKEDITOR.getUrl(a.config.customConfig)!=b&&h(a)||a.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(b,function(){c.fn=
266
266
  CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};h(a)});return!0}function k(a,b){a.on("customConfigLoaded",function(){if(b){if(b.on)for(var d in b.on)a.on(d,b.on[d]);CKEDITOR.tools.extend(a.config,b,!0);delete a.config.on}d=a.config;a.readOnly=d.readOnly?!0:a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled")||a.element.hasAttribute("readonly"):a.element.isReadOnly():a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?a.element.hasAttribute("disabled")||
267
267
  a.element.hasAttribute("readonly"):!1;a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):!1;a.tabIndex=d.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:d.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:d.shiftEnterMode;d.skin&&(CKEDITOR.skinName=d.skin);a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);
268
268
  a.filter=a.activeFilter=new CKEDITOR.filter(a);c(a)});b&&null!=b.customConfig&&(a.config.customConfig=b.customConfig);h(a)||a.fireOnce("customConfigLoaded")}function c(a){CKEDITOR.skin.loadPart("editor",function(){d(a)})}function d(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(c,d){var f=a.config.title;a.langCode=c;a.lang=CKEDITOR.tools.prototypedCopy(d);a.title="string"==typeof f||!1===f?f:[a.lang.editor,a.name].join(", ");a.config.contentsLangDirection||(a.config.contentsLangDirection=
269
269
  a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir);a.fire("langLoaded");b(a)})}function b(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);n(a)})}function n(a){function b(a){if(!a)return"";CKEDITOR.tools.isArray(a)&&(a=a.join(","));return a.replace(/\s/g,"")}var c=a.config,d=b(c.plugins),f=b(c.extraPlugins),e=b(c.removePlugins);if(f)var h=new RegExp("(?:^|,)(?:"+f.replace(/,/g,"|")+")(?\x3d,|$)","g"),d=d.replace(h,
270
- ""),d=d+(","+f);if(e)var k=new RegExp("(?:^|,)(?:"+e.replace(/,/g,"|")+")(?\x3d,|$)","g"),d=d.replace(k,"");CKEDITOR.env.air&&(d+=",adobeair");CKEDITOR.plugins.load(d.split(","),function(b){var d=[],f=[],e=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,b);for(var h in b){var g=b[h],m=g.lang,l=null,n=g.requires,w;CKEDITOR.tools.isArray(n)&&(n=n.join(","));if(n&&(w=n.match(k)))for(;n=w.pop();)CKEDITOR.error("editor-plugin-required",{plugin:n.replace(",",""),requiredBy:h});m&&!a.lang[h]&&(m.split&&
270
+ ""),d=d+(","+f);if(e)var k=new RegExp("(?:^|,)(?:"+e.replace(/,/g,"|")+")(?\x3d,|$)","g"),d=d.replace(k,"");CKEDITOR.env.air&&(d+=",adobeair");CKEDITOR.plugins.load(d.split(","),function(b){var d=[],f=[],e=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,b);for(var h in b){var g=b[h],m=g.lang,l=null,w=g.requires,n;CKEDITOR.tools.isArray(w)&&(w=w.join(","));if(w&&(n=w.match(k)))for(;w=n.pop();)CKEDITOR.error("editor-plugin-required",{plugin:w.replace(",",""),requiredBy:h});m&&!a.lang[h]&&(m.split&&
271
271
  (m=m.split(",")),0<=CKEDITOR.tools.indexOf(m,a.langCode)?l=a.langCode:(l=a.langCode.replace(/-.*/,""),l=l!=a.langCode&&0<=CKEDITOR.tools.indexOf(m,l)?l:0<=CKEDITOR.tools.indexOf(m,"en")?"en":m[0]),g.langEntries&&g.langEntries[l]?(a.lang[h]=g.langEntries[l],l=null):e.push(CKEDITOR.getUrl(g.path+"lang/"+l+".js")));f.push(l);d.push(g)}CKEDITOR.scriptLoader.load(e,function(){if(!a.isDestroyed()&&!a.isDetached()){for(var b=["beforeInit","init","afterInit"],e=0;e<b.length;e++)for(var h=0;h<d.length;h++){var k=
272
- d[h];0===e&&f[h]&&k.lang&&k.langEntries&&(a.lang[k.name]=k.langEntries[f[h]]);if(k[b[e]])k[b[e]](a)}a.fireOnce("pluginsLoaded");c.keystrokes&&a.setKeystroke(a.config.keystrokes);for(h=0;h<a.config.blockedKeystrokes.length;h++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[h]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)}})})}function r(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();this.config.htmlEncodeOutput&&
273
- (b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return!0}return!1}function u(a,b){function c(a){var b=a.startContainer,d=a.endContainer;return b.is&&(b.is("tr")||b.is("td")&&b.equals(d)&&a.endOffset===b.getChildCount())?!0:!1}function d(a){var b=a.startContainer;return b.is("tr")?a.cloneContents():b.clone(!0)}for(var f=new CKEDITOR.dom.documentFragment,e,h,k,g=0;g<a.length;g++){var m=a[g],l=m.startContainer.getAscendant("tr",!0);c(m)?(e||(e=l.getAscendant("table").clone(),
274
- e.append(l.getAscendant({thead:1,tbody:1,tfoot:1}).clone()),f.append(e),e=e.findOne("thead, tbody, tfoot")),h&&h.equals(l)||(h=l,k=l.clone(),e.append(k)),k.append(d(m))):f.append(m.cloneContents())}return e?f:b.getHtmlFromRange(a[0])}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var p=0,t={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{plugins:{detectConflict:function(a,b){for(var c=0;c<b.length;c++){var d=b[c];if(this[d])return CKEDITOR.warn("editor-plugin-conflict",{plugin:a,replacedWith:d}),
272
+ d[h];0===e&&f[h]&&k.lang&&k.langEntries&&(a.lang[k.name]=k.langEntries[f[h]]);if(k[b[e]])k[b[e]](a)}a.fireOnce("pluginsLoaded");c.keystrokes&&a.setKeystroke(a.config.keystrokes);for(h=0;h<a.config.blockedKeystrokes.length;h++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[h]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)}})})}function p(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();this.config.htmlEncodeOutput&&
273
+ (b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):a.setHtml(b);return!0}return!1}function q(a,b){function c(a){var b=a.startContainer,d=a.endContainer;return b.is&&(b.is("tr")||b.is("td")&&b.equals(d)&&a.endOffset===b.getChildCount())?!0:!1}function d(a){var b=a.startContainer;return b.is("tr")?a.cloneContents():b.clone(!0)}for(var f=new CKEDITOR.dom.documentFragment,e,h,k,g=0;g<a.length;g++){var m=a[g],l=m.startContainer.getAscendant("tr",!0);c(m)?(e||(e=l.getAscendant("table").clone(),
274
+ e.append(l.getAscendant({thead:1,tbody:1,tfoot:1}).clone()),f.append(e),e=e.findOne("thead, tbody, tfoot")),h&&h.equals(l)||(h=l,k=l.clone(),e.append(k)),k.append(d(m))):f.append(m.cloneContents())}return e?f:b.getHtmlFromRange(a[0])}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var v=0,r={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{plugins:{detectConflict:function(a,b){for(var c=0;c<b.length;c++){var d=b[c];if(this[d])return CKEDITOR.warn("editor-plugin-conflict",{plugin:a,replacedWith:d}),
275
275
  !0}return!1}},addCommand:function(a,b){b.name=a.toLowerCase();var c=b instanceof CKEDITOR.command?b:new CKEDITOR.command(this,b);this.mode&&e(this,c);return this.commands[a]=c},_attachToForm:function(){function a(b){c.updateElement();c._.required&&!d.getValue()&&!1===c.fire("required")&&b.data.preventDefault()}function b(a){return!!(a&&a.call&&a.apply)}var c=this,d=c.element,f=new CKEDITOR.dom.element(d.$.form);d.is("textarea")&&f&&(f.on("submit",a),b(f.$.submit)&&(f.$.submit=CKEDITOR.tools.override(f.$.submit,
276
- function(b){return function(){a();b.apply?b.apply(this):b()}})),c.on("destroy",function(){f.removeListener("submit",a)}))},destroy:function(a){var b=CKEDITOR.filter.instances,c=this;this.fire("beforeDestroy");!a&&r.call(this);this.editable(null);this.filter&&delete this.filter;CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(b),function(a){a=b[a];c===a.editor&&a.destroy()});delete this.activeFilter;this.status="destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);
276
+ function(b){return function(){a();b.apply?b.apply(this):b()}})),c.on("destroy",function(){f.removeListener("submit",a)}))},destroy:function(a){var b=CKEDITOR.filter.instances,c=this;this.fire("beforeDestroy");!a&&p.call(this);this.editable(null);this.filter&&delete this.filter;CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(b),function(a){a=b[a];c===a.editor&&a.destroy()});delete this.activeFilter;this.status="destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);
277
277
  CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(a){if(!a){a=this.getSelection();if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,b){var c=this.getCommand(a),d={name:a,commandData:b||{},command:c};return c&&c.state!=CKEDITOR.TRISTATE_DISABLED&&!1!==this.fire("beforeCommandExec",d)&&(d.returnValue=c.exec(d.commandData),
278
278
  !c.async&&!1!==this.fire("afterCommandExec",d))?d.returnValue:!1},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;"string"!=typeof b&&(b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?b.getValue():b.getHtml():"");b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");"string"!=typeof a&&(a=(a=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?
279
279
  a.is("textarea")?a.getValue():a.getHtml():"");return a},loadSnapshot:function(a){this.fire("loadSnapshot",a)},setData:function(a,b,c){var d=!0,f=b;b&&"object"==typeof b&&(c=b.internal,f=b.callback,d=!b.noSnapshot);!c&&d&&this.fire("saveSnapshot");if(f||!c)this.once("dataReady",function(a){!c&&d&&this.fire("saveSnapshot");f&&f.call(a.editor)});a={dataValue:a};!c&&this.fire("setData",a);this._.data=a.dataValue;!c&&this.fire("afterSetData",a)},setReadOnly:function(a){a=null==a||a;this.readOnly!=a&&(this.readOnly=
280
- a,this.keystrokeHandler.blockedKeystrokes[8]=+a,this.editable().setReadOnly(a),this.fire("readOnly"))},insertHtml:function(a,b,c){this.fire("insertHtml",{dataValue:a,mode:b,range:c})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var b=this.editable(),c=this.getSelection(),c=c&&c.getRanges();if(!b||!c||0===c.length)return null;b=u(c,b);return a?b.getHtml():b},extractSelectedHtml:function(a,b){var c=this.editable(),
281
- d=this.getSelection().getRanges(),f=new CKEDITOR.dom.documentFragment,e;if(!c||0===d.length)return null;for(e=0;e<d.length;e++)f.append(c.extractHtmlFromRange(d[e],b));b||this.getSelection().selectRanges([d[0]]);return a?f.getHtml():f},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return r.call(this)},setKeystroke:function(){for(var a=
280
+ a,this.keystrokeHandler.blockedKeystrokes[8]=+a,this.editable().setReadOnly(a),this.fire("readOnly"))},insertHtml:function(a,b,c){this.fire("insertHtml",{dataValue:a,mode:b,range:c})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},getSelectedHtml:function(a){var b=this.editable(),c=this.getSelection(),c=c&&c.getRanges();if(!b||!c||0===c.length)return null;b=q(c,b);return a?b.getHtml():b},extractSelectedHtml:function(a,b){var c=this.editable(),
281
+ d=this.getSelection().getRanges(),f=new CKEDITOR.dom.documentFragment,e;if(!c||0===d.length)return null;for(e=0;e<d.length;e++)f.append(c.extractHtmlFromRange(d[e],b));b||this.getSelection().selectRanges([d[0]]);return a?f.getHtml():f},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return p.call(this)},setKeystroke:function(){for(var a=
282
282
  this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],c,d,f=b.length;f--;)c=b[f],d=0,CKEDITOR.tools.isArray(c)&&(d=c[1],c=c[0]),d?a[c]=d:delete a[c]},getCommandKeystroke:function(a,b){var c="string"===typeof a?this.getCommand(a):a,d=[];if(c){var f=CKEDITOR.tools.object.findKey(this.commands,c),e=this.keystrokeHandler.keystrokes;if(c.fakeKeystroke)d.push(c.fakeKeystroke);else for(var h in e)e[h]===f&&d.push(h)}return b?d:d[0]||null},addFeature:function(a){return this.filter.addFeature(a)},
283
283
  setActiveFilter:function(a){a||(a=this.filter);this.activeFilter!==a&&(this.activeFilter=a,this.fire("activeFilterChange"),a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),a.getAllowedEnterMode(this.shiftEnterMode,!0)))},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b)this.activeEnterMode=
284
284
  a,this.activeShiftEnterMode=b,this.fire("activeEnterModeChange")},showNotification:function(a){alert(a)},isDetached:function(){return!!this.container&&this.container.isDetached()},isDestroyed:function(){return"destroyed"===this.status}});CKEDITOR.editor._getEditorElement=function(a){if(!CKEDITOR.env.isCompatible)return null;var b=CKEDITOR.dom.element.get(a);return b?b.getEditor()?(CKEDITOR.error("editor-element-conflict",{editorName:b.getEditor().name}),null):b:(CKEDITOR.error("editor-incorrect-element",
@@ -291,14 +291,14 @@ insertAfter:function(a){var l=a.parent.children,g=CKEDITOR.tools.indexOf(l,a),f=
291
291
  a},g=this.parent;for(;g&&g.type==CKEDITOR.NODE_ELEMENT;){if(l(g))return g;g=g.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}})();"use strict";CKEDITOR.htmlParser.comment=function(a){this.value=a;this._={isBlockLike:!1}};CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(a,
292
292
  l){var g=this.value;if(!(g=a.onComment(l,g,this)))return this.remove(),!1;if("string"!=typeof g)return this.replaceWith(g),!1;this.value=g;return!0},writeHtml:function(a,l){l&&this.filter(l);a.comment(this.value)}});"use strict";(function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:!1}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,l){if(!(this.value=a.onText(l,this.value,this)))return this.remove(),
293
293
  !1},writeHtml:function(a,l){l&&this.filter(l);a.text(this.value)}})})();"use strict";(function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})})();"use strict";CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:!0,hasInlineStarted:!1}};(function(){function a(a){return a.attributes["data-cke-survive"]?
294
- !1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var l=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),g={ol:1,ul:1},f=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(m,h,k){function c(a){var b;if(0<q.length)for(var c=0;c<q.length;c++){var f=
295
- q[c],e=f.name,h=CKEDITOR.dtd[e],k=x.name&&CKEDITOR.dtd[x.name];k&&!k[e]||a&&h&&!h[a]&&CKEDITOR.dtd[a]?e==x.name&&(n(x,x.parent,1),c--):(b||(d(),b=1),f=f.clone(),f.parent=x,x=f,q.splice(c,1),c--)}}function d(){for(;y.length;)n(y.shift(),x)}function b(a){if(a._.isBlockLike&&"pre"!=a.name&&"textarea"!=a.name){var b=a.children.length,c=a.children[b-1],d;c&&c.type==CKEDITOR.NODE_TEXT&&((d=CKEDITOR.tools.rtrim(c.value))?c.value=d:a.children.length=b-1)}}function n(c,d,f){d=d||x||t;var e=x;void 0===c.previous&&
296
- (r(d,c)&&(x=d,p.onTagOpen(k,{}),c.returnPoint=d=x),b(c),a(c)&&!c.children.length||d.add(c),"pre"==c.name&&(A=!1),"textarea"==c.name&&(z=!1));c.returnPoint?(x=c.returnPoint,delete c.returnPoint):x=f?d:e}function r(a,b){if((a==t||"body"==a.name)&&k&&(!a.name||CKEDITOR.dtd[a.name][k])){var c,d;return(c=b.attributes&&(d=b.attributes["data-cke-real-element-type"])?d:b.name)&&c in CKEDITOR.dtd.$inline&&!(c in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function u(a,b){return a in CKEDITOR.dtd.$listItem||
297
- a in CKEDITOR.dtd.$tableContent?a==b||"dt"==a&&"dd"==b||"dd"==a&&"dt"==b:!1}var p=new CKEDITOR.htmlParser,t=h instanceof CKEDITOR.htmlParser.element?h:"string"==typeof h?new CKEDITOR.htmlParser.element(h):new CKEDITOR.htmlParser.fragment,q=[],y=[],x=t,z="textarea"==t.name,A="pre"==t.name;p.onTagOpen=function(b,e,h,k){e=new CKEDITOR.htmlParser.element(b,e);e.isUnknown&&h&&(e.isEmpty=!0);e.isOptionalClose=k;if(a(e))q.push(e);else{if("pre"==b)A=!0;else{if("br"==b&&A){x.add(new CKEDITOR.htmlParser.text("\n"));
298
- return}"textarea"==b&&(z=!0)}if("br"==b)y.push(e);else{for(;!(k=(h=x.name)?CKEDITOR.dtd[h]||(x._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f,e.isUnknown||x.isUnknown||k[b]);)if(x.isOptionalClose)p.onTagClose(h);else if(b in g&&h in g)h=x.children,(h=h[h.length-1])&&"li"==h.name||n(h=new CKEDITOR.htmlParser.element("li"),x),!e.returnPoint&&(e.returnPoint=x),x=h;else if(b in CKEDITOR.dtd.$listItem&&!u(b,h))p.onTagOpen("li"==b?"ul":"dl",{},0,1);else if(h in l&&!u(b,h))!e.returnPoint&&(e.returnPoint=
299
- x),x=x.parent;else if(h in CKEDITOR.dtd.$inline&&q.unshift(x),x.parent)n(x,x.parent,1);else{e.isOrphan=1;break}c(b);d();e.parent=x;e.isEmpty?n(e):x=e}}};p.onTagClose=function(a){for(var b=q.length-1;0<=b;b--)if(a==q[b].name){q.splice(b,1);return}for(var c=[],f=[],e=x;e!=t&&e.name!=a;)e._.isBlockLike||f.unshift(e),c.push(e),e=e.returnPoint||e.parent;if(e!=t){for(b=0;b<c.length;b++){var h=c[b];n(h,h.parent)}x=e;e._.isBlockLike&&d();n(e,e.parent);e==x&&(x=x.parent);q=q.concat(f)}"body"==a&&(k=!1)};p.onText=
300
- function(a){if(!(x._.hasInlineStarted&&!y.length||A||z)&&(a=CKEDITOR.tools.ltrim(a),0===a.length))return;var b=x.name,h=b?CKEDITOR.dtd[b]||(x._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f;if(!z&&!h["#"]&&b in l)p.onTagOpen(e[b]||""),p.onText(a);else{d();c();A||z||(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);if(r(x,a))this.onTagOpen(k,{},0,1);x.add(a)}};p.onCDATA=function(a){x.add(new CKEDITOR.htmlParser.cdata(a))};p.onComment=function(a){d();c();x.add(new CKEDITOR.htmlParser.comment(a))};
301
- p.parse(m);for(d();x!=t;)n(x,x.parent,1);b(t);return t};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,f){isNaN(f)&&(f=this.children.length);var e=0<f?this.children[f-1]:null;if(e){if(a._.isBlockLike&&e.type==CKEDITOR.NODE_TEXT&&(e.value=CKEDITOR.tools.rtrim(e.value),0===e.value.length)){this.children.pop();this.add(a);return}e.next=a}a.previous=e;a.parent=this;this.children.splice(f,0,a);this._.hasInlineStarted||(this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||
294
+ !1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var l=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),g={ol:1,ul:1},f=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(m,h,k){function c(a){var b;if(0<t.length)for(var c=0;c<t.length;c++){var f=
295
+ t[c],e=f.name,h=CKEDITOR.dtd[e],k=x.name&&CKEDITOR.dtd[x.name];k&&!k[e]||a&&h&&!h[a]&&CKEDITOR.dtd[a]?e==x.name&&(n(x,x.parent,1),c--):(b||(d(),b=1),f=f.clone(),f.parent=x,x=f,t.splice(c,1),c--)}}function d(){for(;y.length;)n(y.shift(),x)}function b(a){if(a._.isBlockLike&&"pre"!=a.name&&"textarea"!=a.name){var b=a.children.length,c=a.children[b-1],d;c&&c.type==CKEDITOR.NODE_TEXT&&((d=CKEDITOR.tools.rtrim(c.value))?c.value=d:a.children.length=b-1)}}function n(c,d,f){d=d||x||r;var e=x;void 0===c.previous&&
296
+ (p(d,c)&&(x=d,v.onTagOpen(k,{}),c.returnPoint=d=x),b(c),a(c)&&!c.children.length||d.add(c),"pre"==c.name&&(B=!1),"textarea"==c.name&&(z=!1));c.returnPoint?(x=c.returnPoint,delete c.returnPoint):x=f?d:e}function p(a,b){if((a==r||"body"==a.name)&&k&&(!a.name||CKEDITOR.dtd[a.name][k])){var c,d;return(c=b.attributes&&(d=b.attributes["data-cke-real-element-type"])?d:b.name)&&c in CKEDITOR.dtd.$inline&&!(c in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function q(a,b){return a in CKEDITOR.dtd.$listItem||
297
+ a in CKEDITOR.dtd.$tableContent?a==b||"dt"==a&&"dd"==b||"dd"==a&&"dt"==b:!1}var v=new CKEDITOR.htmlParser,r=h instanceof CKEDITOR.htmlParser.element?h:"string"==typeof h?new CKEDITOR.htmlParser.element(h):new CKEDITOR.htmlParser.fragment,t=[],y=[],x=r,z="textarea"==r.name,B="pre"==r.name;v.onTagOpen=function(b,e,h,k){e=new CKEDITOR.htmlParser.element(b,e);e.isUnknown&&h&&(e.isEmpty=!0);e.isOptionalClose=k;if(a(e))t.push(e);else{if("pre"==b)B=!0;else{if("br"==b&&B){x.add(new CKEDITOR.htmlParser.text("\n"));
298
+ return}"textarea"==b&&(z=!0)}if("br"==b)y.push(e);else{for(;!(k=(h=x.name)?CKEDITOR.dtd[h]||(x._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f,e.isUnknown||x.isUnknown||k[b]);)if(x.isOptionalClose)v.onTagClose(h);else if(b in g&&h in g)h=x.children,(h=h[h.length-1])&&"li"==h.name||n(h=new CKEDITOR.htmlParser.element("li"),x),!e.returnPoint&&(e.returnPoint=x),x=h;else if(b in CKEDITOR.dtd.$listItem&&!q(b,h))v.onTagOpen("li"==b?"ul":"dl",{},0,1);else if(h in l&&!q(b,h))!e.returnPoint&&(e.returnPoint=
299
+ x),x=x.parent;else if(h in CKEDITOR.dtd.$inline&&t.unshift(x),x.parent)n(x,x.parent,1);else{e.isOrphan=1;break}c(b);d();e.parent=x;e.isEmpty?n(e):x=e}}};v.onTagClose=function(a){for(var b=t.length-1;0<=b;b--)if(a==t[b].name){t.splice(b,1);return}for(var c=[],f=[],e=x;e!=r&&e.name!=a;)e._.isBlockLike||f.unshift(e),c.push(e),e=e.returnPoint||e.parent;if(e!=r){for(b=0;b<c.length;b++){var h=c[b];n(h,h.parent)}x=e;e._.isBlockLike&&d();n(e,e.parent);e==x&&(x=x.parent);t=t.concat(f)}"body"==a&&(k=!1)};v.onText=
300
+ function(a){if(!(x._.hasInlineStarted&&!y.length||B||z)&&(a=CKEDITOR.tools.ltrim(a),0===a.length))return;var b=x.name,h=b?CKEDITOR.dtd[b]||(x._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):f;if(!z&&!h["#"]&&b in l)v.onTagOpen(e[b]||""),v.onText(a);else{d();c();B||z||(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);if(p(x,a))this.onTagOpen(k,{},0,1);x.add(a)}};v.onCDATA=function(a){x.add(new CKEDITOR.htmlParser.cdata(a))};v.onComment=function(a){d();c();x.add(new CKEDITOR.htmlParser.comment(a))};
301
+ v.parse(m);for(d();x!=r;)n(x,x.parent,1);b(r);return r};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,f){isNaN(f)&&(f=this.children.length);var e=0<f?this.children[f-1]:null;if(e){if(a._.isBlockLike&&e.type==CKEDITOR.NODE_TEXT&&(e.value=CKEDITOR.tools.rtrim(e.value),0===e.value.length)){this.children.pop();this.add(a);return}e.next=a}a.previous=e;a.parent=this;this.children.splice(f,0,a);this._.hasInlineStarted||(this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||
302
302
  a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike)},filter:function(a,f){f=this.getFilterContext(f);a.onRoot(f,this);this.filterChildren(a,!1,f)},filterChildren:function(a,f,e){if(this.childrenFilteredBy!=a.id){e=this.getFilterContext(e);if(f&&!this.parent)a.onRoot(e,this);this.childrenFilteredBy=a.id;for(f=0;f<this.children.length;f++)!1===this.children[f].filter(a,e)&&f--}},writeHtml:function(a,f){f&&this.filter(f);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,f,e){var c=this.getFilterContext();
303
303
  if(e&&!this.parent&&f)f.onRoot(c,this);f&&this.filterChildren(f,!1,c);f=0;e=this.children;for(c=e.length;f<c;f++)e[f].writeHtml(a)},forEach:function(a,f,e){if(!(e||f&&this.type!=f))var c=a(this);if(!1!==c){e=this.children;for(var d=0;d<e.length;d++)c=e[d],c.type==CKEDITOR.NODE_ELEMENT?c.forEach(a,f):f&&c.type!=f||a(c)}},getFilterContext:function(a){return a||{}}}})();"use strict";(function(){function a(){this.rules=[]}function l(g,f,e,m){var h,k;for(h in f)(k=g[h])||(k=g[h]=new a),k.add(f[h],e,m)}
304
304
  CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(g){this.id=CKEDITOR.tools.getNextNumber();this.elementNameRules=new a;this.attributeNameRules=new a;this.elementsRules={};this.attributesRules={};this.textRules=new a;this.commentRules=new a;this.rootRules=new a;g&&this.addRules(g,10)},proto:{addRules:function(a,f){var e;"number"==typeof f?e=f:f&&"priority"in f&&(e=f.priority);"number"!=typeof e&&(e=10);"object"!=typeof f&&(f={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,
@@ -307,26 +307,26 @@ f,e){return this.textRules.exec(a,f,e)},onComment:function(a,f,e){return this.co
307
307
  new CKEDITOR.htmlParser.text(this.onText(a,f.value,f)):e==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,f.value,f)):null},onAttribute:function(a,f,e,m){return(e=this.attributesRules[e])?e.exec(a,m,f,this):m}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,f,e){this.rules.splice(this.findIndex(f),0,{value:a,priority:f,options:e})},addMany:function(a,f,e){for(var m=[this.findIndex(f),0],h=0,k=a.length;h<k;h++)m.push({value:a[h],priority:f,options:e});this.rules.splice.apply(this.rules,
308
308
  m)},findIndex:function(a){for(var f=this.rules,e=f.length-1;0<=e&&a<f[e].priority;)e--;return e+1},exec:function(a,f){var e=f instanceof CKEDITOR.htmlParser.node||f instanceof CKEDITOR.htmlParser.fragment,m=Array.prototype.slice.call(arguments,1),h=this.rules,k=h.length,c,d,b,l;for(l=0;l<k;l++)if(e&&(c=f.type,d=f.name),b=h[l],!(a.nonEditable&&!b.options.applyToAll||a.nestedEditable&&b.options.excludeNestedEditable)){b=b.value.apply(null,m);if(!1===b||e&&b&&(b.name!=d||b.type!=c))return b;null!=b&&
309
309
  (m[0]=f=b)}return f},execOnName:function(a,f){for(var e=0,m=this.rules,h=m.length,k;f&&e<h;e++)k=m[e],a.nonEditable&&!k.options.applyToAll||a.nestedEditable&&k.options.excludeNestedEditable||(f=f.replace(k.value[0],k.value[1]));return f}}})();(function(){function a(a,b){function c(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function d(a,b){return function(d){if(d.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var e=
310
- [],h=g(d),l,F;if(h)for(k(h,1)&&e.push(h);h;)m(h)&&(l=f(h))&&k(l)&&((F=f(l))&&!m(F)?e.push(l):(c(n).insertAfter(l),l.remove())),h=h.previous;for(h=0;h<e.length;h++)e[h].remove();if(e=!a||!1!==("function"==typeof b?b(d):b))n||CKEDITOR.env.needsBrFiller||d.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT?n||CKEDITOR.env.needsBrFiller||!(7<document.documentMode||d.name in CKEDITOR.dtd.tr||d.name in CKEDITOR.dtd.$listItem)?(e=g(d),e=!e||"form"==d.name&&"input"==e.name):e=!1:e=!1;e&&d.add(c(a))}}}function k(a,b){if((!n||
311
- CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var c;return a.type==CKEDITOR.NODE_TEXT&&(c=a.value.match(y))&&(c.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,c.index))).insertBefore(a),a.value=c[0]),!CKEDITOR.env.needsBrFiller&&n&&(!b||a.parent.name in F)||!n&&((c=a.previous)&&"br"==c.name||!c||m(c)))?!0:!1}var l={elements:{}},n="html"==b,F=CKEDITOR.tools.extend({},w),v;for(v in F)"#"in z[v]||delete F[v];for(v in F)l.elements[v]=
310
+ [],h=g(d),l,w;if(h)for(k(h,1)&&e.push(h);h;)m(h)&&(l=f(h))&&k(l)&&((w=f(l))&&!m(w)?e.push(l):(c(n).insertAfter(l),l.remove())),h=h.previous;for(h=0;h<e.length;h++)e[h].remove();if(e=!a||!1!==("function"==typeof b?b(d):b))n||CKEDITOR.env.needsBrFiller||d.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT?n||CKEDITOR.env.needsBrFiller||!(7<document.documentMode||d.name in CKEDITOR.dtd.tr||d.name in CKEDITOR.dtd.$listItem)?(e=g(d),e=!e||"form"==d.name&&"input"==e.name):e=!1:e=!1;e&&d.add(c(a))}}}function k(a,b){if((!n||
311
+ CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.name&&!a.attributes["data-cke-eol"])return!0;var c;return a.type==CKEDITOR.NODE_TEXT&&(c=a.value.match(y))&&(c.index&&((new CKEDITOR.htmlParser.text(a.value.substring(0,c.index))).insertBefore(a),a.value=c[0]),!CKEDITOR.env.needsBrFiller&&n&&(!b||a.parent.name in F)||!n&&((c=a.previous)&&"br"==c.name||!c||m(c)))?!0:!1}var l={elements:{}},n="html"==b,F=CKEDITOR.tools.extend({},w),u;for(u in F)"#"in z[u]||delete F[u];for(u in F)l.elements[u]=
312
312
  d(n,a.config.fillEmptyBlocks);l.root=d(n,!1);l.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var d=b.attributes;if("data-cke-bogus"in d||"data-cke-eol"in d)delete d["data-cke-bogus"];else{for(d=b.next;d&&e(d);)d=d.next;var k=f(b);!d&&m(b.parent)?h(b.parent,c(a)):m(d)&&k&&!m(k)&&c(a).insertBefore(d)}}}}(n);return l}function l(a,b){return a!=CKEDITOR.ENTER_BR&&!1!==b?a==CKEDITOR.ENTER_DIV?"div":"p":!1}function g(a){for(a=a.children[a.children.length-1];a&&
313
313
  e(a);)a=a.previous;return a}function f(a){for(a=a.previous;a&&e(a);)a=a.previous;return a}function e(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&a.attributes["data-cke-bookmark"]}function m(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in w||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function h(a,b){var c=a.children[a.children.length-1];a.children.push(b);b.parent=a;c&&(c.next=b,b.previous=c)}function k(a){a=a.attributes;"false"!=a.contenteditable&&
314
314
  (a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function c(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}function d(a){return a.replace(G,function(a,b,c){return"\x3c"+b+c.replace(K,function(a,b){return H.test(b)&&-1==c.indexOf("data-cke-saved-"+b)?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+"\x3e"})}function b(a,b){return a.replace(b,function(a,b,c){0===a.indexOf("\x3ctextarea")&&
315
- (a=b+u(c).replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function n(a){return a.replace(I,function(a,b){return decodeURIComponent(b)})}function r(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,function(a){return"\x3c!--"+x+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function u(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}
316
- function p(a,b){var c=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function t(a,b){var c=[],d=b.config.protectedSource,f=b._.dataStore||(b._.dataStore={id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,d=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_tempcomment}"+
315
+ (a=b+q(c).replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function n(a){return a.replace(I,function(a,b){return decodeURIComponent(b)})}function p(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,function(a){return"\x3c!--"+x+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function q(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}
316
+ function v(a,b){var c=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function r(a,b){var c=[],d=b.config.protectedSource,f=b._.dataStore||(b._.dataStore={id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,d=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_tempcomment}"+
317
317
  (c.push(a)-1)+"--\x3e"});for(var h=0;h<d.length;h++)a=a.replace(d[h],function(a){a=a.replace(e,function(a,b,d){return c[d]});return/cke_temp(comment)?/.test(a)?a:"\x3c!--{cke_temp}"+(c.push(a)-1)+"--\x3e"});a=a.replace(e,function(a,b,d){return"\x3c!--"+x+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,"%2D%2D")+"--\x3e"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,
318
- b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,f){return"\x3c"+c+d+"\x3e"+p(u(f),b)+"\x3c/"+c+"\x3e"})}var q;CKEDITOR.htmlDataProcessor=function(c){var f,e,h=this;this.editor=c;this.dataFilter=f=new CKEDITOR.htmlParser.filter;this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;f.addRules(v);f.addRules(D,{applyToAll:!0});f.addRules(a(c,"data"),
319
- {applyToAll:!0});e.addRules(B);e.addRules(C,{applyToAll:!0});e.addRules(a(c,"html"),{applyToAll:!0});c.on("toHtml",function(a){a=a.data;var f=a.dataValue,e,f=q(f),f=t(f,c),f=b(f,M),f=d(f),f=b(f,E),f=f.replace(J,"$1cke:$2"),f=f.replace(L,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),f=f.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),f=f.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");e=a.context||c.editable().getName();var h;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==e&&(e="div",
320
- f="\x3cpre\x3e"+f+"\x3c/pre\x3e",h=1);e=c.document.createElement(e);e.setHtml("a"+f);f=e.getHtml().substr(1);f=f.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");h&&(f=f.replace(/^<pre>|<\/pre>$/gi,""));f=f.replace(F,"$1$2");f=n(f);f=u(f);e=!1===a.fixForBody?!1:l(a.enterMode,c.config.autoParagraph);f=CKEDITOR.htmlParser.fragment.fromHtml(f,a.context,e);e&&(h=f,!h.children.length&&CKEDITOR.dtd[h.name][e]&&(e=new CKEDITOR.htmlParser.element(e),h.add(e)));a.dataValue=f},null,null,5);c.on("toHtml",
321
- function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&c.fire("dataFiltered")},null,null,6);c.on("toHtml",function(a){a.data.dataValue.filterChildren(h.dataFilter,!0)},null,null,10);c.on("toHtml",function(a){a=a.data;var b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(!0);a.dataValue=r(b)},null,null,15);c.on("toDataFormat",function(a){var b=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/^<br *\/?>/i,""));
322
- a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(b,a.data.context,l(a.data.enterMode,c.config.autoParagraph))},null,null,5);c.on("toDataFormat",function(a){a.data.dataValue.filterChildren(h.htmlFilter,!0)},null,null,10);c.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);c.on("toDataFormat",function(a){var b=a.data.dataValue,d=h.writer;d.reset();b.writeChildrenHtml(d);b=d.getHtml(!0);b=u(b);b=p(b,c);a.data.dataValue=b},null,null,15)};CKEDITOR.htmlDataProcessor.prototype=
318
+ b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,f){return"\x3c"+c+d+"\x3e"+v(q(f),b)+"\x3c/"+c+"\x3e"})}var t;CKEDITOR.htmlDataProcessor=function(c){var f,e,h=this;this.editor=c;this.dataFilter=f=new CKEDITOR.htmlParser.filter;this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;f.addRules(u);f.addRules(D,{applyToAll:!0});f.addRules(a(c,"data"),
319
+ {applyToAll:!0});e.addRules(C);e.addRules(A,{applyToAll:!0});e.addRules(a(c,"html"),{applyToAll:!0});c.on("toHtml",function(a){a=a.data;var f=a.dataValue,e,f=t(f),f=r(f,c),f=b(f,M),f=d(f),f=b(f,E),f=f.replace(J,"$1cke:$2"),f=f.replace(L,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),f=f.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),f=f.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");e=a.context||c.editable().getName();var h;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==e&&(e="div",
320
+ f="\x3cpre\x3e"+f+"\x3c/pre\x3e",h=1);e=c.document.createElement(e);e.setHtml("a"+f);f=e.getHtml().substr(1);f=f.replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");h&&(f=f.replace(/^<pre>|<\/pre>$/gi,""));f=f.replace(F,"$1$2");f=n(f);f=q(f);e=!1===a.fixForBody?!1:l(a.enterMode,c.config.autoParagraph);f=CKEDITOR.htmlParser.fragment.fromHtml(f,a.context,e);e&&(h=f,!h.children.length&&CKEDITOR.dtd[h.name][e]&&(e=new CKEDITOR.htmlParser.element(e),h.add(e)));a.dataValue=f},null,null,5);c.on("toHtml",
321
+ function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&c.fire("dataFiltered")},null,null,6);c.on("toHtml",function(a){a.data.dataValue.filterChildren(h.dataFilter,!0)},null,null,10);c.on("toHtml",function(a){a=a.data;var b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(!0);a.dataValue=p(b)},null,null,15);c.on("toDataFormat",function(a){var b=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/^<br *\/?>/i,""));
322
+ a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(b,a.data.context,l(a.data.enterMode,c.config.autoParagraph))},null,null,5);c.on("toDataFormat",function(a){a.data.dataValue.filterChildren(h.htmlFilter,!0)},null,null,10);c.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);c.on("toDataFormat",function(a){var b=a.data.dataValue,d=h.writer;d.reset();b.writeChildrenHtml(d);b=d.getHtml(!0);b=q(b);b=v(b,c);a.data.dataValue=b},null,null,15)};CKEDITOR.htmlDataProcessor.prototype=
323
323
  {toHtml:function(a,b,c,d){var f=this.editor,e,h,k,g;b&&"object"==typeof b?(e=b.context,c=b.fixForBody,d=b.dontFilter,h=b.filter,k=b.enterMode,g=b.protectedWhitespaces):e=b;e||null===e||(e=f.editable().getName());return f.fire("toHtml",{dataValue:a,context:e,fixForBody:c,dontFilter:d,filter:h||f.filter,enterMode:k||f.enterMode,protectedWhitespaces:g}).dataValue},toDataFormat:function(a,b){var c,d,f;b&&(c=b.context,d=b.filter,f=b.enterMode);c||null===c||(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",
324
- {dataValue:a,filter:d||this.editor.filter,context:c,enterMode:f||this.editor.enterMode}).dataValue}};var y=/(?:&nbsp;|\xa0)$/,x="{cke_protected}",z=CKEDITOR.dtd,A="caption colgroup col thead tfoot tbody".split(" "),w=CKEDITOR.tools.extend({},z.$blockLimit,z.$block),v={elements:{input:k,textarea:k}},D={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,
325
- "");if(0===b.indexOf("javascript")||0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},B={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var c=b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},C={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,
326
- ""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var c=["name","href","src"],d,f=0;f<c.length;f++)d="data-cke-saved-"+c[f],d in b&&delete b[c[f]]}return a},table:function(a){a.children.slice(0).sort(function(a,b){var c,d;a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type&&(c=CKEDITOR.tools.indexOf(A,a.name),d=CKEDITOR.tools.indexOf(A,b.name));-1<c&&-1<d&&c!=d||(c=a.parent?a.getIndex():-1,d=b.parent?b.getIndex():-1);return c>d?
324
+ {dataValue:a,filter:d||this.editor.filter,context:c,enterMode:f||this.editor.enterMode}).dataValue}};var y=/(?:&nbsp;|\xa0)$/,x="{cke_protected}",z=CKEDITOR.dtd,B="caption colgroup col thead tfoot tbody".split(" "),w=CKEDITOR.tools.extend({},z.$blockLimit,z.$block),u={elements:{input:k,textarea:k}},D={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,
325
+ "");if(0===b.indexOf("javascript")||0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},C={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var c=b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},A={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,
326
+ ""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var c=["name","href","src"],d,f=0;f<c.length;f++)d="data-cke-saved-"+c[f],d in b&&delete b[c[f]]}return a},table:function(a){a.children.slice(0).sort(function(a,b){var c,d;a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type&&(c=CKEDITOR.tools.indexOf(B,a.name),d=CKEDITOR.tools.indexOf(B,b.name));-1<c&&-1<d&&c!=d||(c=a.parent?a.getIndex():-1,d=b.parent?b.getIndex():-1);return c>d?
327
327
  1:-1})},param:function(a){a.children=[];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&h(a,b=new CKEDITOR.htmlParser.text);
328
- b.value=a.attributes["data-cke-title"]||""},input:c,textarea:c},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(C.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var G=/<(a|area|img|input|source)\b([^>]*)>/gi,K=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,H=/^(href|src|name)$/i,E=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
329
- M=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,I=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,J=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,F=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,L=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;q=function(){function a(c){return CKEDITOR.tools.array.reduce(c.split(""),function(a,c){var d=c.toLowerCase(),f=c.toUpperCase(),e=b(d);d!==f&&(e+="|"+b(f));return a+("("+e+")")},"")}function b(a){var c;c=a.charCodeAt(0);var d=c.toString(16);
328
+ b.value=a.attributes["data-cke-title"]||""},input:c,textarea:c},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(A.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var G=/<(a|area|img|input|source)\b([^>]*)>/gi,K=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,H=/^(href|src|name)$/i,E=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
329
+ M=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,I=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,J=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,F=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,L=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;t=function(){function a(c){return CKEDITOR.tools.array.reduce(c.split(""),function(a,c){var d=c.toLowerCase(),f=c.toUpperCase(),e=b(d);d!==f&&(e+="|"+b(f));return a+("("+e+")")},"")}function b(a){var c;c=a.charCodeAt(0);var d=c.toString(16);
330
330
  c={htmlCode:"\x26#"+c+";?",hex:"\x26#x0*"+d+";?",entity:{"\x3c":"\x26lt;","\x3e":"\x26gt;",":":"\x26colon;"}[a]};for(var f in c)c[f]&&(a+="|"+c[f]);return a}var c=new RegExp("("+a("\x3ccke:encoded\x3e")+"(.*?)"+a("\x3c/cke:encoded\x3e")+")|("+a("\x3c")+a("/")+"?"+a("cke:encoded\x3e")+")","gi"),d=new RegExp("(("+a("{cke_protected")+")(_[0-9]*)?"+a("}")+")","gi");return function(a){return a.replace(c,"").replace(d,"")}}()})();"use strict";CKEDITOR.htmlParser.element=function(a,l){this.name=a;this.attributes=
331
331
  l||{};this.children=[];var g=a||"",f=g.match(/^cke:(.*)/);f&&(g=f[1]);g=!!(CKEDITOR.dtd.$nonBodyContent[g]||CKEDITOR.dtd.$block[g]||CKEDITOR.dtd.$listItem[g]||CKEDITOR.dtd.$tableContent[g]||CKEDITOR.dtd.$nonEditable[g]||"br"==g);this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:g,hasInlineStarted:this.isEmpty||!g}};CKEDITOR.htmlParser.cssStyle=function(a){var l={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
332
332
  function(a,f,e){"font-family"==f&&(e=e.replace(/["']/g,""));l[f.toLowerCase()]=e});return{rules:l,populate:function(a){var f=this.toString();f&&(a instanceof CKEDITOR.dom.element?a.setAttribute("style",f):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=f:a.style=f)},toString:function(){var a=[],f;for(f in l)l[f]&&a.push(f,":",l[f],";");return a.join("")}}};(function(){function a(a){return function(e){return e.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof a?e.name==a:e.name in a)}}var l=
@@ -353,33 +353,33 @@ g.resetDirty();d?g.fire("unlockSnapshot"):"wysiwyg"==a&&g.fire("saveSnapshot");s
353
353
  h.setSize("width",a,!0);d&&(d.style.width="1%");e=CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(e));var b=(h.$.offsetHeight||0)-(c.$.clientHeight||0),k=Math.max(e-(g?0:b),0);e=g?e+b:e;c.setStyle("height",CKEDITOR.tools.cssLength(k));d&&(d.style.width="100%");this.fire("resize",{outerHeight:e,contentsHeight:k,outerWidth:a||h.getSize("width")})};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&
354
354
  CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";(function(){function a(a){var b=a.editor,c=a.data.path,d=c.blockLimit,e=a.data.selection,k=e.getRanges()[0],g;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(e=l(e,c))e.appendBogus(),g=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.edge&&b._.previousActive;h(b,c.block,d)&&k.collapsed&&!k.getCommonAncestor().isReadOnly()&&(c=k.clone(),c.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),d=new CKEDITOR.dom.walker(c),
355
355
  d.guard=function(a){return!f(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()},!d.checkForward()||c.checkStartOfBlock()&&c.checkEndOfBlock())&&(b=k.fixBlock(!0,b.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(b=b.getFirst(f))&&b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/)&&b.remove(),g=1,a.cancel());g&&k.select()}function l(a,b){if(a.isFake)return 0;var c=b.block||b.blockLimit,d=c&&c.getLast(f);if(!(!c||!c.isBlockBoundary()||
356
- d&&d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()||c.is("pre")||c.getBogus()))return c}function g(a){var b=a.data.getTarget();b.is("input")&&(b=b.getAttribute("type"),"submit"!=b&&"reset"!=b||a.data.preventDefault())}function f(a){return n(a)&&r(a)}function e(a,b){return function(c){var d=c.data.$.toElement||c.data.$.fromElement||c.data.$.relatedTarget;(d=d&&d.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(d):null)&&(b.equals(d)||b.contains(d))||a.call(this,c)}}function m(a){function b(a){return function(b,
357
- d){d&&b.type==CKEDITOR.NODE_ELEMENT&&b.is(e)&&(c=b);if(!(d||!f(b)||a&&p(b)))return!1}}var c,d=a.getRanges()[0];a=a.root;var e={table:1,ul:1,ol:1,dl:1};if(d.startPath().contains(e)){var h=d.clone();h.collapse(1);h.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(h);a.guard=b();a.checkBackward();if(c)return h=d.clone(),h.collapse(),h.setEndAt(c,CKEDITOR.POSITION_AFTER_END),a=new CKEDITOR.dom.walker(h),a.guard=b(!0),c=!1,a.checkForward(),c}return null}function h(a,b,c){return!1!==
356
+ d&&d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()||c.is("pre")||c.getBogus()))return c}function g(a){var b=a.data.getTarget();b.is("input")&&(b=b.getAttribute("type"),"submit"!=b&&"reset"!=b||a.data.preventDefault())}function f(a){return n(a)&&p(a)}function e(a,b){return function(c){var d=c.data.$.toElement||c.data.$.fromElement||c.data.$.relatedTarget;(d=d&&d.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(d):null)&&(b.equals(d)||b.contains(d))||a.call(this,c)}}function m(a){function b(a){return function(b,
357
+ d){d&&b.type==CKEDITOR.NODE_ELEMENT&&b.is(e)&&(c=b);if(!(d||!f(b)||a&&v(b)))return!1}}var c,d=a.getRanges()[0];a=a.root;var e={table:1,ul:1,ol:1,dl:1};if(d.startPath().contains(e)){var h=d.clone();h.collapse(1);h.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(h);a.guard=b();a.checkBackward();if(c)return h=d.clone(),h.collapse(),h.setEndAt(c,CKEDITOR.POSITION_AFTER_END),a=new CKEDITOR.dom.walker(h),a.guard=b(!0),c=!1,a.checkForward(),c}return null}function h(a,b,c){return!1!==
358
358
  a.config.autoParagraph&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&(a.editable().equals(c)&&!b||b&&"true"==b.getAttribute("contenteditable"))}function k(a){return a.activeEnterMode!=CKEDITOR.ENTER_BR&&!1!==a.config.autoParagraph?a.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":!1}function c(a){a&&a.isEmptyInlineRemoveable()&&a.remove()}function d(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function b(a,b,c){var d=a.getCommonAncestor(b);for(b=a=c?
359
- b:a;(a=a.getParent())&&!d.equals(a)&&1==a.getChildCount();)b=a;b.remove()}var n,r,u,p,t,q,y,x,z,A;CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=!1;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus&&(a=this.editor._.previousActive||this.getDocument().getActive(),this.contains(a))){a.focus();return}CKEDITOR.env.edge&&14<CKEDITOR.env.version&&!this.hasFocus&&
359
+ b:a;(a=a.getParent())&&!d.equals(a)&&1==a.getChildCount();)b=a;b.remove()}var n,p,q,v,r,t,y,x,z,B;CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=!1;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus&&(a=this.editor._.previousActive||this.getDocument().getActive(),this.contains(a))){a.focus();return}CKEDITOR.env.edge&&14<CKEDITOR.env.version&&!this.hasFocus&&
360
360
  this.getDocument().equals(CKEDITOR.document)&&(this.editor._.previousScrollTop=this.$.scrollTop);try{if(!CKEDITOR.env.ie||CKEDITOR.env.edge&&14<CKEDITOR.env.version||!this.getDocument().equals(CKEDITOR.document))if(CKEDITOR.env.chrome){var b=this.$.scrollTop;this.$.focus();this.$.scrollTop=b}else this.$.focus();else this.$.setActive()}catch(c){if(!CKEDITOR.env.ie)throw c;}CKEDITOR.env.safari&&!this.isInline()&&(a=CKEDITOR.document.getActive(),a.equals(this.getWindow().getFrame())||this.getWindow().focus())},
361
361
  on:function(a,b){var c=Array.prototype.slice.call(arguments,0);CKEDITOR.env.ie&&/^focus|blur$/.exec(a)&&(a="focus"==a?"focusin":"focusout",b=e(b,this),c[0]=a,c[1]=b);return CKEDITOR.dom.element.prototype.on.apply(this,c)},attachListener:function(a){!this._.listeners&&(this._.listeners=[]);var b=Array.prototype.slice.call(arguments,1),b=a.on.apply(a,b);this._.listeners.push(b);return b},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},restoreAttrs:function(){var a=
362
362
  this._.attrChanges,b,c;for(c in a)a.hasOwnProperty(c)&&(b=a[c],null!==b?this.setAttribute(c,b):this.removeAttribute(c))},attachClass:function(a){var b=this.getCustomData("classes");this.hasClass(a)||(!b&&(b=[]),b.push(a),this.setCustomData("classes",b),this.addClass(a))},changeAttr:function(a,b){var c=this.getAttribute(a);b!==c&&(!this._.attrChanges&&(this._.attrChanges={}),a in this._.attrChanges||(this._.attrChanges[a]=c),this.setAttribute(a,b))},insertText:function(a){this.editor.focus();this.insertHtml(this.transformPlainTextToHtml(a),
363
- "text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,b)},insertHtml:function(a,b,c){var e=this.editor;e.focus();e.fire("saveSnapshot");c||(c=e.getSelection().getRanges()[0]);q(this,b||"html",a,c);c.select();d(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,c){q(this,c||"html",a,b);this.editor.fire("afterInsertHtml",
364
- {intoRange:b})},insertElement:function(a,b){var c=this.editor;c.focus();c.fire("saveSnapshot");var e=c.activeEnterMode,c=c.getSelection(),h=a.getName(),h=CKEDITOR.dtd.$block[h];b||(b=c.getRanges()[0]);this.insertElementIntoRange(a,b)&&(b.moveToPosition(a,CKEDITOR.POSITION_AFTER_END),h&&((h=a.getNext(function(a){return f(a)&&!p(a)}))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is(CKEDITOR.dtd.$block)?h.getDtd()["#"]?b.moveToElementEditStart(h):b.moveToElementEditEnd(a):h||e==CKEDITOR.ENTER_BR||(h=b.fixBlock(!0,
363
+ "text")},transformPlainTextToHtml:function(a){var b=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(a,b)},insertHtml:function(a,b,c){var e=this.editor;e.focus();e.fire("saveSnapshot");c||(c=e.getSelection().getRanges()[0]);t(this,b||"html",a,c);c.select();d(this);this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(a,b,c){t(this,c||"html",a,b);this.editor.fire("afterInsertHtml",
364
+ {intoRange:b})},insertElement:function(a,b){var c=this.editor;c.focus();c.fire("saveSnapshot");var e=c.activeEnterMode,c=c.getSelection(),h=a.getName(),h=CKEDITOR.dtd.$block[h];b||(b=c.getRanges()[0]);this.insertElementIntoRange(a,b)&&(b.moveToPosition(a,CKEDITOR.POSITION_AFTER_END),h&&((h=a.getNext(function(a){return f(a)&&!v(a)}))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is(CKEDITOR.dtd.$block)?h.getDtd()["#"]?b.moveToElementEditStart(h):b.moveToElementEditEnd(a):h||e==CKEDITOR.ENTER_BR||(h=b.fixBlock(!0,
365
365
  e==CKEDITOR.ENTER_DIV?"div":"p"),b.moveToElementEditStart(h))));c.selectRanges([b]);d(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,b){var d=this.editor,e=d.config.enterMode,f=a.getName(),h=CKEDITOR.dtd.$block[f];if(b.checkReadOnly())return!1;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&(b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})?y(b):b.startContainer.is(CKEDITOR.dtd.$list)&&x(b));var k,g;if(h)for(;(k=b.getCommonAncestor(0,
366
366
  1))&&(g=CKEDITOR.dtd[k.getName()])&&(!g||!g[f]);)if(k.getName()in CKEDITOR.dtd.span){var h=b.splitElement(k),l=b.createBookmark();c(k);c(h);b.moveToBookmark(l)}else b.checkStartOfBlock()&&b.checkEndOfBlock()?(b.setStartBefore(k),b.collapse(!0),k.remove()):b.splitBlock(e==CKEDITOR.ENTER_DIV?"div":"p",d.editable());b.insertNode(a);return!0},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();"unloaded"==this.status&&(this.status="ready");this.editor.fire("dataReady")},
367
367
  getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.status="detached";this.editor.setData(this.editor.getData(),{internal:!0});this.clearListeners();try{this._.cleanCustomData()}catch(a){if(!CKEDITOR.env.ie||-2146828218!==a.number)throw a;}this.editor.fire("contentDomUnload");delete this.editor.document;delete this.editor.window;delete this.editor},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},
368
368
  fixInitialSelection:function(){function a(){var b=c.getDocument().$,d=b.getSelection(),e;a:if(d.anchorNode&&d.anchorNode==c.$)e=!0;else{if(CKEDITOR.env.webkit&&(e=c.getDocument().getActive())&&e.equals(c)&&!d.anchorNode){e=!0;break a}e=void 0}e&&(e=new CKEDITOR.dom.range(c),e.moveToElementEditStart(c),b=b.createRange(),b.setStart(e.startContainer.$,e.startOffset),b.collapse(!0),d.removeAllRanges(),d.addRange(b))}function b(){var a=c.getDocument().$,d=a.selection,e=c.getDocument().getActive();"None"==
369
369
  d.type&&e.equals(c)&&(d=new CKEDITOR.dom.range(c),a=a.body.createTextRange(),d.moveToElementEditStart(c),d=d.startContainer,d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent()),a.moveToElementText(d.$),a.collapse(!0),a.select())}var c=this;if(CKEDITOR.env.ie&&(9>CKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(),a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document);
370
- a={doc:this.getDocument(),range:a.clone()};z.eol.detect(a,this);z.bogus.exclude(a);z.cell.shrink(a);a.fragment=a.range.cloneContents();z.tree.rebuild(a,this);z.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var c=A,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var f=this.editor.createRange();
370
+ a={doc:this.getDocument(),range:a.clone()};z.eol.detect(a,this);z.bogus.exclude(a);z.cell.shrink(a);a.fragment=a.range.cloneContents();z.tree.rebuild(a,this);z.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var c=B,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var f=this.editor.createRange();
371
371
  f.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=f.createBookmark();c.list.detectMerge(d,this);c.table.detectRanges(d,this);c.block.detectMerge(d,this);d.tableContentsRanges?(c.table.deleteRanges(d),a.moveToBookmark(d.bookmark),d.range=a):(a.moveToBookmark(d.bookmark),d.range=a,a.extractContents(c.detectExtractMerge(d)));a.moveToBookmark(d.targetBookmark);a.optimize();c.fixUneditableRangePosition(a);c.list.merge(d,this);c.table.purge(d,this);c.block.merge(d,this);
372
- if(b){c=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a:{var d=c.block.getElementsByTag("span"),f=0,h;if(d)for(;h=d.getItem(f++);)if(!r(h)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(c.block,CKEDITOR.POSITION_BEFORE_START),c.block.remove())}else c.autoParagraph(this.editor,a),u(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return e},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=
373
- this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(t,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&"Control"==b.type||this.focus()},
372
+ if(b){c=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a:{var d=c.block.getElementsByTag("span"),f=0,h;if(d)for(;h=d.getItem(f++);)if(!p(h)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(c.block,CKEDITOR.POSITION_BEFORE_START),c.block.remove())}else c.autoParagraph(this.editor,a),q(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings();return e},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=
373
+ this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(r,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&"Control"==b.type||this.focus()},
374
374
  this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode,a.data.range)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):a.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&a.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||
375
375
  this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=!1},null,null,-1);this.on("focus",function(){this.hasFocus=!0},null,null,-1);if(CKEDITOR.env.webkit)this.on("scroll",function(){a._.previousScrollTop=a.editable().$.scrollTop},null,null,-1);if(CKEDITOR.env.edge&&14<CKEDITOR.env.version){var c=function(){var b=a.editable();
376
376
  null!=a._.previousScrollTop&&b.getDocument().equals(CKEDITOR.document)&&(b.$.scrollTop=a._.previousScrollTop,a._.previousScrollTop=null,this.removeListener("scroll",c))};this.on("scroll",c)}a.focusManager.add(this);this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,a.once("contentDom",function(){a.focusManager.focus(this)},this));this.isInline()&&this.changeAttr("tabindex",a.tabIndex);if(!this.is("textarea")){a.document=this.getDocument();a.window=this.getWindow();var d=a.document;this.changeAttr("spellcheck",
377
377
  !a.config.disableNativeSpellChecker);var e=a.config.contentsLangDirection;this.getDirection(1)!=e&&this.changeAttr("dir",e);var h=CKEDITOR.getCss();if(h){var e=d.getHead(),k=e.getCustomData("stylesheet");k?h!=k.getText()&&(CKEDITOR.env.ie&&9>CKEDITOR.env.version?k.$.styleSheet.cssText=h:k.setText(h)):(h=d.appendStyleText(h),h=new CKEDITOR.dom.element(h.ownerNode||h.owningElement),e.setCustomData("stylesheet",h),h.data("cke-temp",1))}e=d.getCustomData("stylesheet_ref")||0;d.setCustomData("stylesheet_ref",
378
- e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey(),d;b=a.getSelection();if(0!==b.getRanges().length){if(c in l){var e,f=b.getRanges()[0],h=f.startPath(),k,g,r,c=8==c;CKEDITOR.env.ie&&
379
- 11>CKEDITOR.env.version&&(e=b.getSelectedElement())||(e=m(b))?(a.fire("saveSnapshot"),f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e.remove(),f.select(),a.fire("saveSnapshot"),d=1):f.collapsed&&((k=h.block)&&(r=k[c?"getPrevious":"getNext"](n))&&r.type==CKEDITOR.NODE_ELEMENT&&r.is("table")&&f[c?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),f[c?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove(),f["moveToElementEdit"+(c?"End":"Start")](r),f.select(),a.fire("saveSnapshot"),
380
- d=1):h.blockLimit&&h.blockLimit.is("td")&&(g=h.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(g,c?CKEDITOR.START:CKEDITOR.END)&&(r=g[c?"getPrevious":"getNext"](n))?(a.fire("saveSnapshot"),f["moveToElementEdit"+(c?"End":"Start")](r),f.checkStartOfBlock()&&f.checkEndOfBlock()?r.remove():f.select(),a.fire("saveSnapshot"),d=1):(g=h.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(g,c?CKEDITOR.START:CKEDITOR.END)&&(d=1))}return!d}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&
378
+ e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey(),d;b=a.getSelection();if(0!==b.getRanges().length){if(c in l){var e,f=b.getRanges()[0],h=f.startPath(),k,g,p,c=8==c;CKEDITOR.env.ie&&
379
+ 11>CKEDITOR.env.version&&(e=b.getSelectedElement())||(e=m(b))?(a.fire("saveSnapshot"),f.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e.remove(),f.select(),a.fire("saveSnapshot"),d=1):f.collapsed&&((k=h.block)&&(p=k[c?"getPrevious":"getNext"](n))&&p.type==CKEDITOR.NODE_ELEMENT&&p.is("table")&&f[c?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"),f[c?"checkEndOfBlock":"checkStartOfBlock"]()&&k.remove(),f["moveToElementEdit"+(c?"End":"Start")](p),f.select(),a.fire("saveSnapshot"),
380
+ d=1):h.blockLimit&&h.blockLimit.is("td")&&(g=h.blockLimit.getAscendant("table"))&&f.checkBoundaryOfElement(g,c?CKEDITOR.START:CKEDITOR.END)&&(p=g[c?"getPrevious":"getNext"](n))?(a.fire("saveSnapshot"),f["moveToElementEdit"+(c?"End":"Start")](p),f.checkStartOfBlock()&&f.checkEndOfBlock()?p.remove():f.select(),a.fire("saveSnapshot"),d=1):(g=h.contains(["td","th","caption"]))&&f.checkBoundaryOfElement(g,c?CKEDITOR.START:CKEDITOR.END)&&(d=1))}return!d}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&
381
381
  this.attachListener(this,"keyup",function(b){b.data.getKeystroke()in l&&!this.getFirst(f)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),b.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",g);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();c.is("img","hr",
382
- "input","textarea","select")&&!c.isReadOnly()&&(a.getSelection().selectElement(c),c.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&!b.isReadOnly()&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2==b.data.$.button&&(b=b.data.getTarget(),!b.getAscendant("table")&&!b.getOuterHtml().replace(t,""))){var c=a.createRange();c.moveToElementEditStart(b);
382
+ "input","textarea","select")&&!c.isReadOnly()&&(a.getSelection().selectElement(c),c.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&!b.isReadOnly()&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2==b.data.$.button&&(b=b.data.getTarget(),!b.getAscendant("table")&&!b.getOuterHtml().replace(r,""))){var c=a.createRange();c.moveToElementEditStart(b);
383
383
  c.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(a,"key",function(c){if(a.readOnly)return!0;var d=c.data.domEvent.getKey();if(d in l&&(c=a.getSelection(),0!==c.getRanges().length)){var d=8==d,e=c.getRanges()[0];c=e.startPath();if(e.collapsed)a:{var f=
384
384
  c.block;if(f&&e[d?"checkStartOfBlock":"checkEndOfBlock"]()&&e.moveToClosestEditablePosition(f,!d)&&e.collapsed){if(e.startContainer.type==CKEDITOR.NODE_ELEMENT){var h=e.startContainer.getChild(e.startOffset-(d?1:0));if(h&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("hr")){a.fire("saveSnapshot");h.remove();c=!0;break a}}e=e.startPath().block;if(!e||e&&e.contains(f))c=void 0;else{a.fire("saveSnapshot");var k;(k=(d?e:f).getBogus())&&k.remove();k=a.getSelection();h=k.createBookmarks();(d?f:e).moveChildren(d?
385
385
  e:f,!1);c.lastElement.mergeSiblings();b(f,e,!d);k.selectBookmarks(h);c=!0}}else c=!1}else d=e,k=c.block,e=d.endPath().block,k&&e&&!k.equals(e)?(a.fire("saveSnapshot"),(f=k.getBogus())&&f.remove(),d.enlarge(CKEDITOR.ENLARGE_INLINE),d.deleteContents(),e.getParent()&&(e.moveChildren(k,!1),c.lastElement.mergeSiblings(),b(k,e,!0)),d=a.getSelection().getRanges()[0],d.collapse(1),d.optimize(),""===d.startContainer.getHtml()&&d.startContainer.appendBogus(),d.select(),c=!0):c=!1;if(!c)return;a.getSelection().scrollIntoView();
@@ -387,113 +387,113 @@ a.fire("saveSnapshot");return!1}},this,null,100)}},getUniqueId:function(){var a;
387
387
  --c?a.setCustomData("stylesheet_ref",c):(a.removeCustomData("stylesheet_ref"),b.removeCustomData("stylesheet").remove())}}}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;if(!arguments.length)return b;a?b=a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),b=null);return this._.editable=b};CKEDITOR.on("instanceLoaded",function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||
388
388
  a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1"),a.setAttribute("contentEditable",!1))});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();d&&!d.isLocked&&(d=c.checkDirty(),c.fire("lockSnapshot"),a(b),c.fire("unlockSnapshot"),!d&&c.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role",
389
389
  "textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);var d=b.fire("ariaEditorHelpLabel",{}).label;if(d&&(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+e+'" class\x3d"cke_voice_label"\x3e'+d+"\x3c/span\x3e");c.append(d);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
390
- n=CKEDITOR.dom.walker.whitespaces(!0);r=CKEDITOR.dom.walker.bookmark(!1,!0);u=CKEDITOR.dom.walker.empty();p=CKEDITOR.dom.walker.bogus();t=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;q=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,f,h,k,g=[],l=d.range.startContainer;e=d.range.startPath();for(var l=n[l.getName()],m=0,r=c.getChildren(),q=r.count(),u=-1,x=-1,G=0,y=e.contains(n.$list);m<
391
- q;++m)e=r.getItem(m),a(e)?(h=e.getName(),y&&h in CKEDITOR.dtd.$list?g=g.concat(b(e,d)):(k=!!l[h],"br"!=h||!e.data("cke-eol")||m&&m!=q-1||(G=(f=m?g[m-1].node:r.getItem(m+1))&&(!a(f)||!f.is("br")),f=f&&a(f)&&n.$block[f.getName()]),-1!=u||k||(u=m),k||(x=m),g.push({isElement:1,isLineBreak:G,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:h,allowed:k}),f=G=0)):g.push({isElement:0,node:e,allowed:1});-1<u&&(g[u].firstNotAllowed=1);-1<x&&(g[x].lastNotAllowed=1);return g}function d(b,c){var e=[],
392
- f=b.getChildren(),h=f.count(),k,g=0,l=n[c],m=!b.is(n.$inline)||b.is("br");for(m&&e.push(" ");g<h;g++)k=f.getItem(g),a(k)&&!k.is(l)?e=e.concat(d(k,c)):e.push(k);m&&e.push(" ");return e}function e(b){return a(b.startContainer)&&b.startContainer.getChild(b.startOffset-1)}function g(b){return b&&a(b)&&(b.is(n.$removeEmpty)||b.is("a")&&!b.isBlockBoundary())}function l(b,c,d,e){var f=b.clone(),h,k;f.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);(h=(new CKEDITOR.dom.walker(f)).next())&&a(h)&&r[h.getName()]&&
393
- (k=h.getPrevious())&&a(k)&&!k.getParent().equals(b.startContainer)&&d.contains(k)&&e.contains(h)&&h.isIdentical(k)&&(h.moveChildren(k),h.remove(),l(b,c,d,e))}function m(b,c){function d(b,c){if(c.isBlock&&c.isElement&&!c.node.is("br")&&a(b)&&b.is("br"))return b.remove(),1}var e=c.endContainer.getChild(c.endOffset),f=c.endContainer.getChild(c.endOffset-1);e&&d(e,b[b.length-1]);f&&d(f,b[0])&&(c.setEnd(c.endContainer,c.endOffset-1),c.collapse())}var n=CKEDITOR.dtd,r={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,
394
- h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},q={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},u=CKEDITOR.tools.extend({},n.$inline);delete u.br;return function(r,F,L,x){var y=r.editor,z=!1;"unfiltered_html"==F&&(F="html",z=!0);if(!x.checkReadOnly()){var t=(new CKEDITOR.dom.elementPath(x.startContainer,x.root)).blockLimit||x.root;F={type:F,dontFilter:z,editable:r,editor:y,range:x,blockLimit:t,mergeCandidates:[],zombies:[]};var z=F.range,t=F.mergeCandidates,p="html"===F.type,A,E,T,ba,ca,V;"text"==F.type&&
395
- z.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(E=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",z.document),z.insertNode(E),z.setStartAfter(E));T=new CKEDITOR.dom.elementPath(z.startContainer);F.endPath=ba=new CKEDITOR.dom.elementPath(z.endContainer);if(!z.collapsed){A=ba.block||ba.blockLimit;var ea=z.getCommonAncestor();A&&!A.equals(ea)&&!A.contains(ea)&&z.checkEndOfBlock()&&F.zombies.push(A);z.deleteContents()}for(;(ca=e(z))&&a(ca)&&ca.isBlockBoundary()&&T.contains(ca);)z.moveToPosition(ca,
396
- CKEDITOR.POSITION_BEFORE_END);l(z,F.blockLimit,T,ba);E&&(z.setEndBefore(E),z.collapse(),E.remove());E=z.startPath();if(A=E.contains(g,!1,1))V=z.splitElement(A),F.inlineStylesRoot=A,F.inlineStylesPeak=E.lastElement;E=z.createBookmark();p&&(c(A),c(V));(A=E.startNode.getPrevious(f))&&a(A)&&g(A)&&t.push(A);(A=E.startNode.getNext(f))&&a(A)&&g(A)&&t.push(A);for(A=E.startNode;(A=A.getParent())&&g(A);)t.push(A);z.moveToBookmark(E);y.enterMode===CKEDITOR.ENTER_DIV&&""===y.getData(!0)&&((y=r.getFirst())&&y.remove(),
397
- x.setStartAt(r,CKEDITOR.POSITION_AFTER_START),x.collapse(!0));if(r=L){r=F.range;if("text"==F.type&&F.inlineStylesRoot){x=F.inlineStylesPeak;y=x.getDocument().createText("{cke-peak}");for(V=F.inlineStylesRoot.getParent();!x.equals(V);)y=y.appendTo(x.clone()),x=x.getParent();L=y.getOuterHtml().split("{cke-peak}").join(L)}x=F.blockLimit.getName();if(/^\s+|\s+$/.test(L)&&"span"in CKEDITOR.dtd[x]){var X='\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';L=X+L+X}L=F.editor.dataProcessor.toHtml(L,
398
- {context:null,fixForBody:!1,protectedWhitespaces:!!X,dontFilter:F.dontFilter,filter:F.editor.activeFilter,enterMode:F.editor.activeEnterMode});x=r.document.createElement("body");x.setHtml(L);X&&(x.getFirst().remove(),x.getLast().remove());if((X=r.startPath().block)&&(1!=X.getChildCount()||!X.getBogus()))a:{var O;if(1==x.getChildCount()&&a(O=x.getFirst())&&O.is(q)&&!O.hasAttribute("contenteditable")){X=O.getElementsByTag("*");r=0;for(V=X.count();r<V;r++)if(y=X.getItem(r),!y.is(u))break a;O.moveChildren(O.getParent(1));
399
- O.remove()}}F.dataWrapper=x;r=L}if(r){O=F.range;r=O.document;x=F.blockLimit;V=0;var Q,X=[],R,U;L=E=0;var aa,y=O.startContainer;ca=F.endPath.elements[0];var ga,z=ca.getPosition(y),t=!!ca.getCommonAncestor(y)&&z!=CKEDITOR.POSITION_IDENTICAL&&!(z&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),y=b(F.dataWrapper,F);for(m(y,O);V<y.length;V++){z=y[V];if(p=z.isLineBreak)p=O,A=x,ba=T=void 0,z.hasBlockSibling?p=1:(T=p.startContainer.getAscendant(n.$block,1))&&T.is({div:1,p:1})?(ba=T.getPosition(A),
400
- ba==CKEDITOR.POSITION_IDENTICAL||ba==CKEDITOR.POSITION_CONTAINS?p=0:(A=p.splitElement(T),p.moveToPosition(A,CKEDITOR.POSITION_AFTER_START),p=1)):p=0;if(p)L=0<V;else{p=O.startPath();!z.isBlock&&h(F.editor,p.block,p.blockLimit)&&(U=k(F.editor))&&(U=r.createElement(U),U.appendBogus(),O.insertNode(U),CKEDITOR.env.needsBrFiller&&(Q=U.getBogus())&&Q.remove(),O.moveToPosition(U,CKEDITOR.POSITION_BEFORE_END));if((p=O.startPath().block)&&!p.equals(R)){if(Q=p.getBogus())Q.remove(),X.push(p);R=p}z.firstNotAllowed&&
401
- (E=1);if(E&&z.isElement){p=O.startContainer;for(A=null;p&&!n[p.getName()][z.name];){if(p.equals(x)){p=null;break}A=p;p=p.getParent()}if(p)A&&(aa=O.splitElement(A),F.zombies.push(aa),F.zombies.push(A));else{A=x.getName();ga=!V;p=V==y.length-1;A=d(z.node,A);T=[];ba=A.length;for(var ea=0,ia=void 0,ja=0,da=-1;ea<ba;ea++)ia=A[ea]," "==ia?(ja||ga&&!ea||(T.push(new CKEDITOR.dom.text(" ")),da=T.length),ja=1):(T.push(ia),ja=0);p&&da==T.length&&T.pop();ga=T}}if(ga){for(;p=ga.pop();)O.insertNode(p);ga=0}else O.insertNode(z.node);
402
- z.lastNotAllowed&&V<y.length-1&&((aa=t?ca:aa)&&O.setEndAt(aa,CKEDITOR.POSITION_AFTER_START),E=0);O.collapse()}}1!=y.length?Q=!1:(Q=y[0],Q=Q.isElement&&"false"==Q.node.getAttribute("contenteditable"));Q&&(L=!0,p=y[0].node,O.setStartAt(p,CKEDITOR.POSITION_BEFORE_START),O.setEndAt(p,CKEDITOR.POSITION_AFTER_END));F.dontMoveCaret=L;F.bogusNeededBlocks=X}Q=F.range;var fa;aa=F.bogusNeededBlocks;for(ga=Q.createBookmark();R=F.zombies.pop();)R.getParent()&&(U=Q.clone(),U.moveToElementEditStart(R),U.removeEmptyBlocksAtEnd());
390
+ n=CKEDITOR.dom.walker.whitespaces(!0);p=CKEDITOR.dom.walker.bookmark(!1,!0);q=CKEDITOR.dom.walker.empty();v=CKEDITOR.dom.walker.bogus();r=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;t=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,f,h,k,g=[],l=d.range.startContainer;e=d.range.startPath();for(var l=n[l.getName()],m=0,p=c.getChildren(),t=p.count(),q=-1,x=-1,G=0,y=e.contains(n.$list);m<
391
+ t;++m)e=p.getItem(m),a(e)?(h=e.getName(),y&&h in CKEDITOR.dtd.$list?g=g.concat(b(e,d)):(k=!!l[h],"br"!=h||!e.data("cke-eol")||m&&m!=t-1||(G=(f=m?g[m-1].node:p.getItem(m+1))&&(!a(f)||!f.is("br")),f=f&&a(f)&&n.$block[f.getName()]),-1!=q||k||(q=m),k||(x=m),g.push({isElement:1,isLineBreak:G,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:h,allowed:k}),f=G=0)):g.push({isElement:0,node:e,allowed:1});-1<q&&(g[q].firstNotAllowed=1);-1<x&&(g[x].lastNotAllowed=1);return g}function d(b,c){var e=[],
392
+ f=b.getChildren(),h=f.count(),k,g=0,l=n[c],m=!b.is(n.$inline)||b.is("br");for(m&&e.push(" ");g<h;g++)k=f.getItem(g),a(k)&&!k.is(l)?e=e.concat(d(k,c)):e.push(k);m&&e.push(" ");return e}function e(b){return a(b.startContainer)&&b.startContainer.getChild(b.startOffset-1)}function g(b){return b&&a(b)&&(b.is(n.$removeEmpty)||b.is("a")&&!b.isBlockBoundary())}function l(b,c,d,e){var f=b.clone(),h,k;f.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);(h=(new CKEDITOR.dom.walker(f)).next())&&a(h)&&p[h.getName()]&&
393
+ (k=h.getPrevious())&&a(k)&&!k.getParent().equals(b.startContainer)&&d.contains(k)&&e.contains(h)&&h.isIdentical(k)&&(h.moveChildren(k),h.remove(),l(b,c,d,e))}function m(b,c){function d(b,c){if(c.isBlock&&c.isElement&&!c.node.is("br")&&a(b)&&b.is("br"))return b.remove(),1}var e=c.endContainer.getChild(c.endOffset),f=c.endContainer.getChild(c.endOffset-1);e&&d(e,b[b.length-1]);f&&d(f,b[0])&&(c.setEnd(c.endContainer,c.endOffset-1),c.collapse())}var n=CKEDITOR.dtd,p={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,
394
+ h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},t={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},q=CKEDITOR.tools.extend({},n.$inline);delete q.br;return function(p,F,L,x){var y=p.editor,z=!1;"unfiltered_html"==F&&(F="html",z=!0);if(!x.checkReadOnly()){var r=(new CKEDITOR.dom.elementPath(x.startContainer,x.root)).blockLimit||x.root;F={type:F,dontFilter:z,editable:p,editor:y,range:x,blockLimit:r,mergeCandidates:[],zombies:[]};var z=F.range,r=F.mergeCandidates,v="html"===F.type,B,E,T,ba,ca,V;"text"==F.type&&
395
+ z.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(E=CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",z.document),z.insertNode(E),z.setStartAfter(E));T=new CKEDITOR.dom.elementPath(z.startContainer);F.endPath=ba=new CKEDITOR.dom.elementPath(z.endContainer);if(!z.collapsed){B=ba.block||ba.blockLimit;var ea=z.getCommonAncestor();B&&!B.equals(ea)&&!B.contains(ea)&&z.checkEndOfBlock()&&F.zombies.push(B);z.deleteContents()}for(;(ca=e(z))&&a(ca)&&ca.isBlockBoundary()&&T.contains(ca);)z.moveToPosition(ca,
396
+ CKEDITOR.POSITION_BEFORE_END);l(z,F.blockLimit,T,ba);E&&(z.setEndBefore(E),z.collapse(),E.remove());E=z.startPath();if(B=E.contains(g,!1,1))V=z.splitElement(B),F.inlineStylesRoot=B,F.inlineStylesPeak=E.lastElement;E=z.createBookmark();v&&(c(B),c(V));(B=E.startNode.getPrevious(f))&&a(B)&&g(B)&&r.push(B);(B=E.startNode.getNext(f))&&a(B)&&g(B)&&r.push(B);for(B=E.startNode;(B=B.getParent())&&g(B);)r.push(B);z.moveToBookmark(E);y.enterMode===CKEDITOR.ENTER_DIV&&""===y.getData(!0)&&((y=p.getFirst())&&y.remove(),
397
+ x.setStartAt(p,CKEDITOR.POSITION_AFTER_START),x.collapse(!0));if(p=L){p=F.range;if("text"==F.type&&F.inlineStylesRoot){x=F.inlineStylesPeak;y=x.getDocument().createText("{cke-peak}");for(V=F.inlineStylesRoot.getParent();!x.equals(V);)y=y.appendTo(x.clone()),x=x.getParent();L=y.getOuterHtml().split("{cke-peak}").join(L)}x=F.blockLimit.getName();if(/^\s+|\s+$/.test(L)&&"span"in CKEDITOR.dtd[x]){var X='\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';L=X+L+X}L=F.editor.dataProcessor.toHtml(L,
398
+ {context:null,fixForBody:!1,protectedWhitespaces:!!X,dontFilter:F.dontFilter,filter:F.editor.activeFilter,enterMode:F.editor.activeEnterMode});x=p.document.createElement("body");x.setHtml(L);X&&(x.getFirst().remove(),x.getLast().remove());if((X=p.startPath().block)&&(1!=X.getChildCount()||!X.getBogus()))a:{var O;if(1==x.getChildCount()&&a(O=x.getFirst())&&O.is(t)&&!O.hasAttribute("contenteditable")){X=O.getElementsByTag("*");p=0;for(V=X.count();p<V;p++)if(y=X.getItem(p),!y.is(q))break a;O.moveChildren(O.getParent(1));
399
+ O.remove()}}F.dataWrapper=x;p=L}if(p){O=F.range;p=O.document;x=F.blockLimit;V=0;var Q,X=[],R,U;L=E=0;var aa,y=O.startContainer;ca=F.endPath.elements[0];var ga,z=ca.getPosition(y),r=!!ca.getCommonAncestor(y)&&z!=CKEDITOR.POSITION_IDENTICAL&&!(z&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),y=b(F.dataWrapper,F);for(m(y,O);V<y.length;V++){z=y[V];if(v=z.isLineBreak)v=O,B=x,ba=T=void 0,z.hasBlockSibling?v=1:(T=v.startContainer.getAscendant(n.$block,1))&&T.is({div:1,p:1})?(ba=T.getPosition(B),
400
+ ba==CKEDITOR.POSITION_IDENTICAL||ba==CKEDITOR.POSITION_CONTAINS?v=0:(B=v.splitElement(T),v.moveToPosition(B,CKEDITOR.POSITION_AFTER_START),v=1)):v=0;if(v)L=0<V;else{v=O.startPath();!z.isBlock&&h(F.editor,v.block,v.blockLimit)&&(U=k(F.editor))&&(U=p.createElement(U),U.appendBogus(),O.insertNode(U),CKEDITOR.env.needsBrFiller&&(Q=U.getBogus())&&Q.remove(),O.moveToPosition(U,CKEDITOR.POSITION_BEFORE_END));if((v=O.startPath().block)&&!v.equals(R)){if(Q=v.getBogus())Q.remove(),X.push(v);R=v}z.firstNotAllowed&&
401
+ (E=1);if(E&&z.isElement){v=O.startContainer;for(B=null;v&&!n[v.getName()][z.name];){if(v.equals(x)){v=null;break}B=v;v=v.getParent()}if(v)B&&(aa=O.splitElement(B),F.zombies.push(aa),F.zombies.push(B));else{B=x.getName();ga=!V;v=V==y.length-1;B=d(z.node,B);T=[];ba=B.length;for(var ea=0,ia=void 0,ja=0,da=-1;ea<ba;ea++)ia=B[ea]," "==ia?(ja||ga&&!ea||(T.push(new CKEDITOR.dom.text(" ")),da=T.length),ja=1):(T.push(ia),ja=0);v&&da==T.length&&T.pop();ga=T}}if(ga){for(;v=ga.pop();)O.insertNode(v);ga=0}else O.insertNode(z.node);
402
+ z.lastNotAllowed&&V<y.length-1&&((aa=r?ca:aa)&&O.setEndAt(aa,CKEDITOR.POSITION_AFTER_START),E=0);O.collapse()}}1!=y.length?Q=!1:(Q=y[0],Q=Q.isElement&&"false"==Q.node.getAttribute("contenteditable"));Q&&(L=!0,v=y[0].node,O.setStartAt(v,CKEDITOR.POSITION_BEFORE_START),O.setEndAt(v,CKEDITOR.POSITION_AFTER_END));F.dontMoveCaret=L;F.bogusNeededBlocks=X}Q=F.range;var fa;aa=F.bogusNeededBlocks;for(ga=Q.createBookmark();R=F.zombies.pop();)R.getParent()&&(U=Q.clone(),U.moveToElementEditStart(R),U.removeEmptyBlocksAtEnd());
403
403
  if(aa)for(;R=aa.pop();)CKEDITOR.env.needsBrFiller?R.appendBogus():R.append(Q.document.createText(" "));for(;R=F.mergeCandidates.pop();)R.mergeSiblings();Q.moveToBookmark(ga);if(!F.dontMoveCaret){for(R=e(Q);R&&a(R)&&!R.is(n.$empty);){if(R.isBlockBoundary())Q.moveToPosition(R,CKEDITOR.POSITION_BEFORE_END);else{if(g(R)&&R.getHtml().match(/(\s|&nbsp;)$/g)){fa=null;break}fa=Q.clone();fa.moveToPosition(R,CKEDITOR.POSITION_BEFORE_END)}R=R.getLast(f)}fa&&Q.moveToRange(fa)}}}}();y=function(){function a(b){b=
404
404
  new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;0<b--;)d=a.getItem(b),CKEDITOR.tools.trim(d.getHtml())||(d.appendBogus(),CKEDITOR.env.ie&&9>CKEDITOR.env.version&&d.getChildCount()&&d.getFirst().remove())}return function(d){var e=
405
405
  d.startContainer,f=e.getAscendant("table",1),h=!1;c(f.getElementsByTag("td"));c(f.getElementsByTag("th"));f=d.clone();f.setStart(e,0);f=a(f).lastBackward();f||(f=d.clone(),f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END),f=a(f).lastForward(),h=!0);f||(f=e);f.is("table")?(d.setStartAt(f,CKEDITOR.POSITION_BEFORE_START),d.collapse(!0),f.remove()):(f.is({tbody:1,thead:1,tfoot:1})&&(f=b(f,"tr",h)),f.is("tr")&&(f=b(f,f.getParent().is("thead")?"th":"td",h)),(e=f.getBogus())&&e.remove(),d.moveToPosition(f,h?CKEDITOR.POSITION_AFTER_START:
406
406
  CKEDITOR.POSITION_BEFORE_END))}}();x=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)||a.is(CKEDITOR.dtd.$listItem)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return b}return function(b){var c=b.startContainer,d=!1,e;e=b.clone();e.setStart(c,0);e=a(e).lastBackward();e||(e=b.clone(),e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END),e=a(e).lastForward(),
407
407
  d=!0);e||(e=c);e.is(CKEDITOR.dtd.$list)?(b.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),e.remove()):((c=e.getBogus())&&c.remove(),b.moveToPosition(e,d?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),b.select())}}();z={eol:{detect:function(a,b){var c=a.range,d=c.clone(),e=c.clone(),f=new CKEDITOR.dom.elementPath(c.startContainer,b),h=new CKEDITOR.dom.elementPath(c.endContainer,b);d.collapse(1);e.collapse();f.block&&d.checkBoundaryOfElement(f.block,CKEDITOR.END)&&(c.setStartAfter(f.block),
408
- a.prependEolBr=1);h.block&&e.checkBoundaryOfElement(h.block,CKEDITOR.START)&&(c.setEndBefore(h.block),a.appendEolBr=1)},fix:function(a,b){var c=b.getDocument(),d;a.appendEolBr&&(d=this.createEolBr(c),a.fragment.append(d));!a.prependEolBr||d&&!d.getPrevious()||a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode,b=b.endNode;!b||!p(b)||c&&c.equals(b)||
408
+ a.prependEolBr=1);h.block&&e.checkBoundaryOfElement(h.block,CKEDITOR.START)&&(c.setEndBefore(h.block),a.appendEolBr=1)},fix:function(a,b){var c=b.getDocument(),d;a.appendEolBr&&(d=this.createEolBr(c),a.fragment.append(d));!a.prependEolBr||d&&!d.getPrevious()||a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode,b=b.endNode;!b||!v(b)||c&&c.equals(b)||
409
409
  a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var c=a.range,d=c.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,b),f=new CKEDITOR.dom.elementPath(c.startContainer,b),c=new CKEDITOR.dom.elementPath(c.endContainer,b),h;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var k=e.contains("table").getParent();h=function(a){return!a.equals(k)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(f=f.contains(CKEDITOR.dtd.$list),c=c.contains(CKEDITOR.dtd.$list),
410
410
  !f.equals(c))){var g=e.contains(CKEDITOR.dtd.$list).getParent();h=function(a){return!a.equals(g)}}h||(h=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a,b,d,h)},rebuildFragment:function(a,b,c,d){for(var e;c&&!c.equals(b)&&d(c);)e=c.clone(0,1),a.fragment.appendTo(e),a.fragment=e,c=c.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,c=a.endContainer,d=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(c)&&b.is("tr")&&++d==
411
- e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};A=function(){function a(b,c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var f;f=e.getNext();)f.insertAfter(d),d=f;u(c)&&c.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),f=d.endPath(),h=e.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);
411
+ e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};B=function(){function a(b,c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var f;f=e.getNext();)f.insertAfter(d),d=f;q(c)&&c.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),f=d.endPath(),h=e.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);
412
412
  a.mergeList=h&&k&&h.getParent().equals(k.getParent())&&!h.equals(k);a.mergeListItems=e.block&&f.block&&e.block.is(CKEDITOR.dtd.$listItem)&&f.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList||a.mergeListItems)d=d.clone(),d.setStartBefore(a.bookmark.startNode),d.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=d.createBookmark()},merge:function(a,c){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,f=new CKEDITOR.dom.elementPath(d,c),h=new CKEDITOR.dom.elementPath(e,
413
413
  c);if(a.mergeList){var k=f.contains(CKEDITOR.dtd.$list),g=h.contains(CKEDITOR.dtd.$list);k.equals(g)||(g.moveChildren(k),g.remove())}a.mergeListItems&&(f=f.contains(CKEDITOR.dtd.$listItem),h=h.contains(CKEDITOR.dtd.$listItem),f.equals(h)||b(h,d,e));d.remove();e.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var c=new CKEDITOR.dom.range(b);c.setStartBefore(a.bookmark.startNode);c.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=c.createBookmark()}},
414
414
  merge:function(a,c){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,f=new CKEDITOR.dom.elementPath(d,c),h=new CKEDITOR.dom.elementPath(e,c),f=f.block,h=h.block;f&&h&&!f.equals(h)&&b(h,d,e);d.remove();e.remove()}}},table:function(){function a(c){var e=[],f,h=new CKEDITOR.dom.walker(c),k=c.startPath().contains(d),g=c.endPath().contains(d),l={};h.guard=function(a,h){if(a.type==CKEDITOR.NODE_ELEMENT){var m="visited_"+(h?"out":"in");if(a.getCustomData(m))return;
415
- CKEDITOR.dom.element.setMarker(l,a,m,1)}if(h&&k&&a.equals(k))f=c.clone(),f.setEndAt(k,CKEDITOR.POSITION_BEFORE_END),e.push(f);else if(!h&&g&&a.equals(g))f=c.clone(),f.setStartAt(g,CKEDITOR.POSITION_AFTER_START),e.push(f);else{if(m=!h)m=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!k||b(a,k))&&(!g||b(a,g));if(!m&&(m=h))if(a.is(d))var m=k&&k.getAscendant("table",!0),n=g&&g.getAscendant("table",!0),r=a.getAscendant("table",!0),m=m&&m.contains(r)||n&&n.contains(r);else m=void 0;m&&(f=c.clone(),f.selectNodeContents(a),
415
+ CKEDITOR.dom.element.setMarker(l,a,m,1)}if(h&&k&&a.equals(k))f=c.clone(),f.setEndAt(k,CKEDITOR.POSITION_BEFORE_END),e.push(f);else if(!h&&g&&a.equals(g))f=c.clone(),f.setStartAt(g,CKEDITOR.POSITION_AFTER_START),e.push(f);else{if(m=!h)m=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!k||b(a,k))&&(!g||b(a,g));if(!m&&(m=h))if(a.is(d))var m=k&&k.getAscendant("table",!0),n=g&&g.getAscendant("table",!0),p=a.getAscendant("table",!0),m=m&&m.contains(p)||n&&n.contains(p);else m=void 0;m&&(f=c.clone(),f.selectNodeContents(a),
416
416
  e.push(f))}};h.lastForward();CKEDITOR.dom.element.clearAllMarkers(l);return e}function b(a,c){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(c);return e===CKEDITOR.POSITION_IDENTICAL?!1:0===(e&d)}var d={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,c=b.clone();c.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=new CKEDITOR.dom.walker(c),e=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};c.checkForward();if(1<e){var c=b.startPath().contains("table"),
417
417
  f=b.endPath().contains("table");c&&f&&b.checkBoundaryOfElement(c,CKEDITOR.START)&&b.checkBoundaryOfElement(f,CKEDITOR.END)&&(b=a.range.clone(),b.setStartBefore(c),b.setEndAfter(f),a.purgeTableBookmark=b.createBookmark())}},detectRanges:function(e,f){var h=c(f,e.bookmark),k=h.clone(),g,l,m=h.getCommonAncestor();m.is(CKEDITOR.dtd.$tableContent)&&!m.is(d)&&(m=m.getAscendant("table",!0));l=m;m=new CKEDITOR.dom.elementPath(h.startContainer,l);l=new CKEDITOR.dom.elementPath(h.endContainer,l);m=m.contains("table");
418
418
  l=l.contains("table");if(m||l)m&&l&&b(m,l)?(e.tableSurroundingRange=k,k.setStartAt(m,CKEDITOR.POSITION_AFTER_END),k.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),k=h.clone(),k.setEndAt(m,CKEDITOR.POSITION_AFTER_END),g=h.clone(),g.setStartAt(l,CKEDITOR.POSITION_BEFORE_START),g=a(k).concat(a(g))):m?l||(e.tableSurroundingRange=k,k.setStartAt(m,CKEDITOR.POSITION_AFTER_END),h.setEndAt(m,CKEDITOR.POSITION_AFTER_END)):(e.tableSurroundingRange=k,k.setEndAt(l,CKEDITOR.POSITION_BEFORE_START),h.setStartAt(l,CKEDITOR.POSITION_AFTER_START)),
419
- e.tableContentsRanges=g?g:a(h)},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();)b.extractContents(),u(b.startContainer)&&b.startContainer.appendBogus();a.tableSurroundingRange&&a.tableSurroundingRange.extractContents()},purge:function(a){if(a.purgeTableBookmark){var b=a.doc,c=a.range.clone(),b=b.createElement("p");b.insertBefore(a.purgeTableBookmark.startNode);c.moveToBookmark(a.purgeTableBookmark);c.deleteContents();a.range.moveToPosition(b,CKEDITOR.POSITION_AFTER_START)}}}}(),
419
+ e.tableContentsRanges=g?g:a(h)},deleteRanges:function(a){for(var b;b=a.tableContentsRanges.pop();)b.extractContents(),q(b.startContainer)&&b.startContainer.appendBogus();a.tableSurroundingRange&&a.tableSurroundingRange.extractContents()},purge:function(a){if(a.purgeTableBookmark){var b=a.doc,c=a.range.clone(),b=b.createElement("p");b.insertBefore(a.purgeTableBookmark.startNode);c.moveToBookmark(a.purgeTableBookmark);c.deleteContents();a.range.moveToPosition(b,CKEDITOR.POSITION_AFTER_START)}}}}(),
420
420
  detectExtractMerge:function(a){return!(a.range.startPath().contains(CKEDITOR.dtd.$listItem)&&a.range.endPath().contains(CKEDITOR.dtd.$listItem))},fixUneditableRangePosition:function(a){a.startContainer.getDtd()["#"]||a.moveToClosestEditablePosition(null,!0)},autoParagraph:function(a,b){var c=b.startPath(),d;h(a,c.block,c.blockLimit)&&(d=k(a))&&(d=b.document.createElement(d),d.appendBogus(),b.insertNode(d),b.moveToPosition(d,CKEDITOR.POSITION_AFTER_START))}}}()})();(function(){function a(a){return CKEDITOR.plugins.widget&&
421
421
  CKEDITOR.plugins.widget.isDomWidget(a)}function l(b,c){if(0===b.length||a(b[0].getEnclosedNode()))return!1;var d,e;if((d=!c&&1===b.length)&&!(d=b[0].collapsed)){var f=b[0];d=f.startContainer.getAscendant({td:1,th:1},!0);var h=f.endContainer.getAscendant({td:1,th:1},!0);e=CKEDITOR.tools.trim;d&&d.equals(h)&&!d.findOne("td, th, tr, tbody, table")?(f=f.cloneContents(),d=f.getFirst()?e(f.getFirst().getText())!==e(d.getText()):!0):d=!1}if(d)return!1;for(e=0;e<b.length;e++)if(d=b[e]._getTableElement(),
422
422
  !d)return!1;return!0}function g(a){function b(a){a=a.find("td, th");var c=[],d;for(d=0;d<a.count();d++)c.push(a.getItem(d));return c}var c=[],d,e;for(e=0;e<a.length;e++)d=a[e]._getTableElement(),d.is&&d.is({td:1,th:1})?c.push(d):c=c.concat(b(d));return c}function f(a){a=g(a);var b="",c=[],d,e;for(e=0;e<a.length;e++)d&&!d.equals(a[e].getAscendant("tr"))?(b+=c.join("\t")+"\n",d=a[e].getAscendant("tr"),c=[]):0===e&&(d=a[e].getAscendant("tr")),c.push(a[e].getText());return b+=c.join("\t")}function e(a){var b=
423
- this.root.editor,c=b.getSelection(1);this.reset();A=!0;c.root.once("selectionchange",function(a){a.cancel()},null,null,0);c.selectRanges([a[0]]);c=this._.cache;c.ranges=new CKEDITOR.dom.rangeList(a);c.type=CKEDITOR.SELECTION_TEXT;c.selectedElement=a[0]._getTableElement();c.selectedText=f(a);c.nativeSel=null;this.isFake=1;this.rev=y++;b._.fakeSelection=this;A=!1;this.root.fire("selectionchange")}function m(){var b=this._.fakeSelection,c;if(b){c=this.getSelection(1);var d;if(!(d=!c)&&(d=!c.isHidden())){d=
423
+ this.root.editor,c=b.getSelection(1);this.reset();B=!0;c.root.once("selectionchange",function(a){a.cancel()},null,null,0);c.selectRanges([a[0]]);c=this._.cache;c.ranges=new CKEDITOR.dom.rangeList(a);c.type=CKEDITOR.SELECTION_TEXT;c.selectedElement=a[0]._getTableElement();c.selectedText=f(a);c.nativeSel=null;this.isFake=1;this.rev=y++;b._.fakeSelection=this;B=!1;this.root.fire("selectionchange")}function m(){var b=this._.fakeSelection,c;if(b){c=this.getSelection(1);var d;if(!(d=!c)&&(d=!c.isHidden())){d=
424
424
  b;var e=c.getRanges(),f=d.getRanges(),h=e.length&&e[0]._getTableElement()&&e[0]._getTableElement().getAscendant("table",!0),k=f.length&&f[0]._getTableElement()&&f[0]._getTableElement().getAscendant("table",!0),g=1===e.length&&e[0]._getTableElement()&&e[0]._getTableElement().is("table"),m=1===f.length&&f[0]._getTableElement()&&f[0]._getTableElement().is("table");if(a(d.getSelectedElement()))d=!1;else{var n=1===e.length&&e[0].collapsed,f=l(e,!!CKEDITOR.env.webkit)&&l(f);h=h&&k?h.equals(k)||k.contains(h):
425
425
  !1;h&&(n||f)?(g&&!m&&d.selectRanges(e),d=!0):d=!1}d=!d}d&&(b.reset(),b=0)}if(!b&&(b=c||this.getSelection(1),!b||b.getType()==CKEDITOR.SELECTION_NONE))return;this.fire("selectionCheck",b);c=this.elementPath();c.compare(this._.selectionPreviousPath)||(d=this._.selectionPreviousPath&&this._.selectionPreviousPath.blockLimit.equals(c.blockLimit),!CKEDITOR.env.webkit&&!CKEDITOR.env.gecko||d||(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=c,this.fire("selectionChange",{selection:b,
426
- path:c}))}function h(){v=!0;w||(k.call(this),w=CKEDITOR.tools.setTimeout(k,200,this))}function k(){w=null;v&&(CKEDITOR.tools.setTimeout(m,0,this),v=!1)}function c(a){return D(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?!0:!1}function d(a){function b(c,d){return c&&c.type!=CKEDITOR.NODE_TEXT?a.clone()["moveToElementEdit"+(d?"End":"Start")](c):!1}if(!(a.root instanceof CKEDITOR.editable))return!1;var d=a.startContainer,e=a.getPreviousNode(c,null,d),f=a.getNextNode(c,null,d);return b(e)||
426
+ path:c}))}function h(){u=!0;w||(k.call(this),w=CKEDITOR.tools.setTimeout(k,200,this))}function k(){w=null;u&&(CKEDITOR.tools.setTimeout(m,0,this),u=!1)}function c(a){return D(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?!0:!1}function d(a){function b(c,d){return c&&c.type!=CKEDITOR.NODE_TEXT?a.clone()["moveToElementEdit"+(d?"End":"Start")](c):!1}if(!(a.root instanceof CKEDITOR.editable))return!1;var d=a.startContainer,e=a.getPreviousNode(c,null,d),f=a.getNextNode(c,null,d);return b(e)||
427
427
  b(f,1)||!(e||f||d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()&&d.getBogus())?!0:!1}function b(a){n(a,!1);var b=a.getDocument().createText(x);a.setCustomData("cke-fillingChar",b);return b}function n(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(!1!==b){var d=a.getDocument().getSelection().getNative(),e=d&&"None"!=d.type&&d.getRangeAt(0),f=x.length;if(c.getLength()>f&&e&&e.intersectsNode(c.$)){var h=[{node:d.anchorNode,offset:d.anchorOffset},{node:d.focusNode,offset:d.focusOffset}];
428
- d.anchorNode==c.$&&d.anchorOffset>f&&(h[0].offset-=f);d.focusNode==c.$&&d.focusOffset>f&&(h[1].offset-=f)}}c.setText(r(c.getText(),1));h&&(c=a.getDocument().$,d=c.getSelection(),c=c.createRange(),c.setStart(h[0].node,h[0].offset),c.collapse(!0),d.removeAllRanges(),d.addRange(c),d.extend(h[1].node,h[1].offset))}}function r(a,b){return b?a.replace(z,function(a,b){return b?" ":""}):a.replace(x,"")}function u(a,b){var c=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;",c=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+
428
+ d.anchorNode==c.$&&d.anchorOffset>f&&(h[0].offset-=f);d.focusNode==c.$&&d.focusOffset>f&&(h[1].offset-=f)}}c.setText(p(c.getText(),1));h&&(c=a.getDocument().$,d=c.getSelection(),c=c.createRange(),c.setStart(h[0].node,h[0].offset),c.collapse(!0),d.removeAllRanges(),d.addRange(c),d.extend(h[1].node,h[1].offset))}}function p(a,b){return b?a.replace(z,function(a,b){return b?" ":""}):a.replace(x,"")}function q(a,b){var c=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;",c=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+
429
429
  (CKEDITOR.env.ie&&14>CKEDITOR.env.version?"display:none":"position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;")+'"\x3e'+c+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(c);var d=a.getSelection(1),e=a.createRange(),f=d.root.on("selectionchange",function(a){a.cancel()},null,null,0);e.setStartAt(c,CKEDITOR.POSITION_AFTER_START);e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);d.selectRanges([e]);f.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=
430
- c}function p(a){var b={37:1,39:1,8:1,46:1};return function(c){var d=c.data.getKeystroke();if(b[d]){var e=a.getSelection().getRanges(),f=e[0];1==e.length&&f.collapsed&&(d=f[38>d?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&"false"==d.getAttribute("contenteditable")&&(a.getSelection().fake(d),c.data.preventDefault(),c.cancel())}}}function t(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=
430
+ c}function v(a){var b={37:1,39:1,8:1,46:1};return function(c){var d=c.data.getKeystroke();if(b[d]){var e=a.getSelection().getRanges(),f=e[0];1==e.length&&f.collapsed&&(d=f[38>d?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&"false"==d.getAttribute("contenteditable")&&(a.getSelection().fake(d),c.data.preventDefault(),c.cancel())}}}function r(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=
431
431
  c.startContainer,e;d&&!((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly());)e&&"false"==d.getAttribute("contentEditable")&&c.setStartAfter(d),d=d.getParent();d=c.startContainer;e=c.endContainer;var f=c.startOffset,h=c.endOffset,k=c.clone();d&&d.type==CKEDITOR.NODE_TEXT&&(f>=d.getLength()?k.setStartAfter(d):k.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(h?k.setEndAfter(e):k.setEndBefore(e));d=new CKEDITOR.dom.walker(k);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&
432
- d.isReadOnly()){var e=c.clone();c.setEndBefore(d);c.collapsed&&a.splice(b--,1);d.getPosition(k.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(d),e.collapsed||a.splice(b+1,0,e));return!0}return!1};d.next()}}return a}var q="function"!=typeof window.getSelection,y=1,x=CKEDITOR.tools.repeat("​",7),z=new RegExp(x+"( )?","g"),A,w,v,D=CKEDITOR.dom.walker.invisible(1),B=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);
432
+ d.isReadOnly()){var e=c.clone();c.setEndBefore(d);c.collapsed&&a.splice(b--,1);d.getPosition(k.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(d),e.collapsed||a.splice(b+1,0,e));return!0}return!1};d.next()}}return a}var t="function"!=typeof window.getSelection,y=1,x=CKEDITOR.tools.repeat("​",7),z=new RegExp(x+"( )?","g"),B,w,u,D=CKEDITOR.dom.walker.invisible(1),C=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);
433
433
  return!1}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!c.readOnly)return(e=d.moveToClosestEditablePosition(b.selected,a))||(e=d.moveToClosestEditablePosition(b.selected,!a)),e&&c.getSelection().selectRanges([d]),c.fire("saveSnapshot"),b.selected.remove(),e||(d.moveToElementEditablePosition(c.editable()),c.getSelection().selectRanges([d])),c.fire("saveSnapshot"),!1}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=
434
- c.getSelection();a&&a.removeAllRanges()}var c=a.editor;c.on("contentDom",function(){function a(){u=new CKEDITOR.dom.selection(c.getSelection());u.lock()}function b(){k.removeListener("mouseup",b);r.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,c=a.createRange();"None"!=a.type&&c.parentElement()&&c.parentElement().ownerDocument==f.$&&c.select()}function d(a){var b,c;b=(b=this.document.getActive())?"input"===b.getName()||"textarea"===b.getName():!1;b||(b=this.getSelection(1),(c=e(b))&&
435
- !c.equals(g)&&(b.selectElement(c),a.data.preventDefault()))}function e(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var f=c.document,k=CKEDITOR.document,g=c.editable(),l=f.getBody(),r=f.getDocumentElement(),v=g.isInline(),x,u;CKEDITOR.env.gecko&&g.attachListener(g,"focus",function(a){a.removeListener();0!==x&&(a=c.getSelection().getNative())&&
434
+ c.getSelection();a&&a.removeAllRanges()}var c=a.editor;c.on("contentDom",function(){function a(){q=new CKEDITOR.dom.selection(c.getSelection());q.lock()}function b(){k.removeListener("mouseup",b);p.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,c=a.createRange();"None"!=a.type&&c.parentElement()&&c.parentElement().ownerDocument==f.$&&c.select()}function d(a){var b,c;b=(b=this.document.getActive())?"input"===b.getName()||"textarea"===b.getName():!1;b||(b=this.getSelection(1),(c=e(b))&&
435
+ !c.equals(g)&&(b.selectElement(c),a.data.preventDefault()))}function e(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")},!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var f=c.document,k=CKEDITOR.document,g=c.editable(),l=f.getBody(),p=f.getDocumentElement(),u=g.isInline(),x,q;CKEDITOR.env.gecko&&g.attachListener(g,"focus",function(a){a.removeListener();0!==x&&(a=c.getSelection().getNative())&&
436
436
  a.isCollapsed&&a.anchorNode==g.$&&(a=c.createRange(),a.moveToElementEditStart(g),a.select())},null,null,-2);g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(x&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){x=c._.previousActive&&c._.previousActive.equals(f.getActive());var a=null!=c._.previousScrollTop&&c._.previousScrollTop!=g.$.scrollTop;CKEDITOR.env.webkit&&x&&a&&(g.$.scrollTop=c._.previousScrollTop)}c.unlockSelection(x);x=0},null,null,-1);g.attachListener(g,
437
- "mousedown",function(){x=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||v)q?g.attachListener(g,"beforedeactivate",a,null,null,-1):g.attachListener(c,"selectionCheck",a,null,null,-1),g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusout":"blur",function(){var a=u&&(u.isFake||2>u.getRanges().length);CKEDITOR.env.gecko&&!v&&a||(c.lockSelection(u),x=1)},null,null,-1),g.attachListener(g,"mousedown",function(){x=0});if(CKEDITOR.env.ie&&!v){var y;g.attachListener(g,"mousedown",function(a){2==
438
- a.data.$.button&&((a=c.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(y=c.window.getScrollPosition()))});g.attachListener(g,"mouseup",function(a){2==a.data.$.button&&y&&(c.document.$.documentElement.scrollLeft=y.x,c.document.$.documentElement.scrollTop=y.y);y=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var z,w;r.on("mousedown",function(a){function b(a){a=a.data.$;if(z){var c=l.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(d){}z.setEndPoint(0>
439
- w.compareEndPoints("StartToStart",c)?"EndToEnd":"StartToStart",c);z.select()}}function c(){r.removeListener("mousemove",b);k.removeListener("mouseup",c);r.removeListener("mouseup",c);z.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<r.$.clientHeight&&a.$.x<r.$.clientWidth){z=l.$.createTextRange();try{z.moveToPoint(a.$.clientX,a.$.clientY)}catch(d){}w=z.duplicate();r.on("mousemove",b);k.on("mouseup",c);r.on("mouseup",c)}})}if(7<CKEDITOR.env.version&&11>CKEDITOR.env.version)r.on("mousedown",function(a){a.data.getTarget().is("html")&&
440
- (k.on("mouseup",b),r.on("mouseup",b))})}}g.attachListener(g,"selectionchange",m,c);g.attachListener(g,"keyup",h,c);g.attachListener(g,"touchstart",h,c);g.attachListener(g,"touchend",h,c);CKEDITOR.env.ie&&g.attachListener(g,"keydown",d,c);g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){c.forceNextSelectionCheck();c.selectionChange(1)});if(v&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var t;g.attachListener(g,"mousedown",function(){t=1});g.attachListener(f.getDocumentElement(),
441
- "mouseup",function(){t&&h.call(c);t=0})}else g.attachListener(CKEDITOR.env.ie?g:f.getDocumentElement(),"mouseup",h,c);CKEDITOR.env.webkit&&g.attachListener(f,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:g.hasFocus&&n(g)}},null,null,-1);g.attachListener(g,"keydown",p(c),null,null,-1)});c.on("setData",function(){c.unlockSelection();CKEDITOR.env.webkit&&b()});c.on("contentDomUnload",function(){c.unlockSelection()});if(CKEDITOR.env.ie9Compat)c.on("beforeDestroy",
437
+ "mousedown",function(){x=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||u)t?g.attachListener(g,"beforedeactivate",a,null,null,-1):g.attachListener(c,"selectionCheck",a,null,null,-1),g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusout":"blur",function(){var a=q&&(q.isFake||2>q.getRanges().length);CKEDITOR.env.gecko&&!u&&a||(c.lockSelection(q),x=1)},null,null,-1),g.attachListener(g,"mousedown",function(){x=0});if(CKEDITOR.env.ie&&!u){var y;g.attachListener(g,"mousedown",function(a){2==
438
+ a.data.$.button&&((a=c.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(y=c.window.getScrollPosition()))});g.attachListener(g,"mouseup",function(a){2==a.data.$.button&&y&&(c.document.$.documentElement.scrollLeft=y.x,c.document.$.documentElement.scrollTop=y.y);y=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var w,z;p.on("mousedown",function(a){function b(a){a=a.data.$;if(w){var c=l.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(d){}w.setEndPoint(0>
439
+ z.compareEndPoints("StartToStart",c)?"EndToEnd":"StartToStart",c);w.select()}}function c(){p.removeListener("mousemove",b);k.removeListener("mouseup",c);p.removeListener("mouseup",c);w.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<p.$.clientHeight&&a.$.x<p.$.clientWidth){w=l.$.createTextRange();try{w.moveToPoint(a.$.clientX,a.$.clientY)}catch(d){}z=w.duplicate();p.on("mousemove",b);k.on("mouseup",c);p.on("mouseup",c)}})}if(7<CKEDITOR.env.version&&11>CKEDITOR.env.version)p.on("mousedown",function(a){a.data.getTarget().is("html")&&
440
+ (k.on("mouseup",b),p.on("mouseup",b))})}}g.attachListener(g,"selectionchange",m,c);g.attachListener(g,"keyup",h,c);g.attachListener(g,"touchstart",h,c);g.attachListener(g,"touchend",h,c);CKEDITOR.env.ie&&g.attachListener(g,"keydown",d,c);g.attachListener(g,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){c.forceNextSelectionCheck();c.selectionChange(1)});if(u&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var r;g.attachListener(g,"mousedown",function(){r=1});g.attachListener(f.getDocumentElement(),
441
+ "mouseup",function(){r&&h.call(c);r=0})}else g.attachListener(CKEDITOR.env.ie?g:f.getDocumentElement(),"mouseup",h,c);CKEDITOR.env.webkit&&g.attachListener(f,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:g.hasFocus&&n(g)}},null,null,-1);g.attachListener(g,"keydown",v(c),null,null,-1)});c.on("setData",function(){c.unlockSelection();CKEDITOR.env.webkit&&b()});c.on("contentDomUnload",function(){c.unlockSelection()});if(CKEDITOR.env.ie9Compat)c.on("beforeDestroy",
442
442
  b,null,null,9);c.on("dataReady",function(){delete c._.fakeSelection;delete c._.hiddenSelectionContainer;c.selectionChange(1)});c.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=c.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&&(b.remove(),CKEDITOR.env.gecko&&(a=c.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);c.on("key",function(a){if("wysiwyg"==c.mode){var b=c.getSelection();if(b.isFake){var d=
443
- B[a.data.keyCode];if(d)return d({editor:c,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),c=a.getCustomData("cke-fillingChar");c&&(c.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){n(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=r(a.data))},
444
- b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=r(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?m:h).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection||a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.getSelectedRanges=function(a){var b=this.getSelection();return b&&b.getRanges(a)||
443
+ C[a.data.keyCode];if(d)return d({editor:c,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),c=a.getCustomData("cke-fillingChar");c&&(c.getCustomData("ready")?(n(a),a.editor.fire("selectionCheck")):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){n(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=p(a.data))},
444
+ b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=p(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?m:h).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection||a?(a=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.getSelectedRanges=function(a){var b=this.getSelection();return b&&b.getRanges(a)||
445
445
  []};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);return a.getType()!=CKEDITOR.SELECTION_NONE?(!a.isLocked&&a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;return b?(b.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};
446
446
  CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:y++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=
447
447
  c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b)return CKEDITOR.tools.extend(this._.cache,b._.cache),this.isFake=b.isFake,this.isLocked=b.isLocked,this;a=this.getNative();var d,e;if(a)if(a.getRangeAt)d=(e=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(f){}d=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!d||d.type!=CKEDITOR.NODE_ELEMENT&&d.type!=CKEDITOR.NODE_TEXT||!this.root.equals(d)&&!this.root.contains(d))this._.cache.type=
448
- CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var C={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:r,_createFillingCharSequenceNode:b,FILLING_CHAR_SEQUENCE:x});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==
449
- this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=q?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:q?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;"Text"==d&&(b=CKEDITOR.SELECTION_TEXT);"Control"==d&&(b=CKEDITOR.SELECTION_ELEMENT);c.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=
450
- CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==c.rangeCount){var c=c.getRangeAt(0),d=c.startContainer;d==c.endContainer&&1==d.nodeType&&1==c.endOffset-c.startOffset&&C[d.childNodes[c.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=q?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,
451
- offset:0};for(var e=d.children,f,h,k=b.duplicate(),g=0,l=e.length-1,m=-1,n,r;g<=l;)if(m=Math.floor((g+l)/2),f=e[m],k.moveToElementText(f),n=k.compareEndPoints("StartToStart",b),0<n)l=m-1;else if(0>n)g=m+1;else return{container:d,offset:a(f)};if(-1==m||m==e.length-1&&0>n){k.moveToElementText(d);k.setEndPoint("StartToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!k)return f=e[e.length-1],f.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length};
452
- for(d=e.length;0<k&&0<d;)h=e[--d],h.nodeType==CKEDITOR.NODE_TEXT&&(r=h,k-=h.nodeValue.length);return{container:r,offset:-k}}k.collapse(0<n?!0:!1);k.setEndPoint(0<n?"StartToStart":"EndToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;if(!k)return{container:d,offset:a(f)+(0<n?0:1)};for(;0<k;)try{h=f[0<n?"previousSibling":"nextSibling"],h.nodeType==CKEDITOR.NODE_TEXT&&(k-=h.nodeValue.length,r=h),f=h}catch(q){return{container:d,offset:a(f)}}return{container:r,offset:0<n?-k:r.nodeValue.length+k}};
448
+ CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var A={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:p,_createFillingCharSequenceNode:b,FILLING_CHAR_SEQUENCE:x});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==
449
+ this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=t?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:t?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;"Text"==d&&(b=CKEDITOR.SELECTION_TEXT);"Control"==d&&(b=CKEDITOR.SELECTION_ELEMENT);c.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=
450
+ CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==c.rangeCount){var c=c.getRangeAt(0),d=c.startContainer;d==c.endContainer&&1==d.nodeType&&1==c.endOffset-c.startOffset&&A[d.childNodes[c.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=t?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,
451
+ offset:0};for(var e=d.children,f,h,k=b.duplicate(),g=0,l=e.length-1,m=-1,n,p;g<=l;)if(m=Math.floor((g+l)/2),f=e[m],k.moveToElementText(f),n=k.compareEndPoints("StartToStart",b),0<n)l=m-1;else if(0>n)g=m+1;else return{container:d,offset:a(f)};if(-1==m||m==e.length-1&&0>n){k.moveToElementText(d);k.setEndPoint("StartToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!k)return f=e[e.length-1],f.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length};
452
+ for(d=e.length;0<k&&0<d;)h=e[--d],h.nodeType==CKEDITOR.NODE_TEXT&&(p=h,k-=h.nodeValue.length);return{container:p,offset:-k}}k.collapse(0<n?!0:!1);k.setEndPoint(0<n?"StartToStart":"EndToStart",b);k=k.text.replace(/(\r\n|\r)/g,"\n").length;if(!k)return{container:d,offset:a(f)+(0<n?0:1)};for(;0<k;)try{h=f[0<n?"previousSibling":"nextSibling"],h.nodeType==CKEDITOR.NODE_TEXT&&(k-=h.nodeValue.length,p=h),f=h}catch(t){return{container:d,offset:a(f)}}return{container:p,offset:0<n?-k:p.nodeValue.length+k}};
453
453
  return function(){var a=this.getNative(),c=a&&a.createRange(),d=this.getType();if(!a)return[];if(d==CKEDITOR.SELECTION_TEXT)return a=new CKEDITOR.dom.range(this.root),d=b(c,!0),a.setStart(new CKEDITOR.dom.node(d.container),d.offset),d=b(c),a.setEnd(new CKEDITOR.dom.node(d.container),d.offset),a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse(),[a];if(d==CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e<c.length;e++){for(var f=
454
454
  c.item(e),h=f.parentNode,k=0,a=new CKEDITOR.dom.range(this.root);k<h.childNodes.length&&h.childNodes[k]!=f;k++);a.setStart(new CKEDITOR.dom.node(h),k);a.setEnd(new CKEDITOR.dom.node(h),k+1);d.push(a)}return d}return[]}}():function(){var a=[],b,c=this.getNative();if(!c)return a;for(var d=0;d<c.rangeCount;d++){var e=c.getRangeAt(d);b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};
455
- return function(b){var c=this._.cache,d=c.ranges;d||(c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this)));return b?t(new CKEDITOR.dom.rangeList(d.slice())):d}}(),getStartElement:function(){var a=this._.cache;if(void 0!==a.startElement)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var c=this.getRanges()[0];if(c){if(c.collapsed)b=c.startContainer,b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());else{for(c.optimize();b=
455
+ return function(b){var c=this._.cache,d=c.ranges;d||(c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this)));return b?r(new CKEDITOR.dom.rangeList(d.slice())):d}}(),getStartElement:function(){var a=this._.cache;if(void 0!==a.startElement)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var c=this.getRanges()[0];if(c){if(c.collapsed)b=c.startContainer,b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());else{for(c.optimize();b=
456
456
  c.startContainer,c.startOffset==(b.getChildCount?b.getChildCount():b.getLength())&&!b.isBlockBoundary();)c.setStartAfter(b);b=c.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();if((b=b.getChild(c.startOffset))&&b.type==CKEDITOR.NODE_ELEMENT)for(c=b.getFirst();c&&c.type==CKEDITOR.NODE_ELEMENT;)b=c,c=c.getFirst();else b=c.startContainer}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(void 0!==a.selectedElement)return a.selectedElement;
457
- var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),c,d,e=2;e&&!((c=a.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&C[c.getName()]&&(d=c));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;if(void 0!==a.selectedText)return a.selectedText;var b=this.getNative(),b=q?"Control"==b.type?"":b.createRange().text:
457
+ var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),c,d,e=2;e&&!((c=a.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&A[c.getName()]&&(d=c));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;if(void 0!==a.selectedText)return a.selectedText;var b=this.getNative(),b=t?"Control"==b.type?"":b.createRange().text:
458
458
  b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement();this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),c=this.getRanges(),d=this.isFake;this.isLocked=0;this.reset();a&&(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",1)&&((a=this.root.editor)&&a.plugins.tableselection&&a.plugins.tableselection.isSupportedEnvironment(a)&&l(c)?e.call(this,
459
459
  c):d?this.fake(b):b&&2>c.length?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection)if(this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=y++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);
460
- b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var c=this.root.editor,f=c&&c._.hiddenSelectionContainer;this.reset();if(f)for(var f=this.root,h,k=0;k<a.length;++k)h=a[k],h.endContainer.equals(f)&&(h.endOffset=Math.min(h.endOffset,f.getChildCount()));if(a.length)if(this.isLocked){var g=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();g&&!g.equals(this.root)&&g.focus()}else{var m;a:{var r,v;if(1==a.length&&!(v=a[0]).collapsed&&(m=v.getEnclosedNode())&&
461
- m.type==CKEDITOR.NODE_ELEMENT&&(v=v.clone(),v.shrink(CKEDITOR.SHRINK_ELEMENT,!0),(r=v.getEnclosedNode())&&r.type==CKEDITOR.NODE_ELEMENT&&(m=r),"false"==m.getAttribute("contenteditable")))break a;m=void 0}if(m)this.fake(m);else if(c&&c.plugins.tableselection&&c.plugins.tableselection.isSupportedEnvironment(c)&&l(a)&&!A&&!a[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored"))e.call(this,a);else{if(q){r=CKEDITOR.dom.walker.whitespaces(!0);m=/\ufeff|\u00a0/;v={table:1,tbody:1,
462
- tr:1};1<a.length&&(c=a[a.length-1],a[0].setEnd(c.endContainer,c.endOffset));c=a[0];a=c.collapsed;var x,u,y;if((f=c.getEnclosedNode())&&f.type==CKEDITOR.NODE_ELEMENT&&f.getName()in C&&(!f.is("a")||!f.getText()))try{y=f.$.createControlRange();y.addElement(f.$);y.select();return}catch(z){}if(c.startContainer.type==CKEDITOR.NODE_ELEMENT&&c.startContainer.getName()in v||c.endContainer.type==CKEDITOR.NODE_ELEMENT&&c.endContainer.getName()in v)c.shrink(CKEDITOR.NODE_ELEMENT,!0),a=c.collapsed;y=c.createBookmark();
463
- v=y.startNode;a||(g=y.endNode);y=c.document.$.body.createTextRange();y.moveToElementText(v.$);y.moveStart("character",1);g?(m=c.document.$.body.createTextRange(),m.moveToElementText(g.$),y.setEndPoint("EndToEnd",m),y.moveEnd("character",-1)):(x=v.getNext(r),u=v.hasAscendant("pre"),x=!(x&&x.getText&&x.getText().match(m))&&(u||!v.hasPrevious()||v.getPrevious().is&&v.getPrevious().is("br")),u=c.document.createElement("span"),u.setHtml("\x26#65279;"),u.insertBefore(v),x&&c.document.createText("").insertBefore(v));
464
- c.setStartBefore(v);v.remove();a?(x?(y.moveStart("character",-1),y.select(),c.document.$.selection.clear()):y.select(),c.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START),u.remove()):(c.setEndBefore(g),g.remove(),y.select())}else{g=this.getNative();if(!g)return;this.removeAllRanges();for(y=0;y<a.length;y++){if(y<a.length-1&&(x=a[y],u=a[y+1],m=x.clone(),m.setStart(x.endContainer,x.endOffset),m.setEnd(u.startContainer,u.startOffset),!m.collapsed&&(m.shrink(CKEDITOR.NODE_ELEMENT,!0),c=m.getCommonAncestor(),
465
- m=m.getEnclosedNode(),c.isReadOnly()||m&&m.isReadOnly()))){u.setStart(x.startContainer,x.startOffset);a.splice(y--,1);continue}c=a[y];u=this.document.$.createRange();c.collapsed&&CKEDITOR.env.webkit&&d(c)&&(m=b(this.root),c.insertNode(m),(x=m.getNext())&&!m.getPrevious()&&x.type==CKEDITOR.NODE_ELEMENT&&"br"==x.getName()?(n(this.root),c.moveToPosition(x,CKEDITOR.POSITION_BEFORE_START)):c.moveToPosition(m,CKEDITOR.POSITION_AFTER_END));u.setStart(c.startContainer.$,c.startOffset);try{u.setEnd(c.endContainer.$,
466
- c.endOffset)}catch(w){if(0<=w.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))c.collapse(1),u.setEnd(c.endContainer.$,c.endOffset);else throw w;}g.addRange(u)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a,b){var c=this.root.editor;void 0===b&&a.hasAttribute("aria-label")&&(b=a.getAttribute("aria-label"));this.reset();u(c,b);var d=this._.cache,e=new CKEDITOR.dom.range(this.root);e.setStartBefore(a);e.setEndAfter(a);d.ranges=new CKEDITOR.dom.rangeList(e);d.selectedElement=d.startElement=
460
+ b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var c=this.root.editor,f=c&&c._.hiddenSelectionContainer;this.reset();if(f)for(var f=this.root,h,k=0;k<a.length;++k)h=a[k],h.endContainer.equals(f)&&(h.endOffset=Math.min(h.endOffset,f.getChildCount()));if(a.length)if(this.isLocked){var g=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();g&&!g.equals(this.root)&&g.focus()}else{var m;a:{var p,x;if(1==a.length&&!(x=a[0]).collapsed&&(m=x.getEnclosedNode())&&
461
+ m.type==CKEDITOR.NODE_ELEMENT&&(x=x.clone(),x.shrink(CKEDITOR.SHRINK_ELEMENT,!0),(p=x.getEnclosedNode())&&p.type==CKEDITOR.NODE_ELEMENT&&(m=p),"false"==m.getAttribute("contenteditable")))break a;m=void 0}if(m)this.fake(m);else if(c&&c.plugins.tableselection&&c.plugins.tableselection.isSupportedEnvironment(c)&&l(a)&&!B&&!a[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored"))e.call(this,a);else{if(t){p=CKEDITOR.dom.walker.whitespaces(!0);m=/\ufeff|\u00a0/;x={table:1,tbody:1,
462
+ tr:1};1<a.length&&(c=a[a.length-1],a[0].setEnd(c.endContainer,c.endOffset));c=a[0];a=c.collapsed;var u,q,y;if((f=c.getEnclosedNode())&&f.type==CKEDITOR.NODE_ELEMENT&&f.getName()in A&&(!f.is("a")||!f.getText()))try{y=f.$.createControlRange();y.addElement(f.$);y.select();return}catch(w){}if(c.startContainer.type==CKEDITOR.NODE_ELEMENT&&c.startContainer.getName()in x||c.endContainer.type==CKEDITOR.NODE_ELEMENT&&c.endContainer.getName()in x)c.shrink(CKEDITOR.NODE_ELEMENT,!0),a=c.collapsed;y=c.createBookmark();
463
+ x=y.startNode;a||(g=y.endNode);y=c.document.$.body.createTextRange();y.moveToElementText(x.$);y.moveStart("character",1);g?(m=c.document.$.body.createTextRange(),m.moveToElementText(g.$),y.setEndPoint("EndToEnd",m),y.moveEnd("character",-1)):(u=x.getNext(p),q=x.hasAscendant("pre"),u=!(u&&u.getText&&u.getText().match(m))&&(q||!x.hasPrevious()||x.getPrevious().is&&x.getPrevious().is("br")),q=c.document.createElement("span"),q.setHtml("\x26#65279;"),q.insertBefore(x),u&&c.document.createText("").insertBefore(x));
464
+ c.setStartBefore(x);x.remove();a?(u?(y.moveStart("character",-1),y.select(),c.document.$.selection.clear()):y.select(),c.moveToPosition(q,CKEDITOR.POSITION_BEFORE_START),q.remove()):(c.setEndBefore(g),g.remove(),y.select())}else{g=this.getNative();if(!g)return;this.removeAllRanges();for(y=0;y<a.length;y++){if(y<a.length-1&&(u=a[y],q=a[y+1],m=u.clone(),m.setStart(u.endContainer,u.endOffset),m.setEnd(q.startContainer,q.startOffset),!m.collapsed&&(m.shrink(CKEDITOR.NODE_ELEMENT,!0),c=m.getCommonAncestor(),
465
+ m=m.getEnclosedNode(),c.isReadOnly()||m&&m.isReadOnly()))){q.setStart(u.startContainer,u.startOffset);a.splice(y--,1);continue}c=a[y];q=this.document.$.createRange();c.collapsed&&CKEDITOR.env.webkit&&d(c)&&(m=b(this.root),c.insertNode(m),(u=m.getNext())&&!m.getPrevious()&&u.type==CKEDITOR.NODE_ELEMENT&&"br"==u.getName()?(n(this.root),c.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START)):c.moveToPosition(m,CKEDITOR.POSITION_AFTER_END));q.setStart(c.startContainer.$,c.startOffset);try{q.setEnd(c.endContainer.$,
466
+ c.endOffset)}catch(z){if(0<=z.toString().indexOf("NS_ERROR_ILLEGAL_VALUE"))c.collapse(1),q.setEnd(c.endContainer.$,c.endOffset);else throw z;}g.addRange(q)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a,b){var c=this.root.editor;void 0===b&&a.hasAttribute("aria-label")&&(b=a.getAttribute("aria-label"));this.reset();q(c,b);var d=this._.cache,e=new CKEDITOR.dom.range(this.root);e.setStartBefore(a);e.setEndAfter(a);d.ranges=new CKEDITOR.dom.rangeList(e);d.selectedElement=d.startElement=
467
467
  a;d.type=CKEDITOR.SELECTION_ELEMENT;d.selectedText=d.nativeSel=null;this.isFake=1;this.rev=y++;c._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();a&&a.type==CKEDITOR.NODE_TEXT&&(a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},isInTable:function(a){return l(this.getRanges(),a)},isCollapsed:function(){var a=this.getRanges();return 1===a.length&&a[0].collapsed},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&
468
468
  (a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=[],c,d=0;d<a.length;d++){var e=new CKEDITOR.dom.range(this.root);e.moveToBookmark(a[d]);b.push(e)}a.isFake&&(c=l(b)?b[0]._getTableElement():b[0].getEnclosedNode(),c&&c.type==CKEDITOR.NODE_ELEMENT||(CKEDITOR.warn("selection-not-fake"),a.isFake=0));a.isFake&&!l(b)?this.fake(c):this.selectRanges(b);return this},getCommonAncestor:function(){var a=
469
- this.getRanges();return a.length?a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[q?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;(function(){function a(a,b){for(var c,d;(a=a.getParent())&&
469
+ this.getRanges();return a.length?a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[t?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;(function(){function a(a,b){for(var c,d;(a=a.getParent())&&
470
470
  !a.equals(b);)if(a.getAttribute("data-nostyle"))c=a;else if(!d){var e=a.getAttribute("contentEditable");"false"==e?c=a:"true"==e&&(d=1)}return c}function l(a,b,c,d){return(a.getPosition(b)|d)==d&&(!c.childRule||c.childRule(a))}function g(b){var c=b.document;if(b.collapsed)c=y(this,c),b.insertNode(c),b.moveToPosition(c,CKEDITOR.POSITION_BEFORE_END);else{var d=this.element,f=this._.definition,h,k=f.ignoreReadonly,m=k||f.includeReadonly;null==m&&(m=b.root.getCustomData("cke_includeReadonly"));var n=
471
- CKEDITOR.dtd[d];n||(h=!0,n=CKEDITOR.dtd.span);b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var r=b.createBookmark(),v=r.startNode,x=r.endNode,q=v,u;if(!k){var z=b.getCommonAncestor(),k=a(v,z),z=a(x,z);k&&(q=k.getNextSourceNode(!0));z&&(x=z)}for(q.getPosition(x)==CKEDITOR.POSITION_FOLLOWING&&(q=0);q;){k=!1;if(q.equals(x))q=null,k=!0;else{var w=q.type==CKEDITOR.NODE_ELEMENT?q.getName():null,z=w&&"false"==q.getAttribute("contentEditable"),t=w&&q.getAttribute("data-nostyle");if(w&&q.data("cke-bookmark")||
472
- q.type===CKEDITOR.NODE_COMMENT){q=q.getNextSourceNode(!0);continue}if(z&&m&&CKEDITOR.dtd.$block[w])for(var A=q,D=e(A),B=void 0,C=D.length,aa=0,A=C&&new CKEDITOR.dom.range(A.getDocument());aa<C;++aa){var B=D[aa],G=CKEDITOR.filter.instances[B.data("cke-filter")];if(G?G.check(this):1)A.selectNodeContents(B),g.call(this,A)}D=w?!n[w]||t?0:z&&!m?0:l(q,x,f,M):1;if(D)if(B=q.getParent(),D=f,C=d,aa=h,!B||!(B.getDtd()||CKEDITOR.dtd.span)[C]&&!aa||D.parentRule&&!D.parentRule(B))k=!0;else{if(u||w&&CKEDITOR.dtd.$removeEmpty[w]&&
473
- (q.getPosition(x)|M)!=M||(u=b.clone(),u.setStartBefore(q)),w=q.type,w==CKEDITOR.NODE_TEXT||z||w==CKEDITOR.NODE_ELEMENT&&!q.getChildCount()){for(var w=q,K;(k=!w.getNext(H))&&(K=w.getParent(),n[K.getName()])&&l(K,v,f,I);)w=K;u.setEndAfter(w)}}else k=!0;q=q.getNextSourceNode(t||z)}if(k&&u&&!u.collapsed){for(var k=y(this,c),z=k.hasAttributes(),t=u.getCommonAncestor(),w={},D={},B={},C={},E,da,fa;k&&t;){if(t.getName()==d){for(E in f.attributes)!C[E]&&(fa=t.getAttribute(da))&&(k.getAttribute(E)==fa?D[E]=
474
- 1:C[E]=1);for(da in f.styles)!B[da]&&(fa=t.getStyle(da))&&(k.getStyle(da)==fa?w[da]=1:B[da]=1)}t=t.getParent()}for(E in D)k.removeAttribute(E);for(da in w)k.removeStyle(da);z&&!k.hasAttributes()&&(k=null);k?(u.extractContents().appendTo(k),u.insertNode(k),p.call(this,k),k.mergeSiblings(),CKEDITOR.env.ie||k.$.normalize()):(k=new CKEDITOR.dom.element("span"),u.extractContents().appendTo(k),u.insertNode(k),p.call(this,k),k.remove(!0));u=null}}b.moveToBookmark(r);b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,
471
+ CKEDITOR.dtd[d];n||(h=!0,n=CKEDITOR.dtd.span);b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var p=b.createBookmark(),x=p.startNode,u=p.endNode,q=x,t;if(!k){var w=b.getCommonAncestor(),k=a(x,w),w=a(u,w);k&&(q=k.getNextSourceNode(!0));w&&(u=w)}for(q.getPosition(u)==CKEDITOR.POSITION_FOLLOWING&&(q=0);q;){k=!1;if(q.equals(u))q=null,k=!0;else{var z=q.type==CKEDITOR.NODE_ELEMENT?q.getName():null,w=z&&"false"==q.getAttribute("contentEditable"),r=z&&q.getAttribute("data-nostyle");if(z&&q.data("cke-bookmark")||
472
+ q.type===CKEDITOR.NODE_COMMENT){q=q.getNextSourceNode(!0);continue}if(w&&m&&CKEDITOR.dtd.$block[z])for(var B=q,D=e(B),C=void 0,A=D.length,aa=0,B=A&&new CKEDITOR.dom.range(B.getDocument());aa<A;++aa){var C=D[aa],G=CKEDITOR.filter.instances[C.data("cke-filter")];if(G?G.check(this):1)B.selectNodeContents(C),g.call(this,B)}D=z?!n[z]||r?0:w&&!m?0:l(q,u,f,M):1;if(D)if(C=q.getParent(),D=f,A=d,aa=h,!C||!(C.getDtd()||CKEDITOR.dtd.span)[A]&&!aa||D.parentRule&&!D.parentRule(C))k=!0;else{if(t||z&&CKEDITOR.dtd.$removeEmpty[z]&&
473
+ (q.getPosition(u)|M)!=M||(t=b.clone(),t.setStartBefore(q)),z=q.type,z==CKEDITOR.NODE_TEXT||w||z==CKEDITOR.NODE_ELEMENT&&!q.getChildCount()){for(var z=q,K;(k=!z.getNext(H))&&(K=z.getParent(),n[K.getName()])&&l(K,x,f,I);)z=K;t.setEndAfter(z)}}else k=!0;q=q.getNextSourceNode(r||w)}if(k&&t&&!t.collapsed){for(var k=y(this,c),w=k.hasAttributes(),r=t.getCommonAncestor(),z={},D={},C={},A={},E,da,fa;k&&r;){if(r.getName()==d){for(E in f.attributes)!A[E]&&(fa=r.getAttribute(da))&&(k.getAttribute(E)==fa?D[E]=
474
+ 1:A[E]=1);for(da in f.styles)!C[da]&&(fa=r.getStyle(da))&&(k.getStyle(da)==fa?z[da]=1:C[da]=1)}r=r.getParent()}for(E in D)k.removeAttribute(E);for(da in z)k.removeStyle(da);w&&!k.hasAttributes()&&(k=null);k?(t.extractContents().appendTo(k),t.insertNode(k),v.call(this,k),k.mergeSiblings(),CKEDITOR.env.ie||k.$.normalize()):(k=new CKEDITOR.dom.element("span"),t.extractContents().appendTo(k),t.insertNode(k),v.call(this,k),k.remove(!0));t=null}}b.moveToBookmark(p);b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,
475
475
  !0)}}function f(a){function b(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),c=new CKEDITOR.dom.elementPath(m.getParent()),e=null,f=null,h=0;h<a.elements.length;h++){var k=a.elements[h];if(k==a.block||k==a.blockLimit)break;n.checkElementRemovable(k,!0)&&(e=k)}for(h=0;h<c.elements.length;h++){k=c.elements[h];if(k==c.block||k==c.blockLimit)break;n.checkElementRemovable(k,!0)&&(f=k)}f&&m.breakParent(f);e&&d.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,1);var c=a.createBookmark(),d=c.startNode,
476
- e=this._.definition.alwaysRemoveElement;if(a.collapsed){for(var f=new CKEDITOR.dom.elementPath(d.getParent(),a.root),h,k=0,g;k<f.elements.length&&(g=f.elements[k])&&g!=f.block&&g!=f.blockLimit;k++)if(this.checkElementRemovable(g)){var l;!e&&a.collapsed&&(a.checkBoundaryOfElement(g,CKEDITOR.END)||(l=a.checkBoundaryOfElement(g,CKEDITOR.START)))?(h=g,h.match=l?"start":"end"):(g.mergeSiblings(),g.is(this.element)?u.call(this,g):t(g,A(this)[g.getName()]))}if(h){e=d;for(k=0;;k++){g=f.elements[k];if(g.equals(h))break;
477
- else if(g.match)continue;else g=g.clone();g.append(e);e=g}e["start"==h.match?"insertBefore":"insertAfter"](h)}}else{var m=c.endNode,n=this;b();for(f=d;!f.equals(m);)h=f.getNextSourceNode(),f.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(f)&&(f.getName()==this.element?u.call(this,f):t(f,A(this)[f.getName()]),h.type==CKEDITOR.NODE_ELEMENT&&h.contains(d)&&(b(),h=d.getNext())),f=h}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,!0)}function e(a){var b=[];a.forEach(function(a){if("true"==
476
+ e=this._.definition.alwaysRemoveElement;if(a.collapsed){for(var f=new CKEDITOR.dom.elementPath(d.getParent(),a.root),h,k=0,g;k<f.elements.length&&(g=f.elements[k])&&g!=f.block&&g!=f.blockLimit;k++)if(this.checkElementRemovable(g)){var l;!e&&a.collapsed&&(a.checkBoundaryOfElement(g,CKEDITOR.END)||(l=a.checkBoundaryOfElement(g,CKEDITOR.START)))?(h=g,h.match=l?"start":"end"):(g.mergeSiblings(),g.is(this.element)?q.call(this,g):r(g,B(this)[g.getName()]))}if(h){e=d;for(k=0;;k++){g=f.elements[k];if(g.equals(h))break;
477
+ else if(g.match)continue;else g=g.clone();g.append(e);e=g}e["start"==h.match?"insertBefore":"insertAfter"](h)}}else{var m=c.endNode,n=this;b();for(f=d;!f.equals(m);)h=f.getNextSourceNode(),f.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(f)&&(f.getName()==this.element?q.call(this,f):r(f,B(this)[f.getName()]),h.type==CKEDITOR.NODE_ELEMENT&&h.contains(d)&&(b(),h=d.getNext())),f=h}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,!0)}function e(a){var b=[];a.forEach(function(a){if("true"==
478
478
  a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function m(a){var b=a.getEnclosedNode()||a.getCommonAncestor(!1,!0);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&x(a,this)}function h(a){var b=a.getCommonAncestor(!0,!0);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,c=b.attributes;if(c)for(var d in c)a.removeAttribute(d,c[d]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
479
479
  a.removeStyle(e)}}function k(a){var b=a.createBookmark(!0),c=a.createIterator();c.enforceRealBlocks=!0;this._.enterMode&&(c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var e,f=a.document,h;e=c.getNextParagraph();)!e.isReadOnly()&&(c.activeFilter?c.activeFilter.check(this):1)&&(h=y(this,f,e),d(e,h));a.moveToBookmark(b)}function c(a){var b=a.createBookmark(1),c=a.createIterator();c.enforceRealBlocks=!0;c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var e,f;e=c.getNextParagraph();)this.checkElementRemovable(e)&&
480
- (e.is("pre")?((f=this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&e.copyAttributes(f),d(e,f)):u.call(this,e));a.moveToBookmark(b)}function d(a,c){var d=!c;d&&(c=a.getDocument().createElement("div"),a.copyAttributes(c));var e=c&&c.is("pre"),f=a.is("pre"),h=!e&&f;if(e&&!f){f=c;(h=a.getBogus())&&h.remove();h=a.getHtml();h=n(h,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");h=h.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");h=h.replace(/([ \t\n\r]+|&nbsp;)/g,
481
- " ");h=h.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var k=a.getDocument().createElement("div");k.append(f);f.$.outerHTML="\x3cpre\x3e"+h+"\x3c/pre\x3e";f.copyAttributes(k.getFirst());f=k.getFirst().remove()}else f.setHtml(h);c=f}else h?c=r(d?[a.getHtml()]:b(a),c):a.moveChildren(c);c.replace(a);if(e){var d=c,g;(g=d.getPrevious(E))&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("pre")&&(e=n(g.getHtml(),/\n$/,"")+"\n\n"+n(d.getHtml(),/^\n/,""),CKEDITOR.env.ie?d.$.outerHTML="\x3cpre\x3e"+e+"\x3c/pre\x3e":
482
- d.setHtml(e),g.remove())}else d&&q(c)}function b(a){var b=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"\x3c/pre\x3e"+c+"\x3cpre\x3e"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function n(a,b,c){var d="",e="";a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function r(a,b){var c;
480
+ (e.is("pre")?((f=this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&e.copyAttributes(f),d(e,f)):q.call(this,e));a.moveToBookmark(b)}function d(a,c){var d=!c;d&&(c=a.getDocument().createElement("div"),a.copyAttributes(c));var e=c&&c.is("pre"),f=a.is("pre"),h=!e&&f;if(e&&!f){f=c;(h=a.getBogus())&&h.remove();h=a.getHtml();h=n(h,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");h=h.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");h=h.replace(/([ \t\n\r]+|&nbsp;)/g,
481
+ " ");h=h.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var k=a.getDocument().createElement("div");k.append(f);f.$.outerHTML="\x3cpre\x3e"+h+"\x3c/pre\x3e";f.copyAttributes(k.getFirst());f=k.getFirst().remove()}else f.setHtml(h);c=f}else h?c=p(d?[a.getHtml()]:b(a),c):a.moveChildren(c);c.replace(a);if(e){var d=c,g;(g=d.getPrevious(E))&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("pre")&&(e=n(g.getHtml(),/\n$/,"")+"\n\n"+n(d.getHtml(),/^\n/,""),CKEDITOR.env.ie?d.$.outerHTML="\x3cpre\x3e"+e+"\x3c/pre\x3e":
482
+ d.setHtml(e),g.remove())}else d&&t(c)}function b(a){var b=[];n(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"\x3c/pre\x3e"+c+"\x3cpre\x3e"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function n(a,b,c){var d="",e="";a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function p(a,b){var c;
483
483
  1<a.length&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=n(e,/^[ \t]*\n/,""),e=n(e,/\n$/,""),e=n(e,/^[ \t]+|[ \t]+$/g,function(a,b){return 1==a.length?"\x26nbsp;":b?" "+CKEDITOR.tools.repeat("\x26nbsp;",a.length-1):CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "}),e=e.replace(/\n/g,"\x3cbr\x3e"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat("\x26nbsp;",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);
484
- c.append(f)}else b.setHtml(e)}return c||b}function u(a,b){var c=this._.definition,d=c.attributes,c=c.styles,e=A(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),h;for(h in d)if("class"!=h&&!this._.definition.fullMatch||a.getAttribute(h)==w(h,d[h]))b&&"data-"==h.slice(0,5)||(f=a.hasAttribute(h),a.removeAttribute(h));for(var k in c)this._.definition.fullMatch&&a.getStyle(k)!=w(k,c[k],!0)||(f=f||!!a.getStyle(k),a.removeStyle(k));t(a,e,B[a.getName()]);f&&(this._.definition.alwaysRemoveElement?
485
- q(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?q(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function p(a){for(var b=A(this),c=a.getElementsByTag(this.element),d,e=c.count();0<=--e;)d=c.getItem(e),d.isReadOnly()||u.call(this,d,!0);for(var f in b)if(f!=this.element)for(c=a.getElementsByTag(f),e=c.count()-1;0<=e;e--)d=c.getItem(e),d.isReadOnly()||t(d,b[f])}function t(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],
486
- f;if(f=a.getAttribute(e)){var h=b[d][1];(null===h||h.test&&h.test(f)||"string"==typeof h&&f==h)&&a.removeAttribute(e)}}c||q(a)}function q(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(E),d=a.getNext(E);!c||c.type!=CKEDITOR.NODE_TEXT&&c.isBlockBoundary({br:1})||a.append("br",1);!d||d.type!=CKEDITOR.NODE_TEXT&&d.isBlockBoundary({br:1})||a.append("br");a.remove(!0)}else c=a.getFirst(),d=a.getLast(),a.remove(!0),c&&(c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings(),
484
+ c.append(f)}else b.setHtml(e)}return c||b}function q(a,b){var c=this._.definition,d=c.attributes,c=c.styles,e=B(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),h;for(h in d)if("class"!=h&&!this._.definition.fullMatch||a.getAttribute(h)==w(h,d[h]))b&&"data-"==h.slice(0,5)||(f=a.hasAttribute(h),a.removeAttribute(h));for(var k in c)this._.definition.fullMatch&&a.getStyle(k)!=w(k,c[k],!0)||(f=f||!!a.getStyle(k),a.removeStyle(k));r(a,e,C[a.getName()]);f&&(this._.definition.alwaysRemoveElement?
485
+ t(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!a.hasAttributes()?t(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function v(a){for(var b=B(this),c=a.getElementsByTag(this.element),d,e=c.count();0<=--e;)d=c.getItem(e),d.isReadOnly()||q.call(this,d,!0);for(var f in b)if(f!=this.element)for(c=a.getElementsByTag(f),e=c.count()-1;0<=e;e--)d=c.getItem(e),d.isReadOnly()||r(d,b[f])}function r(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],
486
+ f;if(f=a.getAttribute(e)){var h=b[d][1];(null===h||h.test&&h.test(f)||"string"==typeof h&&f==h)&&a.removeAttribute(e)}}c||t(a)}function t(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(E),d=a.getNext(E);!c||c.type!=CKEDITOR.NODE_TEXT&&c.isBlockBoundary({br:1})||a.append("br",1);!d||d.type!=CKEDITOR.NODE_TEXT&&d.isBlockBoundary({br:1})||a.append("br");a.remove(!0)}else c=a.getFirst(),d=a.getLast(),a.remove(!0),c&&(c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings(),
487
487
  d&&!c.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT&&d.mergeSiblings())}function y(a,b,c){var d;d=a.element;"*"==d&&(d="span");d=new CKEDITOR.dom.element(d,b);c&&c.copyAttributes(d);d=x(d,a);b.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return d}function x(a,b){var c=b._.definition,d=c.attributes,c=CKEDITOR.style.getStyleText(c);if(d)for(var e in d)a.setAttribute(e,d[e]);c&&a.setAttribute("style",c);a.getDocument().removeCustomData("doc_processing_style");
488
- return a}function z(a,b){for(var c in a)a[c]=a[c].replace(K,function(a,c){return b[c]})}function A(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],f,h;"string"==typeof e?f=e.toLowerCase():(f=e.element?e.element.toLowerCase():a.element,h=e.attributes);e=b[f]||(b[f]={});if(h){var e=e.attributes=e.attributes||[],k;for(k in h)e.push([k.toLowerCase(),h[k]])}}}return b}function w(a,
489
- b,c){var d=new CKEDITOR.dom.element("span");d[c?"setStyle":"setAttribute"](a,b);return d[c?"getStyle":"getAttribute"](a)}function v(a,b){function c(a,b){return"font-family"==b.toLowerCase()?a.replace(/["']/g,""):a}"string"==typeof a&&(a=CKEDITOR.tools.parseCssText(a));"string"==typeof b&&(b=CKEDITOR.tools.parseCssText(b,!0));for(var d in a)if(!(d in b)||c(b[d],d)!=c(a[d],d)&&"inherit"!=a[d]&&"inherit"!=b[d])return!1;return!0}function D(a,b,c){var d=a.getRanges();b=b?this.removeFromRange:this.applyToRange;
490
- for(var e,f=d.createIterator();e=f.getNextRange();)b.call(this,e,c);a.selectRanges(d)}var B={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},C={a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},G=/\s*(?:;\s*|$)/,K=/#\((.+?)\)/g,H=CKEDITOR.dom.walker.bookmark(0,
491
- 1),E=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if("string"==typeof a.type)return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;c&&c.style&&(a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style)),delete c.style);b&&(a=CKEDITOR.tools.clone(a),z(a.attributes,b),z(a.styles,b));c=this.element=a.element?"string"==typeof a.element?a.element.toLowerCase():a.element:"*";this.type=a.type||(B[c]?CKEDITOR.STYLE_BLOCK:C[c]?CKEDITOR.STYLE_OBJECT:
488
+ return a}function z(a,b){for(var c in a)a[c]=a[c].replace(K,function(a,c){return b[c]})}function B(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],f,h;"string"==typeof e?f=e.toLowerCase():(f=e.element?e.element.toLowerCase():a.element,h=e.attributes);e=b[f]||(b[f]={});if(h){var e=e.attributes=e.attributes||[],k;for(k in h)e.push([k.toLowerCase(),h[k]])}}}return b}function w(a,
489
+ b,c){var d=new CKEDITOR.dom.element("span");d[c?"setStyle":"setAttribute"](a,b);return d[c?"getStyle":"getAttribute"](a)}function u(a,b){function c(a,b){return"font-family"==b.toLowerCase()?a.replace(/["']/g,""):a}"string"==typeof a&&(a=CKEDITOR.tools.parseCssText(a));"string"==typeof b&&(b=CKEDITOR.tools.parseCssText(b,!0));for(var d in a)if(!(d in b)||c(b[d],d)!=c(a[d],d)&&"inherit"!=a[d]&&"inherit"!=b[d])return!1;return!0}function D(a,b,c){var d=a.getRanges();b=b?this.removeFromRange:this.applyToRange;
490
+ for(var e,f=d.createIterator();e=f.getNextRange();)b.call(this,e,c);a.selectRanges(d)}var C={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},A={a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},G=/\s*(?:;\s*|$)/,K=/#\((.+?)\)/g,H=CKEDITOR.dom.walker.bookmark(0,
491
+ 1),E=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if("string"==typeof a.type)return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;c&&c.style&&(a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style)),delete c.style);b&&(a=CKEDITOR.tools.clone(a),z(a.attributes,b),z(a.styles,b));c=this.element=a.element?"string"==typeof a.element?a.element.toLowerCase():a.element:"*";this.type=a.type||(C[c]?CKEDITOR.STYLE_BLOCK:A[c]?CKEDITOR.STYLE_OBJECT:
492
492
  CKEDITOR.STYLE_INLINE);"object"==typeof this.element&&(this.type=CKEDITOR.STYLE_OBJECT);this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return D.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);D.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return D.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),
493
493
  a)){var b=this._.enterMode;b||(this._.enterMode=a.activeEnterMode);D.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?g:this.type==CKEDITOR.STYLE_BLOCK?k:this.type==CKEDITOR.STYLE_OBJECT?m:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?f:this.type==CKEDITOR.STYLE_BLOCK?c:this.type==CKEDITOR.STYLE_OBJECT?h:null;return this.removeFromRange(a)},applyToObject:function(a){x(a,
494
494
  this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,!0,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var c=a.elements,d=0,e;d<c.length;d++)if(e=c[d],this.type!=CKEDITOR.STYLE_INLINE||e!=a.block&&e!=a.blockLimit){if(this.type==CKEDITOR.STYLE_OBJECT){var f=e.getName();if(!("string"==typeof this.element?f==this.element:f in this.element))continue}if(this.checkElementRemovable(e,!0,b))return!0}}return!1},checkApplicable:function(a,
495
495
  b,c){b&&b instanceof CKEDITOR.filter&&(c=b);if(c&&!c.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(a,b){var c=this._.definition;if(!a||!c.ignoreReadonly&&a.isReadOnly())return!1;var d=a.getName();if("string"==typeof this.element?d==this.element:d in this.element){if(!b&&!a.hasAttributes())return!0;if(d=c._AC)c=d;else{var d={},e=0,f=c.attributes;
496
- if(f)for(var h in f)e++,d[h]=f[h];if(h=CKEDITOR.style.getStyleText(c))d.style||e++,d.style=h;d._length=e;c=c._AC=d}if(c._length){for(var k in c)if("_length"!=k)if(d=a.getAttribute(k)||"","style"==k?v(c[k],d):c[k]==d){if(!b)return!0}else if(b)return!1;if(b)return!0}else return!0}return!1},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return!0;if(b=A(this)[a.getName()]){var d;if(!(b=b.attributes))return!0;for(c=0;c<b.length;c++)if(d=b[c][0],d=a.getAttribute(d)){var e=b[c][1];
496
+ if(f)for(var h in f)e++,d[h]=f[h];if(h=CKEDITOR.style.getStyleText(c))d.style||e++,d.style=h;d._length=e;c=c._AC=d}if(c._length){for(var k in c)if("_length"!=k)if(d=a.getAttribute(k)||"","style"==k?u(c[k],d):c[k]==d){if(!b)return!0}else if(b)return!1;if(b)return!0}else return!0}return!1},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return!0;if(b=B(this)[a.getName()]){var d;if(!(b=b.attributes))return!0;for(c=0;c<b.length;c++)if(d=b[c][0],d=a.getAttribute(d)){var e=b[c][1];
497
497
  if(null===e)return!0;if("string"==typeof e){if(d==e)return!0}else if(e.test(d))return!0}}return!1},buildPreview:function(a){var b=this._.definition,c=[],d=b.element;"bdo"==d&&(d="span");var c=["\x3c",d],e=b.attributes;if(e)for(var f in e)c.push(" ",f,'\x3d"',e[f],'"');(e=CKEDITOR.style.getStyleText(b))&&c.push(' style\x3d"',e,'"');c.push("\x3e",a||b.name,"\x3c/",d,"\x3e");return c.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;
498
498
  var b=a.styles,c=a.attributes&&a.attributes.style||"",d="";c.length&&(c=c.replace(G,";"));for(var e in b){var f=b[e],h=(e+":"+f).replace(G,";");"inherit"==f?d+=h:c+=h}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,!0));return a._ST=c+d};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},
499
499
  a,!0);return this.customHandlers[a.type]=b};var M=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,I=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,l){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,l,!0)};CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&
@@ -504,7 +504,7 @@ CKEDITOR.stylesSet.addExternal(f,g[1]?g.slice(1).join(":"):CKEDITOR.getUrl("styl
504
504
  a.data.$.shiftKey},this),e.attachListener(e,"keyup",function(a){this._.shiftPressed=a.data.$.shiftKey},this))})};CKEDITOR.dom.selection.prototype.optimizeInElementEnds=function(){var f=this.getRanges()[0],e=this.root.editor,g;if(this.root.editor._.shiftPressed||this.isFake||f.isCollapsed||f.startContainer.equals(f.endContainer))g=!1;else if(0===f.endOffset)g=!0;else{g=f.startContainer.type===CKEDITOR.NODE_TEXT;var h=f.endContainer.type===CKEDITOR.NODE_TEXT,k=g?f.startContainer.getLength():f.startContainer.getChildCount();
505
505
  g=f.startOffset===k||g^h}g&&(g=f.clone(),f.shrink(CKEDITOR.SHRINK_TEXT,!1,{skipBogus:!CKEDITOR.env.webkit}),l=!1,a(e,f,g),f.select(),l=!0)}})();CKEDITOR.dom.comment=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"\x3c!--"+this.$.nodeValue+"--\x3e"}});"use strict";(function(){var a=
506
506
  {},l={},g;for(g in CKEDITOR.dtd.$blockLimit)g in CKEDITOR.dtd.$list||(a[g]=1);for(g in CKEDITOR.dtd.$block)g in CKEDITOR.dtd.$blockLimit||g in CKEDITOR.dtd.$empty||(l[g]=1);CKEDITOR.dom.elementPath=function(f,e){var g=null,h=null,k=[],c=f,d;e=e||f.getDocument().getBody();c||(c=e);do if(c.type==CKEDITOR.NODE_ELEMENT){k.push(c);if(!this.lastElement&&(this.lastElement=c,c.is(CKEDITOR.dtd.$object)||"false"==c.getAttribute("contenteditable")))continue;if(c.equals(e))break;if(!h&&(d=c.getName(),"true"==
507
- c.getAttribute("contenteditable")?h=c:!g&&l[d]&&(g=c),a[d])){if(d=!g&&"div"==d){a:{d=c.getChildren();for(var b=0,n=d.count();b<n;b++){var r=d.getItem(b);if(r.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[r.getName()]){d=!0;break a}}d=!1}d=!d}d?g=c:h=c}}while(c=c.getParent());h||(h=e);this.block=g;this.blockLimit=h;this.root=e;this.elements=k}})();CKEDITOR.dom.elementPath.prototype={compare:function(a){var l=this.elements;a=a&&a.elements;if(!a||l.length!=a.length)return!1;for(var g=0;g<l.length;g++)if(!l[g].equals(a[g]))return!1;
507
+ c.getAttribute("contenteditable")?h=c:!g&&l[d]&&(g=c),a[d])){if(d=!g&&"div"==d){a:{d=c.getChildren();for(var b=0,n=d.count();b<n;b++){var p=d.getItem(b);if(p.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[p.getName()]){d=!0;break a}}d=!1}d=!d}d?g=c:h=c}}while(c=c.getParent());h||(h=e);this.block=g;this.blockLimit=h;this.root=e;this.elements=k}})();CKEDITOR.dom.elementPath.prototype={compare:function(a){var l=this.elements;a=a&&a.elements;if(!a||l.length!=a.length)return!1;for(var g=0;g<l.length;g++)if(!l[g].equals(a[g]))return!1;
508
508
  return!0},contains:function(a,l,g){var f=0,e;"string"==typeof a&&(e=function(e){return e.getName()==a});a instanceof CKEDITOR.dom.element?e=function(e){return e.equals(a)}:CKEDITOR.tools.isArray(a)?e=function(e){return-1<CKEDITOR.tools.indexOf(a,e.getName())}:"function"==typeof a?e=a:"object"==typeof a&&(e=function(e){return e.getName()in a});var m=this.elements,h=m.length;l&&(g?f+=1:--h);g&&(m=Array.prototype.slice.call(m,0),m.reverse());for(;f<h;f++)if(e(m[f]))return m[f];return null},isContextFor:function(a){var l;
509
509
  return a in CKEDITOR.dtd.$block?(l=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!l.getDtd()[a]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};CKEDITOR.dom.text=function(a,l){"string"==typeof a&&(a=(l?l.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},
510
510
  getText:function(){return this.$.nodeValue},setText:function(a){this.$.nodeValue=a},isEmpty:function(a){var l=this.getText();a&&(l=CKEDITOR.tools.trim(l));return!l||l===CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE},split:function(a){var l=this.$.parentNode,g=l.childNodes.length,f=this.getLength(),e=this.getDocument(),m=new CKEDITOR.dom.text(this.$.splitText(a),e);l.childNodes.length==g&&(a>=f?(m=e.createText(""),m.insertAfter(this)):(a=e.createText(""),a.insertAfter(m),a.remove()));return m},substring:function(a,
@@ -529,8 +529,8 @@ CKEDITOR.config.coreStyles_superscript={element:"sup"};(function(){function a(a,
529
529
  e?(a.removeAttribute("dir"),c!=a.getComputedStyle("direction")&&a.setAttribute("dir",c)):a.setAttribute("dir",c),d.forceNextSelectionCheck())}}function l(a,c,d){var e=a.getCommonAncestor(!1,!0);a=a.clone();a.enlarge(d==CKEDITOR.ENTER_BR?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(a.checkBoundaryOfElement(e,CKEDITOR.START)&&a.checkBoundaryOfElement(e,CKEDITOR.END)){for(var f;e&&e.type==CKEDITOR.NODE_ELEMENT&&(f=e.getParent())&&1==f.getChildCount()&&!(e.getName()in c);)e=
530
530
  f;return e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in c&&e}}function g(b){return{context:"p",allowedContent:{"h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td":{propertiesOnly:!0,attributes:"dir"}},requiredContent:"p[dir]",refresh:function(a,b){var c=a.config.useComputedState,d,c=void 0===c||c;if(!c){d=b.lastElement;for(var e=a.editable();d&&!(d.getName()in h||d.equals(e));){var f=d.getParent();if(!f)break;d=f}}d=d||b.block||b.blockLimit;d.equals(a.editable())&&(e=a.getSelection().getRanges()[0].getEnclosedNode())&&
531
531
  e.type==CKEDITOR.NODE_ELEMENT&&(d=e);d&&(c=c?d.getComputedStyle("direction"):d.getStyle("direction")||d.getAttribute("dir"),a.getCommand("bidirtl").setState("rtl"==c?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),a.getCommand("bidiltr").setState("ltr"==c?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF));c=(b.block||b.blockLimit||a.editable()).getDirection(1);c!=(a._.selDir||a.lang.dir)&&(a._.selDir=c,a.fire("contentDirChanged",c))},exec:function(c){var d=c.getSelection(),f=c.config.enterMode,h=d.getRanges();
532
- if(h&&h.length){for(var k={},g=d.createBookmarks(),h=h.createIterator(),y,x=0;y=h.getNextRange(1);){var z=y.getEnclosedNode();z&&(!z||z.type==CKEDITOR.NODE_ELEMENT&&z.getName()in m)||(z=l(y,e,f));z&&a(z,b,c,k);var A=new CKEDITOR.dom.walker(y),w=g[x].startNode,v=g[x++].endNode;A.evaluator=function(a){var b=f==CKEDITOR.ENTER_P?"p":"div",c;if(c=(a?a.type==CKEDITOR.NODE_ELEMENT:!1)&&a.getName()in e){if(b=a.is(b))b=(b=a.getParent())?b.type==CKEDITOR.NODE_ELEMENT:!1;c=!(b&&a.getParent().is("blockquote"))}return!!(c&&
533
- a.getPosition(w)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(v)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;z=A.next();)a(z,b,c,k);y=y.createIterator();for(y.enlargeBr=f!=CKEDITOR.ENTER_BR;z=y.getNextParagraph(f==CKEDITOR.ENTER_P?"p":"div");)a(z,b,c,k)}CKEDITOR.dom.element.clearAllMarkers(k);c.forceNextSelectionCheck();d.selectBookmarks(g);c.focus()}}}}function f(a){var c=a==k.setAttribute,d=a==k.removeAttribute,e=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
532
+ if(h&&h.length){for(var k={},g=d.createBookmarks(),h=h.createIterator(),y,x=0;y=h.getNextRange(1);){var z=y.getEnclosedNode();z&&(!z||z.type==CKEDITOR.NODE_ELEMENT&&z.getName()in m)||(z=l(y,e,f));z&&a(z,b,c,k);var B=new CKEDITOR.dom.walker(y),w=g[x].startNode,u=g[x++].endNode;B.evaluator=function(a){var b=f==CKEDITOR.ENTER_P?"p":"div",c;if(c=(a?a.type==CKEDITOR.NODE_ELEMENT:!1)&&a.getName()in e){if(b=a.is(b))b=(b=a.getParent())?b.type==CKEDITOR.NODE_ELEMENT:!1;c=!(b&&a.getParent().is("blockquote"))}return!!(c&&
533
+ a.getPosition(w)&CKEDITOR.POSITION_FOLLOWING&&(a.getPosition(u)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};for(;z=B.next();)a(z,b,c,k);y=y.createIterator();for(y.enlargeBr=f!=CKEDITOR.ENTER_BR;z=y.getNextParagraph(f==CKEDITOR.ENTER_P?"p":"div");)a(z,b,c,k)}CKEDITOR.dom.element.clearAllMarkers(k);c.forceNextSelectionCheck();d.selectBookmarks(g);c.focus()}}}}function f(a){var c=a==k.setAttribute,d=a==k.removeAttribute,e=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
534
534
  return function(f,h){if(!this.isReadOnly()){var k;if(k=f==(c||d?"dir":"direction")||"style"==f&&(d||e.test(h))){a:{k=this;for(var g=k.getDocument().getBody().getParent();k;){if(k.equals(g)){k=!1;break a}k=k.getParent()}k=!0}k=!k}if(k&&(k=this.getDirection(1),g=a.apply(this,arguments),k!=this.getDirection(1)))return this.getDocument().fire("dirChanged",this),g}return a.apply(this,arguments)}}var e={table:1,ul:1,ol:1,blockquote:1,div:1},m={},h={};CKEDITOR.tools.extend(m,e,{tr:1,p:1,div:1,li:1});CKEDITOR.tools.extend(h,
535
535
  m,{td:1});CKEDITOR.plugins.add("bidi",{init:function(a){function c(d,e,f,h,k){a.addCommand(f,new CKEDITOR.command(a,h));a.ui.addButton&&a.ui.addButton(d,{label:e,command:f,toolbar:"bidi,"+k})}if(!a.blockless){var d=a.lang.bidi;c("BidiLtr",d.ltr,"bidiltr",g("ltr"),10);c("BidiRtl",d.rtl,"bidirtl",g("rtl"),20);a.on("contentDom",function(){a.document.on("dirChanged",function(c){a.fire("dirChanged",{node:c.data,dir:c.data.getDirection(1)})})});a.on("contentDirChanged",function(c){c=(a.lang.dir!=c.data?
536
536
  "add":"remove")+"Class";var d=a.ui.space(a.config.toolbarLocation);if(d)d[c]("cke_mixed_dir_content")})}}});for(var k=CKEDITOR.dom.element.prototype,c=["setStyle","removeStyle","setAttribute","removeAttribute"],d=0;d<c.length;d++)k[c[d]]=CKEDITOR.tools.override(k[c[d]],f)})();(function(){var a={exec:function(a){var g=a.getCommand("blockquote").state,f=a.getSelection(),e=f&&f.getRanges()[0];if(e){var m=f.createBookmarks();if(CKEDITOR.env.ie){var h=m[0].startNode,k=m[0].endNode,c;if(h&&"blockquote"==
@@ -551,8 +551,8 @@ function(a){13==a.data.getKeystroke()&&(g=!0)});h.getInputElement().on("keyup",f
551
551
  function(){e.getInputElement().on("keyup",k)},e);CKEDITOR.ui.dialog.labeledElement.call(this,c,d,b,function(){h["aria-labelledby"]=this._.labelId;this._.required&&(h["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',f,'" '],b;for(b in h)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(h[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e");return a.join("")})}},checkbox:function(c,
552
552
  d,b){if(!(3>arguments.length)){var e=a.call(this,d,{"default":!!d["default"]});d.validate&&(this.validate=d.validate);CKEDITOR.ui.dialog.uiElement.call(this,c,d,b,"span",null,null,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),b=[],f=CKEDITOR.tools.getNextId()+"_label",k={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":f};h(a);d["default"]&&(k.checked="checked");"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);
553
553
  e.checkbox=new CKEDITOR.ui.dialog.uiElement(c,a,b,"input",null,k);b.push(' \x3clabel id\x3d"',f,'" for\x3d"',k.id,'"'+(d.labelStyle?' style\x3d"'+d.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(d.label),"\x3c/label\x3e");return b.join("")})}},radio:function(c,d,b){if(!(3>arguments.length)){a.call(this,d);this._["default"]||(this._["default"]=this._.initValue=d.items[0][1]);d.validate&&(this.validate=d.validate);var e=[],f=this;d.role="radiogroup";d.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,
554
- c,d,b,function(){for(var a=[],b=[],k=(d.id?d.id:CKEDITOR.tools.getNextId())+"_radio",g=0;g<d.items.length;g++){var l=d.items[g],m=void 0!==l[2]?l[2]:l[0],z=void 0!==l[1]?l[1]:l[0],A=CKEDITOR.tools.getNextId()+"_radio_input",w=A+"_label",A=CKEDITOR.tools.extend({},d,{id:A,title:null,type:null},!0),m=CKEDITOR.tools.extend({},A,{title:m},!0),v={type:"radio","class":"cke_dialog_ui_radio_input",name:k,value:z,"aria-labelledby":w},D=[];f._["default"]==z&&(v.checked="checked");h(A);h(m);"undefined"!=typeof A.inputStyle&&
555
- (A.style=A.inputStyle);A.keyboardFocusable=!0;e.push(new CKEDITOR.ui.dialog.uiElement(c,A,D,"input",null,v));D.push(" ");new CKEDITOR.ui.dialog.uiElement(c,m,D,"label",null,{id:w,"for":v.id},l[0]);a.push(D.join(""))}new CKEDITOR.ui.dialog.hbox(c,e,a,b);return b.join("")});this._.children=e}},button:function(c,d,b){if(arguments.length){"function"==typeof d&&(d=d(c.getParentEditor()));a.call(this,d,{disabled:d.disabled||!1});CKEDITOR.event.implementOn(this);var e=this;c.on("load",function(){var a=this.getElement();
554
+ c,d,b,function(){for(var a=[],b=[],k=(d.id?d.id:CKEDITOR.tools.getNextId())+"_radio",g=0;g<d.items.length;g++){var l=d.items[g],m=void 0!==l[2]?l[2]:l[0],z=void 0!==l[1]?l[1]:l[0],B=CKEDITOR.tools.getNextId()+"_radio_input",w=B+"_label",B=CKEDITOR.tools.extend({},d,{id:B,title:null,type:null},!0),m=CKEDITOR.tools.extend({},B,{title:m},!0),u={type:"radio","class":"cke_dialog_ui_radio_input",name:k,value:z,"aria-labelledby":w},D=[];f._["default"]==z&&(u.checked="checked");h(B);h(m);"undefined"!=typeof B.inputStyle&&
555
+ (B.style=B.inputStyle);B.keyboardFocusable=!0;e.push(new CKEDITOR.ui.dialog.uiElement(c,B,D,"input",null,u));D.push(" ");new CKEDITOR.ui.dialog.uiElement(c,m,D,"label",null,{id:w,"for":u.id},l[0]);a.push(D.join(""))}new CKEDITOR.ui.dialog.hbox(c,e,a,b);return b.join("")});this._.children=e}},button:function(c,d,b){if(arguments.length){"function"==typeof d&&(d=d(c.getParentEditor()));a.call(this,d,{disabled:d.disabled||!1});CKEDITOR.event.implementOn(this);var e=this;c.on("load",function(){var a=this.getElement();
556
556
  (function(){a.on("click",function(a){e.click();a.data.preventDefault()});a.on("keydown",function(a){a.data.getKeystroke()in{32:1}&&(e.click(),a.data.preventDefault())})})();a.unselectable()},this);var f=CKEDITOR.tools.extend({},d);delete f.style;var h=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,c,f,b,"a",null,{style:d.style,href:"javascript:void(0)",title:d.label,hidefocus:"true","class":d["class"],role:"button","aria-labelledby":h},'\x3cspan id\x3d"'+h+'" class\x3d"cke_dialog_ui_button"\x3e'+
557
557
  CKEDITOR.tools.htmlEncode(d.label)+"\x3c/span\x3e")}},select:function(c,d,b){if(!(3>arguments.length)){var e=a.call(this,d);d.validate&&(this.validate=d.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,c,d,b,function(){var a=CKEDITOR.tools.extend({},d,{id:d.id?d.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),b=[],f=[],k={id:e.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};b.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
558
558
  d.type,'" role\x3d"presentation"');d.width&&b.push('style\x3d"width:'+d.width+'" ');b.push("\x3e");void 0!==d.size&&(k.size=d.size);void 0!==d.multiple&&(k.multiple=d.multiple);h(a);for(var g=0,l;g<d.items.length&&(l=d.items[g]);g++)f.push('\x3coption value\x3d"',CKEDITOR.tools.htmlEncode(void 0!==l[1]?l[1]:l[0]).replace(/"/g,"\x26quot;"),'" /\x3e ',CKEDITOR.tools.htmlEncode(l[0]));"undefined"!=typeof a.inputStyle&&(a.style=a.inputStyle);e.select=new CKEDITOR.ui.dialog.uiElement(c,a,b,"select",null,
@@ -582,44 +582,44 @@ return null}function f(a,b){for(var c=a.$.getElementsByTagName("input"),d=0,e=c.
582
582
  this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}function m(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function h(a){var b=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",K).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),c=b.getChild([0,0,0,0,0]),d=c.getChild(0),
583
583
  e=c.getChild(1);a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c);!CKEDITOR.env.ie||CKEDITOR.env.quirks||CKEDITOR.env.edge||(a="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())",CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"'+a+'" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(c.getParent()));d.unselectable();e.unselectable();return{element:b,
584
584
  parts:{dialog:b.getChild(0),title:d,close:e,tabs:c.getChild(2),contents:c.getChild([3,0,0,0]),footer:c.getChild([3,0,1,0])}}}function k(a,b,c){this.element=b;this.focusIndex=c;this.tabIndex=0;this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};b.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")});b.on("focus",function(){this.fire("mouseover")});b.on("blur",function(){this.fire("mouseout")})}
585
- function c(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();c.on("resize",b);a.on("hide",function(){c.removeListener("resize",b)})}function d(a,c){this.dialog=a;for(var d=c.contents,e=0,f;f=d[e];e++)d[e]=f&&new b(a,f);CKEDITOR.tools.extend(this,c)}function b(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function n(a){function b(c){var g=a.getSize(),l=a.parts.dialog.getParent().getClientSize(),m=c.data.$.screenX,n=c.data.$.screenY,v=m-d.x,r=n-d.y;d={x:m,y:n};e.x+=v;e.y+=r;m=e.x+
586
- k[3]<h?-k[3]:e.x-k[1]>l.width-g.width-h?l.width-g.width+("rtl"==f.lang.dir?0:k[1]):e.x;g=e.y+k[0]<h?-k[0]:e.y-k[2]>l.height-g.height-h?l.height-g.height+k[2]:e.y;m=Math.floor(m);g=Math.floor(g);a.move(m,g,1);c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=C.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var d=null,e=null,f=a.getParentEditor(),
587
- h=f.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof h&&(h=20);a.parts.title.on("mousedown",function(f){if(!a._.moved){var h=a._.element;h.getFirst().setStyle("position","absolute");h.removeStyle("display");a._.moved=!0;a.layout()}d={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);e=a.getPosition();CKEDITOR.env.ie6Compat&&(h=C.getChild(0).getFrameDocument(),h.on("mousemove",b),h.on("mouseup",c));f.data.preventDefault()},
588
- a)}function r(a){function b(c){var n="rtl"==f.lang.dir,v=m.width,r=m.height,x=v+(c.data.$.screenX-l.x)*(n?-1:1)*(a._.moved?1:2),q=r+(c.data.$.screenY-l.y)*(a._.moved?1:2),y=a._.element.getFirst(),y=n&&parseInt(y.getComputedStyle("right"),10),w=a.getPosition();w.x=w.x||0;w.y=w.y||0;w.y+q>g.height&&(q=g.height-w.y);(n?y:w.x)+x>g.width&&(x=g.width-(n?y:w.x));q=Math.floor(q);x=Math.floor(x);if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||e==CKEDITOR.DIALOG_RESIZE_BOTH)v=Math.max(d.minWidth||0,x-h);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||
589
- e==CKEDITOR.DIALOG_RESIZE_BOTH)r=Math.max(d.minHeight||0,q-k);a.resize(v,r);a._.moved&&u(a,a._.position.x,a._.position.y);a._.moved||a.layout();c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);n&&(n.remove(),n=null);if(CKEDITOR.env.ie6Compat){var a=C.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var d=a.definition,e=d.resizable;if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var f=
590
- a.getParentEditor(),h,k,g,l,m,n,v=CKEDITOR.tools.addFunction(function(d){function e(a){return a.isVisible()}m=a.getSize();var f=a.parts.contents,v=f.$.getElementsByTagName("iframe").length,r=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);v&&(n=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'),f.append(n));k=m.height-a.parts.contents.getFirst(e).getSize("height",r);
591
- h=m.width-a.parts.contents.getFirst(e).getSize("width",1);l={x:d.screenX,y:d.screenY};g=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);CKEDITOR.env.ie6Compat&&(f=C.getChild(0).getFrameDocument(),f.on("mousemove",b),f.on("mouseup",c));d.preventDefault&&d.preventDefault()});a.on("load",function(){var b="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+
592
- b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+v+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(v)})}}function u(a,b,c){var d=a.parts.dialog.getParent().getClientSize(),e=a.getSize(),f=a._.viewportRatio,h=Math.max(d.width-e.width,0),d=Math.max(d.height-e.height,0);f.width=h?b/h:f.width;f.height=d?c/d:f.height;
593
- a._.viewportRatio=f}function p(a){a.data.preventDefault(1)}function t(a){var b=a.config,c=CKEDITOR.skinName||a.config.skin,d=b.dialog_backgroundCoverColor||("moono-lisa"==c?"black":"white"),c=b.dialog_backgroundCoverOpacity,e=b.baseFloatZIndex,b=CKEDITOR.tools.genKey(d,c,e),f=I[b];CKEDITOR.document.getBody().addClass("cke_dialog_open");f?f.show():(e=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",e,"; top: 0px; left: 0px; ","; width: 100%; height: 100%;",
585
+ function c(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();c.on("resize",b);a.on("hide",function(){c.removeListener("resize",b)})}function d(a,c){this.dialog=a;for(var d=c.contents,e=0,f;f=d[e];e++)d[e]=f&&new b(a,f);CKEDITOR.tools.extend(this,c)}function b(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function n(a){function b(c){var g=a.getSize(),l=a.parts.dialog.getParent().getClientSize(),m=c.data.$.screenX,n=c.data.$.screenY,u=m-d.x,p=n-d.y;d={x:m,y:n};e.x+=u;e.y+=p;m=e.x+
586
+ k[3]<h?-k[3]:e.x-k[1]>l.width-g.width-h?l.width-g.width+("rtl"==f.lang.dir?0:k[1]):e.x;g=e.y+k[0]<h?-k[0]:e.y-k[2]>l.height-g.height-h?l.height-g.height+k[2]:e.y;m=Math.floor(m);g=Math.floor(g);a.move(m,g,1);c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=A.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var d=null,e=null,f=a.getParentEditor(),
587
+ h=f.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof h&&(h=20);a.parts.title.on("mousedown",function(f){if(!a._.moved){var h=a._.element;h.getFirst().setStyle("position","absolute");h.removeStyle("display");a._.moved=!0;a.layout()}d={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);e=a.getPosition();CKEDITOR.env.ie6Compat&&(h=A.getChild(0).getFrameDocument(),h.on("mousemove",b),h.on("mouseup",c));f.data.preventDefault()},
588
+ a)}function p(a){function b(c){var n="rtl"==f.lang.dir,u=m.width,p=m.height,x=u+(c.data.$.screenX-l.x)*(n?-1:1)*(a._.moved?1:2),t=p+(c.data.$.screenY-l.y)*(a._.moved?1:2),y=a._.element.getFirst(),y=n&&parseInt(y.getComputedStyle("right"),10),w=a.getPosition();w.x=w.x||0;w.y=w.y||0;w.y+t>g.height&&(t=g.height-w.y);(n?y:w.x)+x>g.width&&(x=g.width-(n?y:w.x));t=Math.floor(t);x=Math.floor(x);if(e==CKEDITOR.DIALOG_RESIZE_WIDTH||e==CKEDITOR.DIALOG_RESIZE_BOTH)u=Math.max(d.minWidth||0,x-h);if(e==CKEDITOR.DIALOG_RESIZE_HEIGHT||
589
+ e==CKEDITOR.DIALOG_RESIZE_BOTH)p=Math.max(d.minHeight||0,t-k);a.resize(u,p);a._.moved&&q(a,a._.position.x,a._.position.y);a._.moved||a.layout();c.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);n&&(n.remove(),n=null);if(CKEDITOR.env.ie6Compat){var a=A.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var d=a.definition,e=d.resizable;if(e!=CKEDITOR.DIALOG_RESIZE_NONE){var f=
590
+ a.getParentEditor(),h,k,g,l,m,n,u=CKEDITOR.tools.addFunction(function(d){function e(a){return a.isVisible()}m=a.getSize();var f=a.parts.contents,u=f.$.getElementsByTagName("iframe").length,p=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);u&&(n=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'),f.append(n));k=m.height-a.parts.contents.getFirst(e).getSize("height",p);
591
+ h=m.width-a.parts.contents.getFirst(e).getSize("width",1);l={x:d.screenX,y:d.screenY};g=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);CKEDITOR.env.ie6Compat&&(f=A.getChild(0).getFrameDocument(),f.on("mousemove",b),f.on("mouseup",c));d.preventDefault&&d.preventDefault()});a.on("load",function(){var b="";e==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":e==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+
592
+ b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+u+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(u)})}}function q(a,b,c){var d=a.parts.dialog.getParent().getClientSize(),e=a.getSize(),f=a._.viewportRatio,h=Math.max(d.width-e.width,0),d=Math.max(d.height-e.height,0);f.width=h?b/h:f.width;f.height=d?c/d:f.height;
593
+ a._.viewportRatio=f}function v(a){a.data.preventDefault(1)}function r(a){var b=a.config,c=CKEDITOR.skinName||a.config.skin,d=b.dialog_backgroundCoverColor||("moono-lisa"==c?"black":"white"),c=b.dialog_backgroundCoverOpacity,e=b.baseFloatZIndex,b=CKEDITOR.tools.genKey(d,c,e),f=I[b];CKEDITOR.document.getBody().addClass("cke_dialog_open");f?f.show():(e=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",e,"; top: 0px; left: 0px; ","; width: 100%; height: 100%;",
594
594
  CKEDITOR.env.ie6Compat?"":"background-color: "+d,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(d="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+d+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",e.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),e.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+d+"' );document.close();")+"})())"),e.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),
595
- e.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(e.join("")),f.setOpacity(void 0!==c?c:.5),f.on("keydown",p),f.on("keypress",p),f.on("keyup",p),f.appendTo(CKEDITOR.document.getBody()),I[b]=f);a.focusManager.add(f);C=f;CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus()}function q(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open");C&&(a.focusManager.remove(C),C.hide())}function y(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);
595
+ e.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(e.join("")),f.setOpacity(void 0!==c?c:.5),f.on("keydown",v),f.on("keypress",v),f.on("keyup",v),f.appendTo(CKEDITOR.document.getBody()),I[b]=f);a.focusManager.add(f);A=f;CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus()}function t(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open");A&&(a.focusManager.remove(A),A.hide())}function y(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);
596
596
  (b=J[(b?"CTRL+":"")+(c?"ALT+":"")+(d?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())}function x(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,d=a.data.$.shiftKey,e=String.fromCharCode(a.data.$.keyCode);(b=J[(b?"CTRL+":"")+(c?"ALT+":"")+(d?"SHIFT+":"")+e])&&b.length&&(b=b[b.length-1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),a.data.preventDefault()))}function z(a,b,c,d,e){(J[c]||(J[c]=[])).push({uiElement:a,
597
- dialog:b,key:c,keyup:e||a.accessKeyUp,keydown:d||a.accessKeyDown})}function A(a){for(var b in J){for(var c=J[b],d=c.length-1;0<=d;d--)c[d].dialog!=a&&c[d].uiElement!=a||c.splice(d,1);0===c.length&&delete J[b]}}function w(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])}function v(){}var D=CKEDITOR.tools.cssLength,B,C,G=!CKEDITOR.env.ie||CKEDITOR.env.edge,K='\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"'+(G?"display:flex":
597
+ dialog:b,key:c,keyup:e||a.accessKeyUp,keydown:d||a.accessKeyDown})}function B(a){for(var b in J){for(var c=J[b],d=c.length-1;0<=d;d--)c[d].dialog!=a&&c[d].uiElement!=a||c.splice(d,1);0===c.length&&delete J[b]}}function w(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])}function u(){}var D=CKEDITOR.tools.cssLength,C,A,G=!CKEDITOR.env.ie||CKEDITOR.env.edge,K='\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"'+(G?"display:flex":
598
598
  "")+'" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style\x3d"'+(G?"margin:auto":"position:absolute")+'" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e';
599
- CKEDITOR.dialog=function(b,c){function f(){var a=p._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;c<b;c++)a[c].focusIndex=c}function k(a){var b=p._.focusList;a=a||0;if(!(1>b.length)){var c=p._.currentFocusIndex;p._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(d){}var e=c,f=1<p._.pageCount;do{e+=a;if(f&&!p._.tabBarMode&&(e==b.length||-1==e)){p._.tabBarMode=!0;p._.tabs[p._.currentTabId][0].focus();
600
- p._.currentFocusIndex=-1;return}e=(e+b.length)%b.length;if(e==c)break}while(a&&!b[e].isFocusable());b[e].focus();"text"==b[e].type&&b[e].select()}}function v(c){if(p==CKEDITOR.dialog._.currentTop){var d=c.data.getKeystroke(),e="rtl"==b.lang.dir,f=[37,38,39,40];A=D=0;if(9==d||d==CKEDITOR.SHIFT+9)k(d==CKEDITOR.SHIFT+9?-1:1),A=1;else if(d==CKEDITOR.ALT+121&&!p._.tabBarMode&&1<p.getPageCount())a(p),A=1;else if(-1!=CKEDITOR.tools.indexOf(f,d)&&p._.tabBarMode)d=-1!=CKEDITOR.tools.indexOf([e?39:37,38],d)?
601
- l.call(p):g.call(p),p.selectPage(d),p._.tabs[d][0].focus(),A=1;else if(13!=d&&32!=d||!p._.tabBarMode)if(13==d)d=c.data.getTarget(),d.is("a","button","select","textarea")||d.is("input")&&"button"==d.$.type||((d=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(d.click,0,d),A=1),D=1;else if(27==d)(d=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(d.click,0,d):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),D=1;else return;else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=
602
- -1,k(1),A=1;x(c)}}function x(a){A?a.data.preventDefault(1):D&&a.data.stopPropagation()}var q=CKEDITOR.dialog._.dialogDefinitions[c],y=CKEDITOR.tools.clone(B),w=b.config.dialog_buttonsOrder||"OS",z=b.lang.dir,u={},A,D;("OS"==w&&CKEDITOR.env.mac||"rtl"==w&&"ltr"==z||"ltr"==w&&"rtl"==z)&&y.buttons.reverse();q=CKEDITOR.tools.extend(q(b),y);q=CKEDITOR.tools.clone(q);q=new d(this,q);y=h(b);this._={editor:b,element:y.element,name:c,model:null,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},
603
- buttons:{},accessKeyMap:{},viewportRatio:{width:.5,height:.5},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1};this.parts=y.parts;CKEDITOR.tools.setTimeout(function(){b.fire("ariaWidget",this.parts.contents)},0,this);y={top:0,visibility:"hidden"};CKEDITOR.env.ie6Compat&&(y.position="absolute");y["rtl"==z?"right":"left"]=0;this.parts.dialog.setStyles(y);CKEDITOR.event.call(this);this.definition=q=CKEDITOR.fire("dialogDefinition",
604
- {name:c,definition:q,dialog:this},b).definition;if(!("removeDialogTabs"in b._)&&b.config.removeDialogTabs){y=b.config.removeDialogTabs.split(";");for(z=0;z<y.length;z++)if(w=y[z].split(":"),2==w.length){var t=w[0];u[t]||(u[t]=[]);u[t].push(w[1])}b._.removeDialogTabs=u}if(b._.removeDialogTabs&&(u=b._.removeDialogTabs[c]))for(z=0;z<u.length;z++)q.removeContents(u[z]);if(q.onLoad)this.on("load",q.onLoad);if(q.onShow)this.on("show",q.onShow);if(q.onHide)this.on("hide",q.onHide);if(q.onOk)this.on("ok",
605
- function(a){b.fire("saveSnapshot");setTimeout(function(){b.fire("saveSnapshot")},0);!1===q.onOk.call(this,a)&&(a.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(q.onCancel)this.on("cancel",function(a){!1===q.onCancel.call(this,a)&&(a.data.hide=!1)});var p=this,C=function(a){var b=p._.contents,c=!1,d;for(d in b)for(var e in b[d])if(c=a.call(this,b[d][e]))return};this.on("ok",function(a){C(function(b){if(b.validate){var c=b.validate(this),d="string"==typeof c||!1===c;d&&(a.data.hide=!1,a.stop());
606
- e.call(b,!d,"string"==typeof c?c:void 0);return d}})},this,null,0);this.on("cancel",function(a){C(function(c){if(c.isChanged())return b.config.dialog_noConfirmCancel||confirm(b.lang.common.confirmCancel)||(a.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=k;var G=this._.element;b.focusManager.add(G,1);this.on("show",function(){G.on("keydown",v,this);if(CKEDITOR.env.gecko)G.on("keypress",
607
- x,this)});this.on("hide",function(){G.removeListener("keydown",v);CKEDITOR.env.gecko&&G.removeListener("keypress",x);C(function(a){m.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",v,this,null,0)});this.on("show",function(){f();var a=1<p._.pageCount;b.config.dialog_startupFocusTab&&a?(p._.tabBarMode=!0,p._.tabs[p._.currentTabId][0].focus(),p._.currentFocusIndex=-1):this._.hasFocus||(this._.currentFocusIndex=a?-1:this._.focusList.length-
608
- 1,q.onFocus?(a=q.onFocus.call(this))&&a.focus():k(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);n(this);r(this);(new CKEDITOR.dom.text(q.title,CKEDITOR.document)).appendTo(this.parts.title);for(z=0;z<q.contents.length;z++)(u=q.contents[z])&&this.addPage(u);this.parts.tabs.on("click",function(b){var c=b.data.getTarget();c.hasClass("cke_dialog_tab")&&(c=c.$.id,this.selectPage(c.substring(4,c.lastIndexOf("_"))),
609
- a(this),b.data.preventDefault())},this);z=[];u=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:q.buttons},z).getChild();this.parts.footer.setHtml(z.join(""));for(z=0;z<u.length;z++)this._.buttons[u[z].id]=u[z]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(a,b){if(!this._.contentSize||this._.contentSize.width!=a||this._.contentSize.height!=b){CKEDITOR.dialog.fire("resize",
599
+ CKEDITOR.dialog=function(b,c){function f(){var a=A._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;c<b;c++)a[c].focusIndex=c}function k(a){var b=A._.focusList;a=a||0;if(!(1>b.length)){var c=A._.currentFocusIndex;A._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(d){}var e=c,f=1<A._.pageCount;do{e+=a;if(f&&!A._.tabBarMode&&(e==b.length||-1==e)){A._.tabBarMode=!0;A._.tabs[A._.currentTabId][0].focus();
600
+ A._.currentFocusIndex=-1;return}e=(e+b.length)%b.length;if(e==c)break}while(a&&!b[e].isFocusable());b[e].focus();"text"==b[e].type&&b[e].select()}}function u(c){if(A==CKEDITOR.dialog._.currentTop){var d=c.data.getKeystroke(),e="rtl"==b.lang.dir,f=[37,38,39,40];B=D=0;if(9==d||d==CKEDITOR.SHIFT+9)k(d==CKEDITOR.SHIFT+9?-1:1),B=1;else if(d==CKEDITOR.ALT+121&&!A._.tabBarMode&&1<A.getPageCount())a(A),B=1;else if(-1!=CKEDITOR.tools.indexOf(f,d)&&A._.tabBarMode)d=-1!=CKEDITOR.tools.indexOf([e?39:37,38],d)?
601
+ l.call(A):g.call(A),A.selectPage(d),A._.tabs[d][0].focus(),B=1;else if(13!=d&&32!=d||!A._.tabBarMode)if(13==d)d=c.data.getTarget(),d.is("a","button","select","textarea")||d.is("input")&&"button"==d.$.type||((d=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(d.click,0,d),B=1),D=1;else if(27==d)(d=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(d.click,0,d):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),D=1;else return;else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=
602
+ -1,k(1),B=1;x(c)}}function x(a){B?a.data.preventDefault(1):D&&a.data.stopPropagation()}var t=CKEDITOR.dialog._.dialogDefinitions[c],y=CKEDITOR.tools.clone(C),w=b.config.dialog_buttonsOrder||"OS",z=b.lang.dir,q={},B,D;("OS"==w&&CKEDITOR.env.mac||"rtl"==w&&"ltr"==z||"ltr"==w&&"rtl"==z)&&y.buttons.reverse();t=CKEDITOR.tools.extend(t(b),y);t=CKEDITOR.tools.clone(t);t=new d(this,t);y=h(b);this._={editor:b,element:y.element,name:c,model:null,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},
603
+ buttons:{},accessKeyMap:{},viewportRatio:{width:.5,height:.5},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1};this.parts=y.parts;CKEDITOR.tools.setTimeout(function(){b.fire("ariaWidget",this.parts.contents)},0,this);y={top:0,visibility:"hidden"};CKEDITOR.env.ie6Compat&&(y.position="absolute");y["rtl"==z?"right":"left"]=0;this.parts.dialog.setStyles(y);CKEDITOR.event.call(this);this.definition=t=CKEDITOR.fire("dialogDefinition",
604
+ {name:c,definition:t,dialog:this},b).definition;if(!("removeDialogTabs"in b._)&&b.config.removeDialogTabs){y=b.config.removeDialogTabs.split(";");for(z=0;z<y.length;z++)if(w=y[z].split(":"),2==w.length){var r=w[0];q[r]||(q[r]=[]);q[r].push(w[1])}b._.removeDialogTabs=q}if(b._.removeDialogTabs&&(q=b._.removeDialogTabs[c]))for(z=0;z<q.length;z++)t.removeContents(q[z]);if(t.onLoad)this.on("load",t.onLoad);if(t.onShow)this.on("show",t.onShow);if(t.onHide)this.on("hide",t.onHide);if(t.onOk)this.on("ok",
605
+ function(a){b.fire("saveSnapshot");setTimeout(function(){b.fire("saveSnapshot")},0);!1===t.onOk.call(this,a)&&(a.data.hide=!1)});this.state=CKEDITOR.DIALOG_STATE_IDLE;if(t.onCancel)this.on("cancel",function(a){!1===t.onCancel.call(this,a)&&(a.data.hide=!1)});var A=this,v=function(a){var b=A._.contents,c=!1,d;for(d in b)for(var e in b[d])if(c=a.call(this,b[d][e]))return};this.on("ok",function(a){v(function(b){if(b.validate){var c=b.validate(this),d="string"==typeof c||!1===c;d&&(a.data.hide=!1,a.stop());
606
+ e.call(b,!d,"string"==typeof c?c:void 0);return d}})},this,null,0);this.on("cancel",function(a){v(function(c){if(c.isChanged())return b.config.dialog_noConfirmCancel||confirm(b.lang.common.confirmCancel)||(a.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=k;var G=this._.element;b.focusManager.add(G,1);this.on("show",function(){G.on("keydown",u,this);if(CKEDITOR.env.gecko)G.on("keypress",
607
+ x,this)});this.on("hide",function(){G.removeListener("keydown",u);CKEDITOR.env.gecko&&G.removeListener("keypress",x);v(function(a){m.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",u,this,null,0)});this.on("show",function(){f();var a=1<A._.pageCount;b.config.dialog_startupFocusTab&&a?(A._.tabBarMode=!0,A._.tabs[A._.currentTabId][0].focus(),A._.currentFocusIndex=-1):this._.hasFocus||(this._.currentFocusIndex=a?-1:this._.focusList.length-
608
+ 1,t.onFocus?(a=t.onFocus.call(this))&&a.focus():k(1))},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);n(this);p(this);(new CKEDITOR.dom.text(t.title,CKEDITOR.document)).appendTo(this.parts.title);for(z=0;z<t.contents.length;z++)(q=t.contents[z])&&this.addPage(q);this.parts.tabs.on("click",function(b){var c=b.data.getTarget();c.hasClass("cke_dialog_tab")&&(c=c.$.id,this.selectPage(c.substring(4,c.lastIndexOf("_"))),
609
+ a(this),b.data.preventDefault())},this);z=[];q=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:t.buttons},z).getChild();this.parts.footer.setHtml(z.join(""));for(z=0;z<q.length;z++)this._.buttons[q[z].id]=q[z]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(a,b){if(!this._.contentSize||this._.contentSize.width!=a||this._.contentSize.height!=b){CKEDITOR.dialog.fire("resize",
610
610
  {dialog:this,width:a,height:b},this._.editor);this.fire("resize",{width:a,height:b},this._.editor);this.parts.contents.setStyles({width:a+"px",height:b+"px"});if("rtl"==this._.editor.lang.dir&&this._.position){var c=this.parts.dialog.getParent().getClientSize().width;this._.position.x=c-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)}this._.contentSize={width:a,height:b}}},getSize:function(){var a=this._.element.getFirst();return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||
611
- 0}},move:function(a,b,c){var d=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir;CKEDITOR.env.ie&&d.setStyle("zoom","100%");var f=this.parts.dialog.getParent().getClientSize(),h=this.getSize(),k=this._.viewportRatio,g=Math.max(f.width-h.width,0),f=Math.max(f.height-h.height,0);this._.position&&this._.position.x==a&&this._.position.y==b?(a=Math.floor(g*k.width),b=Math.floor(f*k.height)):u(this,a,b);this._.position={x:a,y:b};e&&(a=g-a);b={top:(0<b?b:0)+"px"};b[e?"right":"left"]=(0<a?a:0)+"px";
611
+ 0}},move:function(a,b,c){var d=this._.element.getFirst(),e="rtl"==this._.editor.lang.dir;CKEDITOR.env.ie&&d.setStyle("zoom","100%");var f=this.parts.dialog.getParent().getClientSize(),h=this.getSize(),k=this._.viewportRatio,g=Math.max(f.width-h.width,0),f=Math.max(f.height-h.height,0);this._.position&&this._.position.x==a&&this._.position.y==b?(a=Math.floor(g*k.width),b=Math.floor(f*k.height)):q(this,a,b);this._.position={x:a,y:b};e&&(a=g-a);b={top:(0<b?b:0)+"px"};b[e?"right":"left"]=(0<a?a:0)+"px";
612
612
  d.setStyles(b);c&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,b=this.definition,d=CKEDITOR.document.getBody(),e=this._.editor.config.baseFloatZIndex;a.getParent()&&a.getParent().equals(d)?a.setStyle("display",G?"flex":"block"):a.appendTo(d);this.resize(this._.contentSize&&this._.contentSize.width||b.width||b.minWidth,this._.contentSize&&this._.contentSize.height||b.height||b.minHeight);this.reset();null===this._.currentTabId&&
613
- this.selectPage(this.definition.contents[0].id);null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=e);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);this.getElement().setStyle("z-index",CKEDITOR.dialog._.currentZIndex);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,t(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,d=this._.parentDialog.getElement().getFirst(),d.$.style.zIndex-=
613
+ this.selectPage(this.definition.contents[0].id);null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=e);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);this.getElement().setStyle("z-index",CKEDITOR.dialog._.currentZIndex);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,r(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,d=this._.parentDialog.getElement().getFirst(),d.$.style.zIndex-=
614
614
  Math.floor(e/2),this._.parentDialog.getElement().setStyle("z-index",d.$.style.zIndex),CKEDITOR.dialog._.currentTop=this);a.on("keydown",y);a.on("keyup",x);this._.hasFocus=!1;for(var f in b.contents)if(b.contents[f]){var a=b.contents[f],e=this._.tabs[a.id],d=a.requiredContent,h=0;if(e){for(var k in this._.contents[a.id]){var g=this._.contents[a.id][k];"hbox"!=g.type&&"vbox"!=g.type&&g.getInputElement()&&(g.requiredContent&&!this._.editor.activeFilter.check(g.requiredContent)?g.disable():(g.enable(),
615
615
  h++))}!h||d&&!this._.editor.activeFilter.check(d)?e[0].addClass("cke_dialog_tab_disabled"):e[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();c(this);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=
616
616
  this.parts.dialog;if(this._.moved||!G){var b=this.getSize(),c=CKEDITOR.document.getWindow().getViewPaneSize(),d;this._.moved&&this._.position?(d=this._.position.x,b=this._.position.y):(d=(c.width-b.width)/2,b=(c.height-b.height)/2);CKEDITOR.env.ie6Compat||(a.setStyle("position","absolute"),a.removeStyle("margin"));d=Math.floor(d);b=Math.floor(b);this.move(d,b)}},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,this._.contents[b][c]);return this},reset:function(){var a=
617
617
  function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",this);this.selectPage(this._.tabIdList[0]);
618
- var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(A(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();this._.parentDialog.getElement().removeStyle("z-index");b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else q(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=
618
+ var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(B(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();this._.parentDialog.getElement().removeStyle("z-index");b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else t(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=
619
619
  10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",y);a.removeListener("keyup",x);var c=this._.editor;c.focus();setTimeout(function(){c.focusManager.unlock();CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&a.resetInitValue()});this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title\x3d"'+CKEDITOR.tools.htmlEncode(a.label)+
620
620
  '"':"",d=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),e=this._.contents[a.id]={},f=d.getChild(),h=0;d=f.shift();)d.notAllowed||"hbox"==d.type||"vbox"==d.type||h++,e[d.id]=d,"function"==typeof d.getChild&&f.push.apply(f,d.getChild());h||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");b.setStyle("min-height",
621
621
  "100%");d=CKEDITOR.env;e="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();c=CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"',0<this._.pageCount?" cke_last":"cke_first",c,a.hidden?' style\x3d"display:none"':"",' id\x3d"',e,'"',d.gecko&&!d.hc?"":' href\x3d"javascript:void(0)"',' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e',a.label,"\x3c/a\x3e"].join(""));b.setAttribute("aria-labelledby",e);this._.tabs[a.id]=[c,b];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;
622
- this._.lastTab=c;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);c.unselectable();this.parts.tabs.append(c);a.accessKey&&(z(this,this,"CTRL+"+a.accessKey,v,w),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var b in this._.tabs){var c=this._.tabs[b][0],d=this._.tabs[b][1];b!=a&&(c.removeClass("cke_dialog_tab_selected"),
622
+ this._.lastTab=c;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);c.unselectable();this.parts.tabs.append(c);a.accessKey&&(z(this,this,"CTRL+"+a.accessKey,u,w),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var b in this._.tabs){var c=this._.tabs[b][0],d=this._.tabs[b][1];b!=a&&(c.removeClass("cke_dialog_tab_selected"),
623
623
  c.removeAttribute("aria-selected"),d.hide());d.setAttribute("aria-hidden",b!=a)}var e=this._.tabs[a];e[0].addClass("cke_dialog_tab_selected");e[0].setAttribute("aria-selected",!0);CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(f(e[1]),e[1].show(),setTimeout(function(){f(e[1],1)},0)):e[1].show();this._.currentTabId=a;this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(a){var b=
624
624
  this._.tabs[a]&&this._.tabs[a][0];b&&1!=this._.pageCount&&b.isVisible()&&(a==this._.currentTabId&&this.selectPage(l.call(this)),b.hide(),this._.pageCount--,this.updateStyle())},showPage:function(a){if(a=this._.tabs[a]&&this._.tabs[a][0])a.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(a,b){var c=this._.contents[a];return c&&c[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},
625
625
  setValueOf:function(a,b,c){return this.getContentElement(a,b).setValue(c)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,
@@ -628,13 +628,13 @@ b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new
628
628
  a=this.getModel(a);return!a||a instanceof CKEDITOR.dom.element&&!a.getParent()?CKEDITOR.dialog.CREATION_MODE:CKEDITOR.dialog.EDITING_MODE}};CKEDITOR.tools.extend(CKEDITOR.dialog,{CREATION_MODE:0,EDITING_MODE:1,add:function(a,b){this._.dialogDefinitions[a]&&"function"!=typeof b||(this._.dialogDefinitions[a]=b)},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(a,b,c){a=a.config.removeDialogTabs;return!(a&&a.match(new RegExp("(?:^|;)"+
629
629
  b+":"+c+"(?:$|;)","i")))},okButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"ok",type:"button",label:a.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(a){a=a.data.dialog;!1!==a.fire("ok",{hide:!0}).hide&&a.hide()}},b,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},!0)};return a}(),cancelButton:function(){var a=function(a,b){b=b||{};return CKEDITOR.tools.extend({id:"cancel",type:"button",
630
630
  label:a.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;!1!==a.fire("cancel",{hide:!0}).hide&&a.hide()}},b,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},!0)};return a}(),addUIElement:function(a,b){this._.uiElementBuilders[a]=b}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
631
- B={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]};var H=function(a,b,c){for(var d=0,e;e=a[d];d++)if(e.id==b||c&&e[c]&&(e=H(e[c],b,c)))return e;return null},E=function(a,b,c,d,e){if(c){for(var f=0,h;h=a[f];f++){if(h.id==c)return a.splice(f,0,b),b;if(d&&h[d]&&(h=E(h[d],b,c,d,!0)))return h}if(e)return null}a.push(b);return b},M=function(a,b,c){for(var d=0,e;e=a[d];d++){if(e.id==b)return a.splice(d,1);if(c&&e[c]&&(e=M(e[c],
631
+ C={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]};var H=function(a,b,c){for(var d=0,e;e=a[d];d++)if(e.id==b||c&&e[c]&&(e=H(e[c],b,c)))return e;return null},E=function(a,b,c,d,e){if(c){for(var f=0,h;h=a[f];f++){if(h.id==c)return a.splice(f,0,b),b;if(d&&h[d]&&(h=E(h[d],b,c,d,!0)))return h}if(e)return null}a.push(b);return b},M=function(a,b,c){for(var d=0,e;e=a[d];d++){if(e.id==b)return a.splice(d,1);if(c&&e[c]&&(e=M(e[c],
632
632
  b,c)))return e}return null};d.prototype={getContents:function(a){return H(this.contents,a)},getButton:function(a){return H(this.buttons,a)},addContents:function(a,b){return E(this.contents,a,b)},addButton:function(a,b){return E(this.buttons,a,b)},removeContents:function(a){M(this.contents,a)},removeButton:function(a){M(this.buttons,a)}};b.prototype={get:function(a){return H(this.elements,a,"children")},add:function(a,b){return E(this.elements,a,b,"children")},remove:function(a){M(this.elements,a,
633
- "children")}};var I={},J={};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,c,d,e,f,h){if(!(4>arguments.length)){var k=(d.call?d(b):d)||"div",g=["\x3c",k," "],l=(e&&e.call?e(b):e)||{},m=(f&&f.call?f(b):f)||{},n=(h&&h.call?h.call(this,a,b):h)||"",v=this.domId=m.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(l.display="none",this.notAllowed=!0);m.id=v;var r={};b.type&&(r["cke_dialog_ui_"+b.type]=1);b.className&&(r[b.className]=
634
- 1);b.disabled&&(r.cke_disabled=1);for(var q=m["class"]&&m["class"].split?m["class"].split(" "):[],v=0;v<q.length;v++)q[v]&&(r[q[v]]=1);q=[];for(v in r)q.push(v);m["class"]=q.join(" ");b.title&&(m.title=b.title);r=(b.style||"").split(";");b.align&&(q=b.align,l["margin-left"]="left"==q?0:"auto",l["margin-right"]="right"==q?0:"auto");for(v in l)r.push(v+":"+l[v]);b.hidden&&r.push("display:none");for(v=r.length-1;0<=v;v--)""===r[v]&&r.splice(v,1);0<r.length&&(m.style=(m.style?m.style+"; ":"")+r.join("; "));
635
- for(v in m)g.push(v+'\x3d"'+CKEDITOR.tools.htmlEncode(m[v])+'" ');g.push("\x3e",n,"\x3c/",k,"\x3e");c.push(g.join(""));(this._||(this._={})).dialog=a;"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged});"function"==typeof b.isChanged&&(this.isChanged=b.isChanged);"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(c){a.call(this,b.setValue.call(this,c))}}));"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,
636
- function(a){return function(){return b.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&this.accessKeyDown&&b.accessKey&&z(this,a,"CTRL+"+b.accessKey);var x=this;a.on("load",function(){var b=x.getInputElement();if(b){var c=x.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;x.fire("focus");c&&this.addClass(c)});b.on("blur",function(){x.fire("blur");
637
- c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=x.focusIndex}))}},hbox:function(a,b,c,d,e){if(!(4>arguments.length)){this._||(this._={});var f=this._.children=b,h=e&&e.widths||null,k=e&&e.height||null,g,l={role:"presentation"};e&&e.align&&(l.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},d,"table",{},l,function(){var a=
633
+ "children")}};var I={},J={};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,c,d,e,f,h){if(!(4>arguments.length)){var k=(d.call?d(b):d)||"div",g=["\x3c",k," "],l=(e&&e.call?e(b):e)||{},m=(f&&f.call?f(b):f)||{},n=(h&&h.call?h.call(this,a,b):h)||"",u=this.domId=m.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(l.display="none",this.notAllowed=!0);m.id=u;var p={};b.type&&(p["cke_dialog_ui_"+b.type]=1);b.className&&(p[b.className]=
634
+ 1);b.disabled&&(p.cke_disabled=1);for(var x=m["class"]&&m["class"].split?m["class"].split(" "):[],u=0;u<x.length;u++)x[u]&&(p[x[u]]=1);x=[];for(u in p)x.push(u);m["class"]=x.join(" ");b.title&&(m.title=b.title);p=(b.style||"").split(";");b.align&&(x=b.align,l["margin-left"]="left"==x?0:"auto",l["margin-right"]="right"==x?0:"auto");for(u in l)p.push(u+":"+l[u]);b.hidden&&p.push("display:none");for(u=p.length-1;0<=u;u--)""===p[u]&&p.splice(u,1);0<p.length&&(m.style=(m.style?m.style+"; ":"")+p.join("; "));
635
+ for(u in m)g.push(u+'\x3d"'+CKEDITOR.tools.htmlEncode(m[u])+'" ');g.push("\x3e",n,"\x3c/",k,"\x3e");c.push(g.join(""));(this._||(this._={})).dialog=a;"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged});"function"==typeof b.isChanged&&(this.isChanged=b.isChanged);"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(c){a.call(this,b.setValue.call(this,c))}}));"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,
636
+ function(a){return function(){return b.getValue.call(this,a.call(this))}}));CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&this.accessKeyDown&&b.accessKey&&z(this,a,"CTRL+"+b.accessKey);var t=this;a.on("load",function(){var b=t.getInputElement();if(b){var c=t.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=!1;a._.hasFocus=!0;t.fire("focus");c&&this.addClass(c)});b.on("blur",function(){t.fire("blur");
637
+ c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=t.focusIndex}))}},hbox:function(a,b,c,d,e){if(!(4>arguments.length)){this._||(this._={});var f=this._.children=b,h=e&&e.widths||null,k=e&&e.height||null,g,l={role:"presentation"};e&&e.align&&(l.align=e.align);CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"hbox"},d,"table",{},l,function(){var a=
638
638
  ['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(g=0;g<c.length;g++){var b="cke_dialog_ui_hbox_child",d=[];0===g&&(b="cke_dialog_ui_hbox_first");g==c.length-1&&(b="cke_dialog_ui_hbox_last");a.push('\x3ctd class\x3d"',b,'" role\x3d"presentation" ');h?h[g]&&d.push("width:"+D(h[g])):d.push("width:"+Math.floor(100/c.length)+"%");k&&d.push("height:"+D(k));e&&void 0!==e.padding&&d.push("padding:"+D(e.padding));CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f[g].align&&d.push("text-align:"+f[g].align);
639
639
  0<d.length&&a.push('style\x3d"'+d.join("; ")+'" ');a.push("\x3e",c[g],"\x3c/td\x3e")}a.push("\x3c/tr\x3e\x3c/tbody\x3e");return a.join("")})}},vbox:function(a,b,c,d,e){if(!(3>arguments.length)){this._||(this._={});var f=this._.children=b,h=e&&e.width||null,k=e&&e.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,e||{type:"vbox"},d,"div",null,{role:"presentation"},function(){var b=['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];b.push('style\x3d"');e&&e.expand&&b.push("height:100%;");
640
640
  b.push("width:"+D(h||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align\x3d"',CKEDITOR.tools.htmlEncode(e&&e.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("\x3e\x3ctbody\x3e");for(var d=0;d<c.length;d++){var g=[];b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');h&&g.push("width:"+D(h||"100%"));k?g.push("height:"+D(k[d])):e&&e.expand&&g.push("height:"+Math.floor(100/c.length)+"%");e&&void 0!==e.padding&&g.push("padding:"+D(e.padding));CKEDITOR.env.ie&&
@@ -647,7 +647,7 @@ h,f,c,b)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("
647
647
  f=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){var a=arguments;return function(){var b=this&&this.getValue?this.getValue():a[0],c,d=CKEDITOR.VALIDATE_AND,e=[],f;for(f=0;f<a.length;f++)if("function"==typeof a[f])e.push(a[f]);else break;f<a.length&&"string"==typeof a[f]&&(c=a[f],f++);f<a.length&&"number"==typeof a[f]&&(d=a[f]);var h=d==CKEDITOR.VALIDATE_AND?!0:!1;for(f=0;f<e.length;f++)h=d==CKEDITOR.VALIDATE_AND?h&&
648
648
  e[f](b):h||e[f](b);return h?!0:c}},regex:function(a,b){return function(c){c=this&&this.getValue?this.getValue():c;return a.test(c)?!0:b}},notEmpty:function(b){return this.regex(a,b)},integer:function(a){return this.regex(b,a)},number:function(a){return this.regex(c,a)},cssLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},a)},htmlLength:function(a){return this.functions(function(a){return d.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return f.test(CKEDITOR.tools.trim(a))},
649
649
  a)},equals:function(a,b){return this.functions(function(b){return b==a},b)},notEqual:function(a,b){return this.functions(function(b){return b!=a},b)}};CKEDITOR.on("instanceDestroyed",function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var b;b=CKEDITOR.dialog._.currentTop;)b.hide();for(var c in I)I[c].remove();I={}}a=a.editor._.storedDialogs;for(var d in a)a[d].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b,c){var d=null,e=CKEDITOR.dialog._.dialogDefinitions[a];
650
- null===CKEDITOR.dialog._.currentTop&&t(this);if("function"==typeof e)e=this._.storedDialogs||(this._.storedDialogs={}),d=e[a]||(e[a]=new CKEDITOR.dialog(this,a)),d.setModel(c),b&&b.call(d,d),d.show();else{if("failed"==e)throw q(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');"string"==typeof e&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[a]&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");
650
+ null===CKEDITOR.dialog._.currentTop&&r(this);if("function"==typeof e)e=this._.storedDialogs||(this._.storedDialogs={}),d=e[a]||(e[a]=new CKEDITOR.dialog(this,a)),d.setModel(c),b&&b.call(d,d),d.show();else{if("failed"==e)throw t(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');"string"==typeof e&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[a]&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");
651
651
  this.openDialog(a,b,c)},this,0,1)}CKEDITOR.skin.loadPart("dialog");if(d)d.once("hide",function(){d.setModel(null)},null,null,999);return d}})})();var ka=!1;CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(a){ka||(CKEDITOR.document.appendStyleSheet(this.path+"styles/dialog.css"),ka=!0);a.on("doubleclick",function(l){l.data.dialog&&a.openDialog(l.data.dialog)},null,null,999)}});"use strict";(function(){function a(a,f){CKEDITOR.tools.extend(this,f,{editor:a,id:"cke-"+CKEDITOR.tools.getUniqueId(),
652
652
  area:a._.notificationArea});f.type||(this.type="info");this.element=this._createElement();a.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)}function l(a){var f=this;this.editor=a;this.notifications=[];this.element=this._createElement();this._uiBuffer=CKEDITOR.tools.eventsBuffer(10,this._layout,this);this._changeBuffer=CKEDITOR.tools.eventsBuffer(500,this._layout,this);a.on("destroy",function(){f._removeListeners();f.element.remove()})}CKEDITOR.plugins.add("notification",
653
653
  {init:function(a){function f(a){var f=new CKEDITOR.dom.element("div");f.setStyles({position:"fixed","margin-left":"-9999px"});f.setAttributes({"aria-live":"assertive","aria-atomic":"true"});f.setText(a);CKEDITOR.document.getBody().append(f);setTimeout(function(){f.remove()},100)}a._.notificationArea=new l(a);a.showNotification=function(e,f,h){var k,c;"progress"==f?k=h:c=h;e=new CKEDITOR.plugins.notification(a,{message:e,type:f,progress:k,duration:c});e.show();return e};a.on("key",function(e){if(27==
@@ -658,46 +658,46 @@ a.progress&&"progress"!=this.type&&(k="progress");k&&(e.removeClass(this._getCla
658
658
  this.type?"cke_notification_info":"cke_notification_"+this.type},_createProgressElement:function(){var a=new CKEDITOR.dom.element("span");a.addClass("cke_notification_progress");a.setStyle("width",this._getPercentageProgress());return a},_getPercentageProgress:function(){return Math.round(100*(this.progress||0))+"%"},_hideAfterTimeout:function(){var a=this,f;this._hideTimeoutId&&clearTimeout(this._hideTimeoutId);if("number"==typeof this.duration)f=this.duration;else if("info"==this.type||"success"==
659
659
  this.type)f="number"==typeof this.editor.config.notification_duration?this.editor.config.notification_duration:5E3;f&&(a._hideTimeoutId=setTimeout(function(){a.hide()},f))}};l.prototype={add:function(a){this.notifications.push(a);this.element.append(a.element);1==this.element.getChildCount()&&(CKEDITOR.document.getBody().append(this.element),this._attachListeners());this._layout()},remove:function(a){var f=CKEDITOR.tools.indexOf(this.notifications,a);0>f||(this.notifications.splice(f,1),a.element.remove(),
660
660
  this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var a=this.editor,f=a.config,e=new CKEDITOR.dom.element("div");e.addClass("cke_notifications_area");e.setAttribute("id","cke_notifications_area_"+a.name);e.setStyle("z-index",f.baseFloatZIndex-2);return e},_attachListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.on("scroll",this._uiBuffer.input);a.on("resize",this._uiBuffer.input);f.on("change",this._changeBuffer.input);
661
- f.on("floatingSpaceLayout",this._layout,this,null,20);f.on("blur",this._layout,this,null,20)},_removeListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.removeListener("scroll",this._uiBuffer.input);a.removeListener("resize",this._uiBuffer.input);f.removeListener("change",this._changeBuffer.input);f.removeListener("floatingSpaceLayout",this._layout);f.removeListener("blur",this._layout)},_layout:function(){function a(){f.setStyle("left",y(x+l.width-n-r))}var f=this.element,e=
662
- this.editor,l=e.ui.contentsElement.getClientRect(),h=e.ui.contentsElement.getDocumentPosition(),k,c,d=f.getClientRect(),b,n=this._notificationWidth,r=this._notificationMargin;b=CKEDITOR.document.getWindow();var u=b.getScrollPosition(),p=b.getViewPaneSize(),t=CKEDITOR.document.getBody(),q=t.getDocumentPosition(),y=CKEDITOR.tools.cssLength;n&&r||(b=this.element.getChild(0),n=this._notificationWidth=b.getClientRect().width,r=this._notificationMargin=parseInt(b.getComputedStyle("margin-left"),10)+parseInt(b.getComputedStyle("margin-right"),
663
- 10));e.toolbar&&(k=e.ui.space(e.config.toolbarLocation),c=k.getClientRect());k&&k.isVisible()&&c.bottom>l.top&&c.bottom<l.bottom-d.height?f.setStyles({position:"fixed",top:y(c.bottom)}):0<l.top?f.setStyles({position:"absolute",top:y(h.y)}):h.y+l.height-d.height>u.y?f.setStyles({position:"fixed",top:0}):f.setStyles({position:"absolute",top:y(h.y+l.height-d.height)});var x="fixed"==f.getStyle("position")?l.left:"static"!=t.getComputedStyle("position")?h.x-q.x:h.x;l.width<n+r?h.x+n+r>u.x+p.width?a():
664
- f.setStyle("left",y(x)):h.x+n+r>u.x+p.width?f.setStyle("left",y(x)):h.x+l.width/2+n/2+r>u.x+p.width?f.setStyle("left",y(x-h.x+u.x+p.width-n-r)):0>l.left+l.width-n-r?a():0>l.left+l.width/2-n/2?f.setStyle("left",y(x-h.x+u.x)):f.setStyle("left",y(x+l.width/2-n/2-r/2))}};CKEDITOR.plugins.notification=a})();(function(){var a='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';
661
+ f.on("floatingSpaceLayout",this._layout,this,null,20);f.on("blur",this._layout,this,null,20)},_removeListeners:function(){var a=CKEDITOR.document.getWindow(),f=this.editor;a.removeListener("scroll",this._uiBuffer.input);a.removeListener("resize",this._uiBuffer.input);f.removeListener("change",this._changeBuffer.input);f.removeListener("floatingSpaceLayout",this._layout);f.removeListener("blur",this._layout)},_layout:function(){function a(){f.setStyle("left",y(x+l.width-n-p))}var f=this.element,e=
662
+ this.editor,l=e.ui.contentsElement.getClientRect(),h=e.ui.contentsElement.getDocumentPosition(),k,c,d=f.getClientRect(),b,n=this._notificationWidth,p=this._notificationMargin;b=CKEDITOR.document.getWindow();var q=b.getScrollPosition(),v=b.getViewPaneSize(),r=CKEDITOR.document.getBody(),t=r.getDocumentPosition(),y=CKEDITOR.tools.cssLength;n&&p||(b=this.element.getChild(0),n=this._notificationWidth=b.getClientRect().width,p=this._notificationMargin=parseInt(b.getComputedStyle("margin-left"),10)+parseInt(b.getComputedStyle("margin-right"),
663
+ 10));e.toolbar&&(k=e.ui.space(e.config.toolbarLocation),c=k.getClientRect());k&&k.isVisible()&&c.bottom>l.top&&c.bottom<l.bottom-d.height?f.setStyles({position:"fixed",top:y(c.bottom)}):0<l.top?f.setStyles({position:"absolute",top:y(h.y)}):h.y+l.height-d.height>q.y?f.setStyles({position:"fixed",top:0}):f.setStyles({position:"absolute",top:y(h.y+l.height-d.height)});var x="fixed"==f.getStyle("position")?l.left:"static"!=r.getComputedStyle("position")?h.x-t.x:h.x;l.width<n+p?h.x+n+p>q.x+v.width?a():
664
+ f.setStyle("left",y(x)):h.x+n+p>q.x+v.width?f.setStyle("left",y(x)):h.x+l.width/2+n/2+p>q.x+v.width?f.setStyle("left",y(x-h.x+q.x+v.width-n-p)):0>l.left+l.width-n-p?a():0>l.left+l.width/2-n/2?f.setStyle("left",y(x-h.x+q.x)):f.setStyle("left",y(x+l.width/2-n/2-p/2))}};CKEDITOR.plugins.notification=a})();(function(){var a='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';
665
665
  CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(a+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(a+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var l="";CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var a=a+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+l+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"')+
666
666
  '\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',g=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),f=CKEDITOR.addTemplate("button",a);CKEDITOR.plugins.add("button",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,
667
667
  CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(f){f.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,l){function h(){var b=a.mode;b&&(b=this.modes[b]?void 0!==k[b]?k[b]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,b=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:
668
- b,this.setState(b),this.refresh&&this.refresh())}var k=null,c=CKEDITOR.env,d=this._.id=CKEDITOR.tools.getNextId(),b="",n=this.command,r,u,p;this._.editor=a;var t={id:d,button:this,editor:a,focus:function(){CKEDITOR.document.getById(d).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},q=CKEDITOR.tools.addFunction(function(a){if(t.onkey)return a=new CKEDITOR.dom.event(a),!1!==t.onkey(t,a.getKeystroke())}),y=CKEDITOR.tools.addFunction(function(a){var b;t.onfocus&&
669
- (b=!1!==t.onfocus(t,new CKEDITOR.dom.event(a)));return b}),x=0;t.clickFn=r=CKEDITOR.tools.addFunction(function(){x&&(a.unlockSelection(1),x=0);t.execute();c.iOS&&a.focus()});this.modes?(k={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(k[a.mode]=this._.state)},this),a.on("activeFilterChange",h,this),a.on("mode",h,this),!this.readOnly&&a.on("readOnly",h,this)):n&&(n=a.getCommand(n))&&(n.on("state",function(){this.setState(n.state)},this),b+=n.state==CKEDITOR.TRISTATE_ON?
670
- "on":n.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var z;if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst();b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(z,"rtl"==b,this.icon,this.iconOffset))},this);n?(u=a.getCommandKeystroke(n))&&(p=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,u)):b+="off";u=this.name||this.command;var A=
671
- null,w=this.icon;z=u;this.icon&&!/\./.test(this.icon)?(z=this.icon,w=null):(this.icon&&(A=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(A=this.iconHiDpi));A?(CKEDITOR.skin.addIcon(A,A),w=null):A=z;b={id:d,name:u,iconName:z,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||""),state:b,ariaDisabled:"disabled"==b?"true":"false",title:this.title+(p?" ("+p.display+")":""),ariaShortcut:p?a.lang.common.keyboardShortcut+" "+p.aria:"",titleJs:c.gecko&&!c.hc?"":(this.title||
672
- "").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:q,focusFn:y,clickFn:r,style:CKEDITOR.skin.getIconStyle(A,"rtl"==a.lang.dir,w,this.iconOffset),arrowHtml:this.hasArrow?g.output():""};f.output(b,l);if(this.onRender)this.onRender();return t},setState:function(a){if(this._.state==a)return!1;this._.state=a;var f=CKEDITOR.document.getById(this._.id);return f?(f.setState(a,"cke_button"),f.setAttribute("aria-disabled",a==CKEDITOR.TRISTATE_DISABLED),
668
+ b,this.setState(b),this.refresh&&this.refresh())}var k=null,c=CKEDITOR.env,d=this._.id=CKEDITOR.tools.getNextId(),b="",n=this.command,p,q,v;this._.editor=a;var r={id:d,button:this,editor:a,focus:function(){CKEDITOR.document.getById(d).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},t=CKEDITOR.tools.addFunction(function(a){if(r.onkey)return a=new CKEDITOR.dom.event(a),!1!==r.onkey(r,a.getKeystroke())}),y=CKEDITOR.tools.addFunction(function(a){var b;r.onfocus&&
669
+ (b=!1!==r.onfocus(r,new CKEDITOR.dom.event(a)));return b}),x=0;r.clickFn=p=CKEDITOR.tools.addFunction(function(){x&&(a.unlockSelection(1),x=0);r.execute();c.iOS&&a.focus()});this.modes?(k={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(k[a.mode]=this._.state)},this),a.on("activeFilterChange",h,this),a.on("mode",h,this),!this.readOnly&&a.on("readOnly",h,this)):n&&(n=a.getCommand(n))&&(n.on("state",function(){this.setState(n.state)},this),b+=n.state==CKEDITOR.TRISTATE_ON?
670
+ "on":n.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var z;if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst();b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(z,"rtl"==b,this.icon,this.iconOffset))},this);n?(q=a.getCommandKeystroke(n))&&(v=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,q)):b+="off";q=this.name||this.command;var B=
671
+ null,w=this.icon;z=q;this.icon&&!/\./.test(this.icon)?(z=this.icon,w=null):(this.icon&&(B=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(B=this.iconHiDpi));B?(CKEDITOR.skin.addIcon(B,B),w=null):B=z;b={id:d,name:q,iconName:z,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||""),state:b,ariaDisabled:"disabled"==b?"true":"false",title:this.title+(v?" ("+v.display+")":""),ariaShortcut:v?a.lang.common.keyboardShortcut+" "+v.aria:"",titleJs:c.gecko&&!c.hc?"":(this.title||
672
+ "").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:t,focusFn:y,clickFn:p,style:CKEDITOR.skin.getIconStyle(B,"rtl"==a.lang.dir,w,this.iconOffset),arrowHtml:this.hasArrow?g.output():""};f.output(b,l);if(this.onRender)this.onRender();return r},setState:function(a){if(this._.state==a)return!1;this._.state=a;var f=CKEDITOR.document.getById(this._.id);return f?(f.setState(a,"cke_button"),f.setAttribute("aria-disabled",a==CKEDITOR.TRISTATE_DISABLED),
673
673
  this.hasArrow?f.setAttribute("aria-expanded",a==CKEDITOR.TRISTATE_ON):a===CKEDITOR.TRISTATE_ON?f.setAttribute("aria-pressed",!0):f.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var f=this;this.allowedContent||this.requiredContent||!this.command||(f=a.getCommand(this.command)||f);return this._.feature=f}};CKEDITOR.ui.prototype.addButton=function(a,f){this.add(a,CKEDITOR.UI_BUTTON,f)}})();(function(){function a(a){function f(){for(var b=
674
- h(),c=CKEDITOR.tools.clone(a.config.toolbarGroups)||l(a),d=0;d<c.length;d++){var g=c[d];if("/"!=g){"string"==typeof g&&(g=c[d]={name:g});var m,q=g.groups;if(q)for(var y=0;y<q.length;y++)m=q[y],(m=b[m])&&k(g,m);(m=b[g.name])&&k(g,m)}}return c}function h(){var b={},c,d,f;for(c in a.ui.items)d=a.ui.items[c],f=d.toolbar||"others",f=f.split(","),d=f[0],f=parseInt(f[1]||-1,10),b[d]||(b[d]=[]),b[d].push({name:c,order:f});for(d in b)b[d]=b[d].sort(function(a,b){return a.order==b.order?0:0>b.order?-1:0>a.order?
674
+ h(),c=CKEDITOR.tools.clone(a.config.toolbarGroups)||l(a),d=0;d<c.length;d++){var g=c[d];if("/"!=g){"string"==typeof g&&(g=c[d]={name:g});var m,t=g.groups;if(t)for(var y=0;y<t.length;y++)m=t[y],(m=b[m])&&k(g,m);(m=b[g.name])&&k(g,m)}}return c}function h(){var b={},c,d,f;for(c in a.ui.items)d=a.ui.items[c],f=d.toolbar||"others",f=f.split(","),d=f[0],f=parseInt(f[1]||-1,10),b[d]||(b[d]=[]),b[d].push({name:c,order:f});for(d in b)b[d]=b[d].sort(function(a,b){return a.order==b.order?0:0>b.order?-1:0>a.order?
675
675
  1:a.order<b.order?-1:1});return b}function k(b,c){if(c.length){b.items?b.items.push(a.ui.create("-")):b.items=[];for(var f;f=c.shift();)f="string"==typeof f?f:f.name,d&&-1!=CKEDITOR.tools.indexOf(d,f)||(f=a.ui.create(f))&&a.addFeature(f)&&b.items.push(f)}}function c(a){var b=[],c,d,e;for(c=0;c<a.length;++c)d=a[c],e={},"/"==d?b.push(d):CKEDITOR.tools.isArray(d)?(k(e,CKEDITOR.tools.clone(d)),b.push(e)):d.items&&(k(e,CKEDITOR.tools.clone(d.items)),e.name=d.name,b.push(e));return b}var d=a.config.removeButtons,
676
676
  d=d&&d.split(","),b=a.config.toolbar;"string"==typeof b&&(b=a.config["toolbar_"+b]);return a.toolbar=b?c(b):f()}function l(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},
677
677
  "/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var g=function(){this.toolbars=[];this.focusCommandExecuted=!1};g.prototype.focus=function(){for(var a=0,f;f=this.toolbars[a++];)for(var h=0,k;k=f.items[h++];)if(k.focus){k.focus();return}};var f={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},100):a.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",
678
678
  {requires:"button",init:function(e){var l,h=function(a,c){var d,b="rtl"==e.lang.dir,f=e.config.toolbarGroupCycling,g=b?37:39,b=b?39:37,f=void 0===f||f;switch(c){case 9:case CKEDITOR.SHIFT+9:for(;!d||!d.items.length;)if(d=9==c?(d?d.next:a.toolbar.next)||e.toolbox.toolbars[0]:(d?d.previous:a.toolbar.previous)||e.toolbox.toolbars[e.toolbox.toolbars.length-1],d.items.length)for(a=d.items[l?d.items.length-1:0];a&&!a.focus;)(a=l?a.previous:a.next)||(d=0);a&&a.focus();return!1;case g:d=a;do d=d.next,!d&&
679
679
  f&&(d=a.toolbar.items[0]);while(d&&!d.focus);d?d.focus():h(a,9);return!1;case 40:return a.button&&a.button.hasArrow?a.execute():h(a,40==c?g:b),!1;case b:case 38:d=a;do d=d.previous,!d&&f&&(d=a.toolbar.items[a.toolbar.items.length-1]);while(d&&!d.focus);d?d.focus():(l=1,h(a,CKEDITOR.SHIFT+9),l=0);return!1;case 27:return e.focus(),!1;case 13:case 32:return a.execute(),!1}return!0};e.on("uiSpace",function(f){if(f.data.space==e.config.toolbarLocation){f.removeListener();e.toolbox=new g;var c=CKEDITOR.tools.getNextId(),
680
- d=['\x3cspan id\x3d"',c,'" class\x3d"cke_voice_label"\x3e',e.lang.toolbar.toolbars,"\x3c/span\x3e",'\x3cspan id\x3d"'+e.ui.spaceId("toolbox")+'" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"',c,'" onmousedown\x3d"return false;"\x3e'],c=!1!==e.config.toolbarStartupExpanded,b,l;e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&d.push('\x3cspan class\x3d"cke_toolbox_main"'+(c?"\x3e":' style\x3d"display:none"\x3e'));for(var m=e.toolbox.toolbars,u=a(e),p=u.length,
681
- t=0;t<p;t++){var q,y=0,x,z=u[t],A="/"!==z&&("/"===u[t+1]||t==p-1),w;if(z)if(b&&(d.push("\x3c/span\x3e"),l=b=0),"/"===z)d.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');else{w=z.items||z;for(var v=0;v<w.length;v++){var D=w[v],B;if(D){var C=function(a){a=a.render(e,d);G=y.items.push(a)-1;0<G&&(a.previous=y.items[G-1],a.previous.next=a);a.toolbar=y;a.onkey=h;a.onfocus=function(){e.toolbox.focusCommandExecuted||e.focus()}};if(D.type==CKEDITOR.UI_SEPARATOR)l=b&&D;else{B=!1!==D.canGroup;
682
- if(!y){q=CKEDITOR.tools.getNextId();y={id:q,items:[]};x=z.name&&(e.lang.toolbar.toolbarGroups[z.name]||z.name);d.push('\x3cspan id\x3d"',q,'" class\x3d"cke_toolbar'+(A?' cke_toolbar_last"':'"'),x?' aria-labelledby\x3d"'+q+'_label"':"",' role\x3d"toolbar"\x3e');x&&d.push('\x3cspan id\x3d"',q,'_label" class\x3d"cke_voice_label"\x3e',x,"\x3c/span\x3e");d.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');var G=m.push(y)-1;0<G&&(y.previous=m[G-1],y.previous.next=y)}B?b||(d.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'),
683
- b=1):b&&(d.push("\x3c/span\x3e"),b=0);l&&(C(l),l=0);C(D)}}}b&&(d.push("\x3c/span\x3e"),l=b=0);y&&d.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')}}e.config.toolbarCanCollapse&&d.push("\x3c/span\x3e");if(e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var K=CKEDITOR.tools.addFunction(function(){e.execCommand("toolbarCollapse")});e.on("destroy",function(){CKEDITOR.tools.removeFunction(K)});e.addCommand("toolbarCollapse",{readOnly:1,exec:function(a){var b=
680
+ d=['\x3cspan id\x3d"',c,'" class\x3d"cke_voice_label"\x3e',e.lang.toolbar.toolbars,"\x3c/span\x3e",'\x3cspan id\x3d"'+e.ui.spaceId("toolbox")+'" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"',c,'" onmousedown\x3d"return false;"\x3e'],c=!1!==e.config.toolbarStartupExpanded,b,l;e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&d.push('\x3cspan class\x3d"cke_toolbox_main"'+(c?"\x3e":' style\x3d"display:none"\x3e'));for(var m=e.toolbox.toolbars,q=a(e),v=q.length,
681
+ r=0;r<v;r++){var t,y=0,x,z=q[r],B="/"!==z&&("/"===q[r+1]||r==v-1),w;if(z)if(b&&(d.push("\x3c/span\x3e"),l=b=0),"/"===z)d.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');else{w=z.items||z;for(var u=0;u<w.length;u++){var D=w[u],C;if(D){var A=function(a){a=a.render(e,d);G=y.items.push(a)-1;0<G&&(a.previous=y.items[G-1],a.previous.next=a);a.toolbar=y;a.onkey=h;a.onfocus=function(){e.toolbox.focusCommandExecuted||e.focus()}};if(D.type==CKEDITOR.UI_SEPARATOR)l=b&&D;else{C=!1!==D.canGroup;
682
+ if(!y){t=CKEDITOR.tools.getNextId();y={id:t,items:[]};x=z.name&&(e.lang.toolbar.toolbarGroups[z.name]||z.name);d.push('\x3cspan id\x3d"',t,'" class\x3d"cke_toolbar'+(B?' cke_toolbar_last"':'"'),x?' aria-labelledby\x3d"'+t+'_label"':"",' role\x3d"toolbar"\x3e');x&&d.push('\x3cspan id\x3d"',t,'_label" class\x3d"cke_voice_label"\x3e',x,"\x3c/span\x3e");d.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');var G=m.push(y)-1;0<G&&(y.previous=m[G-1],y.previous.next=y)}C?b||(d.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'),
683
+ b=1):b&&(d.push("\x3c/span\x3e"),b=0);l&&(A(l),l=0);A(D)}}}b&&(d.push("\x3c/span\x3e"),l=b=0);y&&d.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')}}e.config.toolbarCanCollapse&&d.push("\x3c/span\x3e");if(e.config.toolbarCanCollapse&&e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var K=CKEDITOR.tools.addFunction(function(){e.execCommand("toolbarCollapse")});e.on("destroy",function(){CKEDITOR.tools.removeFunction(K)});e.addCommand("toolbarCollapse",{readOnly:1,exec:function(a){var b=
684
684
  a.ui.space("toolbar_collapser"),c=b.getPrevious(),d=a.ui.space("contents"),e=c.getParent(),f=parseInt(d.$.style.height,10),h=e.$.offsetHeight,k=b.hasClass("cke_toolbox_collapser_min");k?(c.show(),b.removeClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarCollapse)):(c.hide(),b.addClass("cke_toolbox_collapser_min"),b.setAttribute("title",a.lang.toolbar.toolbarExpand));b.getFirst().setText(k?"▲":"◀");d.setStyle("height",f-(e.$.offsetHeight-h)+"px");a.fire("resize",{outerHeight:a.container.$.offsetHeight,
685
685
  contentsHeight:d.$.offsetHeight,outerWidth:a.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}});e.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse");d.push('\x3ca title\x3d"'+(c?e.lang.toolbar.toolbarCollapse:e.lang.toolbar.toolbarExpand)+'" id\x3d"'+e.ui.spaceId("toolbar_collapser")+'" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser');c||d.push(" cke_toolbox_collapser_min");d.push('" onclick\x3d"CKEDITOR.tools.callFunction('+K+')"\x3e','\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e',
686
686
  "\x3c/a\x3e")}d.push("\x3c/span\x3e");f.data.html+=d.join("")}});e.on("destroy",function(){if(this.toolbox){var a,c=0,d,b,e;for(a=this.toolbox.toolbars;c<a.length;c++)for(b=a[c].items,d=0;d<b.length;d++)e=b[d],e.clickFn&&CKEDITOR.tools.removeFunction(e.clickFn),e.keyDownFn&&CKEDITOR.tools.removeFunction(e.keyDownFn)}});e.on("uiReady",function(){var a=e.ui.space("toolbox");a&&e.focusManager.add(a,1)});e.addCommand("toolbarFocus",f);e.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");e.ui.add("-",CKEDITOR.UI_SEPARATOR,
687
687
  {});e.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,c){c.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');return{}}}}})}});CKEDITOR.ui.prototype.addToolbarGroup=function(a,f,h){var k=l(this.editor),c=0===f,d={name:a};if(h){if(h=CKEDITOR.tools.search(k,function(a){return a.name==h})){!h.groups&&(h.groups=[]);if(f&&(f=CKEDITOR.tools.indexOf(h.groups,f),0<=f)){h.groups.splice(f+1,0,a);return}c?h.groups.splice(0,0,a):h.groups.push(a);
688
688
  return}f=null}f&&(f=CKEDITOR.tools.indexOf(k,function(a){return a.name==f}));c?k.splice(0,0,a):"number"==typeof f?k.splice(f+1,0,d):k.push(a)}})();CKEDITOR.UI_SEPARATOR="separator";CKEDITOR.config.toolbarLocation="top";"use strict";(function(){function a(a,c,d){c.type||(c.type="auto");if(d&&!1===a.fire("beforePaste",c)||!c.dataValue&&c.dataTransfer.isEmpty())return!1;c.dataValue||(c.dataValue="");if(CKEDITOR.env.gecko&&"drop"==c.method&&a.toolbox)a.once("afterPaste",function(){a.toolbox.focus()});
689
- return a.fire("paste",c)}function l(b){function c(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){b.getSelection().isCollapsed()||(b.readOnly&&"cut"==a.name||B.initPasteDataTransfer(a,b),a.data.preventDefault())};a.on("copy",d);a.on("cut",d);a.on("cut",function(){b.readOnly||b.extractSelectedHtml()},null,null,999)}a.on(B.mainPasteEvent,function(a){"beforepaste"==B.mainPasteEvent&&C||w(a)});"beforepaste"==B.mainPasteEvent&&(a.on("paste",function(a){G||
690
- (f(),a.data.preventDefault(),w(a),k("paste"))}),a.on("contextmenu",h,null,null,0),a.on("beforepaste",function(a){!a.data||a.data.$.ctrlKey||a.data.$.shiftKey||h()},null,null,0));a.on("beforecut",function(){!C&&g(b)});var e;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),"mouseup",function(){e=setTimeout(v,0)});b.on("destroy",function(){clearTimeout(e)});a.on("keyup",v)}function d(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,fakeKeystroke:"cut"==a?CKEDITOR.CTRL+88:CKEDITOR.CTRL+
691
- 67,exec:function(){"cut"==this.type&&g();var a;var c=this.type;if(CKEDITOR.env.ie)a=k(c);else try{a=b.document.$.execCommand(c,!1,null)}catch(d){a=!1}a||b.showNotification(b.lang.clipboard[this.type+"Error"]);return a}}}function e(){return{canUndo:!1,async:!0,fakeKeystroke:CKEDITOR.CTRL+86,exec:function(b,c){function d(c,h){h="undefined"!==typeof h?h:!0;c?(c.method="paste",c.dataTransfer||(c.dataTransfer=B.initPasteDataTransfer()),a(b,c,h)):f&&!b._.forcePasteDialog&&b.showNotification(g,"info",b.config.clipboard_notificationDuration);
689
+ return a.fire("paste",c)}function l(b){function c(){var a=b.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var d=function(a){b.getSelection().isCollapsed()||(b.readOnly&&"cut"==a.name||C.initPasteDataTransfer(a,b),a.data.preventDefault())};a.on("copy",d);a.on("cut",d);a.on("cut",function(){b.readOnly||b.extractSelectedHtml()},null,null,999)}a.on(C.mainPasteEvent,function(a){"beforepaste"==C.mainPasteEvent&&A||w(a)});"beforepaste"==C.mainPasteEvent&&(a.on("paste",function(a){G||
690
+ (f(),a.data.preventDefault(),w(a),k("paste"))}),a.on("contextmenu",h,null,null,0),a.on("beforepaste",function(a){!a.data||a.data.$.ctrlKey||a.data.$.shiftKey||h()},null,null,0));a.on("beforecut",function(){!A&&g(b)});var e;a.attachListener(CKEDITOR.env.ie?a:b.document.getDocumentElement(),"mouseup",function(){e=setTimeout(u,0)});b.on("destroy",function(){clearTimeout(e)});a.on("keyup",u)}function d(a){return{type:a,canUndo:"cut"==a,startDisabled:!0,fakeKeystroke:"cut"==a?CKEDITOR.CTRL+88:CKEDITOR.CTRL+
691
+ 67,exec:function(){"cut"==this.type&&g();var a;var c=this.type;if(CKEDITOR.env.ie)a=k(c);else try{a=b.document.$.execCommand(c,!1,null)}catch(d){a=!1}a||b.showNotification(b.lang.clipboard[this.type+"Error"]);return a}}}function e(){return{canUndo:!1,async:!0,fakeKeystroke:CKEDITOR.CTRL+86,exec:function(b,c){function d(c,h){h="undefined"!==typeof h?h:!0;c?(c.method="paste",c.dataTransfer||(c.dataTransfer=C.initPasteDataTransfer()),a(b,c,h)):f&&!b._.forcePasteDialog&&b.showNotification(g,"info",b.config.clipboard_notificationDuration);
692
692
  b._.forcePasteDialog=!1;b.fire("afterCommandExec",{name:"paste",command:e,returnValue:!!c})}c="undefined"!==typeof c&&null!==c?c:{};var e=this,f="undefined"!==typeof c.notification?c.notification:!0,h=c.type,k=CKEDITOR.tools.keystrokeToString(b.lang.common.keyboard,b.getCommandKeystroke(this)),g="string"===typeof f?f:b.lang.clipboard.pasteNotification.replace(/%1/,'\x3ckbd aria-label\x3d"'+k.aria+'"\x3e'+k.display+"\x3c/kbd\x3e"),k="string"===typeof c?c:c.dataValue;h&&!0!==b.config.forcePasteAsPlainText&&
693
- "allow-word"!==b.config.forcePasteAsPlainText?b._.nextPasteType=h:delete b._.nextPasteType;"string"===typeof k?d({dataValue:k}):b.getClipboardData(d)}}}function f(){G=1;setTimeout(function(){G=0},100)}function h(){C=1;setTimeout(function(){C=0},10)}function k(a){var c=b.document,d=c.getBody(),e=!1,f=function(){e=!0};d.on(a,f);7<CKEDITOR.env.version?c.$.execCommand(a):c.$.selection.createRange().execCommand(a);d.removeListener(a,f);return e}function g(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var a=
693
+ "allow-word"!==b.config.forcePasteAsPlainText?b._.nextPasteType=h:delete b._.nextPasteType;"string"===typeof k?d({dataValue:k}):b.getClipboardData(d)}}}function f(){G=1;setTimeout(function(){G=0},100)}function h(){A=1;setTimeout(function(){A=0},10)}function k(a){var c=b.document,d=c.getBody(),e=!1,f=function(){e=!0};d.on(a,f);7<CKEDITOR.env.version?c.$.execCommand(a):c.$.selection.createRange().execCommand(a);d.removeListener(a,f);return e}function g(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var a=
694
694
  b.getSelection(),c,d,e;a.getType()==CKEDITOR.SELECTION_ELEMENT&&(c=a.getSelectedElement())&&(d=a.getRanges()[0],e=b.document.createText(""),e.insertBefore(c),d.setStartBefore(e),d.setEndAfter(c),a.selectRanges([d]),setTimeout(function(){c.getParent()&&(e.remove(),a.selectElement(c))},0))}}function l(a,c){var d=b.document,e=b.editable(),f=function(a){a.cancel()},h;if(!d.getById("cke_pastebin")){var k=b.getSelection(),g=k.createBookmarks();CKEDITOR.env.ie&&k.root.fire("selectionchange");var m=new CKEDITOR.dom.element(!CKEDITOR.env.webkit&&
695
695
  !e.is("body")||CKEDITOR.env.ie?"div":"body",d);m.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var n=0,d=d.getWindow();CKEDITOR.env.webkit?(e.append(m),m.addClass("cke_editable"),e.is("body")||(n="static"!=e.getComputedStyle("position")?e:CKEDITOR.dom.element.get(e.$.offsetParent),n=n.getDocumentPosition().y)):e.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(m);m.setStyles({position:"absolute",top:d.getScrollPosition().y-n+10+"px",width:"1px",height:Math.max(1,d.getViewPaneSize().height-
696
- 20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&m.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(n=m.getParent().isReadOnly())?(m.setOpacity(0),m.setAttribute("contenteditable",!0)):m.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-10000px");b.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)h=e.once("blur",f,null,null,-100);n&&m.focus();n=new CKEDITOR.dom.range(m);n.selectNodeContents(m);var v=n.select();CKEDITOR.env.ie&&
697
- (h=e.once("blur",function(){b.lockSelection(v)}));var x=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=x);h&&h.removeListener();CKEDITOR.env.ie&&e.focus();k.selectBookmarks(g);m.remove();var a;CKEDITOR.env.webkit&&(a=m.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(m=a);b.removeListener("selectionChange",f);c(m.getHtml())},0)}}function m(){if("paste"==B.mainPasteEvent)return b.fire("beforePaste",{type:"auto",
698
- method:"paste"}),!1;b.focus();f();var a=b.focusManager;a.lock();if(b.editable().fire(B.mainPasteEvent)&&!k("paste"))return a.unlock(),!1;a.unlock();return!0}function A(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();f();"paste"==B.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},50)}}function w(c){var d={type:"auto",method:"paste",
699
- dataTransfer:B.initPasteDataTransfer(c)};d.dataTransfer.cacheData();var e=!1!==b.fire("beforePaste",d);e&&B.canClipboardApiBeTrusted(d.dataTransfer,b)?(c.data.preventDefault(),setTimeout(function(){a(b,d)},0)):l(c,function(c){d.dataValue=c.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");e&&a(b,d)})}function v(){if("wysiwyg"==b.mode){var a=D("paste");b.getCommand("cut").setState(D("cut"));b.getCommand("copy").setState(D("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function D(a){var c=
700
- b.getSelection(),c=c&&c.getRanges()[0];if((b.readOnly||c&&c.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();c=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var B=CKEDITOR.plugins.clipboard,C=0,G=0;(function(){b.on("key",A);b.on("contentDom",c);b.on("selectionChange",v);if(b.contextMenu){b.contextMenu.addListener(function(){return{cut:D("cut"),
696
+ 20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&m.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(n=m.getParent().isReadOnly())?(m.setOpacity(0),m.setAttribute("contenteditable",!0)):m.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-10000px");b.on("selectionChange",f,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)h=e.once("blur",f,null,null,-100);n&&m.focus();n=new CKEDITOR.dom.range(m);n.selectNodeContents(m);var u=n.select();CKEDITOR.env.ie&&
697
+ (h=e.once("blur",function(){b.lockSelection(u)}));var x=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=x);h&&h.removeListener();CKEDITOR.env.ie&&e.focus();k.selectBookmarks(g);m.remove();var a;CKEDITOR.env.webkit&&(a=m.getFirst())&&a.is&&a.hasClass("Apple-style-span")&&(m=a);b.removeListener("selectionChange",f);c(m.getHtml())},0)}}function m(){if("paste"==C.mainPasteEvent)return b.fire("beforePaste",{type:"auto",
698
+ method:"paste"}),!1;b.focus();f();var a=b.focusManager;a.lock();if(b.editable().fire(C.mainPasteEvent)&&!k("paste"))return a.unlock(),!1;a.unlock();return!0}function B(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();f();"paste"==C.mainPasteEvent&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},50)}}function w(c){var d={type:"auto",method:"paste",
699
+ dataTransfer:C.initPasteDataTransfer(c)};d.dataTransfer.cacheData();var e=!1!==b.fire("beforePaste",d);e&&C.canClipboardApiBeTrusted(d.dataTransfer,b)?(c.data.preventDefault(),setTimeout(function(){a(b,d)},0)):l(c,function(c){d.dataValue=c.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");e&&a(b,d)})}function u(){if("wysiwyg"==b.mode){var a=D("paste");b.getCommand("cut").setState(D("cut"));b.getCommand("copy").setState(D("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function D(a){var c=
700
+ b.getSelection(),c=c&&c.getRanges()[0];if((b.readOnly||c&&c.checkReadOnly())&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;a=b.getSelection();c=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var C=CKEDITOR.plugins.clipboard,A=0,G=0;(function(){b.on("key",B);b.on("contentDom",c);b.on("selectionChange",u);if(b.contextMenu){b.contextMenu.addListener(function(){return{cut:D("cut"),
701
701
  copy:D("copy"),paste:D("paste")}});var a=null;b.on("menuShow",function(){a&&(a.removeListener(),a=null);var c=b.contextMenu.findItemByCommandName("paste");c&&c.element&&(a=c.element.on("touchend",function(){b._.forcePasteDialog=!0}))})}if(b.ui.addButton)b.once("instanceReady",function(){b._.pasteButtons&&CKEDITOR.tools.array.forEach(b._.pasteButtons,function(a){if(a=b.ui.get(a))if(a=CKEDITOR.document.getById(a._.id))a.on("touchend",function(){b._.forcePasteDialog=!0})})})})();(function(){function a(c,
702
702
  d,e,f,h){var k=b.lang.clipboard[d];b.addCommand(d,e);b.ui.addButton&&b.ui.addButton(c,{label:k,command:d,toolbar:"clipboard,"+f});b.addMenuItems&&b.addMenuItem(d,{label:k,command:d,group:"clipboard",order:h})}a("Cut","cut",d("cut"),10,1);a("Copy","copy",d("copy"),20,4);a("Paste","paste",e(),30,8);b._.pasteButtons||(b._.pasteButtons=[]);b._.pasteButtons.push("Paste")})();b.getClipboardData=function(a,c){function d(a){a.removeListener();a.cancel();c(a.data)}function e(a){a.removeListener();a.cancel();
703
703
  c({type:h,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var f=!1,h="auto";c||(c=a,a=null);b.on("beforePaste",function(a){a.removeListener();f=!0;h=a.data.type},null,null,1E3);b.on("paste",d,null,null,0);!1===m()&&(b.removeListener("paste",d),b._.forcePasteDialog&&f&&b.fire("pasteDialog")?(b.on("pasteDialogCommit",e),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",e);a.data._.committed||c(null)})):c(null))}}function g(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&
@@ -710,12 +710,12 @@ function e(d,f){d.select();a(b,{dataTransfer:f,method:"drop"},1);c.resetDragData
710
710
  k.attachListener(g,"dragstart",f);k.attachListener(b,"dragstart",c.resetDragDataTransfer,c,null,1);k.attachListener(b,"dragstart",function(a){c.initDragDataTransfer(a,b)},null,null,2);k.attachListener(b,"dragstart",function(){var a=c.dragRange=b.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c.dragStartContainerChildCount=a?h(a.startContainer):null,c.dragEndContainerChildCount=a?h(a.endContainer):null)},null,null,100);k.attachListener(g,"dragend",f);k.attachListener(b,"dragend",
711
711
  c.initDragDataTransfer,c,null,1);k.attachListener(b,"dragend",c.resetDragDataTransfer,c,null,100);k.attachListener(g,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&&a.data.preventDefault()}});k.attachListener(g,"drop",function(a){if(!a.data.$.defaultPrevented&&(a.data.preventDefault(),!b.readOnly)){var d=
712
712
  a.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=c.getRangeAtDropPosition(a,b),e=c.dragRange;d&&f(a,e,d)}}},null,null,9999);k.attachListener(b,"drop",c.initDragDataTransfer,c,null,1);k.attachListener(b,"drop",function(a){if(a=a.data){var f=a.dropRange,h=a.dragRange,k=a.dataTransfer;k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_INTERNAL?setTimeout(function(){c.internalDrop(h,f,k,b)},0):k.getTransferType(b)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?d(h,f,k):e(f,k)}},
713
- null,null,9999)})}var d;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function d(a){if(!a||t===a.id)return!1;var b=a.getTypes(),b=1===b.length&&"Files"===b[0];a=1===a.getFilesCount();return b&&a}var h,k=e(a);a.config.forcePasteAsPlainText?h="plain-text":a.config.pasteFilter?h=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(h="semantic-content");a.pasteFilter=k.get(h);l(a);c(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));
714
- if(CKEDITOR.env.gecko){var p=["image/png","image/jpeg","image/gif"],t;a.on("paste",function(c){var e=c.data,f=e.dataTransfer;if(!e.dataValue&&"paste"==e.method&&d(f)&&(f=f.getFile(0),-1!=CKEDITOR.tools.indexOf(p,f.type))){var h=new FileReader;h.addEventListener("load",function(){c.data.dataValue='\x3cimg src\x3d"'+h.result+'" /\x3e';a.fire("paste",c.data)},!1);h.addEventListener("abort",function(){a.fire("paste",c.data)},!1);h.addEventListener("error",function(){a.fire("paste",c.data)},!1);h.readAsDataURL(f);
715
- t=e.dataTransfer.id;c.stop()}},null,null,1)}a.on("paste",function(c){c.data.dataTransfer||(c.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!c.data.dataValue){var d=c.data.dataTransfer,e=d.getData("text/html");if(e)c.data.dataValue=e,c.data.type="html";else if(e=d.getData("text/plain"))c.data.dataValue=a.editable().transformPlainTextToHtml(e),c.data.type="text"}},null,null,1);a.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi,
713
+ null,null,9999)})}var d;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function d(a){if(!a||r===a.id)return!1;var b=a.getTypes(),b=1===b.length&&"Files"===b[0];a=1===a.getFilesCount();return b&&a}var h,k=e(a);a.config.forcePasteAsPlainText?h="plain-text":a.config.pasteFilter?h=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(h="semantic-content");a.pasteFilter=k.get(h);l(a);c(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));
714
+ if(CKEDITOR.env.gecko){var v=["image/png","image/jpeg","image/gif"],r;a.on("paste",function(c){var e=c.data,f=e.dataTransfer;if(!e.dataValue&&"paste"==e.method&&d(f)&&(f=f.getFile(0),-1!=CKEDITOR.tools.indexOf(v,f.type))){var h=new FileReader;h.addEventListener("load",function(){c.data.dataValue='\x3cimg src\x3d"'+h.result+'" /\x3e';a.fire("paste",c.data)},!1);h.addEventListener("abort",function(){a.fire("paste",c.data)},!1);h.addEventListener("error",function(){a.fire("paste",c.data)},!1);h.readAsDataURL(f);
715
+ r=e.dataTransfer.id;c.stop()}},null,null,1)}a.on("paste",function(c){c.data.dataTransfer||(c.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!c.data.dataValue){var d=c.data.dataTransfer,e=d.getData("text/html");if(e)c.data.dataValue=e,c.data.type="html";else if(e=d.getData("text/plain"))c.data.dataValue=a.editable().transformPlainTextToHtml(e),c.data.type="text"}},null,null,1);a.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi,
716
716
  " "),"html"!=a.data.type&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1<b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&
717
717
  (d=f.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)f=e=d;e&&(b=e.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(b,d){return d.toLowerCase()in c?(a.data.preSniffing="html","\x3c"+d):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)><div><br><\/div>$/,function(b,d){return d in c?(a.data.endsWithEOL=1,"\x3c/"+d+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,
718
- null,3);a.on("paste",function(c){c=c.data;var d=a._.nextPasteType||c.type,e=c.dataValue,h,l=a.config.clipboard_defaultContentType||"html",n=c.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,v=!0===a.config.forcePasteAsPlainText;h="html"==d||"html"==c.preSniffing?"html":g(e);delete a._.nextPasteType;"htmlifiedtext"==h&&(e=f(a.config,e));if("text"==d&&"html"==h)e=m(a,e,k.get("plain-text"));else if(n&&a.pasteFilter&&!c.dontFilter||v)e=m(a,e,a.pasteFilter);c.startsWithEOL&&(e='\x3cbr data-cke-eol\x3d"1"\x3e'+
718
+ null,3);a.on("paste",function(c){c=c.data;var d=a._.nextPasteType||c.type,e=c.dataValue,h,l=a.config.clipboard_defaultContentType||"html",n=c.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,u=!0===a.config.forcePasteAsPlainText;h="html"==d||"html"==c.preSniffing?"html":g(e);delete a._.nextPasteType;"htmlifiedtext"==h&&(e=f(a.config,e));if("text"==d&&"html"==h)e=m(a,e,k.get("plain-text"));else if(n&&a.pasteFilter&&!c.dontFilter||u)e=m(a,e,a.pasteFilter);c.startsWithEOL&&(e='\x3cbr data-cke-eol\x3d"1"\x3e'+
719
719
  e);c.endsWithEOL&&(e+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==d&&(d="html"==h||"html"==l?"html":"text");c.type=d;c.dataValue=e;delete c.preSniffing;delete c.startsWithEOL;delete c.endsWithEOL},null,null,6);a.on("paste",function(c){c=c.data;c.dataValue&&(a.insertHtml(c.dataValue,c.type,c.range),setTimeout(function(){a.fire("afterPaste")},0))},null,null,1E3);a.on("pasteDialog",function(c){setTimeout(function(){a.openDialog("paste",c.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:CKEDITOR.env.ie&&
720
720
  16>CKEDITOR.env.version||CKEDITOR.env.iOS&&605>CKEDITOR.env.version?!1:!0,isCustomDataTypesSupported:!CKEDITOR.env.ie||16<=CKEDITOR.env.version,isFileApiSupported:!CKEDITOR.env.ie||9<CKEDITOR.env.version,mainPasteEvent:CKEDITOR.env.ie&&!CKEDITOR.env.edge?"beforepaste":"paste",addPasteButton:function(a,c,d){a.ui.addButton&&(a.ui.addButton(c,d),a._.pasteButtons||(a._.pasteButtons=[]),a._.pasteButtons.push(c))},canClipboardApiBeTrusted:function(a,c){return a.getTransferType(c)!=CKEDITOR.DATA_TRANSFER_EXTERNAL||
721
721
  CKEDITOR.env.chrome&&!a.isEmpty()||CKEDITOR.env.gecko&&(a.getData("text/html")||a.getFilesCount())||CKEDITOR.env.safari&&603<=CKEDITOR.env.version&&!CKEDITOR.env.iOS||CKEDITOR.env.iOS&&605<=CKEDITOR.env.version||CKEDITOR.env.edge&&16<=CKEDITOR.env.version?!0:!1},getDropTarget:function(a){var c=a.editable();return CKEDITOR.env.ie&&9>CKEDITOR.env.version||c.isInline()?c:a.document},fixSplitNodesAfterDrop:function(a,c,d,e){function f(a,b,d){var e=a;e.type==CKEDITOR.NODE_TEXT&&(e=a.getParent());if(e.equals(b)&&
@@ -723,8 +723,8 @@ d!=b.getChildCount())return a=c.startContainer.getChild(c.startOffset-1),b=c.sta
723
723
  return a.endContainer.equals(d)&&a.endOffset<=e||a.startContainer.getParent().equals(d)&&a.startContainer.getIndex()<e||a.endContainer.getParent().equals(d)&&a.endContainer.getIndex()<e?!0:!1},internalDrop:function(b,c,d,e){var f=CKEDITOR.plugins.clipboard,h=e.editable(),k,g;e.fire("saveSnapshot");e.fire("lockSnapshot",{dontUpdate:1});CKEDITOR.env.ie&&10>CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(b,c,f.dragStartContainerChildCount,f.dragEndContainerChildCount);(g=this.isDropRangeAffectedByDragRange(b,
724
724
  c))||(k=b.createBookmark(!1));f=c.clone().createBookmark(!1);g&&(k=b.createBookmark(!1));b=k.startNode;c=k.endNode;g=f.startNode;c&&b.getPosition(g)&CKEDITOR.POSITION_PRECEDING&&c.getPosition(g)&CKEDITOR.POSITION_FOLLOWING&&g.insertBefore(b);b=e.createRange();b.moveToBookmark(k);h.extractHtmlFromRange(b,1);c=e.createRange();f.startNode.getCommonAncestor(h)||(f=e.getSelection().createBookmarks()[0]);c.moveToBookmark(f);a(e,{dataTransfer:d,method:"drop",range:c},1);e.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,
725
725
  c){var d=a.data.$,e=d.clientX,f=d.clientY,h=c.getSelection(!0).getRanges()[0],k=c.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&&c.document.$.caretRangeFromPoint(e,f))d=c.document.$.caretRangeFromPoint(e,f),k.setStart(CKEDITOR.dom.node(d.startContainer),d.startOffset),k.collapse(!0);else if(d.rangeParent)k.setStart(CKEDITOR.dom.node(d.rangeParent),d.rangeOffset),k.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&h&&c.editable().hasFocus)return h;
726
- if(document.body.createTextRange){c.focus();d=c.document.getBody().$.createTextRange();try{for(var g=!1,l=0;20>l&&!g;l++){if(!g)try{d.moveToPoint(e,f-l),g=!0}catch(m){}if(!g)try{d.moveToPoint(e,f+l),g=!0}catch(A){}}if(g){var w="cke-temp-"+(new Date).getTime();d.pasteHTML('\x3cspan id\x3d"'+w+'"\x3e​\x3c/span\x3e');var v=c.document.getById(w);k.moveToPosition(v,CKEDITOR.POSITION_BEFORE_START);v.remove()}else{var D=c.document.$.elementFromPoint(e,f),B=new CKEDITOR.dom.element(D),C;if(B.equals(c.editable())||
727
- "html"==B.getName())return h&&h.startContainer&&!h.startContainer.equals(c.editable())?h:null;C=B.getClientRect();e<C.left?k.setStartAt(B,CKEDITOR.POSITION_AFTER_START):k.setStartAt(B,CKEDITOR.POSITION_BEFORE_END);k.collapse(!0)}}catch(G){return null}}else return null}return k},initDragDataTransfer:function(a,c){var d=a.data.$?a.data.$.dataTransfer:null,e=new this.dataTransfer(d,c);"dragstart"===a.name&&e.storeId();d?this.dragData&&e.id==this.dragData.id?e=this.dragData:this.dragData=e:this.dragData?
726
+ if(document.body.createTextRange){c.focus();d=c.document.getBody().$.createTextRange();try{for(var g=!1,l=0;20>l&&!g;l++){if(!g)try{d.moveToPoint(e,f-l),g=!0}catch(m){}if(!g)try{d.moveToPoint(e,f+l),g=!0}catch(B){}}if(g){var w="cke-temp-"+(new Date).getTime();d.pasteHTML('\x3cspan id\x3d"'+w+'"\x3e​\x3c/span\x3e');var u=c.document.getById(w);k.moveToPosition(u,CKEDITOR.POSITION_BEFORE_START);u.remove()}else{var D=c.document.$.elementFromPoint(e,f),C=new CKEDITOR.dom.element(D),A;if(C.equals(c.editable())||
727
+ "html"==C.getName())return h&&h.startContainer&&!h.startContainer.equals(c.editable())?h:null;A=C.getClientRect();e<A.left?k.setStartAt(C,CKEDITOR.POSITION_AFTER_START):k.setStartAt(C,CKEDITOR.POSITION_BEFORE_END);k.collapse(!0)}}catch(G){return null}}else return null}return k},initDragDataTransfer:function(a,c){var d=a.data.$?a.data.$.dataTransfer:null,e=new this.dataTransfer(d,c);"dragstart"===a.name&&e.storeId();d?this.dragData&&e.id==this.dragData.id?e=this.dragData:this.dragData=e:this.dragData?
728
728
  e=this.dragData:this.dragData=e;a.data.dataTransfer=e},resetDragDataTransfer:function(){this.dragData=null},initPasteDataTransfer:function(a,c){if(this.isCustomCopyCutSupported){if(a&&a.data&&a.data.$){var d=a.data.$.clipboardData,e=new this.dataTransfer(d,c);"copy"!==a.name&&"cut"!==a.name||e.storeId();this.copyCutData&&e.id==this.copyCutData.id?(e=this.copyCutData,e.$=d):this.copyCutData=e;return e}return new this.dataTransfer(null,c)}return new this.dataTransfer(CKEDITOR.env.edge&&a&&a.data.$&&
729
729
  a.data.$.clipboardData||null,c)},preventDefaultDropOnElement:function(a){a&&a.on("dragover",k)}};d=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=function(a,c){a&&(this.$=a);this._={metaRegExp:/^<meta.*?>/i,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,fragmentRegExp:/\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g,data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==
730
730
  a?"Text":"url"==a?"URL":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(d);this.id||(this.id="Text"==d?"":"cke-"+CKEDITOR.tools.getUniqueId());c&&(this.sourceEditor=c,this.setData("text/html",c.getSelectedHtml(1)),"Text"==d||this.getData("text/plain")||this.setData("text/plain",c.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype=
@@ -755,25 +755,25 @@ proto:{show:function(){this.element.setStyle("display","")},hide:function(){this
755
755
  g.getItem(--h));){if(k.getAttribute("_cke_focus")&&k.$.offsetWidth){this._.focusIndex=h;k.focus(!0);break}k=null}return k||e?!1:(this._.focusIndex=g.count(),this.onKeyDown(a,1));case "click":case "mouseup":return h=this._.focusIndex,(k=0<=h&&this._.getItems().getItem(h))&&k.fireEventHandler(g,{button:CKEDITOR.tools.normalizeMouseButton(CKEDITOR.MOUSE_BUTTON_LEFT,!0)}),!1}return!0}}})})();CKEDITOR.plugins.add("floatpanel",{requires:"panel"});(function(){function a(a,f,e,m,h){h=CKEDITOR.tools.genKey(f.getUniqueId(),
756
756
  e.getUniqueId(),a.lang.dir,a.uiColor||"",m.css||"",h||"");var k=l[h];k||(k=l[h]=new CKEDITOR.ui.panel(f,m),k.element=e.append(CKEDITOR.dom.element.createFromHtml(k.render(a),f)),k.element.setStyles({display:"none",position:"absolute"}));return k}var l={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(g,f,e,l){function h(){b.hide()}e.forceIFrame=1;e.toolbarRelated&&g.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(f=CKEDITOR.document.getById("cke_"+g.name));var k=f.getDocument();l=a(g,k,
757
757
  f,e,l||0);var c=l.element,d=c.getFirst(),b=this;c.disableContextMenu();this.element=c;this._={editor:g,panel:l,parentElement:f,definition:e,document:k,iframe:d,children:[],dir:g.lang.dir,showBlockParams:null,markFirst:void 0!==e.markFirst?e.markFirst:!0};g.on("mode",h);g.on("resize",h);k.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(a,f){return this._.panel.addBlock(a,f)},addListBlock:function(a,f){return this._.panel.addListBlock(a,f)},getBlock:function(a){return this._.panel.getBlock(a)},
758
- showBlock:function(a,f,e,l,h,k){var c=this._.panel,d=c.showBlock(a);this._.showBlockParams=[].slice.call(arguments);this.allowBlur(!1);var b=this._.editor.editable();this._.returnFocus=b.hasFocus?b:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);this._.hideTimeout=0;var n=this.element,b=this._.iframe,b=CKEDITOR.env.ie&&!CKEDITOR.env.edge?b:new CKEDITOR.dom.window(b.$.contentWindow),r=n.getDocument(),u=this._.parentElement.getPositionedAncestor(),p=f.getDocumentPosition(r),r=u?u.getDocumentPosition(r):
759
- {x:0,y:0},t="rtl"==this._.dir,q=p.x+(l||0)-r.x,y=p.y+(h||0)-r.y;!t||1!=e&&4!=e?t||2!=e&&3!=e||(q+=f.$.offsetWidth-1):q+=f.$.offsetWidth;if(3==e||4==e)y+=f.$.offsetHeight-1;this._.panel._.offsetParentId=f.getId();n.setStyles({top:y+"px",left:0,display:""});n.setOpacity(0);n.getFirst().removeStyle("width");this._.editor.focusManager.add(b);this._.blurSet||(CKEDITOR.event.useCapture=!0,b.on("blur",function(a){function b(){delete this._.returnFocus;this.hide()}this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&
758
+ showBlock:function(a,f,e,l,h,k){var c=this._.panel,d=c.showBlock(a);this._.showBlockParams=[].slice.call(arguments);this.allowBlur(!1);var b=this._.editor.editable();this._.returnFocus=b.hasFocus?b:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);this._.hideTimeout=0;var n=this.element,b=this._.iframe,b=CKEDITOR.env.ie&&!CKEDITOR.env.edge?b:new CKEDITOR.dom.window(b.$.contentWindow),p=n.getDocument(),q=this._.parentElement.getPositionedAncestor(),v=f.getDocumentPosition(p),p=q?q.getDocumentPosition(p):
759
+ {x:0,y:0},r="rtl"==this._.dir,t=v.x+(l||0)-p.x,y=v.y+(h||0)-p.y;!r||1!=e&&4!=e?r||2!=e&&3!=e||(t+=f.$.offsetWidth-1):t+=f.$.offsetWidth;if(3==e||4==e)y+=f.$.offsetHeight-1;this._.panel._.offsetParentId=f.getId();n.setStyles({top:y+"px",left:0,display:""});n.setOpacity(0);n.getFirst().removeStyle("width");this._.editor.focusManager.add(b);this._.blurSet||(CKEDITOR.event.useCapture=!0,b.on("blur",function(a){function b(){delete this._.returnFocus;this.hide()}this.allowBlur()&&a.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&
760
760
  this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(b,0,this)):b.call(this))},this),b.on("focus",function(){this._.focused=!0;this.hideChild();this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(b.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),b.on("touchend",function(){this._.hideTimeout=0;this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1);c.onEscape=CKEDITOR.tools.bind(function(a){if(this.onEscape&&
761
761
  !1===this.onEscape(a))return!1},this);CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.tools.bind(function(){var a=n;a.removeStyle("width");if(d.autoSize){var b=d.element.getDocument(),b=(CKEDITOR.env.webkit||CKEDITOR.env.edge?d.element:b.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<b&&(b+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3);a.setStyle("width",b+10+"px");b=d.element.$.scrollHeight;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<b&&(b+=(a.$.offsetHeight||0)-(a.$.clientHeight||
762
- 0)+3);a.setStyle("height",b+"px");c._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");t&&(q-=n.$.offsetWidth);n.setStyle("left",q+"px");var b=c.element.getWindow(),a=n.$.getBoundingClientRect(),b=b.getViewPaneSize(),e=a.width||a.right-a.left,f=a.height||a.bottom-a.top,h=t?a.right:b.width-a.left,g=t?b.width-a.right:a.left;t?h<e&&(q=g>e?q+e:b.width>e?q-a.left:q-a.right+b.width):h<e&&(q=g>e?q-e:b.width>e?q-a.right+b.width:q-a.left);e=a.top;b.height-
763
- a.top<f&&(y=e>f?y-f:b.height>f?y-a.bottom+b.height:y-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&((b=a=n.$.offsetParent&&new CKEDITOR.dom.element(n.$.offsetParent))&&"html"==b.getName()&&(b=b.getDocument().getBody()),b&&"rtl"==b.getComputedStyle("direction")&&(q=CKEDITOR.env.ie8Compat?q-2*n.getDocument().getDocumentElement().$.scrollLeft:q-(a.$.scrollWidth-a.$.clientWidth)));var a=n.getFirst(),l;(l=a.getCustomData("activePanel"))&&l.onHide&&l.onHide.call(this,1);a.setCustomData("activePanel",this);
764
- n.setStyles({top:y+"px",left:q+"px"});n.setOpacity(1);k&&k()},this);c.isLoaded?a():c.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();d.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.markFirst&&(CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){d.markFirstDisplayed?d.markFirstDisplayed():d._.markFirstDisplayed()},0):d.markFirstDisplayed?d.markFirstDisplayed():
762
+ 0)+3);a.setStyle("height",b+"px");c._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");r&&(t-=n.$.offsetWidth);n.setStyle("left",t+"px");var b=c.element.getWindow(),a=n.$.getBoundingClientRect(),b=b.getViewPaneSize(),e=a.width||a.right-a.left,f=a.height||a.bottom-a.top,h=r?a.right:b.width-a.left,g=r?b.width-a.right:a.left;r?h<e&&(t=g>e?t+e:b.width>e?t-a.left:t-a.right+b.width):h<e&&(t=g>e?t-e:b.width>e?t-a.right+b.width:t-a.left);e=a.top;b.height-
763
+ a.top<f&&(y=e>f?y-f:b.height>f?y-a.bottom+b.height:y-a.top);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&((b=a=n.$.offsetParent&&new CKEDITOR.dom.element(n.$.offsetParent))&&"html"==b.getName()&&(b=b.getDocument().getBody()),b&&"rtl"==b.getComputedStyle("direction")&&(t=CKEDITOR.env.ie8Compat?t-2*n.getDocument().getDocumentElement().$.scrollLeft:t-(a.$.scrollWidth-a.$.clientWidth)));var a=n.getFirst(),l;(l=a.getCustomData("activePanel"))&&l.onHide&&l.onHide.call(this,1);a.setCustomData("activePanel",this);
764
+ n.setStyles({top:y+"px",left:t+"px"});n.setOpacity(1);k&&k()},this);c.isLoaded?a():c.onLoad=a;CKEDITOR.tools.setTimeout(function(){var a=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus();d.element.focus();CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=a);this.allowBlur(!0);this._.markFirst&&(CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){d.markFirstDisplayed?d.markFirstDisplayed():d._.markFirstDisplayed()},0):d.markFirstDisplayed?d.markFirstDisplayed():
765
765
  d._.markFirstDisplayed());this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this);this.visible=1;this.onShow&&this.onShow.call(this)},reposition:function(){var a=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,a))},focus:function(){if(CKEDITOR.env.webkit){var a=CKEDITOR.document.getActive();a&&!a.equals(this._.iframe)&&a.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var a=
766
766
  this._.iframe.getFrameDocument().getActive();a&&a.is("a")&&(this._.lastFocused=a)},hide:function(a){if(this.visible&&(!this.onHide||!0!==this.onHide.call(this))){this.hideChild();CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur();this.element.setStyle("display","none");this.visible=0;this.element.getFirst().removeCustomData("activePanel");if(a=a&&this._.returnFocus)CKEDITOR.env.webkit&&a.type&&a.getWindow().$.focus(),a.focus();delete this._.lastFocused;this._.showBlockParams=
767
767
  null;this._.editor.fire("panelHide",this)}},allowBlur:function(a){var f=this._.panel;void 0!==a&&(f.allowBlur=a);return f.allowBlur},showAsChild:function(a,f,e,l,h,k){if(this._.activeChild!=a||a._.panel._.offsetParentId!=e.getId())this.hideChild(),a.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=a,this._.focused=!1,a.showBlock(f,e,l,h,k),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){a.element.getChild(0).$.style.cssText+=
768
- ""},100)},hideChild:function(a){var f=this._.activeChild;f&&(delete f.onHide,delete this._.activeChild,f.hide(),a&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),f;for(f in l){var e=l[f];a?e.destroy():e.element.hide()}a&&(l={})})})();CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(a){function l(b){var c=b.name,d=b.type,f=b.title,l=b.order,t=b.commandName;b=b.contentTransformations||{};var q=new CKEDITOR.style(h["colorButton_"+
769
- d+"Style"]),y=CKEDITOR.tools.getNextId()+"_colorBox",x={type:d},z=new CKEDITOR.style(h["colorButton_"+d+"Style"],{color:"inherit"}),A;a.addCommand(t,{contextSensitive:!0,exec:function(a,b){if(!a.readOnly){var c=b.newStyle;a.removeStyle(z);a.focus();c&&a.applyStyle(c);a.fire("saveSnapshot")}},refresh:function(a,b){z.checkApplicable(b,a,a.activeFilter)?z.checkActive(b,a)?this.setState(CKEDITOR.TRISTATE_ON):this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)}});a.ui.add(c,
770
- CKEDITOR.UI_PANELBUTTON,{label:f,title:f,command:t,editorFocus:0,toolbar:"colors,"+l,allowedContent:q,requiredContent:q,contentTransformations:b,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":k.panelTitle}},select:function(a){var b=h.colorButton_colors.split(",");a=CKEDITOR.tools.array.find(b,a);a=m(a);e(A,a);A._.markFirstDisplayed()},onBlock:function(b,c){A=c;c.autoSize=!0;c.element.addClass("cke_colorblock");c.element.setHtml(g({type:d,colorBoxId:y,colorData:x,
771
- commandName:t}));c.element.getDocument().getBody().setStyle("overflow","hidden");CKEDITOR.ui.fire("ready",this);var e=c.keys,f="rtl"==a.lang.dir;e[f?37:39]="next";e[40]="next";e[9]="next";e[f?39:37]="prev";e[38]="prev";e[CKEDITOR.SHIFT+9]="prev";e[32]="click"},onOpen:function(){var b=a.getSelection(),c=b&&b.getStartElement(),f=a.elementPath(c);if(!f)return null;c=f.block||f.blockLimit||a.document.getBody();do f=c&&c.getComputedStyle("back"==d?"background-color":"color")||"transparent";while("back"==
768
+ ""},100)},hideChild:function(a){var f=this._.activeChild;f&&(delete f.onHide,delete this._.activeChild,f.hide(),a&&this.focus())}}});CKEDITOR.on("instanceDestroyed",function(){var a=CKEDITOR.tools.isEmpty(CKEDITOR.instances),f;for(f in l){var e=l[f];a?e.destroy():e.element.hide()}a&&(l={})})})();CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(a){function l(b){var c=b.name,d=b.type,f=b.title,l=b.order,r=b.commandName;b=b.contentTransformations||{};var t=new CKEDITOR.style(h["colorButton_"+
769
+ d+"Style"]),y=CKEDITOR.tools.getNextId()+"_colorBox",x={type:d},z=new CKEDITOR.style(h["colorButton_"+d+"Style"],{color:"inherit"}),B;a.addCommand(r,{contextSensitive:!0,exec:function(a,b){if(!a.readOnly){var c=b.newStyle;a.removeStyle(z);a.focus();c&&a.applyStyle(c);a.fire("saveSnapshot")}},refresh:function(a,b){z.checkApplicable(b,a,a.activeFilter)?z.checkActive(b,a)?this.setState(CKEDITOR.TRISTATE_ON):this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)}});a.ui.add(c,
770
+ CKEDITOR.UI_PANELBUTTON,{label:f,title:f,command:r,editorFocus:0,toolbar:"colors,"+l,allowedContent:t,requiredContent:t,contentTransformations:b,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":k.panelTitle}},select:function(a){var b=h.colorButton_colors.split(",");a=CKEDITOR.tools.array.find(b,a);a=m(a);e(B,a);B._.markFirstDisplayed()},onBlock:function(b,c){B=c;c.autoSize=!0;c.element.addClass("cke_colorblock");c.element.setHtml(g({type:d,colorBoxId:y,colorData:x,
771
+ commandName:r}));c.element.getDocument().getBody().setStyle("overflow","hidden");CKEDITOR.ui.fire("ready",this);var e=c.keys,f="rtl"==a.lang.dir;e[f?37:39]="next";e[40]="next";e[9]="next";e[f?39:37]="prev";e[38]="prev";e[CKEDITOR.SHIFT+9]="prev";e[32]="click"},onOpen:function(){var b=a.getSelection(),c=b&&b.getStartElement(),f=a.elementPath(c);if(!f)return null;c=f.block||f.blockLimit||a.document.getBody();do f=c&&c.getComputedStyle("back"==d?"background-color":"color")||"transparent";while("back"==
772
772
  d&&"transparent"==f&&c&&(c=c.getParent()));f&&"transparent"!=f||(f="#ffffff");!1!==h.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(y).setStyle("background-color",f);if(c=b&&b.getRanges()[0]){for(var b=new CKEDITOR.dom.walker(c),k=c.collapsed?c.startContainer:b.next(),c="";k;){k.type!==CKEDITOR.NODE_ELEMENT&&(k=k.getParent());k=m(k.getComputedStyle("back"==d?"background-color":"color"));c=c||k;if(c!==k){c="";break}k=b.next()}"transparent"==c&&(c="");"fore"==d&&(x.automaticTextColor=
773
- "#"+m(f));x.selectionColor=c?"#"+c:"";e(A,c)}return f}})}function g(b){function c(b){b=b&&new CKEDITOR.style(A,{color:b});a.execCommand(l,{newStyle:b})}var d=b.type,e=b.colorBoxId,g=b.colorData,l=b.commandName;b=[];var m=h.colorButton_colors.split(","),y=h.colorButton_colorsPerRow||6,x=a.plugins.colordialog&&!1!==h.colorButton_enableMore,z=m.length+(x?2:1),A=a.config["colorButton_"+d+"Style"];A.childRule="back"==d?function(a){return f(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||
773
+ "#"+m(f));x.selectionColor=c?"#"+c:"";e(B,c)}return f}})}function g(b){function c(b){b=b&&new CKEDITOR.style(B,{color:b});a.execCommand(l,{newStyle:b})}var d=b.type,e=b.colorBoxId,g=b.colorData,l=b.commandName;b=[];var m=h.colorButton_colors.split(","),y=h.colorButton_colorsPerRow||6,x=a.plugins.colordialog&&!1!==h.colorButton_enableMore,z=m.length+(x?2:1),B=a.config["colorButton_"+d+"Style"];B.childRule="back"==d?function(a){return f(a)}:function(a){return!(a.is("a")||a.getElementsByTag("a").count())||
774
774
  f(a)};var w=CKEDITOR.tools.addFunction(function(b){a.focus();a.fire("saveSnapshot");"?"==b?a.getColorFromDialog(function(a){a&&c(a)},null,g):c(b&&"#"+b)});!1!==h.colorButton_enableAutomatic&&b.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',k.auto,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',w,",null,'",d,"');return false;\" href\x3d\"javascript:void('",k.auto,'\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"',
775
- z,'"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+y+'" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"',e,'"\x3e\x3c/span\x3e',k.auto,"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/a\x3e");b.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e');for(e=0;e<m.length;e++){0===e%y&&b.push("\x3c/tr\x3e\x3ctr\x3e");var v=m[e].split("/"),D=v[0],B=v[1]||D;b.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
776
- v[1]?D:a.lang.colorbutton.colors[B]||B,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',w,",'",B,"','",d,"'); return false;\" href\x3d\"javascript:void('",B,'\')" data-value\x3d"'+B+'" role\x3d"option" aria-posinset\x3d"',e+2,'" aria-setsize\x3d"',z,'"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#',B,'"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')}x&&b.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+y+'" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
775
+ z,'"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+y+'" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"',e,'"\x3e\x3c/span\x3e',k.auto,"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/a\x3e");b.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e');for(e=0;e<m.length;e++){0===e%y&&b.push("\x3c/tr\x3e\x3ctr\x3e");var u=m[e].split("/"),D=u[0],C=u[1]||D;b.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
776
+ u[1]?D:a.lang.colorbutton.colors[C]||C,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',w,",'",C,"','",d,"'); return false;\" href\x3d\"javascript:void('",C,'\')" data-value\x3d"'+C+'" role\x3d"option" aria-posinset\x3d"',e+2,'" aria-setsize\x3d"',z,'"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#',C,'"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')}x&&b.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"'+y+'" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
777
777
  k.more,'" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(',w,",'?','",d,"');return false;\" href\x3d\"javascript:void('",k.more,"')\"",' role\x3d"option" aria-posinset\x3d"',z,'" aria-setsize\x3d"',z,'"\x3e',k.more,"\x3c/a\x3e\x3c/td\x3e");b.push("\x3c/tr\x3e\x3c/table\x3e");return b.join("")}function f(a){return"false"==a.getAttribute("contentEditable")||a.getAttribute("data-nostyle")}function e(a,c){for(var d=a._.getItems(),e=0;e<d.count();e++){var f=
778
778
  d.getItem(e);f.removeAttribute("aria-selected");c&&c==m(f.getAttribute("data-value"))&&f.setAttribute("aria-selected",!0)}}function m(a){return CKEDITOR.tools.normalizeHex("#"+CKEDITOR.tools.convertRgbToHex(a||"")).replace(/#/g,"")}var h=a.config,k=a.lang.colorbutton;if(!CKEDITOR.env.hc){l({name:"TextColor",type:"fore",commandName:"textColor",title:k.textColorTitle,order:10,contentTransformations:[[{element:"font",check:"span{color}",left:function(a){return!!a.attributes.color},right:function(a){a.name=
779
779
  "span";a.attributes.color&&(a.styles.color=a.attributes.color);delete a.attributes.color}}]]});var c,d=a.config.colorButton_normalizeBackground;if(void 0===d||d)c=[[{element:"span",left:function(a){var c=CKEDITOR.tools;if("span"!=a.name||!a.styles||!a.styles.background)return!1;a=c.style.parse.background(a.styles.background);return a.color&&1===c.object.keys(a).length},right:function(b){var c=(new CKEDITOR.style(a.config.colorButton_backStyle,{color:b.styles.background})).getDefinition();b.name=c.element;
@@ -794,9 +794,9 @@ c._putScreenReaderMessage(a,"copied");c._attachPasteKeystrokeHandler(a)}},applyF
794
794
  null,g.removeClass("cke_copyformatting_active"),l.removeClass("cke_copyformatting_disabled"),l.removeClass("cke_copyformatting_tableresize_cursor"),c.setState(CKEDITOR.TRISTATE_OFF),b._detachPasteKeystrokeHandler(a));b._putScreenReaderMessage(a,d?"applied":"canceled")}}},_getCursorContainer:function(a){return a.elementMode===CKEDITOR.ELEMENT_MODE_INLINE?a.editable():a.editable().getParent()},_convertElementToStyleDef:function(a){var e=CKEDITOR.tools,c=a.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes),
795
795
  e=e.parseCssText(a.getAttribute("style"),!0,!0);return{element:a.getName(),type:CKEDITOR.STYLE_INLINE,attributes:c,styles:e}},_extractStylesFromElement:function(a,e){var c={},d=[];do if(e.type===CKEDITOR.NODE_ELEMENT&&!e.hasAttribute("data-cke-bookmark")&&(c.element=e,a.copyFormatting.fire("extractFormatting",c,a)&&c.styleDef&&d.push(new CKEDITOR.style(c.styleDef)),e.getName&&-1!==f(CKEDITOR.plugins.copyformatting.breakOnElements,e.getName())))break;while((e=e.getParent())&&e.type===CKEDITOR.NODE_ELEMENT);
796
796
  return d},_extractStylesFromRange:function(a,e){for(var c=[],d=new CKEDITOR.dom.walker(e),b;b=d.next();)c=c.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a,b));return c},_removeStylesFromElementInRange:function(a,e){for(var c=-1!==f(["ol","ul","table"],e),d=new CKEDITOR.dom.walker(a),b;b=d.next();)if(b=b.getAscendant(e,!0))if(b.removeAttributes(b.getAttributes()),c)break},_getSelectedWordOffset:function(a){function e(a,b){return a[b?"getPrevious":"getNext"](function(a){return a.type!==
797
- CKEDITOR.NODE_COMMENT})}function c(a){return a.type==CKEDITOR.NODE_ELEMENT?(a=a.getHtml().replace(/<span.*?>&nbsp;<\/span>/g,""),a.replace(/<.*?>/g,"")):a.getText()}function d(a,b){var h=a,g=/\s/g,l="p br ol ul li td th div caption body".split(" "),m=!1,n=!1,r,B;do{for(r=e(h,b);!r&&h.getParent();){h=h.getParent();if(-1!==f(l,h.getName())){n=m=!0;break}r=e(h,b)}if(r&&r.getName&&-1!==f(l,r.getName())){m=!0;break}h=r}while(h&&h.getStyle&&("none"==h.getStyle("display")||!h.getText()));for(h||(h=a);h.type!==
798
- CKEDITOR.NODE_TEXT;)h=!m||b||n?h.getChild(0):h.getChild(h.getChildCount()-1);for(l=c(h);null!=(n=g.exec(l))&&(B=n.index,b););if("number"!==typeof B&&!m)return d(h,b);if(m)b?B=0:(g=/([\.\b]*$)/,B=(n=g.exec(l))?n.index:l.length);else if(b&&(B+=1,B>l.length))return d(h);return{node:h,offset:B}}var b=/\b\w+\b/ig,g,l,m,p,t;m=p=t=a.startContainer;for(g=c(m);null!=(l=b.exec(g));)if(l.index+l[0].length>=a.startOffset)return a=l.index,b=l.index+l[0].length,0===l.index&&(l=d(m,!0),p=l.node,a=l.offset),b>=g.length&&
799
- (g=d(m),t=g.node,b=g.offset),{startNode:p,startOffset:a,endNode:t,endOffset:b};return null},_filterStyles:function(a){var e=CKEDITOR.tools.isEmpty,c=[],d,b;for(b=0;b<a.length;b++)d=a[b]._.definition,-1!==CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary,d.element)&&(d.element=a[b].element="span"),"span"===d.element&&e(d.attributes)&&e(d.styles)||c.push(a[b]);return c},_determineContext:function(a){function e(c){var d=new CKEDITOR.dom.walker(a),b;if(a.startContainer.getAscendant(c,
797
+ CKEDITOR.NODE_COMMENT})}function c(a){return a.type==CKEDITOR.NODE_ELEMENT?(a=a.getHtml().replace(/<span.*?>&nbsp;<\/span>/g,""),a.replace(/<.*?>/g,"")):a.getText()}function d(a,b){var h=a,g=/\s/g,l="p br ol ul li td th div caption body".split(" "),m=!1,u=!1,n,p;do{for(n=e(h,b);!n&&h.getParent();){h=h.getParent();if(-1!==f(l,h.getName())){u=m=!0;break}n=e(h,b)}if(n&&n.getName&&-1!==f(l,n.getName())){m=!0;break}h=n}while(h&&h.getStyle&&("none"==h.getStyle("display")||!h.getText()));for(h||(h=a);h.type!==
798
+ CKEDITOR.NODE_TEXT;)h=!m||b||u?h.getChild(0):h.getChild(h.getChildCount()-1);for(l=c(h);null!=(u=g.exec(l))&&(p=u.index,b););if("number"!==typeof p&&!m)return d(h,b);if(m)b?p=0:(g=/([\.\b]*$)/,p=(u=g.exec(l))?u.index:l.length);else if(b&&(p+=1,p>l.length))return d(h);return{node:h,offset:p}}var b=/\b\w+\b/ig,g,l,m,v,r;m=v=r=a.startContainer;for(g=c(m);null!=(l=b.exec(g));)if(l.index+l[0].length>=a.startOffset)return a=l.index,b=l.index+l[0].length,0===l.index&&(l=d(m,!0),v=l.node,a=l.offset),b>=g.length&&
799
+ (g=d(m),r=g.node,b=g.offset),{startNode:v,startOffset:a,endNode:r,endOffset:b};return null},_filterStyles:function(a){var e=CKEDITOR.tools.isEmpty,c=[],d,b;for(b=0;b<a.length;b++)d=a[b]._.definition,-1!==CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary,d.element)&&(d.element=a[b].element="span"),"span"===d.element&&e(d.attributes)&&e(d.styles)||c.push(a[b]);return c},_determineContext:function(a){function e(c){var d=new CKEDITOR.dom.walker(a),b;if(a.startContainer.getAscendant(c,
800
800
  !0)||a.endContainer.getAscendant(c,!0))return!0;for(;b=d.next();)if(b.getAscendant(c,!0))return!0}return e({ul:1,ol:1})?"list":e("table")?"table":"text"},_applyStylesToTextContext:function(a,e,c){var d=CKEDITOR.plugins.copyformatting,b=d.excludedAttributesFromInlineTransform,g,l;CKEDITOR.env.webkit&&!CKEDITOR.env.chrome&&a.getSelection().selectRanges([e]);for(g=0;g<c.length;g++)if(e=c[g],-1===f(d.excludedElementsFromInlineTransform,e.element)){if(-1!==f(d.elementsForInlineTransform,e.element))for(e.element=
801
801
  e._.definition.element="span",l=0;l<b.length;l++)e._.definition.attributes[b[l]]&&delete e._.definition.attributes[b[l]];e.apply(a)}},_applyStylesToListContext:function(e,f,c){var d,b,g;for(g=0;g<c.length;g++)d=c[g],b=f.createBookmark(),"ol"===d.element||"ul"===d.element?a(f,{ul:1,ol:1},function(a){var b=d;a.getName()!==b.element&&a.renameNode(b.element);b.applyToObject(a)},!0):"li"===d.element?a(f,"li",function(a){d.applyToObject(a)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,f,
802
802
  [d]),f.moveToBookmark(b)},_applyStylesToTableContext:function(e,k,c){function d(a,b){a.getName()!==b.element&&(b=b.getDefinition(),b.element=a.getName(),b=new CKEDITOR.style(b));b.applyToObject(a)}var b,g,l;for(l=0;l<c.length;l++)b=c[l],g=k.createBookmark(),-1!==f(["table","tr"],b.element)?a(k,b.element,function(a){b.applyToObject(a)}):-1!==f(["td","th"],b.element)?a(k,{td:1,th:1},function(a){d(a,b)}):-1!==f(["thead","tbody"],b.element)?a(k,{thead:1,tbody:1},function(a){d(a,b)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,
@@ -811,14 +811,14 @@ f=CKEDITOR.addTemplate("menuItem",l),e=CKEDITOR.addTemplate("menuArrow",'\x3cspa
811
811
  e.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),d=c.block.attributes=c.attributes||{};!d.role&&(d.role="menu");this._.panelDefinition=c},_:{onShow:function(){var a=this.editor.getSelection(),e=a&&a.getStartElement(),c=this.editor.elementPath(),d=this._.listeners;this.removeAll();for(var b=0;b<d.length;b++){var f=d[b](e,a,c);if(f)for(var g in f){var l=this.editor.getMenuItem(g);!l||l.command&&!this.editor.getCommand(l.command).state||(l.state=f[g],this.add(l))}}},onClick:function(a){this.hide();
812
812
  if(a.onClick)a.onClick();else a.command&&this.editor.execCommand(a.command)},onEscape:function(a){var e=this.parent;e?e._.panel.hideChild(1):27==a&&this.hide(1);return!1},onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(a){var e=this._.subMenu,c=this.items[a];if(c=c.getItems&&c.getItems()){e?e.removeAll():(e=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},!0)),e.parent=this,e._.onClick=CKEDITOR.tools.bind(this._.onClick,
813
813
  this));for(var d in c){var b=this.editor.getMenuItem(d);b&&(b.state=c[d],e.add(b))}var f=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+String(a));setTimeout(function(){e.show(f,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(a){a.order||(a.order=this.items.length);this.items.push(a)},removeAll:function(){this.items=[]},show:function(e,f,c,d){if(!this.parent&&(this._.onShow(),!this.items.length))return;f=f||("rtl"==this.editor.lang.dir?2:1);var b=this.items,g=this.editor,
814
- l=this._.panel,m=this._.element;if(!l){l=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level);l.onEscape=CKEDITOR.tools.bind(function(a){if(!1===this._.onEscape(a))return!1},this);l.onShow=function(){l._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")};l.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this);m=l.addBlock(this.id,this._.panelDefinition.block);m.autoSize=!0;var p=m.keys;
815
- p[40]="next";p[9]="next";p[38]="prev";p[CKEDITOR.SHIFT+9]="prev";p["rtl"==g.lang.dir?37:39]=CKEDITOR.env.ie?"mouseup":"click";p[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(p[13]="mouseup");m=this._.element=m.element;p=m.getDocument();p.getBody().setStyle("overflow","hidden");p.getElementsByTag("html").getItem(0).setStyle("overflow","hidden");this._.itemOverFn=CKEDITOR.tools.addFunction(function(a){clearTimeout(this._.showSubTimeout);this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,
816
- g.config.menu_subMenuDelay||400,this,[a])},this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this);this._.itemClickFn=CKEDITOR.tools.addFunction(function(a){var b=this.items[a];if(b.state==CKEDITOR.TRISTATE_DISABLED)this.hide(1);else if(b.getItems)this._.showSubMenu(a);else this._.onClick(b)},this)}a(b);for(var p=g.elementPath(),p=['\x3cdiv class\x3d"cke_menu'+(p&&p.direction()!=g.lang.dir?" cke_mixed_dir_content":"")+'" role\x3d"presentation"\x3e'],
817
- t=b.length,q=t&&b[0].group,y=0;y<t;y++){var x=b[y];q!=x.group&&(p.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),q=x.group);x.render(this,y,p)}p.push("\x3c/div\x3e");m.setHtml(p.join(""));CKEDITOR.ui.fire("ready",this);this.parent?this.parent._.panel.showAsChild(l,this.id,e,f,c,d):l.showBlock(this.id,e,f,c,d);g.fire("menuShow",[l])},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide();this._.panel&&this._.panel.hide(a)},
814
+ l=this._.panel,m=this._.element;if(!l){l=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level);l.onEscape=CKEDITOR.tools.bind(function(a){if(!1===this._.onEscape(a))return!1},this);l.onShow=function(){l._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")};l.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this);m=l.addBlock(this.id,this._.panelDefinition.block);m.autoSize=!0;var v=m.keys;
815
+ v[40]="next";v[9]="next";v[38]="prev";v[CKEDITOR.SHIFT+9]="prev";v["rtl"==g.lang.dir?37:39]=CKEDITOR.env.ie?"mouseup":"click";v[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(v[13]="mouseup");m=this._.element=m.element;v=m.getDocument();v.getBody().setStyle("overflow","hidden");v.getElementsByTag("html").getItem(0).setStyle("overflow","hidden");this._.itemOverFn=CKEDITOR.tools.addFunction(function(a){clearTimeout(this._.showSubTimeout);this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,
816
+ g.config.menu_subMenuDelay||400,this,[a])},this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this);this._.itemClickFn=CKEDITOR.tools.addFunction(function(a){var b=this.items[a];if(b.state==CKEDITOR.TRISTATE_DISABLED)this.hide(1);else if(b.getItems)this._.showSubMenu(a);else this._.onClick(b)},this)}a(b);for(var v=g.elementPath(),v=['\x3cdiv class\x3d"cke_menu'+(v&&v.direction()!=g.lang.dir?" cke_mixed_dir_content":"")+'" role\x3d"presentation"\x3e'],
817
+ r=b.length,t=r&&b[0].group,y=0;y<r;y++){var x=b[y];t!=x.group&&(v.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),t=x.group);x.render(this,y,v)}v.push("\x3c/div\x3e");m.setHtml(v.join(""));CKEDITOR.ui.fire("ready",this);this.parent?this.parent._.panel.showAsChild(l,this.id,e,f,c,d):l.showBlock(this.id,e,f,c,d);g.fire("menuShow",[l])},addListener:function(a){this._.listeners.push(a)},hide:function(a){this._.onHide&&this._.onHide();this._.panel&&this._.panel.hide(a)},
818
818
  findItemByCommandName:function(a){var e=CKEDITOR.tools.array.filter(this.items,function(c){return a===c.command});return e.length?(e=e[0],{item:e,element:this._.element.findOne("."+e.className)}):null}}});CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,e,c){CKEDITOR.tools.extend(this,c,{order:0,className:"cke_menubutton__"+e});this.group=a._.menuGroups[this.group];this.editor=a;this.name=e},proto:{render:function(a,k,c){var d=a.id+String(k),b="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:
819
- this.state,g="",l=this.editor,u,p,t=b==CKEDITOR.TRISTATE_ON?"on":b==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(g=' aria-checked\x3d"'+(b==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var q=this.getItems,y="\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",x=this.name;this.icon&&!/\./.test(this.icon)&&(x=this.icon);this.command&&(u=l.getCommand(this.command),(u=l.getCommandKeystroke(u))&&(p=CKEDITOR.tools.keystrokeToString(l.lang.common.keyboard,
820
- u)));u=CKEDITOR.tools.htmlEncodeAttr(this.label);a={id:d,name:this.name,iconName:x,label:this.label,attrLabel:u,cls:this.className||"",state:t,hasPopup:q?"true":"false",disabled:b==CKEDITOR.TRISTATE_DISABLED,title:u+(p?" ("+p.display+")":""),ariaShortcut:p?l.lang.common.keyboardShortcut+" "+p.aria:"",href:"javascript:void('"+(u||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:k,iconStyle:CKEDITOR.skin.getIconStyle(x,"rtl"==this.editor.lang.dir,x==
821
- this.icon?null:this.icon,this.iconOffset),shortcutHtml:p?m.output({shortcut:p.display}):"",arrowHtml:q?e.output({label:y}):"",role:this.role?this.role:"menuitem",ariaChecked:g};f.output(a,c)}}})})();CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,
819
+ this.state,g="",l=this.editor,q,v,r=b==CKEDITOR.TRISTATE_ON?"on":b==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(g=' aria-checked\x3d"'+(b==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var t=this.getItems,y="\x26#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",x=this.name;this.icon&&!/\./.test(this.icon)&&(x=this.icon);this.command&&(q=l.getCommand(this.command),(q=l.getCommandKeystroke(q))&&(v=CKEDITOR.tools.keystrokeToString(l.lang.common.keyboard,
820
+ q)));q=CKEDITOR.tools.htmlEncodeAttr(this.label);a={id:d,name:this.name,iconName:x,label:this.label,attrLabel:q,cls:this.className||"",state:r,hasPopup:t?"true":"false",disabled:b==CKEDITOR.TRISTATE_DISABLED,title:q+(v?" ("+v.display+")":""),ariaShortcut:v?l.lang.common.keyboardShortcut+" "+v.aria:"",href:"javascript:void('"+(q||"").replace("'")+"')",hoverFn:a._.itemOverFn,moveOutFn:a._.itemOutFn,clickFn:a._.itemClickFn,index:k,iconStyle:CKEDITOR.skin.getIconStyle(x,"rtl"==this.editor.lang.dir,x==
821
+ this.icon?null:this.icon,this.iconOffset),shortcutHtml:v?m.output({shortcut:v.display}):"",arrowHtml:t?e.output({label:y}):"",role:this.role?this.role:"menuitem",ariaChecked:g};f.output(a,c)}}})})();CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,
822
822
  $:function(a){this.base.call(this,a,{panel:{css:a.config.contextmenu_contentsCss,className:"cke_menu_panel",attributes:{"aria-label":a.lang.contextmenu.options}}})},proto:{addTarget:function(a,l){function g(){e=!1}var f,e;a.on("contextmenu",function(a){a=a.data;var k=CKEDITOR.env.webkit?f:CKEDITOR.env.mac?a.$.metaKey:a.$.ctrlKey;if(!l||!k)if(a.preventDefault(),!e){if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var k=this.editor,c=(new CKEDITOR.dom.elementPath(a.getTarget(),k.editable())).contains(function(a){return a.hasAttribute("contenteditable")},
823
823
  !0);c&&"false"==c.getAttribute("contenteditable")&&k.getSelection().fake(c)}var c=a.getTarget().getDocument(),d=a.getTarget().getDocument().getDocumentElement(),k=!c.equals(CKEDITOR.document),c=c.getWindow().getScrollPosition(),b=k?a.$.clientX:a.$.pageX||c.x+a.$.clientX,g=k?a.$.clientY:a.$.pageY||c.y+a.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(d,null,b,g)},CKEDITOR.env.ie?200:0,this)}},this);if(CKEDITOR.env.webkit){var m=function(){f=0};a.on("keydown",function(a){f=CKEDITOR.env.mac?
824
824
  a.data.$.metaKey:a.data.$.ctrlKey});a.on("keyup",m);a.on("contextmenu",m)}CKEDITOR.env.gecko&&!CKEDITOR.env.mac&&(a.on("keydown",function(a){a.data.$.shiftKey&&121===a.data.$.keyCode&&(e=!0)},null,null,0),a.on("keyup",g),a.on("contextmenu",g))},open:function(a,l,g,f){!1!==this.editor.config.enableContextMenu&&this.editor.getSelection().getType()!==CKEDITOR.SELECTION_NONE&&(this.editor.focus(),a=a||CKEDITOR.document.getDocumentElement(),this.editor.selectionChange(1),this.show(a,l,g,f))}}})},beforeInit:function(a){var l=
@@ -839,9 +839,9 @@ e=f.document.createElement("span");e.setAttribute("style",c);e.setStyle(a,b);c=C
839
839
  {afterInit:function(l){function g(a){return c[a]}function f(a){return"force"!=e.entities_processNumerical&&h[a]?h[a]:"\x26#"+a.charCodeAt(0)+";"}var e=l.config;if(l=(l=l.dataProcessor)&&l.htmlFilter){var m=[];!1!==e.basicEntities&&m.push("nbsp,gt,lt,amp");e.entities&&(m.length&&m.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"),
840
840
  e.entities_latin&&m.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"),e.entities_greek&&m.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"),
841
841
  e.entities_additional&&m.push(e.entities_additional));var h=a(m.join(",")),k=h.regex?"["+h.regex+"]":"a^";delete h.regex;e.entities&&e.entities_processNumerical&&(k="[^ -~]|"+k);var k=new RegExp(k,"g"),c=a("nbsp,gt,lt,amp,shy",!0),d=new RegExp(c.regex,"g");l.addRules({text:function(a){return a.replace(d,g).replace(k,f)}},{applyToAll:!0,excludeNestedEditable:!0})}}})})();CKEDITOR.config.basicEntities=!0;CKEDITOR.config.entities=!0;CKEDITOR.config.entities_latin=!0;CKEDITOR.config.entities_greek=!0;
842
- CKEDITOR.config.entities_additional="#39";(function(){function a(a){var e=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,h=function(){function b(a,d,e){c.setStyle(d,g(e));c.setStyle("position",a)}function d(a){var c=m.getDocumentPosition();switch(a){case "top":b("absolute","top",c.y-x-w);break;case "pin":b("fixed","top",D);break;case "bottom":b("absolute","top",c.y+(q.height||q.bottom-q.top)+w)}k=a}var k,m,t,q,y,x,z,A=e.floatSpaceDockedOffsetX||0,w=e.floatSpaceDockedOffsetY||0,v=e.floatSpacePinnedOffsetX||
843
- 0,D=e.floatSpacePinnedOffsetY||0;return function(b){if(m=a.editable()){var n=b&&"focus"==b.name;n&&c.show();a.fire("floatingSpaceLayout",{show:n});c.removeStyle("left");c.removeStyle("right");t=c.getClientRect();q=m.getClientRect();y=l.getViewPaneSize();x=t.height;z="pageXOffset"in l.$?l.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;k?(x+w<=q.top?d("top"):x+w>y.height-q.bottom?d("pin"):d("bottom"),b=y.width/2,b=e.floatSpacePreferRight?"right":0<q.left&&q.right<y.width&&q.width>t.width?
844
- "rtl"==e.contentsLangDirection?"right":"left":b-q.left>q.right-b?"left":"right",t.width>y.width?(b="left",n=0):(n="left"==b?0<q.left?q.left:0:q.right<y.width?y.width-q.right:0,n+t.width>y.width&&(b="left"==b?"right":"left",n=0)),c.setStyle(b,g(("pin"==k?v:A)+n+("pin"==k?0:"left"==b?z:-z)))):(k="pin",d("pin"),h(b))}}}();if(m){var k=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+
842
+ CKEDITOR.config.entities_additional="#39";(function(){function a(a){var e=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,h=function(){function b(a,d,e){c.setStyle(d,g(e));c.setStyle("position",a)}function d(a){var c=m.getDocumentPosition();switch(a){case "top":b("absolute","top",c.y-x-w);break;case "pin":b("fixed","top",D);break;case "bottom":b("absolute","top",c.y+(t.height||t.bottom-t.top)+w)}k=a}var k,m,r,t,y,x,z,B=e.floatSpaceDockedOffsetX||0,w=e.floatSpaceDockedOffsetY||0,u=e.floatSpacePinnedOffsetX||
843
+ 0,D=e.floatSpacePinnedOffsetY||0;return function(b){if(m=a.editable()){var n=b&&"focus"==b.name;n&&c.show();a.fire("floatingSpaceLayout",{show:n});c.removeStyle("left");c.removeStyle("right");r=c.getClientRect();t=m.getClientRect();y=l.getViewPaneSize();x=r.height;z="pageXOffset"in l.$?l.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;k?(x+w<=t.top?d("top"):x+w>y.height-t.bottom?d("pin"):d("bottom"),b=y.width/2,b=e.floatSpacePreferRight?"right":0<t.left&&t.right<y.width&&t.width>r.width?
844
+ "rtl"==e.contentsLangDirection?"right":"left":b-t.left>t.right-b?"left":"right",r.width>y.width?(b="left",n=0):(n="left"==b?0<t.left?t.left:0:t.right<y.width?y.width-t.right:0,n+r.width>y.width&&(b="left"==b?"right":"left",n=0)),c.setStyle(b,g(("pin"==k?u:B)+n+("pin"==k?0:"left"==b?z:-z)))):(k="pin",d("pin"),h(b))}}}();if(m){var k=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+
845
845
  (CKEDITOR.env.gecko?" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),c=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({content:m,
846
846
  id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(e.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),d=CKEDITOR.tools.eventsBuffer(500,h),b=CKEDITOR.tools.eventsBuffer(100,h);c.unselectable();c.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(c){h(c);a.on("change",d.input);l.on("scroll",b.input);l.on("resize",b.input)});a.on("blur",function(){c.hide();a.removeListener("change",
847
847
  d.input);l.removeListener("scroll",b.input);l.removeListener("resize",b.input)});a.on("destroy",function(){l.removeListener("scroll",b.input);l.removeListener("resize",b.input);c.clearCustomData();c.remove()});a.focusManager.hasFocus&&c.show();a.focusManager.add(c,1)}}var l=CKEDITOR.document.getWindow(),g=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(f){f.on("loaded",function(){a(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var a=
@@ -858,8 +858,8 @@ f.getItem(++k);){if(a.equals(h)){this._.focusIndex=k;break}}else this.element.fo
858
858
  l+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":CKEDITOR.env.air?"\x26nbsp;":"")+"\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),g=CKEDITOR.addTemplate("combo",a);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,
859
859
  a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel";a.block={multiSelect:a.multiSelect,attributes:a.attributes};a.toolbarRelated=!0;this._={panelDefinition:a,items:{},listeners:[]}},proto:{renderHtml:function(a){var e=[];this.render(a,e);return e.join("")},render:function(a,e){function l(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var b=
860
860
  this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;a.readOnly&&!this.readOnly&&(b=CKEDITOR.TRISTATE_DISABLED);this.setState(b);this.setValue("");b!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var h=CKEDITOR.env,k,c,d="cke_"+this.id,b=CKEDITOR.tools.addFunction(function(b){c&&(a.unlockSelection(1),c=0);k.execute(b)},this),n=this;k={id:d,combo:this,focus:function(){CKEDITOR.document.getById(d).getChild(1).focus()},execute:function(b){var c=n._;if(c.state!=CKEDITOR.TRISTATE_DISABLED)if(n.createPanel(a),
861
- c.on)c.panel.hide();else{n.commit();var d=n.getValue();d?c.list.mark(d):c.list.unmarkAll();c.panel.showBlock(n.id,new CKEDITOR.dom.element(b),4)}},clickFn:b};this._.listeners.push(a.on("activeFilterChange",l,this));this._.listeners.push(a.on("mode",l,this));this._.listeners.push(a.on("selectionChange",l,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",l,this));var r=CKEDITOR.tools.addFunction(function(a,c){a=new CKEDITOR.dom.event(a);var d=a.getKeystroke();switch(d){case 13:case 32:case 40:CKEDITOR.tools.callFunction(b,
862
- c);break;default:k.onkey(k,d)}a.preventDefault()}),u=CKEDITOR.tools.addFunction(function(){k.onfocus&&k.onfocus()});c=0;k.keyDownFn=r;h={id:d,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:h.gecko&&!h.hc?"":(this.title||"").replace("'",""),keydownFn:r,focusFn:u,clickFn:b};g.output(h,e);if(this.onRender)this.onRender();return k},createPanel:function(a){if(!this._.panel){var e=this._.panelDefinition,g=this._.panelDefinition.block,h=e.parent||CKEDITOR.document.getBody(),
861
+ c.on)c.panel.hide();else{n.commit();var d=n.getValue();d?c.list.mark(d):c.list.unmarkAll();c.panel.showBlock(n.id,new CKEDITOR.dom.element(b),4)}},clickFn:b};this._.listeners.push(a.on("activeFilterChange",l,this));this._.listeners.push(a.on("mode",l,this));this._.listeners.push(a.on("selectionChange",l,this));!this.readOnly&&this._.listeners.push(a.on("readOnly",l,this));var p=CKEDITOR.tools.addFunction(function(a,c){a=new CKEDITOR.dom.event(a);var d=a.getKeystroke();switch(d){case 13:case 32:case 40:CKEDITOR.tools.callFunction(b,
862
+ c);break;default:k.onkey(k,d)}a.preventDefault()}),q=CKEDITOR.tools.addFunction(function(){k.onfocus&&k.onfocus()});c=0;k.keyDownFn=p;h={id:d,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:h.gecko&&!h.hc?"":(this.title||"").replace("'",""),keydownFn:p,focusFn:q,clickFn:b};g.output(h,e);if(this.onRender)this.onRender();return k},createPanel:function(a){if(!this._.panel){var e=this._.panelDefinition,g=this._.panelDefinition.block,h=e.parent||CKEDITOR.document.getBody(),
863
863
  k="cke_combopanel__"+this.name,c=new CKEDITOR.ui.floatPanel(a,h,e),e=c.addListBlock(this.id,g),d=this;c.onShow=function(){this.element.addClass(k);d.setState(CKEDITOR.TRISTATE_ON);d._.on=1;d.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(d.onOpen)d.onOpen()};c.onHide=function(b){this.element.removeClass(k);d.setState(d.modes&&d.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);d._.on=0;if(!b&&d.onClose)d.onClose()};c.onEscape=function(){c.hide(1)};e.onClick=function(a,e){d.onClick&&
864
864
  d.onClick.call(d,a,e);c.hide()};this._.panel=c;this._.list=e;c.getBlock(this.id).onHide=function(){d._.on=0;d.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a,e){this._.value=a;var g=this.document.getById("cke_"+this.id+"_text");g&&(a||e?g.removeClass("cke_combo_inlinelabel"):(e=this.label,g.addClass("cke_combo_inlinelabel")),g.setText("undefined"!=typeof e?e:a))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},
865
865
  hideItem:function(a){this._.list.hideItem(a)},hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,e,g){this._.items[a]=g||a;this._.list.add(a,e,g)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!=a){var e=this.document.getById("cke_"+this.id);e.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED?
@@ -888,11 +888,11 @@ this.setState(CKEDITOR.tools.search(c,g)?g:l)},e,null,100);e.on("exec",function(
888
888
  "ltr"==a.data.dir?["_rtl",""]:["","_rtl"],l=0;l<b.length;l++)d.hasClass(b[l]+g[0])&&(d.removeClass(b[l]+g[0]),d.addClass(b[l]+g[1]));b=d.getStyle("margin-right");g=d.getStyle("margin-left");b?d.setStyle("margin-left",b):d.removeStyle("margin-left");g?d.setStyle("margin-right",g):d.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=!!a;this.startDisabled=!this.isIndent},specificDefinition:function(a,e,g){this.name=e;this.editor=a;this.jobs={};this.enterBr=
889
889
  a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!g;this.relatedGlobal=g?"indent":"outdent";this.indentKey=g?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,e){a.on("pluginsLoaded",function(){for(var a in e)(function(a,e){var c=a.getCommand(e.relatedGlobal),d;for(d in e.jobs)c.on("exec",function(b){b.data.done||(a.fire("lockSnapshot"),e.execJob(a,d)&&(b.data.done=!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(e.database))},this,null,d),c.on("refresh",function(b){b.data.states||
890
890
  (b.data.states={});b.data.states[e.name+"@"+d]=e.refreshJob(a,d,b.data.path)},this,null,d);a.addFeature(e)})(this,e[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(a,e){var g=this.jobs[e];if(g.state!=l)return g.exec.call(this,a)},refreshJob:function(a,e,g){e=this.jobs[e];a.activeFilter.checkFeature(this)?e.state=e.refresh.call(this,a,g):e.state=l;return e.state},getContext:function(a){return a.contains(this.context)}}})();
891
- (function(){function a(a){function c(c){for(var h=f.startContainer,l=f.endContainer;h&&!h.getParent().equals(c);)h=h.getParent();for(;l&&!l.getParent().equals(c);)l=l.getParent();if(!h||!l)return!1;for(var m=[],A=!1;!A;)h.equals(l)&&(A=!0),m.push(h),h=h.getNext();if(1>m.length)return!1;h=c.getParents(!0);for(l=0;l<h.length;l++)if(h[l].getName&&e[h[l].getName()]){c=h[l];break}for(var h=d.isIndent?1:-1,l=m[0],m=m[m.length-1],A=CKEDITOR.plugins.list.listToArray(c,b),w=A[m.getCustomData("listarray_index")].indent,
892
- l=l.getCustomData("listarray_index");l<=m.getCustomData("listarray_index");l++)if(A[l].indent+=h,0<h){for(var v=A[l].parent,D=l-1;0<=D;D--)if(A[D].indent===h){v=A[D].parent;break}A[l].parent=new CKEDITOR.dom.element(v.getName(),v.getDocument())}for(l=m.getCustomData("listarray_index")+1;l<A.length&&A[l].indent>w;l++)A[l].indent+=h;h=CKEDITOR.plugins.list.arrayToList(A,b,null,a.config.enterMode,c.getDirection());if(!d.isIndent){var B;if((B=c.getParent())&&B.is("li"))for(var m=h.listNode.getChildren(),
893
- C=[],t,l=m.count()-1;0<=l;l--)(t=m.getItem(l))&&t.is&&t.is("li")&&C.push(t)}h&&h.listNode.replace(c);if(C&&C.length)for(l=0;l<C.length;l++){for(t=c=C[l];(t=t.getNext())&&t.is&&t.getName()in e;)CKEDITOR.env.needsNbspFiller&&!c.getFirst(g)&&c.append(f.document.createText(" ")),c.append(t);c.insertAfter(B)}h&&a.fire("contentDomInvalidated");return!0}for(var d=this,b=this.database,e=this.context,f,h=a.getSelection(),h=(h&&h.getRanges()).createIterator();f=h.getNextRange();){for(var m=f.getCommonAncestor();m&&
894
- (m.type!=CKEDITOR.NODE_ELEMENT||!e[m.getName()]);){if(a.editable().equals(m)){m=!1;break}m=m.getParent()}m||(m=f.startPath().contains(e))&&f.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);if(!m){var t=f.getEnclosedNode();t&&t.type==CKEDITOR.NODE_ELEMENT&&t.getName()in e&&(f.setStartAt(t,CKEDITOR.POSITION_AFTER_START),f.setEndAt(t,CKEDITOR.POSITION_BEFORE_END),m=t)}m&&f.startContainer.type==CKEDITOR.NODE_ELEMENT&&f.startContainer.getName()in e&&(t=new CKEDITOR.dom.walker(f),t.evaluator=l,f.startContainer=
895
- t.next());m&&f.endContainer.type==CKEDITOR.NODE_ELEMENT&&f.endContainer.getName()in e&&(t=new CKEDITOR.dom.walker(f),t.evaluator=l,f.endContainer=t.previous());if(m)return c(m)}return 0}function l(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is("li")}function g(a){return f(a)&&e(a)}var f=CKEDITOR.dom.walker.whitespaces(!0),e=CKEDITOR.dom.walker.bookmark(!1,!0),m=CKEDITOR.TRISTATE_DISABLED,h=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function c(b){d.specificDefinition.apply(this,
891
+ (function(){function a(a){function c(c){for(var h=f.startContainer,l=f.endContainer;h&&!h.getParent().equals(c);)h=h.getParent();for(;l&&!l.getParent().equals(c);)l=l.getParent();if(!h||!l)return!1;for(var m=[],B=!1;!B;)h.equals(l)&&(B=!0),m.push(h),h=h.getNext();if(1>m.length)return!1;h=c.getParents(!0);for(l=0;l<h.length;l++)if(h[l].getName&&e[h[l].getName()]){c=h[l];break}for(var h=d.isIndent?1:-1,l=m[0],m=m[m.length-1],B=CKEDITOR.plugins.list.listToArray(c,b),w=B[m.getCustomData("listarray_index")].indent,
892
+ l=l.getCustomData("listarray_index");l<=m.getCustomData("listarray_index");l++)if(B[l].indent+=h,0<h){for(var u=B[l].parent,D=l-1;0<=D;D--)if(B[D].indent===h){u=B[D].parent;break}B[l].parent=new CKEDITOR.dom.element(u.getName(),u.getDocument())}for(l=m.getCustomData("listarray_index")+1;l<B.length&&B[l].indent>w;l++)B[l].indent+=h;h=CKEDITOR.plugins.list.arrayToList(B,b,null,a.config.enterMode,c.getDirection());if(!d.isIndent){var r;if((r=c.getParent())&&r.is("li"))for(var m=h.listNode.getChildren(),
893
+ A=[],q,l=m.count()-1;0<=l;l--)(q=m.getItem(l))&&q.is&&q.is("li")&&A.push(q)}h&&h.listNode.replace(c);if(A&&A.length)for(l=0;l<A.length;l++){for(q=c=A[l];(q=q.getNext())&&q.is&&q.getName()in e;)CKEDITOR.env.needsNbspFiller&&!c.getFirst(g)&&c.append(f.document.createText(" ")),c.append(q);c.insertAfter(r)}h&&a.fire("contentDomInvalidated");return!0}for(var d=this,b=this.database,e=this.context,f,h=a.getSelection(),h=(h&&h.getRanges()).createIterator();f=h.getNextRange();){for(var m=f.getCommonAncestor();m&&
894
+ (m.type!=CKEDITOR.NODE_ELEMENT||!e[m.getName()]);){if(a.editable().equals(m)){m=!1;break}m=m.getParent()}m||(m=f.startPath().contains(e))&&f.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);if(!m){var r=f.getEnclosedNode();r&&r.type==CKEDITOR.NODE_ELEMENT&&r.getName()in e&&(f.setStartAt(r,CKEDITOR.POSITION_AFTER_START),f.setEndAt(r,CKEDITOR.POSITION_BEFORE_END),m=r)}m&&f.startContainer.type==CKEDITOR.NODE_ELEMENT&&f.startContainer.getName()in e&&(r=new CKEDITOR.dom.walker(f),r.evaluator=l,f.startContainer=
895
+ r.next());m&&f.endContainer.type==CKEDITOR.NODE_ELEMENT&&f.endContainer.getName()in e&&(r=new CKEDITOR.dom.walker(f),r.evaluator=l,f.endContainer=r.previous());if(m)return c(m)}return 0}function l(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is("li")}function g(a){return f(a)&&e(a)}var f=CKEDITOR.dom.walker.whitespaces(!0),e=CKEDITOR.dom.walker.bookmark(!1,!0),m=CKEDITOR.TRISTATE_DISABLED,h=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function c(b){d.specificDefinition.apply(this,
896
896
  arguments);this.requiredContent=["ul","ol"];b.on("key",function(a){var c=b.elementPath();if("wysiwyg"==b.mode&&a.data.keyCode==this.indentKey&&c){var d=this.getContext(c);!d||this.isIndent&&CKEDITOR.plugins.indentList.firstItemInPath(this.context,c,d)||(b.execCommand(this.relatedGlobal),a.cancel())}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(a,b){var c=this.getContext(b),d=CKEDITOR.plugins.indentList.firstItemInPath(this.context,b,c);return c&&this.isIndent&&!d?h:m}:function(a,
897
897
  b){return!this.getContext(b)||this.isIndent?m:h},exec:CKEDITOR.tools.bind(a,this)}}var d=CKEDITOR.plugins.indent;d.registerCommands(e,{indentlist:new c(e,"indentlist",!0),outdentlist:new c(e,"outdentlist")});CKEDITOR.tools.extend(c.prototype,d.specificDefinition.prototype,{context:{ol:1,ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(a,c,d){var b=c.contains(l);d||(d=c.contains(a));return d&&b&&b.equals(d.getFirst(l))}})();(function(){function a(a,e,c){if(!a.getCustomData("indent_processed")){var d=
898
898
  this.editor,b=this.isIndent;if(e){d=a.$.className.match(this.classNameRegex);c=0;d&&(d=d[1],c=CKEDITOR.tools.indexOf(e,d)+1);if(0>(c+=b?1:-1))return;c=Math.min(c,e.length);c=Math.max(c,0);a.$.className=CKEDITOR.tools.ltrim(a.$.className.replace(this.classNameRegex,""));0<c&&a.addClass(e[c-1])}else{e=l(a,c);c=parseInt(a.getStyle(e),10);var f=d.config.indentOffset||40;isNaN(c)&&(c=0);c+=(b?1:-1)*f;if(0>c)return;c=Math.max(c,0);c=Math.ceil(c/f)*f;a.setStyle(e,c?c+(d.config.indentUnit||"px"):"");""===
@@ -907,8 +907,8 @@ e=g.getSelectedText();for(var k=0,c=-1,d=0;d<e.length;d++)if(" "===e.charAt(d)||
907
907
  else{for(;!a.hasAttribute||!a.hasAttribute("align")&&!a.getStyle("text-align");){g=a.getParent();if(!g)break;a=g}g=a.getStyle("text-align")||a.getAttribute("align")||""}g&&(g=g.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,""));!g&&e&&(g="rtl"==a.getComputedStyle("direction")?"right":"left");return g}function l(a,e,g){this.editor=a;this.name=e;this.value=g;this.context="p";e=a.config.justifyClasses;var h=a.config.enterMode==CKEDITOR.ENTER_P?"p":"div";if(e){switch(g){case "left":this.cssClassName=
908
908
  e[0];break;case "center":this.cssClassName=e[1];break;case "right":this.cssClassName=e[2];break;case "justify":this.cssClassName=e[3]}this.cssClassRegex=new RegExp("(?:^|\\s+)(?:"+e.join("|")+")(?\x3d$|\\s)");this.requiredContent=h+"("+this.cssClassName+")"}else this.requiredContent=h+"{text-align}";this.allowedContent={"caption div h1 h2 h3 h4 h5 h6 p pre td th li":{propertiesOnly:!0,styles:this.cssClassName?null:"text-align",classes:this.cssClassName||null}};a.config.enterMode==CKEDITOR.ENTER_BR&&
909
909
  (this.allowedContent.div=!0)}function g(a){var e=a.editor,g=e.createRange();g.setStartBefore(a.data.node);g.setEndAfter(a.data.node);for(var h=new CKEDITOR.dom.walker(g),k;k=h.next();)if(k.type==CKEDITOR.NODE_ELEMENT)if(!k.equals(a.data.node)&&k.getDirection())g.setStartAfter(k),h=new CKEDITOR.dom.walker(g);else{var c=e.config.justifyClasses;c&&(k.hasClass(c[0])?(k.removeClass(c[0]),k.addClass(c[2])):k.hasClass(c[2])&&(k.removeClass(c[2]),k.addClass(c[0])));c=k.getStyle("text-align");"left"==c?k.setStyle("text-align",
910
- "right"):"right"==c&&k.setStyle("text-align","left")}}l.prototype={exec:function(f){var e=f.getSelection(),g=f.config.enterMode;if(e){for(var h=e.createBookmarks(),k=e.getRanges(),c=this.cssClassName,d,b,l=f.config.useComputedState,l=void 0===l||l,r=k.length-1;0<=r;r--)for(d=k[r].createIterator(),d.enlargeBr=g!=CKEDITOR.ENTER_BR;b=d.getNextParagraph(g==CKEDITOR.ENTER_P?"p":"div");)if(!b.isReadOnly()){var u=b.getName(),p;p=f.activeFilter.check(u+"{text-align}");if((u=f.activeFilter.check(u+"("+c+")"))||
911
- p){b.removeAttribute("align");b.removeStyle("text-align");var t=c&&(b.$.className=CKEDITOR.tools.ltrim(b.$.className.replace(this.cssClassRegex,""))),q=this.state==CKEDITOR.TRISTATE_OFF&&(!l||a(b,!0)!=this.value);c&&u?q?b.addClass(c):t||b.removeAttribute("class"):q&&p&&b.setStyle("text-align",this.value)}}f.focus();f.forceNextSelectionCheck();e.selectBookmarks(h)}},refresh:function(f,e){var g=e.block||e.blockLimit,h=g.getName(),k=g.equals(f.editable()),h=this.cssClassName?f.activeFilter.check(h+"("+
910
+ "right"):"right"==c&&k.setStyle("text-align","left")}}l.prototype={exec:function(f){var e=f.getSelection(),g=f.config.enterMode;if(e){for(var h=e.createBookmarks(),k=e.getRanges(),c=this.cssClassName,d,b,l=f.config.useComputedState,l=void 0===l||l,p=k.length-1;0<=p;p--)for(d=k[p].createIterator(),d.enlargeBr=g!=CKEDITOR.ENTER_BR;b=d.getNextParagraph(g==CKEDITOR.ENTER_P?"p":"div");)if(!b.isReadOnly()){var q=b.getName(),v;v=f.activeFilter.check(q+"{text-align}");if((q=f.activeFilter.check(q+"("+c+")"))||
911
+ v){b.removeAttribute("align");b.removeStyle("text-align");var r=c&&(b.$.className=CKEDITOR.tools.ltrim(b.$.className.replace(this.cssClassRegex,""))),t=this.state==CKEDITOR.TRISTATE_OFF&&(!l||a(b,!0)!=this.value);c&&q?t?b.addClass(c):r||b.removeAttribute("class"):t&&v&&b.setStyle("text-align",this.value)}}f.focus();f.forceNextSelectionCheck();e.selectBookmarks(h)}},refresh:function(f,e){var g=e.block||e.blockLimit,h=g.getName(),k=g.equals(f.editable()),h=this.cssClassName?f.activeFilter.check(h+"("+
912
912
  this.cssClassName+")"):f.activeFilter.check(h+"{text-align}");k&&!CKEDITOR.dtd.$list[e.lastElement.getName()]?this.setState(CKEDITOR.TRISTATE_OFF):!k&&h?this.setState(a(g,this.editor.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)}};CKEDITOR.plugins.add("justify",{init:function(a){if(!a.blockless){var e=new l(a,"justifyleft","left"),m=new l(a,"justifycenter","center"),h=new l(a,"justifyright","right"),k=new l(a,"justifyblock",
913
913
  "justify");a.addCommand("justifyleft",e);a.addCommand("justifycenter",m);a.addCommand("justifyright",h);a.addCommand("justifyblock",k);a.ui.addButton&&(a.ui.addButton("JustifyLeft",{label:a.lang.common.alignLeft,command:"justifyleft",toolbar:"align,10"}),a.ui.addButton("JustifyCenter",{label:a.lang.common.center,command:"justifycenter",toolbar:"align,20"}),a.ui.addButton("JustifyRight",{label:a.lang.common.alignRight,command:"justifyright",toolbar:"align,30"}),a.ui.addButton("JustifyBlock",{label:a.lang.common.justify,
914
914
  command:"justifyblock",toolbar:"align,40"}));a.on("dirChanged",g)}}})})();(function(){function a(a,e){var g=f.exec(a),c=f.exec(e);if(g){if(!g[2]&&"px"==c[2])return c[1];if("px"==g[2]&&!c[2])return c[1]+"px"}return e}var l=CKEDITOR.htmlParser.cssStyle,g=CKEDITOR.tools.cssLength,f=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,e={elements:{$:function(e){var f=e.attributes;if((f=(f=(f=f&&f["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(f)))&&f.children[0])&&e.attributes["data-cke-resizable"]){var g=
@@ -924,76 +924,76 @@ toolbar:"links,20"}),a.ui.addButton("Anchor",{label:a.lang.link.anchor.toolbar,c
924
924
  c)&&(b.data.dialog="anchor"))},null,null,0);a.on("doubleclick",function(b){b.data.dialog in{link:1,anchor:1}&&b.data.link&&a.getSelection().selectElement(b.data.link)},null,null,20);a.addMenuItems&&a.addMenuItems({anchor:{label:a.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:a.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:a.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:a.lang.link.unlink,command:"unlink",
925
925
  group:"link",order:5}});a.contextMenu&&a.contextMenu.addListener(function(b){if(!b||b.isReadOnly())return null;b=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b);if(!b&&!(b=CKEDITOR.plugins.link.getSelectedLink(a)))return null;var c={};b.getAttribute("href")&&b.getChildCount()&&(c={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF});b&&b.hasAttribute("name")&&(c.anchor=c.removeAnchor=CKEDITOR.TRISTATE_OFF);return c});this.compiledProtectionFunction=f(a)},afterInit:function(a){a.dataProcessor.dataFilter.addRules({elements:{a:function(b){return b.attributes.name?
926
926
  b.children.length?null:a.createFakeParserElement(b,"cke_anchor","anchor"):null}}});var b=a._.elementsPath&&a._.elementsPath.filters;b&&b.push(function(b,c){if("a"==c&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,b)||b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())))return"anchor"})}});var e=/^javascript:/,m=/^(?:mailto)(?:(?!\?(subject|body)=).)+/i,h=/subject=([^;?:@&=$,\/]*)/i,k=/body=([^;?:@&=$,\/]*)/i,c=/^#(.*)$/,d=/^((?:http|https|ftp|news):\/\/)?(.*)$/,b=/^(_(?:self|top|parent|blank))$/,
927
- n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,r=/^javascript:([^(]+)\(([^)]+)\)$/,u=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,p=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,t=/^tel:(.*)$/,q={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",
927
+ n=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,p=/^javascript:([^(]+)\(([^)]+)\)$/,q=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,v=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,r=/^tel:(.*)$/,t={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",
928
928
  rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(a,b){var c=a.getSelection(),d=c.getSelectedElement(),e=c.getRanges(),f=[],h;if(!b&&d&&d.is("a"))return d;for(d=0;d<e.length;d++)if(h=c.getRanges()[d],h.shrink(CKEDITOR.SHRINK_ELEMENT,!0,{skipBogus:!0}),(h=a.elementPath(h.getCommonAncestor()).contains("a",1))&&b)f.push(h);else if(h)return h;return b?f:null},getEditorAnchors:function(a){for(var b=a.editable(),c=b.isInline()&&!a.plugins.divarea?a.document:b,b=c.getElementsByTag("a"),c=c.getElementsByTag("img"),
929
929
  d=[],e=0,f;f=b.getItem(e++);)(f.data("cke-saved-name")||f.hasAttribute("name"))&&d.push({name:f.data("cke-saved-name")||f.getAttribute("name"),id:f.getAttribute("id")});for(e=0;f=c.getItem(e++);)(f=this.tryRestoreFakeAnchor(a,f))&&d.push({name:f.getAttribute("name"),id:f.getAttribute("id")});return d},fakeAnchor:!0,tryRestoreFakeAnchor:function(a,b){if(b&&b.data("cke-real-element-type")&&"anchor"==b.data("cke-real-element-type")){var c=a.restoreRealElement(b);if(c.data("cke-saved-name"))return c}},
930
- parseLinkAttributes:function(a,f){var g=f&&(f.data("cke-saved-href")||f.getAttribute("href"))||"",l=a.plugins.link.compiledProtectionFunction,w=a.config.emailProtection,v={},D;g.match(e)&&("encode"==w?g=g.replace(n,function(a,b,c){c=c||"";return"mailto:"+String.fromCharCode.apply(String,b.split(","))+c.replace(/\\'/g,"'")}):w&&g.replace(r,function(a,b,c){if(b==l.name){v.type="email";a=v.email={};b=/(^')|('$)/g;c=c.match(/[^,\s]+/g);for(var d=c.length,e,f,h=0;h<d;h++)e=decodeURIComponent,f=c[h].replace(b,
931
- "").replace(/\\'/g,"'"),f=e(f),e=l.params[h].toLowerCase(),a[e]=f;a.address=[a.name,a.domain].join("@")}}));if(!v.type)if(w=g.match(c))v.type="anchor",v.anchor={},v.anchor.name=v.anchor.id=w[1];else if(w=g.match(t))v.type="tel",v.tel=w[1];else if(w=g.match(m)){D=g.match(h);var g=g.match(k),B=v.email={};v.type="email";B.address=w[0].replace("mailto:","");D&&(B.subject=decodeURIComponent(D[1]));g&&(B.body=decodeURIComponent(g[1]))}else g&&(D=g.match(d))&&(v.type="url",v.url={},v.url.protocol=D[1],v.url.url=
932
- D[2]);if(f){if(g=f.getAttribute("target"))v.target={type:g.match(b)?g:"frame",name:g};else if(g=(g=f.data("cke-pa-onclick")||f.getAttribute("onclick"))&&g.match(u))for(v.target={type:"popup",name:g[1]};w=p.exec(g[2]);)"yes"!=w[2]&&"1"!=w[2]||w[1]in{height:1,width:1,top:1,left:1}?isFinite(w[2])&&(v.target[w[1]]=w[2]):v.target[w[1]]=!0;null!==f.getAttribute("download")&&(v.download=!0);var g={},C;for(C in q)(w=f.getAttribute(C))&&(g[q[C]]=w);if(C=f.data("cke-saved-name")||g.advName)g.advName=C;CKEDITOR.tools.isEmpty(g)||
933
- (v.advanced=g)}return v},getLinkAttributes:function(b,c){var d=b.config.emailProtection||"",e={};switch(c.type){case "url":var d=c.url&&void 0!==c.url.protocol?c.url.protocol:"http://",f=c.url&&CKEDITOR.tools.trim(c.url.url)||"";e["data-cke-saved-href"]=0===f.indexOf("/")?f:d+f;break;case "anchor":d=c.anchor&&c.anchor.id;e["data-cke-saved-href"]="#"+(c.anchor&&c.anchor.name||d||"");break;case "email":var h=c.email,f=h.address;switch(d){case "":case "encode":var k=encodeURIComponent(h.subject||""),
930
+ parseLinkAttributes:function(a,f){var g=f&&(f.data("cke-saved-href")||f.getAttribute("href"))||"",l=a.plugins.link.compiledProtectionFunction,w=a.config.emailProtection,u={},D;g.match(e)&&("encode"==w?g=g.replace(n,function(a,b,c){c=c||"";return"mailto:"+String.fromCharCode.apply(String,b.split(","))+c.replace(/\\'/g,"'")}):w&&g.replace(p,function(a,b,c){if(b==l.name){u.type="email";a=u.email={};b=/(^')|('$)/g;c=c.match(/[^,\s]+/g);for(var d=c.length,e,f,h=0;h<d;h++)e=decodeURIComponent,f=c[h].replace(b,
931
+ "").replace(/\\'/g,"'"),f=e(f),e=l.params[h].toLowerCase(),a[e]=f;a.address=[a.name,a.domain].join("@")}}));if(!u.type)if(w=g.match(c))u.type="anchor",u.anchor={},u.anchor.name=u.anchor.id=w[1];else if(w=g.match(r))u.type="tel",u.tel=w[1];else if(w=g.match(m)){D=g.match(h);var g=g.match(k),C=u.email={};u.type="email";C.address=w[0].replace("mailto:","");D&&(C.subject=decodeURIComponent(D[1]));g&&(C.body=decodeURIComponent(g[1]))}else g&&(D=g.match(d))&&(u.type="url",u.url={},u.url.protocol=D[1],u.url.url=
932
+ D[2]);if(f){if(g=f.getAttribute("target"))u.target={type:g.match(b)?g:"frame",name:g};else if(g=(g=f.data("cke-pa-onclick")||f.getAttribute("onclick"))&&g.match(q))for(u.target={type:"popup",name:g[1]};w=v.exec(g[2]);)"yes"!=w[2]&&"1"!=w[2]||w[1]in{height:1,width:1,top:1,left:1}?isFinite(w[2])&&(u.target[w[1]]=w[2]):u.target[w[1]]=!0;null!==f.getAttribute("download")&&(u.download=!0);var g={},A;for(A in t)(w=f.getAttribute(A))&&(g[t[A]]=w);if(A=f.data("cke-saved-name")||g.advName)g.advName=A;CKEDITOR.tools.isEmpty(g)||
933
+ (u.advanced=g)}return u},getLinkAttributes:function(b,c){var d=b.config.emailProtection||"",e={};switch(c.type){case "url":var d=c.url&&void 0!==c.url.protocol?c.url.protocol:"http://",f=c.url&&CKEDITOR.tools.trim(c.url.url)||"";e["data-cke-saved-href"]=0===f.indexOf("/")?f:d+f;break;case "anchor":d=c.anchor&&c.anchor.id;e["data-cke-saved-href"]="#"+(c.anchor&&c.anchor.name||d||"");break;case "email":var h=c.email,f=h.address;switch(d){case "":case "encode":var k=encodeURIComponent(h.subject||""),
934
934
  m=encodeURIComponent(h.body||""),h=[];k&&h.push("subject\x3d"+k);m&&h.push("body\x3d"+m);h=h.length?"?"+h.join("\x26"):"";"encode"==d?(d=["javascript:void(location.href\x3d'mailto:'+",l(f)],h&&d.push("+'",a(h),"'"),d.push(")")):d=["mailto:",f,h];break;default:d=f.split("@",2),h.name=d[0],h.domain=d[1],d=["javascript:",g(b,h)]}e["data-cke-saved-href"]=d.join("");break;case "tel":e["data-cke-saved-href"]="tel:"+c.tel}if(c.target)if("popup"==c.target.type){for(var d=["window.open(this.href, '",c.target.name||
935
- "","', '"],n="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),f=n.length,k=function(a){c.target[a]&&n.push(a+"\x3d"+c.target[a])},h=0;h<f;h++)n[h]+=c.target[n[h]]?"\x3dyes":"\x3dno";k("width");k("left");k("height");k("top");d.push(n.join(","),"'); return false;");e["data-cke-pa-onclick"]=d.join("")}else"notSet"!=c.target.type&&c.target.name&&(e.target=c.target.name);c.download&&(e.download="");if(c.advanced){for(var t in q)(d=c.advanced[q[t]])&&(e[t]=d);e.name&&
936
- (e["data-cke-saved-name"]=e.name)}e["data-cke-saved-href"]&&(e.href=e["data-cke-saved-href"]);t={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1,download:1};c.advanced&&CKEDITOR.tools.extend(t,q);for(var r in e)delete t[r];return{set:e,removed:CKEDITOR.tools.object.keys(t)}},showDisplayTextForElement:function(a,b){var c={img:1,table:1,tbody:1,thead:1,tfoot:1,input:1,select:1,textarea:1},d=b.getSelection();return b.widgets&&b.widgets.focused||d&&1<d.getRanges().length?!1:!a||!a.getName||
935
+ "","', '"],n="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),f=n.length,k=function(a){c.target[a]&&n.push(a+"\x3d"+c.target[a])},h=0;h<f;h++)n[h]+=c.target[n[h]]?"\x3dyes":"\x3dno";k("width");k("left");k("height");k("top");d.push(n.join(","),"'); return false;");e["data-cke-pa-onclick"]=d.join("")}else"notSet"!=c.target.type&&c.target.name&&(e.target=c.target.name);c.download&&(e.download="");if(c.advanced){for(var r in t)(d=c.advanced[t[r]])&&(e[r]=d);e.name&&
936
+ (e["data-cke-saved-name"]=e.name)}e["data-cke-saved-href"]&&(e.href=e["data-cke-saved-href"]);r={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1,download:1};c.advanced&&CKEDITOR.tools.extend(r,t);for(var p in e)delete r[p];return{set:e,removed:CKEDITOR.tools.object.keys(r)}},showDisplayTextForElement:function(a,b){var c={img:1,table:1,tbody:1,thead:1,tfoot:1,input:1,select:1,textarea:1},d=b.getSelection();return b.widgets&&b.widgets.focused||d&&1<d.getRanges().length?!1:!a||!a.getName||
937
937
  !a.is(c)}};CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype={exec:function(a){if(CKEDITOR.env.ie){var b=a.getSelection().getRanges()[0],c=b.getPreviousEditableNode()&&b.getPreviousEditableNode().getAscendant("a",!0)||b.getNextEditableNode()&&b.getNextEditableNode().getAscendant("a",!0),d;b.collapsed&&c&&(d=b.createBookmark(),b.selectNodeContents(c),b.select())}c=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});a.removeStyle(c);d&&(b.moveToBookmark(d),
938
938
  b.select())},refresh:function(a,b){var c=b.lastElement&&b.lastElement.getAscendant("a",!0);c&&"a"==c.getName()&&c.getAttribute("href")&&c.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]",editorFocus:1};CKEDITOR.removeAnchorCommand=function(){};CKEDITOR.removeAnchorCommand.prototype={exec:function(a){var b=a.getSelection(),c=b.createBookmarks(),d;if(b&&(d=b.getSelectedElement())&&(d.getChildCount()?
939
939
  d.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,d)))d.remove(1);else if(d=CKEDITOR.plugins.link.getSelectedLink(a))d.hasAttribute("href")?(d.removeAttributes({name:1,"data-cke-saved-name":1}),d.removeClass("cke_anchor")):d.remove(1);b.selectBookmarks(c)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0,linkDefaultProtocol:"http://"})})();(function(){function a(a,b,c,d){for(var e=CKEDITOR.plugins.list.listToArray(b.root,c),f=[],h=
940
940
  0;h<b.contents.length;h++){var g=b.contents[h];(g=g.getAscendant("li",!0))&&!g.getCustomData("list_item_processed")&&(f.push(g),CKEDITOR.dom.element.setMarker(c,g,"list_item_processed",!0))}for(var g=b.root.getDocument(),k,l,h=0;h<f.length;h++){var m=f[h].getCustomData("listarray_index");k=e[m].parent;k.is(this.type)||(l=g.createElement(this.type),k.copyAttributes(l,{start:1,type:1}),l.removeStyle("list-style-type"),e[m].parent=l)}c=CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode);for(var n,
941
941
  e=c.listNode.getChildCount(),h=0;h<e&&(n=c.listNode.getChild(h));h++)n.getName()==this.type&&d.push(n);c.listNode.replace(b.root);a.fire("contentDomInvalidated")}function l(a,b,c){var d=b.contents,e=b.root.getDocument(),f=[];if(1==d.length&&d[0].equals(b.root)){var h=e.createElement("div");d[0].moveChildren&&d[0].moveChildren(h);d[0].append(h);d[0]=h}b=b.contents[0].getParent();for(h=0;h<d.length;h++)b=b.getCommonAncestor(d[h].getParent());a=a.config.useComputedState;var g,k;a=void 0===a||a;for(h=
942
- 0;h<d.length;h++)for(var l=d[h],m;m=l.getParent();){if(m.equals(b)){f.push(l);!k&&l.getDirection()&&(k=1);l=l.getDirection(a);null!==g&&(g=g&&g!=l?null:l);break}l=m}if(!(1>f.length)){d=f[f.length-1].getNext();h=e.createElement(this.type);for(c.push(h);f.length;)c=f.shift(),a=e.createElement("li"),l=c,l.is("pre")||p.test(l.getName())||"false"==l.getAttribute("contenteditable")?c.appendTo(a):(c.copyAttributes(a),g&&c.getDirection()&&(a.removeStyle("direction"),a.removeAttribute("dir")),c.moveChildren(a),
942
+ 0;h<d.length;h++)for(var l=d[h],m;m=l.getParent();){if(m.equals(b)){f.push(l);!k&&l.getDirection()&&(k=1);l=l.getDirection(a);null!==g&&(g=g&&g!=l?null:l);break}l=m}if(!(1>f.length)){d=f[f.length-1].getNext();h=e.createElement(this.type);for(c.push(h);f.length;)c=f.shift(),a=e.createElement("li"),l=c,l.is("pre")||v.test(l.getName())||"false"==l.getAttribute("contenteditable")?c.appendTo(a):(c.copyAttributes(a),g&&c.getDirection()&&(a.removeStyle("direction"),a.removeAttribute("dir")),c.moveChildren(a),
943
943
  c.remove()),a.appendTo(h);g&&k&&h.setAttribute("dir",g);d?h.insertBefore(d):h.appendTo(b)}}function g(a,b,c){function d(c){if(!(!(l=k[c?"getFirst":"getLast"]())||l.is&&l.isBlockBoundary()||!(m=b.root[c?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||m.is&&m.isBlockBoundary({br:1})))a.document.createElement("br")[c?"insertBefore":"insertAfter"](l)}for(var e=CKEDITOR.plugins.list.listToArray(b.root,c),f=[],h=0;h<b.contents.length;h++){var g=b.contents[h];(g=g.getAscendant("li",!0))&&!g.getCustomData("list_item_processed")&&
944
944
  (f.push(g),CKEDITOR.dom.element.setMarker(c,g,"list_item_processed",!0))}g=null;for(h=0;h<f.length;h++)g=f[h].getCustomData("listarray_index"),e[g].indent=-1;for(h=g+1;h<e.length;h++)if(e[h].indent>e[h-1].indent+1){f=e[h-1].indent+1-e[h].indent;for(g=e[h].indent;e[h]&&e[h].indent>=g;)e[h].indent+=f,h++;h--}var k=CKEDITOR.plugins.list.arrayToList(e,c,null,a.config.enterMode,b.root.getAttribute("dir")).listNode,l,m;d(!0);d();k.replace(b.root);a.fire("contentDomInvalidated")}function f(a,b){this.name=
945
- a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function e(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](t);)(f=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",f),e.remove(),c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d),c=e}function m(a){function b(c){var d=a[c?"getPrevious":"getNext"](r);d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is(a.getName())&&(e(a,d,null,!c),a.remove(),a=d)}b();b(1)}function h(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in
946
- CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function k(a,b,d){a.fire("saveSnapshot");d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=d.extractContents();b.trim(!1,!0);var h=b.createBookmark(),g=new CKEDITOR.dom.elementPath(b.startContainer),k=g.block,g=g.lastElement.getAscendant("li",1)||k,l=new CKEDITOR.dom.elementPath(d.startContainer),n=l.contains(CKEDITOR.dtd.$listItem),l=l.contains(CKEDITOR.dtd.$list);k?(k=k.getBogus())&&k.remove():l&&(k=l.getPrevious(r))&&
947
- u(k)&&k.remove();(k=f.getLast())&&k.type==CKEDITOR.NODE_ELEMENT&&k.is("br")&&k.remove();(k=b.startContainer.getChild(b.startOffset))?f.insertBefore(k):b.startContainer.append(f);n&&(f=c(n))&&(g.contains(n)?(e(f,n.getParent(),n),f.remove()):g.append(f));for(;d.checkStartOfBlock()&&d.checkEndOfBlock();){l=d.startPath();f=l.block;if(!f)break;f.is("li")&&(g=f.getParent(),f.equals(g.getLast(r))&&f.equals(g.getFirst(r))&&(f=g));d.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}d=d.clone();f=
948
- a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return r(a)&&!u(a)};(d=d.next())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in CKEDITOR.dtd.$list&&m(d);b.moveToBookmark(h);b.select();a.fire("saveSnapshot")}function c(a){return(a=a.getLast(r))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in d?a:null}var d={ol:1,ul:1},b=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(),r=function(a){return!(b(a)||n(a))},u=CKEDITOR.dom.walker.bogus();
945
+ a;this.context=this.type=b;this.allowedContent=b+" li";this.requiredContent=b}function e(a,b,c,d){for(var e,f;e=a[d?"getLast":"getFirst"](r);)(f=e.getDirection(1))!==b.getDirection(1)&&e.setAttribute("dir",f),e.remove(),c?e[d?"insertBefore":"insertAfter"](c):b.append(e,d),c=e}function m(a){function b(c){var d=a[c?"getPrevious":"getNext"](p);d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is(a.getName())&&(e(a,d,null,!c),a.remove(),a=d)}b();b(1)}function h(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in
946
+ CKEDITOR.dtd.$block||a.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[a.getName()]["#"]}function k(a,b,d){a.fire("saveSnapshot");d.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var f=d.extractContents();b.trim(!1,!0);var h=b.createBookmark(),g=new CKEDITOR.dom.elementPath(b.startContainer),k=g.block,g=g.lastElement.getAscendant("li",1)||k,l=new CKEDITOR.dom.elementPath(d.startContainer),n=l.contains(CKEDITOR.dtd.$listItem),l=l.contains(CKEDITOR.dtd.$list);k?(k=k.getBogus())&&k.remove():l&&(k=l.getPrevious(p))&&
947
+ q(k)&&k.remove();(k=f.getLast())&&k.type==CKEDITOR.NODE_ELEMENT&&k.is("br")&&k.remove();(k=b.startContainer.getChild(b.startOffset))?f.insertBefore(k):b.startContainer.append(f);n&&(f=c(n))&&(g.contains(n)?(e(f,n.getParent(),n),f.remove()):g.append(f));for(;d.checkStartOfBlock()&&d.checkEndOfBlock();){l=d.startPath();f=l.block;if(!f)break;f.is("li")&&(g=f.getParent(),f.equals(g.getLast(p))&&f.equals(g.getFirst(p))&&(f=g));d.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove()}d=d.clone();f=
948
+ a.editable();d.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=function(a){return p(a)&&!q(a)};(d=d.next())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in CKEDITOR.dtd.$list&&m(d);b.moveToBookmark(h);b.select();a.fire("saveSnapshot")}function c(a){return(a=a.getLast(p))&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in d?a:null}var d={ol:1,ul:1},b=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(),p=function(a){return!(b(a)||n(a))},q=CKEDITOR.dom.walker.bogus();
949
949
  CKEDITOR.plugins.list={listToArray:function(a,b,c,e,f){if(!d[a.getName()])return[];e||(e=0);c||(c=[]);for(var h=0,g=a.getChildCount();h<g;h++){var k=a.getChild(h);k.type==CKEDITOR.NODE_ELEMENT&&k.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(k,b,c,e+1);if("li"==k.$.nodeName.toLowerCase()){var l={parent:a,indent:e,element:k,contents:[]};f?l.grandparent=f:(l.grandparent=a.getParent(),l.grandparent&&"li"==l.grandparent.$.nodeName.toLowerCase()&&(l.grandparent=l.grandparent.getParent()));
950
- b&&CKEDITOR.dom.element.setMarker(b,k,"listarray_index",c.length);c.push(l);for(var m=0,n=k.getChildCount(),t;m<n;m++)t=k.getChild(m),t.type==CKEDITOR.NODE_ELEMENT&&d[t.getName()]?CKEDITOR.plugins.list.listToArray(t,b,c,e+1,l.grandparent):l.contents.push(t)}}return c},arrayToList:function(a,b,c,e,f){c||(c=0);if(!a||a.length<c+1)return null;for(var h,g=a[c].parent.getDocument(),k=new CKEDITOR.dom.documentFragment(g),l=null,m=c,t=Math.max(a[c].indent,0),u=null,p,E,M=e==CKEDITOR.ENTER_P?"p":"div";;){var I=
951
- a[m];h=I.grandparent;p=I.element.getDirection(1);if(I.indent==t){l&&a[m].parent.getName()==l.getName()||(l=a[m].parent.clone(!1,1),f&&l.setAttribute("dir",f),k.append(l));u=l.append(I.element.clone(0,1));p!=l.getDirection(1)&&u.setAttribute("dir",p);for(h=0;h<I.contents.length;h++)u.append(I.contents[h].clone(1,1));m++}else if(I.indent==Math.max(t,0)+1)I=a[m-1].element.getDirection(1),m=CKEDITOR.plugins.list.arrayToList(a,null,m,e,I!=p?p:null),!u.getChildCount()&&CKEDITOR.env.needsNbspFiller&&7>=
952
- g.$.documentMode&&u.append(g.createText(" ")),u.append(m.listNode),m=m.nextIndex;else if(-1==I.indent&&!c&&h){d[h.getName()]?(u=I.element.clone(!1,!0),p!=h.getDirection(1)&&u.setAttribute("dir",p)):u=new CKEDITOR.dom.documentFragment(g);var l=h.getDirection(1)!=p,J=I.element,F=J.getAttribute("class"),L=J.getAttribute("style"),P=u.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(e!=CKEDITOR.ENTER_BR||l||L||F),N,Y=I.contents.length,S;for(h=0;h<Y;h++)if(N=I.contents[h],n(N)&&1<Y)P?S=N.clone(1,1):u.append(N.clone(1,
953
- 1));else if(N.type==CKEDITOR.NODE_ELEMENT&&N.isBlockBoundary()){l&&!N.getDirection()&&N.setAttribute("dir",p);E=N;var Z=J.getAttribute("style");Z&&E.setAttribute("style",Z.replace(/([^;])$/,"$1;")+(E.getAttribute("style")||""));F&&N.addClass(F);E=null;S&&(u.append(S),S=null);u.append(N.clone(1,1))}else P?(E||(E=g.createElement(M),u.append(E),l&&E.setAttribute("dir",p)),L&&E.setAttribute("style",L),F&&E.setAttribute("class",F),S&&(E.append(S),S=null),E.append(N.clone(1,1))):u.append(N.clone(1,1));
954
- S&&((E||u).append(S),S=null);u.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&m!=a.length-1&&(CKEDITOR.env.needsBrFiller&&(p=u.getLast())&&p.type==CKEDITOR.NODE_ELEMENT&&p.is("br")&&p.remove(),(p=u.getLast(r))&&p.type==CKEDITOR.NODE_ELEMENT&&p.is(CKEDITOR.dtd.$block)||u.append(g.createElement("br")));p=u.$.nodeName.toLowerCase();"div"!=p&&"p"!=p||u.appendBogus();k.append(u);l=null;m++}else return null;E=null;if(a.length<=m||Math.max(a[m].indent,0)<t)break}if(b)for(a=k.getFirst();a;){if(a.type==CKEDITOR.NODE_ELEMENT&&
955
- (CKEDITOR.dom.element.clearMarkers(b,a),a.getName()in CKEDITOR.dtd.$listItem&&(c=a,g=f=e=void 0,e=c.getDirection()))){for(f=c.getParent();f&&!(g=f.getDirection());)f=f.getParent();e==g&&c.removeAttribute("dir")}a=a.getNextSourceNode()}return{listNode:k,nextIndex:m}}};var p=/^h[1-6]$/,t=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);f.prototype={exec:function(b){function c(a){return d[a.root.getName()]&&!e(a.root,[CKEDITOR.NODE_COMMENT])}function e(a,b){return CKEDITOR.tools.array.filter(a.getChildren().toArray(),
956
- function(a){return-1===CKEDITOR.tools.array.indexOf(b,a.type)}).length}function f(a){var b=!0;if(0===a.getChildCount())return!1;a.forEach(function(a){if(a.type!==CKEDITOR.NODE_COMMENT)return b=!1},null,!0);return b}this.refresh(b,b.elementPath());var h=b.config,k=b.getSelection(),n=k&&k.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var t=b.editable();if(t.getFirst(r)){var B=1==n.length&&n[0];(h=B&&B.getEnclosedNode())&&h.is&&this.type==h.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else h.enterMode==
957
- CKEDITOR.ENTER_BR?t.appendBogus():n[0].fixBlock(1,h.enterMode==CKEDITOR.ENTER_P?"p":"div"),k.selectRanges(n)}for(var h=k.createBookmarks(!0),t=[],C={},n=n.createIterator(),u=0;(B=n.getNextRange())&&++u;){var p=B.getBoundaryNodes(),H=p.startNode,E=p.endNode;H.type==CKEDITOR.NODE_ELEMENT&&"td"==H.getName()&&B.setStartAt(p.startNode,CKEDITOR.POSITION_AFTER_START);E.type==CKEDITOR.NODE_ELEMENT&&"td"==E.getName()&&B.setEndAt(p.endNode,CKEDITOR.POSITION_BEFORE_END);B=B.createIterator();for(B.forceBrBreak=
958
- this.state==CKEDITOR.TRISTATE_OFF;p=B.getNextParagraph();)if(!p.getCustomData("list_block")&&!f(p)){CKEDITOR.dom.element.setMarker(C,p,"list_block",1);for(var M=b.elementPath(p),H=M.elements,E=0,M=M.blockLimit,I,J=H.length-1;0<=J&&(I=H[J]);J--)if(d[I.getName()]&&M.contains(I)){M.removeCustomData("list_group_object_"+u);(H=I.getCustomData("list_group_object"))?H.contents.push(p):(H={root:I,contents:[p]},t.push(H),CKEDITOR.dom.element.setMarker(C,I,"list_group_object",H));E=1;break}E||(E=M,E.getCustomData("list_group_object_"+
959
- u)?E.getCustomData("list_group_object_"+u).contents.push(p):(H={root:E,contents:[p]},CKEDITOR.dom.element.setMarker(C,E,"list_group_object_"+u,H),t.push(H)))}}for(I=[];0<t.length;)H=t.shift(),this.state==CKEDITOR.TRISTATE_OFF?c(H)||(d[H.root.getName()]?a.call(this,b,H,C,I):l.call(this,b,H,I)):this.state==CKEDITOR.TRISTATE_ON&&d[H.root.getName()]&&!c(H)&&g.call(this,b,H,C);for(J=0;J<I.length;J++)m(I[J]);CKEDITOR.dom.element.clearAllMarkers(C);k.selectBookmarks(h);b.focus()},refresh:function(a,b){var c=
950
+ b&&CKEDITOR.dom.element.setMarker(b,k,"listarray_index",c.length);c.push(l);for(var m=0,n=k.getChildCount(),r;m<n;m++)r=k.getChild(m),r.type==CKEDITOR.NODE_ELEMENT&&d[r.getName()]?CKEDITOR.plugins.list.listToArray(r,b,c,e+1,l.grandparent):l.contents.push(r)}}return c},arrayToList:function(a,b,c,e,f){c||(c=0);if(!a||a.length<c+1)return null;for(var h,g=a[c].parent.getDocument(),k=new CKEDITOR.dom.documentFragment(g),l=null,m=c,r=Math.max(a[c].indent,0),q=null,v,E,M=e==CKEDITOR.ENTER_P?"p":"div";;){var I=
951
+ a[m];h=I.grandparent;v=I.element.getDirection(1);if(I.indent==r){l&&a[m].parent.getName()==l.getName()||(l=a[m].parent.clone(!1,1),f&&l.setAttribute("dir",f),k.append(l));q=l.append(I.element.clone(0,1));v!=l.getDirection(1)&&q.setAttribute("dir",v);for(h=0;h<I.contents.length;h++)q.append(I.contents[h].clone(1,1));m++}else if(I.indent==Math.max(r,0)+1)I=a[m-1].element.getDirection(1),m=CKEDITOR.plugins.list.arrayToList(a,null,m,e,I!=v?v:null),!q.getChildCount()&&CKEDITOR.env.needsNbspFiller&&7>=
952
+ g.$.documentMode&&q.append(g.createText(" ")),q.append(m.listNode),m=m.nextIndex;else if(-1==I.indent&&!c&&h){d[h.getName()]?(q=I.element.clone(!1,!0),v!=h.getDirection(1)&&q.setAttribute("dir",v)):q=new CKEDITOR.dom.documentFragment(g);var l=h.getDirection(1)!=v,J=I.element,F=J.getAttribute("class"),L=J.getAttribute("style"),P=q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(e!=CKEDITOR.ENTER_BR||l||L||F),N,Y=I.contents.length,S;for(h=0;h<Y;h++)if(N=I.contents[h],n(N)&&1<Y)P?S=N.clone(1,1):q.append(N.clone(1,
953
+ 1));else if(N.type==CKEDITOR.NODE_ELEMENT&&N.isBlockBoundary()){l&&!N.getDirection()&&N.setAttribute("dir",v);E=N;var Z=J.getAttribute("style");Z&&E.setAttribute("style",Z.replace(/([^;])$/,"$1;")+(E.getAttribute("style")||""));F&&N.addClass(F);E=null;S&&(q.append(S),S=null);q.append(N.clone(1,1))}else P?(E||(E=g.createElement(M),q.append(E),l&&E.setAttribute("dir",v)),L&&E.setAttribute("style",L),F&&E.setAttribute("class",F),S&&(E.append(S),S=null),E.append(N.clone(1,1))):q.append(N.clone(1,1));
954
+ S&&((E||q).append(S),S=null);q.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&m!=a.length-1&&(CKEDITOR.env.needsBrFiller&&(v=q.getLast())&&v.type==CKEDITOR.NODE_ELEMENT&&v.is("br")&&v.remove(),(v=q.getLast(p))&&v.type==CKEDITOR.NODE_ELEMENT&&v.is(CKEDITOR.dtd.$block)||q.append(g.createElement("br")));v=q.$.nodeName.toLowerCase();"div"!=v&&"p"!=v||q.appendBogus();k.append(q);l=null;m++}else return null;E=null;if(a.length<=m||Math.max(a[m].indent,0)<r)break}if(b)for(a=k.getFirst();a;){if(a.type==CKEDITOR.NODE_ELEMENT&&
955
+ (CKEDITOR.dom.element.clearMarkers(b,a),a.getName()in CKEDITOR.dtd.$listItem&&(c=a,g=f=e=void 0,e=c.getDirection()))){for(f=c.getParent();f&&!(g=f.getDirection());)f=f.getParent();e==g&&c.removeAttribute("dir")}a=a.getNextSourceNode()}return{listNode:k,nextIndex:m}}};var v=/^h[1-6]$/,r=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);f.prototype={exec:function(b){function c(a){return d[a.root.getName()]&&!e(a.root,[CKEDITOR.NODE_COMMENT])}function e(a,b){return CKEDITOR.tools.array.filter(a.getChildren().toArray(),
956
+ function(a){return-1===CKEDITOR.tools.array.indexOf(b,a.type)}).length}function f(a){var b=!0;if(0===a.getChildCount())return!1;a.forEach(function(a){if(a.type!==CKEDITOR.NODE_COMMENT)return b=!1},null,!0);return b}this.refresh(b,b.elementPath());var h=b.config,k=b.getSelection(),u=k&&k.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var n=b.editable();if(n.getFirst(p)){var r=1==u.length&&u[0];(h=r&&r.getEnclosedNode())&&h.is&&this.type==h.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else h.enterMode==
957
+ CKEDITOR.ENTER_BR?n.appendBogus():u[0].fixBlock(1,h.enterMode==CKEDITOR.ENTER_P?"p":"div"),k.selectRanges(u)}for(var h=k.createBookmarks(!0),n=[],A={},u=u.createIterator(),q=0;(r=u.getNextRange())&&++q;){var v=r.getBoundaryNodes(),H=v.startNode,E=v.endNode;H.type==CKEDITOR.NODE_ELEMENT&&"td"==H.getName()&&r.setStartAt(v.startNode,CKEDITOR.POSITION_AFTER_START);E.type==CKEDITOR.NODE_ELEMENT&&"td"==E.getName()&&r.setEndAt(v.endNode,CKEDITOR.POSITION_BEFORE_END);r=r.createIterator();for(r.forceBrBreak=
958
+ this.state==CKEDITOR.TRISTATE_OFF;v=r.getNextParagraph();)if(!v.getCustomData("list_block")&&!f(v)){CKEDITOR.dom.element.setMarker(A,v,"list_block",1);for(var M=b.elementPath(v),H=M.elements,E=0,M=M.blockLimit,I,J=H.length-1;0<=J&&(I=H[J]);J--)if(d[I.getName()]&&M.contains(I)){M.removeCustomData("list_group_object_"+q);(H=I.getCustomData("list_group_object"))?H.contents.push(v):(H={root:I,contents:[v]},n.push(H),CKEDITOR.dom.element.setMarker(A,I,"list_group_object",H));E=1;break}E||(E=M,E.getCustomData("list_group_object_"+
959
+ q)?E.getCustomData("list_group_object_"+q).contents.push(v):(H={root:E,contents:[v]},CKEDITOR.dom.element.setMarker(A,E,"list_group_object_"+q,H),n.push(H)))}}for(I=[];0<n.length;)H=n.shift(),this.state==CKEDITOR.TRISTATE_OFF?c(H)||(d[H.root.getName()]?a.call(this,b,H,A,I):l.call(this,b,H,I)):this.state==CKEDITOR.TRISTATE_ON&&d[H.root.getName()]&&!c(H)&&g.call(this,b,H,A);for(J=0;J<I.length;J++)m(I[J]);CKEDITOR.dom.element.clearAllMarkers(A);k.selectBookmarks(h);b.focus()},refresh:function(a,b){var c=
960
960
  b.contains(d,1),e=b.blockLimit||b.root;c&&e.contains(c)?this.setState(c.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(a){a.blockless||(a.addCommand("numberedlist",new f("numberedlist","ol")),a.addCommand("bulletedlist",new f("bulletedlist","ul")),a.ui.addButton&&(a.ui.addButton("NumberedList",{label:a.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),a.ui.addButton("BulletedList",
961
- {label:a.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),a.on("key",function(b){var e=b.data.domEvent.getKey(),f;if("wysiwyg"==a.mode&&e in{8:1,46:1}){var g=a.getSelection().getRanges()[0],l=g&&g.startPath();if(g&&g.collapsed){var m=8==e,n=a.editable(),t=new CKEDITOR.dom.walker(g.clone());t.evaluator=function(a){return r(a)&&!u(a)};t.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=g.clone();if(m){var C;(C=l.contains(d))&&g.checkBoundaryOfElement(C,
962
- CKEDITOR.START)&&(C=C.getParent())&&C.is("li")&&(C=c(C))?(f=C,C=C.getPrevious(r),e.moveToPosition(C&&u(C)?C:f,CKEDITOR.POSITION_BEFORE_START)):(t.range.setStartAt(n,CKEDITOR.POSITION_AFTER_START),t.range.setEnd(g.startContainer,g.startOffset),(C=t.previous())&&C.type==CKEDITOR.NODE_ELEMENT&&(C.getName()in d||C.is("li"))&&(C.is("li")||(t.range.selectNodeContents(C),t.reset(),t.evaluator=h,C=t.previous()),f=C,e.moveToElementEditEnd(f),e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END)));
963
- if(f)k(a,e,g),b.cancel();else{var p=l.contains(d);p&&g.checkBoundaryOfElement(p,CKEDITOR.START)&&(f=p.getFirst(r),g.checkBoundaryOfElement(f,CKEDITOR.START)&&(C=p.getPrevious(r),c(f)?C&&(g.moveToElementEditEnd(C),g.select()):a.execCommand("outdent"),b.cancel()))}}else if(f=l.contains("li")){if(t.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),m=(n=f.getLast(r))&&h(n)?n:f,l=0,(C=t.next())&&C.type==CKEDITOR.NODE_ELEMENT&&C.getName()in d&&C.equals(n)?(l=1,C=t.next()):g.checkBoundaryOfElement(m,CKEDITOR.END)&&
964
- (l=2),l&&C){g=g.clone();g.moveToElementEditStart(C);if(1==l&&(e.optimize(),!e.startContainer.equals(f))){for(f=e.startContainer;f.is(CKEDITOR.dtd.$inline);)p=f,f=f.getParent();p&&e.moveToPosition(p,CKEDITOR.POSITION_AFTER_END)}2==l&&(e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END),g.endPath().block&&g.moveToPosition(g.endPath().block,CKEDITOR.POSITION_AFTER_START));k(a,e,g);b.cancel()}}else t.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(C=t.next())&&C.type==CKEDITOR.NODE_ELEMENT&&
965
- C.is(d)&&(C=C.getFirst(r),l.block&&g.checkStartOfBlock()&&g.checkEndOfBlock()?(l.block.remove(),g.moveToElementEditStart(C),g.select()):c(C)?(g.moveToElementEditStart(C),g.select()):(g=g.clone(),g.moveToElementEditStart(C),k(a,e,g)),b.cancel());setTimeout(function(){a.selectionChange(1)})}}}))}})})();(function(){CKEDITOR.plugins.liststyle={requires:"dialog,contextmenu",init:function(a){if(!a.blockless){var l;l=new CKEDITOR.dialogCommand("numberedListStyle",{requiredContent:"ol",allowedContent:"ol{list-style-type}[start]; li{list-style-type}[value]",
961
+ {label:a.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),a.on("key",function(b){var e=b.data.domEvent.getKey(),f;if("wysiwyg"==a.mode&&e in{8:1,46:1}){var g=a.getSelection().getRanges()[0],l=g&&g.startPath();if(g&&g.collapsed){var m=8==e,n=a.editable(),r=new CKEDITOR.dom.walker(g.clone());r.evaluator=function(a){return p(a)&&!q(a)};r.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=g.clone();if(m){var A;(A=l.contains(d))&&g.checkBoundaryOfElement(A,
962
+ CKEDITOR.START)&&(A=A.getParent())&&A.is("li")&&(A=c(A))?(f=A,A=A.getPrevious(p),e.moveToPosition(A&&q(A)?A:f,CKEDITOR.POSITION_BEFORE_START)):(r.range.setStartAt(n,CKEDITOR.POSITION_AFTER_START),r.range.setEnd(g.startContainer,g.startOffset),(A=r.previous())&&A.type==CKEDITOR.NODE_ELEMENT&&(A.getName()in d||A.is("li"))&&(A.is("li")||(r.range.selectNodeContents(A),r.reset(),r.evaluator=h,A=r.previous()),f=A,e.moveToElementEditEnd(f),e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END)));
963
+ if(f)k(a,e,g),b.cancel();else{var v=l.contains(d);v&&g.checkBoundaryOfElement(v,CKEDITOR.START)&&(f=v.getFirst(p),g.checkBoundaryOfElement(f,CKEDITOR.START)&&(A=v.getPrevious(p),c(f)?A&&(g.moveToElementEditEnd(A),g.select()):a.execCommand("outdent"),b.cancel()))}}else if(f=l.contains("li")){if(r.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),m=(n=f.getLast(p))&&h(n)?n:f,l=0,(A=r.next())&&A.type==CKEDITOR.NODE_ELEMENT&&A.getName()in d&&A.equals(n)?(l=1,A=r.next()):g.checkBoundaryOfElement(m,CKEDITOR.END)&&
964
+ (l=2),l&&A){g=g.clone();g.moveToElementEditStart(A);if(1==l&&(e.optimize(),!e.startContainer.equals(f))){for(f=e.startContainer;f.is(CKEDITOR.dtd.$inline);)v=f,f=f.getParent();v&&e.moveToPosition(v,CKEDITOR.POSITION_AFTER_END)}2==l&&(e.moveToPosition(e.endPath().block,CKEDITOR.POSITION_BEFORE_END),g.endPath().block&&g.moveToPosition(g.endPath().block,CKEDITOR.POSITION_AFTER_START));k(a,e,g);b.cancel()}}else r.range.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(A=r.next())&&A.type==CKEDITOR.NODE_ELEMENT&&
965
+ A.is(d)&&(A=A.getFirst(p),l.block&&g.checkStartOfBlock()&&g.checkEndOfBlock()?(l.block.remove(),g.moveToElementEditStart(A),g.select()):c(A)?(g.moveToElementEditStart(A),g.select()):(g=g.clone(),g.moveToElementEditStart(A),k(a,e,g)),b.cancel());setTimeout(function(){a.selectionChange(1)})}}}))}})})();(function(){CKEDITOR.plugins.liststyle={requires:"dialog,contextmenu",init:function(a){if(!a.blockless){var l;l=new CKEDITOR.dialogCommand("numberedListStyle",{requiredContent:"ol",allowedContent:"ol{list-style-type}[start]; li{list-style-type}[value]",
966
966
  contentTransformations:[["ol: listTypeToStyle"]]});l=a.addCommand("numberedListStyle",l);a.addFeature(l);CKEDITOR.dialog.add("numberedListStyle",this.path+"dialogs/liststyle.js");l=new CKEDITOR.dialogCommand("bulletedListStyle",{requiredContent:"ul",allowedContent:"ul{list-style-type}",contentTransformations:[["ul: listTypeToStyle"]]});l=a.addCommand("bulletedListStyle",l);a.addFeature(l);CKEDITOR.dialog.add("bulletedListStyle",this.path+"dialogs/liststyle.js");a.addMenuGroup("list",108);a.addMenuItems({numberedlist:{label:a.lang.liststyle.numberedTitle,
967
967
  group:"list",command:"numberedListStyle"},bulletedlist:{label:a.lang.liststyle.bulletedTitle,group:"list",command:"bulletedListStyle"}});a.contextMenu.addListener(function(a){if(!a||a.isReadOnly())return null;for(;a;){var f=a.getName();if("ol"==f)return{numberedlist:CKEDITOR.TRISTATE_OFF};if("ul"==f)return{bulletedlist:CKEDITOR.TRISTATE_OFF};a=a.getParent()}return null})}}};CKEDITOR.plugins.add("liststyle",CKEDITOR.plugins.liststyle)})();"use strict";(function(){function a(a,b,c){return n(b)&&n(c)&&
968
- c.equals(b.getNext(function(a){return!(O(a)||Q(a)||r(a))}))}function l(a){this.upper=a[0];this.lower=a[1];this.set.apply(this,a.slice(2))}function g(a){var b=a.element;if(b&&n(b)&&(b=b.getAscendant(a.triggers,!0))&&a.editable.contains(b)){var c=h(b);if("true"==c.getAttribute("contenteditable"))return b;if(c.is(a.triggers))return c}return null}function f(a,b,c){A(a,b);A(a,c);a=b.size.bottom;c=c.size.top;return a&&c?0|(a+c)/2:a||c}function e(a,c,d){return c=c[d?"getPrevious":"getNext"](function(c){return c&&
969
- c.type==CKEDITOR.NODE_TEXT&&!O(c)||n(c)&&!r(c)&&!b(a,c)})}function m(a,b,c){return a>b&&a<c}function h(a,b){if(a.data("cke-editable"))return null;for(b||(a=a.getParent());a&&!a.data("cke-editable");){if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}function k(a){var b=a.doc,d=G('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"'+ca+"position:absolute;border-top:1px dashed "+a.boxColor+'"\x3e\x3c/span\x3e',b),e=CKEDITOR.getUrl(this.path+"images/"+(K.hidpi?
970
- "hidpi/":"")+"icon"+(a.rtl?"-rtl":"")+".png");B(d,{attach:function(){this.wrap.getParent()||this.wrap.appendTo(a.editable,!0);return this},lineChildren:[B(G('\x3cspan title\x3d"'+a.editor.lang.magicline.title+'" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e',b),{base:ca+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+e+") center no-repeat "+a.boxColor+";cursor:pointer;"+(K.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(K.hidpi?
971
- "background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),B(G(ea,b),{base:V+"left:0px;border-left-color:"+a.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px","border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),B(G(ea,b),{base:V+"right:0px;border-right-color:"+a.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px","border-width:0 8px 8px 0;top:0px"]})],
972
- detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){A(a,this);var b=a.holdDistance,c=this.size;return c&&m(a.mouse.y,c.top-b,c.bottom+b)&&m(a.mouse.x,c.left-b,c.right+b)?!0:!1},place:function(){var b=a.view,c=a.editable,d=a.trigger,e=d.upper,f=d.lower,h=e||f,g=h.getParent(),k={};this.trigger=d;e&&A(a,e,!0);f&&A(a,f,!0);A(a,g,!0);a.inInlineMode&&w(a,!0);g.equals(c)?(k.left=b.scroll.x,k.right=-b.scroll.x,k.width=""):(k.left=h.size.left-h.size.margin.left+b.scroll.x-
968
+ c.equals(b.getNext(function(a){return!(O(a)||Q(a)||p(a))}))}function l(a){this.upper=a[0];this.lower=a[1];this.set.apply(this,a.slice(2))}function g(a){var b=a.element;if(b&&n(b)&&(b=b.getAscendant(a.triggers,!0))&&a.editable.contains(b)){var c=h(b);if("true"==c.getAttribute("contenteditable"))return b;if(c.is(a.triggers))return c}return null}function f(a,b,c){B(a,b);B(a,c);a=b.size.bottom;c=c.size.top;return a&&c?0|(a+c)/2:a||c}function e(a,c,d){return c=c[d?"getPrevious":"getNext"](function(c){return c&&
969
+ c.type==CKEDITOR.NODE_TEXT&&!O(c)||n(c)&&!p(c)&&!b(a,c)})}function m(a,b,c){return a>b&&a<c}function h(a,b){if(a.data("cke-editable"))return null;for(b||(a=a.getParent());a&&!a.data("cke-editable");){if(a.hasAttribute("contenteditable"))return a;a=a.getParent()}return null}function k(a){var b=a.doc,d=G('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"'+ca+"position:absolute;border-top:1px dashed "+a.boxColor+'"\x3e\x3c/span\x3e',b),e=CKEDITOR.getUrl(this.path+"images/"+(K.hidpi?
970
+ "hidpi/":"")+"icon"+(a.rtl?"-rtl":"")+".png");C(d,{attach:function(){this.wrap.getParent()||this.wrap.appendTo(a.editable,!0);return this},lineChildren:[C(G('\x3cspan title\x3d"'+a.editor.lang.magicline.title+'" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e',b),{base:ca+"height:17px;width:17px;"+(a.rtl?"left":"right")+":17px;background:url("+e+") center no-repeat "+a.boxColor+";cursor:pointer;"+(K.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(K.hidpi?
971
+ "background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),C(G(ea,b),{base:V+"left:0px;border-left-color:"+a.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px","border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),C(G(ea,b),{base:V+"right:0px;border-right-color:"+a.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px","border-width:0 8px 8px 0;top:0px"]})],
972
+ detach:function(){this.wrap.getParent()&&this.wrap.remove();return this},mouseNear:function(){B(a,this);var b=a.holdDistance,c=this.size;return c&&m(a.mouse.y,c.top-b,c.bottom+b)&&m(a.mouse.x,c.left-b,c.right+b)?!0:!1},place:function(){var b=a.view,c=a.editable,d=a.trigger,e=d.upper,f=d.lower,h=e||f,g=h.getParent(),k={};this.trigger=d;e&&B(a,e,!0);f&&B(a,f,!0);B(a,g,!0);a.inInlineMode&&w(a,!0);g.equals(c)?(k.left=b.scroll.x,k.right=-b.scroll.x,k.width=""):(k.left=h.size.left-h.size.margin.left+b.scroll.x-
973
973
  (a.inInlineMode?b.editable.left+b.editable.border.left:0),k.width=h.size.outerWidth+h.size.margin.left+h.size.margin.right+b.scroll.x,k.right="");e&&f?k.top=e.size.margin.bottom===f.size.margin.top?0|e.size.bottom+e.size.margin.bottom/2:e.size.margin.bottom<f.size.margin.top?e.size.bottom+e.size.margin.bottom:e.size.bottom+e.size.margin.bottom-f.size.margin.top:e?f||(k.top=e.size.bottom+e.size.margin.bottom):k.top=f.size.top-f.size.margin.top;d.is(P)||m(k.top,b.scroll.y-15,b.scroll.y+5)?(k.top=a.inInlineMode?
974
974
  0:b.scroll.y,this.look(P)):d.is(N)||m(k.top,b.pane.bottom-5,b.pane.bottom+15)?(k.top=a.inInlineMode?b.editable.height+b.editable.padding.top+b.editable.padding.bottom:b.pane.bottom-1,this.look(N)):(a.inInlineMode&&(k.top-=b.editable.top+b.editable.border.top),this.look(Y));a.inInlineMode&&(k.top--,k.top+=b.editable.scroll.top,k.left+=b.editable.scroll.left);for(var l in k)k[l]=CKEDITOR.tools.cssLength(k[l]);this.setStyles(k)},look:function(a){if(this.oldLook!=a){for(var b=this.lineChildren.length,
975
- c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new C("span",a.doc)});for(b=d.lineChildren.length;b--;)d.lineChildren[b].appendTo(d);d.look(Y);d.appendTo(d.wrap);d.unselectable();d.lineChildren[0].on("mouseup",function(b){d.detach();c(a,function(b){var c=a.line.trigger;b[c.is(I)?"insertBefore":"insertAfter"](c.is(I)?c.lower:c.upper)},!0);a.editor.focus();K.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();b.data.preventDefault(!0)});d.on("mousedown",
976
- function(a){a.data.preventDefault(!0)});a.line=d}function c(a,b,c){var d=new CKEDITOR.dom.range(a.doc),e=a.editor,f;K.ie&&a.enterMode==CKEDITOR.ENTER_BR?f=a.doc.createText(S):(f=(f=h(a.element,!0))&&f.data("cke-enter-mode")||a.enterMode,f=new C(M[f],a.doc),f.is("br")||a.doc.createText(S).appendTo(f));c&&e.fire("saveSnapshot");b(f);d.moveToPosition(f,CKEDITOR.POSITION_AFTER_START);e.getSelection().selectRanges([d]);a.hotNode=f;c&&e.fire("saveSnapshot")}function d(a,b){return{canUndo:!0,modes:{wysiwyg:1},
975
+ c;b--;)(c=this.lineChildren[b]).setAttribute("style",c.base+c.looks[0|a/2]);this.oldLook=a}},wrap:new A("span",a.doc)});for(b=d.lineChildren.length;b--;)d.lineChildren[b].appendTo(d);d.look(Y);d.appendTo(d.wrap);d.unselectable();d.lineChildren[0].on("mouseup",function(b){d.detach();c(a,function(b){var c=a.line.trigger;b[c.is(I)?"insertBefore":"insertAfter"](c.is(I)?c.lower:c.upper)},!0);a.editor.focus();K.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();b.data.preventDefault(!0)});d.on("mousedown",
976
+ function(a){a.data.preventDefault(!0)});a.line=d}function c(a,b,c){var d=new CKEDITOR.dom.range(a.doc),e=a.editor,f;K.ie&&a.enterMode==CKEDITOR.ENTER_BR?f=a.doc.createText(S):(f=(f=h(a.element,!0))&&f.data("cke-enter-mode")||a.enterMode,f=new A(M[f],a.doc),f.is("br")||a.doc.createText(S).appendTo(f));c&&e.fire("saveSnapshot");b(f);d.moveToPosition(f,CKEDITOR.POSITION_AFTER_START);e.getSelection().selectRanges([d]);a.hotNode=f;c&&e.fire("saveSnapshot")}function d(a,b){return{canUndo:!0,modes:{wysiwyg:1},
977
977
  exec:function(){function d(e){var f=K.ie&&9>K.version?" ":S,h=a.hotNode&&a.hotNode.getText()==f&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!b;c(a,function(c){h&&a.hotNode&&a.hotNode.remove();c[b?"insertAfter":"insertBefore"](e);c.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!b});a.lastCmdDirection=!!b});K.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView();a.line.detach()}return function(c){c=c.getSelection().getStartElement();var f;c=c.getAscendant(T,1);
978
- if(!t(a,c)&&c&&!c.equals(a.editable)&&!c.contains(a.editable)){(f=h(c))&&"false"==f.getAttribute("contenteditable")&&(c=f);a.element=c;f=e(a,c,!b);var k;n(f)&&f.is(a.triggers)&&f.is(W)&&(!e(a,f,!b)||(k=e(a,f,!b))&&n(k)&&k.is(a.triggers))?d(f):(k=g(a,c),n(k)&&(e(a,k,!b)?(c=e(a,k,!b))&&n(c)&&c.is(a.triggers)&&d(k):d(k)))}}}()}}function b(a,b){if(!b||b.type!=CKEDITOR.NODE_ELEMENT||!b.$)return!1;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&
979
- a.$}function r(a){if(!n(a))return!1;var b;(b=u(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function u(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function p(a,b){return n(b)?b.is(a.triggers):null}function t(a,b){if(!b)return!1;for(var c=b.getParents(1),d=c.length;d--;)for(var e=a.tabuList.length;e--;)if(c[d].hasAttribute(a.tabuList[e]))return!0;return!1}function q(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&
980
- !b.is(ha)});if(!b)return!1;A(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function y(a){var c=a.editable,d=a.mouse,e=a.view,f=a.triggerOffset;w(a);var h=d.y>(a.inInlineMode?e.editable.top+e.editable.height/2:Math.min(e.editable.height,e.pane.height)/2),c=c[h?"getLast":"getFirst"](function(a){return!(O(a)||Q(a))});if(!c)return null;b(a,c)&&(c=a.line.wrap[h?"getPrevious":"getNext"](function(a){return!(O(a)||Q(a))}));if(!n(c)||r(c)||!p(a,c))return null;A(a,c);return!h&&0<=c.size.top&&m(d.y,
981
- 0,c.size.top+f)?(a=a.inInlineMode||0===e.scroll.y?P:Y,new l([null,c,I,L,a])):h&&c.size.bottom<=e.pane.height&&m(d.y,c.size.bottom-f,e.pane.height)?(a=a.inInlineMode||m(c.size.bottom,e.pane.height-f,e.pane.height)?N:Y,new l([c,null,J,L,a])):null}function x(a){var b=a.mouse,c=a.view,d=a.triggerOffset,f=g(a);if(!f)return null;A(a,f);var d=Math.min(d,0|f.size.outerHeight/2),h=[],k,v;if(m(b.y,f.size.top-1,f.size.top+d))v=!1;else if(m(b.y,f.size.bottom-d,f.size.bottom+1))v=!0;else return null;if(r(f)||
982
- q(a,f,v)||f.getParent().is(Z))return null;var t=e(a,f,!v);if(t){if(t&&t.type==CKEDITOR.NODE_TEXT)return null;if(n(t)){if(r(t)||!p(a,t)||t.getParent().is(Z))return null;h=[t,f][v?"reverse":"concat"]().concat([F,L])}}else f.equals(a.editable[v?"getLast":"getFirst"](a.isRelevant))?(w(a),v&&m(b.y,f.size.bottom-d,c.pane.height)&&m(f.size.bottom,c.pane.height-d,c.pane.height)?k=N:m(b.y,0,f.size.top+d)&&(k=P)):k=Y,h=[null,f][v?"reverse":"concat"]().concat([v?J:I,L,k,f.equals(a.editable[v?"getLast":"getFirst"](a.isRelevant))?
983
- v?N:P:Y]);return 0 in h?new l(h):null}function z(a,b,c,d){for(var e=b.getDocumentPosition(),f={},h={},g={},k={},l=U.length;l--;)f[U[l]]=parseInt(b.getComputedStyle.call(b,"border-"+U[l]+"-width"),10)||0,g[U[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+U[l]),10)||0,h[U[l]]=parseInt(b.getComputedStyle.call(b,"margin-"+U[l]),10)||0;c&&!d||v(a,d);k.top=e.y-(c?0:a.view.scroll.y);k.left=e.x-(c?0:a.view.scroll.x);k.outerWidth=b.$.offsetWidth;k.outerHeight=b.$.offsetHeight;k.height=k.outerHeight-(g.top+
984
- g.bottom+f.top+f.bottom);k.width=k.outerWidth-(g.left+g.right+f.left+f.right);k.bottom=k.top+k.outerHeight;k.right=k.left+k.outerWidth;a.inInlineMode&&(k.scroll={top:b.$.scrollTop,left:b.$.scrollLeft});return B({border:f,padding:g,margin:h,ignoreScroll:c},k,!0)}function A(a,b,c){if(!n(b))return b.size=null;if(!b.size)b.size={};else if(b.size.ignoreScroll==c&&b.size.date>new Date-ba)return null;return B(b.size,z(a,b,c),{date:+new Date},!0)}function w(a,b){a.view.editable=z(a,a.editable,b,!0)}function v(a,
985
- b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-ba)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();B(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function D(a,b,c,d){for(var e=d,f=d,h=0,g=!1,k=!1,m=a.view.pane.height,n=a.mouse;n.y+h<m&&0<n.y-h;){g||(g=b(e,d));k||(k=b(f,d));!g&&0<n.y-h&&(e=c(a,{x:n.x,y:n.y-h}));
986
- !k&&n.y+h<m&&(f=c(a,{x:n.x,y:n.y+h}));if(g&&k)break;h+=2}return new l([e,f,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var f=a.config,h=f.magicline_triggerOffset||30,m={editor:a,enterMode:f.enterMode,triggerOffset:h,holdDistance:0|h*(f.magicline_holdDistance||.5),boxColor:f.magicline_color||"#ff0000",rtl:"rtl"==f.contentsLangDirection,tabuList:["data-cke-hidden-sel"].concat(f.magicline_tabuList||[]),triggers:f.magicline_everywhere?T:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},
987
- q,D,p;m.isRelevant=function(a){return n(a)&&!b(m,a)&&!r(a)};a.on("contentDom",function(){var h=a.editable(),n=a.document,r=a.window;B(m,{editable:h,inInlineMode:h.isInline(),doc:n,win:r,hotNode:null},!0);m.boundary=m.inInlineMode?m.editable:m.doc.getDocumentElement();h.is(E.$inline)||(m.inInlineMode&&!u(h)&&h.setStyles({position:"relative",top:null,left:null}),k.call(this,m),v(m),h.attachListener(a,"beforeUndoImage",function(){m.line.detach()}),h.attachListener(a,"beforeGetData",function(){m.line.wrap.getParent()&&
988
- (m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),h.attachListener(m.inInlineMode?n:n.getWindow().getFrame(),"mouseout",function(b){if("wysiwyg"==a.mode)if(m.inInlineMode){var c=b.data.$.clientX;b=b.data.$.clientY;v(m);w(m,!0);var d=m.view.editable,e=m.view.scroll;c>d.left-e.x&&c<d.right-e.x&&b>d.top-e.y&&b<d.bottom-e.y||(clearTimeout(p),p=null,m.line.detach())}else clearTimeout(p),p=null,m.line.detach()}),h.attachListener(h,"keyup",function(){m.hiddenMode=
989
- 0}),h.attachListener(h,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),h.attachListener(m.inInlineMode?h:n,"mousemove",function(b){D=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!p){var c={x:b.data.$.clientX,y:b.data.$.clientY};p=setTimeout(function(){m.mouse=c;p=m.trigger=null;v(m);D&&!m.hiddenMode&&a.focusManager.hasFocus&&!m.line.mouseNear()&&(m.element=X(m,!0))&&((m.trigger=y(m)||x(m)||R(m))&&!t(m,m.trigger.upper||m.trigger.lower)?
990
- m.line.attach().place():(m.trigger=null,m.line.detach()),D=!1)},30)}}),h.attachListener(r,"scroll",function(){"wysiwyg"==a.mode&&(m.line.detach(),K.webkit&&(m.hiddenMode=1,clearTimeout(q),q=setTimeout(function(){m.mouseDown||(m.hiddenMode=0)},50)))}),h.attachListener(H?n:r,"mousedown",function(){"wysiwyg"==a.mode&&(m.line.detach(),m.hiddenMode=1,m.mouseDown=1)}),h.attachListener(H?n:r,"mouseup",function(){m.hiddenMode=0;m.mouseDown=0}),a.addCommand("accessPreviousSpace",d(m)),a.addCommand("accessNextSpace",
978
+ if(!r(a,c)&&c&&!c.equals(a.editable)&&!c.contains(a.editable)){(f=h(c))&&"false"==f.getAttribute("contenteditable")&&(c=f);a.element=c;f=e(a,c,!b);var k;n(f)&&f.is(a.triggers)&&f.is(W)&&(!e(a,f,!b)||(k=e(a,f,!b))&&n(k)&&k.is(a.triggers))?d(f):(k=g(a,c),n(k)&&(e(a,k,!b)?(c=e(a,k,!b))&&n(c)&&c.is(a.triggers)&&d(k):d(k)))}}}()}}function b(a,b){if(!b||b.type!=CKEDITOR.NODE_ELEMENT||!b.$)return!1;var c=a.line;return c.wrap.equals(b)||c.wrap.contains(b)}function n(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&
979
+ a.$}function p(a){if(!n(a))return!1;var b;(b=q(a))||(n(a)?(b={left:1,right:1,center:1},b=!(!b[a.getComputedStyle("float")]&&!b[a.getAttribute("align")])):b=!1);return b}function q(a){return!!{absolute:1,fixed:1}[a.getComputedStyle("position")]}function v(a,b){return n(b)?b.is(a.triggers):null}function r(a,b){if(!b)return!1;for(var c=b.getParents(1),d=c.length;d--;)for(var e=a.tabuList.length;e--;)if(c[d].hasAttribute(a.tabuList[e]))return!0;return!1}function t(a,b,c){b=b[c?"getLast":"getFirst"](function(b){return a.isRelevant(b)&&
980
+ !b.is(ha)});if(!b)return!1;B(a,b);return c?b.size.top>a.mouse.y:b.size.bottom<a.mouse.y}function y(a){var c=a.editable,d=a.mouse,e=a.view,f=a.triggerOffset;w(a);var h=d.y>(a.inInlineMode?e.editable.top+e.editable.height/2:Math.min(e.editable.height,e.pane.height)/2),c=c[h?"getLast":"getFirst"](function(a){return!(O(a)||Q(a))});if(!c)return null;b(a,c)&&(c=a.line.wrap[h?"getPrevious":"getNext"](function(a){return!(O(a)||Q(a))}));if(!n(c)||p(c)||!v(a,c))return null;B(a,c);return!h&&0<=c.size.top&&m(d.y,
981
+ 0,c.size.top+f)?(a=a.inInlineMode||0===e.scroll.y?P:Y,new l([null,c,I,L,a])):h&&c.size.bottom<=e.pane.height&&m(d.y,c.size.bottom-f,e.pane.height)?(a=a.inInlineMode||m(c.size.bottom,e.pane.height-f,e.pane.height)?N:Y,new l([c,null,J,L,a])):null}function x(a){var b=a.mouse,c=a.view,d=a.triggerOffset,f=g(a);if(!f)return null;B(a,f);var d=Math.min(d,0|f.size.outerHeight/2),h=[],k,u;if(m(b.y,f.size.top-1,f.size.top+d))u=!1;else if(m(b.y,f.size.bottom-d,f.size.bottom+1))u=!0;else return null;if(p(f)||
982
+ t(a,f,u)||f.getParent().is(Z))return null;var r=e(a,f,!u);if(r){if(r&&r.type==CKEDITOR.NODE_TEXT)return null;if(n(r)){if(p(r)||!v(a,r)||r.getParent().is(Z))return null;h=[r,f][u?"reverse":"concat"]().concat([F,L])}}else f.equals(a.editable[u?"getLast":"getFirst"](a.isRelevant))?(w(a),u&&m(b.y,f.size.bottom-d,c.pane.height)&&m(f.size.bottom,c.pane.height-d,c.pane.height)?k=N:m(b.y,0,f.size.top+d)&&(k=P)):k=Y,h=[null,f][u?"reverse":"concat"]().concat([u?J:I,L,k,f.equals(a.editable[u?"getLast":"getFirst"](a.isRelevant))?
983
+ u?N:P:Y]);return 0 in h?new l(h):null}function z(a,b,c,d){for(var e=b.getDocumentPosition(),f={},h={},g={},k={},l=U.length;l--;)f[U[l]]=parseInt(b.getComputedStyle.call(b,"border-"+U[l]+"-width"),10)||0,g[U[l]]=parseInt(b.getComputedStyle.call(b,"padding-"+U[l]),10)||0,h[U[l]]=parseInt(b.getComputedStyle.call(b,"margin-"+U[l]),10)||0;c&&!d||u(a,d);k.top=e.y-(c?0:a.view.scroll.y);k.left=e.x-(c?0:a.view.scroll.x);k.outerWidth=b.$.offsetWidth;k.outerHeight=b.$.offsetHeight;k.height=k.outerHeight-(g.top+
984
+ g.bottom+f.top+f.bottom);k.width=k.outerWidth-(g.left+g.right+f.left+f.right);k.bottom=k.top+k.outerHeight;k.right=k.left+k.outerWidth;a.inInlineMode&&(k.scroll={top:b.$.scrollTop,left:b.$.scrollLeft});return C({border:f,padding:g,margin:h,ignoreScroll:c},k,!0)}function B(a,b,c){if(!n(b))return b.size=null;if(!b.size)b.size={};else if(b.size.ignoreScroll==c&&b.size.date>new Date-ba)return null;return C(b.size,z(a,b,c),{date:+new Date},!0)}function w(a,b){a.view.editable=z(a,a.editable,b,!0)}function u(a,
985
+ b){a.view||(a.view={});var c=a.view;if(!(!b&&c&&c.date>new Date-ba)){var d=a.win,c=d.getScrollPosition(),d=d.getViewPaneSize();C(a.view,{scroll:{x:c.x,y:c.y,width:a.doc.$.documentElement.scrollWidth-d.width,height:a.doc.$.documentElement.scrollHeight-d.height},pane:{width:d.width,height:d.height,bottom:d.height+c.y},date:+new Date},!0)}}function D(a,b,c,d){for(var e=d,f=d,h=0,g=!1,k=!1,m=a.view.pane.height,u=a.mouse;u.y+h<m&&0<u.y-h;){g||(g=b(e,d));k||(k=b(f,d));!g&&0<u.y-h&&(e=c(a,{x:u.x,y:u.y-h}));
986
+ !k&&u.y+h<m&&(f=c(a,{x:u.x,y:u.y+h}));if(g&&k)break;h+=2}return new l([e,f,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var f=a.config,h=f.magicline_triggerOffset||30,m={editor:a,enterMode:f.enterMode,triggerOffset:h,holdDistance:0|h*(f.magicline_holdDistance||.5),boxColor:f.magicline_color||"#ff0000",rtl:"rtl"==f.contentsLangDirection,tabuList:["data-cke-hidden-sel"].concat(f.magicline_tabuList||[]),triggers:f.magicline_everywhere?T:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},
987
+ t,A,D;m.isRelevant=function(a){return n(a)&&!b(m,a)&&!p(a)};a.on("contentDom",function(){var h=a.editable(),n=a.document,p=a.window;C(m,{editable:h,inInlineMode:h.isInline(),doc:n,win:p,hotNode:null},!0);m.boundary=m.inInlineMode?m.editable:m.doc.getDocumentElement();h.is(E.$inline)||(m.inInlineMode&&!q(h)&&h.setStyles({position:"relative",top:null,left:null}),k.call(this,m),u(m),h.attachListener(a,"beforeUndoImage",function(){m.line.detach()}),h.attachListener(a,"beforeGetData",function(){m.line.wrap.getParent()&&
988
+ (m.line.detach(),a.once("getData",function(){m.line.attach()},null,null,1E3))},null,null,0),h.attachListener(m.inInlineMode?n:n.getWindow().getFrame(),"mouseout",function(b){if("wysiwyg"==a.mode)if(m.inInlineMode){var c=b.data.$.clientX;b=b.data.$.clientY;u(m);w(m,!0);var d=m.view.editable,e=m.view.scroll;c>d.left-e.x&&c<d.right-e.x&&b>d.top-e.y&&b<d.bottom-e.y||(clearTimeout(D),D=null,m.line.detach())}else clearTimeout(D),D=null,m.line.detach()}),h.attachListener(h,"keyup",function(){m.hiddenMode=
989
+ 0}),h.attachListener(h,"keydown",function(b){if("wysiwyg"==a.mode)switch(b.data.getKeystroke()){case 2228240:case 16:m.hiddenMode=1,m.line.detach()}}),h.attachListener(m.inInlineMode?h:n,"mousemove",function(b){A=!0;if("wysiwyg"==a.mode&&!a.readOnly&&!D){var c={x:b.data.$.clientX,y:b.data.$.clientY};D=setTimeout(function(){m.mouse=c;D=m.trigger=null;u(m);A&&!m.hiddenMode&&a.focusManager.hasFocus&&!m.line.mouseNear()&&(m.element=X(m,!0))&&((m.trigger=y(m)||x(m)||R(m))&&!r(m,m.trigger.upper||m.trigger.lower)?
990
+ m.line.attach().place():(m.trigger=null,m.line.detach()),A=!1)},30)}}),h.attachListener(p,"scroll",function(){"wysiwyg"==a.mode&&(m.line.detach(),K.webkit&&(m.hiddenMode=1,clearTimeout(t),t=setTimeout(function(){m.mouseDown||(m.hiddenMode=0)},50)))}),h.attachListener(H?n:p,"mousedown",function(){"wysiwyg"==a.mode&&(m.line.detach(),m.hiddenMode=1,m.mouseDown=1)}),h.attachListener(H?n:p,"mouseup",function(){m.hiddenMode=0;m.mouseDown=0}),a.addCommand("accessPreviousSpace",d(m)),a.addCommand("accessNextSpace",
991
991
  d(m,!0)),a.setKeystroke([[f.magicline_keystrokePrevious,"accessPreviousSpace"],[f.magicline_keystrokeNext,"accessNextSpace"]]),a.on("loadSnapshot",function(){var b,c,d,e;for(e in{p:1,br:1,div:1})for(b=a.document.getElementsByTag(e),d=b.count();d--;)if((c=b.getItem(d)).data("cke-magicline-hot")){m.hotNode=c;m.lastCmdDirection="true"===c.data("cke-magicline-dir")?!0:!1;return}}),a._.magiclineBackdoor={accessFocusSpace:c,boxTrigger:l,isLine:b,getAscendantTrigger:g,getNonEmptyNeighbour:e,getSize:z,that:m,
992
- triggerEdge:x,triggerEditable:y,triggerExpand:R})},this)}});var B=CKEDITOR.tools.extend,C=CKEDITOR.dom.element,G=C.createFromHtml,K=CKEDITOR.env,H=CKEDITOR.env.ie&&9>CKEDITOR.env.version,E=CKEDITOR.dtd,M={},I=128,J=64,F=32,L=16,P=4,N=2,Y=1,S=" ",Z=E.$listItem,ha=E.$tableContent,W=B({},E.$nonEditable,E.$empty),T=E.$block,ba=100,ca="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",V=ca+"border-color:transparent;display:block;border-style:solid;",
992
+ triggerEdge:x,triggerEditable:y,triggerExpand:R})},this)}});var C=CKEDITOR.tools.extend,A=CKEDITOR.dom.element,G=A.createFromHtml,K=CKEDITOR.env,H=CKEDITOR.env.ie&&9>CKEDITOR.env.version,E=CKEDITOR.dtd,M={},I=128,J=64,F=32,L=16,P=4,N=2,Y=1,S=" ",Z=E.$listItem,ha=E.$tableContent,W=C({},E.$nonEditable,E.$empty),T=E.$block,ba=100,ca="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",V=ca+"border-color:transparent;display:block;border-style:solid;",
993
993
  ea="\x3cspan\x3e"+S+"\x3c/span\x3e";M[CKEDITOR.ENTER_BR]="br";M[CKEDITOR.ENTER_P]="p";M[CKEDITOR.ENTER_DIV]="div";l.prototype={set:function(a,b,c){this.properties=a+b+(c||Y);return this},is:function(a){return(this.properties&a)==a}};var X=function(){function a(b,c){var d=b.$.elementFromPoint(c.x,c.y);return d&&d.nodeType?new CKEDITOR.dom.element(d):null}return function(c,d,e){if(!c.mouse)return null;var f=c.doc,h=c.line.wrap;e=e||c.mouse;var g=a(f,e);d&&b(c,g)&&(h.hide(),g=a(f,e),h.show());return!g||
994
994
  g.type!=CKEDITOR.NODE_ELEMENT||!g.$||K.ie&&9>K.version&&!c.boundary.equals(g)&&!c.boundary.contains(g)?null:g}}(),O=CKEDITOR.dom.walker.whitespaces(),Q=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),R=function(){function c(b){var e=b.element,h,g,k;if(!n(e)||e.contains(b.editable)||e.isReadOnly())return null;k=D(b,function(a,b){return!b.equals(a)},function(a,b){return X(a,!0,b)},e);h=k.upper;g=k.lower;if(a(b,h,g))return k.set(F,8);if(h&&e.contains(h))for(;!h.getParent().equals(e);)h=h.getParent();
995
- else h=e.getFirst(function(a){return d(b,a)});if(g&&e.contains(g))for(;!g.getParent().equals(e);)g=g.getParent();else g=e.getLast(function(a){return d(b,a)});if(!h||!g)return null;A(b,h);A(b,g);if(!m(b.mouse.y,h.size.top,g.size.bottom))return null;for(var e=Number.MAX_VALUE,l,v,w,q;g&&!g.equals(h)&&(v=h.getNext(b.isRelevant));)l=Math.abs(f(b,h,v)-b.mouse.y),l<e&&(e=l,w=h,q=v),h=v,A(b,h);if(!w||!q||!m(b.mouse.y,w.size.top,q.size.bottom))return null;k.upper=w;k.lower=q;return k.set(F,8)}function d(a,
996
- c){return!(c&&c.type==CKEDITOR.NODE_TEXT||Q(c)||r(c)||b(a,c)||c.type==CKEDITOR.NODE_ELEMENT&&c.$&&c.is("br"))}return function(b){var d=c(b),e;if(e=d){e=d.upper;var f=d.lower;e=!e||!f||r(f)||r(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?!1:p(b,e)&&p(b,f)&&a(b,e,f)?!0:!1}return e?d:null}}(),U=["top","left","right","bottom"]})();CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51;CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52;(function(){function a(a,
995
+ else h=e.getFirst(function(a){return d(b,a)});if(g&&e.contains(g))for(;!g.getParent().equals(e);)g=g.getParent();else g=e.getLast(function(a){return d(b,a)});if(!h||!g)return null;B(b,h);B(b,g);if(!m(b.mouse.y,h.size.top,g.size.bottom))return null;for(var e=Number.MAX_VALUE,l,u,r,w;g&&!g.equals(h)&&(u=h.getNext(b.isRelevant));)l=Math.abs(f(b,h,u)-b.mouse.y),l<e&&(e=l,r=h,w=u),h=u,B(b,h);if(!r||!w||!m(b.mouse.y,r.size.top,w.size.bottom))return null;k.upper=r;k.lower=w;return k.set(F,8)}function d(a,
996
+ c){return!(c&&c.type==CKEDITOR.NODE_TEXT||Q(c)||p(c)||b(a,c)||c.type==CKEDITOR.NODE_ELEMENT&&c.$&&c.is("br"))}return function(b){var d=c(b),e;if(e=d){e=d.upper;var f=d.lower;e=!e||!f||p(f)||p(e)||f.equals(e)||e.equals(f)||f.contains(e)||e.contains(f)?!1:v(b,e)&&v(b,f)&&a(b,e,f)?!0:!1}return e?d:null}}(),U=["top","left","right","bottom"]})();CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51;CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52;(function(){function a(a,
997
997
  e){return CKEDITOR.tools.array.filter(a,function(a){return a.canHandle(e)}).sort(function(a,d){return a.priority===d.priority?0:a.priority-d.priority})}function l(a,e){var c=a.shift();c&&c.handle(e,function(){l(a,e)})}function g(a){var e=CKEDITOR.tools.array.reduce(a,function(a,d){return CKEDITOR.tools.array.isArray(d.filters)?a.concat(d.filters):a},[]);return CKEDITOR.tools.array.filter(e,function(a,d){return CKEDITOR.tools.array.indexOf(e,a)===d})}function f(a,f){var c=0,d,b;if(!CKEDITOR.tools.array.isArray(a)||
998
998
  0===a.length)return!0;d=CKEDITOR.tools.array.filter(a,function(a){return-1===CKEDITOR.tools.array.indexOf(e,a)});if(0<d.length)for(b=0;b<d.length;b++)(function(a){CKEDITOR.scriptLoader.queue(a,function(b){b&&e.push(a);++c===d.length&&f()})})(d[b]);return 0===d.length}var e=[],m=CKEDITOR.tools.createClass({$:function(){this.handlers=[]},proto:{register:function(a){"number"!==typeof a.priority&&(a.priority=10);this.handlers.push(a)},addPasteListener:function(e){e.on("paste",function(k){var c=a(this.handlers,
999
999
  k),d;if(0!==c.length){d=g(c);d=f(d,function(){return e.fire("paste",k.data)});if(!d)return k.cancel();l(c,k)}},this,null,3)}}});CKEDITOR.plugins.add("pastetools",{requires:"clipboard",beforeInit:function(a){a.pasteTools=new m;a.pasteTools.addPasteListener(a)}});CKEDITOR.plugins.pastetools={filters:{},loadFilters:f,createFilter:function(a){var e=CKEDITOR.tools.array.isArray(a.rules)?a.rules:[a.rules],c=a.additionalTransforms;return function(a,b){var f=new CKEDITOR.htmlParser.basicWriter,h=new CKEDITOR.htmlParser.filter,
@@ -1008,9 +1008,9 @@ a.pasteTools.register({filters:a.config.pasteFromWordCleanupFile?[a.config.paste
1008
1008
  m)a.on("afterPasteFromWord",l)}})})();(function(){var a={canUndo:!1,async:!0,exec:function(a,g){var f=a.lang,e=CKEDITOR.tools.keystrokeToString(f.common.keyboard,a.getCommandKeystroke(CKEDITOR.env.ie?a.commands.paste:this)),m=g&&"undefined"!==typeof g.notification?g.notification:!g||!g.from||"keystrokeHandler"===g.from&&CKEDITOR.env.ie,f=m&&"string"===typeof m?m:f.pastetext.pasteNotification.replace(/%1/,'\x3ckbd aria-label\x3d"'+e.aria+'"\x3e'+e.display+"\x3c/kbd\x3e");a.execCommand("paste",{type:"text",
1009
1009
  notification:m?f:!1})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(l){var g=CKEDITOR.env.safari?CKEDITOR.CTRL+CKEDITOR.ALT+CKEDITOR.SHIFT+86:CKEDITOR.CTRL+CKEDITOR.SHIFT+86;l.addCommand("pastetext",a);l.setKeystroke(g,"pastetext");CKEDITOR.plugins.clipboard.addPasteButton(l,"PasteText",{label:l.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"});if(l.config.forcePasteAsPlainText)l.on("beforePaste",function(a){"html"!=a.data.type&&(a.data.type="text")});l.on("pasteState",
1010
1010
  function(a){l.getCommand("pastetext").setState(a.data)})}})})();CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}});CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var l=a._.removeFormatRegex||(a._.removeFormatRegex=new RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,
1011
- "|")+")$","i")),g=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,e=a.getSelection().getRanges().createIterator(),m=function(a){return a.type==CKEDITOR.NODE_ELEMENT},h=[],k;k=e.getNextRange();){var c=k.createBookmark();k=a.createRange();k.setStartBefore(c.startNode);c.endNode&&k.setEndAfter(c.endNode);k.collapsed||k.enlarge(CKEDITOR.ENLARGE_ELEMENT);var d=k.createBookmark(),b=d.startNode,n=d.endNode,r=function(b){for(var c=
1012
- a.elementPath(b),d=c.elements,e=1,h;(h=d[e])&&!h.equals(c.block)&&!h.equals(c.blockLimit);e++)l.test(h.getName())&&f(a,h)&&b.breakParent(h)};r(b);if(n)for(r(n),b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);b&&!b.equals(n);)if(b.isReadOnly()){if(b.getPosition(n)&CKEDITOR.POSITION_CONTAINS)break;b=b.getNext(m)}else r=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==b.getName()&&b.data("cke-realelement")||b.hasAttribute("data-cke-bookmark")||!f(a,b)||(l.test(b.getName())?b.remove(1):(b.removeAttributes(g),
1013
- a.fire("removeFormatCleanup",b))),b=r;d.startNode.remove();d.endNode&&d.endNode.remove();k.moveToBookmark(c);h.push(k)}a.forceNextSelectionCheck();a.getSelection().selectRanges(h)}}},filter:function(a,l){for(var g=a._.removeFormatFilters||[],f=0;f<g.length;f++)if(!1===g[f](l))return!1;return!0}};CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){this._.removeFormatFilters||(this._.removeFormatFilters=[]);this._.removeFormatFilters.push(a)};CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
1011
+ "|")+")$","i")),g=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,e=a.getSelection().getRanges().createIterator(),m=function(a){return a.type==CKEDITOR.NODE_ELEMENT},h=[],k;k=e.getNextRange();){var c=k.createBookmark();k=a.createRange();k.setStartBefore(c.startNode);c.endNode&&k.setEndAfter(c.endNode);k.collapsed||k.enlarge(CKEDITOR.ENLARGE_ELEMENT);var d=k.createBookmark(),b=d.startNode,n=d.endNode,p=function(b){for(var c=
1012
+ a.elementPath(b),d=c.elements,e=1,h;(h=d[e])&&!h.equals(c.block)&&!h.equals(c.blockLimit);e++)l.test(h.getName())&&f(a,h)&&b.breakParent(h)};p(b);if(n)for(p(n),b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);b&&!b.equals(n);)if(b.isReadOnly()){if(b.getPosition(n)&CKEDITOR.POSITION_CONTAINS)break;b=b.getNext(m)}else p=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==b.getName()&&b.data("cke-realelement")||b.hasAttribute("data-cke-bookmark")||!f(a,b)||(l.test(b.getName())?b.remove(1):(b.removeAttributes(g),
1013
+ a.fire("removeFormatCleanup",b))),b=p;d.startNode.remove();d.endNode&&d.endNode.remove();k.moveToBookmark(c);h.push(k)}a.forceNextSelectionCheck();a.getSelection().selectRanges(h)}}},filter:function(a,l){for(var g=a._.removeFormatFilters||[],f=0;f<g.length;f++)if(!1===g[f](l))return!1;return!0}};CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){this._.removeFormatFilters||(this._.removeFormatFilters=[]);this._.removeFormatFilters.push(a)};CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
1014
1014
  CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.plugins.add("resize",{init:function(a){function l(e){var h=c.width,g=c.height,l=h+(e.data.$.screenX-k.x)*("rtl"==m?-1:1);e=g+(e.data.$.screenY-k.y);d&&(h=Math.max(f.resize_minWidth,Math.min(l,f.resize_maxWidth)));b&&(g=Math.max(f.resize_minHeight,Math.min(e,f.resize_maxHeight)));a.resize(d?h:null,g)}function g(){CKEDITOR.document.removeListener("mousemove",l);CKEDITOR.document.removeListener("mouseup",
1015
1015
  g);a.document&&(a.document.removeListener("mousemove",l),a.document.removeListener("mouseup",g))}var f=a.config,e=a.ui.spaceId("resizer"),m=a.element?a.element.getDirection(1):"ltr";!f.resize_dir&&(f.resize_dir="vertical");void 0===f.resize_maxWidth&&(f.resize_maxWidth=3E3);void 0===f.resize_maxHeight&&(f.resize_maxHeight=3E3);void 0===f.resize_minWidth&&(f.resize_minWidth=750);void 0===f.resize_minHeight&&(f.resize_minHeight=250);if(!1!==f.resize_enabled){var h=null,k,c,d=("both"==f.resize_dir||
1016
1016
  "horizontal"==f.resize_dir)&&f.resize_minWidth!=f.resize_maxWidth,b=("both"==f.resize_dir||"vertical"==f.resize_dir)&&f.resize_minHeight!=f.resize_maxHeight,n=CKEDITOR.tools.addFunction(function(b){h||(h=a.getResizable());c={width:h.$.offsetWidth||0,height:h.$.offsetHeight||0};k={x:b.screenX,y:b.screenY};f.resize_minWidth>c.width&&(f.resize_minWidth=c.width);f.resize_minHeight>c.height&&(f.resize_minHeight=c.height);CKEDITOR.document.on("mousemove",l);CKEDITOR.document.on("mouseup",g);a.document&&
@@ -1043,60 +1043,60 @@ g["border-top"]===g["border-bottom"]&&(e=CKEDITOR.tools.style.parse.border(g["bo
1043
1043
  "th")||g.equals(h)||(e=g);a=a.createRange();a.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove();a.select()}}}));a.ui.addButton&&a.ui.addButton("Table",{label:g.toolbar,command:"table",toolbar:"insert,30"});CKEDITOR.dialog.add("table",this.path+"dialogs/table.js");CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js");a.addMenuItems&&a.addMenuItems({table:{label:g.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:g.deleteTable,command:"tableDelete",group:"table",
1044
1044
  order:1}});a.on("doubleclick",function(a){a.data.element.is("table")&&(a.data.dialog="tableProperties")});a.contextMenu&&a.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}});(function(){function a(a,b){function c(a){return b?b.contains(a)&&a.getAscendant("table",!0).equals(b):!0}function d(a){var b=/^(?:td|th)$/;0<e.length||a.type!=CKEDITOR.NODE_ELEMENT||!b.test(a.getName())||a.getCustomData("selected_cell")||(CKEDITOR.dom.element.setMarker(f,
1045
1045
  a,"selected_cell",!0),e.push(a))}var e=[],f={};if(!a)return e;for(var h=a.getRanges(),g=0;g<h.length;g++){var k=h[g];if(k.collapsed)(k=k.getCommonAncestor().getAscendant({td:1,th:1},!0))&&c(k)&&e.push(k);else{var k=new CKEDITOR.dom.walker(k),l;for(k.guard=d;l=k.next();)l.type==CKEDITOR.NODE_ELEMENT&&l.is(CKEDITOR.dtd.table)||(l=l.getAscendant({td:1,th:1},!0))&&!l.getCustomData("selected_cell")&&c(l)&&(CKEDITOR.dom.element.setMarker(f,l,"selected_cell",!0),e.push(l))}}CKEDITOR.dom.element.clearAllMarkers(f);
1046
- return e}function l(b,c){for(var d=p(b)?b:a(b),e=d[0],f=e.getAscendant("table"),e=e.getDocument(),h=d[0].getParent(),g=h.$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=new CKEDITOR.dom.element(f.$.rows[k]),g=c?g:k,h=c?h:d,d=CKEDITOR.tools.buildTableMap(f),f=d[g],g=c?d[g-1]:d[g+1],d=d[0].length,e=e.createElement("tr"),k=0;f[k]&&k<d;k++){var l;1<f[k].rowSpan&&g&&f[k]==g[k]?(l=f[k],l.rowSpan+=1):(l=(new CKEDITOR.dom.element(f[k])).clone(),l.removeAttribute("rowSpan"),l.appendBogus(),
1047
- e.append(l),l=l.$);k+=l.colSpan-1}c?e.insertBefore(h):e.insertAfter(h);return e}function g(b){if(b instanceof CKEDITOR.dom.selection){var c=b.getRanges(),d=a(b),e=d[0].getAscendant("table"),f=CKEDITOR.tools.buildTableMap(e),h=d[0].getParent().$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=[];b.reset();for(b=h;b<=k;b++){for(var l=f[b],m=new CKEDITOR.dom.element(e.$.rows[b]),n=0;n<l.length;n++){var r=new CKEDITOR.dom.element(l[n]),p=r.getParent().$.rowIndex;1==r.$.rowSpan?r.remove():
1048
- (--r.$.rowSpan,p==b&&(p=f[b+1],p[n-1]?r.insertAfter(new CKEDITOR.dom.element(p[n-1])):(new CKEDITOR.dom.element(e.$.rows[b+1])).append(r,1)));n+=r.$.colSpan-1}d.push(m)}f=e.$.rows;c[0].moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);h=new CKEDITOR.dom.element(f[k+1]||(0<h?f[h-1]:null)||e.$.parentNode);for(b=d.length;0<=b;b--)g(d[b]);return e.$.parentNode?h:(c[0].select(),null)}b instanceof CKEDITOR.dom.element&&(e=b.getAscendant("table"),1==e.$.rows.length?e.remove():b.remove());return null}function f(a){for(var b=
1049
- a.getParent().$.cells,c=0,d=0;d<b.length;d++){var e=b[d],c=c+e.colSpan;if(e==a.$)break}return c-1}function e(a,b){for(var c=b?Infinity:0,d=0;d<a.length;d++){var e=f(a[d]);if(b?e<c:e>c)c=e}return c}function m(b,c){for(var d=p(b)?b:a(b),f=d[0].getAscendant("table"),h=e(d,1),d=e(d),g=c?h:d,k=CKEDITOR.tools.buildTableMap(f),f=[],h=[],d=[],l=k.length,m=0;m<l;m++){var n=c?k[m][g-1]:k[m][g+1];f.push(k[m][g]);h.push(n)}for(m=0;m<l;m++)f[m]&&(1<f[m].colSpan&&h[m]==f[m]?(k=f[m],k.colSpan+=1):(g=new CKEDITOR.dom.element(f[m]),
1046
+ return e}function l(b,c){for(var d=v(b)?b:a(b),e=d[0],f=e.getAscendant("table"),e=e.getDocument(),h=d[0].getParent(),g=h.$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=new CKEDITOR.dom.element(f.$.rows[k]),g=c?g:k,h=c?h:d,d=CKEDITOR.tools.buildTableMap(f),f=d[g],g=c?d[g-1]:d[g+1],d=d[0].length,e=e.createElement("tr"),k=0;f[k]&&k<d;k++){var l;1<f[k].rowSpan&&g&&f[k]==g[k]?(l=f[k],l.rowSpan+=1):(l=(new CKEDITOR.dom.element(f[k])).clone(),l.removeAttribute("rowSpan"),l.appendBogus(),
1047
+ e.append(l),l=l.$);k+=l.colSpan-1}c?e.insertBefore(h):e.insertAfter(h);return e}function g(b){if(b instanceof CKEDITOR.dom.selection){var c=b.getRanges(),d=a(b),e=d[0].getAscendant("table"),f=CKEDITOR.tools.buildTableMap(e),h=d[0].getParent().$.rowIndex,d=d[d.length-1],k=d.getParent().$.rowIndex+d.$.rowSpan-1,d=[];b.reset();for(b=h;b<=k;b++){for(var l=f[b],m=new CKEDITOR.dom.element(e.$.rows[b]),n=0;n<l.length;n++){var A=new CKEDITOR.dom.element(l[n]),p=A.getParent().$.rowIndex;1==A.$.rowSpan?A.remove():
1048
+ (--A.$.rowSpan,p==b&&(p=f[b+1],p[n-1]?A.insertAfter(new CKEDITOR.dom.element(p[n-1])):(new CKEDITOR.dom.element(e.$.rows[b+1])).append(A,1)));n+=A.$.colSpan-1}d.push(m)}f=e.$.rows;c[0].moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);h=new CKEDITOR.dom.element(f[k+1]||(0<h?f[h-1]:null)||e.$.parentNode);for(b=d.length;0<=b;b--)g(d[b]);return e.$.parentNode?h:(c[0].select(),null)}b instanceof CKEDITOR.dom.element&&(e=b.getAscendant("table"),1==e.$.rows.length?e.remove():b.remove());return null}function f(a){for(var b=
1049
+ a.getParent().$.cells,c=0,d=0;d<b.length;d++){var e=b[d],c=c+e.colSpan;if(e==a.$)break}return c-1}function e(a,b){for(var c=b?Infinity:0,d=0;d<a.length;d++){var e=f(a[d]);if(b?e<c:e>c)c=e}return c}function m(b,c){for(var d=v(b)?b:a(b),f=d[0].getAscendant("table"),h=e(d,1),d=e(d),g=c?h:d,k=CKEDITOR.tools.buildTableMap(f),f=[],h=[],d=[],l=k.length,m=0;m<l;m++){var n=c?k[m][g-1]:k[m][g+1];f.push(k[m][g]);h.push(n)}for(m=0;m<l;m++)f[m]&&(1<f[m].colSpan&&h[m]==f[m]?(k=f[m],k.colSpan+=1):(g=new CKEDITOR.dom.element(f[m]),
1050
1050
  k=g.clone(),k.removeAttribute("colSpan"),k.appendBogus(),k[c?"insertBefore":"insertAfter"].call(k,g),d.push(k),k=k.$),m+=k.rowSpan-1);return d}function h(b){function c(a){var b=a.getRanges(),d,e;if(1!==b.length)return a;b=b[0];if(b.collapsed||0!==b.endOffset)return a;d=b.endContainer;e=d.getName().toLowerCase();if("td"!==e&&"th"!==e)return a;for((e=d.getPrevious())||(e=d.getParent().getPrevious().getLast());e.type!==CKEDITOR.NODE_TEXT&&"br"!==e.getName().toLowerCase();)if(e=e.getLast(),!e)return a;
1051
- b.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);return b.select()}CKEDITOR.env.webkit&&!b.isFake&&(b=c(b));var d=b.getRanges(),e=a(b),f=e[0],h=e[e.length-1],e=f.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(e),k,l,m=[];b.reset();var n=0;for(b=g.length;n<b;n++)for(var r=0,p=g[n].length;r<p;r++)void 0===k&&g[n][r]==f.$&&(k=r),g[n][r]==h.$&&(l=r);for(n=k;n<=l;n++)for(r=0;r<g.length;r++)h=g[r],f=new CKEDITOR.dom.element(e.$.rows[r]),h=new CKEDITOR.dom.element(h[n]),h.$&&(1==h.$.colSpan?h.remove():--h.$.colSpan,
1052
- r+=h.$.rowSpan-1,f.$.cells.length||m.push(f));k=g[0].length-1>l?new CKEDITOR.dom.element(g[0][l+1]):k&&-1!==g[0][k-1].cellIndex?new CKEDITOR.dom.element(g[0][k-1]):new CKEDITOR.dom.element(e.$.parentNode);m.length==b&&(d[0].moveToPosition(e,CKEDITOR.POSITION_AFTER_END),d[0].select(),e.remove());return k}function k(a,b){var c=a.getStartElement().getAscendant({td:1,th:1},!0);if(c){var d=c.clone();d.appendBogus();b?d.insertBefore(c):d.insertAfter(c)}}function c(b){if(b instanceof CKEDITOR.dom.selection){var e=
1051
+ b.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);return b.select()}CKEDITOR.env.webkit&&!b.isFake&&(b=c(b));var d=b.getRanges(),e=a(b),f=e[0],h=e[e.length-1],e=f.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(e),k,l,m=[];b.reset();var n=0;for(b=g.length;n<b;n++)for(var p=0,q=g[n].length;p<q;p++)void 0===k&&g[n][p]==f.$&&(k=p),g[n][p]==h.$&&(l=p);for(n=k;n<=l;n++)for(p=0;p<g.length;p++)h=g[p],f=new CKEDITOR.dom.element(e.$.rows[p]),h=new CKEDITOR.dom.element(h[n]),h.$&&(1==h.$.colSpan?h.remove():--h.$.colSpan,
1052
+ p+=h.$.rowSpan-1,f.$.cells.length||m.push(f));k=g[0].length-1>l?new CKEDITOR.dom.element(g[0][l+1]):k&&-1!==g[0][k-1].cellIndex?new CKEDITOR.dom.element(g[0][k-1]):new CKEDITOR.dom.element(e.$.parentNode);m.length==b&&(d[0].moveToPosition(e,CKEDITOR.POSITION_AFTER_END),d[0].select(),e.remove());return k}function k(a,b){var c=a.getStartElement().getAscendant({td:1,th:1},!0);if(c){var d=c.clone();d.appendBogus();b?d.insertBefore(c):d.insertAfter(c)}}function c(b){if(b instanceof CKEDITOR.dom.selection){var e=
1053
1053
  b.getRanges(),f=a(b),h=f[0]&&f[0].getAscendant("table"),g;a:{var k=0;g=f.length-1;for(var l={},m,n;m=f[k++];)CKEDITOR.dom.element.setMarker(l,m,"delete_cell",!0);for(k=0;m=f[k++];)if((n=m.getPrevious())&&!n.getCustomData("delete_cell")||(n=m.getNext())&&!n.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(l);g=n;break a}CKEDITOR.dom.element.clearAllMarkers(l);k=f[0].getParent();(k=k.getPrevious())?g=k.getLast():(k=f[g].getParent(),g=(k=k.getNext())?k.getChild(0):null)}b.reset();for(b=
1054
1054
  f.length-1;0<=b;b--)c(f[b]);g?d(g,!0):h&&(e[0].moveToPosition(h,CKEDITOR.POSITION_BEFORE_START),e[0].select(),h.remove())}else b instanceof CKEDITOR.dom.element&&(e=b.getParent(),1==e.getChildCount()?e.remove():b.remove())}function d(a,b){var c=a.getDocument(),d=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(d.focus(),c.focus());c=new CKEDITOR.dom.range(c);c["moveToElementEdit"+(b?"End":"Start")](a)||(c.selectNodeContents(a),c.collapse(b?!1:!0));c.select(!0)}function b(a,b,c){a=a[b];
1055
- if("undefined"==typeof c)return a;for(b=0;a&&b<a.length;b++){if(c.is&&a[b]==c.$)return b;if(b==c)return new CKEDITOR.dom.element(a[b])}return c.is?-1:null}function n(c,d,e){var f=a(c),h;if((d?1!=f.length:2>f.length)||(h=c.getCommonAncestor())&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("table"))return!1;c=f[0];h=c.getAscendant("table");var g=CKEDITOR.tools.buildTableMap(h),k=g.length,l=g[0].length,m=c.getParent().$.rowIndex,n=b(g,m,c),r;if(d){var p;try{var u=parseInt(c.getAttribute("rowspan"),10)||1;r=parseInt(c.getAttribute("colspan"),
1056
- 10)||1;p=g["up"==d?m-u:"down"==d?m+u:m]["left"==d?n-r:"right"==d?n+r:n]}catch(H){return!1}if(!p||c.$==p)return!1;f["up"==d||"left"==d?"unshift":"push"](new CKEDITOR.dom.element(p))}d=c.getDocument();var E=m,u=p=0,M=!e&&new CKEDITOR.dom.documentFragment(d),I=0;for(d=0;d<f.length;d++){r=f[d];var J=r.getParent(),F=r.getFirst(),L=r.$.colSpan,P=r.$.rowSpan,J=J.$.rowIndex,N=b(g,J,r),I=I+L*P,u=Math.max(u,N-n+L);p=Math.max(p,J-m+P);e||(L=r,(P=L.getBogus())&&P.remove(),L.trim(),r.getChildren().count()&&(J==
1057
- E||!F||F.isBlockBoundary&&F.isBlockBoundary({br:1})||(E=M.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!E||E.is&&E.is("br")||M.append("br")),r.moveChildren(M)),d?r.remove():r.setHtml(""));E=J}if(e)return p*u==I;M.moveChildren(c);c.appendBogus();u>=l?c.removeAttribute("rowSpan"):c.$.rowSpan=p;p>=k?c.removeAttribute("colSpan"):c.$.colSpan=u;e=new CKEDITOR.dom.nodeList(h.$.rows);f=e.count();for(d=f-1;0<=d;d--)h=e.getItem(d),h.$.cells.length||(h.remove(),f++);return c}function r(c,d){var e=a(c);if(1<
1058
- e.length)return!1;if(d)return!0;var e=e[0],f=e.getParent(),h=f.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(h),k=f.$.rowIndex,l=b(g,k,e),m=e.$.rowSpan,n;if(1<m){n=Math.ceil(m/2);for(var m=Math.floor(m/2),f=k+n,h=new CKEDITOR.dom.element(h.$.rows[f]),g=b(g,f),r,f=e.clone(),k=0;k<g.length;k++)if(r=g[k],r.parentNode==h.$&&k>l){f.insertBefore(new CKEDITOR.dom.element(r));break}else r=null;r||h.append(f)}else for(m=n=1,h=f.clone(),h.insertAfter(f),h.append(f=e.clone()),r=b(g,k),l=0;l<r.length;l++)r[l].rowSpan++;
1059
- f.appendBogus();e.$.rowSpan=n;f.$.rowSpan=m;1==n&&e.removeAttribute("rowSpan");1==m&&f.removeAttribute("rowSpan");return f}function u(c,d){var e=a(c);if(1<e.length)return!1;if(d)return!0;var e=e[0],f=e.getParent(),h=f.getAscendant("table"),h=CKEDITOR.tools.buildTableMap(h),g=b(h,f.$.rowIndex,e),k=e.$.colSpan;if(1<k)f=Math.ceil(k/2),k=Math.floor(k/2);else{for(var k=f=1,l=[],m=0;m<h.length;m++){var n=h[m];l.push(n[g]);1<n[g].rowSpan&&(m+=n[g].rowSpan-1)}for(h=0;h<l.length;h++)l[h].colSpan++}h=e.clone();
1060
- h.insertAfter(e);h.appendBogus();e.$.colSpan=f;h.$.colSpan=k;1==f&&e.removeAttribute("colSpan");1==k&&h.removeAttribute("colSpan");return h}var p=CKEDITOR.tools.isArray;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(b){function e(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function f(a,c){var d=b.addCommand(a,c);b.addFeature(d)}var p=b.lang.table,
1061
- z=CKEDITOR.tools.style.parse,A="td{width} td{height} td{border-color} td{background-color} td{white-space} td{vertical-align} td{text-align} td[colspan] td[rowspan] th".split(" ");f("cellProperties",new CKEDITOR.dialogCommand("cellProperties",e({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:A,contentTransformations:[[{element:"td",left:function(a){return a.styles.background&&z.background(a.styles.background).color},
1055
+ if("undefined"==typeof c)return a;for(b=0;a&&b<a.length;b++){if(c.is&&a[b]==c.$)return b;if(b==c)return new CKEDITOR.dom.element(a[b])}return c.is?-1:null}function n(c,d,e){var f=a(c),h;if((d?1!=f.length:2>f.length)||(h=c.getCommonAncestor())&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("table"))return!1;c=f[0];h=c.getAscendant("table");var g=CKEDITOR.tools.buildTableMap(h),k=g.length,l=g[0].length,m=c.getParent().$.rowIndex,n=b(g,m,c),p;if(d){var q;try{var v=parseInt(c.getAttribute("rowspan"),10)||1;p=parseInt(c.getAttribute("colspan"),
1056
+ 10)||1;q=g["up"==d?m-v:"down"==d?m+v:m]["left"==d?n-p:"right"==d?n+p:n]}catch(H){return!1}if(!q||c.$==q)return!1;f["up"==d||"left"==d?"unshift":"push"](new CKEDITOR.dom.element(q))}d=c.getDocument();var E=m,v=q=0,M=!e&&new CKEDITOR.dom.documentFragment(d),I=0;for(d=0;d<f.length;d++){p=f[d];var J=p.getParent(),F=p.getFirst(),L=p.$.colSpan,P=p.$.rowSpan,J=J.$.rowIndex,N=b(g,J,p),I=I+L*P,v=Math.max(v,N-n+L);q=Math.max(q,J-m+P);e||(L=p,(P=L.getBogus())&&P.remove(),L.trim(),p.getChildren().count()&&(J==
1057
+ E||!F||F.isBlockBoundary&&F.isBlockBoundary({br:1})||(E=M.getLast(CKEDITOR.dom.walker.whitespaces(!0)),!E||E.is&&E.is("br")||M.append("br")),p.moveChildren(M)),d?p.remove():p.setHtml(""));E=J}if(e)return q*v==I;M.moveChildren(c);c.appendBogus();v>=l?c.removeAttribute("rowSpan"):c.$.rowSpan=q;q>=k?c.removeAttribute("colSpan"):c.$.colSpan=v;e=new CKEDITOR.dom.nodeList(h.$.rows);f=e.count();for(d=f-1;0<=d;d--)h=e.getItem(d),h.$.cells.length||(h.remove(),f++);return c}function p(c,d){var e=a(c);if(1<
1058
+ e.length)return!1;if(d)return!0;var e=e[0],f=e.getParent(),h=f.getAscendant("table"),g=CKEDITOR.tools.buildTableMap(h),k=f.$.rowIndex,l=b(g,k,e),m=e.$.rowSpan,n;if(1<m){n=Math.ceil(m/2);for(var m=Math.floor(m/2),f=k+n,h=new CKEDITOR.dom.element(h.$.rows[f]),g=b(g,f),p,f=e.clone(),k=0;k<g.length;k++)if(p=g[k],p.parentNode==h.$&&k>l){f.insertBefore(new CKEDITOR.dom.element(p));break}else p=null;p||h.append(f)}else for(m=n=1,h=f.clone(),h.insertAfter(f),h.append(f=e.clone()),p=b(g,k),l=0;l<p.length;l++)p[l].rowSpan++;
1059
+ f.appendBogus();e.$.rowSpan=n;f.$.rowSpan=m;1==n&&e.removeAttribute("rowSpan");1==m&&f.removeAttribute("rowSpan");return f}function q(c,d){var e=a(c);if(1<e.length)return!1;if(d)return!0;var e=e[0],f=e.getParent(),h=f.getAscendant("table"),h=CKEDITOR.tools.buildTableMap(h),g=b(h,f.$.rowIndex,e),k=e.$.colSpan;if(1<k)f=Math.ceil(k/2),k=Math.floor(k/2);else{for(var k=f=1,l=[],m=0;m<h.length;m++){var n=h[m];l.push(n[g]);1<n[g].rowSpan&&(m+=n[g].rowSpan-1)}for(h=0;h<l.length;h++)l[h].colSpan++}h=e.clone();
1060
+ h.insertAfter(e);h.appendBogus();e.$.colSpan=f;h.$.colSpan=k;1==f&&e.removeAttribute("colSpan");1==k&&h.removeAttribute("colSpan");return h}var v=CKEDITOR.tools.isArray;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(b){function e(a){return CKEDITOR.tools.extend(a||{},{contextSensitive:1,refresh:function(a,b){this.setState(b.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function f(a,c){var d=b.addCommand(a,c);b.addFeature(d)}var v=b.lang.table,
1061
+ z=CKEDITOR.tools.style.parse,B="td{width} td{height} td{border-color} td{background-color} td{white-space} td{vertical-align} td{text-align} td[colspan] td[rowspan] th".split(" ");f("cellProperties",new CKEDITOR.dialogCommand("cellProperties",e({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:B,contentTransformations:[[{element:"td",left:function(a){return a.styles.background&&z.background(a.styles.background).color},
1062
1062
  right:function(a){a.styles["background-color"]=z.background(a.styles.background).color}},{element:"td",check:"td{vertical-align}",left:function(a){return a.attributes&&a.attributes.valign},right:function(a){a.styles["vertical-align"]=a.attributes.valign;delete a.attributes.valign}}],[{element:"tr",check:"td{height}",left:function(a){return a.styles&&a.styles.height},right:function(a){CKEDITOR.tools.array.forEach(a.children,function(b){b.name in{td:1,th:1}&&(b.attributes["cke-row-height"]=a.styles.height)});
1063
1063
  delete a.styles.height}}],[{element:"td",check:"td{height}",left:function(a){return(a=a.attributes)&&a["cke-row-height"]},right:function(a){a.styles.height=a.attributes["cke-row-height"];delete a.attributes["cke-row-height"]}}]]})));CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js");f("rowDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();(a=g(a))&&d(a)}}));f("rowInsertBefore",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);l(b,!0)}}));
1064
1064
  f("rowInsertAfter",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);l(b)}}));f("columnDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();(a=h(a))&&d(a,!0)}}));f("columnInsertBefore",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);m(b,!0)}}));f("columnInsertAfter",e({requiredContent:"table",exec:function(b){b=b.getSelection();b=a(b);m(b)}}));f("cellDelete",e({requiredContent:"table",exec:function(a){a=a.getSelection();c(a)}}));f("cellMerge",
1065
1065
  e({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(a,b){b.cell=n(a.getSelection());d(b.cell,!0)}}));f("cellMergeRight",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a,b){b.cell=n(a.getSelection(),"right");d(b.cell,!0)}}));f("cellMergeDown",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(a,b){b.cell=n(a.getSelection(),"down");d(b.cell,!0)}}));f("cellVerticalSplit",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",
1066
- exec:function(a){d(u(a.getSelection()))}}));f("cellHorizontalSplit",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){d(r(a.getSelection()))}}));f("cellInsertBefore",e({requiredContent:"table",exec:function(a){a=a.getSelection();k(a,!0)}}));f("cellInsertAfter",e({requiredContent:"table",exec:function(a){a=a.getSelection();k(a)}}));b.addMenuItems&&b.addMenuItems({tablecell:{label:p.cell.menu,group:"tablecell",order:1,getItems:function(){var c=b.getSelection(),d=a(c),c=
1067
- {tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:n(c,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:n(c,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:n(c,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:u(c,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:r(c,!0)?CKEDITOR.TRISTATE_OFF:
1068
- CKEDITOR.TRISTATE_DISABLED};b.filter.check(A)&&(c.tablecell_properties=0<d.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);return c}},tablecell_insertBefore:{label:p.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:p.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:p.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:p.cell.merge,group:"tablecell",command:"cellMerge",
1069
- order:16},tablecell_merge_right:{label:p.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:p.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:p.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:p.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:p.cell.title,group:"tablecellproperties",command:"cellProperties",
1070
- order:21},tablerow:{label:p.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF}}},tablerow_insertBefore:{label:p.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:p.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:p.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},
1071
- tablecolumn:{label:p.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:p.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:p.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:p.column.deleteColumn,group:"tablecolumn",
1066
+ exec:function(a){d(q(a.getSelection()))}}));f("cellHorizontalSplit",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(a){d(p(a.getSelection()))}}));f("cellInsertBefore",e({requiredContent:"table",exec:function(a){a=a.getSelection();k(a,!0)}}));f("cellInsertAfter",e({requiredContent:"table",exec:function(a){a=a.getSelection();k(a)}}));b.addMenuItems&&b.addMenuItems({tablecell:{label:v.cell.menu,group:"tablecell",order:1,getItems:function(){var c=b.getSelection(),d=a(c),c=
1067
+ {tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:n(c,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:n(c,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:n(c,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:q(c,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:p(c,!0)?CKEDITOR.TRISTATE_OFF:
1068
+ CKEDITOR.TRISTATE_DISABLED};b.filter.check(B)&&(c.tablecell_properties=0<d.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);return c}},tablecell_insertBefore:{label:v.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:v.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:v.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:v.cell.merge,group:"tablecell",command:"cellMerge",
1069
+ order:16},tablecell_merge_right:{label:v.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:v.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:v.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:v.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:v.cell.title,group:"tablecellproperties",command:"cellProperties",
1070
+ order:21},tablerow:{label:v.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF}}},tablerow_insertBefore:{label:v.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:v.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:v.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},
1071
+ tablecolumn:{label:v.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:v.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:v.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:v.column.deleteColumn,group:"tablecolumn",
1072
1072
  command:"columnDelete",order:15}});b.contextMenu&&b.contextMenu.addListener(function(a,b,c){return(a=c.contains({td:1,th:1},1))&&!a.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getCellColIndex:f,insertRow:l,insertColumn:m,getSelectedCells:a};CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)})();CKEDITOR.tools.buildTableMap=function(a,l,g,f,e){a=a.$.rows;g=g||0;f="number"===typeof f?f:a.length-1;e="number"===typeof e?
1073
- e:-1;var m=-1,h=[];for(l=l||0;l<=f;l++){m++;!h[m]&&(h[m]=[]);for(var k=-1,c=g;c<=(-1===e?a[l].cells.length-1:e);c++){var d=a[l].cells[c];if(!d)break;for(k++;h[m][k];)k++;for(var b=isNaN(d.colSpan)?1:d.colSpan,d=isNaN(d.rowSpan)?1:d.rowSpan,n=0;n<d&&!(l+n>f);n++){h[m+n]||(h[m+n]=[]);for(var r=0;r<b;r++)h[m+n][k+r]=a[l].cells[c]}k+=b-1;if(-1!==e&&k>=e)break}}return h};(function(){function a(a){return CKEDITOR.plugins.widget&&CKEDITOR.plugins.widget.isDomWidget(a)}function l(a,b){var d=a.getAscendant("table"),
1073
+ e:-1;var m=-1,h=[];for(l=l||0;l<=f;l++){m++;!h[m]&&(h[m]=[]);for(var k=-1,c=g;c<=(-1===e?a[l].cells.length-1:e);c++){var d=a[l].cells[c];if(!d)break;for(k++;h[m][k];)k++;for(var b=isNaN(d.colSpan)?1:d.colSpan,d=isNaN(d.rowSpan)?1:d.rowSpan,n=0;n<d&&!(l+n>f);n++){h[m+n]||(h[m+n]=[]);for(var p=0;p<b;p++)h[m+n][k+p]=a[l].cells[c]}k+=b-1;if(-1!==e&&k>=e)break}}return h};(function(){function a(a){return CKEDITOR.plugins.widget&&CKEDITOR.plugins.widget.isDomWidget(a)}function l(a,b){var d=a.getAscendant("table"),
1074
1074
  e=b.getAscendant("table"),f=CKEDITOR.tools.buildTableMap(d),h=c(a),g=c(b),k=[],l={},m,n;d.contains(e)&&(b=b.getAscendant({td:1,th:1}),g=c(b));h>g&&(d=h,h=g,g=d,d=a,a=b,b=d);for(d=0;d<f[h].length;d++)if(a.$===f[h][d]){m=d;break}for(d=0;d<f[g].length;d++)if(b.$===f[g][d]){n=d;break}m>n&&(d=m,m=n,n=d);for(d=h;d<=g;d++)for(h=m;h<=n;h++)e=new CKEDITOR.dom.element(f[d][h]),e.$&&!e.getCustomData("selected_cell")&&(k.push(e),CKEDITOR.dom.element.setMarker(l,e,"selected_cell",!0));CKEDITOR.dom.element.clearAllMarkers(l);
1075
- return k}function g(a){return(a=a.editable().findOne(".cke_table-faked-selection"))&&a.getAscendant("table")}function f(a,b){var c=a.editable().find(".cke_table-faked-selection"),d=a.editable().findOne("[data-cke-table-faked-selection-table]"),e;a.fire("lockSnapshot");a.editable().removeClass("cke_table-faked-selection-editor");for(e=0;e<c.count();e++)c.getItem(e).removeClass("cke_table-faked-selection");d&&d.data("cke-table-faked-selection-table",!1);a.fire("unlockSnapshot");b&&(t={active:!1},a.getSelection().isInTable()&&
1076
- a.getSelection().reset())}function e(a,b){var c=[],d,e;for(e=0;e<b.length;e++)d=a.createRange(),d.setStartBefore(b[e]),d.setEndAfter(b[e]),c.push(d);a.getSelection().selectRanges(c)}function m(a){var b=a.editable().find(".cke_table-faked-selection");1>b.count()||(b=l(b.getItem(0),b.getItem(b.count()-1)),e(a,b))}function h(b,c,d){var h=y(b.getSelection(!0));c=c.is("table")?null:c;var g;(g=t.active&&!t.first)&&!(g=c)&&(g=b.getSelection().getRanges(),g=1<h.length||g[0]&&!g[0].collapsed?!0:!1);if(g)t.first=
1077
- c||h[0],t.dirty=c?!1:1!==h.length;else if(t.active&&c&&t.first.getAscendant("table").equals(c.getAscendant("table"))){h=l(t.first,c);if(!t.dirty&&1===h.length&&!a(d.data.getTarget()))return f(b,"mouseup"===d.name);t.dirty=!0;t.last=c;e(b,h)}}function k(a){var b=(a=a.editor||a.sender.editor)&&a.getSelection(),c=b&&b.getRanges()||[],d=c&&c[0].getEnclosedNode(),d=d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is("img"),e;if(b&&(f(a),b.isInTable()&&b.isFake))if(d)a.getSelection().reset();else if(!c[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")){1===
1075
+ return k}function g(a){return(a=a.editable().findOne(".cke_table-faked-selection"))&&a.getAscendant("table")}function f(a,b){var c=a.editable().find(".cke_table-faked-selection"),d=a.editable().findOne("[data-cke-table-faked-selection-table]"),e;a.fire("lockSnapshot");a.editable().removeClass("cke_table-faked-selection-editor");for(e=0;e<c.count();e++)c.getItem(e).removeClass("cke_table-faked-selection");d&&d.data("cke-table-faked-selection-table",!1);a.fire("unlockSnapshot");b&&(r={active:!1},a.getSelection().isInTable()&&
1076
+ a.getSelection().reset())}function e(a,b){var c=[],d,e;for(e=0;e<b.length;e++)d=a.createRange(),d.setStartBefore(b[e]),d.setEndAfter(b[e]),c.push(d);a.getSelection().selectRanges(c)}function m(a){var b=a.editable().find(".cke_table-faked-selection");1>b.count()||(b=l(b.getItem(0),b.getItem(b.count()-1)),e(a,b))}function h(b,c,d){var h=y(b.getSelection(!0));c=c.is("table")?null:c;var g;(g=r.active&&!r.first)&&!(g=c)&&(g=b.getSelection().getRanges(),g=1<h.length||g[0]&&!g[0].collapsed?!0:!1);if(g)r.first=
1077
+ c||h[0],r.dirty=c?!1:1!==h.length;else if(r.active&&c&&r.first.getAscendant("table").equals(c.getAscendant("table"))){h=l(r.first,c);if(!r.dirty&&1===h.length&&!a(d.data.getTarget()))return f(b,"mouseup"===d.name);r.dirty=!0;r.last=c;e(b,h)}}function k(a){var b=(a=a.editor||a.sender.editor)&&a.getSelection(),c=b&&b.getRanges()||[],d=c&&c[0].getEnclosedNode(),d=d&&d.type==CKEDITOR.NODE_ELEMENT&&d.is("img"),e;if(b&&(f(a),b.isInTable()&&b.isFake))if(d)a.getSelection().reset();else if(!c[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")){1===
1078
1078
  c.length&&c[0]._getTableElement()&&c[0]._getTableElement().is("table")&&(e=c[0]._getTableElement());e=y(b,e);a.fire("lockSnapshot");for(b=0;b<e.length;b++)e[b].addClass("cke_table-faked-selection");0<e.length&&(a.editable().addClass("cke_table-faked-selection-editor"),e[0].getAscendant("table").data("cke-table-faked-selection-table",""));a.fire("unlockSnapshot")}}function c(a){return a.getAscendant("tr",!0).$.rowIndex}function d(b){function c(a,b){return a&&b?a.equals(b)||a.contains(b)||b.contains(a)||
1079
- a.getCommonAncestor(b).is(u):!1}function e(a){return!a.getAscendant("table",!0)&&a.getDocument().equals(l.document)}function k(a,b,c,d){if("mousedown"===a.name&&(CKEDITOR.tools.getMouseButton(a)===CKEDITOR.MOUSE_BUTTON_LEFT||!d))return!0;if(b=a.name===(CKEDITOR.env.gecko?"mousedown":"mouseup")&&!e(a.data.getTarget()))a=a.data.getTarget().getAscendant({td:1,th:1},!0),b=!(a&&a.hasClass("cke_table-faked-selection"));return b}if(b.data.getTarget().getName&&("mouseup"===b.name||!a(b.data.getTarget()))){var l=
1080
- b.editor||b.listenerData.editor,n=l.getSelection(1),r=g(l),p=b.data.getTarget(),q=p&&p.getAscendant({td:1,th:1},!0),p=p&&p.getAscendant("table",!0),u={table:1,thead:1,tbody:1,tfoot:1,tr:1,td:1,th:1};p&&p.hasAttribute("data-cke-tableselection-ignored")||(k(b,n,r,p)&&f(l,!0),!t.active&&"mousedown"===b.name&&CKEDITOR.tools.getMouseButton(b)===CKEDITOR.MOUSE_BUTTON_LEFT&&p&&(t={active:!0},CKEDITOR.document.on("mouseup",d,null,{editor:l})),(q||p)&&h(l,q||p,b),"mouseup"===b.name&&(CKEDITOR.tools.getMouseButton(b)===
1081
- CKEDITOR.MOUSE_BUTTON_LEFT&&(e(b.data.getTarget())||c(r,p))&&m(l),t={active:!1},CKEDITOR.document.removeListener("mouseup",d)))}}function b(a){var b=a.data.getTarget().getAscendant("table",!0);b&&b.hasAttribute("data-cke-tableselection-ignored")||(b=a.data.getTarget().getAscendant({td:1,th:1},!0))&&!b.hasClass("cke_table-faked-selection")&&(a.cancel(),a.data.preventDefault())}function n(a,b){function c(a){a.cancel()}var d=a.getSelection(),e=d.createBookmarks(),f=a.document,h=a.createRange(),g=f.getDocumentElement().$,
1082
- k=CKEDITOR.env.ie&&9>CKEDITOR.env.version,l=a.blockless||CKEDITOR.env.ie?"span":"div",m,n,r,p;f.getById("cke_table_copybin")||(m=f.createElement(l),n=f.createElement(l),n.setAttributes({id:"cke_table_copybin","data-cke-temp":"1"}),m.setStyles({position:"absolute",width:"1px",height:"1px",overflow:"hidden"}),m.setStyle("ltr"==a.config.contentsLangDirection?"left":"right","-5000px"),m.setHtml(a.getSelectedHtml(!0)),a.fire("lockSnapshot"),n.append(m),a.editable().append(n),p=a.on("selectionChange",c,
1083
- null,null,0),k&&(r=g.scrollTop),h.selectNodeContents(m),h.select(),k&&(g.scrollTop=r),setTimeout(function(){n.remove();d.selectBookmarks(e);p.removeListener();a.fire("unlockSnapshot");b&&(a.extractSelectedHtml(),a.fire("saveSnapshot"))},100))}function r(a){var b=a.editor||a.sender.editor,c=b.getSelection();c.isInTable()&&(c.getRanges()[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")||n(b,"cut"===a.name))}function u(a){this._reset();a&&this.setSelectedCells(a)}function p(a,
1084
- b,c){a.on("beforeCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&(c.data.selectedCells=y(a.getSelection()))});a.on("afterCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&c(a,d.data)})}var t={active:!1},q,y,x,z,A;u.prototype={};u.prototype._reset=function(){this.cells={first:null,last:null,all:[]};this.rows={first:null,last:null}};u.prototype.setSelectedCells=function(a){this._reset();a=a.slice(0);this._arraySortByDOMOrder(a);this.cells.all=a;this.cells.first=
1085
- a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};u.prototype.getTableMap=function(){var a=x(this.cells.first),b;a:{b=this.cells.last;var d=b.getAscendant("table"),e=c(b),d=CKEDITOR.tools.buildTableMap(d),f;for(f=0;f<d[e].length;f++)if((new CKEDITOR.dom.element(d[e][f])).equals(b)){b=f;break a}b=void 0}return CKEDITOR.tools.buildTableMap(this._getTable(),c(this.rows.first),a,c(this.rows.last),b)};u.prototype._getTable=function(){return this.rows.first.getAscendant("table")};
1086
- u.prototype.insertRow=function(a,b,c){if("undefined"===typeof a)a=1;else if(0>=a)return;for(var d=this.cells.first.$.cellIndex,e=this.cells.last.$.cellIndex,f=c?[]:this.cells.all,h,g=0;g<a;g++)h=z(c?this.cells.all:f,b),h=CKEDITOR.tools.array.filter(h.find("td, th").toArray(),function(a){return c?!0:a.$.cellIndex>=d&&a.$.cellIndex<=e}),f=b?h.concat(f):f.concat(h);this.setSelectedCells(f)};u.prototype.insertColumn=function(a){function b(a){a=c(a);return a>=f&&a<=h}if("undefined"===typeof a)a=1;else if(0>=
1087
- a)return;for(var d=this.cells,e=d.all,f=c(d.first),h=c(d.last),d=0;d<a;d++)e=e.concat(CKEDITOR.tools.array.filter(A(e),b));this.setSelectedCells(e)};u.prototype.emptyCells=function(a){a=a||this.cells.all;for(var b=0;b<a.length;b++)a[b].setHtml("")};u.prototype._arraySortByDOMOrder=function(a){a.sort(function(a,b){return a.getPosition(b)&CKEDITOR.POSITION_PRECEDING?-1:1})};var w={onPaste:function(a){function b(a){var c=d.createRange();c.selectNodeContents(a);c.select()}function c(a){return Math.max.apply(null,
1079
+ a.getCommonAncestor(b).is(t):!1}function e(a){return!a.getAscendant("table",!0)&&a.getDocument().equals(l.document)}function k(a,b,c,d){if("mousedown"===a.name&&(CKEDITOR.tools.getMouseButton(a)===CKEDITOR.MOUSE_BUTTON_LEFT||!d))return!0;if(b=a.name===(CKEDITOR.env.gecko?"mousedown":"mouseup")&&!e(a.data.getTarget()))a=a.data.getTarget().getAscendant({td:1,th:1},!0),b=!(a&&a.hasClass("cke_table-faked-selection"));return b}if(b.data.getTarget().getName&&("mouseup"===b.name||!a(b.data.getTarget()))){var l=
1080
+ b.editor||b.listenerData.editor,n=l.getSelection(1),p=g(l),q=b.data.getTarget(),v=q&&q.getAscendant({td:1,th:1},!0),q=q&&q.getAscendant("table",!0),t={table:1,thead:1,tbody:1,tfoot:1,tr:1,td:1,th:1};q&&q.hasAttribute("data-cke-tableselection-ignored")||(k(b,n,p,q)&&f(l,!0),!r.active&&"mousedown"===b.name&&CKEDITOR.tools.getMouseButton(b)===CKEDITOR.MOUSE_BUTTON_LEFT&&q&&(r={active:!0},CKEDITOR.document.on("mouseup",d,null,{editor:l})),(v||q)&&h(l,v||q,b),"mouseup"===b.name&&(CKEDITOR.tools.getMouseButton(b)===
1081
+ CKEDITOR.MOUSE_BUTTON_LEFT&&(e(b.data.getTarget())||c(p,q))&&m(l),r={active:!1},CKEDITOR.document.removeListener("mouseup",d)))}}function b(a){var b=a.data.getTarget().getAscendant("table",!0);b&&b.hasAttribute("data-cke-tableselection-ignored")||(b=a.data.getTarget().getAscendant({td:1,th:1},!0))&&!b.hasClass("cke_table-faked-selection")&&(a.cancel(),a.data.preventDefault())}function n(a,b){function c(a){a.cancel()}var d=a.getSelection(),e=d.createBookmarks(),f=a.document,h=a.createRange(),g=f.getDocumentElement().$,
1082
+ k=CKEDITOR.env.ie&&9>CKEDITOR.env.version,l=a.blockless||CKEDITOR.env.ie?"span":"div",m,n,p,q;f.getById("cke_table_copybin")||(m=f.createElement(l),n=f.createElement(l),n.setAttributes({id:"cke_table_copybin","data-cke-temp":"1"}),m.setStyles({position:"absolute",width:"1px",height:"1px",overflow:"hidden"}),m.setStyle("ltr"==a.config.contentsLangDirection?"left":"right","-5000px"),m.setHtml(a.getSelectedHtml(!0)),a.fire("lockSnapshot"),n.append(m),a.editable().append(n),q=a.on("selectionChange",c,
1083
+ null,null,0),k&&(p=g.scrollTop),h.selectNodeContents(m),h.select(),k&&(g.scrollTop=p),setTimeout(function(){n.remove();d.selectBookmarks(e);q.removeListener();a.fire("unlockSnapshot");b&&(a.extractSelectedHtml(),a.fire("saveSnapshot"))},100))}function p(a){var b=a.editor||a.sender.editor,c=b.getSelection();c.isInTable()&&(c.getRanges()[0]._getTableElement({table:1}).hasAttribute("data-cke-tableselection-ignored")||n(b,"cut"===a.name))}function q(a){this._reset();a&&this.setSelectedCells(a)}function v(a,
1084
+ b,c){a.on("beforeCommandExec",function(c){-1!==CKEDITOR.tools.array.indexOf(b,c.data.name)&&(c.data.selectedCells=y(a.getSelection()))});a.on("afterCommandExec",function(d){-1!==CKEDITOR.tools.array.indexOf(b,d.data.name)&&c(a,d.data)})}var r={active:!1},t,y,x,z,B;q.prototype={};q.prototype._reset=function(){this.cells={first:null,last:null,all:[]};this.rows={first:null,last:null}};q.prototype.setSelectedCells=function(a){this._reset();a=a.slice(0);this._arraySortByDOMOrder(a);this.cells.all=a;this.cells.first=
1085
+ a[0];this.cells.last=a[a.length-1];this.rows.first=a[0].getAscendant("tr");this.rows.last=this.cells.last.getAscendant("tr")};q.prototype.getTableMap=function(){var a=x(this.cells.first),b;a:{b=this.cells.last;var d=b.getAscendant("table"),e=c(b),d=CKEDITOR.tools.buildTableMap(d),f;for(f=0;f<d[e].length;f++)if((new CKEDITOR.dom.element(d[e][f])).equals(b)){b=f;break a}b=void 0}return CKEDITOR.tools.buildTableMap(this._getTable(),c(this.rows.first),a,c(this.rows.last),b)};q.prototype._getTable=function(){return this.rows.first.getAscendant("table")};
1086
+ q.prototype.insertRow=function(a,b,c){if("undefined"===typeof a)a=1;else if(0>=a)return;for(var d=this.cells.first.$.cellIndex,e=this.cells.last.$.cellIndex,f=c?[]:this.cells.all,h,g=0;g<a;g++)h=z(c?this.cells.all:f,b),h=CKEDITOR.tools.array.filter(h.find("td, th").toArray(),function(a){return c?!0:a.$.cellIndex>=d&&a.$.cellIndex<=e}),f=b?h.concat(f):f.concat(h);this.setSelectedCells(f)};q.prototype.insertColumn=function(a){function b(a){a=c(a);return a>=f&&a<=h}if("undefined"===typeof a)a=1;else if(0>=
1087
+ a)return;for(var d=this.cells,e=d.all,f=c(d.first),h=c(d.last),d=0;d<a;d++)e=e.concat(CKEDITOR.tools.array.filter(B(e),b));this.setSelectedCells(e)};q.prototype.emptyCells=function(a){a=a||this.cells.all;for(var b=0;b<a.length;b++)a[b].setHtml("")};q.prototype._arraySortByDOMOrder=function(a){a.sort(function(a,b){return a.getPosition(b)&CKEDITOR.POSITION_PRECEDING?-1:1})};var w={onPaste:function(a){function b(a){var c=d.createRange();c.selectNodeContents(a);c.select()}function c(a){return Math.max.apply(null,
1088
1088
  CKEDITOR.tools.array.map(a,function(a){return a.length},0))}var d=a.editor,f=d.getSelection(),h=y(f),g=f.isInTable(!0)&&this.isBoundarySelection(f),k=this.findTableInPastedContent(d,a.data.dataValue),m,n;(function(a,b,c,d){a=a.getRanges();var e=a.length&&a[0]._getTableElement({table:1});if(!b.length||e&&e.hasAttribute("data-cke-tableselection-ignored")||d&&!c)return!1;if(b=!d)(b=a[0])?(b=b.clone(),b.enlarge(CKEDITOR.ENLARGE_ELEMENT),b=(b=b.getEnclosedNode())&&b.is&&b.is(CKEDITOR.dtd.$tableContent)):
1089
- b=void 0,b=!b;return b?!1:!0})(f,h,k,g)&&(h=h[0].getAscendant("table"),m=new u(y(f,h)),d.once("afterPaste",function(){var a;if(n){a=new CKEDITOR.dom.element(n[0][0]);var b=n[n.length-1];a=l(a,new CKEDITOR.dom.element(b[b.length-1]))}else a=m.cells.all;e(d,a)}),k?(a.stop(),g?(m.insertRow(1,1===g,!0),f.selectElement(m.rows.first)):(m.emptyCells(),e(d,m.cells.all)),a=m.getTableMap(),n=CKEDITOR.tools.buildTableMap(k),m.insertRow(n.length-a.length),m.insertColumn(c(n)-c(a)),a=m.getTableMap(),this.pasteTable(m,
1089
+ b=void 0,b=!b;return b?!1:!0})(f,h,k,g)&&(h=h[0].getAscendant("table"),m=new q(y(f,h)),d.once("afterPaste",function(){var a;if(n){a=new CKEDITOR.dom.element(n[0][0]);var b=n[n.length-1];a=l(a,new CKEDITOR.dom.element(b[b.length-1]))}else a=m.cells.all;e(d,a)}),k?(a.stop(),g?(m.insertRow(1,1===g,!0),f.selectElement(m.rows.first)):(m.emptyCells(),e(d,m.cells.all)),a=m.getTableMap(),n=CKEDITOR.tools.buildTableMap(k),m.insertRow(n.length-a.length),m.insertColumn(c(n)-c(a)),a=m.getTableMap(),this.pasteTable(m,
1090
1090
  a,n),d.fire("saveSnapshot"),setTimeout(function(){d.fire("afterPaste")},0)):(b(m.cells.first),d.once("afterPaste",function(){d.fire("lockSnapshot");m.emptyCells(m.cells.all.slice(1));e(d,m.cells.all);d.fire("unlockSnapshot")})))},isBoundarySelection:function(a){a=a.getRanges()[0];var b=a.endContainer.getAscendant("tr",!0);if(b&&a.collapsed){if(a.checkBoundaryOfElement(b,CKEDITOR.START))return 1;if(a.checkBoundaryOfElement(b,CKEDITOR.END))return 2}return 0},findTableInPastedContent:function(a,b){var c=
1091
1091
  a.dataProcessor,d=new CKEDITOR.dom.element("body");c||(c=new CKEDITOR.htmlDataProcessor(a));d.setHtml(c.toHtml(b),{fixForBody:!1});return 1<d.getChildCount()?null:d.findOne("table")},pasteTable:function(a,b,c){var d,e=x(a.cells.first),f=a._getTable(),h={},g,k,l,m;for(l=0;l<c.length;l++)for(g=new CKEDITOR.dom.element(f.$.rows[a.rows.first.$.rowIndex+l]),m=0;m<c[l].length;m++)if(k=new CKEDITOR.dom.element(c[l][m]),d=b[l]&&b[l][m]?new CKEDITOR.dom.element(b[l][m]):null,k&&!k.getCustomData("processed")){if(d&&
1092
1092
  d.getParent())k.replace(d);else if(0===m||c[l][m-1])(d=0!==m?new CKEDITOR.dom.element(c[l][m-1]):null)&&g.equals(d.getParent())?k.insertAfter(d):0<e?g.$.cells[e]?k.insertAfter(new CKEDITOR.dom.element(g.$.cells[e])):g.append(k):g.append(k,!0);CKEDITOR.dom.element.setMarker(h,k,"processed",!0)}else k.getCustomData("processed")&&d&&d.remove();CKEDITOR.dom.element.clearAllMarkers(h)}};CKEDITOR.plugins.tableselection={getCellsBetween:l,keyboardIntegration:function(a){function b(a){var c=a.getEnclosedNode();
1093
1093
  c&&"function"===typeof c.is&&c.is({td:1,th:1})?c.setText(""):a.deleteContents();CKEDITOR.tools.array.forEach(a._find("td"),function(a){a.appendBogus()})}var c=a.editable();c.attachListener(c,"keydown",function(a){function c(b,d){if(!d.length)return null;var f=a.createRange(),h=CKEDITOR.dom.range.mergeRanges(d);CKEDITOR.tools.array.forEach(h,function(a){a.enlarge(CKEDITOR.ENLARGE_ELEMENT)});var g=h[0].getBoundaryNodes(),k=g.startNode,g=g.endNode;if(k&&k.is&&k.is(e)){for(var l=k.getAscendant("table",
1094
- !0),m=k.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l),n=!1,r=function(a){return!k.contains(a)&&a.is&&a.is("td","th")};m&&!r(m);)m=m.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l);!m&&g&&g.is&&!g.is("table")&&g.getNext()&&(m=g.getNext().findOne("td, th"),n=!0);if(m)f["moveToElementEdit"+(n?"Start":"End")](m);else f.setStartBefore(k.getAscendant("table",!0)),f.collapse(!0);h[0].deleteContents();return[f]}if(k)return f.moveToElementEditablePosition(k),[f]}var d={37:1,38:1,39:1,40:1,8:1,46:1,13:1},
1094
+ !0),m=k.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l),n=!1,p=function(a){return!k.contains(a)&&a.is&&a.is("td","th")};m&&!p(m);)m=m.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,l);!m&&g&&g.is&&!g.is("table")&&g.getNext()&&(m=g.getNext().findOne("td, th"),n=!0);if(m)f["moveToElementEdit"+(n?"Start":"End")](m);else f.setStartBefore(k.getAscendant("table",!0)),f.collapse(!0);h[0].deleteContents();return[f]}if(k)return f.moveToElementEditablePosition(k),[f]}var d={37:1,38:1,39:1,40:1,8:1,46:1,13:1},
1095
1095
  e=CKEDITOR.tools.extend({table:1},CKEDITOR.dtd.$tableContent);delete e.td;delete e.th;return function(e){var f=e.data.getKey(),h=e.data.getKeystroke(),g,k=37===f||38==f,l,m,n;if(d[f]&&!a.readOnly&&(g=a.getSelection())&&g.isInTable()&&g.isFake){l=g.getRanges();m=l[0]._getTableElement();n=l[l.length-1]._getTableElement();if(13!==f||a.plugins.enterkey)e.data.preventDefault(),e.cancel();if(36<f&&41>f)l[0].moveToElementEditablePosition(k?m:n,!k),g.selectRanges([l[0]]);else if(13!==f||13===h||h===CKEDITOR.SHIFT+
1096
1096
  13){for(e=0;e<l.length;e++)b(l[e]);(e=c(m,l))?l=e:l[0].moveToElementEditablePosition(m);g.selectRanges(l);13===f&&a.plugins.enterkey?(a.fire("lockSnapshot"),13===h?a.execCommand("enter"):a.execCommand("shiftEnter"),a.fire("unlockSnapshot"),a.fire("saveSnapshot")):13!==f&&a.fire("saveSnapshot")}}}}(a),null,null,-1);c.attachListener(c,"keypress",function(c){var d=a.getSelection(),e=c.data.$.charCode||13===c.data.getKey(),f;if(!a.readOnly&&d&&d.isInTable()&&d.isFake&&e&&!(c.data.getKeystroke()&CKEDITOR.CTRL)){c=
1097
- d.getRanges();e=c[0].getEnclosedNode().getAscendant({td:1,th:1},!0);for(f=0;f<c.length;f++)b(c[f]);e&&(c[0].moveToElementEditablePosition(e),d.selectRanges([c[0]]))}},null,null,-1)}};CKEDITOR.plugins.add("tableselection",{requires:"clipboard,tabletools",isSupportedEnvironment:function(){return!(CKEDITOR.env.ie&&11>CKEDITOR.env.version)},onLoad:function(){q=CKEDITOR.plugins.tabletools;y=q.getSelectedCells;x=q.getCellColIndex;z=q.insertRow;A=q.insertColumn;CKEDITOR.document.appendStyleSheet(this.path+
1097
+ d.getRanges();e=c[0].getEnclosedNode().getAscendant({td:1,th:1},!0);for(f=0;f<c.length;f++)b(c[f]);e&&(c[0].moveToElementEditablePosition(e),d.selectRanges([c[0]]))}},null,null,-1)}};CKEDITOR.plugins.add("tableselection",{requires:"clipboard,tabletools",isSupportedEnvironment:function(){return!(CKEDITOR.env.ie&&11>CKEDITOR.env.version)},onLoad:function(){t=CKEDITOR.plugins.tabletools;y=t.getSelectedCells;x=t.getCellColIndex;z=t.insertRow;B=t.insertColumn;CKEDITOR.document.appendStyleSheet(this.path+
1098
1098
  "styles/tableselection.css")},init:function(a){this.isSupportedEnvironment()&&(a.addContentsCss&&a.addContentsCss(this.path+"styles/tableselection.css"),a.on("contentDom",function(){var c=a.editable(),e=c.isInline()?c:a.document,f={editor:a};c.attachListener(e,"mousedown",d,null,f);c.attachListener(e,"mousemove",d,null,f);c.attachListener(e,"mouseup",d,null,f);c.attachListener(c,"dragstart",b);c.attachListener(a,"selectionCheck",k);CKEDITOR.plugins.tableselection.keyboardIntegration(a);CKEDITOR.plugins.clipboard&&
1099
- !CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(c.attachListener(c,"cut",r),c.attachListener(c,"copy",r))}),a.on("paste",w.onPaste,w),p(a,"rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "),function(a,b){e(a,b.selectedCells)}),p(a,["cellMerge","cellMergeRight","cellMergeDown"],function(a,b){e(a,[b.commandData.cell])}),p(a,["cellDelete"],function(a){f(a,!0)}))}})})();CKEDITOR.plugins.add("taoqtiimage",{init:function(a){a.addCommand("insertQtiImage",
1099
+ !CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(c.attachListener(c,"cut",p),c.attachListener(c,"copy",p))}),a.on("paste",w.onPaste,w),v(a,"rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "),function(a,b){e(a,b.selectedCells)}),v(a,["cellMerge","cellMergeRight","cellMergeDown"],function(a,b){e(a,[b.commandData.cell])}),v(a,["cellDelete"],function(a){f(a,!0)}))}})})();CKEDITOR.plugins.add("taoqtiimage",{init:function(a){a.addCommand("insertQtiImage",
1100
1100
  {exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"img" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiImage",{label:a.lang.insertQtiImage.button,command:"insertQtiImage",icon:this.path+"images/taoqtiimage.png"})}});CKEDITOR.plugins.add("taoqtimaths",{init:function(a){a.addCommand("insertQtiMaths",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&
1101
1101
  (a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"math" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiMaths",{label:a.lang.insertQtiMaths.button,command:"insertQtiMaths",icon:this.path+"images/taoqtimaths.png"})}});CKEDITOR.plugins.add("taoqtimedia",{init:function(a){a.addCommand("insertQtiMedia",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"object" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),
1102
1102
  g.insert.call(a))}});a.ui.addButton("TaoQtiMedia",{label:a.lang.insertQtiMedia.button,command:"insertQtiMedia",icon:this.path+"images/taoqtimedia.png"})}});CKEDITOR.plugins.add("taoqtitable",{requires:"dialog",icons:this.path+"images/taoqtitable.png",hidpi:!1,init:function(a){var l=!0;if("table"===a.element.getAttribute("data-qti-class"))l=!1;else if(a.blockless)return;var g=a.lang.table;a.addCommand("taoqtitable",new CKEDITOR.dialogCommand("taoqtitable",{context:"table",allowedContent:"table[summary];caption tbody thead tfoot;th td tr[scope];"+
@@ -1109,52 +1109,52 @@ a.editable();c.attachListener(c,"mouseup",function(){h(a)});c.attachListener(c,"
1109
1109
  new CKEDITOR.styleCommand(l,{contentForms:g}));a.ui.addButton("TaoHighlight",{label:a.lang.spanHighlight.button,command:"spanHighlight",icon:this.path+"images/taohighlight.png"})}});CKEDITOR.plugins.add("taoqtiinclude",{init:function(a){a.addCommand("insertQtiInclude",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"include" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiInclude",
1110
1110
  {label:a.lang.insertQtiInclude.button,command:"insertQtiInclude",icon:this.path+"images/taoqtiimage.png"})}});CKEDITOR.plugins.add("taoqtiprintedvariable",{init:function(a){a.addCommand("insertQtiPrintedVariable",{exec:function(a){var g=a.config.taoQtiItem;"function"===typeof g.insert&&(a.insertHtml('\x3cspan data-new\x3d"true" data-qti-class\x3d"printedVariable" class\x3d"widget-box"\x3e\x26nbsp;\x3c/span\x3e'),g.insert.call(a))}});a.ui.addButton("TaoQtiPrintedVariable",{label:a.lang.insertQtiPrintedVariable.button,
1111
1111
  command:"insertQtiPrintedVariable",icon:this.path+"images/taoqtiprintedvariable.png"})}});CKEDITOR.plugins.add("taofurigana",{init:function(a){function l(a){a=a.getRanges()[0].extractContents().$;return new CKEDITOR.dom.element(a)}function g(a){return a.nodeType===window.Node.TEXT_NODE?a.parentNode:a}function f(a){return null!==a.getAscendant("ruby")}function e(a){var c=a.getSelection();a=c.getNative();var d;if(d=null!==a)d=!(c&&c.isCollapsed())&&c.getRanges()[0]&&!f(c.getRanges()[0].startContainer);
1112
- if(c=d)if(a=!a.isCollapsed&&a.getRangeAt(0)){k=!1;var c=a.cloneContents().childNodes,e;for(e=0;e<c.length;e++)if(d=c[e],!k&&d.nodeType!==window.Node.TEXT_NODE){k=!0;break}if(c=""!==a.toString().trim())c=g(a.startContainer),a=g(a.endContainer),c=c.isSameNode(a);c=c&&!k}else c=!1;return c}function m(b,c,d){b=b.getAscendant("ruby");if(!b)return!1;var e=b.find("rb"),f=b.find("rt");if(e.$.length&&!f.$.length||c&&e.$.length&&f.$.length&&!f.$[0].innerText.trim())return a.fire("saveSnapshot"),a.fire("lockSnapshot"),
1113
- e=new CKEDITOR.dom.element.createFromHtml(e.$[0].innerHTML),e.replace(b),c||(c=new CKEDITOR.dom.range(a.document),c.selectNodeContents(e),d.selectRanges([c])),a.fire("unlockSnapshot"),!0}function h(a){function h(e){c.forEach(function(c){a.getCommand(c).setState(e)});d.forEach(function(a){a.setState(e)})}var g=a.getCommand("rubyFurigana"),k=a.getSelection(),l=k.getRanges()[0];c.length||a.toolbar.forEach(function(a){a.items&&a.items.length&&a.items.forEach(function(a){a.command&&"rubyFurigana"!==a.command?
1114
- c.push(a.command):a.command||"undefined"===typeof a.setState||d.push(a)})});g&&(e(a)?(g.setState(CKEDITOR.TRISTATE_OFF),h(CKEDITOR.TRISTATE_OFF)):k.getRanges()[0]&&f(l.startContainer)?m(l.startContainer,!1,k)?(g.setState(CKEDITOR.TRISTATE_DISABLED),h(CKEDITOR.TRISTATE_OFF)):(g.setState(CKEDITOR.TRISTATE_ON),setTimeout(function(){h(CKEDITOR.TRISTATE_DISABLED)},150)):(g.setState(CKEDITOR.TRISTATE_DISABLED),h(CKEDITOR.TRISTATE_OFF)))}var k,c=[],d=[];a.addCommand("rubyFurigana",{exec:function(a){var c=
1115
- a.getSelection(),d=c.getRanges()[0],g=d.startContainer,k,t,q;f(g)?(k=g.getAscendant("ruby"),t=k.find("rb"),q=k.find("rt"),m(g,!0)?h(a):t.$.length&&q.$.length&&g.getParent().$===q.$[0]&&null===g.$.nextSibling&&d.endOffset+1>=g.$.length&&(q=new CKEDITOR.dom.range(a.document),k.$.nextSibling?(d=new CKEDITOR.dom.text(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE),d.insertAfter(k),q.moveToElementEditablePosition(d)):q.moveToClosestEditablePosition(k,!0),c.selectRanges([q]),h(a))):e(a)&&(a.fire("saveSnapshot"),
1116
- a.fire("lockSnapshot"),k=new CKEDITOR.dom.element("ruby",a.document),t=new CKEDITOR.dom.element("rb",a.document),t.append(l(c)),q=new CKEDITOR.dom.element("rt",a.document),q.appendHtml("\x26nbsp;"),k.append(t),k.append(q),c=new CKEDITOR.dom.element("span",a.document),q.append(c),q.appendHtml("\x26nbsp;"),a.insertElement(k),q=new CKEDITOR.dom.text("​",a.document),k.append(q),q=new CKEDITOR.dom.range(a.document),q.setStart(c,0),q.collapse(!0),a.getSelection().removeAllRanges(),a.getSelection().selectRanges([q]),
1117
- h(a),a.fire("unlockSnapshot"),c.remove())}});a.on("instanceReady",function(){var b=a.editable();a.getCommand("rubyFurigana").setState(CKEDITOR.TRISTATE_DISABLED);b.attachListener(b,"mouseup",function(){h(a)});b.attachListener(b,"keyup",function(){h(a)})});a.on("blur",function(){for(var b=a.document.find("ruby"),c=!1,d=0;d<b.count();d++){var e=b.getItem(d),f=e.find("rt");f.$.length&&""===f.$[0].innerText.trim()&&(f=e.find("rb"),f.$.length&&(a.fire("saveSnapshot"),a.fire("lockSnapshot"),(new CKEDITOR.dom.element.createFromHtml(f.$[0].innerHTML)).replace(e),
1118
- a.fire("unlockSnapshot"),c=!0))}c&&(a.updateElement(),a.fire("change"),h(a))});a.ui.addButton("TaoFurigana",{label:a.lang.rubyFurigana.button,command:"rubyFurigana",icon:this.path+"images/taofurigana.png"})}});"use strict";(function(){function a(a,d){return CKEDITOR.tools.array.reduce(d,function(a,c){return c(a)},a)}var l=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],g={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function d(a){e.enabled&&!1!==a.data.command.canUndo&&
1119
- e.save()}function b(){e.enabled=a.readOnly?!1:"wysiwyg"==a.mode;e.onChange()}var e=a.undoManager=new f(a),g=e.editingHandler=new h(e),k=a.addCommand("undo",{exec:function(){e.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),m=a.addCommand("redo",{exec:function(){e.redo()&&(a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});a.setKeystroke([[l[0],"undo"],[l[1],"redo"],[l[2],"redo"]]);e.onChange=function(){k.setState(e.undoable()?CKEDITOR.TRISTATE_OFF:
1120
- CKEDITOR.TRISTATE_DISABLED);m.setState(e.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",d);a.on("afterCommandExec",d);a.on("saveSnapshot",function(a){e.save(a.data&&a.data.contentOnly)});a.on("contentDom",g.attachListeners,g);a.on("instanceReady",function(){a.fire("saveSnapshot")});a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&e.save(!0)});a.on("mode",b);a.on("readOnly",b);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",
1121
- toolbar:"undo,10"}),a.ui.addButton("Redo",{label:a.lang.undo.redo,command:"redo",toolbar:"undo,20"}));a.resetUndo=function(){e.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){e.currentImage&&e.update()});a.on("lockSnapshot",function(a){a=a.data;e.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",e.unlock,e)}});CKEDITOR.plugins.undo={};var f=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||
1122
- 20;this.strokesLimit=25;this._filterRules=[];this.editor=a;this.reset();CKEDITOR.env.ie&&this.addFilterRule(function(a){return a.replace(/\s+data-cke-expando=".*?"/g,"")})};f.prototype={type:function(a,d){var b=f.getKeyGroup(a),e=this.strokesRecorded[b]+1;d=d||e>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());d?(e=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[b]=e;this.previousKeyGroup=b},keyGroupChanged:function(a){return f.getKeyGroup(a)!=
1123
- this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,d,b){var f=this.editor;if(this.locked||"ready"!=f.status||"wysiwyg"!=f.mode)return!1;var h=f.editable();if(!h||
1124
- "ready"!=h.status)return!1;h=this.snapshots;d||(d=new e(f));if(!1===d.contents)return!1;if(this.currentImage)if(d.equalsContent(this.currentImage)){if(a||d.equalsSelection(this.currentImage))return!1}else!1!==b&&f.fire("change");h.splice(this.index+1,h.length-this.index-1);h.length==this.limit&&h.shift();this.index=h.push(d)-1;this.currentImage=d;!1!==b&&this.refreshState();return!0},restoreImage:function(a){var d=this.editor,b;a.bookmarks&&(d.focus(),b=d.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);
1125
- a.bookmarks?b.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(b=this.editor.document.getBody().$.createTextRange(),b.collapse(!0),b.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();d.fire("change")},getNextImage:function(a){var d=this.snapshots,b=this.currentImage,e;if(b)if(a)for(e=this.index-1;0<=e;e--){if(a=d[e],!b.equalsContent(a))return a.index=e,a}else for(e=this.index+1;e<d.length;e++)if(a=d[e],!b.equalsContent(a))return a.index=
1126
- e,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||(a=new e(this.editor));for(var d=this.index,b=this.snapshots;0<d&&this.currentImage.equalsContent(b[d-
1127
- 1]);)--d;b.splice(d,this.index-d+1,a);this.index=d;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var d=this.snapshots,b=d[d.length-1];return b.equalsContent(a)&&!b.equalsSelection(a)?(this.currentImage=d[d.length-1]=a,!0):!1},lock:function(a,d){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var b=null;if(d)b=!0;else{var f=new e(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(f)&&(b=f)}this.locked={update:b,level:1}}},
1128
- unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(!0===a)this.update();else if(a){var d=new e(this.editor,!0);a.equalsContent(d)||this.update()}}},addFilterRule:function(a){this._filterRules.push(a)}};f.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};f.keyGroups={PRINTABLE:0,FUNCTIONAL:1};f.isNavigationKey=function(a){return!!f.navigationKeyCodes[a]};f.getKeyGroup=function(a){var d=f.keyGroups;return g[a]?d.FUNCTIONAL:d.PRINTABLE};f.getOppositeKeyGroup=
1129
- function(a){var d=f.keyGroups;return a==d.FUNCTIONAL?d.PRINTABLE:d.FUNCTIONAL};f.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&f.getKeyGroup(a)==f.keyGroups.FUNCTIONAL};var e=CKEDITOR.plugins.undo.Image=function(c,d){this.editor=c;c.fire("beforeUndoImage");var b=c.getSnapshot();b&&(this.contents=a(b,c.undoManager._filterRules));d||(this.bookmarks=(b=b&&c.getSelection())&&b.createBookmarks2(!0));c.fire("afterUndoImage")},m=/\b(?:href|src|name)="[^"]*?"/gi;e.prototype={equalsContent:function(a){var d=
1130
- this.contents;a=a.contents;CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(d=d.replace(m,""),a=a.replace(m,""));return d!=a?!1:!0},equalsSelection:function(a){var d=this.bookmarks;a=a.bookmarks;if(d||a){if(!d||!a||d.length!=a.length)return!1;for(var b=0;b<d.length;b++){var e=d[b],f=a[b];if(e.startOffset!=f.startOffset||e.endOffset!=f.endOffset||!CKEDITOR.tools.arrayCompare(e.start,f.start)||!CKEDITOR.tools.arrayCompare(e.end,f.end))return!1}}return!0}};var h=CKEDITOR.plugins.undo.NativeEditingHandler=
1131
- function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new k;this.lastKeydownImage=null};h.prototype={onKeydown:function(a){var d=a.data.getKey();if(229!==d)if(-1<CKEDITOR.tools.indexOf(l,a.data.getKeystroke()))a.data.preventDefault();else if(this.keyEventsStack.cleanUp(a),a=this.undoManager,this.keyEventsStack.getLast(d)||this.keyEventsStack.push(d),this.lastKeydownImage=new e(a.editor),f.isNavigationKey(d)||this.undoManager.keyGroupChanged(d))if(a.strokesRecorded[0]||a.strokesRecorded[1])a.save(!1,
1132
- this.lastKeydownImage,!1),a.resetType()},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));this.keyEventsStack.increment(a.keyCode);this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var d=this.undoManager;a=a.data.getKey();var b=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);
1133
- if(!(f.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new e(d.editor,!0))))if(0<b)d.type(a);else if(f.isNavigationKey(a))this.onNavigationKey(!0)},onNavigationKey:function(a){var d=this.undoManager;!a&&d.save(!0,null,!1)||d.updateSelection(new e(d.editor));d.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},activateInputEventListener:function(){this.ignoreInputEvent=!1},attachListeners:function(){var a=this.undoManager.editor,d=a.editable(),
1134
- b=this;d.attachListener(d,"keydown",function(a){b.onKeydown(a);if(f.ieFunctionalKeysBug(a.data.getKey()))b.onInput()},null,null,999);d.attachListener(d,CKEDITOR.env.ie?"keypress":"input",b.onInput,b,null,999);d.attachListener(d,"keyup",b.onKeyup,b,null,999);d.attachListener(d,"paste",b.ignoreInputEventListener,b,null,999);d.attachListener(d,"drop",b.ignoreInputEventListener,b,null,999);a.on("afterPaste",b.activateInputEventListener,b,null,999);d.attachListener(d.isInline()?d:a.document.getDocumentElement(),
1135
- "click",function(){b.onNavigationKey()},null,null,999);d.attachListener(this.undoManager.editor,"blur",function(){b.keyEventsStack.remove(9)},null,null,999)}};var k=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};k.prototype={push:function(a){a=this.stack.push({keyCode:a,inputs:0});return this.stack[a-1]},getLastIndex:function(a){if("number"!=typeof a)return this.stack.length-1;for(var d=this.stack.length;d--;)if(this.stack[d].keyCode==a)return d;return-1},getLast:function(a){a=this.getLastIndex(a);
1136
- return-1!=a?this.stack[a]:null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,d=0;a--;)d+=this.stack[a].inputs;return d},cleanUp:function(a){a=a.data.$;a.ctrlKey||a.metaKey||this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}})();
1137
- (function(){function a(a){function f(a){var c=!1;b.attachListener(b,"keydown",function(){var b=g.getBody().getElementsByTag(a);if(!c){for(var d=0;d<b.count();d++)b.getItem(d).setCustomData("retain",!0);c=!0}},null,null,1);b.attachListener(b,"keyup",function(){var b=g.getElementsByTag(a);c&&(1==b.count()&&!b.getItem(0).getCustomData("retain")&&CKEDITOR.tools.isEmpty(b.getItem(0).getAttributes())&&b.getItem(0).remove(1),c=!1)})}var h=this.editor;if(h&&!h.isDetached()){var g=a.document,c=g.body,d=g.getElementById("cke_actscrpt");
1138
- d&&d.parentNode.removeChild(d);(d=g.getElementById("cke_shimscrpt"))&&d.parentNode.removeChild(d);(d=g.getElementById("cke_basetagscrpt"))&&d.parentNode.removeChild(d);c.contentEditable=!0;CKEDITOR.env.ie&&(c.hideFocus=!0,c.disabled=!0,c.removeAttribute("disabled"));delete this._.isLoadingData;this.$=c;g=new CKEDITOR.dom.document(g);this.setup();this.fixInitialSelection();var b=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&g.getDocumentElement().addClass(g.$.compatMode);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&
1139
- h.enterMode!=CKEDITOR.ENTER_P?f("p"):CKEDITOR.env.edge&&15>CKEDITOR.env.version&&h.enterMode!=CKEDITOR.ENTER_DIV&&f("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)g.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){h.editable().focus()})});l(h);try{h.document.$.execCommand("2D-position",!1,!0)}catch(n){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==h.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var b=
1140
- a.data.getKeystroke();if(33==b||34==b)if(CKEDITOR.env.ie)setTimeout(function(){h.getSelection().scrollIntoView()},0);else if(h.window.$.innerHeight>this.$.offsetHeight){var c=h.createRange();c[33==b?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(g,"blur",function(){try{g.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(g,"touchend",function(){a.focus()});c=h.document.getElementsByTag("title").getItem(0);
1141
- c.data("cke-title",c.getText());CKEDITOR.env.ie&&(h.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");h.fire("contentDom");this._.isPendingFocus&&(h.focus(),this._.isPendingFocus=!1);setTimeout(function(){h.fire("dataReady")},0)},0,this)}}function l(a){function f(){var c;a.editable().attachListener(a,"selectionChange",function(){var b=a.getSelection().getSelectedElement();b&&(c&&(c.detachEvent("onresizestart",h),c=null),b.$.attachEvent("onresizestart",
1142
- h),c=b.$)})}function h(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var g=a.document.$;g.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);g.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(c){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&f(a)}function g(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var f=[],h;for(h in CKEDITOR.dtd.$removeEmpty)f.push("html.CSS1Compat "+
1143
- h+"[contenteditable\x3dfalse]");a.push(f.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var f;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",
1112
+ if(c=d)if(a=!a.isCollapsed&&a.getRangeAt(0)){k=!1;var c=a.cloneContents().childNodes,e;for(e=0;e<c.length;e++)if(d=c[e],!k&&d.nodeType!==window.Node.TEXT_NODE){k=!0;break}if(c=""!==a.toString().trim())c=g(a.startContainer),a=g(a.endContainer),c=c.isSameNode(a);c=c&&!k}else c=!1;return c}function m(b,c,d){b=b.getAscendant("ruby");if(!b)return!1;var e=b.find("rb"),f=b.find("rt"),h;if(e.$.length&&!f.$.length||c&&e.$.length&&f.$.length&&!f.$[0].innerText.trim()){a.fire("saveSnapshot");a.fire("lockSnapshot");
1113
+ try{var g=e.count()?e.getItem(0):null,k=g?g.getText():"",l=new CKEDITOR.dom.text(k,a.document);l.replace(b);c||(h=new CKEDITOR.dom.range(a.document),h.selectNodeContents(l),d.selectRanges([h]));a.updateElement();a.fire("change")}finally{a.fire("unlockSnapshot")}return!0}}function h(a){function h(e){c.forEach(function(c){a.getCommand(c).setState(e)});d.forEach(function(a){a.setState(e)})}var g=a.getCommand("rubyFurigana"),k=a.getSelection(),l=k.getRanges()[0];c.length||a.toolbar.forEach(function(a){a.items&&
1114
+ a.items.length&&a.items.forEach(function(a){a.command&&"rubyFurigana"!==a.command?c.push(a.command):a.command||"undefined"===typeof a.setState||d.push(a)})});g&&(e(a)?(g.setState(CKEDITOR.TRISTATE_OFF),h(CKEDITOR.TRISTATE_OFF)):k.getRanges()[0]&&f(l.startContainer)?m(l.startContainer,!1,k)?(g.setState(CKEDITOR.TRISTATE_DISABLED),h(CKEDITOR.TRISTATE_OFF)):(g.setState(CKEDITOR.TRISTATE_ON),setTimeout(function(){h(CKEDITOR.TRISTATE_DISABLED)},150)):(g.setState(CKEDITOR.TRISTATE_DISABLED),h(CKEDITOR.TRISTATE_OFF)))}
1115
+ var k,c=[],d=[];a.addCommand("rubyFurigana",{exec:function(a){var c=a.getSelection(),d=c.getRanges()[0].startContainer,g,k,r;if(f(d))if(g=d.getAscendant("ruby"),k=g.find("rb"),m(d,!0))h(a);else{a.fire("saveSnapshot");a.fire("lockSnapshot");try{var d="",t=k.getItem(0);t&&(d=t.getText());var y=new CKEDITOR.dom.text(d,a.document);y.replace(g);r=new CKEDITOR.dom.range(a.document);r.setStartAfter(y);r.collapse(!0);c.selectRanges([r]);a.updateElement();a.fire("change");h(a)}finally{a.fire("unlockSnapshot")}}else e(a)&&
1116
+ (a.fire("saveSnapshot"),a.fire("lockSnapshot"),g=new CKEDITOR.dom.element("ruby",a.document),k=new CKEDITOR.dom.element("rb",a.document),k.append(l(c)),r=new CKEDITOR.dom.element("rt",a.document),r.appendHtml("\x26nbsp;"),g.append(k),g.append(r),k=new CKEDITOR.dom.element("span",a.document),r.append(k),r.appendHtml("\x26nbsp;"),a.insertElement(g),r=g.getNext(),(!r||r.type===CKEDITOR.NODE_TEXT&&""===r.getText().trim())&&(new CKEDITOR.dom.text("​",a.document)).insertAfter(g),r=new CKEDITOR.dom.range(a.document),
1117
+ r.setStart(k,0),r.collapse(!0),a.getSelection().removeAllRanges(),a.getSelection().selectRanges([r]),h(a),a.fire("unlockSnapshot"),k.remove())}});a.on("instanceReady",function(){var b=a.editable();a.getCommand("rubyFurigana").setState(CKEDITOR.TRISTATE_DISABLED);b.attachListener(b,"mouseup",function(){h(a)});b.attachListener(b,"keyup",function(){h(a)})});a.on("blur",function(){for(var b=a.document.find("ruby"),c=!1,d=0;d<b.count();d++){var e=b.getItem(d),f=e.find("rt");f.$.length&&""===f.$[0].innerText.trim()&&
1118
+ (f=e.find("rb"),f.$.length&&(a.fire("saveSnapshot"),a.fire("lockSnapshot"),(new CKEDITOR.dom.element.createFromHtml(f.$[0].innerHTML)).replace(e),a.fire("unlockSnapshot"),c=!0))}c&&(a.updateElement(),a.fire("change"),h(a))});a.ui.addButton("TaoFurigana",{label:a.lang.rubyFurigana.button,command:"rubyFurigana",icon:this.path+"images/taofurigana.png"})}});"use strict";(function(){function a(a,d){return CKEDITOR.tools.array.reduce(d,function(a,c){return c(a)},a)}var l=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+
1119
+ 89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],g={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function d(a){e.enabled&&!1!==a.data.command.canUndo&&e.save()}function b(){e.enabled=a.readOnly?!1:"wysiwyg"==a.mode;e.onChange()}var e=a.undoManager=new f(a),g=e.editingHandler=new h(e),k=a.addCommand("undo",{exec:function(){e.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),m=a.addCommand("redo",{exec:function(){e.redo()&&(a.selectionChange(),this.fire("afterRedo"))},
1120
+ startDisabled:!0,canUndo:!1});a.setKeystroke([[l[0],"undo"],[l[1],"redo"],[l[2],"redo"]]);e.onChange=function(){k.setState(e.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);m.setState(e.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",d);a.on("afterCommandExec",d);a.on("saveSnapshot",function(a){e.save(a.data&&a.data.contentOnly)});a.on("contentDom",g.attachListeners,g);a.on("instanceReady",function(){a.fire("saveSnapshot")});a.on("beforeModeUnload",
1121
+ function(){"wysiwyg"==a.mode&&e.save(!0)});a.on("mode",b);a.on("readOnly",b);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",toolbar:"undo,10"}),a.ui.addButton("Redo",{label:a.lang.undo.redo,command:"redo",toolbar:"undo,20"}));a.resetUndo=function(){e.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){e.currentImage&&e.update()});a.on("lockSnapshot",function(a){a=a.data;e.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",e.unlock,e)}});CKEDITOR.plugins.undo=
1122
+ {};var f=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||20;this.strokesLimit=25;this._filterRules=[];this.editor=a;this.reset();CKEDITOR.env.ie&&this.addFilterRule(function(a){return a.replace(/\s+data-cke-expando=".*?"/g,"")})};f.prototype={type:function(a,d){var b=f.getKeyGroup(a),e=this.strokesRecorded[b]+1;d=d||e>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());
1123
+ d?(e=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[b]=e;this.previousKeyGroup=b},keyGroupChanged:function(a){return f.getKeyGroup(a)!=this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);
1124
+ this.resetType();this.onChange()},save:function(a,d,b){var f=this.editor;if(this.locked||"ready"!=f.status||"wysiwyg"!=f.mode)return!1;var h=f.editable();if(!h||"ready"!=h.status)return!1;h=this.snapshots;d||(d=new e(f));if(!1===d.contents)return!1;if(this.currentImage)if(d.equalsContent(this.currentImage)){if(a||d.equalsSelection(this.currentImage))return!1}else!1!==b&&f.fire("change");h.splice(this.index+1,h.length-this.index-1);h.length==this.limit&&h.shift();this.index=h.push(d)-1;this.currentImage=
1125
+ d;!1!==b&&this.refreshState();return!0},restoreImage:function(a){var d=this.editor,b;a.bookmarks&&(d.focus(),b=d.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);a.bookmarks?b.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(b=this.editor.document.getBody().$.createTextRange(),b.collapse(!0),b.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();d.fire("change")},getNextImage:function(a){var d=this.snapshots,
1126
+ b=this.currentImage,e;if(b)if(a)for(e=this.index-1;0<=e;e--){if(a=d[e],!b.equalsContent(a))return a.index=e,a}else for(e=this.index+1;e<d.length;e++)if(a=d[e],!b.equalsContent(a))return a.index=e,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=
1127
+ this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||(a=new e(this.editor));for(var d=this.index,b=this.snapshots;0<d&&this.currentImage.equalsContent(b[d-1]);)--d;b.splice(d,this.index-d+1,a);this.index=d;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var d=this.snapshots,b=d[d.length-1];return b.equalsContent(a)&&!b.equalsSelection(a)?(this.currentImage=d[d.length-1]=a,!0):!1},lock:function(a,d){if(this.locked)this.locked.level++;
1128
+ else if(a)this.locked={level:1};else{var b=null;if(d)b=!0;else{var f=new e(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(f)&&(b=f)}this.locked={update:b,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(!0===a)this.update();else if(a){var d=new e(this.editor,!0);a.equalsContent(d)||this.update()}}},addFilterRule:function(a){this._filterRules.push(a)}};f.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};f.keyGroups=
1129
+ {PRINTABLE:0,FUNCTIONAL:1};f.isNavigationKey=function(a){return!!f.navigationKeyCodes[a]};f.getKeyGroup=function(a){var d=f.keyGroups;return g[a]?d.FUNCTIONAL:d.PRINTABLE};f.getOppositeKeyGroup=function(a){var d=f.keyGroups;return a==d.FUNCTIONAL?d.PRINTABLE:d.FUNCTIONAL};f.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&f.getKeyGroup(a)==f.keyGroups.FUNCTIONAL};var e=CKEDITOR.plugins.undo.Image=function(c,d){this.editor=c;c.fire("beforeUndoImage");var b=c.getSnapshot();b&&(this.contents=
1130
+ a(b,c.undoManager._filterRules));d||(this.bookmarks=(b=b&&c.getSelection())&&b.createBookmarks2(!0));c.fire("afterUndoImage")},m=/\b(?:href|src|name)="[^"]*?"/gi;e.prototype={equalsContent:function(a){var d=this.contents;a=a.contents;CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(d=d.replace(m,""),a=a.replace(m,""));return d!=a?!1:!0},equalsSelection:function(a){var d=this.bookmarks;a=a.bookmarks;if(d||a){if(!d||!a||d.length!=a.length)return!1;for(var b=0;b<d.length;b++){var e=d[b],
1131
+ f=a[b];if(e.startOffset!=f.startOffset||e.endOffset!=f.endOffset||!CKEDITOR.tools.arrayCompare(e.start,f.start)||!CKEDITOR.tools.arrayCompare(e.end,f.end))return!1}}return!0}};var h=CKEDITOR.plugins.undo.NativeEditingHandler=function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new k;this.lastKeydownImage=null};h.prototype={onKeydown:function(a){var d=a.data.getKey();if(229!==d)if(-1<CKEDITOR.tools.indexOf(l,a.data.getKeystroke()))a.data.preventDefault();else if(this.keyEventsStack.cleanUp(a),
1132
+ a=this.undoManager,this.keyEventsStack.getLast(d)||this.keyEventsStack.push(d),this.lastKeydownImage=new e(a.editor),f.isNavigationKey(d)||this.undoManager.keyGroupChanged(d))if(a.strokesRecorded[0]||a.strokesRecorded[1])a.save(!1,this.lastKeydownImage,!1),a.resetType()},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));this.keyEventsStack.increment(a.keyCode);this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&
1133
+ (this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var d=this.undoManager;a=a.data.getKey();var b=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);if(!(f.ieFunctionalKeysBug(a)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new e(d.editor,!0))))if(0<b)d.type(a);else if(f.isNavigationKey(a))this.onNavigationKey(!0)},onNavigationKey:function(a){var d=this.undoManager;!a&&d.save(!0,null,!1)||d.updateSelection(new e(d.editor));
1134
+ d.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},activateInputEventListener:function(){this.ignoreInputEvent=!1},attachListeners:function(){var a=this.undoManager.editor,d=a.editable(),b=this;d.attachListener(d,"keydown",function(a){b.onKeydown(a);if(f.ieFunctionalKeysBug(a.data.getKey()))b.onInput()},null,null,999);d.attachListener(d,CKEDITOR.env.ie?"keypress":"input",b.onInput,b,null,999);d.attachListener(d,"keyup",b.onKeyup,b,null,999);d.attachListener(d,"paste",b.ignoreInputEventListener,
1135
+ b,null,999);d.attachListener(d,"drop",b.ignoreInputEventListener,b,null,999);a.on("afterPaste",b.activateInputEventListener,b,null,999);d.attachListener(d.isInline()?d:a.document.getDocumentElement(),"click",function(){b.onNavigationKey()},null,null,999);d.attachListener(this.undoManager.editor,"blur",function(){b.keyEventsStack.remove(9)},null,null,999)}};var k=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};k.prototype={push:function(a){a=this.stack.push({keyCode:a,inputs:0});return this.stack[a-
1136
+ 1]},getLastIndex:function(a){if("number"!=typeof a)return this.stack.length-1;for(var d=this.stack.length;d--;)if(this.stack[d].keyCode==a)return d;return-1},getLast:function(a){a=this.getLastIndex(a);return-1!=a?this.stack[a]:null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=
1137
+ this.stack.length,d=0;a--;)d+=this.stack[a].inputs;return d},cleanUp:function(a){a=a.data.$;a.ctrlKey||a.metaKey||this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}})();(function(){function a(a){function f(a){var c=!1;b.attachListener(b,"keydown",function(){var b=g.getBody().getElementsByTag(a);if(!c){for(var d=0;d<b.count();d++)b.getItem(d).setCustomData("retain",!0);c=!0}},null,null,1);b.attachListener(b,"keyup",function(){var b=g.getElementsByTag(a);c&&(1==b.count()&&!b.getItem(0).getCustomData("retain")&&
1138
+ CKEDITOR.tools.isEmpty(b.getItem(0).getAttributes())&&b.getItem(0).remove(1),c=!1)})}var h=this.editor;if(h&&!h.isDetached()){var g=a.document,c=g.body,d=g.getElementById("cke_actscrpt");d&&d.parentNode.removeChild(d);(d=g.getElementById("cke_shimscrpt"))&&d.parentNode.removeChild(d);(d=g.getElementById("cke_basetagscrpt"))&&d.parentNode.removeChild(d);c.contentEditable=!0;CKEDITOR.env.ie&&(c.hideFocus=!0,c.disabled=!0,c.removeAttribute("disabled"));delete this._.isLoadingData;this.$=c;g=new CKEDITOR.dom.document(g);
1139
+ this.setup();this.fixInitialSelection();var b=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&g.getDocumentElement().addClass(g.$.compatMode);CKEDITOR.env.ie&&!CKEDITOR.env.edge&&h.enterMode!=CKEDITOR.ENTER_P?f("p"):CKEDITOR.env.edge&&15>CKEDITOR.env.version&&h.enterMode!=CKEDITOR.ENTER_DIV&&f("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)g.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){h.editable().focus()})});l(h);try{h.document.$.execCommand("2D-position",
1140
+ !1,!0)}catch(n){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==h.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var b=a.data.getKeystroke();if(33==b||34==b)if(CKEDITOR.env.ie)setTimeout(function(){h.getSelection().scrollIntoView()},0);else if(h.window.$.innerHeight>this.$.offsetHeight){var c=h.createRange();c[33==b?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(g,"blur",function(){try{g.$.selection.empty()}catch(a){}});
1141
+ CKEDITOR.env.iOS&&this.attachListener(g,"touchend",function(){a.focus()});c=h.document.getElementsByTag("title").getItem(0);c.data("cke-title",c.getText());CKEDITOR.env.ie&&(h.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");h.fire("contentDom");this._.isPendingFocus&&(h.focus(),this._.isPendingFocus=!1);setTimeout(function(){h.fire("dataReady")},0)},0,this)}}function l(a){function f(){var c;a.editable().attachListener(a,"selectionChange",
1142
+ function(){var b=a.getSelection().getSelectedElement();b&&(c&&(c.detachEvent("onresizestart",h),c=null),b.$.attachEvent("onresizestart",h),c=b.$)})}function h(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var g=a.document.$;g.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);g.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(c){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&f(a)}function g(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");
1143
+ var f=[],h;for(h in CKEDITOR.dtd.$removeEmpty)f.push("html.CSS1Compat "+h+"[contenteditable\x3dfalse]");a.push(f.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var f;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",
1144
1144
  requiredContent:"body"});a.addMode("wysiwyg",function(g){function h(b){b&&b.removeListener();a.isDestroyed()||a.isDetached()||(a.editable(new f(a,c.$.contentWindow.document.body)),a.setData(a.getData(1),g))}var k="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",k=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(k)+"}())":"",c=CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"'+
1145
- k+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');c.setStyles({width:"100%",height:"100%"});c.addClass("cke_wysiwyg_frame").addClass("cke_reset");k=a.ui.space("contents");k.append(c);var d=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(d)c.on("load",h);var b=a.title,l=a.fire("ariaEditorHelpLabel",{}).label;b&&(CKEDITOR.env.ie&&l&&(b+=", "+l),c.setAttribute("title",b));if(l){var b=CKEDITOR.tools.getNextId(),r=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+b+'" class\x3d"cke_voice_label"\x3e'+
1146
- l+"\x3c/span\x3e");k.append(r,1);c.setAttribute("aria-describedby",b)}a.on("beforeModeUnload",function(a){a.removeListener();r&&r.remove()});c.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!d&&h();a.fire("ariaWidget",c)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var f=this.config,h=f.contentsCss;CKEDITOR.tools.isArray(h)||(f.contentsCss=h?[h]:[]);f.contentsCss.push(a)};f=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=
1145
+ k+'" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');c.setStyles({width:"100%",height:"100%"});c.addClass("cke_wysiwyg_frame").addClass("cke_reset");k=a.ui.space("contents");k.append(c);var d=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;if(d)c.on("load",h);var b=a.title,l=a.fire("ariaEditorHelpLabel",{}).label;b&&(CKEDITOR.env.ie&&l&&(b+=", "+l),c.setAttribute("title",b));if(l){var b=CKEDITOR.tools.getNextId(),p=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+b+'" class\x3d"cke_voice_label"\x3e'+
1146
+ l+"\x3c/span\x3e");k.append(p,1);c.setAttribute("aria-describedby",b)}a.on("beforeModeUnload",function(a){a.removeListener();p&&p.remove()});c.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!d&&h();a.fire("ariaWidget",c)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var f=this.config,h=f.contentsCss;CKEDITOR.tools.isArray(h)||(f.contentsCss=h?[h]:[]);f.contentsCss.push(a)};f=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=
1147
1147
  CKEDITOR.tools.addFunction(function(e){CKEDITOR.tools.setTimeout(a,0,this,e)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,f){var h=this.editor;if(f)this.setHtml(a),this.fixInitialSelection(),h.fire("dataReady");else{this._.isLoadingData=!0;h._.dataStore={id:1};var k=h.config,c=k.fullPage,d=k.docType,b=CKEDITOR.tools.buildStyleHtml(g()).replace(/<style>/,'\x3cstyle data-cke-temp\x3d"1"\x3e');c||(b+=CKEDITOR.tools.buildStyleHtml(h.config.contentsCss));
1148
1148
  var l=k.baseHref?'\x3cbase href\x3d"'+k.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";c&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){h.docType=d=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){h.xmlDeclaration=a;return""}));a=h.dataProcessor.toHtml(a);c?(/<body[\s|>]/.test(a)||(a="\x3cbody\x3e"+a),/<html[\s|>]/.test(a)||(a="\x3chtml\x3e"+a+"\x3c/html\x3e"),/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$\x26\x3ctitle\x3e\x3c/title\x3e")):a=a.replace(/<html[^>]*>/,"$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),
1149
1149
  l&&(a=a.replace(/<head[^>]*?>/,"$\x26"+l)),a=a.replace(/<\/head\s*>/,b+"$\x26"),a=d+a):a=k.docType+'\x3chtml dir\x3d"'+k.contentsLangDirection+'" lang\x3d"'+(k.contentsLanguage||h.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+l+b+"\x3c/head\x3e\x3cbody"+(k.bodyId?' id\x3d"'+k.bodyId+'"':"")+(k.bodyClass?' class\x3d"'+k.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'\x3cbody contenteditable\x3d"true" '),2E4>CKEDITOR.env.version&&
1150
1150
  (a=a.replace(/<body[^>]*>/,"$\x26\x3c!-- cke-content-start --\x3e")));k='\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"'+(CKEDITOR.env.ie?' defer\x3d"defer" ':"")+"\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded\x3d1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"\x3c/script\x3e";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(k+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
1151
- l&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(k+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,k);this.clearCustomData();this.clearListeners();h.fire("contentDomUnload");var r=this.getDocument();try{r.write(a)}catch(u){setTimeout(function(){r.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,h=f.fullPage,g=h&&a.docType,c=h&&a.xmlDeclaration,
1151
+ l&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(k+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,k);this.clearCustomData();this.clearListeners();h.fire("contentDomUnload");var p=this.getDocument();try{p.write(a)}catch(q){setTimeout(function(){p.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,h=f.fullPage,g=h&&a.docType,c=h&&a.xmlDeclaration,
1152
1152
  d=this.getDocument(),h=h?d.getDocumentElement().getOuterHtml():d.getBody().getHtml();CKEDITOR.env.gecko&&f.enterMode!=CKEDITOR.ENTER_BR&&(h=h.replace(/<br>(?=\s*(:?$|<\/body>))/,""));h=a.dataProcessor.toDataFormat(h);c&&(h=c+"\n"+h);g&&(h=g+"\n"+h);return h},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:f.baseProto.focus.call(this)},detach:function(){var a=this.editor,g=a.document,a=a.container.findOne("iframe.cke_wysiwyg_frame");f.baseProto.detach.call(this);this.clearCustomData(this._.expandoNumber);
1153
1153
  g.getDocumentElement().clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);a&&(a.clearCustomData(),(g=a.removeCustomData("onResize"))&&g.removeListener(),a.isDetached()||a.remove())}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.plugins.add("interactionsource",{lang:"en",requires:"dialog",icons:"sourcedialog,sourcedialog-rtl",hidpi:!0,init:function(a){function l(a){if(!a||"function"!==
1154
1154
  typeof a.getName||"div"!==a.getName())return!1;try{var e=a.getAttribute("class")||"",c=a.getAttribute("data-units")||"";if(-1!==e.indexOf("col-12")&&"12"===c)return!0;a=["grid-row","qti-itemBody","item-editor-drop-area"];for(c=0;c<a.length;c++)if(-1!==e.indexOf(a[c]))return!0;return!1}catch(d){return console.error("Error in isBoundaryElement:",d),!1}}function g(a){if(!a||"function"!==typeof a.getName||"function"!==typeof a.getAttribute)return!1;try{if("div"===a.getName()&&!a.getAttribute("data-qti-class")){if(l(a))return!1;
1155
1155
  if("function"===typeof a.hasClass&&a.hasClass("custom-interaction-wrapper"))return!0;if("function"===typeof a.getChildren){var e=a.getChildren();for(a=0;a<e.count();a++){var c=e.getItem(a);if(f(c))return!0}}}return!1}catch(d){return console.error("Error in isCustomWrapperDiv:",d),!1}}function f(a){if(!a||"function"!==typeof a.getAttribute)return!1;try{return a.getAttribute("data-serial")&&a.getAttribute("data-qti-class")}catch(e){return console.error("Error in isInteractionElement:",e),!1}}function e(){try{a.interactionElement=
1156
- null;a.interactionWrapper=null;var e=a.getSelection(),k=e&&e.getStartElement();if(k){var c;if(k)try{for(var d=k,e=!1,k=null;d&&!e;){if(f(d))if(e=!0,a.interactionElement=d,"function"===typeof d.getParent){var b=d.getParent();g(b)?a.interactionWrapper=b:a.interactionWrapper=null}else a.interactionWrapper=null;else g(d)&&(k=d);if("function"===typeof d.getParent){if(d=d.getParent(),l(d))break}else break}if(!e&&k&&"function"===typeof k.getChildren)for(var n=k.getChildren(),b=0;b<n.count();b++){var r=n.getItem(b);
1157
- if(f(r)){a.interactionElement=r;a.interactionWrapper=k;e=!0;break}}c=e}catch(u){console.error("Error in findInteractionFromElement:",u),c=!1}else c=!1;if(c)return!0}var p=a.editable();return p&&m(p)?!0:!1}catch(t){return console.error("Error in findInteractionAndWrapper:",t),!1}}function m(e){if(!e)return!1;try{if(f(e)){a.interactionElement=e;if("function"===typeof e.getParent){var k=e.getParent();g(k)?a.interactionWrapper=k:a.interactionWrapper=null}else a.interactionWrapper=null;return!0}if(g(e)&&
1156
+ null;a.interactionWrapper=null;var e=a.getSelection(),k=e&&e.getStartElement();if(k){var c;if(k)try{for(var d=k,e=!1,k=null;d&&!e;){if(f(d))if(e=!0,a.interactionElement=d,"function"===typeof d.getParent){var b=d.getParent();g(b)?a.interactionWrapper=b:a.interactionWrapper=null}else a.interactionWrapper=null;else g(d)&&(k=d);if("function"===typeof d.getParent){if(d=d.getParent(),l(d))break}else break}if(!e&&k&&"function"===typeof k.getChildren)for(var n=k.getChildren(),b=0;b<n.count();b++){var p=n.getItem(b);
1157
+ if(f(p)){a.interactionElement=p;a.interactionWrapper=k;e=!0;break}}c=e}catch(q){console.error("Error in findInteractionFromElement:",q),c=!1}else c=!1;if(c)return!0}var v=a.editable();return v&&m(v)?!0:!1}catch(r){return console.error("Error in findInteractionAndWrapper:",r),!1}}function m(e){if(!e)return!1;try{if(f(e)){a.interactionElement=e;if("function"===typeof e.getParent){var k=e.getParent();g(k)?a.interactionWrapper=k:a.interactionWrapper=null}else a.interactionWrapper=null;return!0}if(g(e)&&
1158
1158
  "function"===typeof e.getChildren)for(var c=e.getChildren(),k=0;k<c.count();k++){var d=c.getItem(k);if(f(d))return a.interactionElement=d,a.interactionWrapper=e,!0}if("function"===typeof e.getChildren){var b=e.getChildren();for(e=0;e<b.count();e++)if(m(b.getItem(e)))return!0}return!1}catch(l){return console.error("Error in scanForInteractions:",l),!1}}a.addCommand("interactionsource",new CKEDITOR.dialogCommand("interactionsourcedialog"));CKEDITOR.dialog.add("interactionsourcedialog",this.path+"dialogs/interactionsource.js");
1159
1159
  a.ui.addButton("InteractionSource",{label:a.lang.interactionsource.toolbar,command:"interactionsource",icon:"sourcedialog",toolbar:"mode,11"});a.on("selectionChange",function(){e()});a.findInteractionAndWrapper=e}});CKEDITOR.config.plugins="basicstyles,bidi,blockquote,dialogui,dialog,notification,button,toolbar,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,copyformatting,menu,contextmenu,confighelper,dialogadvtab,entities,floatingspace,listblock,richcombo,font,format,htmlwriter,indent,indentlist,indentblock,taotab,taountab,justify,fakeobjects,link,list,liststyle,magicline,pastetools,pastefromlibreoffice,pastefromword,pastetext,removeformat,resize,selectall,sharedspace,sourcearea,sourcedialog,specialchar,stylescombo,tab,table,tabletools,tableselection,taoqtiimage,taoqtimaths,taoqtimedia,taoqtitable,taounderline,taotooltip,taohighlight,taoqtiinclude,taoqtiprintedvariable,taofurigana,undo,wysiwygarea,interactionsource";
1160
1160
  CKEDITOR.config.skin="tao";(function(){var a=function(a,g){var f=CKEDITOR.getUrl("plugins/"+g);a=a.split(",");for(var e=0;e<a.length;e++)CKEDITOR.skin.icons[a[e]]={path:f,offset:-a[++e],bgsize:a[++e]}};CKEDITOR.env.hidpi?a("about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,codesnippet,384,,bgcolor,408,,textcolor,432,,copyformatting,456,,creatediv,480,,docprops-rtl,504,,docprops,528,,easyimagealigncenter,552,,easyimagealignleft,576,,easyimagealignright,600,,easyimagealt,624,,easyimagefull,648,,easyimageside,672,,easyimageupload,696,,embed,720,,embedsemantic,744,,emojipanel,768,,find-rtl,792,,find,816,,replace,840,,flash,864,,button,888,,checkbox,912,,form,936,,hiddenfield,960,,imagebutton,984,,radio,1008,,select-rtl,1032,,select,1056,,textarea-rtl,1080,,textarea,1104,,textfield-rtl,1128,,textfield,1152,,horizontalrule,1176,,iframe,1200,,image,1224,,indent-rtl,1248,,indent,1272,,outdent-rtl,1296,,outdent,1320,,interactionsource,2688,auto,justifyblock,1368,,justifycenter,1392,,justifyleft,1416,,justifyright,1440,,anchor-rtl,1464,,anchor,1488,,link,1512,,unlink,1536,,bulletedlist-rtl,1560,,bulletedlist,1584,,numberedlist-rtl,1608,,numberedlist,1632,,mathjax,1656,,maximize,1680,,newpage-rtl,1704,,newpage,1728,,pagebreak-rtl,1752,,pagebreak,1776,,pastefromword-rtl,1800,,pastefromword,1824,,pastetext-rtl,1848,,pastetext,1872,,placeholder,1896,,preview-rtl,1920,,preview,1944,,print,1968,,removeformat,1992,,save,2016,,selectall,2040,,showblocks-rtl,2064,,showblocks,2088,,smiley,2112,,source-rtl,2136,,source,2160,,sourcedialog-rtl,2184,,sourcedialog,2208,,specialchar,2232,,table,2256,,language,2280,,templates-rtl,2304,,templates,2328,,uicolor,2352,,redo-rtl,2376,,redo,2400,,undo-rtl,2424,,undo,2448,,simplebox,4944,auto",