alpaca
Version:
Alpaca provides the easiest and fastest way to generate interactive forms for the web and mobile devices. It runs simply as HTML5 or more elaborately using Bootstrap, jQuery Mobile or jQuery UI. Alpaca uses Handlebars to process JSON schema and provide
101 lines • 479 kB
JavaScript
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function(){if(!window.CKEDITOR||!window.CKEDITOR.dom)window.CKEDITOR||(window.CKEDITOR=function(){var a={timestamp:"E4KB",version:"4.4.1 (Standard)",revision:"568b5ed",rnd:Math.floor(900*Math.random())+100,_:{pending:[]},status:"unloaded",basePath:function(){var a=window.CKEDITOR_BASEPATH||"";if(!a)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var b=d[c].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(b){a=b[1];break}}-1==a.indexOf(":/")&&"//"!=a.slice(0,
2)&&(a=0===a.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+a:location.href.match(/^[^\?]*\/(?:)/)[0]+a);if(!a)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return a}(),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("?")?"&":"?")+"t="+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?
(document.removeEventListener("DOMContentLoaded",a,!1),d()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),d())}catch(c){}}function d(){for(var a;a=c.shift();)a()}var c=[];return function(d){c.push(d);"complete"===document.readyState&&setTimeout(a,1);if(1==c.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",
a);window.attachEvent("onload",a);d=!1;try{d=!window.frameElement}catch(b){}if(document.documentElement.doScroll&&d){var g=function(){try{document.documentElement.doScroll("left")}catch(d){setTimeout(g,1);return}a()};g()}}}}()},f=window.CKEDITOR_GETURL;if(f){var b=a.getUrl;a.getUrl=function(e){return f.call(a,e)||b.call(a,e)}}return a}()),CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var f=CKEDITOR.event.prototype,b;for(b in f)a[b]==void 0&&(a[b]=f[b])},CKEDITOR.event.prototype=
function(){function a(a){var d=f(this);return d[a]||(d[a]=new b(a))}var f=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},b=function(a){this.name=a;this.listeners=[]};b.prototype={getListenerIndex:function(a){for(var d=0,c=this.listeners;d<c.length;d++)if(c[d].fn==a)return d;return-1}};return{define:function(e,d){var c=a.call(this,e);CKEDITOR.tools.extend(c,d,true)},on:function(e,d,c,b,i){function g(a,k,g,i){a={name:e,sender:this,editor:a,data:k,listenerData:b,
stop:g,cancel:i,removeListener:f};return d.call(c,a)===false?false:a.data}function f(){n.removeListener(e,d)}var k=a.call(this,e);if(k.getListenerIndex(d)<0){k=k.listeners;c||(c=this);isNaN(i)&&(i=10);var n=this;g.fn=d;g.priority=i;for(var o=k.length-1;o>=0;o--)if(k[o].priority<=i){k.splice(o+1,0,g);return{removeListener:f}}k.unshift(g)}return{removeListener:f}},once:function(){var a=arguments[1];arguments[1]=function(d){d.removeListener();return a.apply(this,arguments)};return this.on.apply(this,
arguments)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,d=function(){a=1},c=0,b=function(){c=1};return function(i,g,j){var k=f(this)[i],i=a,n=c;a=c=0;if(k){var o=k.listeners;if(o.length)for(var o=o.slice(0),q,l=0;l<o.length;l++){if(k.errorProof)try{q=o[l].call(this,j,g,d,b)}catch(m){}else q=o[l].call(this,j,g,d,b);q===false?c=1:typeof q!="undefined"&&(g=q);if(a||c)break}}g=c?false:typeof g=="undefined"?
true:g;a=i;c=n;return g}}(),fireOnce:function(a,d,c){d=this.fire(a,d,c);delete f(this)[a];return d},removeListener:function(a,d){var c=f(this)[a];if(c){var b=c.getListenerIndex(d);b>=0&&c.listeners.splice(b,1)}},removeAllListeners:function(){var a=f(this),d;for(d in a)delete a[d]},hasListeners:function(a){return(a=f(this)[a])&&a.listeners.length>0}}}()),CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=
function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fire.call(this,a,f,this)},CKEDITOR.editor.prototype.fireOnce=function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fireOnce.call(this,a,f,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)),CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),f={ie:a.indexOf("trident/")>-1,webkit:a.indexOf(" applewebkit/")>-1,air:a.indexOf(" adobeair/")>
-1,mac:a.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:a.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return false;var a=document.domain,c=window.location.hostname;return a!=c&&a!="["+c+"]"},secure:location.protocol=="https:"};f.gecko=navigator.product=="Gecko"&&!f.webkit&&!f.ie;if(f.webkit)a.indexOf("chrome")>-1?f.chrome=true:f.safari=true;var b=0;if(f.ie){b=f.quirks||!document.documentMode?
parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode;f.ie9Compat=b==9;f.ie8Compat=b==8;f.ie7Compat=b==7;f.ie6Compat=b<7||f.quirks}if(f.gecko){var e=a.match(/rv:([\d\.]+)/);if(e){e=e[1].split(".");b=e[0]*1E4+(e[1]||0)*100+(e[2]||0)*1}}f.air&&(b=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));f.webkit&&(b=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));f.version=b;f.isCompatible=f.iOS&&b>=534||!f.mobile&&(f.ie&&b>6||f.gecko&&b>=2E4||f.air&&b>=1||f.webkit&&b>=522||false);f.hidpi=window.devicePixelRatio>=
2;f.needsBrFiller=f.gecko||f.webkit||f.ie&&b>10;f.needsNbspFiller=f.ie&&b<11;f.cssClass="cke_browser_"+(f.ie?"ie":f.gecko?"gecko":f.webkit?"webkit":"unknown");if(f.quirks)f.cssClass=f.cssClass+" cke_browser_quirks";if(f.ie)f.cssClass=f.cssClass+(" cke_browser_ie"+(f.quirks?"6 cke_browser_iequirks":f.version));if(f.air)f.cssClass=f.cssClass+" cke_browser_air";if(f.iOS)f.cssClass=f.cssClass+" cke_browser_ios";if(f.hidpi)f.cssClass=f.cssClass+" cke_hidpi";return f}()),"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);
CKEDITOR.loadFullCore=function(){if(CKEDITOR.status!="basic_ready")CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=CKEDITOR.loadFullCore,f=CKEDITOR.loadFullCoreTimeout;if(a){CKEDITOR.status=
"basic_ready";a&&a._load?a():f&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},f*1E3)}})})();CKEDITOR.status="basic_loaded"}(),CKEDITOR.dom={},function(){var a=[],f=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",b=/&/g,e=/>/g,d=/</g,c=/"/g,h=/&/g,i=/>/g,g=/</g,j=/"/g;CKEDITOR.on("reset",function(){a=[]});CKEDITOR.tools={arrayCompare:function(a,d){if(!a&&!d)return true;if(!a||!d||a.length!=d.length)return false;for(var c=0;c<
a.length;c++)if(a[c]!=d[c])return false;return true},clone:function(a){var d;if(a&&a instanceof Array){d=[];for(var c=0;c<a.length;c++)d[c]=CKEDITOR.tools.clone(a[c]);return d}if(a===null||typeof a!="object"||a instanceof String||a instanceof Number||a instanceof Boolean||a instanceof Date||a instanceof RegExp)return a;d=new a.constructor;for(c in a)d[c]=CKEDITOR.tools.clone(a[c]);return d},capitalize:function(a,d){return a.charAt(0).toUpperCase()+(d?a.slice(1):a.slice(1).toLowerCase())},extend:function(a){var d=
arguments.length,c,b;if(typeof(c=arguments[d-1])=="boolean")d--;else if(typeof(c=arguments[d-2])=="boolean"){b=arguments[d-1];d=d-2}for(var l=1;l<d;l++){var e=arguments[l],h;for(h in e)if(c===true||a[h]==void 0)if(!b||h in b)a[h]=e[h]}return a},prototypedCopy:function(a){var d=function(){};d.prototype=a;return new d},copy:function(a){var d={},c;for(c in a)d[c]=a[c];return d},isArray:function(a){return Object.prototype.toString.call(a)=="[object Array]"},isEmpty:function(a){for(var d in a)if(a.hasOwnProperty(d))return false;
return true},cssVendorPrefix:function(a,d,c){if(c)return f+a+":"+d+";"+a+":"+d;c={};c[a]=d;c[f+a]=d;return c},cssStyleToDomStyle:function(){var a=document.createElement("div").style,d=typeof a.cssFloat!="undefined"?"cssFloat":typeof a.styleFloat!="undefined"?"styleFloat":"float";return function(a){return a=="float"?d:a.replace(/-./g,function(a){return a.substr(1).toUpperCase()})}}(),buildStyleHtml:function(a){for(var a=[].concat(a),d,c=[],b=0;b<a.length;b++)if(d=a[b])/@import|[{}]/.test(d)?c.push("<style>"+
d+"</style>"):c.push('<link type="text/css" rel=stylesheet href="'+d+'">');return c.join("")},htmlEncode:function(a){return(""+a).replace(b,"&").replace(e,">").replace(d,"<")},htmlDecode:function(a){return a.replace(h,"&").replace(i,">").replace(g,"<")},htmlEncodeAttr:function(a){return a.replace(c,""").replace(d,"<").replace(e,">")},htmlDecodeAttr:function(a){return a.replace(j,'"').replace(g,"<").replace(i,">")},getNextNumber:function(){var a=0;return function(){return++a}}(),
getNextId:function(){return"cke_"+this.getNextNumber()},override:function(a,d){var c=d(a);c.prototype=a.prototype;return c},setTimeout:function(a,d,c,b,l){l||(l=window);c||(c=l);return l.setTimeout(function(){b?a.apply(c,[].concat(b)):a.apply(c)},d||0)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(d){return d.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(d){return d.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(d){return d.replace(a,
"")}}(),indexOf:function(a,d){if(typeof d=="function")for(var c=0,b=a.length;c<b;c++){if(d(a[c]))return c}else{if(a.indexOf)return a.indexOf(d);c=0;for(b=a.length;c<b;c++)if(a[c]===d)return c}return-1},search:function(a,d){var c=CKEDITOR.tools.indexOf(a,d);return c>=0?a[c]:null},bind:function(a,d){return function(){return a.apply(d,arguments)}},createClass:function(a){var d=a.$,c=a.base,b=a.privates||a._,l=a.proto,a=a.statics;!d&&(d=function(){c&&this.base.apply(this,arguments)});if(b)var e=d,d=function(){var a=
this._||(this._={}),d;for(d in b){var c=b[d];a[d]=typeof c=="function"?CKEDITOR.tools.bind(c,this):c}e.apply(this,arguments)};if(c){d.prototype=this.prototypedCopy(c.prototype);d.prototype.constructor=d;d.base=c;d.baseProto=c.prototype;d.prototype.base=function(){this.base=c.prototype.base;c.apply(this,arguments);this.base=arguments.callee}}l&&this.extend(d.prototype,l,true);a&&this.extend(d,a,true);return d},addFunction:function(d,c){return a.push(function(){return d.apply(c||this,arguments)})-1},
removeFunction:function(d){a[d]=null},callFunction:function(d){var c=a[d];return c&&c.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var a=/^-?\d+\.?\d*px$/,d;return function(c){d=CKEDITOR.tools.trim(c+"")+"px";return a.test(d)?d:c||""}}(),convertToPx:function(){var a;return function(d){if(!a){a=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(a)}if(!/%$/.test(d)){a.setStyle("width",
d);return a.$.clientWidth}return d}}(),repeat:function(a,d){return Array(d+1).join(a)},tryThese:function(){for(var a,d=0,c=arguments.length;d<c;d++){var b=arguments[d];try{a=b();break}catch(l){}}return a},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(a){return function(){var d=arguments,c=this;window.setTimeout(function(){a.apply(c,d)},0)}},normalizeCssText:function(a,d){var c=[],b,l=CKEDITOR.tools.parseCssText(a,true,d);for(b in l)c.push(b+":"+l[b]);c.sort();
return c.length?c.join(";")+";":""},convertRgbToHex:function(a){return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(a,d,c,b){a=[d,c,b];for(d=0;d<3;d++)a[d]=("0"+parseInt(a[d],10).toString(16)).slice(-2);return"#"+a.join("")})},parseCssText:function(a,d,c){var b={};if(c){c=new CKEDITOR.dom.element("span");c.setAttribute("style",a);a=CKEDITOR.tools.convertRgbToHex(c.getAttribute("style")||"")}if(!a||a==";")return b;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
function(a,c,e){if(d){c=c.toLowerCase();c=="font-family"&&(e=e.toLowerCase().replace(/["']/g,"").replace(/\s*,\s*/g,","));e=CKEDITOR.tools.trim(e)}b[c]=e});return b},writeCssText:function(a,d){var c,b=[];for(c in a)b.push(c+":"+a[c]);d&&b.sort();return b.join("; ")},objectCompare:function(a,d,c){var b;if(!a&&!d)return true;if(!a||!d)return false;for(b in a)if(a[b]!=d[b])return false;if(!c)for(b in d)if(a[b]!=d[b])return false;return true},objectKeys:function(a){var d=[],c;for(c in a)d.push(c);return d},
convertArrayToObject:function(a,d){var c={};arguments.length==1&&(d=true);for(var b=0,l=a.length;b<l;++b)c[a[b]]=d;return c},fixDomain:function(){for(var a;;)try{a=window.parent.document.domain;break}catch(d){a=a?a.replace(/.+?(?:\.|$)/,""):document.domain;if(!a)break;document.domain=a}return!!a},eventsBuffer:function(a,d){function c(){l=(new Date).getTime();b=false;d()}var b,l=0;return{input:function(){if(!b){var d=(new Date).getTime()-l;d<a?b=setTimeout(c,a-d):c()}},reset:function(){b&&clearTimeout(b);
b=l=0}}},enableHtml5Elements:function(a,d){for(var c=["abbr","article","aside","audio","bdi","canvas","data","datalist","details","figcaption","figure","footer","header","hgroup","mark","meter","nav","output","progress","section","summary","time","video"],b=c.length,l;b--;){l=a.createElement(c[b]);d&&a.appendChild(l)}},checkIfAnyArrayItemMatches:function(a,d){for(var c=0,b=a.length;c<b;++c)if(a[c].match(d))return true;return false},checkIfAnyObjectPropertyMatches:function(a,d){for(var c in a)if(c.match(d))return true;
return false},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="}}(),CKEDITOR.dtd=function(){var a=CKEDITOR.tools.extend,f=function(a,d){for(var c=CKEDITOR.tools.clone(a),b=1;b<arguments.length;b++){var d=arguments[b],e;for(e in d)delete c[e]}return c},b={},e={},d={address:1,article:1,aside:1,blockquote:1,details:1,div:1,dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,
table:1,ul:1},c={command:1,link:1,meta:1,noscript:1,script:1,style:1},h={},i={"#":1},g={center:1,dir:1,noframes:1};a(b,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},i,{acronym:1,applet:1,
basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(e,d,b,g);f={a:f(b,{a:1,button:1}),abbr:b,address:e,area:h,article:a({style:1},e),aside:a({style:1},e),audio:a({source:1,track:1},e),b:b,base:h,bdi:b,bdo:b,blockquote:e,body:e,br:h,button:f(b,{a:1,button:1}),canvas:b,caption:e,cite:b,code:b,col:h,colgroup:{col:1},command:h,datalist:a({option:1},b),dd:e,del:b,details:a({summary:1},e),dfn:b,div:a({style:1},e),dl:{dt:1,dd:1},dt:e,em:b,embed:h,fieldset:a({legend:1},e),figcaption:e,figure:a({figcaption:1},
e),footer:e,form:e,h1:b,h2:b,h3:b,h4:b,h5:b,h6:b,head:a({title:1,base:1},c),header:e,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:h,html:a({head:1,body:1},e,c),i:b,iframe:i,img:h,input:h,ins:b,kbd:b,keygen:h,label:b,legend:b,li:e,link:h,map:e,mark:b,menu:a({li:1},e),meta:h,meter:f(b,{meter:1}),nav:e,noscript:a({link:1,meta:1,style:1},b),object:a({param:1},b),ol:{li:1},optgroup:{option:1},option:i,output:b,p:b,param:h,pre:b,progress:f(b,{progress:1}),q:b,rp:b,rt:b,ruby:a({rp:1,rt:1},b),s:b,samp:b,script:i,
section:a({style:1},e),select:{optgroup:1,option:1},small:b,source:h,span:b,strong:b,style:i,sub:b,summary:b,sup:b,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:e,textarea:i,tfoot:{tr:1},th:e,thead:{tr:1},time:f(b,{time:1}),title:i,tr:{th:1,td:1},track:h,u:b,ul:{li:1},"var":b,video:a({source:1,track:1},e),wbr:h,acronym:b,applet:a({param:1},e),basefont:h,big:b,center:e,dialog:h,dir:{li:1},font:b,isindex:h,noframes:e,strike:b,tt:b};a(f,{$block:a({audio:1,dd:1,dt:1,figcaption:1,
li:1,video:1},d,g),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,
dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:b,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:a({body:1,head:1,html:1},f.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi: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,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,
tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return f}(),CKEDITOR.dom.event=function(a){this.$=a},CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a=a+CKEDITOR.CTRL;this.$.shiftKey&&(a=a+CKEDITOR.SHIFT);this.$.altKey&&(a=a+CKEDITOR.ALT);return a},preventDefault:function(a){var f=this.$;f.preventDefault?f.preventDefault():f.returnValue=false;a&&this.stopPropagation()},stopPropagation:function(){var a=
this.$;a.stopPropagation?a.stopPropagation():a.cancelBubble=true},getTarget:function(){var a=this.$.target||this.$.srcElement;return a?new CKEDITOR.dom.node(a):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var a=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(a.documentElement.scrollLeft||a.body.scrollLeft),y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}},CKEDITOR.CTRL=1114112,CKEDITOR.SHIFT=2228224,CKEDITOR.ALT=
4456448,CKEDITOR.EVENT_PHASE_CAPTURING=1,CKEDITOR.EVENT_PHASE_AT_TARGET=2,CKEDITOR.EVENT_PHASE_BUBBLING=3,CKEDITOR.dom.domObject=function(a){if(a)this.$=a},CKEDITOR.dom.domObject.prototype=function(){var a=function(a,b){return function(e){typeof CKEDITOR!="undefined"&&a.fire(b,new CKEDITOR.dom.event(e))}};return{getPrivate:function(){var a;if(!(a=this.getCustomData("_")))this.setCustomData("_",a={});return a},on:function(f){var b=this.getCustomData("_cke_nativeListeners");if(!b){b={};this.setCustomData("_cke_nativeListeners",
b)}if(!b[f]){b=b[f]=a(this,f);this.$.addEventListener?this.$.addEventListener(f,b,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+f,b)}return CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(a){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(a)){var b=this.getCustomData("_cke_nativeListeners"),e=b&&b[a];if(e){this.$.removeEventListener?this.$.removeEventListener(a,e,false):this.$.detachEvent&&this.$.detachEvent("on"+
a,e);delete b[a]}}},removeAllListeners:function(){var a=this.getCustomData("_cke_nativeListeners"),b;for(b in a){var e=a[b];this.$.detachEvent?this.$.detachEvent("on"+b,e):this.$.removeEventListener&&this.$.removeEventListener(b,e,false);delete a[b]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}(),function(a){var f={};CKEDITOR.on("reset",function(){f={}});a.equals=function(a){try{return a&&a.$===this.$}catch(e){return false}};a.setCustomData=function(a,e){var d=this.getUniqueId();(f[d]||
(f[d]={}))[a]=e;return this};a.getCustomData=function(a){var e=this.$["data-cke-expando"];return(e=e&&f[e])&&a in e?e[a]:null};a.removeCustomData=function(a){var e=this.$["data-cke-expando"],e=e&&f[e],d,c;if(e){d=e[a];c=a in e;delete e[a]}return c?d:null};a.clearCustomData=function(){this.removeAllListeners();var a=this.$["data-cke-expando"];a&&delete f[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)}(CKEDITOR.dom.domObject.prototype),
CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):this},CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject,CKEDITOR.NODE_ELEMENT=1,CKEDITOR.NODE_DOCUMENT=9,CKEDITOR.NODE_TEXT=3,CKEDITOR.NODE_COMMENT=8,CKEDITOR.NODE_DOCUMENT_FRAGMENT=11,CKEDITOR.POSITION_IDENTICAL=
0,CKEDITOR.POSITION_DISCONNECTED=1,CKEDITOR.POSITION_FOLLOWING=2,CKEDITOR.POSITION_PRECEDING=4,CKEDITOR.POSITION_IS_CONTAINED=8,CKEDITOR.POSITION_CONTAINS=16,CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,f){a.append(this,f);return a},clone:function(a,f){var b=this.$.cloneNode(a),e=function(d){d["data-cke-expando"]&&(d["data-cke-expando"]=false);if(d.nodeType==CKEDITOR.NODE_ELEMENT){f||d.removeAttribute("id",false);if(a)for(var d=d.childNodes,c=0;c<d.length;c++)e(d[c])}};e(b);
return new CKEDITOR.dom.node(b)},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);return a},getAddress:function(a){for(var f=[],b=this.getDocument().$.documentElement,e=this.$;e&&e!=b;){var d=e.parentNode;d&&f.unshift(this.getIndex.call({$:e},
a));e=d}return f},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){var f=this.$,b=-1,e;if(!this.$.parentNode)return b;do if(!a||!(f!=this.$&&f.nodeType==CKEDITOR.NODE_TEXT&&(e||!f.nodeValue))){b++;e=f.nodeType==CKEDITOR.NODE_TEXT}while(f=f.previousSibling);return b},getNextSourceNode:function(a,f,b){if(b&&!b.call)var e=b,b=function(a){return!a.equals(e)};var a=!a&&this.getFirst&&this.getFirst(),d;if(!a){if(this.type==
CKEDITOR.NODE_ELEMENT&&b&&b(this,true)===false)return null;a=this.getNext()}for(;!a&&(d=(d||this).getParent());){if(b&&b(d,true)===false)return null;a=d.getNext()}return!a||b&&b(a)===false?null:f&&f!=a.type?a.getNextSourceNode(false,f,b):a},getPreviousSourceNode:function(a,f,b){if(b&&!b.call)var e=b,b=function(a){return!a.equals(e)};var a=!a&&this.getLast&&this.getLast(),d;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&b(this,true)===false)return null;a=this.getPrevious()}for(;!a&&(d=(d||this).getParent());){if(b&&
b(d,true)===false)return null;a=d.getPrevious()}return!a||b&&b(a)===false?null:f&&a.type!=f?a.getPreviousSourceNode(false,f,b):a},getPrevious:function(a){var f=this.$,b;do b=(f=f.previousSibling)&&f.nodeType!=10&&new CKEDITOR.dom.node(f);while(b&&a&&!a(b));return b},getNext:function(a){var f=this.$,b;do b=(f=f.nextSibling)&&new CKEDITOR.dom.node(f);while(b&&a&&!a(b));return b},getParent:function(a){var f=this.$.parentNode;return f&&(f.nodeType==CKEDITOR.NODE_ELEMENT||a&&f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?
new CKEDITOR.dom.node(f):null},getParents:function(a){var f=this,b=[];do b[a?"push":"unshift"](f);while(f=f.getParent());return b},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var f=this.contains?this:this.getParent();do if(f.contains(a))return f;while(f=f.getParent());return null},getPosition:function(a){var f=this.$,b=a.$;if(f.compareDocumentPosition)return f.compareDocumentPosition(b);if(f==b)return CKEDITOR.POSITION_IDENTICAL;if(this.type==
CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(f.contains){if(f.contains(b))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(b.contains(f))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in f)return f.sourceIndex<0||b.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:f.sourceIndex<b.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}for(var f=this.getAddress(),a=a.getAddress(),b=Math.min(f.length,a.length),e=0;e<=b-1;e++)if(f[e]!=
a[e]){if(e<b)return f[e]<a[e]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;break}return f.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,f){var b=this.$,e;if(!f)b=b.parentNode;for(;b;){if(b.nodeName&&(e=b.nodeName.toLowerCase(),typeof a=="string"?e==a:e in a))return new CKEDITOR.dom.node(b);try{b=b.parentNode}catch(d){b=null}}return null},hasAscendant:function(a,f){var b=this.$;if(!f)b=
b.parentNode;for(;b;){if(b.nodeName&&b.nodeName.toLowerCase()==a)return true;b=b.parentNode}return false},move:function(a,f){a.append(this.remove(),f)},remove:function(a){var f=this.$,b=f.parentNode;if(b){if(a)for(;a=f.firstChild;)b.insertBefore(f.removeChild(a),f);b.removeChild(f)}return this},replace:function(a){this.insertBefore(a);a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.ltrim(a.getText()),
b=a.getLength();if(f){if(f.length<b){a.split(b-f.length);this.$.removeChild(this.$.firstChild)}}else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.rtrim(a.getText()),b=a.getLength();if(f){if(f.length<b){a.split(f.length);this.$.lastChild.parentNode.removeChild(this.$.lastChild)}}else{a.remove();continue}}break}if(CKEDITOR.env.needsBrFiller)(a=this.$.lastChild)&&(a.type==1&&a.nodeName.toLowerCase()=="br")&&
a.parentNode.removeChild(a)},isReadOnly:function(){var a=this;this.type!=CKEDITOR.NODE_ELEMENT&&(a=this.getParent());if(a&&typeof a.$.isContentEditable!="undefined")return!(a.$.isContentEditable||a.data("cke-editable"));for(;a;){if(a.data("cke-editable"))break;if(a.getAttribute("contentEditable")=="false")return true;if(a.getAttribute("contentEditable")=="true")break;a=a.getParent()}return!a}}),CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)},CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject,
CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var a=this.$.document,f=a.compatMode=="CSS1Compat";return{width:(f?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(f?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||
a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?new CKEDITOR.dom.element.get(a):null}}),CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)},CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var f=new CKEDITOR.dom.element("link");f.setAttributes({rel:"stylesheet",type:"text/css",
href:a});this.getHead().append(f)}},appendStyleText:function(a){if(this.$.createStyleSheet){var f=this.$.createStyleSheet("");f.cssText=a}else{var b=new CKEDITOR.dom.element("style",this);b.append(new CKEDITOR.dom.text(a,this));this.getHead().append(b)}return f||b.$.sheet},createElement:function(a,f){var b=new CKEDITOR.dom.element(a,this);if(f){f.attributes&&b.setAttributes(f.attributes);f.styles&&b.setStyles(f.styles)}return b},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},
getActive:function(){return new CKEDITOR.dom.element(this.$.activeElement)},getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,f){for(var b=this.$.documentElement,e=0;b&&e<a.length;e++){var d=a[e];if(f)for(var c=-1,h=0;h<b.childNodes.length;h++){var i=b.childNodes[h];if(!(f===true&&i.nodeType==3&&i.previousSibling&&i.previousSibling.nodeType==3)){c++;if(c==d){b=i;break}}}else b=b.childNodes[d]}return b?new CKEDITOR.dom.node(b):null},getElementsByTag:function(a,
f){if((!CKEDITOR.env.ie||document.documentMode>8)&&f)a=f+":"+a;return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),true)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||
this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$&\n<script data-cke-temp="1">('+CKEDITOR.tools.fixDomain+")();<\/script>"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");if(!a){a=this.$.createDocumentFragment();
CKEDITOR.tools.enableHtml5Elements(a,true);this.setCustomData("html5ShivFrag",a)}return a}}),CKEDITOR.dom.nodeList=function(a){this.$=a},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){if(a<0||a>=this.$.length)return null;return(a=this.$[a])?new CKEDITOR.dom.node(a):null}},CKEDITOR.dom.element=function(a,f){typeof a=="string"&&(a=(f?f.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,a)},CKEDITOR.dom.element.get=function(a){return(a=typeof a==
"string"?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(a,f){var b=new CKEDITOR.dom.element("div",f);b.setHtml(a);return b.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(a,f,b,e){var d=f.getCustomData("list_marker_id")||f.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),c=f.getCustomData("list_marker_names")||
f.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[d]=f;c[b]=1;return f.setCustomData(b,e)},CKEDITOR.dom.element.clearAllMarkers=function(a){for(var f in a)CKEDITOR.dom.element.clearMarkers(a,a[f],1)},CKEDITOR.dom.element.clearMarkers=function(a,f,b){var e=f.getCustomData("list_marker_names"),d=f.getCustomData("list_marker_id"),c;for(c in e)f.removeCustomData(c);f.removeCustomData("list_marker_names");if(b){f.removeCustomData("list_marker_id");delete a[d]}},function(){function a(a){var c=
true;if(!a.$.id){a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber();c=false}return function(){c||a.removeAttribute("id")}}function f(a,c){return"#"+a.$.id+" "+c.split(/,\s*/).join(", #"+a.$.id+" ")}function b(a){for(var c=0,b=0,i=e[a].length;b<i;b++)c=c+(parseInt(this.getComputedStyle(e[a][b])||0,10)||0);return c}CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:function(a){var c=this.$.className;c&&(RegExp("(?:^|\\s)"+a+"(?:\\s|$)","").test(c)||(c=c+(" "+a)));
this.$.className=c||a;return this},removeClass:function(a){var c=this.getAttribute("class");if(c){a=RegExp("(?:^|\\s+)"+a+"(?=\\s|$)","i");if(a.test(c))(c=c.replace(a,"").replace(/^\s+/,""))?this.setAttribute("class",c):this.removeAttribute("class")}return this},hasClass:function(a){return RegExp("(?:^|\\s+)"+a+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(a,c){typeof a=="string"&&(a=this.getDocument().createElement(a));c?this.$.insertBefore(a.$,this.$.firstChild):this.$.appendChild(a.$);
return a},appendHtml:function(a){if(this.$.childNodes.length){var c=new CKEDITOR.dom.element("div",this.getDocument());c.setHtml(a);c.moveChildren(this)}else this.setHtml(a)},appendText:function(a){this.$.text!=void 0?this.$.text=this.$.text+a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();if(!a||!a.is||!a.is("br")){a=this.getDocument().createElement("br");
CKEDITOR.env.gecko&&a.setAttribute("type","_moz");this.append(a)}}},breakParent:function(a){var c=new CKEDITOR.dom.range(this.getDocument());c.setStartAfter(this);c.setEndAfter(a);a=c.extractContents();c.insertNode(this.remove());a.insertAfterNode(this)},contains:CKEDITOR.env.ie||CKEDITOR.env.webkit?function(a){var c=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?c.contains(a.getParent().$):c!=a.$&&c.contains(a.$)}:function(a){return!!(this.$.compareDocumentPosition(a.$)&16)},focus:function(){function a(){try{this.$.focus()}catch(d){}}
return function(c){c?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(true));return a.innerHTML},getClientRect:function(){var a=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());!a.width&&(a.width=a.right-a.left);!a.height&&
(a.height=a.bottom-a.top);return a},setHtml:CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(a){try{var c=this.$;if(this.getParent())return c.innerHTML=a;var b=this.getDocument()._getHtml5ShivFrag();b.appendChild(c);c.innerHTML=a;b.removeChild(c);return a}catch(e){this.$.innerHTML="";c=new CKEDITOR.dom.element("body",this.getDocument());c.$.innerHTML=a;for(c=c.getChildren();c.count();)this.append(c.getItem(0));return a}}:function(a){return this.$.innerHTML=a},setText:function(a){CKEDITOR.dom.element.prototype.setText=
this.$.innerText!=void 0?function(a){return this.$.innerText=a}:function(a){return this.$.textContent=a};return this.setText(a)},getAttribute:function(){var a=function(a){return this.$.getAttribute(a,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){switch(a){case "class":a="className";break;case "http-equiv":a="httpEquiv";break;case "name":return this.$.name;case "tabindex":a=this.$.getAttribute(a,2);a!==0&&this.$.tabIndex===0&&(a=null);return a;case "checked":a=
this.$.attributes.getNamedItem(a);return(a.specified?a.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[a];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(a,2)}:a}(),getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:CKEDITOR.env.ie?function(a){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]}:
function(a){var c=this.getWindow().$.getComputedStyle(this.$,null);return c?c.getPropertyValue(a):""},getDtd:function(){var a=CKEDITOR.dtd[this.getName()];this.getDtd=function(){return a};return a},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:CKEDITOR.env.ie?function(){var a=this.$.tabIndex;a===0&&(!CKEDITOR.dtd.$tabIndex[this.getName()]&&parseInt(this.getAttribute("tabindex"),10)!==0)&&(a=-1);return a}:CKEDITOR.env.webkit?function(){var a=this.$.tabIndex;if(a==void 0){a=
parseInt(this.getAttribute("tabindex"),10);isNaN(a)&&(a=-1)}return a}:function(){return this.$.tabIndex},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var a=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&!(document.documentMode>8)){var c=this.$.scopeName;c!="HTML"&&(a=c.toLowerCase()+":"+a)}return(this.getName=
function(){return a})()},getValue:function(){return this.$.value},getFirst:function(a){var c=this.$.firstChild;(c=c&&new CKEDITOR.dom.node(c))&&(a&&!a(c))&&(c=c.getNext(a));return c},getLast:function(a){var c=this.$.lastChild;(c=c&&new CKEDITOR.dom.node(c))&&(a&&!a(c))&&(c=c.getPrevious(a));return c},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},is:function(){var a=this.getName();if(typeof arguments[0]=="object")return!!arguments[0][a];for(var c=0;c<arguments.length;c++)if(arguments[c]==
a)return true;return false},isEditable:function(a){var c=this.getName();if(this.isReadOnly()||this.getComputedStyle("display")=="none"||this.getComputedStyle("visibility")=="hidden"||CKEDITOR.dtd.$nonEditable[c]||CKEDITOR.dtd.$empty[c]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount())return false;if(a!==false){a=CKEDITOR.dtd[c]||CKEDITOR.dtd.span;return!(!a||!a["#"])}return true},isIdentical:function(a){var c=this.clone(0,1),a=a.clone(0,1);c.removeAttributes(["_moz_dirty",
"data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);a.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(c.$.isEqualNode){c.$.style.cssText=CKEDITOR.tools.normalizeCssText(c.$.style.cssText);a.$.style.cssText=CKEDITOR.tools.normalizeCssText(a.$.style.cssText);return c.$.isEqualNode(a.$)}c=c.getOuterHtml();a=a.getOuterHtml();if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&this.is("a")){var b=this.getParent();if(b.type==CKEDITOR.NODE_ELEMENT){b=
b.clone();b.setHtml(c);c=b.getHtml();b.setHtml(a);a=b.getHtml()}}return c==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&this.getComputedStyle("visibility")!="hidden",c,b;if(a&&CKEDITOR.env.webkit){c=this.getWindow();if(!c.equals(CKEDITOR.document.getWindow())&&(b=c.$.frameElement))a=(new CKEDITOR.dom.element(b)).isVisible()}return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return false;for(var a=this.getChildren(),c=0,b=a.count();c<
b;c++){var e=a.getItem(c);if(!(e.type==CKEDITOR.NODE_ELEMENT&&e.data("cke-bookmark"))&&(e.type==CKEDITOR.NODE_ELEMENT&&!e.isEmptyInlineRemoveable()||e.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(e.getText())))return false}return true},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var a=this.$.attributes,c=0;c<a.length;c++){var b=a[c];switch(b.nodeName){case "class":if(this.getAttribute("class"))return true;case "data-cke-expando":continue;default:if(b.specified)return true}}return false}:
function(){var a=this.$.attributes,c=a.length,b={"data-cke-expando":1,_moz_dirty:1};return c>0&&(c>2||!b[a[0].nodeName]||c==2&&!b[a[1].nodeName])},hasAttribute:function(){function a(d){return(d=this.$.attributes.getNamedItem(d))?CKEDITOR.env.ie?d.specified:true:false}return CKEDITOR.env.ie&&CKEDITOR.env.version<8?function(c){return c=="name"?!!this.$.name:a.call(this,c)}:a}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,c){var b=this.$,a=a.$;if(b!=a){var e;if(c)for(;e=
b.lastChild;)a.insertBefore(b.removeChild(e),a.firstChild);else for(;e=b.firstChild;)a.appendChild(b.removeChild(e))}},mergeSiblings:function(){function a(d,b,e){if(b&&b.type==CKEDITOR.NODE_ELEMENT){for(var g=[];b.data("cke-bookmark")||b.isEmptyInlineRemoveable();){g.push(b);b=e?b.getNext():b.getPrevious();if(!b||b.type!=CKEDITOR.NODE_ELEMENT)return}if(d.isIdentical(b)){for(var f=e?d.getLast():d.getFirst();g.length;)g.shift().move(d,!e);b.moveChildren(d,!e);b.remove();f&&f.type==CKEDITOR.NODE_ELEMENT&&
f.mergeSiblings()}}}return function(c){if(c===false||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a")){a(this,this.getNext(),true);a(this,this.getPrevious())}}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var a=function(a,d){this.$.setAttribute(a,d);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(c,b){c=="class"?this.$.className=b:c=="style"?this.$.style.cssText=b:c=="tabindex"?this.$.tabIndex=b:c=="checked"?
this.$.checked=b:c=="contenteditable"?a.call(this,"contentEditable",b):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(c,b){if(c=="src"&&b.match(/^http:\/\//))try{a.apply(this,arguments)}catch(e){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var c in a)this.setAttribute(c,a[c]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&
(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){a=="class"?a="className":a=="tabindex"?a="tabIndex":a=="contenteditable"&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var c=0;c<a.length;c++)this.removeAttribute(a[c]);else for(c in a)a.hasOwnProperty(c)&&this.removeAttribute(c)},removeStyle:function(a){var c=this.$.style;if(!c.removeProperty&&(a=="border"||a=="margin"||a=="padding")){var b=["top","left","right","bottom"],
e;a=="border"&&(e=["color","style","width"]);for(var c=[],g=0;g<b.length;g++)if(e)for(var f=0;f<e.length;f++)c.push([a,b[g],e[f]].join("-"));else c.push([a,b[g]].join("-"));for(a=0;a<c.length;a++)this.removeStyle(c[a])}else{c.removeProperty?c.removeProperty(a):c.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a));this.$.style.cssText||this.removeAttribute("style")}},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){if(CKEDITOR.env.ie&&CKEDITOR.env.version<9){a=Math.round(a*100);this.setStyle("filter",a>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+a+")")}else this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,c=this.getElementsByTag("*"),b=0,e=c.count();b<e;b++){a=c.getItem(b);a.setAttribute("unselectable","on")}}},getPositionedAncestor:function(){for(var a=
this;a.getName()!="html";){if(a.getComputedStyle("position")!="static")return a;a=a.getParent()}return null},getDocumentPosition:function(a){var c=0,b=0,e=this.getDocument(),g=e.getBody(),f=e.$.compatMode=="BackCompat";if(document.documentElement.getBoundingClientRect){var k=this.$.getBoundingClientRect(),n=e.$.documentElement,o=n.clientTop||g.$.clientTop||0,q=n.clientLeft||g.$.clientLeft||0,l=true;if(CKEDITOR.env.ie){l=e.getDocumentElement().contains(this);e=e.getBody().contains(this);l=f&&e||!f&&
l}if(l){c=k.left+(!f&&n.scrollLeft||g.$.scrollLeft);c=c-q;b=k.top+(!f&&n.scrollTop||g.$.scrollTop);b=b-o}}else{g=this;for(e=null;g&&!(g.getName()=="body"||g.getName()=="html");){c=c+(g.$.offsetLeft-g.$.scrollLeft);b=b+(g.$.offsetTop-g.$.scrollTop);if(!g.equals(this)){c=c+(g.$.clientLeft||0);b=b+(g.$.clientTop||0)}for(;e&&!e.equals(g);){c=c-e.$.scrollLeft;b=b-e.$.scrollTop;e=e.getParent()}e=g;g=(k=g.$.offsetParent)?new CKEDITOR.dom.element(k):null}}if(a){g=this.getWindow();e=a.getWindow();if(!g.equals(e)&&
g.$.frameElement){a=(new CKEDITOR.dom.element(g.$.frameElement)).getDocumentPosition(a);c=c+a.x;b=b+a.y}}if(!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!f){c=c+(this.$.clientLeft?1:0);b=b+(this.$.clientTop?1:0)}return{x:c,y:b}},scrollIntoView:function(a){var c=this.getParent();if(c){do{(c.$.clientWidth&&c.$.clientWidth<c.$.scrollWidth||c.$.clientHeight&&c.$.clientHeight<c.$.scrollHeight)&&!c.is("body")&&this.scrollIntoParent(c,a,1);if(c.is("html")){var b=c.getWindow();try{var e=
b.$.frameElement;e&&(c=new CKEDITOR.dom.element(e))}catch(g){}}}while(c=c.getParent())}},scrollIntoParent:function(a,c,b){var e,g,f,k;function n(c,b){if(/body|html/.test(a.getName()))a.getWindow().$.scrollBy(c,b);else{a.$.scrollLeft=a.$.scrollLeft+c;a.$.scrollTop=a.$.scrollTop+b}}function o(a,c){var d={x:0,y:0};if(!a.is(l?"body":"html")){var b=a.$.getBoundingClientRect();d.x=b.left;d.y=b.top}b=a.getWindow();if(!b.equals(c)){b=o(CKEDITOR.dom.element.get(b.$.frameElement),c);d.x=d.x+b.x;d.y=d.y+b.y}return d}
function q(a,c){return parseInt(a.getComputedStyle("margin-"+c)||0,10)||0}!a&&(a=this.getWindow());f=a.getDocument();var l=f.$.compatMode=="BackCompat";a instanceof CKEDITOR.dom.window&&(a=l?f.getBody():f.getDocumentElement());f=a.getWindow();g=o(this,f);var m=o(a,f),v=this.$.offsetHeight;e=this.$.offsetWidth;var t=a.$.clientHeight,s=a.$.clientWidth;f=g.x-q(this,"left")-m.x||0;k=g.y-q(this,"top")-m.y||0;e=g.x+e+q(this,"right")-(m.x+s)||0;g=g.y+v+q(this,"bottom")-(m.y+t)||0;if(k<0||g>0)n(0,c===true?
k:c===false?g:k<0?k:g);if(b&&(f<0||e>0))n(f<0?f:e,0)},setState:function(a,c,b){c=c||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(c+"_on");this.removeClass(c+"_off");this.removeClass(c+"_disabled");b&&this.setAttribute("aria-pressed",true);b&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(c+"_disabled");this.removeClass(c+"_off");this.removeClass(c+"_on");b&&this.setAttribute("aria-disabled",true);b&&this.removeAttribute("aria-pressed");break;default:this.addClass(c+
"_off");this.removeClass(c+"_on");this.removeClass(c+"_disabled");b&&this.removeAttribute("aria-pressed");b&&this.removeAttribute("aria-disabled")}},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){for(var b=this.$.attributes,c=c||{},e=0;e<b.length;e++){var g=b[e],f=g.nodeName.toLowerCase(),k;if(!(f in c))if(f=="checked"&&(k=this.getAttribute(f)))a.setAttribute(f,k);
else if(!CKEDITOR.env.ie||this.hasAttribute(f)){k=this.getAttribute(f);if(k===null)k=g.nodeValue;a.setAttribute(f,k)}}if(this.$.style.cssText!=="")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()&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(c,
b){var d=c.childNodes;if(b>=0&&b<d.length)return d[b]}return function(c){var b=this.$;if(c.slice)for(;c.length>0&&b;)b=a(b,c.shift());else b=a(b,c);return b?new CKEDITOR.dom.node(b):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(a){a.data.getTarget().hasClass("cke_enable_context_menu")||a.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&
this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,c){a="data-"+a;if(c===void 0)return this.getAttribute(a);c===false?this.removeAttribute(a):this.setAttribute(a,c);return null},getEditor:function(){var a=CKEDITOR.instances,c,b;for(c in a){b=a[c];if(b.element.equals(this)&&b.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return b}return null},find:function(b){var c=a(this),b=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(f(this,
b)));c();return b},findOne:function(b){var c=a(this),b=this.$.querySelector(f(this,b));c();return b?new CKEDITOR.dom.element(b):null},forEach:function(a,c,b){if(!b&&(!c||this.type==c))var e=a(this);if(e!==false)for(var b=this.getChildren(),g=0;g<b.count();g++){e=b.getItem(g);e.type==CKEDITOR.NODE_ELEMENT?e.forEach(a,c):(!c||e.type==c)&&a(e)}}});var e={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,e){if(typeof c=="number"){if(e&&(!CKEDITOR.env.ie||!CKEDITOR.env.quirks))c=c-b.call(this,a);this.setStyle(a,c+"px")}};CKEDITOR.dom.element.prototype.getSize=function(a,c){var e=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;c&&(e=e-b.call(this,a));return e}}(),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,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)}},!0,{append:1,appendBogus:1,getFirst:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,mo