CVE-2021-41169 (JavaScript, published 2021-10-21T21:15Z)
Description: value: Sulu is an open-source PHP content management system based on the Symfony framework. In versions before 1.6.43 are subject to stored cross site scripting attacks. HTML input into Tag names is not properly sanitized. Only admin users are allowed to create tags. Users are advised to upgrade.
Severity: LOW (CVSS v3 base score: 4.8)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/sulu/sulu
Files changed:
src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1634826923308.js
src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.js
src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1634826923308.js
src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.js
src/Sulu/Bundle/AdminBundle/Resources/public/js/vendor/husky/husky.js
src/Sulu/Bundle/AdminBundle/Resources/public/js/vendor/husky/husky.min.js
src/Sulu/Bundle/AdminBundle/Resources/views/Admin/index.html.dist.twig
src/Sulu/Bundle/AdminBundle/Resources/views/Security/login.html.dist.twig
Commit message: Merge pull request from GHSA-h58v-g3q6-q9fx



Vulnerable code:
define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1614246819288"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==i.href)return clearInterval(s),n()}},10);i.href=t,e.appendChild(i)};return i.normalize=function(e,t){return e.substr(e.length-4,4)==".css"&&(e=e.substr(0,e.length-4)),t(e)},i.load=function(e,t,r,i){(n?p:d)(t.toUrl(e+".css"),r)},i}),define("config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU)),t=e.sections?e.sections:{};return{set:function(e,n){!!e&&typeof e=="string"&&(t[e]=n)},has:function(e){return!!e&&typeof e=="string"&&t.hasOwnProperty(e)},get:function(e){var n,r=null;return this.has(e)&&(r=t[e],typeof r=="object"&&(n=r instanceof Array?[]:{},r=jQuery.extend(!0,n,r))),r}}}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("<div/>"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('<div class="sulu-header"/>'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r<e.length;r++)t?n[e[r].name]=r:n.push(e[r].name);return n},n="sulu.fields.loaded";e.sandbox.sulu.viewStates={},e.sandbox.sulu.unlockDeleteSuccessLabel=function(){e.sandbox.sulu.viewStates.nodeDeleted=!0},e.sandbox.sulu.triggerDeleteSuccessLabel=function(t){e.sandbox.sulu.viewStates.nodeDeleted===!0&&(t=t||"labels.success.content-deleted-desc",e.sandbox.emit("sulu.labels.success.show",t,"labels.success"),delete e.sandbox.sulu.viewStates.nodeDeleted)},e.sandbox.sulu.loadUrlAndMergeWithSetting=function(r,i,s,o,u){this.sandbox.util.load(s).then(function(s){!!u&&typeof u=="function"&&(s=_.filter(s,u));var a=e.sandbox.sulu.getUserSetting(r),f=s,l=[],c,h,p,d,v,m,g;a?(v=t.call(this,f),m=t.call(this,f),g=t.call(this,f,!0),d=t.call(this,a),this.sandbox.util.foreach(d,function(e,t){h=m.indexOf(e);if(h>=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s<u;)o(r,i[s])},e.sandbox.sulu.createAddressString=function(e){var t="";if(!e&&typeof e!="object")throw new Error("no valid address object");return r=!0,!e.street||(t=i(t,""),t+=e.street),!e.number||(t=i(t," "),t+=e.number),!e.addition||(t=i(t," - "),t+=e.addition),!e.zip||(t=i(t,", "),t+=e.zip),!e.city||(e.city?t=i(t," "):t=i(t,", "),t+=e.city),!e.state||(t=i(t,", "),t+=e.state),!e.country||(t=i(t,", "),typeof e.country=="string"?t+=e.country:t+=e.country.name),t},e.sandbox.sulu.initListToolbarAndList=function(e,t,n,r,i,o){var u=e+"Order",a=e+"Fields",f=e+"DropdownPageSize",l=e+"InfinitePageSize",c=this.sandbox.sulu.getUserSetting(f),h=this.sandbox.sulu.getUserSetting(l),p=this.sandbox.sulu.getUserSetting(u),d=typeof t=="string"?t:null,v=function(e){var t={columnOptions:{data:e,key:a,url:d},instanceName:"content",context:i},v=this.sandbox.util.extend(!0,{},t,n),m={view:"table",pagination:"dropdown",paginationOptions:{},matchings:e,selectedCounter:!0,viewOptions:{table:{noItemsText:"public.empty-list"}}},g={dropdown:{limit:c},"infinite-scroll":{limit:h}},y,b="husky.datagrid.";!c||(m.paginationOptions.dropdown=g.dropdown),!h||(m.paginationOptions.dropdown=g["infinite-scroll"]),y=this.sandbox.util.extend(!0,{},m,r),y.url=s(y.url,p),this.sandbox.emit("sulu.list.preload",y),y.searchInstanceName=y.searchInstanceName||v.instanceName,y.columnOptionsInstanceName=y.columnOptionsInstanceName||v.instanceName,v.datagridInstanceName=y.instanceName,v.listInfoContainerSelector=o,v.searchOptions={storageName:y.storageName||null},this.sandbox.start([{name:"list-toolbar@suluadmin",options:v},{name:"datagrid@husky",options:y}]),!y.instanceName||(b+=y.instanceName+"."),this.sandbox.on(b+"page-size.changed",function(e,t){var n=f;t==="infinite-scroll"&&(n=l),this.sandbox.sulu.saveUserSetting(n,e)}.bind(this)),this.sandbox.on(b+"data.sort",function(e){this.sandbox.sulu.saveUserSetting(u,e)}.bind(this))};d?this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,a,["translation","default","editable","validation","width","type"],d,v.bind(this),function(e){return!e.display||e.display!=="never"}):v.call(this,t)},e.sandbox.sulu.initList=function(e,t,n){this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,e,["translation","default","editable","validation","width","type"],t,function(e){var t={view:"table",pagination:"dropdown",selectedCounter:!0,matchings:e};t=this.sandbox.util.extend(!0,{},t,n),this.sandbox.start([{name:"datagrid@husky",options:t}])}.bind(this))},e.sandbox.sulu.showLoader=function(e){this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#ccc"}}])}}})}(),function(){"use strict";var e=function(e,t,n){var r=t.parent||e,i=t.options||{},s=this.sandbox.util.extend(!0,{},n[r],i);return s.id=e,s};define("aura_extensions/sulu-buttons",[],{initialize:function(t){var n={},r={},i,s;t.sandbox.sulu.buttons={},t.sandbox.sulu.buttons.dropdownItems={},t.sandbox.sulu.buttons.add=function(e,t){if(!!n[e])throw new Error('Sulu.buttons: Button with name "'+e+'" already exists!');n[e]=t},t.sandbox.sulu.buttons.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.dropdownItems.add=function(e,t){if(!!r[e])throw new Error('Sulu.buttons: Dropdown-item with name "'+e+'" already exists!');r[e]=t},t.sandbox.sulu.buttons.dropdownItems.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.dropdownItems.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.get=function(i){var s=[],o;return t.sandbox.util.foreach(Object.keys(i),function(u){o=e.call(t,u,i[u],n);if(!!o.dropdownItems){var a=o.dropdownItems;t.sandbox.dom.isArray(a)||(a=[],t.sandbox.util.foreach(Object.keys(o.dropdownItems),function(n){a.push(e.call(t,n,o.dropdownItems[n],r))}.bind(this))),o.dropdownItems=a}!o||s.push(o)}),s},t.sandbox.sulu.buttons.getApiButton=function(e){return t.sandbox.util.extend(!0,{},n[e])},i=[{name:"add",template:{icon:"plus-circle",title:"public.add-new","class":"highlight",callback:function(){t.sandbox.emit("sulu.toolbar.add")}}},{name:"deleteSelected",template:{icon:"trash-o",title:"public.delete-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"delete",template:{icon:"trash-o",title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"settings",template:{title:"public.settings",icon:"gear",callback:function(){t.sandbox.emit("sulu.toolbar.settings")}}},{name:"export",template:{title:"public.export",icon:"download",callback:function(){var e=$("<div/>");$("body").append(e),App.start([{name:"csv-export@suluadmin",options:{el:e,urlParameter:this.urlParameter,url:this.url}}])}}},{name:"edit",template:{title:"public.edit",icon:"pencil",callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"editSelected",template:{icon:"pencil",title:"public.edit-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"refresh",template:{icon:"refresh",title:"public.refresh",callback:function(){t.sandbox.emit("sulu.toolbar.refresh")}}},{name:"layout",template:{icon:"th-large",title:"public.layout",dropdownOptions:{markSelected:!0},dropdownItems:{smallThumbnails:{},bigThumbnails:{},table:{}}}},{name:"save",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")}}},{name:"toggler",template:{title:"",content:'<div data-aura-component="toggler@husky" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"toggler-on",template:{title:"",content:'<div data-aura-component="toggler@husky" data-checked="true" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"saveWithOptions",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")},dropdownItems:{saveBack:{},saveNew:{}},dropdownOptions:{onlyOnClickOnArrow:!0}}}],s=[{name:"smallThumbnails",template:{title:"sulu.toolbar.small-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-small")}}},{name:"bigThumbnails",template:{title:"sulu.toolbar.big-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-large")}}},{name:"table",template:{title:"sulu.toolbar.table",callback:function(){t.sandbox.emit("sulu.toolbar.change.table")}}},{name:"saveBack",template:{title:"public.save-and-back",callback:function(){t.sandbox.emit("sulu.toolbar.save","back")}}},{name:"saveNew",template:{title:"public.save-and-new",callback:function(){t.sandbox.emit("sulu.toolbar.save","new")}}},{name:"delete",template:{title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}}],t.sandbox.sulu.buttons.push(i),t.sandbox.sulu.buttons.dropdownItems.push(s)}})}(),function(){"use strict";define("aura_extensions/url-manager",["app-config"],function(e){return{name:"url-manager",initialize:function(t){var n=t.sandbox,r={},i=[];n.urlManager={},n.urlManager.setUrl=function(e,t,n,s){r[e]={template:t,handler:n},!s||i.push(s)},n.urlManager.getUrl=function(t,s){var o,u;if(t in r)o=r[t];else for(var a=-1,f=i.length,l;++a<f;){l=i[a](t);if(l in r){o=r[l];break}}return o?(o.handler&&(s=o.handler.call(this,s)),_.extend(s,{languageCode:e.getUser().locale},{}),u=o.template,typeof u=="function"&&(u=o.template.call(this,s)),n.template.parse(u,s)):null}}}})}(),define("aura_extensions/default-extension",[],function(){"use strict";return function(e){e.components.before("initialize",function(){if(!this.defaults)return;!this.defaults.options||(this.options=this.sandbox.util.extend(!0,{},this.defaults.options,this.options));if(!!this.defaults.translations){var e=this.sandbox.util.extend(!0,{},this.defaults.translations,this.options.translations||{});this.translations=this.sandbox.util.object(this.sandbox.util.arrayMap(e,function(e,t){return[t,this.sandbox.translate(e)]}.bind(this)))}if(!!this.defaults.templates){var t=this.sandbox.util.extend(!0,{},this.defaults.templates,this.options.templates||{});this.templates=this.sandbox.util.object(this.sandbox.util.arrayMap(t,function(e,t){return[t,this.sandbox.util.template(e)]}.bind(this)))}})}}),define("aura_extensions/event-extension",[],function(){"use strict";var e=function(e,t,n){return e+(n?n+".":"")+t},t=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(){var e=[].splice.call(arguments,0);e.splice(0,0,r),this.sandbox.emit.apply(this,e)}.bind(this)},n=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.on(r,e)}.bind(this)},r=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.once(r,e)}.bind(this)};return function(i){i.sandbox.events.createEventName=e,i.components.before("initialize",function(){if(!this.events)return;this.events=this.sandbox.util.object(this.sandbox.util.arrayMap(this.events.names,function(e,i){return e.type==="on"?[i,n.call(this,this.events.namespace,e.postFix,e.callback)]:e.type==="once"?[i,r.call(this,this.events.namespace,e.postFix,e.callback)]:[i,t.call(this,this.events.namespace,e.postFix)]}.bind(this)))})}}),define("aura_extensions/sticky-toolbar",[],function(){"use strict";var e={scrollContainerSelector:".content-column > .wrapper .page",fixedClass:"fixed",scrollMarginTop:90,stickyToolbarClass:"sticky-toolbar"},t=function(t,n,r){n>(r||e.scrollMarginTop)?t.addClass(e.fixedClass):t.removeClass(e.fixedClass)};return function(n){n.sandbox.stickyToolbar={enable:function(r,i){r.addClass(e.stickyToolbarClass),n.sandbox.dom.on(e.scrollContainerSelector,"scroll.sticky-toolbar",function(){t(r,n.sandbox.dom.scrollTop(e.scrollContainerSelector),i)})},disable:function(t){t.removeClass(e.stickyToolbarClass),n.sandbox.dom.off(e.scrollContainerSelector,"scroll.sticky-toolbar")},reset:function(t){t.removeClass(e.fixedClass)}},n.components.after("initialize",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.enable(this.$el,typeof this.stickyToolbar=="number"?this.stickyToolbar:null)}),n.components.before("destroy",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.disable(this.$el)})}}),function(e){if(typeof exports=="object"&&typeof module!="undefined")module.exports=e();else if(typeof define=="function"&&define.amd)define("vendor/clipboard/clipboard",[],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.Clipboard=e()}}(function(){var e,t,n;return function r(e,t,n){function i(o,u){if(!t[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,r,e,t,n)}return t[o].exports}var s=typeof require=="function"&&require;for(var o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,n){function s(e,t){while(e&&e.nodeType!==r){if(typeof e.matches=="function"&&e.matches(t))return e;e=e.parentNode}}var r=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}t.exports=s},{}],2:[function(e,t,n){function i(e,t,n,r,i){var o=s.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}function s(e,t,n,i){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&i.call(e,n)}}var r=e("./closest");t.exports=i},{"./closest":1}],3:[function(e,t,n){n.node=function(e){return e!==undefined&&e instanceof HTMLElement&&e.nodeType===1},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return e!==undefined&&(t==="[object NodeList]"||t==="[object HTMLCollection]")&&"length"in e&&(e.length===0||n.node(e[0]))},n.string=function(e){return typeof e=="string"||e instanceof String},n.fn=function(e){var t=Object.prototype.toString.call(e);return t==="[object Function]"}},{}],4:[function(e,t,n){function s(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return o(e,t,n);if(r.nodeList(e))return u(e,t,n);if(r.string(e))return a(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function o(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function u(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function a(e,t,n){return i(document.body,e,t,n)}var r=e("./is"),i=e("delegate");t.exports=s},{"./is":3,delegate:2}],5:[function(e,t,n){function r(e){var t;if(e.nodeName==="SELECT")e.focus(),t=e.value;else if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(e),r.removeAllRanges(),r.addRange(i),t=r.toString()}return t}t.exports=r},{}],6:[function(e,t,n){function r(){}r.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var s=0,o=r.length;s<o;s++)r[s].fn!==t&&r[s].fn._!==t&&i.push(r[s]);return i.length?n[e]=i:delete n[e],this}},t.exports=r},{}],7:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","select"],s);else if(typeof r!="undefined")s(n,t("select"));else{var o={exports:{}};s(o,i.select),i.clipboardAction=o.exports}})(this,function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=r(t),i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(){function e(t){s(this,e),this.resolveOptions(t),this.initSelection()}return o(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=function(e){function t(e,n){f(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.resolveOptions(n),r.listenClick(e),r}return h(t,e),l(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'<div class="sulu-dashboard" data-aura-component="dashboard@suluadmin"/>'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("<div/>"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['<div class="blue-row"></div>','<div class="toolbar-row">','   <div class="left-container '+t.backClass+'">','       <span class="fa-'+t.backIcon+'"></span>',"   </div>",'   <div class="toolbar-container">','       <div class="'+t.toolbarClass+'"></div>',"   </div>",'   <div class="right-container">',"   </div>","</div>"].join(""),tabsRow:['<div class="',t.tabsRowClass,'">','    <div class="',t.tabsClass,'"></div>',"</div>"].join(""),languageChanger:['<div class="language-changer">','   <span class="title"><%= title %></span>','   <span class="dropdown-toggle"></span>',"</div>"].join(""),titleElement:['<div class="'+t.contentTitleClass+'">','   <div class="content-title <% if(!!underline){ %>underlined<% } %>">',"       <h2><%= title %></h2>","   </div>","</div>"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('<div class="'+t.breadcrumbContainerClass+'"/>'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("<div/>"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t<n;)e.push({id:this.sandbox.sulu.locales[t],title:this.sandbox.sulu.locales[t]});return e},startToolbarComponent:function(e,n){var r=this.sandbox.dom.createElement("<div />"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('<div class="'+t.tabsContentClass+'"/>');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e<this.options.scrollDelta?(this.showTabs(),this.oldScrollPosition=e):e>=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('<div class="'+t.tabsLabelContainer+'"/>');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['<span class="breadcrumb">','<% if (!!icon) { %><span class="<%= icon %> icon"></span><% } %><%= title %><span class="fa-chevron-right separator"></span>',"</span>"].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'<div id="column-options-overlay" />'),this.sandbox.start([{name:"column-options@husky",options:{el:"#column-options-overlay",data:this.sandbox.sulu.getUserSetting(this.options.columnOptions.key),hidden:!1,instanceName:this.options.instanceName,trigger:".toggle",header:{title:this.sandbox.translate("list-toolbar.column-options.title")}}}]),e=this.options.instanceName?this.options.instanceName+".":"",this.sandbox.once("husky.column-options."+e+"saved",function(e){this.sandbox.sulu.saveUserSetting(this.options.columnOptions.key,e)}.bind(this))}.bind(this)}},i=function(e,t){var n=e.slice(0),r=[];return this.sandbox.util.foreach(e,function(e){r.push(e.id)}.bind(this)),this.sandbox.util.foreach(t,function(e){var t=r.indexOf(e.id);t<0?n.push(e):n[t]=e}.bind(this)),n},s=function(e,t){if(typeof e=="string")try{e=JSON.parse(e)}catch(n){t[e]?e=t[e].call(this):this.sandbox.logger.log("no template found!")}else typeof e=="function"&&(e=e.call(this));return e},o=function(e){var t,n,i;for(t=-1,n=e.length;++t<n;)i=e[t],i.hasOwnProperty("dropdownItems")&&(i.dropdownItems=o.call(this,i.dropdownItems)),i.hasOwnProperty("type")&&i.type==="columnOptions"&&(e[t]=this.sandbox.util.extend({},r.call(this),i));return e},u=function(e){this.sandbox.dom.addClass(e.el,"list-toolbar"),this.sandbox.start([{name:"toolbar@husky",options:e}])};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.template=s.call(this,this.options.template,t),this.options.listener=s.call(this,this.options.listener,n),!this.options.parentTemplate||(this.options.parentTemplate=s.call(this,this.options.parentTemplate,t),this.options.parentListener=s.call(this,this.options.parentListener,n),this.options.template=i.call(this,this.options.parentTemplate,this.options.template)),this.sandbox.emit("sulu.list-toolbar.extend",this.options.context,this.options.template,this.options.instanceName,this.options.datagridInstanceName,this.options.listInfoContainerSelector),this.options.template=o.call(this,this.options.template);var r,a={groups:this.options.groups,hasSearch:!0,buttons:this.options.template,instanceName:this.options.instanceName,showTitleAsTooltip:this.options.showTitleAsTooltip,showTitle:!1,searchOptions:this.options.searchOptions||{}};this.options.hasOwnProperty("hasSearch")&&(a.hasSearch=this.options.hasSearch),this.options.listener&&this.options.listener.call(this),this.options.parentListener&&this.options.parentListener.call(this),r=this.sandbox.dom.createElement("<div />"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("<div/>"),r;return typeof e!="undefined"?(r=e,this.removeLabelWithId(e)):(this.labelId=this.labelId+1,r=this.labelId),this.sandbox.dom.attr(n,"id","sulu-labels-"+r),this.sandbox.dom.attr(n,"data-id",r),t?this.$navigationLabels.prepend(n):this.sandbox.dom.prepend(this.$el,n),n},removeLabelWithId:function(e){var t=this.labelsById[e];!t||(delete this.labels[t.type][t.description],delete this.labelsById[e],this.sandbox.dom.remove(this.sandbox.dom.find("[data-id='"+e+"']",this.$el)))},showLabel:function(e,t,n,r,i,s){r=r||++this.labelId,this.labels[e][t]?this.sandbox.emit("husky.label."+this.labels[e][t]+".refresh"):(this.startLabelComponent({type:e,description:this.sandbox.translate(t),title:this.sandbox.translate(n),el:this.createLabelContainer(r,i),instanceName:r,autoVanish:s}),this.labels[e][t]=r,this.labelsById[r]={type:e,description:t},this.sandbox.once("husky.label."+r+".destroyed",function(){this.removeLabelWithId(r)}.bind(this)))},startLabelComponent:function(e){this.sandbox.start([{name:"label@husky",options:e}])}}}),define("__component__$sidebar@suluadmin",[],function(){"use strict";var e={instanceName:"",url:"",expandable:!0},t={widgetContainerSelector:"#sulu-widgets",componentClass:"sulu-sidebar",columnSelector:".sidebar-column",fixedWidthClass:"fixed",maxWidthClass:"max",loaderClass:"sidebar-loader",visibleSidebarClass:"has-visible-sidebar",maxSidebarClass:"has-max-sidebar",noVisibleSidebarClass:"has-no-visible-sidebar",hiddenClass:"hidden"},n=function(){return h.call(this,"initialized")},r=function(){return h.call(this,"hide")},i=function(){return h.call(this,"show")},s=function(){return h.call(this,"append-widget")},o=function(){return h.call(this,"prepend-widget")},u=function(){return h.call(this,"set-widget")},a=function(){return h.call(this,"empty")},f=function(){return h.call(this,"change-width")},l=function(){return h.call(this,"add-classes")},c=function(){return h.call(this,"reset-classes")},h=function(e){return"sulu.sidebar."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.widgets=[],this.bindCustomEvents(),this.render(),this.sandbox.emit(n.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.hideColumn()},bindCustomEvents:function(){this.sandbox.on(f.call(this),this.changeWidth.bind(this)),this.sandbox.on(r.call(this),this.hideColumn.bind(this)),this.sandbox.on(i.call(this),this.showColumn.bind(this)),this.sandbox.on(u.call(this),this.setWidget.bind(this)),this.sandbox.on(s.call(this),this.appendWidget.bind(this)),this.sandbox.on(o.call(this),this.prependWidget.bind(this)),this.sandbox.on(a.call(this),this.emptySidebar.bind(this)),this.sandbox.on(c.call(this),this.resetClasses.bind(this)),this.sandbox.on(l.call(this),this.addClasses.bind(this))},resetClasses:function(){this.sandbox.dom.removeClass(this.$el),this.sandbox.dom.addClass(this.$el,t.componentClass)},addClasses:function(e){this.sandbox.dom.addClass(this.$el,e)},changeWidth:function(e){this.width=e,e==="fixed"?this.changeToFixedWidth():e==="max"&&this.changeToMaxWidth(),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.fixedWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.maxWidthClass),this.sandbox.dom.addClass(e,t.fixedWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.prepend(n,e),this.sandbox.dom.removeClass(n,t.maxSidebarClass))},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.maxWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.append(n,e),this.sandbox.dom.addClass(n,t.maxSidebarClass))},hideColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeToFixedWidth(),this.sandbox.dom.removeClass(n,t.visibleSidebarClass),this.sandbox.dom.addClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},showColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeWidth(this.width),this.sandbox.dom.removeClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(n,t.visibleSidebarClass),this.sandbox.dom.removeClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},appendWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t)},prependWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.unshift({url:e,$el:n}),this.sandbox.dom.prepend(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.prepend(this.$el,t)},setWidget:function(e,t){if(!t){if(this.widgets.length!==1||this.widgets[0].url!==e){var n;this.emptySidebar(!1),this.loadWidget(e).then(function(t){if(t===undefined||t===""){this.sandbox.dom.css(this.$el,"display","none");return}n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(this.$el,n),this.sandbox.dom.css(this.$el,"display","block")}.bind(this))}}else t=$(t),this.emptySidebar(!0),this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t),this.sandbox.start(this.$el),this.sandbox.dom.css(this.$el,"display","block")},loadWidget:function(e){var t=this.sandbox.data.deferred();return this.showColumn(),this.startLoader(),this.sandbox.util.load(e,null,"html").then(function(e){this.stopLoader(),t.resolve(e)}.bind(this)),t.promise()},emptySidebar:function(e){while(this.widgets.length>0)this.sandbox.stop(this.widgets[0].$el),this.sandbox.dom.remove(this.widgets[0].$el),this.widgets.splice(0,1);e!==!0&&this.hideColumn()},startLoader:function(){var e=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>');this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#e4e4e4"}}])},stopLoader:function(){this.sandbox.stop(this.$find("."+t.loaderClass))}}}),define("__component__$data-overlay@suluadmin",[],function(){"use strict";var e={instanceName:"",component:""},t={main:['<div class="data-overlay">','<button class="fa-times data-overlay-close btn btn-link"></button>','<div class="data-overlay-content"></div>',"</div>"].join("")},n=function(e){return"sulu.data-overlay."+(this.options.instanceName?this.options.instanceName+".":"")+e},r=function(){return n.call(this,"initialized")},i=function(){return n.call(this,"show")},s=function(){return n.call(this,"hide")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.mainTemplate=this.sandbox.util.template(t.main),this.render(),this.startComponent(),this.bindEvents(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},bindEvents:function(){this.sandbox.on(i.call(this),this.show.bind(this)),this.sandbox.on(s.call(this),this.hide.bind(this))},bindDomEvents:function(){this.$el.on("click",".data-overlay-close",this.hide.bind(this))},render:function(){var e=this.mainTemplate();this.$el.html(e)},startComponent:function(){var e=this.options.component;if(!e)throw new Error("No component defined!");this.sandbox.start([{name:e,options:{el:".data-overlay-content"}}])},show:function(){this.$el.fadeIn(150)},hide:function(){this.$el.fadeOut(150)}}});
define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1614246819288"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==i.href)return clearInterval(s),n()}},10);i.href=t,e.appendChild(i)};return i.normalize=function(e,t){return e.substr(e.length-4,4)==".css"&&(e=e.substr(0,e.length-4)),t(e)},i.load=function(e,t,r,i){(n?p:d)(t.toUrl(e+".css"),r)},i}),define("config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU)),t=e.sections?e.sections:{};return{set:function(e,n){!!e&&typeof e=="string"&&(t[e]=n)},has:function(e){return!!e&&typeof e=="string"&&t.hasOwnProperty(e)},get:function(e){var n,r=null;return this.has(e)&&(r=t[e],typeof r=="object"&&(n=r instanceof Array?[]:{},r=jQuery.extend(!0,n,r))),r}}}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("<div/>"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('<div class="sulu-header"/>'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r<e.length;r++)t?n[e[r].name]=r:n.push(e[r].name);return n},n="sulu.fields.loaded";e.sandbox.sulu.viewStates={},e.sandbox.sulu.unlockDeleteSuccessLabel=function(){e.sandbox.sulu.viewStates.nodeDeleted=!0},e.sandbox.sulu.triggerDeleteSuccessLabel=function(t){e.sandbox.sulu.viewStates.nodeDeleted===!0&&(t=t||"labels.success.content-deleted-desc",e.sandbox.emit("sulu.labels.success.show",t,"labels.success"),delete e.sandbox.sulu.viewStates.nodeDeleted)},e.sandbox.sulu.loadUrlAndMergeWithSetting=function(r,i,s,o,u){this.sandbox.util.load(s).then(function(s){!!u&&typeof u=="function"&&(s=_.filter(s,u));var a=e.sandbox.sulu.getUserSetting(r),f=s,l=[],c,h,p,d,v,m,g;a?(v=t.call(this,f),m=t.call(this,f),g=t.call(this,f,!0),d=t.call(this,a),this.sandbox.util.foreach(d,function(e,t){h=m.indexOf(e);if(h>=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s<u;)o(r,i[s])},e.sandbox.sulu.createAddressString=function(e){var t="";if(!e&&typeof e!="object")throw new Error("no valid address object");return r=!0,!e.street||(t=i(t,""),t+=e.street),!e.number||(t=i(t," "),t+=e.number),!e.addition||(t=i(t," - "),t+=e.addition),!e.zip||(t=i(t,", "),t+=e.zip),!e.city||(e.city?t=i(t," "):t=i(t,", "),t+=e.city),!e.state||(t=i(t,", "),t+=e.state),!e.country||(t=i(t,", "),typeof e.country=="string"?t+=e.country:t+=e.country.name),t},e.sandbox.sulu.initListToolbarAndList=function(e,t,n,r,i,o){var u=e+"Order",a=e+"Fields",f=e+"DropdownPageSize",l=e+"InfinitePageSize",c=this.sandbox.sulu.getUserSetting(f),h=this.sandbox.sulu.getUserSetting(l),p=this.sandbox.sulu.getUserSetting(u),d=typeof t=="string"?t:null,v=function(e){var t={columnOptions:{data:e,key:a,url:d},instanceName:"content",context:i},v=this.sandbox.util.extend(!0,{},t,n),m={view:"table",pagination:"dropdown",paginationOptions:{},matchings:e,selectedCounter:!0,viewOptions:{table:{noItemsText:"public.empty-list"}}},g={dropdown:{limit:c},"infinite-scroll":{limit:h}},y,b="husky.datagrid.";!c||(m.paginationOptions.dropdown=g.dropdown),!h||(m.paginationOptions.dropdown=g["infinite-scroll"]),y=this.sandbox.util.extend(!0,{},m,r),y.url=s(y.url,p),this.sandbox.emit("sulu.list.preload",y),y.searchInstanceName=y.searchInstanceName||v.instanceName,y.columnOptionsInstanceName=y.columnOptionsInstanceName||v.instanceName,v.datagridInstanceName=y.instanceName,v.listInfoContainerSelector=o,v.searchOptions={storageName:y.storageName||null},this.sandbox.start([{name:"list-toolbar@suluadmin",options:v},{name:"datagrid@husky",options:y}]),!y.instanceName||(b+=y.instanceName+"."),this.sandbox.on(b+"page-size.changed",function(e,t){var n=f;t==="infinite-scroll"&&(n=l),this.sandbox.sulu.saveUserSetting(n,e)}.bind(this)),this.sandbox.on(b+"data.sort",function(e){this.sandbox.sulu.saveUserSetting(u,e)}.bind(this))};d?this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,a,["translation","default","editable","validation","width","type"],d,v.bind(this),function(e){return!e.display||e.display!=="never"}):v.call(this,t)},e.sandbox.sulu.initList=function(e,t,n){this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,e,["translation","default","editable","validation","width","type"],t,function(e){var t={view:"table",pagination:"dropdown",selectedCounter:!0,matchings:e};t=this.sandbox.util.extend(!0,{},t,n),this.sandbox.start([{name:"datagrid@husky",options:t}])}.bind(this))},e.sandbox.sulu.showLoader=function(e){this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#ccc"}}])}}})}(),function(){"use strict";var e=function(e,t,n){var r=t.parent||e,i=t.options||{},s=this.sandbox.util.extend(!0,{},n[r],i);return s.id=e,s};define("aura_extensions/sulu-buttons",[],{initialize:function(t){var n={},r={},i,s;t.sandbox.sulu.buttons={},t.sandbox.sulu.buttons.dropdownItems={},t.sandbox.sulu.buttons.add=function(e,t){if(!!n[e])throw new Error('Sulu.buttons: Button with name "'+e+'" already exists!');n[e]=t},t.sandbox.sulu.buttons.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.dropdownItems.add=function(e,t){if(!!r[e])throw new Error('Sulu.buttons: Dropdown-item with name "'+e+'" already exists!');r[e]=t},t.sandbox.sulu.buttons.dropdownItems.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.dropdownItems.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.get=function(i){var s=[],o;return t.sandbox.util.foreach(Object.keys(i),function(u){o=e.call(t,u,i[u],n);if(!!o.dropdownItems){var a=o.dropdownItems;t.sandbox.dom.isArray(a)||(a=[],t.sandbox.util.foreach(Object.keys(o.dropdownItems),function(n){a.push(e.call(t,n,o.dropdownItems[n],r))}.bind(this))),o.dropdownItems=a}!o||s.push(o)}),s},t.sandbox.sulu.buttons.getApiButton=function(e){return t.sandbox.util.extend(!0,{},n[e])},i=[{name:"add",template:{icon:"plus-circle",title:"public.add-new","class":"highlight",callback:function(){t.sandbox.emit("sulu.toolbar.add")}}},{name:"deleteSelected",template:{icon:"trash-o",title:"public.delete-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"delete",template:{icon:"trash-o",title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"settings",template:{title:"public.settings",icon:"gear",callback:function(){t.sandbox.emit("sulu.toolbar.settings")}}},{name:"export",template:{title:"public.export",icon:"download",callback:function(){var e=$("<div/>");$("body").append(e),App.start([{name:"csv-export@suluadmin",options:{el:e,urlParameter:this.urlParameter,url:this.url}}])}}},{name:"edit",template:{title:"public.edit",icon:"pencil",callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"editSelected",template:{icon:"pencil",title:"public.edit-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"refresh",template:{icon:"refresh",title:"public.refresh",callback:function(){t.sandbox.emit("sulu.toolbar.refresh")}}},{name:"layout",template:{icon:"th-large",title:"public.layout",dropdownOptions:{markSelected:!0},dropdownItems:{smallThumbnails:{},bigThumbnails:{},table:{}}}},{name:"save",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")}}},{name:"toggler",template:{title:"",content:'<div data-aura-component="toggler@husky" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"toggler-on",template:{title:"",content:'<div data-aura-component="toggler@husky" data-checked="true" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"saveWithOptions",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")},dropdownItems:{saveBack:{},saveNew:{}},dropdownOptions:{onlyOnClickOnArrow:!0}}}],s=[{name:"smallThumbnails",template:{title:"sulu.toolbar.small-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-small")}}},{name:"bigThumbnails",template:{title:"sulu.toolbar.big-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-large")}}},{name:"table",template:{title:"sulu.toolbar.table",callback:function(){t.sandbox.emit("sulu.toolbar.change.table")}}},{name:"saveBack",template:{title:"public.save-and-back",callback:function(){t.sandbox.emit("sulu.toolbar.save","back")}}},{name:"saveNew",template:{title:"public.save-and-new",callback:function(){t.sandbox.emit("sulu.toolbar.save","new")}}},{name:"delete",template:{title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}}],t.sandbox.sulu.buttons.push(i),t.sandbox.sulu.buttons.dropdownItems.push(s)}})}(),function(){"use strict";define("aura_extensions/url-manager",["app-config"],function(e){return{name:"url-manager",initialize:function(t){var n=t.sandbox,r={},i=[];n.urlManager={},n.urlManager.setUrl=function(e,t,n,s){r[e]={template:t,handler:n},!s||i.push(s)},n.urlManager.getUrl=function(t,s){var o,u;if(t in r)o=r[t];else for(var a=-1,f=i.length,l;++a<f;){l=i[a](t);if(l in r){o=r[l];break}}return o?(o.handler&&(s=o.handler.call(this,s)),_.extend(s,{languageCode:e.getUser().locale},{}),u=o.template,typeof u=="function"&&(u=o.template.call(this,s)),n.template.parse(u,s)):null}}}})}(),define("aura_extensions/default-extension",[],function(){"use strict";return function(e){e.components.before("initialize",function(){if(!this.defaults)return;!this.defaults.options||(this.options=this.sandbox.util.extend(!0,{},this.defaults.options,this.options));if(!!this.defaults.translations){var e=this.sandbox.util.extend(!0,{},this.defaults.translations,this.options.translations||{});this.translations=this.sandbox.util.object(this.sandbox.util.arrayMap(e,function(e,t){return[t,this.sandbox.translate(e)]}.bind(this)))}if(!!this.defaults.templates){var t=this.sandbox.util.extend(!0,{},this.defaults.templates,this.options.templates||{});this.templates=this.sandbox.util.object(this.sandbox.util.arrayMap(t,function(e,t){return[t,this.sandbox.util.template(e)]}.bind(this)))}})}}),define("aura_extensions/event-extension",[],function(){"use strict";var e=function(e,t,n){return e+(n?n+".":"")+t},t=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(){var e=[].splice.call(arguments,0);e.splice(0,0,r),this.sandbox.emit.apply(this,e)}.bind(this)},n=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.on(r,e)}.bind(this)},r=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.once(r,e)}.bind(this)};return function(i){i.sandbox.events.createEventName=e,i.components.before("initialize",function(){if(!this.events)return;this.events=this.sandbox.util.object(this.sandbox.util.arrayMap(this.events.names,function(e,i){return e.type==="on"?[i,n.call(this,this.events.namespace,e.postFix,e.callback)]:e.type==="once"?[i,r.call(this,this.events.namespace,e.postFix,e.callback)]:[i,t.call(this,this.events.namespace,e.postFix)]}.bind(this)))})}}),define("aura_extensions/sticky-toolbar",[],function(){"use strict";var e={scrollContainerSelector:".content-column > .wrapper .page",fixedClass:"fixed",scrollMarginTop:90,stickyToolbarClass:"sticky-toolbar"},t=function(t,n,r){n>(r||e.scrollMarginTop)?t.addClass(e.fixedClass):t.removeClass(e.fixedClass)};return function(n){n.sandbox.stickyToolbar={enable:function(r,i){r.addClass(e.stickyToolbarClass),n.sandbox.dom.on(e.scrollContainerSelector,"scroll.sticky-toolbar",function(){t(r,n.sandbox.dom.scrollTop(e.scrollContainerSelector),i)})},disable:function(t){t.removeClass(e.stickyToolbarClass),n.sandbox.dom.off(e.scrollContainerSelector,"scroll.sticky-toolbar")},reset:function(t){t.removeClass(e.fixedClass)}},n.components.after("initialize",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.enable(this.$el,typeof this.stickyToolbar=="number"?this.stickyToolbar:null)}),n.components.before("destroy",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.disable(this.$el)})}}),function(e){if(typeof exports=="object"&&typeof module!="undefined")module.exports=e();else if(typeof define=="function"&&define.amd)define("vendor/clipboard/clipboard",[],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.Clipboard=e()}}(function(){var e,t,n;return function r(e,t,n){function i(o,u){if(!t[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,r,e,t,n)}return t[o].exports}var s=typeof require=="function"&&require;for(var o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,n){function s(e,t){while(e&&e.nodeType!==r){if(typeof e.matches=="function"&&e.matches(t))return e;e=e.parentNode}}var r=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}t.exports=s},{}],2:[function(e,t,n){function i(e,t,n,r,i){var o=s.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}function s(e,t,n,i){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&i.call(e,n)}}var r=e("./closest");t.exports=i},{"./closest":1}],3:[function(e,t,n){n.node=function(e){return e!==undefined&&e instanceof HTMLElement&&e.nodeType===1},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return e!==undefined&&(t==="[object NodeList]"||t==="[object HTMLCollection]")&&"length"in e&&(e.length===0||n.node(e[0]))},n.string=function(e){return typeof e=="string"||e instanceof String},n.fn=function(e){var t=Object.prototype.toString.call(e);return t==="[object Function]"}},{}],4:[function(e,t,n){function s(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return o(e,t,n);if(r.nodeList(e))return u(e,t,n);if(r.string(e))return a(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function o(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function u(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function a(e,t,n){return i(document.body,e,t,n)}var r=e("./is"),i=e("delegate");t.exports=s},{"./is":3,delegate:2}],5:[function(e,t,n){function r(e){var t;if(e.nodeName==="SELECT")e.focus(),t=e.value;else if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(e),r.removeAllRanges(),r.addRange(i),t=r.toString()}return t}t.exports=r},{}],6:[function(e,t,n){function r(){}r.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var s=0,o=r.length;s<o;s++)r[s].fn!==t&&r[s].fn._!==t&&i.push(r[s]);return i.length?n[e]=i:delete n[e],this}},t.exports=r},{}],7:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","select"],s);else if(typeof r!="undefined")s(n,t("select"));else{var o={exports:{}};s(o,i.select),i.clipboardAction=o.exports}})(this,function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=r(t),i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(){function e(t){s(this,e),this.resolveOptions(t),this.initSelection()}return o(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=function(e){function t(e,n){f(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.resolveOptions(n),r.listenClick(e),r}return h(t,e),l(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'<div class="sulu-dashboard" data-aura-component="dashboard@suluadmin"/>'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("<div/>"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['<div class="blue-row"></div>','<div class="toolbar-row">','   <div class="left-container '+t.backClass+'">','       <span class="fa-'+t.backIcon+'"></span>',"   </div>",'   <div class="toolbar-container">','       <div class="'+t.toolbarClass+'"></div>',"   </div>",'   <div class="right-container">',"   </div>","</div>"].join(""),tabsRow:['<div class="',t.tabsRowClass,'">','    <div class="',t.tabsClass,'"></div>',"</div>"].join(""),languageChanger:['<div class="language-changer">','   <span class="title"><%= title %></span>','   <span class="dropdown-toggle"></span>',"</div>"].join(""),titleElement:['<div class="'+t.contentTitleClass+'">','   <div class="content-title <% if(!!underline){ %>underlined<% } %>">',"       <h2><%= title %></h2>","   </div>","</div>"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('<div class="'+t.breadcrumbContainerClass+'"/>'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("<div/>"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t<n;)e.push({id:this.sandbox.sulu.locales[t],title:this.sandbox.sulu.locales[t]});return e},startToolbarComponent:function(e,n){var r=this.sandbox.dom.createElement("<div />"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('<div class="'+t.tabsContentClass+'"/>');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e<this.options.scrollDelta?(this.showTabs(),this.oldScrollPosition=e):e>=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('<div class="'+t.tabsLabelContainer+'"/>');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['<span class="breadcrumb">','<% if (!!icon) { %><span class="<%= icon %> icon"></span><% } %><%= title %><span class="fa-chevron-right separator"></span>',"</span>"].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'<div id="column-options-overlay" />'),this.sandbox.start([{name:"column-options@husky",options:{el:"#column-options-overlay",data:this.sandbox.sulu.getUserSetting(this.options.columnOptions.key),hidden:!1,instanceName:this.options.instanceName,trigger:".toggle",header:{title:this.sandbox.translate("list-toolbar.column-options.title")}}}]),e=this.options.instanceName?this.options.instanceName+".":"",this.sandbox.once("husky.column-options."+e+"saved",function(e){this.sandbox.sulu.saveUserSetting(this.options.columnOptions.key,e)}.bind(this))}.bind(this)}},i=function(e,t){var n=e.slice(0),r=[];return this.sandbox.util.foreach(e,function(e){r.push(e.id)}.bind(this)),this.sandbox.util.foreach(t,function(e){var t=r.indexOf(e.id);t<0?n.push(e):n[t]=e}.bind(this)),n},s=function(e,t){if(typeof e=="string")try{e=JSON.parse(e)}catch(n){t[e]?e=t[e].call(this):this.sandbox.logger.log("no template found!")}else typeof e=="function"&&(e=e.call(this));return e},o=function(e){var t,n,i;for(t=-1,n=e.length;++t<n;)i=e[t],i.hasOwnProperty("dropdownItems")&&(i.dropdownItems=o.call(this,i.dropdownItems)),i.hasOwnProperty("type")&&i.type==="columnOptions"&&(e[t]=this.sandbox.util.extend({},r.call(this),i));return e},u=function(e){this.sandbox.dom.addClass(e.el,"list-toolbar"),this.sandbox.start([{name:"toolbar@husky",options:e}])};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.template=s.call(this,this.options.template,t),this.options.listener=s.call(this,this.options.listener,n),!this.options.parentTemplate||(this.options.parentTemplate=s.call(this,this.options.parentTemplate,t),this.options.parentListener=s.call(this,this.options.parentListener,n),this.options.template=i.call(this,this.options.parentTemplate,this.options.template)),this.sandbox.emit("sulu.list-toolbar.extend",this.options.context,this.options.template,this.options.instanceName,this.options.datagridInstanceName,this.options.listInfoContainerSelector),this.options.template=o.call(this,this.options.template);var r,a={groups:this.options.groups,hasSearch:!0,buttons:this.options.template,instanceName:this.options.instanceName,showTitleAsTooltip:this.options.showTitleAsTooltip,showTitle:!1,searchOptions:this.options.searchOptions||{}};this.options.hasOwnProperty("hasSearch")&&(a.hasSearch=this.options.hasSearch),this.options.listener&&this.options.listener.call(this),this.options.parentListener&&this.options.parentListener.call(this),r=this.sandbox.dom.createElement("<div />"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("<div/>"),r;return typeof e!="undefined"?(r=e,this.removeLabelWithId(e)):(this.labelId=this.labelId+1,r=this.labelId),this.sandbox.dom.attr(n,"id","sulu-labels-"+r),this.sandbox.dom.attr(n,"data-id",r),t?this.$navigationLabels.prepend(n):this.sandbox.dom.prepend(this.$el,n),n},removeLabelWithId:function(e){var t=this.labelsById[e];!t||(delete this.labels[t.type][t.description],delete this.labelsById[e],this.sandbox.dom.remove(this.sandbox.dom.find("[data-id='"+e+"']",this.$el)))},showLabel:function(e,t,n,r,i,s){r=r||++this.labelId,this.labels[e][t]?this.sandbox.emit("husky.label."+this.labels[e][t]+".refresh"):(this.startLabelComponent({type:e,description:this.sandbox.translate(t),title:this.sandbox.translate(n),el:this.createLabelContainer(r,i),instanceName:r,autoVanish:s}),this.labels[e][t]=r,this.labelsById[r]={type:e,description:t},this.sandbox.once("husky.label."+r+".destroyed",function(){this.removeLabelWithId(r)}.bind(this)))},startLabelComponent:function(e){this.sandbox.start([{name:"label@husky",options:e}])}}}),define("__component__$sidebar@suluadmin",[],function(){"use strict";var e={instanceName:"",url:"",expandable:!0},t={widgetContainerSelector:"#sulu-widgets",componentClass:"sulu-sidebar",columnSelector:".sidebar-column",fixedWidthClass:"fixed",maxWidthClass:"max",loaderClass:"sidebar-loader",visibleSidebarClass:"has-visible-sidebar",maxSidebarClass:"has-max-sidebar",noVisibleSidebarClass:"has-no-visible-sidebar",hiddenClass:"hidden"},n=function(){return h.call(this,"initialized")},r=function(){return h.call(this,"hide")},i=function(){return h.call(this,"show")},s=function(){return h.call(this,"append-widget")},o=function(){return h.call(this,"prepend-widget")},u=function(){return h.call(this,"set-widget")},a=function(){return h.call(this,"empty")},f=function(){return h.call(this,"change-width")},l=function(){return h.call(this,"add-classes")},c=function(){return h.call(this,"reset-classes")},h=function(e){return"sulu.sidebar."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.widgets=[],this.bindCustomEvents(),this.render(),this.sandbox.emit(n.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.hideColumn()},bindCustomEvents:function(){this.sandbox.on(f.call(this),this.changeWidth.bind(this)),this.sandbox.on(r.call(this),this.hideColumn.bind(this)),this.sandbox.on(i.call(this),this.showColumn.bind(this)),this.sandbox.on(u.call(this),this.setWidget.bind(this)),this.sandbox.on(s.call(this),this.appendWidget.bind(this)),this.sandbox.on(o.call(this),this.prependWidget.bind(this)),this.sandbox.on(a.call(this),this.emptySidebar.bind(this)),this.sandbox.on(c.call(this),this.resetClasses.bind(this)),this.sandbox.on(l.call(this),this.addClasses.bind(this))},resetClasses:function(){this.sandbox.dom.removeClass(this.$el),this.sandbox.dom.addClass(this.$el,t.componentClass)},addClasses:function(e){this.sandbox.dom.addClass(this.$el,e)},changeWidth:function(e){this.width=e,e==="fixed"?this.changeToFixedWidth():e==="max"&&this.changeToMaxWidth(),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.fixedWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.maxWidthClass),this.sandbox.dom.addClass(e,t.fixedWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.prepend(n,e),this.sandbox.dom.removeClass(n,t.maxSidebarClass))},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.maxWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.append(n,e),this.sandbox.dom.addClass(n,t.maxSidebarClass))},hideColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeToFixedWidth(),this.sandbox.dom.removeClass(n,t.visibleSidebarClass),this.sandbox.dom.addClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},showColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeWidth(this.width),this.sandbox.dom.removeClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(n,t.visibleSidebarClass),this.sandbox.dom.removeClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},appendWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t)},prependWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.unshift({url:e,$el:n}),this.sandbox.dom.prepend(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.prepend(this.$el,t)},setWidget:function(e,t){if(!t){if(this.widgets.length!==1||this.widgets[0].url!==e){var n;this.emptySidebar(!1),this.loadWidget(e).then(function(t){if(t===undefined||t===""){this.sandbox.dom.css(this.$el,"display","none");return}n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(this.$el,n),this.sandbox.dom.css(this.$el,"display","block")}.bind(this))}}else t=$(t),this.emptySidebar(!0),this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t),this.sandbox.start(this.$el),this.sandbox.dom.css(this.$el,"display","block")},loadWidget:function(e){var t=this.sandbox.data.deferred();return this.showColumn(),this.startLoader(),this.sandbox.util.load(e,null,"html").then(function(e){this.stopLoader(),t.resolve(e)}.bind(this)),t.promise()},emptySidebar:function(e){while(this.widgets.length>0)this.sandbox.stop(this.widgets[0].$el),this.sandbox.dom.remove(this.widgets[0].$el),this.widgets.splice(0,1);e!==!0&&this.hideColumn()},startLoader:function(){var e=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>');this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#e4e4e4"}}])},stopLoader:function(){this.sandbox.stop(this.$find("."+t.loaderClass))}}}),define("__component__$data-overlay@suluadmin",[],function(){"use strict";var e={instanceName:"",component:""},t={main:['<div class="data-overlay">','<button class="fa-times data-overlay-close btn btn-link"></button>','<div class="data-overlay-content"></div>',"</div>"].join("")},n=function(e){return"sulu.data-overlay."+(this.options.instanceName?this.options.instanceName+".":"")+e},r=function(){return n.call(this,"initialized")},i=function(){return n.call(this,"show")},s=function(){return n.call(this,"hide")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.mainTemplate=this.sandbox.util.template(t.main),this.render(),this.startComponent(),this.bindEvents(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},bindEvents:function(){this.sandbox.on(i.call(this),this.show.bind(this)),this.sandbox.on(s.call(this),this.hide.bind(this))},bindDomEvents:function(){this.$el.on("click",".data-overlay-close",this.hide.bind(this))},render:function(){var e=this.mainTemplate();this.$el.html(e)},startComponent:function(){var e=this.options.component;if(!e)throw new Error("No component defined!");this.sandbox.start([{name:e,options:{el:".data-overlay-content"}}])},show:function(){this.$el.fadeIn(150)},hide:function(){this.$el.fadeOut(150)}}});
require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1614246819288"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['<div class="media-container '+t.mediaLoadingClass+'">','   <div class="media-logo"></div>','   <div class="'+t.mediaBackgroundClass+'">','       <div class="darkener"></div>',"   </div>","</div>"].join(""),contentContainer:['<div class="content-container">','   <div class="'+t.contentBoxClass+'">','       <div class="content-logo navigator'+t.websiteSwitchClass+'"></div>','       <div class="'+t.frameSliderClass+'"></div>',"   </div>",'   <div class="grid-row login-content-footer">','       <span class="navigator '+t.websiteSwitchClass+'"><%= backWebsiteMessage %></span>',"   </div>",'   <div class="'+t.successOverlayClass+'">','       <div class="success-icon"></div>',"   </div>","</div>"].join(""),loginFrame:function(){return['<div class="'+t.frameClass+' login">','   <form class="grid inputs">','       <span class="'+t.errorMessageClass+'"><%= errorMessage %></span>','       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="text" name="username" id="username" placeholder="<%= emailUser %>"/>',"       </div>",'       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="password" name="password" id="password" placeholder="<%= password %>"/>',"       </div>",'       <input type="hidden" name="_csrf_token" id="_csrf_token" value="',this.options.csrfToken,'"/>','       <div class="grid-row small box-frame-footer">','           <span class="navigator '+t.forgotPasswordSwitchClass+'"><%= forgotPasswordMessage %></span>','           <div id="'+t.loginButtonId+'" class="btn action large fit"><%= login %></div>',"       </div>","   </form>","</div>"].join("")},forgotPasswordFrame:['<div class="'+t.frameClass+' forgot-password">','   <div class="grid inputs">','       <span class="'+t.errorMessageClass+'"></span>','       <div class="grid-row">','           <input id="user" class="form-element input-large husky-validate" type="text" placeholder="<%= emailUser %>" tabindex="-1"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.requestResetMailButtonId+'" class="btn action large fit"><%= reset %></div>',"   </div>","</div>"].join(""),resendMailFrame:['<div class="'+t.frameClass+' resend-mail">','   <div class="grid-row">','       <span class="message"><%= sentMessage %></span>','       <span class="message to-mail"></span>',"   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.resendResetMailButtonId+'" class="btn action large fit"><%= resend %></div>',"   </div>","</div>"].join(""),resetPasswordFrame:['<div class="'+t.frameClass+' reset-password">','   <div class="grid inputs">','       <div class="grid-row">','           <input id="password1" class="form-element input-large husky-validate" type="password" placeholder="<%= password1Label %>"/>',"       </div>",'       <div class="grid-row">','           <input id="password2" class="form-element input-large husky-validate" type="password" placeholder="<%= password2Label %>"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginRouteClass+'"><%= loginRouteMessage %></span>','       <div id="'+t.resetPasswordButtonId+'" class="btn action large fit"><%= login %></div>',"   </div>","</div>"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("<img/>");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}});
require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1614246819288"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['<div class="media-container '+t.mediaLoadingClass+'">','   <div class="media-logo"></div>','   <div class="'+t.mediaBackgroundClass+'">','       <div class="darkener"></div>',"   </div>","</div>"].join(""),contentContainer:['<div class="content-container">','   <div class="'+t.contentBoxClass+'">','       <div class="content-logo navigator'+t.websiteSwitchClass+'"></div>','       <div class="'+t.frameSliderClass+'"></div>',"   </div>",'   <div class="grid-row login-content-footer">','       <span class="navigator '+t.websiteSwitchClass+'"><%= backWebsiteMessage %></span>',"   </div>",'   <div class="'+t.successOverlayClass+'">','       <div class="success-icon"></div>',"   </div>","</div>"].join(""),loginFrame:function(){return['<div class="'+t.frameClass+' login">','   <form class="grid inputs">','       <span class="'+t.errorMessageClass+'"><%= errorMessage %></span>','       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="text" name="username" id="username" placeholder="<%= emailUser %>"/>',"       </div>",'       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="password" name="password" id="password" placeholder="<%= password %>"/>',"       </div>",'       <input type="hidden" name="_csrf_token" id="_csrf_token" value="',this.options.csrfToken,'"/>','       <div class="grid-row small box-frame-footer">','           <span class="navigator '+t.forgotPasswordSwitchClass+'"><%= forgotPasswordMessage %></span>','           <div id="'+t.loginButtonId+'" class="btn action large fit"><%= login %></div>',"       </div>","   </form>","</div>"].join("")},forgotPasswordFrame:['<div class="'+t.frameClass+' forgot-password">','   <div class="grid inputs">','       <span class="'+t.errorMessageClass+'"></span>','       <div class="grid-row">','           <input id="user" class="form-element input-large husky-validate" type="text" placeholder="<%= emailUser %>" tabindex="-1"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.requestResetMailButtonId+'" class="btn action large fit"><%= reset %></div>',"   </div>","</div>"].join(""),resendMailFrame:['<div class="'+t.frameClass+' resend-mail">','   <div class="grid-row">','       <span class="message"><%= sentMessage %></span>','       <span class="message to-mail"></span>',"   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.resendResetMailButtonId+'" class="btn action large fit"><%= resend %></div>',"   </div>","</div>"].join(""),resetPasswordFrame:['<div class="'+t.frameClass+' reset-password">','   <div class="grid inputs">','       <div class="grid-row">','           <input id="password1" class="form-element input-large husky-validate" type="password" placeholder="<%= password1Label %>"/>',"       </div>",'       <div class="grid-row">','           <input id="password2" class="form-element input-large husky-validate" type="password" placeholder="<%= password2Label %>"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginRouteClass+'"><%= loginRouteMessage %></span>','       <div id="'+t.resetPasswordButtonId+'" class="btn action large fit"><%= login %></div>',"   </div>","</div>"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("<img/>");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}});
                    '           <div class="suggestion-column" style="width: <%= field.width %>;"><%= context[field.id] %></div>' +
                    '       <div class="text"><%= context[this.options.valueKey] %></div>' +
var requirejs,require,define;(function(global){function isFunction(e){return ostring.call(e)==="[object Function]"}function isArray(e){return ostring.call(e)==="[object Array]"}function each(e,t){if(e){var n;for(n=0;n<e.length;n+=1)if(e[n]&&t(e[n],n,e))break}}function eachReverse(e,t){if(e){var n;for(n=e.length-1;n>-1;n-=1)if(e[n]&&t(e[n],n,e))break}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){if(n||!hasProp(e,i))r&&typeof t!="string"?(e[i]||(e[i]={}),mixin(e[i],t,n,r)):e[i]=t}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function v(e){var t,n;for(t=0;e[t];t+=1){n=e[t];if(n===".")e.splice(t,1),t-=1;else if(n===".."){if(t===1&&(e[2]===".."||e[0]===".."))break;t>0&&(e.splice(t-1,2),t-=2)}}}function m(e,t,n){var r,i,s,u,a,f,l,c,h,p,d,m=t&&t.split("/"),g=m,y=o.map,b=y&&y["*"];e&&e.charAt(0)==="."&&(t?(getOwn(o.pkgs,t)?g=m=[t]:g=m.slice(0,m.length-1),e=g.concat(e.split("/")),v(e),i=getOwn(o.pkgs,r=e[0]),e=e.join("/"),i&&e===r+"/"+i.main&&(e=r)):e.indexOf("./")===0&&(e=e.substring(2)));if(n&&y&&(m||b)){u=e.split("/");for(a=u.length;a>0;a-=1){l=u.slice(0,a).join("/");if(m)for(f=m.length;f>0;f-=1){s=getOwn(y,m.slice(0,f).join("/"));if(s){s=getOwn(s,l);if(s){c=s,h=a;break}}}if(c)break;!p&&b&&getOwn(b,l)&&(p=getOwn(b,l),d=a)}!c&&p&&(c=p,h=d),c&&(u.splice(0,h,c),e=u.join("/"))}return e}function g(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===r.contextName)return t.parentNode.removeChild(t),!0})}function y(e){var t=getOwn(o.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),r.require.undef(e),r.require([e]),!0}function b(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function w(e,t,n,i){var s,o,u,a,f=null,l=t?t.name:null,h=e,v=!0,g="";return e||(v=!1,e="_@r"+(p+=1)),a=b(e),f=a[0],e=a[1],f&&(f=m(f,l,i),o=getOwn(c,f)),e&&(f?o&&o.normalize?g=o.normalize(e,function(e){return m(e,l,i)}):g=m(e,l,i):(g=m(e,l,i),a=b(g),f=a[0],g=a[1],n=!0,s=r.nameToUrl(g))),u=f&&!o&&!n?"_unnormalized"+(d+=1):"",{prefix:f,name:g,parentMap:t,unnormalized:!!u,url:s,originalName:h,isDefine:v,id:(f?f+"!"+g:g)+u}}function E(e){var t=e.id,n=getOwn(u,t);return n||(n=u[t]=new r.Module(e)),n}function S(e,t,n){var r=e.id,i=getOwn(u,r);hasProp(c,r)&&(!i||i.defineEmitComplete)?t==="defined"&&n(c[r]):(i=E(e),i.error&&t==="error"?n(i.error):i.on(t,n))}function x(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(u,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function T(){globalDefQueue.length&&(apsp.apply(l,[l.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function N(e){delete u[e],delete a[e]}function C(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var s=r.id,o=getOwn(u,s);o&&!e.depMatched[i]&&!n[s]&&(getOwn(t,s)?(e.defineDep(i,c[s]),e.check()):C(o,t,n))}),n[r]=!0)}function k(){var e,n,i,u,f=o.waitSeconds*1e3,l=f&&r.startTime+f<(new Date).getTime(),c=[],h=[],p=!1,d=!0;if(t)return;t=!0,eachProp(a,function(t){e=t.map,n=e.id;if(!t.enabled)return;e.isDefine||h.push(t);if(!t.error)if(!t.inited&&l)y(n)?(u=!0,p=!0):(c.push(n),g(n));else if(!t.inited&&t.fetched&&e.isDefine){p=!0;if(!e.prefix)return d=!1}});if(l&&c.length)return i=makeError("timeout","Load timeout for modules: "+c,null,c),i.contextName=r.contextName,x(i);d&&each(h,function(e){C(e,{},{})}),(!l||u)&&p&&(isBrowser||isWebWorker)&&!s&&(s=setTimeout(function(){s=0,k()},50)),t=!1}function L(e){hasProp(c,e[0])||E(w(e[0],null,!0)).init(e[1],e[2])}function A(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function O(e){var t=e.currentTarget||e.srcElement;return A(t,r.onScriptLoad,"load","onreadystatechange"),A(t,r.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function M(){var e;T();while(l.length){e=l.shift();if(e[0]===null)return x(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));L(e)}}var t,n,r,i,s,o={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},u={},a={},f={},l=[],c={},h={},p=1,d=1;return i={require:function(e){return e.require?e.require:e.require=r.makeRequire(e.map)},exports:function(e){e.usingExports=!0;if(e.map.isDefine)return e.exports?e.exports:e.exports=c[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){var t,n=getOwn(o.pkgs,e.map.id);return t=n?getOwn(o.config,e.map.id+"/"+n.main):getOwn(o.config,e.map.id),t||{}},exports:c[e.map.id]}}},n=function(e){this.events=getOwn(f,e.id)||{},this.map=e,this.shim=getOwn(o.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},n.prototype={init:function(e,t,n,r){r=r||{};if(this.inited)return;this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check()},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(this.fetched)return;this.fetched=!0,r.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();r.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))},load:function(){var e=this.map.url;h[e]||(h[e]=!0,r.load(this.map.id,e))},check:function(){if(!this.enabled||this.enabling)return;var e,t,n=this.map.id,i=this.depExports,s=this.exports,o=this.factory;if(!this.inited)this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{s=r.execCb(n,o,i,s)}catch(u){e=u}else s=r.execCb(n,o,i,s);this.map.isDefine&&(t=this.module,t&&t.exports!==undefined&&t.exports!==this.exports?s=t.exports:s===undefined&&this.usingExports&&(s=this.exports));if(e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",x(this.error=e)}else s=o;this.exports=s,this.map.isDefine&&!this.ignore&&(c[n]=s,req.onResourceLoad&&req.onResourceLoad(r,this.map,this.depMaps)),N(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}},callPlugin:function(){var e=this.map,t=e.id,n=w(e.prefix);this.depMaps.push(n),S(n,"defined",bind(this,function(n){var i,s,a,f=this.map.name,l=this.map.parentMap?this.map.parentMap.name:null,c=r.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){n.normalize&&(f=n.normalize(f,function(e){return m(e,l,!0)})||""),s=w(e.prefix+"!"+f,this.map.parentMap),S(s,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),a=getOwn(u,s.id),a&&(this.depMaps.push(s),this.events.error&&a.on("error",bind(this,function(e){this.emit("error",e)})),a.enable());return}i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(u,function(e){e.map.id.indexOf(t+"_unnormalized")===0&&N(e.map.id)}),x(e)}),i.fromText=bind(this,function(n,s){var u=e.name,a=w(u),f=useInteractive;s&&(n=s),f&&(useInteractive=!1),E(a),hasProp(o.config,t)&&(o.config[u]=o.config[t]);try{req.exec(n)}catch(l){return x(makeError("fromtexteval","fromText eval for "+t+" failed: "+l,l,[t]))}f&&(useInteractive=!0),this.depMaps.push(a),r.completeLoad(u),c([u],i)}),n.load(e.name,c,i,o)})),r.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){a[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,s,o;if(typeof e=="string"){e=w(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,o=getOwn(i,e.id);if(o){this.depExports[t]=o(this);return}this.depCount+=1,S(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&S(e,"error",bind(this,this.errback))}n=e.id,s=u[n],!hasProp(i,n)&&s&&!s.enabled&&r.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(u,e.id);t&&!t.enabled&&r.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),e==="error"&&delete this.events[e]}},r={config:o,contextName:e,registry:u,defined:c,urlFetched:h,defQueue:l,Module:n,makeModuleMap:w,nextTick:req.nextTick,onError:x,configure:function(e){e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/");var t=o.pkgs,n=o.shim,i={paths:!0,config:!0,map:!0};eachProp(e,function(e,t){i[t]?t==="map"?(o.map||(o.map={}),mixin(o[t],e,!0,!0)):mixin(o[t],e,!0):o[t]=e}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),(e.exports||e.init)&&!e.exportsFn&&(e.exportsFn=r.makeShimExports(e)),n[t]=e}),o.shim=n),e.packages&&(each(e.packages,function(e){var n;e=typeof e=="string"?{name:e}:e,n=e.location,t[e.name]={name:e.name,location:n||e.name,main:(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),o.pkgs=t),eachProp(u,function(e,t){!e.inited&&!e.map.unnormalized&&(e.map=w(t))}),(e.deps||e.callback)&&r.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function s(o,a,f){var l,h,p;return n.enableBuildCallback&&a&&isFunction(a)&&(a.__requireJsBuild=!0),typeof o=="string"?isFunction(a)?x(makeError("requireargs","Invalid require call"),f):t&&hasProp(i,o)?i[o](u[t.id]):req.get?req.get(r,o,t,s):(h=w(o,t,!1,!0),l=h.id,hasProp(c,l)?c[l]:x(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(M(),r.nextTick(function(){M(),p=E(w(null,t)),p.skipMap=n.skipMap,p.init(o,a,f,{enabled:!0}),k()}),s)}return n=n||{},mixin(s,{isBrowser:isBrowser,toUrl:function(e){var n,i=e.lastIndexOf("."),s=e.split("/")[0],o=s==="."||s==="..";return i!==-1&&(!o||i>1)&&(n=e.substring(i,e.length),e=e.substring(0,i)),r.nameToUrl(m(e,t&&t.id,!0),n,!0)},defined:function(e){return hasProp(c,w(e,t,!1,!0).id)},specified:function(e){return e=w(e,t,!1,!0).id,hasProp(c,e)||hasProp(u,e)}}),t||(s.undef=function(e){T();var n=w(e,t,!0),r=getOwn(u,e);g(e),delete c[e],delete h[n.url],delete f[e],r&&(r.events.defined&&(f[e]=r.events),N(e))}),s},enable:function(e){var t=getOwn(u,e.id);t&&E(e).enable()},completeLoad:function(e){var t,n,r,i=getOwn(o.shim,e)||{},s=i.exports;T();while(l.length){n=l.shift();if(n[0]===null){n[0]=e;if(t)break;t=!0}else n[0]===e&&(t=!0);L(n)}r=getOwn(u,e);if(!t&&!hasProp(c,e)&&r&&!r.inited){if(o.enforceDefine&&(!s||!getGlobal(s))){if(y(e))return;return x(makeError("nodefine","No define call for "+e,null,[e]))}L([e,i.deps||[],i.exportsFn])}k()},nameToUrl:function(e,t,n){var r,i,s,u,a,f,l,c,h;if(req.jsExtRegExp.test(e))c=e+(t||"");else{r=o.paths,i=o.pkgs,a=e.split("/");for(f=a.length;f>0;f-=1){l=a.slice(0,f).join("/"),s=getOwn(i,l),h=getOwn(r,l);if(h){isArray(h)&&(h=h[0]),a.splice(0,f,h);break}if(s){e===s.name?u=s.location+"/"+s.main:u=s.location,a.splice(0,f,u);break}}c=a.join("/"),c+=t||(/^data\:|\?/.test(c)||n?"":".js"),c=(c.charAt(0)==="/"||c.match(/^[\w\+\.\-]+:/)?"":o.baseUrl)+c}return o.urlArgs?c+((c.indexOf("?")===-1?"?":"&")+o.urlArgs):c},load:function(e,t){req.load(r,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=O(e);r.completeLoad(t.id)}},onScriptError:function(e){var t=O(e);if(!y(t.id))return x(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}},r.require=r.makeRequire(),r}function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"?interactiveScript:(eachReverse(scripts(),function(e){if(e.readyState==="interactive")return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.9",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=typeof window!="undefined"&&typeof navigator!="undefined"&&!!window.document,isWebWorker=!isBrowser&&typeof importScripts!="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(typeof define!="undefined")return;if(typeof requirejs!="undefined"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=undefined}typeof require!="undefined"&&!isFunction(require)&&(cfg=require,require=undefined),req=requirejs=function(e,t,n,r){var i,s,o=defContextName;return!isArray(e)&&typeof e!="string"&&(s=e,isArray(t)?(e=t,t=n,n=r):e=[]),s&&s.context&&(o=s.context),i=getOwn(contexts,o),i||(i=contexts[o]=req.s.newContext(o)),s&&i.configure(s),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick=typeof setTimeout!="undefined"?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,n){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,n){var r=e&&e.config||{},i;if(isBrowser)return i=req.createNode(r,t,n),i.setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),i.attachEvent&&!(i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)):(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)),i.src=n,currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):head.appendChild(i),currentlyAddingScript=null,i;if(isWebWorker)try{importScripts(n),e.completeLoad(t)}catch(s){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+n,s,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){head||(head=e.parentNode),dataMain=e.getAttribute("data-main");if(dataMain)return mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,n){var r,i;typeof e!="string"&&(n=t,t=e,e=null),isArray(t)||(n=t,t=null),!t&&isFunction(n)&&(t=[],n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(n.length===1?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this),define("requirejs",function(){}),function(e,t){function H(e){var t=e.length,n=w.type(e);return w.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||n!=="function"&&(t===0||typeof t=="number"&&t>0&&t-1 in e)}function j(e){var t=B[e]={};return w.each(e.match(S)||[],function(e,n){t[n]=!0}),t}function q(e,n,r,i){if(!w.acceptData(e))return;var s,o,u=w.expando,a=e.nodeType,f=a?w.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===t&&typeof n=="string")return;l||(a?l=e[u]=c.pop()||w.guid++:l=u),f[l]||(f[l]=a?{}:{toJSON:w.noop});if(typeof n=="object"||typeof n=="function")i?f[l]=w.extend(f[l],n):f[l].data=w.extend(f[l].data,n);return o=f[l],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[w.camelCase(n)]=r),typeof n=="string"?(s=o[n],s==null&&(s=o[w.camelCase(n)])):s=o,s}function R(e,t,n){if(!w.acceptData(e))return;var r,i,s=e.nodeType,o=s?w.cache:e,u=s?e[w.expando]:w.expando;if(!o[u])return;if(t){r=n?o[u]:o[u].data;if(r){w.isArray(t)?t=t.concat(w.map(t,w.camelCase)):t in r?t=[t]:(t=w.camelCase(t),t in r?t=[t]:t=t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!z(r):!w.isEmptyObject(r))return}}if(!n){delete o[u].data;if(!z(o[u]))return}s?w.cleanData([e],!0):w.support.deleteExpando||o!=o.window?delete o[u]:o[u]=null}function U(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(I,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:F.test(r)?w.parseJSON(r):r}catch(s){}w.data(e,n,r)}else r=t}return r}function z(e){var t;for(t in e){if(t==="data"&&w.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function it(){return!0}function st(){return!1}function ot(){try{return o.activeElement}catch(e){}}function ct(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ht(e,t,n){if(w.isFunction(t))return w.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return w.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(ut.test(t))return w.filter(t,e,n);t=w.filter(t,e)}return w.grep(e,function(e){return w.inArray(e,t)>=0!==n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Mt(e,t){return w.nodeName(e,"table")&&w.nodeName(t.nodeType===1?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function _t(e){return e.type=(w.find.attr(e,"type")!==null)+"/"+e.type,e}function Dt(e){var t=Ct.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)w._data(n,"globalEval",!t||w._data(t[r],"globalEval"))}function Ht(e,t){if(t.nodeType!==1||!w.hasData(e))return;var n,r,i,s=w._data(e),o=w._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)w.event.add(t,n,u[n][r])}o.data&&(o.data=w.extend({},o.data))}function Bt(e,t){var n,r,i;if(t.nodeType!==1)return;n=t.nodeName.toLowerCase();if(!w.support.noCloneEvent&&t[w.expando]){i=w._data(t);for(r in i.events)w.removeEvent(t,r,i.handle);t.removeAttribute(w.expando)}if(n==="script"&&t.text!==e.text)_t(t).text=e.text,Dt(t);else if(n==="object")t.parentNode&&(t.outerHTML=e.outerHTML),w.support.html5Clone&&e.innerHTML&&!w.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML);else if(n==="input"&&xt.test(e.type))t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value);else if(n==="option")t.defaultSelected=t.selected=e.defaultSelected;else if(n==="input"||n==="textarea")t.defaultValue=e.defaultValue}function jt(e,n){var r,s,o=0,u=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!u)for(u=[],r=e.childNodes||e;(s=r[o])!=null;o++)!n||w.nodeName(s,n)?u.push(s):w.merge(u,jt(s,n));return n===t||n&&w.nodeName(e,n)?w.merge([e],u):u}function Ft(e){xt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--){t=en[i]+n;if(t in e)return t}return r}function nn(e,t){return e=t||e,w.css(e,"display")==="none"||!w.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o<u;o++){r=e[o];if(!r.style)continue;s[o]=w._data(r,"olddisplay"),n=r.style.display,t?(!s[o]&&n==="none"&&(r.style.display=""),r.style.display===""&&nn(r)&&(s[o]=w._data(r,"olddisplay",an(r.nodeName)))):s[o]||(i=nn(r),(n&&n!=="none"||!i)&&w._data(r,"olddisplay",i?n:w.css(r,"display")))}for(o=0;o<u;o++){r=e[o];if(!r.style)continue;if(!t||r.style.display==="none"||r.style.display==="")r.style.display=t?s[o]||"":"none"}return e}function sn(e,t,n){var r=$t.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function on(e,t,n,r,i){var s=n===(r?"border":"content")?4:t==="width"?1:0,o=0;for(;s<4;s+=2)n==="margin"&&(o+=w.css(e,n+Zt[s],!0,i)),r?(n==="content"&&(o-=w.css(e,"padding"+Zt[s],!0,i)),n!=="margin"&&(o-=w.css(e,"border"+Zt[s]+"Width",!0,i))):(o+=w.css(e,"padding"+Zt[s],!0,i),n!=="padding"&&(o+=w.css(e,"border"+Zt[s]+"Width",!0,i)));return o}function un(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=qt(e),o=w.support.boxSizing&&w.css(e,"boxSizing",!1,s)==="border-box";if(i<=0||i==null){i=Rt(e,t,s);if(i<0||i==null)i=e.style[t];if(Jt.test(i))return i;r=o&&(w.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+on(e,t,n||(o?"border":"content"),r,s)+"px"}function an(e){var t=o,n=Qt[e];if(!n){n=fn(e,t);if(n==="none"||!n)It=(It||w("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(It[0].contentWindow||It[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=fn(e,t),It.detach();Qt[e]=n}return n}function fn(e,t){var n=w(t.createElement(e)).appendTo(t.body),r=w.css(n[0],"display");return n.remove(),r}function vn(e,t,n,r){var i;if(w.isArray(t))w.each(t,function(t,i){n||cn.test(e)?r(e,i):vn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&w.type(t)==="object")for(i in t)vn(e+"["+i+"]",t[i],n,r);else r(e,t)}function _n(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(S)||[];if(w.isFunction(n))while(r=s[i++])r[0]==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Dn(e,t,n,r){function o(u){var a;return i[u]=!0,w.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=w.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((s[i]?e:r||(r={}))[i]=n[i]);return r&&w.extend(!0,e,r),e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes;while(f[0]==="*")f.shift(),s===t&&(s=e.mimeType||n.getResponseHeader("Content-Type"));if(s)for(u in a)if(a[u]&&a[u].test(s)){f.unshift(u);break}if(f[0]in r)o=f[0];else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}i||(i=u)}o=o||i}if(o)return o!==f[0]&&f.unshift(o),r[o]}function Bn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s){e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift();if(s)if(s==="*")s=a;else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o)for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}}}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){return setTimeout(function(){Xn=t}),Xn=w.now()}function Zn(e,t,n){var r,i=(Gn[t]||[]).concat(Gn["*"]),s=0,o=i.length;for(;s<o;s++)if(r=i[s].call(n,t,e))return r}function er(e,t,n){var r,i,s=0,o=Qn.length,u=w.Deferred().always(function(){delete a.elem}),a=function(){if(i)return!1;var t=Xn||Yn(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,s=1-r,o=0,a=f.tweens.length;for(;o<a;o++)f.tweens[o].run(s);return u.notifyWith(e,[f,s,n]),s<1&&a?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Yn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(r),r},stop:function(t){var n=0,r=t?f.tweens.length:0;if(i)return this;i=!0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;tr(l,f.opts.specialEasing);for(;s<o;s++){r=Qn[s].call(f,e,l,f.opts);if(r)return r}return w.map(l,Zn,f),w.isFunction(f.opts.start)&&f.opts.start.call(e,f),w.fx.timer(w.extend(a,{elem:e,anim:f,queue:f.opts.queue})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function tr(e,t){var n,r,i,s,o;for(n in e){r=w.camelCase(n),i=t[r],s=e[n],w.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=w.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function nr(e,t,n){var r,i,s,o,u,a,f=this,l={},c=e.style,h=e.nodeType&&nn(e),p=w._data(e,"fxshow");n.queue||(u=w._queueHooks(e,"fx"),u.unqueued==null&&(u.unqueued=0,a=u.empty.fire,u.empty.fire=function(){u.unqueued||a()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,w.queue(e,"fx").length||u.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[c.overflow,c.overflowX,c.overflowY],w.css(e,"display")==="inline"&&w.css(e,"float")==="none"&&(!w.support.inlineBlockNeedsLayout||an(e.nodeName)==="inline"?c.display="inline-block":c.zoom=1)),n.overflow&&(c.overflow="hidden",w.support.shrinkWrapBlocks||f.always(function(){c.overflow=n.overflow[0],c.overflowX=n.overflow[1],c.overflowY=n.overflow[2]}));for(r in t){i=t[r];if($n.exec(i)){delete t[r],s=s||i==="toggle";if(i===(h?"hide":"show"))continue;l[r]=p&&p[r]||w.style(e,r)}}if(!w.isEmptyObject(l)){p?"hidden"in p&&(h=p.hidden):p=w._data(e,"fxshow",{}),s&&(p.hidden=!h),h?w(e).show():f.done(function(){w(e).hide()}),f.done(function(){var t;w._removeData(e,"fxshow");for(t in l)w.style(e,t,l[t])});for(r in l)o=Zn(h?p[r]:0,r,f),r in p||(p[r]=o.start,h&&(o.end=o.start,o.start=r==="width"||r==="height"?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function sr(e){return w.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,s=e.location,o=e.document,u=o.documentElement,a=e.jQuery,f=e.$,l={},c=[],h="1.10.2",p=c.concat,d=c.push,v=c.slice,m=c.indexOf,g=l.toString,y=l.hasOwnProperty,b=h.trim,w=function(e,t){return new w.fn.init(e,t,r)},E=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,S=/\S+/g,x=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,N=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,C=/^[\],:{}\s]*$/,k=/(?:^|:|,)(?:\s*\[)+/g,L=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,O=/^-ms-/,M=/-([\da-z])/gi,_=function(e,t){return t.toUpperCase()},D=function(e){if(o.addEventListener||e.type==="load"||o.readyState==="complete")P(),w.ready()},P=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",D,!1),e.removeEventListener("load",D,!1)):(o.detachEvent("onreadystatechange",D),e.detachEvent("onload",D))};w.fn=w.prototype={jquery:h,constructor:w,init:function(e,n,r){var i,s;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=T.exec(e);if(i&&(i[1]||!n)){if(i[1]){n=n instanceof w?n[0]:n,w.merge(this,w.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0));if(N.test(i[1])&&w.isPlainObject(n))for(i in n)w.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}s=o.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2])return r.find(e);this.length=1,this[0]=s}return this.context=o,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):w.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),w.makeArray(e,this))},selector:"",length:0,toArray:function(){return v.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return w.each(this,e,t)},ready:function(e){return w.ready.promise().done(e),this},slice:function(){return this.pushStack(v.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},w.fn.init.prototype=w.fn,w.extend=w.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!w.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((s=arguments[a])!=null)for(i in s){e=u[i],r=s[i];if(u===r)continue;l&&r&&(w.isPlainObject(r)||(n=w.isArray(r)))?(n?(n=!1,o=e&&w.isArray(e)?e:[]):o=e&&w.isPlainObject(e)?e:{},u[i]=w.extend(l,o,r)):r!==t&&(u[i]=r)}return u},w.extend({expando:"jQuery"+(h+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===w&&(e.$=f),t&&e.jQuery===w&&(e.jQuery=a),w},isReady:!1,readyWait:1,holdReady:function(e){e?w.readyWait++:w.ready(!0)},ready:function(e){if(e===!0?--w.readyWait:w.isReady)return;if(!o.body)return setTimeout(w.ready);w.isReady=!0;if(e!==!0&&--w.readyWait>0)return;n.resolveWith(o,[w]),w.fn.trigger&&w(o).trigger("ready").off("ready")},isFunction:function(e){return w.type(e)==="function"},isArray:Array.isArray||function(e){return w.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):typeof e=="object"||typeof e=="function"?l[g.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||w.type(e)!=="object"||e.nodeType||w.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(w.support.ownLast)for(n in e)return y.call(e,n);for(n in e);return n===t||y.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||o;var r=N.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=w.buildFragment([e],t,i),i&&w(i).remove(),w.merge([],r.childNodes))},parseJSON:function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(t===null)return t;if(typeof t=="string"){t=w.trim(t);if(t&&C.test(t.replace(L,"@").replace(A,"]").replace(k,"")))return(new Function("return "+t))()}w.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&w.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&w.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(O,"ms-").replace(M,_)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=H(e);if(n)if(o)for(;i<s;i++){r=t.apply(e[i],n);if(r===!1)break}else for(i in e){r=t.apply(e[i],n);if(r===!1)break}else if(o)for(;i<s;i++){r=t.call(e[i],i,e[i]);if(r===!1)break}else for(i in e){r=t.call(e[i],i,e[i]);if(r===!1)break}return e},trim:b&&!b.call("﻿ ")?function(e){return e==null?"":b.call(e)}:function(e){return e==null?"":(e+"").replace(x,"")},makeArray:function(e,t){var n=t||[];return e!=null&&(H(Object(e))?w.merge(n,typeof e=="string"?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,t,n){var r,i=0,s=e.length,o=H(e),u=[];if(o)for(;i<s;i++)r=t(e[i],i,n),r!=null&&(u[u.length]=r);else for(i in e)r=t(e[i],i,n),r!=null&&(u[u.length]=r);return p.apply([],u)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(s=e[n],n=e,e=s),w.isFunction(e)?(r=v.call(arguments,2),i=function(){return e.apply(n||this,r.concat(v.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i):t},access:function(e,n,r,i,s,o,u){var a=0,f=e.length,l=r==null;if(w.type(r)==="object"){s=!0;for(a in r)w.access(e,n,a,r[a],!0,o,u)}else if(i!==t){s=!0,w.isFunction(i)||(u=!0),l&&(u?(n.call(e,i),n=null):(l=n,n=function(e,t,n){return l.call(w(e),n)}));if(n)for(;a<f;a++)n(e[a],r,u?i:i.call(e[a],a,n(e[a],r)))}return s?e:l?n.call(e):f?n(e[0],r):o},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i}}),w.ready.promise=function(t){if(!n){n=w.Deferred();if(o.readyState==="complete")setTimeout(w.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",D,!1),e.addEventListener("load",D,!1);else{o.attachEvent("onreadystatechange",D),e.attachEvent("onload",D);var r=!1;try{r=e.frameElement==null&&o.documentElement}catch(i){}r&&r.doScroll&&function s(){if(!w.isReady){try{r.doScroll("left")}catch(e){return setTimeout(s,50)}P(),w.ready()}}()}}return n.promise(t)},w.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()}),r=w(o),function(e,t){function ot(e,t,n,i){var s,o,u,a,f,l,p,m,g,w;(t?t.ownerDocument||t:E)!==h&&c(t),t=t||h,n=n||[];if(!e||typeof e!="string")return n;if((a=t.nodeType)!==1&&a!==9)return[];if(d&&!i){if(s=Z.exec(e))if(u=s[1]){if(a===9){o=t.getElementById(u);if(!o||!o.parentNode)return n;if(o.id===u)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(u))&&y(t,o)&&o.id===u)return n.push(o),n}else{if(s[2])return H.apply(n,t.getElementsByTagName(e)),n;if((u=s[3])&&r.getElementsByClassName&&t.getElementsByClassName)return H.apply(n,t.getElementsByClassName(u)),n}if(r.qsa&&(!v||!v.test(e))){m=p=b,g=t,w=a===9&&e;if(a===1&&t.nodeName.toLowerCase()!=="object"){l=mt(e),(p=t.getAttribute("id"))?m=p.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",f=l.length;while(f--)l[f]=m+gt(l[f]);g=$.test(e)&&t.parentNode||t,w=l.join(",")}if(w)try{return H.apply(n,g.querySelectorAll(w)),n}catch(S){}finally{p||t.removeAttribute("id")}}}return Nt(e.replace(W,"$1"),t,n,i)}function ut(){function t(n,r){return e.push(n+=" ")>s.cacheLength&&delete t[e.shift()],t[n]=r}var e=[];return t}function at(e){return e[b]=!0,e}function ft(e){var t=h.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)s.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||O)-(~e.sourceIndex||O);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function dt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function vt(){}function mt(e,t){var n,r,i,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=s.preFilter;while(u){if(!n||(r=X.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(i=[]);n=!1;if(r=V.exec(u))n=r.shift(),i.push({value:n,type:r[0].replace(W," ")}),u=u.slice(n.length);for(o in s.filter)(r=G[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(n=r.shift(),i.push({value:n,type:o,matches:r}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)}function gt(e){var t=0,n=e.length,r="";for(;t<n;t++)r+=e[t].value;return r}function yt(e,t,n){var r=t.dir,s=n&&r==="parentNode",o=x++;return t.first?function(t,n,i){while(t=t[r])if(t.nodeType===1||s)return e(t,n,i)}:function(t,n,u){var a,f,l,c=S+" "+o;if(u){while(t=t[r])if(t.nodeType===1||s)if(e(t,n,u))return!0}else while(t=t[r])if(t.nodeType===1||s){l=t[b]||(t[b]={});if((f=l[r])&&f[0]===c){if((a=f[1])===!0||a===i)return a===!0}else{f=l[r]=[c],f[1]=e(t,n,u)||i;if(f[1]===!0)return!0}}}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function wt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function Et(e,t,n,r,i,s){return r&&!r[b]&&(r=Et(r)),i&&!i[b]&&(i=Et(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||Tt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?wt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=wt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?j.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=wt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):H.apply(o,g)})}function St(e){var t,n,r,i=e.length,o=s.relative[e[0].type],u=o||s.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,!0),c=yt(function(e){return j.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a<i;a++)if(n=s.relative[e[a].type])h=[yt(bt(h),n)];else{n=s.filter[e[a].type].apply(null,e[a].matches);if(n[b]){r=++a;for(;r<i;r++)if(s.relative[e[r].type])break;return Et(a>1&&bt(h),a>1&&gt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(W,"$1"),n,a<r&&St(e.slice(a,r)),r<i&&St(e=e.slice(r)),r<i&&gt(e))}h.push(n)}return bt(h)}function xt(e,t){var n=0,r=t.length>0,o=e.length>0,u=function(u,a,l,c,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,x=f,T=u||o&&s.find.TAG("*",p&&a.parentNode||a),N=S+=x==null?1:Math.random()||.1;E&&(f=a!==h&&a,i=n);for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++])if(m(d,a,l)){c.push(d);break}E&&(S=N,i=++n)}r&&((d=!m&&d)&&y--,u&&w.push(d))}y+=b;if(r&&b!==y){v=0;while(m=t[v++])m(w,g,a,l);if(u){if(y>0)while(b--)!w[b]&&!g[b]&&(g[b]=D.call(c));g=wt(g)}H.apply(c,g),E&&!u&&g.length>0&&y+t.length>1&&ot.uniqueSort(c)}return E&&(S=N,f=x),w};return r?at(u):u}function Tt(e,t,n){var r=0,i=t.length;for(;r<i;r++)ot(e,t[r],n);return n}function Nt(e,t,n,i){var o,u,f,l,c,h=mt(e);if(!i&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&r.getById&&t.nodeType===9&&d&&s.relative[u[1].type]){t=(s.find.ID(f.matches[0].replace(rt,it),t)||[])[0];if(!t)return n;e=e.slice(u.shift().value.length)}o=G.needsContext.test(e)?0:u.length;while(o--){f=u[o];if(s.relative[l=f.type])break;if(c=s.find[l])if(i=c(f.matches[0].replace(rt,it),$.test(u[0].type)&&t.parentNode||t)){u.splice(o,1),e=i.length&&gt(u);if(!e)return H.apply(n,i),n;break}}}return a(e,h)(i,t,!d,n,$.test(e)),n}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b="sizzle"+ -(new Date),E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=!1,L=function(e,t){return e===t?(k=!0,0):0},A=typeof t,O=1<<31,M={}.hasOwnProperty,_=[],D=_.pop,P=_.push,H=_.push,B=_.slice,j=_.indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",I="[\\x20\\t\\r\\n\\f]",q="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",R=q.replace("w","w#"),U="\\["+I+"*("+q+")"+I+"*(?:([*^$|!~]?=)"+I+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+R+")|)|)"+I+"*\\]",z=":("+q+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+U.replace(3,8)+")*)|.*)\\)|)",W=new RegExp("^"+I+"+|((?:^|[^\\\\])(?:\\\\.)*)"+I+"+$","g"),X=new RegExp("^"+I+"*,"+I+"*"),V=new RegExp("^"+I+"*([>+~]|"+I+")"+I+"*"),$=new RegExp(I+"*[+~]"),J=new RegExp("="+I+"*([^\\]'\"]*)"+I+"*\\]","g"),K=new RegExp(z),Q=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q.replace("w","w*")+")"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=new RegExp("\\\\([\\da-f]{1,6}"+I+"?|("+I+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{H.apply(_=B.call(E.childNodes),E.childNodes),_[E.childNodes.length].nodeType}catch(st){H={apply:_.length?function(e,t){P.apply(e,B.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}u=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},r=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:E,n=t.defaultView;if(t===h||t.nodeType!==9||!t.documentElement)return h;h=t,p=t.documentElement,d=!u(t),n&&n.attachEvent&&n!==n.top&&n.attachEvent("onbeforeunload",function(){c()}),r.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ft(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ft(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",e.getElementsByClassName("i").length===2}),r.getById=ft(function(e){return p.appendChild(e).id=b,!t.getElementsByName||!t.getElementsByName(b).length}),r.getById?(s.find.ID=function(e,t){if(typeof t.getElementById!==A&&d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},s.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete s.find.ID,s.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),s.find.TAG=r.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==A)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},s.find.CLASS=r.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==A&&d)return t.getElementsByClassName(e)},m=[],v=[];if(r.qsa=Y.test(t.querySelectorAll))ft(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||v.push("\\["+I+"*(?:value|"+F+")"),e.querySelectorAll(":checked").length||v.push(":checked")}),ft(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&v.push("[*^$]="+I+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")});return(r.matchesSelector=Y.test(g=p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ft(function(e){r.disconnectedMatch=g.call(e,"div"),g.call(e,"[s!='']:x"),m.push("!=",z)}),v=v.length&&new RegExp(v.join("|")),m=m.length&&new RegExp(m.join("|")),y=Y.test(p.contains)||p.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},L=p.compareDocumentPosition?function(e,n){if(e===n)return k=!0,0;var i=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);if(i)return i&1||!r.sortDetached&&n.compareDocumentPosition(e)===i?e===t||y(E,e)?-1:n===t||y(E,n)?1:l?j.call(l,e)-j.call(l,n):0:i&4?-1:1;return e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,s=e.parentNode,o=n.parentNode,u=[e],a=[n];if(e===n)return k=!0,0;if(!s||!o)return e===t?-1:n===t?1:s?-1:o?1:l?j.call(l,e)-j.call(l,n):0;if(s===o)return ct(e,n);r=e;while(r=r.parentNode)u.unshift(r);r=n;while(r=r.parentNode)a.unshift(r);while(u[i]===a[i])i++;return i?ct(u[i],a[i]):u[i]===E?-1:a[i]===E?1:0},t},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){(e.ownerDocument||e)!==h&&c(e),t=t.replace(J,"='$1']");if(r.matchesSelector&&d&&(!m||!m.test(t))&&(!v||!v.test(t)))try{var n=g.call(e,t);if(n||r.disconnectedMatch||e.document&&e.document.nodeType!==11)return n}catch(i){}return ot(t,h,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==h&&c(e),y(e,t)},ot.attr=function(e,n){(e.ownerDocument||e)!==h&&c(e);var i=s.attrHandle[n.toLowerCase()],o=i&&M.call(s.attrHandle,n.toLowerCase())?i(e,n,!d):t;return o===t?r.attributes||!d?e.getAttribute(n):(o=e.getAttributeNode(n))&&o.specified?o.value:null:o},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,n=[],i=0,s=0;k=!r.detectDuplicates,l=!r.sortStable&&e.slice(0),e.sort(L);if(k){while(t=e[s++])t===e[s]&&(i=n.push(s));while(i--)e.splice(n[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r];r++)n+=o(t);else if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(i===3||i===4)return e.nodeValue;return n},s=ot.selectors={cacheLength:50,createPseudo:at,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return G.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&K.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return e==="*"?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&T(e,function(e){return t.test(typeof e.className=="string"&&e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[b]||(m[b]={}),f=l[e]||[],p=f[0]===S&&f[1],h=f[0]===S&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}else if(y&&(f=(t[b]||(t[b]={}))[e])&&f[0]===S)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[b]||(c[b]={}))[e]=[S,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=s.pseudos[e]||s.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],s.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=j.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(W,"$1"));return r[b]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return Q.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4)return!1;return!0},parent:function(e){return!s.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[n<0?n+t:n]}),even:dt(function(e,t){var n=0;for(;n<t;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;n<t;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=n<0?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=n<0?n+t:n;for(;++r<t;)e.push(r);return e})}},s.pseudos.nth=s.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})s.pseudos[n]=ht(n);for(n in{submit:!0,reset:!0})s.pseudos[n]=pt(n);vt.prototype=s.filters=s.pseudos,s.setFilters=new vt,a=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=mt(e)),n=t.length;while(n--)s=St(t[n]),s[b]?r.push(s):i.push(s);s=C(e,xt(i,r))}return s},r.sortStable=b.split("").sort(L).join("")===b,r.detectDuplicates=k,c(),r.sortDetached=ft(function(e){return e.compareDocumentPosition(h.createElement("div"))&1}),ft(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild.getAttribute("href")==="#"})||lt("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!r.attributes||!ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&lt("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),ft(function(e){return e.getAttribute("disabled")==null})||lt(F,function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),w.find=ot,w.expr=ot.selectors,w.expr[":"]=w.expr.pseudos,w.unique=ot.uniqueSort,w.text=ot.getText,w.isXMLDoc=ot.isXML,w.contains=ot.contains}(e);var B={};w.Callbacks=function(e){e=typeof e=="string"?B[e]||j(e):w.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){r=e.memory&&t,i=!0,o=u||0,u=0,s=a.length,n=!0;for(;a&&o<s;o++)if(a[o].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,a&&(f?f.length&&l(f.shift()):r?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function i(t){w.each(t,function(t,n){var r=w.type(n);r==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&r!=="string"&&i(n)})})(arguments),n?s=a.length:r&&(u=t,l(r))}return this},remove:function(){return a&&w.each(arguments,function(e,t){var r;while((r=w.inArray(t,a,r))>-1)a.splice(r,1),n&&(r<=s&&s--,r<=o&&o--)}),this},has:function(e){return e?w.inArray(e,a)>-1:!!a&&!!a.length},empty:function(){return a=[],s=0,this},disable:function(){return a=f=r=t,this},disabled:function(){return!a},lock:function(){return f=t,r||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return a&&(!i||f)&&(t=t||[],t=[e,t.slice?t.slice():t],n?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},w.extend({Deferred:function(e){var t=[["resolve","done",w.Callbacks("once memory"),"resolved"],["reject","fail",w.Callbacks("once memory"),"rejected"],["notify","progress",w.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return w.Deferred(function(n){w.each(t,function(t,s){var o=s[0],u=w.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);e&&w.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n.promise():this,u?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?w.extend(e,r):r}},i={};return r.pipe=r.then,w.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=v.call(arguments),r=n.length,i=r!==1||e&&w.isFunction(e.promise)?r:0,s=i===1?e:w.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?v.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&w.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),w.support=function(t){var n,r,s,u,a,f,l,c,h,p=o.createElement("div");p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*")||[],r=p.getElementsByTagName("a")[0];if(!r||!r.style||!n.length)return t;u=o.createElement("select"),f=u.appendChild(o.createElement("option")),s=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute=p.className!=="t",t.leadingWhitespace=p.firstChild.nodeType===3,t.tbody=!p.getElementsByTagName("tbody").length,t.htmlSerialize=!!p.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized=r.getAttribute("href")==="/a",t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!s.value,t.optSelected=f.selected,t.enctype=!!o.createElement("form").enctype,t.html5Clone=o.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,s.checked=!0,t.noCloneChecked=s.cloneNode(!0).checked,u.disabled=!0,t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}s=o.createElement("input"),s.setAttribute("value",""),t.input=s.getAttribute("value")==="",s.value="t",s.setAttribute("type","radio"),t.radioValue=s.value==="t",s.setAttribute("checked","t"),s.setAttribute("name","t"),a=o.createDocumentFragment(),a.appendChild(s),t.appendChecked=s.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){t.noCloneEvent=!1}),p.cloneNode(!0).click());for(h in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+h,"t"),t[h+"Bubbles"]=l in e||p.attributes[l].expando===!1;p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle=p.style.backgroundClip==="content-box";for(h in w(t))break;return t.ownLast=h!=="0",w(function(){var n,r,s,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=o.getElementsByTagName("body")[0];if(!a)return;n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=p.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",w.swap(a,a.style.zoom!=null?{zoom:1}:{},function(){t.boxSizing=p.offsetWidth===4}),e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px",r=p.appendChild(o.createElement("div")),r.style.cssText=p.style.cssText=u,r.style.marginRight=r.style.width="0",p.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof p.style.zoom!==i&&(p.innerHTML="",p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",t.shrinkWrapBlocks=p.offsetWidth!==3,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(n),n=p=s=r=null}),n=u=a=f=r=s=null,t}({});var F=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;w.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?w.cache[e[w.expando]]:e[w.expando],!!e&&!z(e)},data:function(e,t,n){return q(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return q(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9)return!1;var t=e.nodeName&&w.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),w.fn.extend({data:function(e,n){var r,i,s=null,o=0,u=this[0];if(e===t){if(this.length){s=w.data(u);if(u.nodeType===1&&!w._data(u,"parsedAttrs")){r=u.attributes;for(;o<r.length;o++)i=r[o].name,i.indexOf("data-")===0&&(i=w.camelCase(i.slice(5)),U(u,i,s[i]));w._data(u,"parsedAttrs",!0)}}return s}return typeof e=="object"?this.each(function(){w.data(this,e)}):arguments.length>1?this.each(function(){w.data(this,e,n)}):u?U(u,e,w.data(u,e)):null},removeData:function(e){return this.each(function(){w.removeData(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=w._data(e,t),n&&(!r||w.isArray(n)?r=w._data(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),s=w._queueHooks(e,t),o=function(){w.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return w._data(e,n)||w._data(e,n,{empty:w.Callbacks("once memory").add(function(){w._removeData(e,t+"queue"),w._removeData(e,n)})})}}),w.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?w.queue(this[0],e):n===t?this:this.each(function(){var t=w.queue(this,e,n);w._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},delay:function(e,t){return e=w.fx?w.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=w.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=w._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var W,X,V=/[\t\r\n\f]/g,$=/\r/g,J=/^(?:input|select|textarea|button|object)$/i,K=/^(?:a|area)$/i,Q=/^(?:checked|selected)$/i,G=w.support.getSetAttribute,Y=w.support.input;w.fn.extend({attr:function(e,t){return w.access(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})},prop:function(e,t){return w.access(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return e=w.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e=="string"&&e;if(w.isFunction(e))return this.each(function(t){w(this).addClass(e.call(this,t,this.className))});if(a){t=(e||"").match(S)||[];for(;o<u;o++){n=this[o],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(V," "):" ");if(r){s=0;while(i=t[s++])r.indexOf(" "+i+" ")<0&&(r+=i+" ");n.className=w.trim(r)}}}return this},removeClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=arguments.length===0||typeof e=="string"&&e;if(w.isFunction(e))return this.each(function(t){w(this).removeClass(e.call(this,t,this.className))});if(a){t=(e||"").match(S)||[];for(;o<u;o++){n=this[o],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(V," "):"");if(r){s=0;while(i=t[s++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?w.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):w.isFunction(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var t,r=0,s=w(this),o=e.match(S)||[];while(t=o[r++])s.hasClass(t)?s.removeClass(t):s.addClass(t)}else if(n===i||n==="boolean")this.className&&w._data(this,"__className__",this.className),this.className=this.className||e===!1?"":w._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(V," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return r=w.valHooks[s.type]||w.valHooks[s.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(s,"value"))!==t?n:(n=s.value,typeof n=="string"?n.replace($,""):n==null?"":n);return}return i=w.isFunction(e),this.each(function(n){var s;if(this.nodeType!==1)return;i?s=e.call(this,n,w(this).val()):s=e,s==null?s="":typeof s=="number"?s+="":w.isArray(s)&&(s=w.map(s,function(e){return e==null?"":e+""})),r=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t)this.value=s})}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return t!=null?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(w.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!w.nodeName(n.parentNode,"optgroup"))){t=w(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n,r,i=e.options,s=w.makeArray(t),o=i.length;while(o--){r=i[o];if(r.selected=w.inArray(w(r).val(),s)>=0)n=!0}return n||(e.selectedIndex=-1),s}}},attr:function(e,n,r){var s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;if(typeof e.getAttribute===i)return w.prop(e,n,r);if(u!==1||!w.isXMLDoc(e))n=n.toLowerCase(),s=w.attrHooks[n]||(w.expr.match.bool.test(n)?X:W);if(r===t)return s&&"get"in s&&(o=s.get(e,n))!==null?o:(o=w.find.attr(e,n),o==null?t:o);if(r!==null)return s&&"set"in s&&(o=s.set(e,r,n))!==t?o:(e.setAttribute(n,r+""),r);w.removeAttr(e,n)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(S);if(s&&e.nodeType===1)while(n=s[i++])r=w.propFix[n]||n,w.expr.match.bool.test(n)?Y&&G||!Q.test(n)?e[r]=!1:e[w.camelCase("default-"+n)]=e[r]=!1:w.attr(e,n,""),e.removeAttribute(G?n:r)},attrHooks:{type:{set:function(e,t){if(!w.support.radioValue&&t==="radio"&&w.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!w.isXMLDoc(e),o&&(n=w.propFix[n]||n,s=w.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):J.test(e.nodeName)||K.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?w.removeAttr(e,n):Y&&G||!Q.test(n)?e.setAttribute(!G&&w.propFix[n]||n,n):e[w.camelCase("default-"+n)]=e[n]=!0,n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,n){var r=w.expr.attrHandle[n]||w.find.attr;w.expr.attrHandle[n]=Y&&G||!Q.test(n)?function(e,n,i){var s=w.expr.attrHandle[n],o=i?t:(w.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return w.expr.attrHandle[n]=s,o}:function(e,n,r){return r?t:e[w.camelCase("default-"+n)]?n.toLowerCase():null}});if(!Y||!G)w.attrHooks.value={set:function(e,t,n){if(!w.nodeName(e,"input"))return W&&W.set(e,t,n);e.defaultValue=t}};G||(W={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="",r==="value"||n===e.getAttribute(r)?n:t}},w.expr.attrHandle.id=w.expr.attrHandle.name=w.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.value!==""?i.value:null},w.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:W.set},w.attrHooks.contenteditable={set:function(e,t,n){W.set(e,t===""?!1:t,n)}},w.each(["width","height"],function(e,t){w.attrHooks[t]={set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}}})),w.support.hrefNormalized||w.each(["href","src"],function(e,t){w.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),w.support.style||(w.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),w.support.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.support.enctype||(w.propFix.enctype="encoding"),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(w.isArray(t))return e.checked=w.inArray(w(e).val(),t)>=0}},w.support.checkOn||(w.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;w.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=w._data(e);if(!y)return;r.handler&&(l=r,r=l.handler,o=l.selector),r.guid||(r.guid=w.guid++),(a=y.events)||(a=y.events={}),(h=y.handle)||(h=y.handle=function(e){return typeof w===i||!!e&&w.event.triggered===e.type?t:w.event.dispatch.apply(h.elem,arguments)},h.elem=e),n=(n||"").match(S)||[""],f=n.length;while(f--){u=rt.exec(n[f])||[],v=g=u[1],m=(u[2]||"").split(".").sort();if(!v)continue;c=w.event.special[v]||{},v=(o?c.delegateType:c.bindType)||v,c=w.event.special[v]||{},p=w.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&w.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[],d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===!1)e.addEventListener?e.addEventListener(v,h,!1):e.attachEvent&&e.attachEvent("on"+v,h)}c.add&&(c.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,p):d.push(p),w.event.global[v]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=w.hasData(e)&&w._data(e);if(!m||!(l=m.events))return;t=(t||"").match(S)||[""],f=t.length;while(f--){u=rt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in l)w.event.remove(e,p+t[f],n,r,!0);continue}c=w.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=l[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;while(s--)o=h[s],(i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(h.splice(s,1),o.selector&&h.delegateCount--,c.remove&&c.remove.call(e,o));a&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&w.removeEvent(e,p,m.handle),delete l[p])}w.isEmptyObject(l)&&(delete m.handle,w._removeData(e,"events"))},trigger:function(n,r,i,s){var u,a,f,l,c,h,p,d=[i||o],v=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||o;if(i.nodeType===3||i.nodeType===8)return;if(nt.test(v+w.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),a=v.indexOf(":")<0&&"on"+v,n=n[w.expando]?n:new w.Event(v,typeof n=="object"&&n),n.isTrigger=s?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=r==null?[n]:w.makeArray(r,[n]),c=w.event.special[v]||{};if(!s&&c.trigger&&c.trigger.apply(i,r)===!1)return;if(!s&&!c.noBubble&&!w.isWindow(i)){l=c.delegateType||v,nt.test(l+v)||(f=f.parentNode);for(;f;f=f.parentNode)d.push(f),h=f;h===(i.ownerDocument||o)&&d.push(h.defaultView||h.parentWindow||e)}p=0;while((f=d[p++])&&!n.isPropagationStopped())n.type=p>1?l:c.bindType||v,u=(w._data(f,"events")||{})[n.type]&&w._data(f,"handle"),u&&u.apply(f,r),u=a&&f[a],u&&w.acceptData(f)&&u.apply&&u.apply(f,r)===!1&&n.preventDefault();n.type=v;if(!s&&!n.isDefaultPrevented()&&(!c._default||c._default.apply(d.pop(),r)===!1)&&w.acceptData(i)&&a&&i[v]&&!w.isWindow(i)){h=i[a],h&&(i[a]=null),w.event.triggered=v;try{i[v]()}catch(g){}w.event.triggered=t,h&&(i[a]=h)}return n.result},dispatch:function(e){e=w.event.fix(e);var n,r,i,s,o,u=[],a=v.call(arguments),f=(w._data(this,"events")||{})[e.type]||[],l=w.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=w.event.handlers.call(this,e,f),n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,r=((w.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click"))for(;f!=this;f=f.parentNode||this)if(f.nodeType===1&&(f.disabled!==!0||e.type!=="click")){s=[];for(o=0;o<a;o++)i=n[o],r=i.selector+" ",s[r]===t&&(s[r]=i.needsContext?w(r,this).index(f)>=0:w.find(r,this,null,[f]).length),s[r]&&s.push(i);s.length&&u.push({elem:f,handlers:s})}return a<n.length&&u.push({elem:this,handlers:n.slice(a)}),u},fix:function(e){if(e[w.expando])return e;var t,n,r,i=e.type,s=e,u=this.fixHooks[i];u||(this.fixHooks[i]=u=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=u.props?this.props.concat(u.props):this.props,e=new w.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=s.srcElement||o),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,u.filter?u.filter(e,s):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,s,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(i=e.target.ownerDocument||o,s=i.documentElement,r=i.body,e.pageX=n.clientX+(s&&s.scrollLeft||r&&r.scrollLeft||0)-(s&&s.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||r&&r.scrollTop||0)-(s&&s.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ot()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===ot()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(w.nodeName(this,"input")&&this.type==="checkbox"&&this.click)return this.click(),!1},_default:function(e){return w.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=w.extend(new w.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?w.event.trigger(i,null,t):w.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},w.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:st):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||w.now(),this[w.expando]=!0},w.Event.prototype={isDefaultPrevented:st,isPropagationStopped:st,isImmediatePropagationStopped:st,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},w.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj;if(!i||i!==r&&!w.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),w.support.submitBubbles||(w.event.special.submit={setup:function(){if(w.nodeName(this,"form"))return!1;w.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=w.nodeName(n,"input")||w.nodeName(n,"button")?n.form:t;r&&!w._data(r,"submitBubbles")&&(w.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),w._data(r,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&w.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(w.nodeName(this,"form"))return!1;w.event.remove(this,"._submit")}}),w.support.changeBubbles||(w.event.special.change={setup:function(){if(Z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")w.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),w.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),w.event.simulate("change",this,e,!0)});return!1}w.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!w._data(t,"changeBubbles")&&(w.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&w.event.simulate("change",this.parentNode,e,!0)}),w._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return w.event.remove(this,"._change"),!Z.test(this.nodeName)}}),w.support.focusinBubbles||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){w.event.simulate(t,e.target,w.event.fix(e),!0)};w.event.special[t]={setup:function(){n++===0&&o.addEventListener(e,r,!0)},teardown:function(){--n===0&&o.removeEventListener(e,r,!0)}}}),w.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(o in e)this.on(o,n,r,e[o],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=st;else if(!i)return this;return s===1&&(u=i,i=function(e){return w().off(e),u.apply(this,arguments)},i.guid=u.guid||(u.guid=w.guid++)),this.each(function(){w.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,w(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=st),this.each(function(){w.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}});var ut=/^.[^:#\[\.,]*$/,at=/^(?:parents|prev(?:Until|All))/,ft=w.expr.match.needsContext,lt={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if(typeof e!="string")return this.pushStack(w(e).filter(function(){for(t=0;t<i;t++)if(w.contains(r[t],this))return!0}));for(t=0;t<i;t++)w.find(e,r[t],n);return n=this.pushStack(i>1?w.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=w(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(w.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ht(this,e||[],!0))},filter:function(e){return this.pushStack(ht(this,e||[],!1))},is:function(e){return!!ht(this,typeof e=="string"&&ft.test(e)?w(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,s=[],o=ft.test(e)||typeof e!="string"?w(e,t||this.context):0;for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&w.find.matchesSelector(n,e))){n=s.push(n);break}return this.pushStack(s.length>1?w.unique(s):s)},index:function(e){return e?typeof e=="string"?w.inArray(this[0],w(e)):w.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?w(e,t):w.makeArray(e&&e.nodeType?[e]:e),r=w.merge(this.get(),n);return this.pushStack(w.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return w.dir(e,"parentNode")},parentsUntil:function(e,t,n){return w.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return w.dir(e,"nextSibling")},prevAll:function(e){return w.dir(e,"previousSibling")},nextUntil:function(e,t,n){return w.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return w.dir(e,"previousSibling",n)},siblings:function(e){return w.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return w.sibling(e.firstChild)},contents:function(e){return w.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:w.merge([],e.childNodes)}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=w.filter(r,i)),this.length>1&&(lt[e]||(i=w.unique(i)),at.test(e)&&(i=i.reverse())),this.pushStack(i)}}),w.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return e.nodeType===1}))},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!w(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/<tbody/i,Et=/<|&#?\w+;/,St=/<(?:script|style|link)/i,xt=/^(?:checkbox|radio)$/i,Tt=/checked\s*(?:[^=]|=\s*.checked.)/i,Nt=/^$|\/(?:java|ecma)script/i,Ct=/^true\/(.*)/,kt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Lt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:w.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},At=pt(o),Ot=At.appendChild(o.createElement("div"));Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td,w.fn.extend({text:function(e){return w.access(this,function(e){return e===t?w.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?w.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++)!t&&n.nodeType===1&&w.cleanData(jt(n)),n.parentNode&&(t&&w.contains(n.ownerDocument,n)&&Pt(jt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&w.cleanData(jt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&w.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return w.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(vt,""):t;if(typeof e=="string"&&!St.test(e)&&(w.support.htmlSerialize||!mt.test(e))&&(w.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(w.cleanData(jt(n,!1)),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=w.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),w(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=p.apply([],e);var r,i,s,o,u,a,f=0,l=this.length,c=this,h=l-1,d=e[0],v=w.isFunction(d);if(v||!(l<=1||typeof d!="string"||w.support.checkClone||!Tt.test(d)))return this.each(function(r){var i=c.eq(r);v&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(l){a=w.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=a.firstChild,a.childNodes.length===1&&(a=r);if(r){o=w.map(jt(a,"script"),_t),s=o.length;for(;f<l;f++)i=a,f!==h&&(i=w.clone(i,!0,!0),s&&w.merge(o,jt(i,"script"))),t.call(this[f],i,f);if(s){u=o[o.length-1].ownerDocument,w.map(o,Dt);for(f=0;f<s;f++)i=o[f],Nt.test(i.type||"")&&!w._data(i,"globalEval")&&w.contains(u,i)&&(i.src?w._evalUrl(i.src):w.globalEval((i.text||i.textContent||i.innerHTML||"").replace(kt,"")))}a=r=null}}return this}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){var n,r=0,i=[],s=w(e),o=s.length-1;for(;r<=o;r++)n=r===o?this:this.clone(!0),w(s[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),w.extend({clone:function(e,t,n){var r,i,s,o,u,a=w.contains(e.ownerDocument,e);w.support.html5Clone||w.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(Ot.innerHTML=e.outerHTML,Ot.removeChild(s=Ot.firstChild));if((!w.support.noCloneEvent||!w.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!w.isXMLDoc(e)){r=jt(s),u=jt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&Bt(i,r[o])}if(t)if(n){u=u||jt(e),r=r||jt(s);for(o=0;(i=u[o])!=null;o++)Ht(i,r[o])}else Ht(e,s);return r=jt(s,"script"),r.length>0&&Pt(r,!a&&jt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d<c;d++){s=e[d];if(s||s===0)if(w.type(s)==="object")w.merge(p,s.nodeType?[s]:s);else if(!Et.test(s))p.push(t.createTextNode(s));else{u=u||h.appendChild(t.createElement("div")),a=(bt.exec(s)||["",""])[1].toLowerCase(),l=Lt[a]||Lt._default,u.innerHTML=l[1]+s.replace(yt,"<$1></$2>")+l[2],i=l[0];while(i--)u=u.lastChild;!w.support.leadingWhitespace&&gt.test(s)&&p.push(t.createTextNode(gt.exec(s)[0]));if(!w.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]==="<table>"&&!wt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)w.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}w.merge(p,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=h.lastChild}}u&&h.removeChild(u),w.support.appendChecked||w.grep(jt(p,"input"),Ft),d=0;while(s=p[d++]){if(r&&w.inArray(s,r)!==-1)continue;o=w.contains(s.ownerDocument,s),u=jt(h.appendChild(s),"script"),o&&Pt(u);if(n){i=0;while(s=u[i++])Nt.test(s.type||"")&&n.push(s)}}return u=null,h},cleanData:function(e,t){var n,r,s,o,u=0,a=w.expando,f=w.cache,l=w.support.deleteExpando,h=w.event.special;for(;(n=e[u])!=null;u++)if(t||w.acceptData(n)){s=n[a],o=s&&f[s];if(o){if(o.events)for(r in o.events)h[r]?w.event.remove(n,r):w.removeEvent(n,r,o.handle);f[s]&&(delete f[s],l?delete n[a]:typeof n.removeAttribute!==i?n.removeAttribute(a):n[a]=null,c.push(s))}}},_evalUrl:function(e){return w.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),w.fn.extend({wrapAll:function(e){if(w.isFunction(e))return this.each(function(t){w(this).wrapAll(e.call(this,t))});if(this[0]){var t=w(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return w.isFunction(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=w.isFunction(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){w.nodeName(this,"body")||w(this).replaceWith(this.childNodes)}).end()}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+E+")(.*)$","i"),Jt=new RegExp("^("+E+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+E+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];w.fn.extend({css:function(e,n){return w.access(this,function(e,n,r){var i,s,o={},u=0;if(w.isArray(n)){s=qt(e),i=n.length;for(;u<i;u++)o[n[u]]=w.css(e,n[u],!1,s);return o}return r!==t?w.style(e,n,r):w.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){nn(this)?w(this).show():w(this).hide()})}}),w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":w.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=w.camelCase(n),f=e.style;n=w.cssProps[a]||(w.cssProps[a]=tn(f,a)),u=w.cssHooks[n]||w.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=Kt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(w.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!w.cssNumber[a]&&(r+="px"),!w.support.clearCloneStyle&&r===""&&n.indexOf("background")===0&&(f[n]="inherit");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=w.camelCase(n);return n=w.cssProps[a]||(w.cssProps[a]=tn(e.style,a)),u=w.cssHooks[n]||w.cssHooks[a],u&&"get"in u&&(o=u.get(e,!0,r)),o===t&&(o=Rt(e,n,i)),o==="normal"&&n in Yt&&(o=Yt[n]),r===""||r?(s=parseFloat(o),r===!0||w.isNumeric(s)?s||0:o):o}}),e.getComputedStyle?(qt=function(t){return e.getComputedStyle(t,null)},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;return u&&(a===""&&!w.contains(e.ownerDocument,e)&&(a=w.style(e,n)),Jt.test(a)&&Vt.test(n)&&(i=f.width,s=f.minWidth,o=f.maxWidth,f.minWidth=f.maxWidth=f.width=a,a=u.width,f.width=i,f.minWidth=s,f.maxWidth=o)),a}):o.documentElement.currentStyle&&(qt=function(e){return e.currentStyle},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;return a==null&&f&&f[n]&&(a=f[n]),Jt.test(a)&&!Wt.test(n)&&(i=f.left,s=e.runtimeStyle,o=s&&s.left,o&&(s.left=e.currentStyle.left),f.left=n==="fontSize"?"1em":a,a=f.pixelLeft+"px",f.left=i,o&&(s.left=o)),a===""?"auto":a}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&Xt.test(w.css(e,"display"))?w.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,w.support.boxSizing&&w.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),w.support.opacity||(w.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=w.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&w.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}),w(function(){w.support.reliableMarginRight||(w.cssHooks.marginRight={get:function(e,t){if(t)return w.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}),!w.support.pixelPosition&&w.fn.position&&w.each(["top","left"],function(e,t){w.cssHooks[t]={get:function(e,n){if(n)return n=Rt(e,t),Jt.test(n)?w(e).position()[t]+"px":n}}})}),w.expr&&w.expr.filters&&(w.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!w.support.reliableHiddenOffsets&&(e.style&&e.style.display||w.css(e,"display"))==="none"},w.expr.filters.visible=function(e){return!w.expr.filters.hidden(e)}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+Zt[r]+t]=s[r]||s[r-2]||s[0];return i}},Vt.test(e)||(w.cssHooks[e+t].set=sn)});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=w(this).val();return n==null?null:w.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}}),w.param=function(e,n){var r,i=[],s=function(e,t){t=w.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=w.ajaxSettings&&w.ajaxSettings.traditional);if(w.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){s(this.name,this.value)});else for(r in e)vn(r,e[r],n,s);return i.join("&").replace(ln,"+")},w.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,gn,yn=w.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=w.fn.load,Ln={},An={},On="*/".concat("*");try{gn=s.href}catch(Mn){gn=o.createElement("a"),gn.href="",gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[],w.fn.load=function(e,n,r){if(typeof e!="string"&&kn)return kn.apply(this,arguments);var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),w.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(o="POST"),u.length>0&&w.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments,u.html(i?w("<div>").append(w.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":w.parseJSON,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Pn(Pn(e,w.ajaxSettings),t):Pn(w.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(b===2)return;b=2,u&&clearTimeout(u),f=t,o=i||"",x.readyState=e>0?4:0,l=e>=200&&e<300||e===304,r&&(E=Hn(c,x,r)),E=Bn(c,E,x,l);if(l)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(w.lastModified[s]=S),S=x.getResponseHeader("etag"),S&&(w.etag[s]=S)),e===204||c.type==="HEAD"?T="nocontent":e===304?T="notmodified":(T=E.state,g=E.data,y=E.error,l=!y);else{y=T;if(e||!T)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[g,T,x]):d.rejectWith(h,[x,T,y]),x.statusCode(m),m=t,a&&p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y]),v.fireWith(h,[x,T]),a&&(p.trigger("ajaxComplete",[x,c]),--w.active||w.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=w.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?w(h):w.event,d=w.Deferred(),v=w.Callbacks("once memory"),m=c.statusCode||{},g={},y={},b=0,E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!l){l={};while(t=Sn.exec(o))l[t[1].toLowerCase()]=t[2]}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||E;return f&&f.abort(t),N(0,t),this}};d.promise(x).complete=v.add,x.success=x.done,x.error=x.fail,c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//"),c.type=n.method||n.type||c.method||c.type,c.dataTypes=w.trim(c.dataType||"*").toLowerCase().match(S)||[""],c.crossDomain==null&&(r=Cn.exec(c.url.toLowerCase()),c.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||(r[1]==="http:"?"80":"443"))===(mn[3]||(mn[1]==="http:"?"80":"443")))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=w.param(c.data,c.traditional)),Dn(Ln,c,n,x);if(b===2)return x;a=c.global,a&&w.active++===0&&w.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Tn.test(c.type),s=c.url,c.hasContent||(c.data&&(s=c.url+=(bn.test(s)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++)),c.ifModified&&(w.lastModified[s]&&x.setRequestHeader("If-Modified-Since",w.lastModified[s]),w.etag[s]&&x.setRequestHeader("If-None-Match",w.etag[s])),(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers)x.setRequestHeader(i,c.headers[i]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&b!==2){E="abort";for(i in{success:1,error:1,complete:1})x[i](c[i]);f=Dn(An,c,n,x);if(!f)N(-1,"No Transport");else{x.readyState=1,a&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{b=1,f.send(g,N)}catch(T){if(!(b<2))throw T;N(-1,T)}}return x}return x.abort()},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,n){return w.get(e,t,n,"script")}}),w.each(["get","post"],function(e,n){w[n]=function(e,r,i,s){return w.isFunction(r)&&(s=s||i,i=r,r=t),w.ajax({url:e,type:n,dataType:s,data:r,success:i})}}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),w.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||w("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||w.expando+"_"+yn++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==!1&&(Fn.test(n.url)?"url":typeof n.data=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp")return s=n.jsonpCallback=w.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a?n[a]=n[a].replace(Fn,"$1"+s):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||w.error(s+" was not called"),u[0]},n.dataTypes[0]="json",o=e[s],e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,jn.push(s)),u&&w.isFunction(o)&&o(u[0]),u=o=t}),"script"});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In)In[e](t,!0)};w.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn,qn=w.ajaxSettings.xhr(),w.support.cors=!!qn&&"withCredentials"in qn,qn=w.support.ajax=!!qn,qn&&w.ajaxTransport(function(n){if(!n.crossDomain||w.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=w.noop,Un&&delete In[o]);if(i)a.readyState!==4&&a.abort();else{c={},u=a.status,f=a.getAllResponseHeaders(),typeof a.responseText=="string"&&(c.text=a.responseText);try{l=a.statusText}catch(h){l=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(p){i||s(-1,p)}c&&s(u,l,c,f)},n.async?a.readyState===4?setTimeout(r):(o=++Rn,Un&&(In||(In={},w(e).unload(Un)),In[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+E+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Jn.exec(t),s=i&&i[3]||(w.cssNumber[e]?"":"px"),o=(w.cssNumber[e]||s!=="px"&&+r)&&Jn.exec(w.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3],i=i||[],o=+r||1;do u=u||".5",o/=u,w.style(n.elem,e,o+s);while(u!==(u=n.cur()/r)&&u!==1&&--a)}return i&&(o=n.start=+o||+r||0,n.unit=s,n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]),n}]};w.Animation=w.extend(er,{tweener:function(e,t){w.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Gn[n]=Gn[n]||[],Gn[n].unshift(t)},prefilter:function(e,t){t?Qn.unshift(e):Qn.push(e)}}),w.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(w.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=w.css(e.elem,e.prop,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):e.elem.style&&(e.elem.style[w.cssProps[e.prop]]!=null||w.cssHooks[e.prop])?w.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return e==null||typeof e=="boolean"?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),s=w.speed(t,n,r),o=function(){var t=er(this,w.extend({},e),s);(i||w._data(this,"finish"))&&t.stop(!0)};return o.finish=o,i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=w.timers,o=w._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Kn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&w.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=w._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],s=w.timers,o=r?r.length:0;n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0);for(t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.speed=function(e,t,n){var r=e&&typeof e=="object"?w.extend({},e):{complete:n||!n&&t||w.isFunction(e)&&e,duration:e,easing:n&&t||t&&!w.isFunction(t)&&t};r.duration=w.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in w.fx.speeds?w.fx.speeds[r.duration]:w.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){w.isFunction(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},w.timers=[],w.fx=rr.prototype.init,w.fx.tick=function(){var e,n=w.timers,r=0;Xn=w.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||w.fx.stop(),Xn=t},w.fx.timer=function(e){e()&&w.timers.push(e)&&w.fx.start()},w.fx.interval=13,w.fx.start=function(){Vn||(Vn=setInterval(w.fx.tick,w.fx.interval))},w.fx.stop=function(){clearInterval(Vn),Vn=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fx.step={},w.expr&&w.expr.filters&&(w.expr.filters.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length}),w.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){w.offset.setOffset(this,e,t)});var n,r,s={top:0,left:0},o=this[0],u=o&&o.ownerDocument;if(!u)return;return n=u.documentElement,w.contains(n,o)?(typeof o.getBoundingClientRect!==i&&(s=o.getBoundingClientRect()),r=sr(u),{top:s.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:s.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):s},w.offset={setOffset:function(e,t,n){var r=w.css(e,"position");r==="static"&&(e.style.position="relative");var i=w(e),s=i.offset(),o=w.css(e,"top"),u=w.css(e,"left"),a=(r==="absolute"||r==="fixed")&&w.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),w.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},w.fn.extend({position:function(){if(!this[0])return;var e,t,n={top:0,left:0},r=this[0];return w.css(r,"position")==="fixed"?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),w.nodeName(e[0],"html")||(n=e.offset()),n.top+=w.css(e[0],"borderTopWidth",!0),n.left+=w.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-w.css(r,"marginTop",!0),left:t.left-n.left-w.css(r,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u;while(e&&!w.nodeName(e,"html")&&w.css(e,"position")==="static")e=e.offsetParent;return e||u})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);w.fn[e]=function(i){return w.access(this,function(e,i,s){var o=sr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?w(o).scrollLeft():s,r?s:w(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),w.each({Height:"height",Width:"width"},function(e,n){w.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){w.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return w.access(this,function(n,r,i){var s;return w.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?w.css(n,r,u):w.style(n,r,i,u)},n,o?i:t,o,null)}})}),w.fn.size=function(){return this.length},w.fn.andSelf=w.fn.addBack,typeof module=="object"&&module&&typeof module.exports=="object"?module.exports=w:(e.jQuery=e.$=w,typeof define=="function"&&define.amd&&define("jquery",[],function(){return w}))}(window),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else{var o=x.keys(e);for(var i=0,s=o.length;i<s;i++)if(t.call(r,e[o[i]],o[i],e)===n)return}};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r},x.sample=function(e,t,n){return arguments.length<2||n?e[x.random(e.length-1)]:x.shuffle(e).slice(0,Math.max(0,t))};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index-t.index}),"value")};var L=function(e){return function(t,n,r){var i={},s=n==null?x.identity:k(n);return T(t,function(n,o){var u=s.call(r,n,o,t);e(i,u,n)}),i}};x.groupBy=L(function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)}),x.indexBy=L(function(e,t,n){e[t]=n}),x.countBy=L(function(e,t){x.has(e,t)?e[t]++:e[t]=1}),x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t==null||n?e[0]:u.call(e,0,t)},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t==null||n?e[e.length-1]:u.call(e,Math.max(e.length-t,0))},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return t&&x.every(e,x.isArray)?a.apply(n,e):(T(e,function(e){x.isArray(e)||x.isArguments(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n)};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n<e;n++)t[n]=x.pluck(arguments,""+n);return t},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};x.bind=function(e,t){var n,r;if(S&&e.bind===S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;return n=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:new Date,o=null,s=e.apply(r,i)};return function(){var f=new Date;!u&&n.leading===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(o),o=null,u=f,s=e.apply(r,i)):!o&&n.trailing!==!1&&(o=setTimeout(a,l)),s}},x.debounce=function(e,t,n){var r,i,s,o,u;return function(){s=this,i=arguments,o=new Date;var a=function(){var f=new Date-o;f<t?r=setTimeout(a,t-f):(r=null,n||(u=e.apply(s,i)))},f=n&&!r;return r||(r=setTimeout(a,t)),f&&(u=e.apply(s,i)),u}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=e[t[i]];return r},x.pairs=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},x.invert=function(e){var t={},n=x.keys(e);for(var r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;var o=e.constructor,u=t.constructor;if(o!==u&&!(x.isFunction(o)&&o instanceof o&&x.isFunction(u)&&u instanceof u))return!1;n.push(e),r.push(t);var a=0,l=!0;if(i=="[object Array]"){a=e.length,l=a==t.length;if(l)while(a--)if(!(l=M(e[a],t[a],n,r)))break}else{for(var c in e)if(x.has(e,c)){a++;if(!(l=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(l){for(c in t)if(x.has(t,c)&&!(a--))break;l=!a}}return n.pop(),r.pop(),l};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(Math.max(0,e));for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t,n;return t||e._}}(this)),function(e,t){if(typeof define=="function"&&define.amd)define("backbone",["underscore","jquery","exports"],function(n,r,i){e.Backbone=t(e,i,n,r)});else if(typeof exports!="undefined"){var n=require("underscore");t(e,exports,n)}else e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t,n,r){var i=e.Backbone,s=[],o=s.push,u=s.slice,a=s.splice;t.VERSION="1.1.2",t.$=r,t.noConflict=function(){return e.Backbone=i,this},t.emulateHTTP=!1,t.emulateJSON=!1;var f=t.Events={on:function(e,t,n){if(!c(this,"on",e,[t,n])||!t)return this;this._events||(this._events={});var r=this._events[e]||(this._events[e]=[]);return r.push({callback:t,context:n,ctx:n||this}),this},once:function(e,t,r){if(!c(this,"once",e,[t,r])||!t)return this;var i=this,s=n.once(function(){i.off(e,s),t.apply(this,arguments)});return s._callback=t,this.on(e,s,r)},off:function(e,t,r){var i,s,o,u,a,f,l,h;if(!this._events||!c(this,"off",e,[t,r]))return this;if(!e&&!t&&!r)return this._events=void 0,this;u=e?[e]:n.keys(this._events);for(a=0,f=u.length;a<f;a++){e=u[a];if(o=this._events[e]){this._events[e]=i=[];if(t||r)for(l=0,h=o.length;l<h;l++)s=o[l],(t&&t!==s.callback&&t!==s.callback._callback||r&&r!==s.context)&&i.push(s);i.length||delete this._events[e]}}return this},trigger:function(e){if(!this._events)return this;var t=u.call(arguments,1);if(!c(this,"trigger",e,t))return this;var n=this._events[e],r=this._events.all;return n&&h(n,t),r&&h(r,arguments),this},stopListening:function(e,t,r){var i=this._listeningTo;if(!i)return this;var s=!t&&!r;!r&&typeof t=="object"&&(r=this),e&&((i={})[e._listenId]=e);for(var o in i)e=i[o],e.off(t,r,this),(s||n.isEmpty(e._events))&&delete this._listeningTo[o];return this}},l=/\s+/,c=function(e,t,n,r){if(!n)return!0;if(typeof n=="object"){for(var i in n)e[t].apply(e,[i,n[i]].concat(r));return!1}if(l.test(n)){var s=n.split(l);for(var o=0,u=s.length;o<u;o++)e[t].apply(e,[s[o]].concat(r));return!1}return!0},h=function(e,t){var n,r=-1,i=e.length,s=t[0],o=t[1],u=t[2];switch(t.length){case 0:while(++r<i)(n=e[r]).callback.call(n.ctx);return;case 1:while(++r<i)(n=e[r]).callback.call(n.ctx,s);return;case 2:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o);return;case 3:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o,u);return;default:while(++r<i)(n=e[r]).callback.apply(n.ctx,t);return}},p={listenTo:"on",listenToOnce:"once"};n.each(p,function(e,t){f[t]=function(t,r,i){var s=this._listeningTo||(this._listeningTo={}),o=t._listenId||(t._listenId=n.uniqueId("l"));return s[o]=t,!i&&typeof r=="object"&&(i=this),t[e](r,i,this),this}}),f.bind=f.on,f.unbind=f.off,n.extend(t,f);var d=t.Model=function(e,t){var r=e||{};t||(t={}),this.cid=n.uniqueId("c"),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(r=this.parse(r,t)||{}),r=n.defaults({},r,n.result(this,"defaults")),this.set(r,t),this.changed={},this.initialize.apply(this,arguments)};n.extend(d.prototype,f,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return this.get(e)!=null},set:function(e,t,r){var i,s,o,u,a,f,l,c;if(e==null)return this;typeof e=="object"?(s=e,r=t):(s={})[e]=t,r||(r={});if(!this._validate(s,r))return!1;o=r.unset,a=r.silent,u=[],f=this._changing,this._changing=!0,f||(this._previousAttributes=n.clone(this.attributes),this.changed={}),c=this.attributes,l=this._previousAttributes,this.idAttribute in s&&(this.id=s[this.idAttribute]);for(i in s)t=s[i],n.isEqual(c[i],t)||u.push(i),n.isEqual(l[i],t)?delete this.changed[i]:this.changed[i]=t,o?delete c[i]:c[i]=t;if(!a){u.length&&(this._pending=r);for(var h=0,p=u.length;h<p;h++)this.trigger("change:"+u[h],this,c[u[h]],r)}if(f)return this;if(!a)while(this._pending)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return e==null?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?n.clone(this.changed):!1;var t,r=!1,i=this._changing?this._previousAttributes:this.attributes;for(var s in e){if(n.isEqual(i[s],t=e[s]))continue;(r||(r={}))[s]=t}return r},previous:function(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=e?n.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=this,r=e.success;return e.success=function(n){if(!t.set(t.parse(n,e),e))return!1;r&&r(t,n,e),t.trigger("sync",t,n,e)},I(this,e),this.sync("read",this,e)},save:function(e,t,r){var i,s,o,u=this.attributes;e==null||typeof e=="object"?(i=e,r=t):(i={})[e]=t,r=n.extend({validate:!0},r);if(i&&!r.wait){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;i&&r.wait&&(this.attributes=n.extend({},u,i)),r.parse===void 0&&(r.parse=!0);var a=this,f=r.success;return r.success=function(e){a.attributes=u;var t=a.parse(e,r);r.wait&&(t=n.extend(i||{},t));if(n.isObject(t)&&!a.set(t,r))return!1;f&&f(a,e,r),a.trigger("sync",a,e,r)},I(this,r),s=this.isNew()?"create":r.patch?"patch":"update",s==="patch"&&(r.attrs=i),o=this.sync(s,this,r),i&&r.wait&&(this.attributes=u),o},destroy:function(e){e=e?n.clone(e):{};var t=this,r=e.success,i=function(){t.trigger("destroy",t,t.collection,e)};e.success=function(n){(e.wait||t.isNew())&&i(),r&&r(t,n,e),t.isNew()||t.trigger("sync",t,n,e)};if(this.isNew())return e.success(),!1;I(this,e);var s=this.sync("delete",this,e);return e.wait||i(),s},url:function(){var e=n.result(this,"urlRoot")||n.result(this.collection,"url")||F();return this.isNew()?e:e.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},n.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var r=this.validationError=this.validate(e,t)||null;return r?(this.trigger("invalid",this,r,n.extend(t,{validationError:r})),!1):!0}});var v=["keys","values","pairs","invert","pick","omit"];n.each(v,function(e){d.prototype[e]=function(){var t=u.call(arguments);return t.unshift(this.attributes),n[e].apply(n,t)}});var m=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),t.comparator!==void 0&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},g={add:!0,remove:!0,merge:!0},y={add:!0,remove:!1};n.extend(m.prototype,f,{model:d,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:!1},t,y))},remove:function(e,t){var r=!n.isArray(e);e=r?[e]:n.clone(e),t||(t={});var i,s,o,u;for(i=0,s=e.length;i<s;i++){u=e[i]=this.get(e[i]);if(!u)continue;delete this._byId[u.id],delete this._byId[u.cid],o=this.indexOf(u),this.models.splice(o,1),this.length--,t.silent||(t.index=o,u.trigger("remove",u,this,t)),this._removeReference(u,t)}return r?e[0]:e},set:function(e,t){t=n.defaults({},t,g),t.parse&&(e=this.parse(e,t));var r=!n.isArray(e);e=r?e?[e]:[]:n.clone(e);var i,s,o,u,a,f,l,c=t.at,h=this.model,p=this.comparator&&c==null&&t.sort!==!1,v=n.isString(this.comparator)?this.comparator:null,m=[],y=[],b={},w=t.add,E=t.merge,S=t.remove,x=!p&&w&&S?[]:!1;for(i=0,s=e.length;i<s;i++){a=e[i]||{},a instanceof d?o=u=a:o=a[h.prototype.idAttribute||"id"];if(f=this.get(o))S&&(b[f.cid]=!0),E&&(a=a===u?u.attributes:a,t.parse&&(a=f.parse(a,t)),f.set(a,t),p&&!l&&f.hasChanged(v)&&(l=!0)),e[i]=f;else if(w){u=e[i]=this._prepareModel(a,t);if(!u)continue;m.push(u),this._addReference(u,t)}u=f||u,x&&(u.isNew()||!b[u.id])&&x.push(u),b[u.id]=!0}if(S){for(i=0,s=this.length;i<s;++i)b[(u=this.models[i]).cid]||y.push(u);y.length&&this.remove(y,t)}if(m.length||x&&x.length){p&&(l=!0),this.length+=m.length;if(c!=null)for(i=0,s=m.length;i<s;i++)this.models.splice(c+i,0,m[i]);else{x&&(this.models.length=0);var T=x||m;for(i=0,s=T.length;i<s;i++)this.models.push(T[i])}}l&&this.sort({silent:!0});if(!t.silent){for(i=0,s=m.length;i<s;i++)(u=m[i]).trigger("add",u,this,t);(l||x&&x.length)&&this.trigger("sort",this,t)}return r?e[0]:e},reset:function(e,t){t||(t={});for(var r=0,i=this.models.length;r<i;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return u.apply(this.models,arguments)},get:function(e){return e==null?void 0:this._byId[e]||this._byId[e.id]||this._byId[e.cid]},at:function(e){return this.models[e]},where:function(e,t){return n.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var n in e)if(e[n]!==t.get(n))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),n.isString(this.comparator)||this.comparator.length===1?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return n.invoke(this.models,"get",e)},fetch:function(e){e=e?n.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=e.success,r=this;return e.success=function(n){var i=e.reset?"reset":"set";r[i](n,e),t&&t(r,n,e),r.trigger("sync",r,n,e)},I(this,e),this.sync("read",this,e)},create:function(e,t){t=t?n.clone(t):{};if(!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var r=this,i=t.success;return t.success=function(e,n){t.wait&&r.add(e,t),i&&i(e,n,t)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof d)return e;t=t?n.clone(t):{},t.collection=this;var r=new this.model(e,t);return r.validationError?(this.trigger("invalid",this,r.validationError,t),!1):r},_addReference:function(e,t){this._byId[e.cid]=e,e.id!=null&&(this._byId[e.id]=e),e.collection||(e.collection=this),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if((e==="add"||e==="remove")&&n!==this)return;e==="destroy"&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],t.id!=null&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments)}});var b=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];n.each(b,function(e){m.prototype[e]=function(){var t=u.call(arguments);return t.unshift(this.models),n[e].apply(n,t)}});var w=["groupBy","countBy","sortBy","indexBy"];n.each(w,function(e){m.prototype[e]=function(t,r){var i=n.isFunction(t)?t:function(e){return e.get(t)};return n[e](this.models,i,r)}});var E=t.View=function(e){this.cid=n.uniqueId("view"),e||(e={}),n.extend(this,n.pick(e,x)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},S=/^(\S+)\s*(.*)$/,x=["model","collection","el","id","attributes","className","tagName","events"];n.extend(E.prototype,f,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(e,n){return this.$el&&this.undelegateEvents(),this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0],n!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=n.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var r=e[t];n.isFunction(r)||(r=this[e[t]]);if(!r)continue;var i=t.match(S),s=i[1],o=i[2];r=n.bind(r,this),s+=".delegateEvents"+this.cid,o===""?this.$el.on(s,r):this.$el.on(s,o,r)}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(!this.el){var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e["class"]=n.result(this,"className"));var r=t.$("<"+n.result(this,"tagName")+">").attr(e);this.setElement(r,!1)}else this.setElement(n.result(this,"el"),!1)}}),t.sync=function(e,r,i){var s=N[e];n.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var o={type:s,dataType:"json"};i.url||(o.url=n.result(r,"url")||F()),i.data==null&&r&&(e==="create"||e==="update"||e==="patch")&&(o.contentType="application/json",o.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{});if(i.emulateHTTP&&(s==="PUT"||s==="DELETE"||s==="PATCH")){o.type="POST",i.emulateJSON&&(o.data._method=s);var u=i.beforeSend;i.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",s);if(u)return u.apply(this,arguments)}}o.type!=="GET"&&!i.emulateJSON&&(o.processData=!1),o.type==="PATCH"&&T&&(o.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var a=i.xhr=t.ajax(n.extend(o,i));return r.trigger("request",r,a,i),a};var T=typeof window!="undefined"&&!!window.ActiveXObject&&(!window.XMLHttpRequest||!(new XMLHttpRequest).dispatchEvent),N={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var C=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},k=/\((.*?)\)/g,L=/(\(\?)?:\w+/g,A=/\*\w+/g,O=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(C.prototype,f,{initialize:function(){},route:function(e,r,i){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var s=this;return t.history.route(e,function(n){var o=s._extractParameters(e,n);s.execute(i,o),s.trigger.apply(s,["route:"+r].concat(o)),s.trigger("route",r,o),t.history.trigger("route",s,r,o)}),this},execute:function(e,t){e&&e.apply(this,t)},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(!this.routes)return;this.routes=n.result(this,"routes");var e,t=n.keys(this.routes);while((e=t.pop())!=null)this.route(e,this.routes[e])},_routeToRegExp:function(e){return e=e.replace(O,"\\$&").replace(k,"(?:$1)?").replace(L,function(e,t){return t?e:"([^/?]+)"}).replace(A,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var r=e.exec(t).slice(1);return n.map(r,function(e,t){return t===r.length-1?e||null:e?decodeURIComponent(e):null})}});var M=t.History=function(){this.handlers=[],n.bindAll(this,"checkUrl"),typeof window!="undefined"&&(this.location=window.location,this.history=window.history)},_=/^[#\/]|\s+$/g,D=/^\/+|\/+$/g,P=/msie [\w.]+/,H=/\/$/,B=/#.*$/;M.started=!1,n.extend(M.prototype,f,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(e==null)if(this._hasPushState||!this._wantsHashChange||t){e=decodeURI(this.location.pathname+this.location.search);var n=this.root.replace(H,"");e.indexOf(n)||(e=e.slice(n.length))}else e=this.getHash();return e.replace(_,"")},start:function(e){if(M.started)throw new Error("Backbone.history has already been started");M.started=!0,this.options=n.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment(),i=document.documentMode,s=P.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(D,"/");if(s&&this._wantsHashChange){var o=t.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=o.hide().appendTo("body")[0].contentWindow,this.navigate(r)}this._hasPushState?t.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?t.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=r;var u=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&u.hash&&(this.fragment=this.getHash().replace(_,""),this.history.replaceState({},document.title,this.root+this.fragment))}if(!this.options.silent)return this.loadUrl()},stop:function(){t.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),M.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return e=this.fragment=this.getFragment(e),n.any(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0})},navigate:function(e,t){if(!M.started)return!1;if(!t||t===!0)t={trigger:!!t};var n=this.root+(e=this.getFragment(e||""));e=e.replace(B,"");if(this.fragment===e)return;this.fragment=e,e===""&&n!=="/"&&(n=n.slice(0,-1));if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}if(t.trigger)return this.loadUrl(e)},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new M;var j=function(e,t){var r=this,i;e&&n.has(e,"constructor")?i=e.constructor:i=function(){return r.apply(this,arguments)},n.extend(i,r,t);var s=function(){this.constructor=i};return s.prototype=r.prototype,i.prototype=new s,e&&n.extend(i.prototype,e),i.__super__=r.prototype,i};d.extend=m.extend=C.extend=E.extend=M.extend=j;var F=function(){throw new Error('A "url" property or function must be specified')},I=function(e,t){var n=t.error;t.error=function(r){n&&n(e,r,t),e.trigger("error",e,r,t)}};return t}),define("text",["module"],function(e){"use strict";function v(e,t){return e===undefined||e===""?t:e}function m(e,t,n,r){if(t===r)return!0;if(e===n){if(e==="http")return v(t,"80")===v(r,"80");if(e==="https")return v(t,"443")===v(r,"443")}return!1}var t,n,r,i,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],u=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.15",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.lastIndexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||m(s,u,n,i))):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i&&i.isBuild&&!i.inlineText){r();return}d.isBuild=i&&i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i[0]==="﻿"&&(i=i.substring(1)),t(i)}catch(s){r&&r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status||0,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r&&r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return t}),define("aura/ext/debug",[],function(){"use strict";return{name:"debug",initialize:function(e){typeof window.attachDebugger=="function"&&(e.logger.log("Attaching debugger ..."),window.attachDebugger(e))}}}),!function(e){function r(){this._events={},this._conf&&i.call(this,this._conf)}function i(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners&&(this._events.maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this.newListener=e.newListener),this.wildcard&&(this.listenerTree={}))}function s(e){this._events={},this.newListener=!1,i.call(this,e)}function o(e,t,n,r){if(!n)return[];var i=[],s,u,a,f,l,c,h,p=t.length,d=t[r],v=t[r+1];if(r===p&&n._listeners){if(typeof n._listeners=="function")return e&&e.push(n._listeners),[n];for(s=0,u=n._listeners.length;s<u;s++)e&&e.push(n._listeners[s]);return[n]}if(d==="*"||d==="**"||n[d]){if(d==="*"){for(a in n)a!=="_listeners"&&n.hasOwnProperty(a)&&(i=i.concat(o(e,t,n[a],r+1)));return i}if(d==="**"){h=r+1===p||r+2===p&&v==="*",h&&n._listeners&&(i=i.concat(o(e,t,n,p)));for(a in n)a!=="_listeners"&&n.hasOwnProperty(a)&&(a==="*"||a==="**"?(n[a]._listeners&&!h&&(i=i.concat(o(e,t,n[a],p))),i=i.concat(o(e,t,n[a],r))):a===v?i=i.concat(o(e,t,n[a],r+2)):i=i.concat(o(e,t,n[a],r)));return i}i=i.concat(o(e,t,n[d],r+1))}f=n["*"],f&&o(e,t,f,r+1),l=n["**"];if(l)if(r<p){l._listeners&&o(e,t,l,p);for(a in l)a!=="_listeners"&&l.hasOwnProperty(a)&&(a===v?o(e,t,l[a],r+2):a===d?o(e,t,l[a],r+1):(c={},c[a]=l[a],o(e,t,{"**":c},r+1)))}else l._listeners?o(e,t,l,p):l["*"]&&l["*"]._listeners&&o(e,t,l["*"],p);return i}function u(e,r){e=typeof e=="string"?e.split(this.delimiter):e.slice();for(var i=0,s=e.length;i+1<s;i++)if(e[i]==="**"&&e[i+1]==="**")return;var o=this.listenerTree,u=e.shift();while(u){o[u]||(o[u]={}),o=o[u];if(e.length===0){if(!o._listeners)o._listeners=r;else if(typeof o._listeners=="function")o._listeners=[o._listeners,r];else if(t(o._listeners)){o._listeners.push(r);if(!o._listeners.warned){var a=n;typeof this._events.maxListeners!="undefined"&&(a=this._events.maxListeners),a>0&&o._listeners.length>a&&(o._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",o._listeners.length),console.trace())}}return!0}u=e.shift()}return!0}var t=Array.isArray?Array.isArray:function(t){return Object.prototype.toString.call(t)==="[object Array]"},n=10;s.prototype.delimiter=".",s.prototype.setMaxListeners=function(e){this._events||r.call(this),this._events.maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e},s.prototype.event="",s.prototype.once=function(e,t){return this.many(e,1,t),this},s.prototype.many=function(e,t,n){function i(){--t===0&&r.off(e,i),n.apply(this,arguments)}var r=this;if(typeof n!="function")throw new Error("many only accepts instances of Function");return i._origin=n,this.on(e,i),r},s.prototype.emit=function(){this._events||r.call(this);var e=arguments[0];if(e==="newListener"&&!this.newListener&&!this._events.newListener)return!1;if(this._all){var t=arguments.length,n=new Array(t-1);for(var i=1;i<t;i++)n[i-1]=arguments[i];for(i=0,t=this._all.length;i<t;i++)this.event=e,this._all[i].apply(this,n)}if(e==="error"&&!this._all&&!this._events.error&&(!this.wildcard||!this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var s;if(this.wildcard){s=[];var u=typeof e=="string"?e.split(this.delimiter):e.slice();o.call(this,s,u,this.listenerTree,0)}else s=this._events[e];if(typeof s=="function"){this.event=e;if(arguments.length===1)s.call(this);else if(arguments.length>1)switch(arguments.length){case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:var t=arguments.length,n=new Array(t-1);for(var i=1;i<t;i++)n[i-1]=arguments[i];s.apply(this,n)}return!0}if(s){var t=arguments.length,n=new Array(t-1);for(var i=1;i<t;i++)n[i-1]=arguments[i];var a=s.slice();for(var i=0,t=a.length;i<t;i++)this.event=e,a[i].apply(this,n);return a.length>0||!!this._all}return!!this._all},s.prototype.on=function(e,i){if(typeof e=="function")return this.onAny(e),this;if(typeof i!="function")throw new Error("on only accepts instances of Function");this._events||r.call(this),this.emit("newListener",e,i);if(this.wildcard)return u.call(this,e,i),this;if(!this._events[e])this._events[e]=i;else if(typeof this._events[e]=="function")this._events[e]=[this._events[e],i];else if(t(this._events[e])){this._events[e].push(i);if(!this._events[e].warned){var s=n;typeof this._events.maxListeners!="undefined"&&(s=this._events.maxListeners),s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}}return this},s.prototype.onAny=function(e){if(typeof e!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(e),this},s.prototype.addListener=s.prototype.on,s.prototype.off=function(e,n){if(typeof n!="function")throw new Error("removeListener only takes instances of Function");var r,i=[];if(this.wildcard){var s=typeof e=="string"?e.split(this.delimiter):e.slice();i=o.call(this,null,s,this.listenerTree,0)}else{if(!this._events[e])return this;r=this._events[e],i.push({_listeners:r})}for(var u=0;u<i.length;u++){var a=i[u];r=a._listeners;if(t(r)){var f=-1;for(var l=0,c=r.length;l<c;l++)if(r[l]===n||r[l].listener&&r[l].listener===n||r[l]._origin&&r[l]._origin===n){f=l;break}if(f<0)continue;return this.wildcard?a._listeners.splice(f,1):this._events[e].splice(f,1),r.length===0&&(this.wildcard?delete a._listeners:delete this._events[e]),this}if(r===n||r.listener&&r.listener===n||r._origin&&r._origin===n)this.wildcard?delete a._listeners:delete this._events[e]}return this},s.prototype.offAny=function(e){var t=0,n=0,r;if(e&&this._all&&this._all.length>0){r=this._all;for(t=0,n=r.length;t<n;t++)if(e===r[t])return r.splice(t,1),this}else this._all=[];return this},s.prototype.removeListener=s.prototype.off,s.prototype.removeAllListeners=function(e){if(arguments.length===0)return!this._events||r.call(this),this;if(this.wildcard){var t=typeof e=="string"?e.split(this.delimiter):e.slice(),n=o.call(this,null,t,this.listenerTree,0);for(var i=0;i<n.length;i++){var s=n[i];s._listeners=null}}else{if(!this._events[e])return this;this._events[e]=null}return this},s.prototype.listeners=function(e){if(this.wildcard){var n=[],i=typeof e=="string"?e.split(this.delimiter):e.slice();return o.call(this,n,i,this.listenerTree,0),n}return this._events||r.call(this),this._events[e]||(this._events[e]=[]),t(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},s.prototype.listenersAny=function(){return this._all?this._all:[]},typeof define=="function"&&define.amd?define("eventemitter",[],function(){return s}):typeof exports=="object"?exports.EventEmitter2=s:window.EventEmitter2=s}(),define("aura/ext/mediator",["eventemitter","underscore"],function(){"use strict";return{name:"mediator",require:{paths:{eventemitter:"bower_components/eventemitter2/lib/eventemitter2",underscore:"bower_components/underscore/underscore"},shim:{underscore:{exports:"_"}}},initialize:function(e){var t=require("eventemitter"),n=require("underscore");e.config.mediator=n.defaults(e.config.mediator||{},{wildcard:!0,delimiter:".",newListener:!0,maxListeners:20});var r=new t(e.config.mediator);e.core.mediator=r;var i=function(t){return function(i,s,o){if(this.stopped)return;if(!n.isFunction(s)||!n.isString(i))throw new Error("Invalid arguments passed to sandbox."+t);o=o||this;var u=function(){var t=Array.prototype.slice.call(arguments);try{s.apply(o,t)}catch(n){e.logger.error("Error caught in listener '"+i+"', called with arguments: ",t,"\nError:",n.message,n,t)}};this._events=this._events||[],this._events.push({name:i,listener:s,callback:u}),r[t](i,u)}};e.sandbox.on=i("on"),e.sandbox.once=i("once"),e.sandbox.off=function(e,t){if(!this._events)return;this._events=n.reject(this._events,function(t){var n=t.name===e;return n&&r.off(e,t.callback),n})},e.sandbox.emit=function(){if(this.stopped)return;var t=e.config.debug;if(t.enable&&(t.components.length===0||t.components.indexOf("aura:mediator")!==-1)){var n=Array.prototype.slice.call(arguments);n.unshift("Event emitted"),e.logger.log.apply(e.logger,n)}r.emit.apply(r,arguments)},e.sandbox.stopListening=function(){if(!this._events)return;n.each(this._events,function(e){r.off(e.name,e.callback)})};var s=["aura","sandbox","stop"].join(e.config.mediator.delimiter);e.core.mediator.on(s,function(e){e.stopListening()})}}}),define("aura/ext/components",[],function(){"use strict";return function(e){function o(t,n,r,i){var o=s[t+":"+n]||[],u=[];e.core.util.each(o,function(e,t){typeof t=="function"&&u.push(t.apply(r,i))});var a=e.core.data.when.apply(undefined,u).promise();return a}function u(t,r){var i;if(typeof t=="string")i=t,t=r[i]||function(){};else{if(typeof t.name!="string")throw new Error("Error invoking Component with callbacks: ",r.options.name,". first argument should be either the name of a function or of the form : { name: 'fnName', fn: function() { ... } } ");i=t.name,t=t.fn||function(){}}var s=e.core.data.deferred(),u,a,f=[].slice.call(arguments,2);return u=o("before",i,r,f),u.then(function(){return t.apply(r,f)}).then(function(e){return o("after",i,r,f.concat(e)).then(function(){n.data.when(e).then(function(){s.resolve(e)})},s.reject)}).fail(function(t){e.logger.error("Error in Component "+r.options.name+" "+i+" callback",t),s.reject(t)}),s.promise()}function a(e){var t=r.clone(e),i=n.data.deferred(),s=this;return this.options=r.defaults(t||{},this.options||{}),this._ref=t._ref,this.$el=n.dom.find(t.el),this.initialized=i.promise(),this.invokeWithCallbacks("initialize",this.options).then(function(){i.resolve(s)}),this}function l(e,t,i){var s=r.clone(i||{});s.el=e,s.require={};var o,u=n.dom.data(e);return n.util.each(u,function(e,n){e=e.replace(new RegExp("^"+t),""),e=e.charAt(0).toLowerCase()+e.slice(1),e!=="component"&&e!=="widget"?s[e]=n:o=n}),c(o,s)}function c(t,r){var i=t.split("@"),s=n.util.decamelize(i[0]),o=i[1]||"default",u=require.s.contexts._,a=e.config.sources[o]||"./aura_components";return r.name=s,r.ref="__component__$"+s+"@"+o,r.baseUrl=a+"/"+s,r.require=r.require||{},r.require.packages=r.require.packages||[],r.require.packages.push({name:r.ref,location:a+"/"+s}),r}var t=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n=e.core,r=e.core.util._;n.Components=n.Components||{};var i={},s={};a.prototype.initialize=function(){},a.prototype.html=function(e){var t=this.$el;t.html(e);var n=this;return r.defer(function(){n.sandbox.start(t,{reset:!0})}),this},a.prototype.$find=function(e){return this.$el.find(e)},a.prototype.invokeWithCallbacks=function(e){return u.apply(undefined,[e,this].concat([].slice.call(arguments,1)))};var f=function(e,r){var i=this,s;e&&t(e,"constructor")?s=e.constructor:s=function(){i.apply(this,arguments)},n.util.extend(s,i,r);var o=function(){this.constructor=s};return o.prototype=i.prototype,s.prototype=new o,e&&n.util.extend(s.prototype,e),s.__super__=i.prototype,s};return a.extend=f,a.load=function(t,s){var o=n.data.deferred(),u=s.ref,f,l,c=s.el;s._ref=n.util._.uniqueId(u+"+");var h=r.clone(s);return e.logger.log("Start loading component:",t),o.fail(function(n){e.logger.error("Error loading component:",t,n)}),require.config(h.require),require([u],function(r){if(!r)return o.reject("component "+u+" Definition is empty !");try{if(i[u])l=i[u];else{r.type?l=n.Components[r.type]:l=a;if(!l)throw new Error("Can't find component of type '"+r.type+"', did you forget to include the extension that provides it ?");n.util._.isObject(r)&&(l=i[u]=l.extend(r))}var f=e.sandboxes.create(s._ref,{el:c});f.logger.setName("Component '"+t+"'("+f.logger.name+")");var p={sandbox:f};typeof r=="function"&&(p.initialize=r),l=l.extend(p);var d=new l(h);d.$el.data("__sandbox_ref__",f.ref);var v=d.initialized;return v.then(function(e){o.resolve(e)}),v.fail(function(e){o.reject(e)}),v}catch(m){e.logger.error(m.message),o.reject(m)}},function(e){o.reject(e)}),o.promise()},a.parseList=function(t){var i=[];if(Array.isArray(t))r.map(t,function(e){var t=c(e.name,e.options);i.push({name:e.name,options:t})});else if(t&&n.dom.find(t)){var s=e.config.namespace,o=["[data-aura-component]","[data-aura-widget]"];s&&(o.push("[data-"+s+"-component]"),o.push("[data-"+s+"-widget]")),o=o.join(","),n.dom.find(o,t||"body").each(function(){var e="aura";s&&(this.getAttribute("data-"+s+"-component")||this.getAttribute("data-"+s+"-widget"))&&(e=s);var t=l(this,e);i.push({name:t.name,options:t})})}return i},a.startAll=function(e){var t=a.parseList(e),r=[];n.util.each(t,function(e,t){var n=a.load(t.name,t.options);r.push(n)});var i=n.data.when.apply(undefined,r);return i.promise()},{name:"components",require:{paths:{text:"bower_components/requirejs-text/text"}},initialize:function(e){function t(e,t){s[e]=s[e]||[],s[e].push(t)}e.core.Components.Base=a,e.components.before=function(e,n){var r="before:"+e;t(r,n)},e.components.after=function(e,n){var r="after:"+e;t(r,n)},e.components.addType=function(t,n){if(e.core.Components[t])throw new Error("Component type "+t+" already defined");e.core.Components[t]=a.extend(n)},e.sandbox.start=function(t,n){if(this.stopped)return;var i=["aura","sandbox","start"].join(e.config.mediator.delimiter);e.core.mediator.emit(i,this);var s=this._children||[];n&&n.reset&&(r.invoke(this._children||[],"stop"),s=[]);var o=this;return a.startAll(t).done(function(){var e=Array.prototype.slice.call(arguments);r.each(e,function(e){e.sandbox._component=e,e.sandbox._parent=o,s.push(e.sandbox)}),o._children=s})}},afterAppStart:function(e){if(e.config.components!==!1&&e.startOptions.components!==!1){var t;Array.isArray(e.startOptions.components)?t=n.dom.find("body"):t=n.dom.find(e.startOptions.components),e.core.appSandbox=e.sandboxes.create(e.ref,{el:t}),e.core.appSandbox.start(e.startOptions.components)}}}}}),define("form/util",[],function(){"use strict";var e=["form","validation"];return{debugEnabled:!1,getFields:function(e){return $(e).find('input:not([data-form="false"], [type="submit"], [type="button"], [type="checkbox"], [type="radio"]), textarea:not([data-form="false"]), select:not([data-form="false"]), *[data-form="true"], *[data-type="collection"], *[contenteditable="true"]')},findGroupedFieldsBySelector:function(e,t){var n={},r;return $(e).find(t).each(function(e,t){r=$(t).data("mapper-property"),n[r]||(n[r]=[]),n[r].push(t)}),n},getCheckboxes:function(e){return this.findGroupedFieldsBySelector(e,'input[type="checkbox"]')},getRadios:function(e){return this.findGroupedFieldsBySelector(e,'input[type="radio"]')},parseData:function(e,t,n){var r=$(e);return this.buildOptions(r.data(),t,"",n)},buildOptions:function(t,n,r,i){r||(r=""),i||(i={});var s=$.extend({},i,{}),o=n+this.ucFirst(r);return $.each(t,function(t,r){var i=new RegExp("^"+o);i.test(t)&&$.inArray(t,e)===-1&&(t!==o?t=t.replace(i,""):t=t.replace(new RegExp("^"+n),""),t!==""&&(t=this.lcFirst(t),s[t]=r))}.bind(this)),s},isValueField:function(e){var t=$(e);return t.is("input, select, textarea, option, button")},isCheckbox:function(e){var t=$(e);return t.is(":checkbox")},getValue:function(e){var t=$(e);return this.isCheckbox(t)?t.prop("checked"):this.isValueField(t)?t.val():t.html()},setValue:function(e,t){var n=$(e);this.isCheckbox(n)?n.prop("checked",t):this.isValueField(n)?n.val(t):n.html(t)},debug:function(e,t,n){!this.debugEnabled||(e?t?n?console.log("Husky Validation:",e,t,n):console.log("Husky Validation:",e,t):console.log("Husky Validation:",e):console.log("Husky Validation"))},ucFirst:function(e){e+="";var t=e.charAt(0).toUpperCase();return t+e.substr(1)},lcFirst:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},startsWith:function(e,t){return e.indexOf(t)===0},print:function(e,t){t||(t=1);var n="",r="&nbsp;&nbsp;&nbsp;&nbsp;",i,s,o="",u=0;while(u<t)o+=r,u++;for(i in e)e.hasOwnProperty(i)&&(s=e[i],typeof s=="string"?this.isNumeric(s)?n+=o+i+": "+s+"; </br>":(s.length>7&&(s=s.substring(0,6)+" ..."),n+=o+i+": '"+s+"'; </br>"):n+=o+i+": { </br>"+o+r+print(s,t++)+"}");return n},isNumeric:function(e){return e.match(/-?\d+(.\d+)?/)}}}),define("form/element",["form/util"],function(e){"use strict";return function(t,n,r){var i={type:null,validationTrigger:"focusout",validationAddClasses:!0,validationAddClassesParent:!0,validationErrorClass:"husky-validate-error",validationClass:"husky-validate",validation:!0},s=["validation","validationTrigger","validationAddClasses","validationAddClassesParent","validationClass","validationErrorClass","validationSubmitEvent"],o,u={},a,f=null,l=null,c={initialize:function(){l=$.Deferred(),this.requireCounter=0,this.initialized=l.promise(),this.$el=$(t),this.$el.data("element",this),this.options=$.extend({},i,r),!this.options.validationAddClasses||this.$el.addClass(this.options.validationClass),!this.options.validation||c.initValidation.call(this)},resolveInitialization:function(){this.requireCounter--,this.requireCounter===0&&l.resolve()},initValidation:function(){c.bindValidationDomEvents.call(this),c.initValidators.call(this),c.initType.call(this)},bindValidationDomEvents:function(){var e=this.options.validationTrigger?this.options.validationTrigger:"";if(e===""||e==="none")return;this.$el.is("select")&&(e+=(new RegExp("change","i")).test(e)?"":" change"),e=e.replace(/^\s+/g,"").replace(/\s+$/g,""),this.$el.bind(e,this.validate.bind(this))},initValidators:function(){var t=function(t,r){this.requireCounter++,require(["validator/"+t],function(i){u[t]=new i(this.$el,n,this,r),e.debug("Element Validator",t,r),c.resolveInitialization.call(this)}.bind(this))}.bind(this);$.each(this.options,function(n,r){if(!!r&&$.inArray(n,s)===-1&&e.startsWith(n,"validation")){var i=e.lcFirst(n.replace("validation","")),o=e.buildOptions(this.options,"validation",i);t(i,o)}}.bind(this)),this.$el.attr("required")==="required"&&!u.required&&t("required",{required:!0}),!!this.$el.attr("min")&&!u.min&&t("min",{min:parseInt(this.$el.attr("min"),10)}),!!this.$el.attr("max")&&!u.max&&t("max",{max:parseInt(this.$el.attr("max"),10)}),!!this.$el.attr("pattern")&&!u.pattern&&t("regex",{regex:this.$el.attr("pattern")})},initType:function(){var t=function(t,r){this.requireCounter++,require(["type/"+t],function(i){a=new i(this.$el,r,n),a.initialized.then(function(){e.debug("Element Type",t,r),c.resolveInitialization.call(this)}.bind(this))}.bind(this))}.bind(this),r=e.buildOptions(this.options,"type"),i,s;this.options.type?i=this.options.type:this.$el.attr("type")?(s=this.$el.attr("type"),s==="email"?i="email":s==="url"?i="url":s==="number"?i="decimal":s==="date"?(i="date",!r.format||(r.format="d")):s==="time"?(i="date",!r.format||(r.format="t")):s==="datetime"?i="date":i="string"):i="string",t(i,r)},hasConstraints:function(){var e=!!a&&a.needsValidation(),t=Object.keys(u).length>0;return t||e},needsValidation:function(){return f!==e.getValue(this.$el)},reset:function(){var e=this.$el;!this.options.validationAddClassesParent||(e=e.parent()),e.removeClass(this.options.validationErrorClass)},setValid:function(e){o=e;if(!!this.options.validationAddClasses){c.reset.call(this);var t=this.$el;!this.options.validationAddClassesParent||(t=t.parent()),e||t.addClass(this.options.validationErrorClass)}}},h={validate:function(t){var n=!0,r=!1;return(t||c.needsValidation.call(this))&&c.hasConstraints.call(this)&&($.each(u,function(e,t){t.validate()||(n=!1)}),r=!0),!!a&&a.needsValidation()&&(a.validate()||(n=!1),r=!0),r===!0&&(n||e.debug("Field validate",n?"true":"false",this.$el),c.setValid.call(this,n)),n},update:function(){if(!c.hasConstraints.call(this))return!0;var t=!0;return $.each(u,function(e,n){n.update()||(t=!1)}),a!==null&&!a.validate()&&(t=!1),t||e.debug("Field validate",t?"true":"false",this.$el),c.setValid.call(this,t),t},isValid:function(){return o},updateConstraint:function(e,t){if(!($.inArray(e,Object.keys(u))>-1))throw"No constraint with name: "+e;u[e].updateConstraint(t),this.validate()},deleteConstraint:function(e){if(!($.inArray(e,Object.keys(u))>-1))throw"No constraint with name: "+e;delete u[e],this.validate(!0)},addConstraint:function(e,t){if($.inArray(e,Object.keys(u))!==-1)throw"Constraint with name: "+e+" already exists";require(["validator/"+e],function(r){u[e]=new r(this.$el,n,this,t)}.bind(this))},hasConstraint:function(e){return!!u[e]},getConstraint:function(e){return this.hasConstraint(e)?u[e]:!1},fieldAdded:function(e){$.each(u,function(t,n){n.fieldAdded(e)})},fieldRemoved:function(e){$.each(u,function(t,n){n.fieldRemoved(e)})},setValue:function(e){var t=$.Deferred(),n;return this.initialized.then(function(){n=a.setValue(e),n?n.then(function(){t.resolve()}):t.resolve()}.bind(this)),t.promise()},getValue:function(e){return a.getValue(e)},getType:function(){return a}};return c.initialize.call(h),h}}),define("form/elementGroup",[],function(){"use strict";var e=function(e,t){e.forEach(function(e){t.forEach(function(t){e.$el.val()===t&&e.$el.prop("checked",!0)})})},t=function(e,t){for(var n=-1;++n<e.length;)if(e[n].$el.val()===t){e[n].$el.prop("checked",!0);return}};return function(n,r){var i={getValue:function(){var e=[];n.forEach(function(t){t.$el.is(":checked")&&e.push(t.$el.val())});if(!!r){if(e.length>1)throw new Error("Single value element group cannot return more than one value");return e[0]}return e},setValue:function(i){if(!!r&&!!$.isArray(i))throw new Error("Single value element cannot be set to an array value");if(!r&&!$.isArray(i))throw new Error("Field with multiple values cannot be set to a single value");$.isArray(i)?e.call(this,n,i):t.call(this,n,i)}};return n.forEach(function(e){e.$el.data("elementGroup",i)}),i}}),define("form/validation",["form/util"],function(e){"use strict";return function(t){var n,r={initialize:function(){r.bindValidationDomEvents.call(this),e.debug("INIT Validation")},bindValidationDomEvents:function(){!t.options.validationSubmitEvent||t.$el.on("submit",function(){return t.validation.validate()}.bind(this))},setValid:function(e){n=e}},i={validate:function(n){var i=!0;return $.each(t.elements,function(e,t){t.validate(n)||(i=!1)}),$.each(t.mapper.collections,function(e,t){$.each(t.items,function(e,t){$.each(t.data("collection").childElements,function(e,t){t.validate(n)||(i=!1)})})}),r.setValid.call(this,i),e.debug("Validation",i?"success":"error"),i},isValid:function(){return n},updateConstraint:function(e,t,n){var r=$(e);if(!r.data("element"))throw"No validation element";$(e).data("element").updateConstraint(t,n)},deleteConstraint:function(e,t){var n=$(e);if(!n.data("element"))throw"No validation element";n.data("element").deleteConstraint(t)},addConstraint:function(e,n,r){var i=$(e),s;i.data("element")?i.data("element").addConstraint(n,r):(s=t.addField(e),s.addConstraint(n,r),t.elements.push(s))}};return r.initialize.call(i),i}}),define("form/mapper",["form/util"],function(e){"use strict";return function(t){var n={},r={initialize:function(){e.debug("INIT Mapper"),this.collections=[],this.collectionsSet={},this.emptyTemplates={},this.templates={},t.initialized.then(function(){var e='*[data-type="collection"]',n=t.$el.find(e);n.each(r.initCollection.bind(this))}.bind(this))},initCollection:function(n,i){var s=$(i),o=s.data("element"),u=s.data("mapper-property"),a,f,l,c=$.Deferred(),h=0,p=function(){h--,h===0&&c.resolve()};if(!$.isArray(u)){if(typeof u!="object")throw"no valid mapper-property value";u=[u],s.data("mapper-property",u)}return o.$children=s.children().clone(!0),s.html(""),f={id:_.uniqueId("collection_"),property:u,$element:s,element:o,items:[]},this.collections.push(f),h+=o.$children.length,o.$children.each(function(e,t){var n=$(t),i,s,c,h=0,d=function(){h--,h===0&&p()};if(!n.is("script"))throw"template has to be defined as <script>";a={tpl:n.html(),id:n.attr("id"),collection:f},o.$children[e]=a;for(s=-1,c=u.length;++s<c;)u[s].tpl===a.id&&(i=u[s].data,l=u[s]["empty-tpl"]),u[s]["empty-tpl"]&&u[s]["empty-tpl"]===a.id&&(this.emptyTemplates[u[s].data]={id:u[s]["empty-tpl"],tpl:n.html()});if(!i)d();else{a.propertyName=i,h=f.element.getType().getMinOccurs(),this.templates[i]={tpl:a,collection:f,emptyTemplate:l};for(s=f.element.getType().getMinOccurs()+1;--s>0;)r.appendChildren.call(this,f,a).then(function(){$("#current-counter-"+i).text(f.element.getType().getChildren(a.id).length),d()}.bind(this))}}.bind(this)),$.each(u,function(e,n){t.$el.on("click",'*[data-mapper-add="'+n.data+'"]',r.addClick.bind(this)),t.$el.on("click",'*[data-mapper-remove="'+n.data+'"]',r.removeClick.bind(this)),c.then(function(){r.emitInitCollectionEvent(n.data)})}.bind(this)),r.checkFullAndEmpty.call(this,u[0].data),c.then(function(){e.debug("collection resolved")}),c.promise()},addClick:function(e){var t=$(e.currentTarget),n=t.data("mapper-add"),i=this.templates[n].tpl,s=this.templates[n].collection;s.element.getType().canAdd(i.id)&&r.appendChildren.call(this,s,i).then(function(){$("#current-counter-"+n).text(s.element.getType().getChildren(i.id).length),r.emitAddEvent(n,null)}.bind(this)),r.checkFullAndEmpty.call(this,n)},addEmptyTemplate:function(e,t){if(this.emptyTemplates.hasOwnProperty(t)){var n=$(this.emptyTemplates[t].tpl);n.attr("id",this.emptyTemplates[t].id),e.append(n)}},removeClick:function(e){var t=$(e.currentTarget),n=t.data("mapper-remove"),i=this.templates[n].tpl,s=this.templates[n].collection,o=t.closest("."+n+"-element");s.element.getType().canRemove(i.id)&&(r.remove.call(this,o),$("#current-counter-"+n).text(s.element.getType().getChildren(i.id).length),r.emitRemoveEvent(n,null)),r.checkFullAndEmpty.call(this,n)},checkFullAndEmpty:function(e){var t=$("[data-mapper-add='"+e+"']"),n=$("[data-mapper-remove='"+e+"']"),r=this.templates[e].tpl,i=this.templates[e].collection,s=i.element.$el.data("mapper-full-class")||"full",o=i.element.$el.data("mapper-empty-class")||"empty";t.removeClass(s),t.removeClass(o),$(i.element.$el).removeClass(s),$(i.element.$el).removeClass(o);if(!!t.length||!!n.length)i.element.getType().canAdd(r.id)?i.element.getType().canRemove(r.id)||(t.addClass(o),$(i.element.$el).addClass(o)):(t.addClass(s),$(i.element.$el).addClass(s))},emitInitCollectionEvent:function(e){$(t.$el).trigger("form-collection-init",[e])},emitAddEvent:function(e,n){$(t.$el).trigger("form-add",[e,n])},emitRemoveEvent:function(e,n){$(t.$el).trigger("form-remove",[e,n])},processData:function(e,t,i){var s=$(e),o=s.data("type"),u=s.data("mapper-property"),a=s.data("element"),f,l;return t&&!!n[t.data]?l=n[t.data]:!n[u]||(l=n[u]),o!=="collection"?a?a.getValue():null:(f=[],$.each(s.children(),function(e,n){if(!t||t.tpl===n.dataset.mapperPropertyTpl){var s=$(n).data("collection").childElements,o=$(n).data("collection").childElementGroups,u={};s.forEach(function(e){r.addDataFromElement.call(this,e,u,i)});for(e in o)o.hasOwnProperty(e)&&(u[e]=o[e].getValue());!i||(u.mapperId=n.dataset.mapperId);var a=Object.keys(u);a.length===1?u[a[0]]!==""&&f.push(u[a[0]]):(!l||l(u))&&f.push(u)}}.bind(this)),f)},setCollectionData:function(e,t){var n=t.$element,i=this.templates[t.key].tpl,s=e.length,o=$.Deferred(),u=function(){s--,s===0&&o.resolve()},a,f;if(s===0)r.addEmptyTemplate.call(this,n,i.propertyName),o.resolve();else{if(e.length<t.element.getType().getMinOccurs())for(a=t.element.getType().getMinOccurs()+1,f=e.length;--a>f;)e.push({});t.items=[],$.each(e,function(e,n){r.appendChildren.call(this,t,i,n).then(function(e){r.setData.call(this,n,e).then(function(){u()}.bind(this))}.bind(this))}.bind(this))}return $("#current-counter-"+n.attr("id")).text(e.length),r.checkFullAndEmpty.call(this,t.property[0].data),o.promise()},appendChildren:function(n,i,s,o,u){var a=$.extend(!0,{},i),f=a.collection.element.getType().getChildren(a.id).length,l=$.extend({},{index:f},s||{}),c=_.template(a.tpl,l,t.options.delimiter),h=$(c),p=e.getFields(h),d=e.getRadios(h),v=e.getCheckboxes(h),m=$.Deferred(),g=p.length,y=n.$element,b,w;return h.attr("data-mapper-property-tpl",a.id),h.attr("data-mapper-id",_.uniqueId()),u&&(b=y.find('*[data-mapper-property-tpl="'+a.id+'"]').last()).length>0?b.after(h):y.append(h),a.collection.childElements=[],a.collection.childElementGroups={},p.length>0?p.each(function(e,n){w=t.createField($(n)),a.collection.childElements.push(w),w.initialized.then(function(){g--,g===0&&m.resolve(h)})}.bind(this)):m.resolve(h),_.size(d)>0&&$.each(d,function(e,n){a.collection.childElementGroups[e]=t.createFieldGroup(n,!0)}),_.size(v)>0&&$.each(v,function(e,n){a.collection.childElementGroups[e]=t.createFieldGroup(n,!1)}),h.data("collection",a.collection),!o||m.then(function(){r.setData.call(this,o,p)}.bind(this)),n.items.push(h),m.promise()},getElementByMapperId:function(e){for(var t=-1,n=this.collections.length;++t<n;)for(var r=-1,i=this.collections[t].items.length;++r<i;)if(this.collections[t].items[r].data("mapper-id")===e)return this.collections[t].items[r];return null},deleteElementByMapperId:function(e){var t;return $.each(this.collections,function(n,r){$.each(r.items,function(n,i){return i.data("mapper-id").toString()!==e.toString()?!0:(t=i.attr("data-mapper-property-tpl"),i.remove(),r.items.splice(n,1),!1)})}.bind(this)),t},remove:function(n){$.each(e.getFields(n),function(e,n){t.removeField(n)}.bind(this)),n.remove()},setData:function(e,n){n||(n=t.$el);var i=$.Deferred(),s,o,u,a=1,f=function(){a--,a===0&&i.resolve()};return typeof e!="object"?(s="*[data-mapper-property]",o=n.find(s),u=o.data("element"),u?u.setValue(e).then(function(){f()}):(u=t.addField(o),u.initialized.then(function(){u.setValue(e).then(function(){f()})}.bind(this)))):e!==null&&!$.isEmptyObject(e)?(a=Object.keys(e).length,$.each(e,function(e,i){var o,u,a;$.isArray(i)&&this.templates.hasOwnProperty(e)?(a=this.templates[e].collection,a.key=e,this.collectionsSet.hasOwnProperty(a.id)||a.$element.children().each(function(e,t){$(t).remove()}.bind(this)),this.collectionsSet[a.id]=!0,r.setCollectionData.call(this,i,a).then(function(){f()})):t.elementGroups.hasOwnProperty(e)?(t.elementGroups[e].setValue(i),f()):(s='*[data-mapper-property="'+e+'"]',o=n.andSelf().find(s),u=o.data("element"),o.length>0?u?u.setValue(i).then(function(){f()}):(u=t.addField(o),u.initialized.then(function(){u.setValue(i).then(function(){f()})}.bind(this))):f())}.bind(this))):i.resolve(),i.promise()},addDataFromElement:function(e,t,n){var i=e.$el,s=i.data("mapper-property"),o;if(!s)return;$.isArray(s)?$.each(s,function(e,s){t[s.data]=r.processData.call(this,i,s,n)}.bind(this)):s.match(/.*\..*/)?(o=s.split("."),t[o[0]]={},t[o[0]][o[1]]=r.processData.call(this,i)):t[s]=r.processData.call(this,i)},getDataFromElements:function(e,t,n){var i={};e.forEach(function(e){r.addDataFromElement.call(this,e,i,n)}.bind(this));for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s].getValue());return i}},i={setData:function(e,t){return this.collectionsSet={},r.setData.call(this,e,t)},getData:function(e,n){if(!e||!e.data("mapper-id"))return r.getDataFromElements(t.elements,t.elementGroups,n);var i=r.getElementByMapperId.call(this,e.data("mapper-id")).data("collection");return r.getDataFromElements(i.childElements,i.childElementGroups,n)},addCollectionFilter:function(e,t){n[e]=t},removeCollectionFilter:function(e){delete n[e]},addToCollection:function(e,t,n){var i=this.templates[e],s=i.collection.$element,o=!1,u,a,f=$.Deferred();return n||(o=!0),i.emptyTemplate&&(a=$(s).find("#"+i.emptyTemplate),a&&a.remove()),r.appendChildren.call(this,i.collection,i.tpl,t,t,o).then(function(e){f.resolve(e)}.bind(this)),f},editInCollection:function(e,t){var n=r.getElementByMapperId.call(this,e);r.setData.call(this,t,n)},removeFromCollection:function(e){var n,i=r.deleteElementByMapperId.call(this,e);if(t.$el.find("*[data-mapper-property-tpl="+i+"]").length<1)for(n in this.templates)if(this.templates[n].tpl.id===i){r.addEmptyTemplate.call(this,this.templates[n].collection.$element,n);return}}};return r.initialize.call(i),i}}),require.config({paths:{form:"js/form","form/mapper":"js/mapper","form/validation":"js/validation","form/element":"js/element","form/elementGroup":"js/elementGroup","form/util":"js/util","type/default":"js/types/default","type/readonly-select":"js/types/readonlySelect","type/string":"js/types/string","type/date":"js/types/date","type/decimal":"js/types/decimal","type/hiddenData":"js/types/hiddenData","type/mappingData":"js/types/mappingData","type/email":"js/types/email","type/url":"js/types/url","type/label":"js/types/label","type/select":"js/types/select","type/collection":"js/types/collection","type/attributes":"js/types/attributes","validator/default":"js/validators/default","validator/min":"js/validators/min","validator/max":"js/validators/max","validator/minLength":"js/validators/min-length","validator/maxLength":"js/validators/max-length","validator/required":"js/validators/required","validator/unique":"js/validators/unique","validator/equal":"js/validators/equal","validator/regex":"js/validators/regex"}}),define("form",["form/element","form/elementGroup","form/validation","form/mapper","form/util"],function(e,t,n,r,i){"use strict";return function(s,o){var u={debug:!1,delimiter:{interpolate:/<~=(.+?)~>/g,escape:/<~-(.+?)~>/g,evaluate:/<~(.+?)~>/g},validation:!0,validationTrigger:"focusout",validationAddClassesParent:!0,validationAddClasses:!0,validationSubmitEvent:!0,mapper:!0},a={initialize:function(){this.$el=$(s),this.options=$.extend(u,this.$el.data(),o),i.debugEnabled=this.options.debug,this.initialized=a.initFields.call(this),!this.options.validation||(this.validation=new n(this)),!this.options.mapper||(this.mapper=new r(this)),this.$el.data("form-object",this)},initFields:function(e){var t=$.Deferred(),n=0,r=function(){n--,n===0&&t.resolve()};return $.each(i.getFields(e||this.$el),function(e,t){n++,a.addField.call(this,t).initialized.then(r.bind(this))}.bind(this)),a.addGroupedFields.call(this,e),t.promise()},bindValidationDomEvents:function(){!this.options.validationSubmitEvent||this.$el.on("submit",function(){return this.validation.validate()}.bind(this))},createField:function(t){var n=$(t),r=i.parseData(n,"",this.options);return new e(n,f,r)},createFieldGroup:function(n,r){return new t(n.map(function(t){var n=$(t),r=i.parseData(n,"",this.options);return new e(n,f,r)}.bind(this)),r)},addField:function(e){var t=this.createField(e);return this.elements.push(t),i.debug("Element created",o),t},addSingleGroupedField:function(e,t,n){this.elementGroups[e]=this.createFieldGroup(t,n)},addGroupedFields:function(e){$.each(i.getCheckboxes(e||this.$el),function(e,t){t.length>1?a.addSingleGroupedField.call(this,e,t,!1):a.addField.call(this,t)}.bind(this)),$.each(i.getRadios(e||this.$el),function(e,t){a.addSingleGroupedField.call(this,e,t,!0)}.bind(this))}},f={elements:[],elementGroups:{},options:{},validation:!1,mapper:!1,createField:function(e){var t=a.createField(e);return t.initialized.then(function(){t.fieldAdded(t)}.bind(this)),t},createFieldGroup:function(e,t){return a.createFieldGroup(e,t)},addField:function(e){var t=a.addField.call(this,e);return t.initialized.then(function(){$.each(this.elements,function(e,t){t.fieldAdded(t)})}.bind(this)),t},addGroupedFields:function(e){return a.addGroupedFields.call(this,e)},initFields:function(e){return a.initFields.call(this,e)},removeFields:function(e){i.getFields(e).each(function(e,t){this.removeField(t)}.bind(this))},removeField:function(e){var t=$(e),n=t.data("element");$.each(this.elements,function(e,t){t.fieldRemoved(n)}),this.elements.splice(this.elements.indexOf(n),1)}};return a.initialize.call(f),f}}),define("type/default",["form/util"],function(e){"use strict";return function(t,n,r,i,s,o){var u={initialize:function(){this.$el=t,this.options=$.extend({},n,r);var e=$.Deferred();this.requireCounter=0,this.initialized=e.promise(),!this.initializeSub||this.initializeSub(),e.resolve()}},a={name:i,form:o,needsValidation:function(){return!0},updateConstraint:function(e){$.extend(this.options,e)},setValue:function(t){e.setValue(this.$el,this.getViewData.call(this,t))},getValue:function(){return this.getModelData.call(this,e.getValue(this.$el))},getViewData:function(e){return e},getModelData:function(e){return e}},f=$.extend({},a,s);return u.initialize.call(f),f}}),define("type/string",["type/default"],function(e){"use strict";return function(t,n){var r={},i={needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"string",i)}}),define("type/date",["type/default","form/util"],function(e,t){"use strict";return function(n,r){var i={format:"d"},s=function(e){return t.debug(e,new Date(e)),new Date(e)},o={validate:function(){var e=t.getValue(this.$el),n;return e===""?!0:(n=Globalize.parseDate(e,this.options.format),n!==null)},needsValidation:function(){var e=t.getValue(this.$el);return e!==""},getViewData:function(e){return Globalize.format(s(e),this.options.format)},getModelData:function(e){if(e!==""){var t=Globalize.parseDate(e,this.options.format);return t.toISOString()}return e}};return new e(n,i,r,"date",o)}}),define("type/decimal",["type/default"],function(e){"use strict";return function(t,n){var r={format:"n",regExp:/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/,nullable:!1},i={initializeSub:function(){},validate:function(){var e=this.getValue();return e===""||this.options.nullable===!0&&e===null?!0:this.options.regExp.test(e)},getModelData:function(e){return e===""?this.options.nullable===!0?null:"":Globalize.parseFloat(e)},getViewData:function(e){if(typeof e=="string"){if(e==="")return"";e=parseFloat(e)}return Globalize.format(e,this.options.format)}};return new e(t,r,n,"decimal",i)}}),define("type/hiddenData",["type/default"],function(e){"use strict";return function(t,n){var r={id:"id",defaultValue:null},i={hiddenData:null,setValue:function(e){this.hiddenData=e,!!e&&typeof e=="object"&&!!e[this.options.id]&&this.$el.data("id",e[this.options.id])},getValue:function(){return this.hiddenData!==null?this.hiddenData:this.options.defaultValue},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"hiddenData",i)}}),define("type/mappingData",["type/default"],function(e){"use strict";return function(t,n){var r={defaultValue:null,mapping:null,searchProperty:"id",showProperty:"name"},i={setValue:function(e){e!==null&&typeof e!="object"&&(this.$el.data("value",e),this.$el.text(this.getMappingValue(e)||this.options.defaultValue))},getValue:function(){var e=this.$el.data("value");return e!==null?e:this.options.defaultValue},needsValidation:function(){return!1},validate:function(){return!0},getMappingValue:function(e){var t,n=this.options.mapping;if(!!n)for(t in this.options.mapping)if(!!n.hasOwnProperty(t)&&n[t].hasOwnProperty(this.options.searchProperty)&&n[t].hasOwnProperty(this.options.showProperty)&&String(n[t][this.options.searchProperty])===String(e))return n[t][this.options.showProperty]}};return new e(t,r,n,"hiddenData",i)}}),define("type/email",["type/default","form/util"],function(e,t){"use strict";return function(t,n){var r={regExp:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))){2,6}$/i},i={validate:function(){var e=this.getValue();return e===""?!0:this.options.regExp.test(e)},needsValidation:function(){var e=this.getValue();return e!==""}};return new e(t,r,n,"email",i)}}),define("type/url",["type/default","form/util"],function(e,t){"use strict";return function(t,n){var r={regExp:/^(https?|s?ftp|git):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i},i={validate:function(){var e=this.getValue();return e===""?!0:(this.options["url-strict"]!=="true"&&(e=(new RegExp("(https?|s?ftp|git)","i")).test(e)?e:"http://"+e),this.options.regExp.test(e))},needsValidation:function(){var e=this.getValue();return e!==""}};return new e(t,r,n,"email",i)}}),define("type/label",["type/default"],function(e){"use strict";return function(t,n){var r={id:"id",label:"name",translate:!0},i={setValue:function(e){if(!!e[this.options.label]){var t=e[this.options.label],n=e[this.options.label];!this.options.translate||(n=Globalize.localize(t,Globalize.culture().name),n===undefined&&(n=t)),this.$el.text(n)}!e[this.options.id]||this.$el.data(this.options.id,e[this.options.id])},getValue:function(){var e={};return e[this.options.id]=this.$el.data(this.options.id),e[this.options.label]=this.$el.text(),e},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"label",i)}}),define("type/select",["type/default","form/util"],function(e,t){"use strict";return function(n,r){var i={id:"id",label:"name",type:"object"},s={setValue:function(e){typeof e=="object"?this.$el.val(e[this.options.id]):(this.$el.find("option[id="+e+"]").attr("selected","selected"),this.options.type="string")},getValue:function(){if(this.options.type==="object"){var e={};return e[this.options.id]=t.getValue(this.$el),e[this.options.label]=this.$el.find("option:selected").text(),e}return this.$el.children(":selected").attr("id")},needsValidation:function(){return!1},validate:function(){return!0}};return new e(n,i,r,"select",s)}}),define("type/readonly-select",["type/default"],function(e){"use strict";return function(t,n){var r={id:null,data:[],idProperty:"id",outputProperty:"name"},i={setValue:function(e){var t=this.options.data,n=this.options.idProperty,r,i;if(typeof e=="object"){if(!e.hasOwnProperty(n))throw"value has no property named "+n;e=e[n]}else if(e===null)return;this.$el.data("id",e);if(t.length>0)for(r=-1,i=t.length;++r<i;)if(t[r].hasOwnProperty(n)&&t[r][n].toString()===e.toString()){this.$el.html(t[r][this.options.outputProperty]);break}},getValue:function(){var e=this.$el.data("id"),t,n;for(t=-1,n=this.options.data.length;++t<n;)if(this.options.data[t][this.options.idProperty].toString()===e.toString())return this.options.data[t];return null},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"readonly-select",i)}}),define("type/collection",["type/default"],function(e){"use strict";return function(t,n){var r={min:0,max:null},i={validate:function(){return!0},needsValidation:function(){return!1},getChildren:function(e){return this.$el.find('*[data-mapper-property-tpl="'+e+'"]')},getMinOccurs:function(){return this.options.min},getMaxOccurs:function(){return this.options.max},canAdd:function(e){var t=this.getChildren(e).length;return this.getMaxOccurs()===null||t<this.getMaxOccurs()},canRemove:function(e){var t=this.getChildren(e).length;return t>this.getMinOccurs()}};return new e(t,r,n,"collection",i)}}),define("type/attributes",["type/default"],function(e){"use strict";return function(t,n){var r={},i={setValue:function(e){this.$el.data("attributes",e)},getValue:function(){return this.$el.data("attributes")},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"attributes",i)}}),define("validator/default",[],function(){"use strict";return function(e,t,n,r,i){return{name:i,initialize:function(){this.$el=e,this.data=$.extend(n,this.$el.data(),r),this.updateData(),!this.initializeSub||this.initializeSub()},validate:function(){},update:function(){return this.validate()},updateConstraint:function(e){$.extend(this.data,e),this.updateData()},updateData:function(){$.each(this.data,function(e,t){this.$el.data(e,t)}.bind(this))},fieldRemoved:function(){},fieldAdded:function(){}}}}),define("validator/min",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={min:0},o=$.extend(new e(t,n,s,i,"min"),{validate:function(){var e=this.data.element.getValue();return Number(e)>=this.data.min}});return o.initialize(),o}}),define("validator/max",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={max:999},o=$.extend(new e(t,n,s,i,"max"),{validate:function(){var e=this.data.element.getValue();return Number(e)<=this.data.max}});return o.initialize(),o}}),define("validator/minLength",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={minLength:0},o=$.extend(new e(t,n,s,i,"min-length"),{validate:function(){var e=this.data.element.getValue();return e.length>=this.data.minLength}});return o.initialize(),o}}),define("validator/maxLength",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={maxLength:999},o=$.extend(new e(t,n,s,i,"max-length"),{validate:function(){var e=this.data.element.getValue();return e.length<=this.data.maxLength}});return o.initialize(),o}}),define("validator/required",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={},o=$.extend(new e(t,n,s,i,"required"),{validate:function(){if(!this.data.required)return!0;var e=this.data.element.getValue();return typeof e=="number"?!0:(!_.isString(e)||(e=e.trim()),e?_.size(e)>0:!1)}});return o.initialize(),o}}),define("validator/unique",["validator/default","form/util"],function(e,t){"use strict";return function(n,r,i,s){var o={validationUnique:null},u=[],a=function(e,t){return u.indexOf(e)&&!!e.options.validationUnique&&e.options.validationUnique===t},f=function(e){var t=!0;return $.each(u,function(n,r){return l(e,r)?!0:(t=!1,!1)}),t},l=function(e,t){return e!==t.getValue()},c=function(){$.each(u,function(e,t){t.update()})},h=$.extend({},new e(n,r,o,s,"unique"),{initializeSub:function(){i.initialized.then(function(){$.each(r.elements,function(e,t){this.fieldAdded(t)}.bind(this))}.bind(this))},validate:function(){var e=this.data.element.getValue(),t;if(!this.data.unique)throw"No option group set";return t=f(e),c(),t},update:function(){var e=this.data.element.getValue(),t;if(!this.data.unique)throw"No option group set";return t=f(e),t},fieldAdded:function(e){e.$el!==this.$el&&a(e,this.data.unique)&&(t.debug("field added",this.$el),u.push(e))},fieldRemoved:function(e){t.debug("field removed",this.$el),u=u.splice(u.indexOf(e),1)}});return h.initialize(),h}}),define("validator/equal",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={equal:null},o=[],u=function(e,t){return o.indexOf(e)&&!!e.options.validationEqual&&e.options.validationEqual===t},a=function(e){var t=!0;return $.each(o,function(n,r){return f(e,r)?!0:(t=!1,!1)}),t},f=function(e,t){return e===t.getValue()},l=function(){$.each(o,function(e,t){t.update()})},c=$.extend(new e(t,n,s,i,"equal"),{initializeSub:function(){r.initialized.then(function(){$.each(n.elements,function(e,t){this.fieldAdded(t)}.bind(this))}.bind(this))},validate:function(){var e=this.$el.val(),t;if(!this.data.equal)throw"No option group set";return t=a(e),l(),t},update:function(){var e=this.data.element.getValue(),t;if(!this.data.equal)throw"No option group set";return t=a(e),t},fieldAdded:function(e){e.$el!==this.$el&&u(e,this.data.equal)&&o.push(e)},fieldRemoved:function(e){o=o.splice(o.indexOf(e),1)}});return c.initialize(),c}}),define("validator/regex",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={regex:/\w*/},o=$.extend(new e(t,n,s,i,"regex"),{validate:function(){var e=this.data.regex,t=new RegExp(e),n=this.data.element.getValue();return n===""?!0:t.test(n)}});return o.initialize(),o}}),define("husky-validation",function(){}),function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N;n=function(e){return new n.prototype.init(e)},typeof require!="undefined"&&typeof exports!="undefined"&&typeof module!="undefined"?module.exports=n:e.Globalize=n,n.cultures={},n.prototype={constructor:n,init:function(e){return this.cultures=n.cultures,this.cultureSelector=e,this}},n.prototype.init.prototype=n.prototype,n.cultures["default"]={name:"en",englishName:"English",nativeName:"English",isRTL:!1,language:"en",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSizes:[3],"+":"+","-":"-",NaN:"NaN",negativeInfinity:"-Infinity",positiveInfinity:"Infinity",percent:{pattern:["-n %","n %"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"$"}},calendars:{standard:{name:"Gregorian_USEnglish","/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss"}}},messages:{}},n.cultures["default"].calendar=n.cultures["default"].calendars.standard,n.cultures.en=n.cultures["default"],n.cultureSelector="en",r=/^0x[a-f0-9]+$/i,i=/^[+\-]?infinity$/i,s=/^[+\-]?\d*\.?\d*(e[+\-]?\d+)?$/,o=/^\s+|\s+$/g,u=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},a=function(e,t){return e.substr(e.length-t.length)===t},f=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,p=arguments.length,d=!1;typeof u=="boolean"&&(d=u,u=arguments[1]||{},a=2),typeof u!="object"&&!c(u)&&(u={});for(;a<p;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;d&&i&&(h(i)||(s=l(i)))?(s?(s=!1,o=r&&l(r)?r:[]):o=r&&h(r)?r:{},u[n]=f(d,o,i)):i!==t&&(u[n]=i)}return u},l=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},c=function(e){return Object.prototype.toString.call(e)==="[object Function]"},h=function(e){return Object.prototype.toString.call(e)==="[object Object]"},p=function(e,t){return e.indexOf(t)===0},d=function(e){return(e+"").replace(o,"")},v=function(e){return isNaN(e)?NaN:Math[e<0?"ceil":"floor"](e)},m=function(e,t,n){var r;for(r=e.length;r<t;r+=1)e=n?"0"+e:e+"0";return e},g=function(e,t){var n=0,r=!1;for(var i=0,s=e.length;i<s;i++){var o=e.charAt(i);switch(o){case"'":r?t.push("'"):n++,r=!1;break;case"\\":r&&t.push("\\"),r=!r;break;default:t.push(o),r=!1}}return n},y=function(e,t){t=t||"F";var n,r=e.patterns,i=t.length;if(i===1){n=r[t];if(!n)throw"Invalid date format string '"+t+"'.";t=n}else i===2&&t.charAt(0)==="%"&&(t=t.charAt(1));return t},b=function(e,t,n){function T(e,t){var n,r=e+"";return t>1&&r.length<t?(n=c[t-2]+r,n.substr(n.length-t,t)):(n=r,n)}function N(){return h||p?h:(h=d.test(t),p=!0,h)}function C(e,t){if(w)return w[t];switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate();default:throw"Invalid part value "+t}}var r=n.calendar,i=r.convert,s;if(!t||!t.length||t==="i"){if(n&&n.name.length)if(i)s=b(e,r.patterns.F,n);else{var o=new Date(e.getTime()),u=S(e,r.eras);o.setFullYear(x(e,r,u)),s=o.toLocaleString()}else s=e.toString();return s}var a=r.eras,f=t==="s";t=y(r,t),s=[];var l,c=["0","00","000"],h,p,d=/([^d]|^)(d|dd)([^d]|$)/g,v=0,m=E(),w;!f&&i&&(w=i.fromGregorian(e));for(;;){var k=m.lastIndex,L=m.exec(t),A=t.slice(k,L?L.index:t.length);v+=g(A,s);if(!L)break;if(v%2){s.push(L[0]);continue}var O=L[0],M=O.length;switch(O){case"ddd":case"dddd":var _=M===3?r.days.namesAbbr:r.days.names;s.push(_[e.getDay()]);break;case"d":case"dd":h=!0,s.push(T(C(e,2),M));break;case"MMM":case"MMMM":var D=C(e,1);s.push(r.monthsGenitive&&N()?r.monthsGenitive[M===3?"namesAbbr":"names"][D]:r.months[M===3?"namesAbbr":"names"][D]);break;case"M":case"MM":s.push(T(C(e,1)+1,M));break;case"y":case"yy":case"yyyy":D=w?w[0]:x(e,r,S(e,a),f),M<4&&(D%=100),s.push(T(D,M));break;case"h":case"hh":l=e.getHours()%12,l===0&&(l=12),s.push(T(l,M));break;case"H":case"HH":s.push(T(e.getHours(),M));break;case"m":case"mm":s.push(T(e.getMinutes(),M));break;case"s":case"ss":s.push(T(e.getSeconds(),M));break;case"t":case"tt":D=e.getHours()<12?r.AM?r.AM[0]:" ":r.PM?r.PM[0]:" ",s.push(M===1?D.charAt(0):D);break;case"f":case"ff":case"fff":s.push(T(e.getMilliseconds(),3).substr(0,M));break;case"z":case"zz":l=e.getTimezoneOffset()/60,s.push((l<=0?"+":"-")+T(Math.floor(Math.abs(l)),M));break;case"zzz":l=e.getTimezoneOffset()/60,s.push((l<=0?"+":"-")+T(Math.floor(Math.abs(l)),2)+":"+T(Math.abs(e.getTimezoneOffset()%60),2));break;case"g":case"gg":r.eras&&s.push(r.eras[S(e,a)].name);break;case"/":s.push(r["/"]);break;default:throw"Invalid date format pattern '"+O+"'."}}return s.join("")},function(){var e;e=function(e,t,n){var r=n.groupSizes,i=r[0],s=1,o=Math.pow(10,t),u=Math.round(e*o)/o;isFinite(u)||(u=e),e=u;var a=e+"",f="",l=a.split(/e/i),c=l.length>1?parseInt(l[1],10):0;a=l[0],l=a.split("."),a=l[0],f=l.length>1?l[1]:"";var h;c>0?(f=m(f,c,!1),a+=f.slice(0,c),f=f.substr(c)):c<0&&(c=-c,a=m(a,c+1,!0),f=a.slice(-c,a.length)+f,a=a.slice(0,-c)),t>0?f=n["."]+(f.length>t?f.slice(0,t):m(f,t)):f="";var p=a.length-1,d=n[","],v="";while(p>=0){if(i===0||i>p)return a.slice(0,p+1)+(v.length?d+v+f:f);v=a.slice(p-i+1,p+1)+(v.length?d+v:""),p-=i,s<r.length&&(i=r[s],s++)}return a.slice(0,p+1)+d+v+f},w=function(t,n,r){if(!isFinite(t))return t===Infinity?r.numberFormat.positiveInfinity:t===-Infinity?r.numberFormat.negativeInfinity:r.numberFormat.NaN;if(!n||n==="i")return r.name.length?t.toLocaleString():t.toString();n=n||"D";var i=r.numberFormat,s=Math.abs(t),o=-1,u;n.length>1&&(o=parseInt(n.slice(1),10));var a=n.charAt(0).toUpperCase(),f;switch(a){case"D":u="n",s=v(s),o!==-1&&(s=m(""+s,o,!0)),t<0&&(s="-"+s);break;case"N":f=i;case"C":f=f||i.currency;case"P":f=f||i.percent,u=t<0?f.pattern[0]:f.pattern[1]||"n",o===-1&&(o=f.decimals),s=e(s*(a==="P"?100:1),o,f);break;default:throw"Bad number format specifier: "+a}var l=/n|\$|-|%/g,c="";for(;;){var h=l.lastIndex,p=l.exec(u);c+=u.slice(h,p?p.index:u.length);if(!p)break;switch(p[0]){case"n":c+=s;break;case"$":c+=i.currency.symbol;break;case"-":/[1-9]/.test(s)&&(c+=i["-"]);break;case"%":c+=i.percent.symbol}}return c}}(),E=function(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g},S=function(e,t){if(!t)return 0;var n,r=e.getTime();for(var i=0,s=t.length;i<s;i++){n=t[i].start;if(n===null||r>=n)return i}return 0},x=function(e,t,n,r){var i=e.getFullYear();return!r&&t.eras&&(i-=t.eras[n].offset),i},function(){var e,t,n,r,i,s,o;e=function(e,t){if(t<100){var n=new Date,r=S(n),i=x(n,e,r),s=e.twoDigitYearMax;s=typeof s=="string"?(new Date).getFullYear()%100+parseInt(s,10):s,t+=i-i%100,t>s&&(t-=100)}return t},t=function(e,t,n){var r,i=e.days,a=e._upperDays;return a||(e._upperDays=a=[o(i.names),o(i.namesAbbr),o(i.namesShort)]),t=s(t),n?(r=u(a[1],t),r===-1&&(r=u(a[2],t))):r=u(a[0],t),r},n=function(e,t,n){var r=e.months,i=e.monthsGenitive||e.months,a=e._upperMonths,f=e._upperMonthsGen;a||(e._upperMonths=a=[o(r.names),o(r.namesAbbr)],e._upperMonthsGen=f=[o(i.names),o(i.namesAbbr)]),t=s(t);var l=u(n?a[1]:a[0],t);return l<0&&(l=u(n?f[1]:f[0],t)),l},r=function(e,t){var n=e._parseRegExp;if(!n)e._parseRegExp=n={};else{var r=n[t];if(r)return r}var i=y(e,t).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),s=["^"],o=[],u=0,a=0,f=E(),l;while((l=f.exec(i))!==null){var c=i.slice(u,l.index);u=f.lastIndex,a+=g(c,s);if(a%2){s.push(l[0]);continue}var h=l[0],p=h.length,d;switch(h){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":d="(\\D+)";break;case"tt":case"t":d="(\\D*)";break;case"yyyy":case"fff":case"ff":case"f":d="(\\d{"+p+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":d="(\\d\\d?)";break;case"zzz":d="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":d="([+-]?\\d\\d?)";break;case"/":d="(\\/)";break;default:throw"Invalid date format pattern '"+h+"'."}d&&s.push(d),o.push(l[0])}g(i.slice(u),s),s.push("$");var v=s.join("").replace(/\s+/g,"\\s+"),m={regExp:v,groups:o};return n[t]=m},i=function(e,t,n){return e<t||e>n},s=function(e){return e.split(" ").join(" ").toUpperCase()},o=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)t[n]=s(e[n]);return t},T=function(s,o,u){s=d(s);var a=u.calendar,f=r(a,o),l=(new RegExp(f.regExp)).exec(s);if(l===null)return null;var c=f.groups,h=null,v=null,m=null,g=null,y=null,b=0,w,E=0,S=0,x=0,T=null,N=!1;for(var C=0,k=c.length;C<k;C++){var L=l[C+1];if(L){var A=c[C],O=A.length,M=parseInt(L,10);switch(A){case"dd":case"d":g=M;if(i(g,1,31))return null;break;case"MMM":case"MMMM":m=n(a,L,O===3);if(i(m,0,11))return null;break;case"M":case"MM":m=M-1;if(i(m,0,11))return null;break;case"y":case"yy":case"yyyy":v=O<4?e(a,M):M;if(i(v,0,9999))return null;break;case"h":case"hh":b=M,b===12&&(b=0);if(i(b,0,11))return null;break;case"H":case"HH":b=M;if(i(b,0,23))return null;break;case"m":case"mm":E=M;if(i(E,0,59))return null;break;case"s":case"ss":S=M;if(i(S,0,59))return null;break;case"tt":case"t":N=a.PM&&(L===a.PM[0]||L===a.PM[1]||L===a.PM[2]);if(!N&&(!a.AM||L!==a.AM[0]&&L!==a.AM[1]&&L!==a.AM[2]))return null;break;case"f":case"ff":case"fff":x=M*Math.pow(10,3-O);if(i(x,0,999))return null;break;case"ddd":case"dddd":y=t(a,L,O===3);if(i(y,0,6))return null;break;case"zzz":var _=L.split(/:/);if(_.length!==2)return null;w=parseInt(_[0],10);if(i(w,-12,13))return null;var D=parseInt(_[1],10);if(i(D,0,59))return null;T=w*60+(p(L,"-")?-D:D);break;case"z":case"zz":w=M;if(i(w,-12,13))return null;T=w*60;break;case"g":case"gg":var P=L;if(!P||!a.eras)return null;P=d(P.toLowerCase());for(var H=0,B=a.eras.length;H<B;H++)if(P===a.eras[H].name.toLowerCase()){h=H;break}if(h===null)return null}}}var j=new Date,F,I=a.convert;F=I?I.fromGregorian(j)[0]:j.getFullYear(),v===null?v=F:a.eras&&(v+=a.eras[h||0].offset),m===null&&(m=0),g===null&&(g=1);if(I){j=I.toGregorian(v,m,g);if(j===null)return null}else{j.setFullYear(v,m,g);if(j.getDate()!==g)return null;if(y!==null&&j.getDay()!==y)return null}N&&b<12&&(b+=12),j.setHours(b,E,S,x);if(T!==null){var q=j.getMinutes()-(T+j.getTimezoneOffset());j.setHours(j.getHours()+parseInt(q/60,10),q%60)}return j}}(),N=function(e,t,n){var r=t["-"],i=t["+"],s;switch(n){case"n -":r=" "+r,i=" "+i;case"n-":a(e,r)?s=["-",e.substr(0,e.length-r.length)]:a(e,i)&&(s=["+",e.substr(0,e.length-i.length)]);break;case"- n":r+=" ",i+=" ";case"-n":p(e,r)?s=["-",e.substr(r.length)]:p(e,i)&&(s=["+",e.substr(i.length)]);break;case"(n)":p(e,"(")&&a(e,")")&&(s=["-",e.substr(1,e.length-2)])}return s||["",e]},n.prototype.findClosestCulture=function(e){return n.findClosestCulture.call(this,e)},n.prototype.format=function(e,t,r){return n.format.call(this,e,t,r)},n.prototype.localize=function(e,t){return n.localize.call(this,e,t)},n.prototype.parseInt=function(e,t,r){return n.parseInt.call(this,e,t,r)},n.prototype.parseFloat=function(e,t,r){return n.parseFloat.call(this,e,t,r)},n.prototype.culture=function(e){return n.culture.call(this,e)},n.addCultureInfo=function(e,t,n){var r={},i=!1;typeof e!="string"?(n=e,e=this.culture().name,r=this.cultures[e]):typeof t!="string"?(n=t,i=this.cultures[e]==null,r=this.cultures[e]||this.cultures["default"]):(i=!0,r=this.cultures[t]),this.cultures[e]=f(!0,{},r,n),i&&(this.cultures[e].calendar=this.cultures[e].calendars.standard)},n.findClosestCulture=function(e){var t;if(!e)return this.findClosestCulture(this.cultureSelector)||this.cultures["default"];typeof e=="string"&&(e=e.split(","));if(l(e)){var n,r=this.cultures,i=e,s,o=i.length,u=[];for(s=0;s<o;s++){e=d(i[s]);var a,f=e.split(";");n=d(f[0]),f.length===1?a=1:(e=d(f[1]),e.indexOf("q=")===0?(e=e.substr(2),a=parseFloat(e),a=isNaN(a)?0:a):a=1),u.push({lang:n,pri:a})}u.sort(function(e,t){return e.pri<t.pri?1:e.pri>t.pri?-1:0});for(s=0;s<o;s++){n=u[s].lang,t=r[n];if(t)return t}for(s=0;s<o;s++){n=u[s].lang;do{var c=n.lastIndexOf("-");if(c===-1)break;n=n.substr(0,c),t=r[n];if(t)return t}while(1)}for(s=0;s<o;s++){n=u[s].lang;for(var h in r){var p=r[h];if(p.language==n)return p}}}else if(typeof e=="object")return e;return t||null},n.format=function(e,t,n){var r=this.findClosestCulture(n);return e instanceof Date?e=b(e,t,r):typeof e=="number"&&(e=w(e,t,r)),e},n.localize=function(e,t){return this.findClosestCulture(t).messages[e]||this.cultures["default"].messages[e]},n.parseDate=function(e,t,n){n=this.findClosestCulture(n);var r,i,s;if(t){typeof t=="string"&&(t=[t]);if(t.length)for(var o=0,u=t.length;o<u;o++){var a=t[o];if(a){r=T(e,a,n);if(r)break}}}else{s=n.calendar.patterns;for(i in s){r=T(e,s[i],n);if(r)break}}return r||null},n.parseInt=function(e,t,r){return v(n.parseFloat(e,t,r))},n.parseFloat=function(e,t,n){typeof t!="number"&&(n=t,t=10);var o=this.findClosestCulture(n),u=NaN,a=o.numberFormat;e.indexOf(o.numberFormat.currency.symbol)>-1&&(e=e.replace(o.numberFormat.currency.symbol,""),e=e.replace(o.numberFormat.currency["."],o.numberFormat["."])),e.indexOf(o.numberFormat.percent.symbol)>-1&&(e=e.replace(o.numberFormat.percent.symbol,"")),e=e.replace(/ /g,"");if(i.test(e))u=parseFloat(e);else if(!t&&r.test(e))u=parseInt(e,16);else{var f=N(e,a,a.pattern[0]),l=f[0],c=f[1];l===""&&a.pattern[0]!=="(n)"&&(f=N(e,a,"(n)"),l=f[0],c=f[1]),l===""&&a.pattern[0]!=="-n"&&(f=N(e,a,"-n"),l=f[0],c=f[1]),l=l||"+";var h,p,d=c.indexOf("e");d<0&&(d=c.indexOf("E")),d<0?(p=c,h=null):(p=c.substr(0,d),h=c.substr(d+1));var v,m,g=a["."],y=p.indexOf(g);y<0?(v=p,m=null):(v=p.substr(0,y),m=p.substr(y+g.length));var b=a[","];v=v.split(b).join("");var w=b.replace(/\u00A0/g," ");b!==w&&(v=v.split(w).join(""));var E=l+v;m!==null&&(E+="."+m);if(h!==null){var S=N(h,a,"-n");E+="e"+(S[0]||"+")+S[1]}s.test(E)&&(u=parseFloat(E))}return u},n.culture=function(e){return typeof e!="undefined"&&(this.cultureSelector=e),this.findClosestCulture(e)||this.cultures["default"]}}(this),define("globalize_lib",function(){}),function(){if(!window.CKEDITOR||!window.CKEDITOR.dom)window.CKEDITOR||(window.CKEDITOR=function(){var e=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,t={timestamp:"F0RF",version:"4.4.7 (Standard)",revision:"3a35b3d",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:e},status:"unloaded",basePath:function(){var t=window.CKEDITOR_BASEPATH||"";if(!t)for(var n=document.getElementsByTagName("script"),r=0;r<n.length;r++){var i=n[r].src.match(e);if(i){t=i[1];break}}-1==t.indexOf(":/")&&"//"!=t.slice(0,2)&&(t=0===t.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+t:location.href.match(/^[^\?]*\/(?:)/)[0]+t);if(!t)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return t}(),getUrl:function(e){return-1==e.indexOf(":/")&&0!==e.indexOf("/")&&(e=this.basePath+e),this.timestamp&&"/"!=e.charAt(e.length-1)&&!/[&?]t=/.test(e)&&(e+=(0<=e.indexOf("?")?"&":"?")+"t="+this.timestamp),e},domReady:function(){function e(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",e,!1),t()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",e),t())}catch(n){}}function t(){for(var e;e=n.shift();)e()}var n=[];return function(t){function r(){try{document.documentElement.doScroll("left")}catch(t){setTimeout(r,1);return}e()}n.push(t),"complete"===document.readyState&&setTimeout(e,1);if(1==n.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",e,!1),window.addEventListener("load",e,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",e),window.attachEvent("onload",e),t=!1;try{t=!window.frameElement}catch(i){}document.documentElement.doScroll&&t&&r()}}}()},n=window.CKEDITOR_GETURL;if(n){var r=t.getUrl;t.getUrl=function(e){return n.call(t,e)||r.call(t,e)}}return t}()),CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(e){var t=CKEDITOR.event.prototype,n;for(n in t)e[n]==null&&(e[n]=t[n])},CKEDITOR.event.prototype=function(){function e(e){var r=t(this);return r[e]||(r[e]=new n(e))}var t=function(e){return e=e.getPrivate&&e.getPrivate()||e._||(e._={}),e.events||(e.events={})},n=function(e){this.name=e,this.listeners=[]};return n.prototype={getListenerIndex:function(e){for(var t=0,n=this.listeners;t<n.length;t++)if(n[t].fn==e)return t;return-1}},{define:function(t,n){var r=e.call(this,t);CKEDITOR.tools.extend(r,n,!0)},on:function(t,n,r,i,s){function o(e,s,o,a){return e={name:t,sender:this,editor:e,data:s,listenerData:i,stop:o,cancel:a,removeListener:u},n.call(r,e)===!1?!1:e.data}function u(){l.removeListener(t,n)}var f=e.call(this,t);if(f.getListenerIndex(n)<0){f=f.listeners,r||(r=this),isNaN(s)&&(s=10);var l=this;o.fn=n,o.priority=s;for(var c=f.length-1;c>=0;c--)if(f[c].priority<=s)return f.splice(c+1,0,o),{removeListener:u};f.unshift(o)}return{removeListener:u}},once:function(){var e=Array.prototype.slice.call(arguments),t=e[1];return e[1]=function(e){return e.removeListener(),t.apply(this,arguments)},this.on.apply(this,e)},capture:function(){CKEDITOR.event.useCapture=1;var e=this.on.apply(this,arguments);return CKEDITOR.event.useCapture=0,e},fire:function(){var e=0,n=function(){e=1},r=0,i=function(){r=1};return function(s,o,u){var f=t(this)[s],s=e,l=r;e=r=0;if(f){var h=f.listeners;if(h.length)for(var h=h.slice(0),p,v=0;v<h.length;v++){if(f.errorProof)try{p=h[v].call(this,u,o,n,i)}catch(m){}else p=h[v].call(this,u,o,n,i);p===!1?r=1:typeof p!="undefined"&&(o=p);if(e||r)break}}return o=r?!1:typeof o=="undefined"?!0:o,e=s,r=l,o}}(),fireOnce:function(e,n,r){return n=this.fire(e,n,r),delete t(this)[e],n},removeListener:function(e,n){var r=t(this)[e];if(r){var i=r.getListenerIndex(n);i>=0&&r.listeners.splice(i,1)}},removeAllListeners:function(){var e=t(this),n;for(n in e)delete e[n]},hasListeners:function(e){return(e=t(this)[e])&&e.listeners.length>0}}}()),CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]),CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fire.call(this,e,t,this)},CKEDITOR.editor.prototype.fireOnce=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fireOnce.call(this,e,t,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)),CKEDITOR.env||(CKEDITOR.env=function(){var e=navigator.userAgent.toLowerCase(),t={ie:e.indexOf("trident/")>-1,webkit:e.indexOf(" applewebkit/")>-1,air:e.indexOf(" adobeair/")>-1,mac:e.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:e.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(e),isCustomDomain:function(){if(!this.ie)return!1;var e=document.domain,t=window.location.hostname;return e!=t&&e!="["+t+"]"},secure:location.protocol=="https:"};t.gecko=navigator.product=="Gecko"&&!t.webkit&&!t.ie,t.webkit&&(e.indexOf("chrome")>-1?t.chrome=!0:t.safari=!0);var n=0;t.ie&&(n=t.quirks||!document.documentMode?parseFloat(e.match(/msie (\d+)/)[1]):document.documentMode,t.ie9Compat=n==9,t.ie8Compat=n==8,t.ie7Compat=n==7,t.ie6Compat=n<7||t.quirks);if(t.gecko){var r=e.match(/rv:([\d\.]+)/);r&&(r=r[1].split("."),n=r[0]*1e4+(r[1]||0)*100+(r[2]||0)*1)}return t.air&&(n=parseFloat(e.match(/ adobeair\/(\d+)/)[1])),t.webkit&&(n=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),t.version=n,t.isCompatible=t.iOS&&n>=534||!t.mobile&&(t.ie&&n>6||t.gecko&&n>=2e4||t.air&&n>=1||t.webkit&&n>=522||!1),t.hidpi=window.devicePixelRatio>=2,t.needsBrFiller=t.gecko||t.webkit||t.ie&&n>10,t.needsNbspFiller=t.ie&&n<11,t.cssClass="cke_browser_"+(t.ie?"ie":t.gecko?"gecko":t.webkit?"webkit":"unknown"),t.quirks&&(t.cssClass=t.cssClass+" cke_browser_quirks"),t.ie&&(t.cssClass=t.cssClass+(" cke_browser_ie"+(t.quirks?"6 cke_browser_iequirks":t.version))),t.air&&(t.cssClass=t.cssClass+" cke_browser_air"),t.iOS&&(t.cssClass=t.cssClass+" cke_browser_ios"),t.hidpi&&(t.cssClass=t.cssClass+" cke_hidpi"),t}()),"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 e=document.createElement("script");e.type="text/javascript",e.src=CKEDITOR.basePath+"ckeditor.js",document.getElementsByTagName("head")[0].appendChild(e)}},CKEDITOR.loadFullCoreTimeout=0,CKEDITOR.add=function(e){(this._.pending||(this._.pending=[])).push(e)},function(){CKEDITOR.domReady(function(){var e=CKEDITOR.loadFullCore,t=CKEDITOR.loadFullCoreTimeout;e&&(CKEDITOR.status="basic_ready",e&&e._load?e():t&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},t*1e3))})}(),CKEDITOR.status="basic_loaded"}(),CKEDITOR.dom={},function(){var e=[],t=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",n=/&/g,r=/>/g,i=/</g,s=/"/g,o=/&amp;/g,u=/&gt;/g,a=/&lt;/g,f=/&quot;/g;CKEDITOR.on("reset",function(){e=[]}),CKEDITOR.tools={arrayCompare:function(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0},clone:function(e){var t;if(e&&e instanceof Array){t=[];for(var n=0;n<e.length;n++)t[n]=CKEDITOR.tools.clone(e[n]);return t}if(e===null||typeof e!="object"||e instanceof String||e instanceof Number||e instanceof Boolean||e instanceof Date||e instanceof RegExp||e.nodeType||e.window===e)return e;t=new e.constructor;for(n in e)t[n]=CKEDITOR.tools.clone(e[n]);return t},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},extend:function(e){var t=arguments.length,n,r;typeof (n=arguments[t-1])=="boolean"?t--:typeof (n=arguments[t-2])=="boolean"&&(r=arguments[t-1],t-=2);for(var i=1;i<t;i++){var s=arguments[i],o;for(o in s)if(n===!0||e[o]==null)if(!r||o in r)e[o]=s[o]}return e},prototypedCopy:function(e){var t=function(){};return t.prototype=e,new t},copy:function(e){var t={},n;for(n in e)t[n]=e[n];return t},isArray:function(e){return Object.prototype.toString.call(e)=="[object Array]"},isEmpty:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},cssVendorPrefix:function(e,n,r){return r?t+e+":"+n+";"+e+":"+n:(r={},r[e]=n,r[t+e]=n,r)},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t=typeof e.cssFloat!="undefined"?"cssFloat":typeof e.styleFloat!="undefined"?"styleFloat":"float";return function(e){return e=="float"?t:e.replace(/-./g,function(e){return e.substr(1).toUpperCase()})}}(),buildStyleHtml:function(e){for(var e=[].concat(e),t,n=[],r=0;r<e.length;r++)if(t=e[r])/@import|[{}]/.test(t)?n.push("<style>"+t+"</style>"):n.push('<link type="text/css" rel=stylesheet href="'+t+'">');return n.join("")},htmlEncode:function(e){return(""+e).replace(n,"&amp;").replace(r,"&gt;").replace(i,"&lt;")},htmlDecode:function(e){return e.replace(o,"&").replace(u,">").replace(a,"<")},htmlEncodeAttr:function(e){return e.replace(s,"&quot;").replace(i,"&lt;").replace(r,"&gt;")},htmlDecodeAttr:function(e){return e.replace(f,'"').replace(a,"<").replace(u,">")},getNextNumber:function(){var e=0;return function(){return++e}}(),getNextId:function(){return"cke_"+this.getNextNumber()},override:function(e,t){var n=t(e);return n.prototype=e.prototype,n},setTimeout:function(e,t,n,r,i){return i||(i=window),n||(n=i),i.setTimeout(function(){r?e.apply(n,[].concat(r)):e.apply(n)},t||0)},trim:function(){var e=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(t){return t.replace(e,"")}}(),ltrim:function(){var e=/^[ \t\n\r]+/g;return function(t){return t.replace(e,"")}}(),rtrim:function(){var e=/[ \t\n\r]+$/g;return function(t){return t.replace(e,"")}}(),indexOf:function(e,t){if(typeof t=="function"){for(var n=0,r=e.length;n<r;n++)if(t(e[n]))return n}else{if(e.indexOf)return e.indexOf(t);n=0;for(r=e.length;n<r;n++)if(e[n]===t)return n}return-1},search:function(e,t){var n=CKEDITOR.tools.indexOf(e,t);return n>=0?e[n]:null},bind:function(e,t){return function(){return e.apply(t,arguments)}},createClass:function(e){var t=e.$,n=e.base,r=e.privates||e._,i=e.proto,e=e.statics;!t&&(t=function(){n&&this.base.apply(this,arguments)});if(r)var s=t,t=function(){var e=this._||(this._={}),t;for(t in r){var n=r[t];e[t]=typeof n=="function"?CKEDITOR.tools.bind(n,this):n}s.apply(this,arguments)};return n&&(t.prototype=this.prototypedCopy(n.prototype),t.prototype.constructor=t,t.base=n,t.baseProto=n.prototype,t.prototype.base=function(){this.base=n.prototype.base,n.apply(this,arguments),this.base=arguments.callee}),i&&this.extend(t.prototype,i,!0),e&&this.extend(t,e,!0),t},addFunction:function(t,n){return e.push(function(){return t.apply(n||this,arguments)})-1},removeFunction:function(t){e[t]=null},callFunction:function(t){var n=e[t];return n&&n.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var e=/^-?\d+\.?\d*px$/,t;return function(n){return t=CKEDITOR.tools.trim(n+"")+"px",e.test(t)?t:n||""}}(),convertToPx:function(){var e;return function(t){return e||(e=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(e)),/%$/.test(t)?t:(e.setStyle("width",t),e.$.clientWidth)}}(),repeat:function(e,t){return Array(t+1).join(e)},tryThese:function(){for(var e,t=0,n=arguments.length;t<n;t++){var r=arguments[t];try{e=r();break}catch(i){}}return e},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(e){return function(){var t=arguments,n=this;window.setTimeout(function(){e.apply(n,t)},0)}},normalizeCssText:function(e,t){var n=[],r,i=CKEDITOR.tools.parseCssText(e,!0,t);for(r in i)n.push(r+":"+i[r]);return n.sort(),n.length?n.join(";")+";":""},convertRgbToHex:function(e){return e.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(e,t,n,r){e=[t,n,r];for(t=0;t<3;t++)e[t]=("0"+parseInt(e[t],10).toString(16)).slice(-2);return"#"+e.join("")})},parseCssText:function(e,t,n){var r={};return n&&(n=new CKEDITOR.dom.element("span"),n.setAttribute("style",e),e=CKEDITOR.tools.convertRgbToHex(n.getAttribute("style")||"")),!e||e==";"?r:(e.replace(/&quot;/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,n,i){t&&(n=n.toLowerCase(),n=="font-family"&&(i=i.toLowerCase().replace(/["']/g,"").replace(/\s*,\s*/g,",")),i=CKEDITOR.tools.trim(i)),r[n]=i}),r)},writeCssText:function(e,t){var n,r=[];for(n in e)r.push(n+":"+e[n]);return t&&r.sort(),r.join("; ")},objectCompare:function(e,t,n){var r;if(!e&&!t)return!0;if(!e||!t)return!1;for(r in e)if(e[r]!=t[r])return!1;if(!n)for(r in t)if(e[r]!=t[r])return!1;return!0},objectKeys:function(e){var t=[],n;for(n in e)t.push(n);return t},convertArrayToObject:function(e,t){var n={};arguments.length==1&&(t=!0);for(var r=0,i=e.length;r<i;++r)n[e[r]]=t;return n},fixDomain:function(){for(var e;;)try{e=window.parent.document.domain;break}catch(t){e=e?e.replace(/.+?(?:\.|$)/,""):document.domain;if(!e)break;document.domain=e}return!!e},eventsBuffer:function(e,t){function n(){i=(new Date).getTime(),r=!1,t()}var r,i=0;return{input:function(){if(!r){var t=(new Date).getTime()-i;t<e?r=setTimeout(n,e-t):n()}},reset:function(){r&&clearTimeout(r),r=i=0}}},enableHtml5Elements:function(e,t){for(var n=["abbr","article","aside","audio","bdi","canvas","data","datalist","details","figcaption","figure","footer","header","hgroup","mark","meter","nav","output","progress","section","summary","time","video"],r=n.length,i;r--;)i=e.createElement(n[r]),t&&e.appendChild(i)},checkIfAnyArrayItemMatches:function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n].match(t))return!0;return!1},checkIfAnyObjectPropertyMatches:function(e,t){for(var n in e)if(n.match(t))return!0;return!1},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="}}(),CKEDITOR.dtd=function(){var e=CKEDITOR.tools.extend,t=function(e,t){for(var n=CKEDITOR.tools.clone(e),r=1;r<arguments.length;r++){var t=arguments[r],i;for(i in t)delete n[i]}return n},n={},r={},i={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,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},s={command:1,link:1,meta:1,noscript:1,script:1,style:1},o={},u={"#":1},a={center:1,dir:1,noframes:1};return e(n,{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},u,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1}),e(r,i,n,a),t={a:t(n,{a:1,button:1}),abbr:n,address:r,area:o,article:r,aside:r,audio:e({source:1,track:1},r),b:n,base:o,bdi:n,bdo:n,blockquote:r,body:r,br:o,button:t(n,{a:1,button:1}),canvas:n,caption:r,cite:n,code:n,col:o,colgroup:{col:1},command:o,datalist:e({option:1},n),dd:r,del:n,details:e({summary:1},r),dfn:n,div:r,dl:{dt:1,dd:1},dt:r,em:n,embed:o,fieldset:e({legend:1},r),figcaption:r,figure:e({figcaption:1},r),footer:r,form:r,h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:e({title:1,base:1},s),header:r,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:o,html:e({head:1,body:1},r,s),i:n,iframe:u,img:o,input:o,ins:n,kbd:n,keygen:o,label:n,legend:n,li:r,link:o,main:r,map:r,mark:n,menu:e({li:1},r),meta:o,meter:t(n,{meter:1}),nav:r,noscript:e({link:1,meta:1,style:1},n),object:e({param:1},n),ol:{li:1},optgroup:{option:1},option:u,output:n,p:n,param:o,pre:n,progress:t(n,{progress:1}),q:n,rp:n,rt:n,ruby:e({rp:1,rt:1},n),s:n,samp:n,script:u,section:r,select:{optgroup:1,option:1},small:n,source:o,span:n,strong:n,style:u,sub:n,summary:n,sup:n,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:r,textarea:u,tfoot:{tr:1},th:r,thead:{tr:1},time:t(n,{time:1}),title:u,tr:{th:1,td:1},track:o,u:n,ul:{li:1},"var":n,video:e({source:1,track:1},r),wbr:o,acronym:n,applet:e({param:1},r),basefont:o,big:n,center:r,dialog:o,dir:{li:1},font:n,isindex:o,noframes:r,strike:n,tt:n},e(t,{$block:e({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},i,a),$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,main: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,main: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:n,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:e({body:1,head:1,html:1},t.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}}),t}(),CKEDITOR.dom.event=function(e){this.$=e},CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var e=this.getKey();if(this.$.ctrlKey||this.$.metaKey)e+=CKEDITOR.CTRL;return this.$.shiftKey&&(e+=CKEDITOR.SHIFT),this.$.altKey&&(e+=CKEDITOR.ALT),e},preventDefault:function(e){var t=this.$;t.preventDefault?t.preventDefault():t.returnValue=!1,e&&this.stopPropagation()},stopPropagation:function(){var e=this.$;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},getTarget:function(){var e=this.$.target||this.$.srcElement;return e?new CKEDITOR.dom.node(e):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var e=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(e.documentElement.scrollLeft||e.body.scrollLeft),y:this.$.pageY||this.$.clientY+(e.documentElement.scrollTop||e.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(e){e&&(this.$=e)},CKEDITOR.dom.domObject.prototype=function(){var e=function(e,t){return function(n){typeof CKEDITOR!="undefined"&&e.fire(t,new CKEDITOR.dom.event(n))}};return{getPrivate:function(){var e;return(e=this.getCustomData("_"))||this.setCustomData("_",e={}),e},on:function(t){var n=this.getCustomData("_cke_nativeListeners");return n||(n={},this.setCustomData("_cke_nativeListeners",n)),n[t]||(n=n[t]=e(this,t),this.$.addEventListener?this.$.addEventListener(t,n,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+t,n)),CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(e){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(e)){var t=this.getCustomData("_cke_nativeListeners"),n=t&&t[e];n&&(this.$.removeEventListener?this.$.removeEventListener(e,n,!1):this.$.detachEvent&&this.$.detachEvent("on"+e,n),delete t[e])}},removeAllListeners:function(){var e=this.getCustomData("_cke_nativeListeners"),t;for(t in e){var n=e[t];this.$.detachEvent?this.$.detachEvent("on"+t,n):this.$.removeEventListener&&this.$.removeEventListener(t,n,!1),delete e[t]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}(),function(e){var t={};CKEDITOR.on("reset",function(){t={}}),e.equals=function(e){try{return e&&e.$===this.$}catch(t){return!1}},e.setCustomData=function(e,n){var r=this.getUniqueId();return(t[r]||(t[r]={}))[e]=n,this},e.getCustomData=function(e){var n=this.$["data-cke-expando"];return(n=n&&t[n])&&e in n?n[e]:null},e.removeCustomData=function(e){var n=this.$["data-cke-expando"],n=n&&t[n],r,i;return n&&(r=n[e],i=e in n,delete n[e]),i?r:null},e.clearCustomData=function(){this.removeAllListeners();var e=this.$["data-cke-expando"];e&&delete t[e]},e.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())},CKEDITOR.event.implementOn(e)}(CKEDITOR.dom.domObject.prototype),CKEDITOR.dom.node=function(e){return e?new CKEDITOR.dom[e.nodeType==CKEDITOR.NODE_DOCUMENT?"document":e.nodeType==CKEDITOR.NODE_ELEMENT?"element":e.nodeType==CKEDITOR.NODE_TEXT?"text":e.nodeType==CKEDITOR.NODE_COMMENT?"comment":e.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](e):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(e,t){return e.append(this,t),e},clone:function(e,t){var n=this.$.cloneNode(e),r=function(n){n["data-cke-expando"]&&(n["data-cke-expando"]=!1);if(n.nodeType==CKEDITOR.NODE_ELEMENT){t||n.removeAttribute("id",!1);if(e)for(var n=n.childNodes,i=0;i<n.length;i++)r(n[i])}};return r(n),new CKEDITOR.dom.node(n)},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(e){return e.$.parentNode.insertBefore(this.$,e.$.nextSibling),e},insertBefore:function(e){return e.$.parentNode.insertBefore(this.$,e.$),e},insertBeforeMe:function(e){return this.$.parentNode.insertBefore(e.$,this.$),e},getAddress:function(e){for(var t=[],n=this.getDocument().$.documentElement,r=this.$;r&&r!=n;){var i=r.parentNode;i&&t.unshift(this.getIndex.call({$:r},e)),r=i}return t},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(e){function t(e,n){var r=n?e.nextSibling:e.previousSibling;return!r||r.nodeType!=CKEDITOR.NODE_TEXT?null:r.nodeValue?r:t(r,n)}var n=this.$,r=-1,i;if(!this.$.parentNode||e&&n.nodeType==CKEDITOR.NODE_TEXT&&!n.nodeValue&&!t(n)&&!t(n,!0))return-1;do if(!e||n==this.$||n.nodeType!=CKEDITOR.NODE_TEXT||!i&&!!n.nodeValue)r++,i=n.nodeType==CKEDITOR.NODE_TEXT;while(n=n.previousSibling);return r},getNextSourceNode:function(e,t,n){if(n&&!n.call)var r=n,n=function(e){return!e.equals(r)};var e=!e&&this.getFirst&&this.getFirst(),i;if(!e){if(this.type==CKEDITOR.NODE_ELEMENT&&n&&n(this,!0)===!1)return null;e=this.getNext()}for(;!e&&(i=(i||this).getParent());){if(n&&n(i,!0)===!1)return null;e=i.getNext()}return!e||n&&n(e)===!1?null:t&&t!=e.type?e.getNextSourceNode(!1,t,n):e},getPreviousSourceNode:function(e,t,n){if(n&&!n.call)var r=n,n=function(e){return!e.equals(r)};var e=!e&&this.getLast&&this.getLast(),i;if(!e){if(this.type==CKEDITOR.NODE_ELEMENT&&n&&n(this,!0)===!1)return null;e=this.getPrevious()}for(;!e&&(i=(i||this).getParent());){if(n&&n(i,!0)===!1)return null;e=i.getPrevious()}return!e||n&&n(e)===!1?null:t&&e.type!=t?e.getPreviousSourceNode(!1,t,n):e},getPrevious:function(e){var t=this.$,n;do n=(t=t.previousSibling)&&t.nodeType!=10&&new CKEDITOR.dom.node(t);while(n&&e&&!e(n));return n},getNext:function(e){var t=this.$,n;do n=(t=t.nextSibling)&&new CKEDITOR.dom.node(t);while(n&&e&&!e(n));return n},getParent:function(e){var t=this.$.parentNode;return t&&(t.nodeType==CKEDITOR.NODE_ELEMENT||e&&t.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(t):null},getParents:function(e){var t=this,n=[];do n[e?"push":"unshift"](t);while(t=t.getParent());return n},getCommonAncestor:function(e){if(e.equals(this))return this;if(e.contains&&e.contains(this))return e;var t=this.contains?this:this.getParent();do if(t.contains(e))return t;while(t=t.getParent());return null},getPosition:function(e){var t=this.$,n=e.$;if(t.compareDocumentPosition)return t.compareDocumentPosition(n);if(t==n)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&e.type==CKEDITOR.NODE_ELEMENT){if(t.contains){if(t.contains(n))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(n.contains(t))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in t)return t.sourceIndex<0||n.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:t.sourceIndex<n.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}for(var t=this.getAddress(),e=e.getAddress(),n=Math.min(t.length,e.length),r=0;r<=n-1;r++)if(t[r]!=e[r]){if(r<n)return t[r]<e[r]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;break}return t.length<e.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(e,t){var n=this.$,r,i;t||(n=n.parentNode),typeof e=="function"?(i=!0,r=e):(i=!1,r=function(t){return t=typeof t.nodeName=="string"?t.nodeName.toLowerCase():"",typeof e=="string"?t==e:t in e});for(;n;){if(r(i?new CKEDITOR.dom.node(n):n))return new CKEDITOR.dom.node(n);try{n=n.parentNode}catch(s){n=null}}return null},hasAscendant:function(e,t){var n=this.$;t||(n=n.parentNode);for(;n;){if(n.nodeName&&n.nodeName.toLowerCase()==e)return!0;n=n.parentNode}return!1},move:function(e,t){e.append(this.remove(),t)},remove:function(e){var t=this.$,n=t.parentNode;if(n){if(e)for(;e=t.firstChild;)n.insertBefore(t.removeChild(e),t);n.removeChild(t)}return this},replace:function(e){this.insertBefore(e),e.remove()},trim:function(){this.ltrim(),this.rtrim()},ltrim:function(){for(var e;this.getFirst&&(e=this.getFirst());){if(e.type==CKEDITOR.NODE_TEXT){var t=CKEDITOR.tools.ltrim(e.getText()),n=e.getLength();if(!t){e.remove();continue}t.length<n&&(e.split(n-t.length),this.$.removeChild(this.$.firstChild))}break}},rtrim:function(){for(var e;this.getLast&&(e=this.getLast());){if(e.type==CKEDITOR.NODE_TEXT){var t=CKEDITOR.tools.rtrim(e.getText()),n=e.getLength();if(!t){e.remove();continue}t.length<n&&(e.split(t.length),this.$.lastChild.parentNode.removeChild(this.$.lastChild))}break}CKEDITOR.env.needsBrFiller&&(e=this.$.lastChild)&&e.type==1&&e.nodeName.toLowerCase()=="br"&&e.parentNode.removeChild(e)},isReadOnly:function(){var e=this;this.type!=CKEDITOR.NODE_ELEMENT&&(e=this.getParent());if(e&&typeof e.$.isContentEditable!="undefined")return!e.$.isContentEditable&&!e.data("cke-editable");for(;e;){if(e.data("cke-editable"))break;if(e.getAttribute("contentEditable")=="false")return!0;if(e.getAttribute("contentEditable")=="true")break;e=e.getParent()}return!e}}),CKEDITOR.dom.window=function(e){CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var e=this.$.document,t=e.compatMode=="CSS1Compat";return{width:(t?e.documentElement.clientWidth:e.body.clientWidth)||0,height:(t?e.documentElement.clientHeight:e.body.clientHeight)||0}},getScrollPosition:function(){var e=this.$;return"pageXOffset"in e?{x:e.pageXOffset||0,y:e.pageYOffset||0}:(e=e.document,{x:e.documentElement.scrollLeft||e.body.scrollLeft||0,y:e.documentElement.scrollTop||e.body.scrollTop||0})},getFrame:function(){var e=this.$.frameElement;return e?new CKEDITOR.dom.element.get(e):null}}),CKEDITOR.dom.document=function(e){CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(e){if(this.$.createStyleSheet)this.$.createStyleSheet(e);else{var t=new CKEDITOR.dom.element("link");t.setAttributes({rel:"stylesheet",type:"text/css",href:e}),this.getHead().append(t)}},appendStyleText:function(e){if(this.$.createStyleSheet){var t=this.$.createStyleSheet("");t.cssText=e}else{var n=new CKEDITOR.dom.element("style",this);n.append(new CKEDITOR.dom.text(e,this)),this.getHead().append(n)}return t||n.$.sheet},createElement:function(e,t){var n=new CKEDITOR.dom.element(e,this);return t&&(t.attributes&&n.setAttributes(t.attributes),t.styles&&n.setStyles(t.styles)),n},createText:function(e){return new CKEDITOR.dom.text(e,this)},focus:function(){this.getWindow().focus()},getActive:function(){var e;try{e=this.$.activeElement}catch(t){return null}return new CKEDITOR.dom.element(e)},getById:function(e){return(e=this.$.getElementById(e))?new CKEDITOR.dom.element(e):null},getByAddress:function(e,t){for(var n=this.$.documentElement,r=0;n&&r<e.length;r++){var i=e[r];if(t)for(var s=-1,o=0;o<n.childNodes.length;o++){var u=n.childNodes[o];if(t!==!0||u.nodeType!=3||!u.previousSibling||u.previousSibling.nodeType!=3){s++;if(s==i){n=u;break}}}else n=n.childNodes[i]}return n?new CKEDITOR.dom.node(n):null},getElementsByTag:function(e,t){return!(CKEDITOR.env.ie&&document.documentMode<=8)&&t&&(e=t+":"+e),new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(e))},getHead:function(){var e=this.$.getElementsByTagName("head")[0];return e=e?new CKEDITOR.dom.element(e):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},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(e){this.$.open("text/html","replace"),CKEDITOR.env.ie&&(e=e.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$&\n<script data-cke-temp="1">('+CKEDITOR.tools.fixDomain+")();</script>")),this.$.write(e),this.$.close()},find:function(e){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e))},findOne:function(e){return(e=this.$.querySelector(e))?new CKEDITOR.dom.element(e):null},_getHtml5ShivFrag:function(){var e=this.getCustomData("html5ShivFrag");return e||(e=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(e,!0),this.setCustomData("html5ShivFrag",e)),e}}),CKEDITOR.dom.nodeList=function(e){this.$=e},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(e){return e<0||e>=this.$.length?null:(e=this.$[e])?new CKEDITOR.dom.node(e):null}},CKEDITOR.dom.element=function(e,t){typeof e=="string"&&(e=(t?t.$:document).createElement(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.element.get=function(e){return(e=typeof e=="string"?document.getElementById(e)||document.getElementsByName(e)[0]:e)&&(e.$?e:new CKEDITOR.dom.element(e))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(e,t){var n=new CKEDITOR.dom.element("div",t);return n.setHtml(e),n.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(e,t,n,r){var i=t.getCustomData("list_marker_id")||t.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),s=t.getCustomData("list_marker_names")||t.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");return e[i]=t,s[n]=1,t.setCustomData(n,r)},CKEDITOR.dom.element.clearAllMarkers=function(e){for(var t in e)CKEDITOR.dom.element.clearMarkers(e,e[t],1)},CKEDITOR.dom.element.clearMarkers=function(e,t,n){var r=t.getCustomData("list_marker_names"),i=t.getCustomData("list_marker_id"),s;for(s in r)t.removeCustomData(s);t.removeCustomData("list_marker_names"),n&&(t.removeCustomData("list_marker_id"),delete e[i])},function(){function e(e){var t=!0;return e.$.id||(e.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),t=!1),function(){t||e.removeAttribute("id")}}function t(e,t){return"#"+e.$.id+" "+t.split(/,\s*/).join(", #"+e.$.id+" ")}function n(e){for(var t=0,n=0,i=r[e].length;n<i;n++)t+=parseInt(this.getComputedStyle(r[e][n])||0,10)||0;return t}CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:function(e){var t=this.$.className;return t&&(RegExp("(?:^|\\s)"+e+"(?:\\s|$)","").test(t)||(t+=" "+e)),this.$.className=t||e,this},removeClass:function(e){var t=this.getAttribute("class");return t&&(e=RegExp("(?:^|\\s+)"+e+"(?=\\s|$)","i"),e.test(t)&&((t=t.replace(e,"").replace(/^\s+/,""))?this.setAttribute("class",t):this.removeAttribute("class"))),this},hasClass:function(e){return RegExp("(?:^|\\s+)"+e+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(e,t){return typeof e=="string"&&(e=this.getDocument().createElement(e)),t?this.$.insertBefore(e.$,this.$.firstChild):this.$.appendChild(e.$),e},appendHtml:function(e){if(this.$.childNodes.length){var t=new CKEDITOR.dom.element("div",this.getDocument());t.setHtml(e),t.moveChildren(this)}else this.setHtml(e)},appendText:function(e){this.$.text!=null?this.$.text=this.$.text+e:this.append(new CKEDITOR.dom.text(e))},appendBogus:function(e){if(e||CKEDITOR.env.needsBrFiller){for(e=this.getLast();e&&e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(e.getText());)e=e.getPrevious();if(!e||!e.is||!e.is("br"))e=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&e.setAttribute("type","_moz"),this.append(e)}},breakParent:function(e){var t=new CKEDITOR.dom.range(this.getDocument());t.setStartAfter(this),t.setEndAfter(e),e=t.extractContents(),t.insertNode(this.remove()),e.insertAfterNode(this)},contains:CKEDITOR.env.ie||CKEDITOR.env.webkit?function(e){var t=this.$;return e.type!=CKEDITOR.NODE_ELEMENT?t.contains(e.getParent().$):t!=e.$&&t.contains(e.$)}:function(e){return!!(this.$.compareDocumentPosition(e.$)&16)},focus:function(){function e(){try{this.$.focus()}catch(e){}}return function(t){t?CKEDITOR.tools.setTimeout(e,100,this):e.call(this)}}(),getHtml:function(){var e=this.$.innerHTML;return CKEDITOR.env.ie?e.replace(/<\?[^>]*>/g,""):e},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var e=this.$.ownerDocument.createElement("div");return e.appendChild(this.$.cloneNode(!0)),e.innerHTML},getClientRect:function(){var e=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());return!e.width&&(e.width=e.right-e.left),!e.height&&(e.height=e.bottom-e.top),e},setHtml:CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(e){try{var t=this.$;if(this.getParent())return t.innerHTML=e;var n=this.getDocument()._getHtml5ShivFrag();return n.appendChild(t),t.innerHTML=e,n.removeChild(t),e}catch(r){this.$.innerHTML="",t=new CKEDITOR.dom.element("body",this.getDocument()),t.$.innerHTML=e;for(t=t.getChildren();t.count();)this.append(t.getItem(0));return e}}:function(e){return this.$.innerHTML=e},setText:function(){var e=document.createElement("p");return e.innerHTML="x",e=e.textContent,function(t){this.$[e?"textContent":"innerText"]=t}}(),getAttribute:function(){var e=function(e){return this.$.getAttribute(e,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(e){switch(e){case"class":e="className";break;case"http-equiv":e="httpEquiv";break;case"name":return this.$.name;case"tabindex":return e=this.$.getAttribute(e,2),e!==0&&this.$.tabIndex===0&&(e=null),e;case"checked":return e=this.$.attributes.getNamedItem(e),(e.specified?e.nodeValue:this.$.checked)?"checked":null;case"hspace":case"value":return this.$[e];case"style":return this.$.style.cssText;case"contenteditable":case"contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(e,2)}:e}(),getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:CKEDITOR.env.ie?function(e){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(e)]}:function(e){var t=this.getWindow().$.getComputedStyle(this.$,null);return t?t.getPropertyValue(e):""},getDtd:function(){var e=CKEDITOR.dtd[this.getName()];return this.getDtd=function(){return e},e},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:CKEDITOR.env.ie?function(){var e=this.$.tabIndex;return e===0&&!CKEDITOR.dtd.$tabIndex[this.getName()]&&parseInt(this.getAttribute("tabindex"),10)!==0&&(e=-1),e}:CKEDITOR.env.webkit?function(){var e=this.$.tabIndex;return e===void 0&&(e=parseInt(this.getAttribute("tabindex"),10),isNaN(e)&&(e=-1)),e}: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 e=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&document.documentMode<=8){var t=this.$.scopeName;t!="HTML"&&(e=t.toLowerCase()+":"+e)}return this.getName=function(){return e},this.getName()},getValue:function(){return this.$.value},getFirst:function(e){var t=this.$.firstChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getNext(e)),t},getLast:function(e){var t=this.$.lastChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getPrevious(e)),t},getStyle:function(e){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(e)]},is:function(){var e=this.getName();if(typeof arguments[0]=="object")return!!arguments[0][e];for(var t=0;t<arguments.length;t++)if(arguments[t]==e)return!0;return!1},isEditable:function(e){var t=this.getName();return this.isReadOnly()||this.getComputedStyle("display")=="none"||this.getComputedStyle("visibility")=="hidden"||CKEDITOR.dtd.$nonEditable[t]||CKEDITOR.dtd.$empty[t]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount()?!1:e!==!1?(e=CKEDITOR.dtd[t]||CKEDITOR.dtd.span,!!e&&!!e["#"]):!0},isIdentical:function(e){var t=this.clone(0,1),e=e.clone(0,1);t.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]),e.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(t.$.isEqualNode)return t.$.style.cssText=CKEDITOR.tools.normalizeCssText(t.$.style.cssText),e.$.style.cssText=CKEDITOR.tools.normalizeCssText(e.$.style.cssText),t.$.isEqualNode(e.$);t=t.getOuterHtml(),e=e.getOuterHtml();if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&this.is("a")){var n=this.getParent();n.type==CKEDITOR.NODE_ELEMENT&&(n=n.clone(),n.setHtml(t),t=n.getHtml(),n.setHtml(e),e=n.getHtml())}return t==e},isVisible:function(){var e=(this.$.offsetHeight||this.$.offsetWidth)&&this.getComputedStyle("visibility")!="hidden",t,n;return e&&CKEDITOR.env.webkit&&(t=this.getWindow(),!t.equals(CKEDITOR.document.getWindow())&&(n=t.$.frameElement)&&(e=(new CKEDITOR.dom.element(n)).isVisible())),!!e},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;for(var e=this.getChildren(),t=0,n=e.count();t<n;t++){var r=e.getItem(t);if((r.type!=CKEDITOR.NODE_ELEMENT||!r.data("cke-bookmark"))&&(r.type==CKEDITOR.NODE_ELEMENT&&!r.isEmptyInlineRemoveable()||r.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(r.getText())))return!1}return!0},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var e=this.$.attributes,t=0;t<e.length;t++){var n=e[t];switch(n.nodeName){case"class":if(this.getAttribute("class"))return!0;case"data-cke-expando":continue;default:if(n.specified)return!0}}return!1}:function(){var e=this.$.attributes,t=e.length,n={"data-cke-expando":1,_moz_dirty:1};return t>0&&(t>2||!n[e[0].nodeName]||t==2&&!n[e[1].nodeName])},hasAttribute:function(){function e(e){var t=this.$.attributes.getNamedItem(e);if(this.getName()=="input")switch(e){case"class":return this.$.className.length>0;case"checked":return!!this.$.checked;case"value":return e=this.getAttribute("type"),e=="checkbox"||e=="radio"?this.$.value!="on":!!this.$.value}return t?t.specified:!1}return CKEDITOR.env.ie?CKEDITOR.env.version<8?function(t){return t=="name"?!!this.$.name:e.call(this,t)}:e:function(e){return!!this.$.attributes.getNamedItem(e)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(e,t){var n=this.$,e=e.$;if(n!=e){var r;if(t)for(;r=n.lastChild;)e.insertBefore(n.removeChild(r),e.firstChild);else for(;r=n.firstChild;)e.appendChild(n.removeChild(r))}},mergeSiblings:function(){function e(e,t,n){if(t&&t.type==CKEDITOR.NODE_ELEMENT){for(var r=[];t.data("cke-bookmark")||t.isEmptyInlineRemoveable();){r.push(t),t=n?t.getNext():t.getPrevious();if(!t||t.type!=CKEDITOR.NODE_ELEMENT)return}if(e.isIdentical(t)){for(var i=n?e.getLast():e.getFirst();r.length;)r.shift().move(e,!n);t.moveChildren(e,!n),t.remove(),i&&i.type==CKEDITOR.NODE_ELEMENT&&i.mergeSiblings()}}}return function(t){if(t===!1||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))e(this,this.getNext(),!0),e(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var e=function(e,t){return this.$.setAttribute(e,t),this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(t,n){return t=="class"?this.$.className=n:t=="style"?this.$.style.cssText=n:t=="tabindex"?this.$.tabIndex=n:t=="checked"?this.$.checked=n:t=="contenteditable"?e.call(this,"contentEditable",n):e.apply(this,arguments),this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(t,n){if(t=="src"&&n.match(/^http:\/\//))try{e.apply(this,arguments)}catch(r){}else e.apply(this,arguments);return this}:e}(),setAttributes:function(e){for(var t in e)this.setAttribute(t,e[t]);return this},setValue:function(e){return this.$.value=e,this},removeAttribute:function(){var e=function(e){this.$.removeAttribute(e)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(e){e=="class"?e="className":e=="tabindex"?e="tabIndex":e=="contenteditable"&&(e="contentEditable"),this.$.removeAttribute(e)}:e}(),removeAttributes:function(e){if(CKEDITOR.tools.isArray(e))for(var t=0;t<e.length;t++)this.removeAttribute(e[t]);else for(t in e)e.hasOwnProperty(t)&&this.removeAttribute(t)},removeStyle:function(e){var t=this.$.style;if(!!t.removeProperty||e!="border"&&e!="margin"&&e!="padding")t.removeProperty?t.removeProperty(e):t.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(e)),this.$.style.cssText||this.removeAttribute("style");else{var n=["top","left","right","bottom"],r;e=="border"&&(r=["color","style","width"]);for(var t=[],i=0;i<n.length;i++)if(r)for(var s=0;s<r.length;s++)t.push([e,n[i],r[s]].join("-"));else t.push([e,n[i]].join("-"));for(e=0;e<t.length;e++)this.removeStyle(t[e])}},setStyle:function(e,t){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(e)]=t,this},setStyles:function(e){for(var t in e)this.setStyle(t,e[t]);return this},setOpacity:function(e){CKEDITOR.env.ie&&CKEDITOR.env.version<9?(e=Math.round(e*100),this.setStyle("filter",e>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+e+")")):this.setStyle("opacity",e)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var e,t=this.getElementsByTag("*"),n=0,r=t.count();n<r;n++)e=t.getItem(n),e.setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var e=this;e.getName()!="html";){if(e.getComputedStyle("position")!="static")return e;e=e.getParent()}return null},getDocumentPosition:function(e){var t=0,n=0,r=this.getDocument(),i=r.getBody(),s=CKEDITOR.env.quirks;if(document.documentElement.getBoundingClientRect){var o=this.$.getBoundingClientRect(),u=r.$.documentElement,a=u.clientTop||i.$.clientTop||0,f=u.clientLeft||i.$.clientLeft||0,l=!0;CKEDITOR.env.ie&&(l=r.getDocumentElement().contains(this),r=r.getBody().contains(this),l=s&&r||!s&&l),l&&(CKEDITOR.env.webkit?(t=i.$.scrollLeft||u.scrollLeft,n=i.$.scrollTop||u.scrollTop):(n=s?i.$:u,t=n.scrollLeft,n=n.scrollTop),t=o.left+t-f,n=o.top+n-a)}else{a=this;for(f=null;a&&a.getName()!="body"&&a.getName()!="html";){t+=a.$.offsetLeft-a.$.scrollLeft,n+=a.$.offsetTop-a.$.scrollTop,a.equals(this)||(t+=a.$.clientLeft||0,n+=a.$.clientTop||0);for(;f&&!f.equals(a);)t-=f.$.scrollLeft,n-=f.$.scrollTop,f=f.getParent();f=a,a=(o=a.$.offsetParent)?new CKEDITOR.dom.element(o):null}}return e&&(o=this.getWindow(),a=e.getWindow(),!o.equals(a)&&o.$.frameElement&&(e=(new CKEDITOR.dom.element(o.$.frameElement)).getDocumentPosition(e),t+=e.x,n+=e.y)),!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!s&&(t+=this.$.clientLeft?1:0,n+=this.$.clientTop?1:0),{x:t,y:n}},scrollIntoView:function(e){var t=this.getParent();if(t)do{(t.$.clientWidth&&t.$.clientWidth<t.$.scrollWidth||t.$.clientHeight&&t.$.clientHeight<t.$.scrollHeight)&&!t.is("body")&&this.scrollIntoParent(t,e,1);if(t.is("html")){var n=t.getWindow();try{var r=n.$.frameElement;r&&(t=new CKEDITOR.dom.element(r))}catch(i){}}}while(t=t.getParent())},scrollIntoParent:function(e,t,n){function u(t,n){/body|html/.test(e.getName())?e.getWindow().$.scrollBy(t,n):(e.$.scrollLeft=e.$.scrollLeft+t,e.$.scrollTop=e.$.scrollTop+n)}function a(e,t){var n={x:0,y:0};if(!e.is(l?"body":"html")){var r=e.$.getBoundingClientRect();n.x=r.left,n.y=r.top}return r=e.getWindow(),r.equals(t)||(r=a(CKEDITOR.dom.element.get(r.$.frameElement),t),n.x=n.x+r.x,n.y=n.y+r.y),n}function f(e,t){return parseInt(e.getComputedStyle("margin-"+t)||0,10)||0}var r,i,s,o;!e&&(e=this.getWindow()),s=e.getDocument();var l=s.$.compatMode=="BackCompat";e instanceof CKEDITOR.dom.window&&(e=l?s.getBody():s.getDocumentElement()),s=e.getWindow(),i=a(this,s);var c=a(e,s),h=this.$.offsetHeight;r=this.$.offsetWidth;var p=e.$.clientHeight,d=e.$.clientWidth;s=i.x-f(this,"left")-c.x||0,o=i.y-f(this,"top")-c.y||0,r=i.x+r+f(this,"right")-(c.x+d)||0,i=i.y+h+f(this,"bottom")-(c.y+p)||0,(o<0||i>0)&&u(0,t===!0?o:t===!1?i:o<0?o:i),n&&(s<0||r>0)&&u(s<0?s:r,0)},setState:function(e,t,n){t=t||"cke";switch(e){case CKEDITOR.TRISTATE_ON:this.addClass(t+"_on"),this.removeClass(t+"_off"),this.removeClass(t+"_disabled"),n&&this.setAttribute("aria-pressed",!0),n&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(t+"_disabled"),this.removeClass(t+"_off"),this.removeClass(t+"_on"),n&&this.setAttribute("aria-disabled",!0),n&&this.removeAttribute("aria-pressed");break;default:this.addClass(t+"_off"),this.removeClass(t+"_on"),this.removeClass(t+"_disabled"),n&&this.removeAttribute("aria-pressed"),n&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var e=this.$;try{e.contentWindow.document}catch(t){e.src=e.src}return e&&new CKEDITOR.dom.document(e.contentWindow.document)},copyAttributes:function(e,t){for(var n=this.$.attributes,t=t||{},r=0;r<n.length;r++){var i=n[r],s=i.nodeName.toLowerCase(),o;if(!(s in t))if(s=="checked"&&(o=this.getAttribute(s)))e.setAttribute(s,o);else if(!CKEDITOR.env.ie||this.hasAttribute(s))o=this.getAttribute(s),o===null&&(o=i.nodeValue),e.setAttribute(s,o)}this.$.style.cssText!==""&&(e.$.style.cssText=this.$.style.cssText)},renameNode:function(e){if(this.getName()!=e){var t=this.getDocument(),e=new CKEDITOR.dom.element(e,t);this.copyAttributes(e),this.moveChildren(e),this.getParent()&&this.$.parentNode.replaceChild(e.$,this.$),e.$["data-cke-expando"]=this.$["data-cke-expando"],this.$=e.$,delete this.getName}},getChild:function(){function e(e,t){var n=e.childNodes;if(t>=0&&t<n.length)return n[t]}return function(t){var n=this.$;if(t.slice)for(;t.length>0&&n;)n=e(n,t.shift());else n=e(n,t);return n?new CKEDITOR.dom.node(n):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(e){e.data.getTarget().hasClass("cke_enable_context_menu")||e.data.preventDefault()})},getDirection:function(e){return e?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(e,t){return e="data-"+e,t===void 0?this.getAttribute(e):(t===!1?this.removeAttribute(e):this.setAttribute(e,t),null)},getEditor:function(){var e=CKEDITOR.instances,t,n;for(t in e){n=e[t];if(n.element.equals(this)&&n.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return n}return null},find:function(n){var r=e(this),n=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(t(this,n)));return r(),n},findOne:function(n){var r=e(this),n=this.$.querySelector(t(this,n));return r(),n?new CKEDITOR.dom.element(n):null},forEach:function(e,t,n){if(!n&&(!t||this.type==t))var r=e(this);if(r!==!1)for(var n=this.getChildren(),i=0;i<n.count();i++)r=n.getItem(i),r.type==CKEDITOR.NODE_ELEMENT?r.forEach(e,t):(!t||r.type==t)&&e(r)}});var r={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(e,t,r){typeof t=="number"&&(r&&(!CKEDITOR.env.ie||!CKEDITOR.env.quirks)&&(t-=n.call(this,e)),this.setStyle(e,t+"px"))},CKEDITOR.dom.element.prototype.getSize=function(e,t){var r=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(e)],this.$["client"+CKEDITOR.tools.capitalize(e)])||0;return t&&(r-=n.call(this,e)),r}}(),CKEDITOR.dom.documentFragment=function(e){e=e||CKEDITOR.document,this.$=e.type==CKEDITOR.NODE_DOCUMENT?e.$.createDocumentFragment():e},CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(e){e=e.$,e.parentNode.insertBefore(this.$,e.nextSibling)}},!0,{append:1,appendBogus:1,getFirst: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}),function(){function e(e,t){var n=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(n.collapsed)return this.end(),null;n.optimize()}var r,i=n.startContainer;r=n.endContainer;var s=n.startOffset,o=n.endOffset,u,a=this.guard,f=this.type,l=e?"getPreviousSourceNode":"getNextSourceNode";if(!e&&!this._.guardLTR){var c=r.type==CKEDITOR.NODE_ELEMENT?r:r.getParent(),h=r.type==CKEDITOR.NODE_ELEMENT?r.getChild(o):r.getNext();this._.guardLTR=function(e,t){return(!t||!c.equals(e))&&(!h||!e.equals(h))&&(e.type!=CKEDITOR.NODE_ELEMENT||!t||!e.equals(n.root))}}if(e&&!this._.guardRTL){var p=i.type==CKEDITOR.NODE_ELEMENT?i:i.getParent(),d=i.type==CKEDITOR.NODE_ELEMENT?s?i.getChild(s-1):null:i.getPrevious();this._.guardRTL=function(e,t){return(!t||!p.equals(e))&&(!d||!e.equals(d))&&(e.type!=CKEDITOR.NODE_ELEMENT||!t||!e.equals(n.root))}}var v=e?this._.guardRTL:this._.guardLTR;u=a?function(e,t){return v(e,t)===!1?!1:a(e,t)}:v,this.current?r=this.current[l](!1,f,u):(e?r.type==CKEDITOR.NODE_ELEMENT&&(r=o>0?r.getChild(o-1):u(r,!0)===!1?null:r.getPreviousSourceNode(!0,f,u)):(r=i,r.type==CKEDITOR.NODE_ELEMENT&&!(r=r.getChild(s))&&(r=u(i,!0)===!1?null:i.getNextSourceNode(!0,f,u))),r&&u(r)===!1&&(r=null));for(;r&&!this._.end;){this.current=r;if(!this.evaluator||this.evaluator(r)!==!1){if(!t)return r}else if(t&&this.evaluator)return!1;r=r[l](!1,f,u)}return this.end(),this.current=null}function t(t){for(var n,r=null;n=e.call(this,t);)r=n;return r}function n(e){if(f(e))return!1;if(e.type==CKEDITOR.NODE_TEXT)return!0;if(e.type==CKEDITOR.NODE_ELEMENT){if(e.is(CKEDITOR.dtd.$inline)||e.is("hr")||e.getAttribute("contenteditable")=="false")return!0;var t;if(t=!CKEDITOR.env.needsBrFiller)if(t=e.is(l))e:{t=0;for(var n=e.getChildCount();t<n;++t)if(!f(e.getChild(t))){t=!1;break e}t=!0}if(t)return!0}return!1}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(e){this.range=e,this._={}},proto:{end:function(){this._.end=1},next:function(){return e.call(this)},previous:function(){return e.call(this,1)},checkForward:function(){return e.call(this,0,1)!==!1},checkBackward:function(){return e.call(this,1,1)!==!1},lastForward:function(){return t.call(this)},lastBackward:function(){return t.call(this,1)},reset:function(){delete this.current,this._={}}}});var r={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},i={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(e){return this.getComputedStyle("float")!="none"||this.getComputedStyle("position")in i||!r[this.getComputedStyle("display")]?!!(this.is(CKEDITOR.dtd.$block)||e&&this.is(e)):!0},CKEDITOR.dom.walker.blockBoundary=function(e){return function(t){return t.type!=CKEDITOR.NODE_ELEMENT||!t.isBlockBoundary(e)}},CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})},CKEDITOR.dom.walker.bookmark=function(e,t){function n(e){return e&&e.getName&&e.getName()=="span"&&e.data("cke-bookmark")}return function(r){var i,s;return i=r&&r.type!=CKEDITOR.NODE_ELEMENT&&(s=r.getParent())&&n(s),i=e?i:i||n(r),!!(t^i)}},CKEDITOR.dom.walker.whitespaces=function(e){return function(t){var n;return t&&t.type==CKEDITOR.NODE_TEXT&&(n=!CKEDITOR.tools.trim(t.getText())||CKEDITOR.env.webkit&&t.getText()=="​"),!!(e^n)}},CKEDITOR.dom.walker.invisible=function(e){var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.env.webkit?1:0;return function(r){return t(r)?r=1:(r.type==CKEDITOR.NODE_TEXT&&(r=r.getParent()),r=r.$.offsetWidth<=n),!!(e^r)}},CKEDITOR.dom.walker.nodeType=function(e,t){return function(n){return!!(t^n.type==e)}},CKEDITOR.dom.walker.bogus=function(e){function t(e){return!o(e)&&!u(e)}return function(n){var r=CKEDITOR.env.needsBrFiller?n.is&&n.is("br"):n.getText&&s.test(n.getText());return r&&(r=n.getParent(),n=n.getNext(t),r=r.isBlockBoundary()&&(!n||n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary())),!!(e^r)}},CKEDITOR.dom.walker.temp=function(e){return function(t){return t.type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent()),t=t&&t.hasAttribute("data-cke-temp"),!!(e^t)}};var s=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,o=CKEDITOR.dom.walker.whitespaces(),u=CKEDITOR.dom.walker.bookmark(),a=CKEDITOR.dom.walker.temp();CKEDITOR.dom.walker.ignored=function(e){return function(t){return t=o(t)||u(t)||a(t),!!(e^t)}};var f=CKEDITOR.dom.walker.ignored(),l=function(e){var t={},n;for(n in e)CKEDITOR.dtd[n]["#"]&&(t[n]=1);return t}(CKEDITOR.dtd.$block);CKEDITOR.dom.walker.editable=function(e){return function(t){return!!(e^n(t))}},CKEDITOR.dom.element.prototype.getBogus=function(){var e=this;do e=e.getPreviousSourceNode();while(u(e)||o(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$inline)&&!e.is(CKEDITOR.dtd.$empty));return e&&(CKEDITOR.env.needsBrFiller?e.is&&e.is("br"):e.getText&&s.test(e.getText()))?e:!1}}(),CKEDITOR.dom.range=function(e){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null,this.collapsed=!0;var t=e instanceof CKEDITOR.dom.document;this.document=t?e:e.getDocument(),this.root=t?e.getBody():e},function(){function e(){var e=!1,t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(!0),r=CKEDITOR.dom.walker.bogus();return function(i){return n(i)||t(i)?!0:r(i)&&!e?e=!0:i.type==CKEDITOR.NODE_TEXT&&(i.hasAscendant("pre")||CKEDITOR.tools.trim(i.getText()).length)||i.type==CKEDITOR.NODE_ELEMENT&&!i.is(s)?!1:!0}}function t(e){var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(1);return function(r){return n(r)||t(r)?!0:!e&&o(r)||r.type==CKEDITOR.NODE_ELEMENT&&r.is(CKEDITOR.dtd.$removeEmpty)}}function n(e){return function(){var t;return this[e?"getPreviousNode":"getNextNode"](function(e){return!t&&f(e)&&(t=e),a(e)&&(!o(e)||!e.equals(t))})}}var r=function(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer.equals(e.endContainer)&&e.startOffset==e.endOffset},i=function(e,t,n,r){e.optimizeBookmark();var i=e.startContainer,s=e.endContainer,o=e.startOffset,u=e.endOffset,a,f;s.type==CKEDITOR.NODE_TEXT?s=s.split(u):s.getChildCount()>0&&(u>=s.getChildCount()?(s=s.append(e.document.createText("")),f=!0):s=s.getChild(u)),i.type==CKEDITOR.NODE_TEXT?(i.split(o),i.equals(s)&&(s=i.getNext())):o?o>=i.getChildCount()?(i=i.append(e.document.createText("")),a=!0):i=i.getChild(o).getPrevious():(i=i.append(e.document.createText(""),1),a=!0);var o=i.getParents(),u=s.getParents(),l,c,h;for(l=0;l<o.length;l++){c=o[l],h=u[l];if(!c.equals(h))break}for(var p=n,d,v,m,g=l;g<o.length;g++){d=o[g],p&&!d.equals(i)&&(v=p.append(d.clone()));for(d=d.getNext();d;){if(d.equals(u[g])||d.equals(s))break;m=d.getNext(),t==2?p.append(d.clone(!0)):(d.remove(),t==1&&p.append(d)),d=m}p&&(p=v)}p=n;for(n=l;n<u.length;n++){d=u[n],t>0&&!d.equals(s)&&(v=p.append(d.clone()));if(!o[n]||d.$.parentNode!=o[n].$.parentNode)for(d=d.getPrevious();d;){if(d.equals(o[n])||d.equals(i))break;m=d.getPrevious(),t==2?p.$.insertBefore(d.$.cloneNode(!0),p.$.firstChild):(d.remove(),t==1&&p.$.insertBefore(d.$,p.$.firstChild)),d=m}p&&(p=v)}t==2?(c=e.startContainer,c.type==CKEDITOR.NODE_TEXT&&(c.$.data=c.$.data+c.$.nextSibling.data,c.$.parentNode.removeChild(c.$.nextSibling)),e=e.endContainer,e.type==CKEDITOR.NODE_TEXT&&e.$.nextSibling&&(e.$.data=e.$.data+e.$.nextSibling.data,e.$.parentNode.removeChild(e.$.nextSibling))):(c&&h&&(i.$.parentNode!=c.$.parentNode||s.$.parentNode!=h.$.parentNode)&&(t=h.getIndex(),a&&h.$.parentNode==i.$.parentNode&&t--,r&&c.type==CKEDITOR.NODE_ELEMENT?(r=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',e.document),r.insertAfter(c),c.mergeSiblings(!1),e.moveToBookmark({startNode:r})):e.setStart(h.getParent(),t)),e.collapse(!0)),a&&i.remove(),f&&s.$.parentNode&&s.remove()},s={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},o=CKEDITOR.dom.walker.bogus(),u=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,a=CKEDITOR.dom.walker.editable(),f=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var e=new CKEDITOR.dom.range(this.root);return e._setStartContainer(this.startContainer),e.startOffset=this.startOffset,e._setEndContainer(this.endContainer),e.endOffset=this.endOffset,e.collapsed=this.collapsed,e},collapse:function(e){e?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset),this.collapsed=!0},cloneContents:function(){var e=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||i(this,2,e),e},deleteContents:function(e){this.collapsed||i(this,0,null,e)},extractContents:function(e){var t=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||i(this,1,t,e),t},createBookmark:function(e){var t,n,r,i,s=this.collapsed;return t=this.document.createElement("span"),t.data("cke-bookmark",1),t.setStyle("display","none"),t.setHtml("&nbsp;"),e&&(r="cke_bm_"+CKEDITOR.tools.getNextNumber(),t.setAttribute("id",r+(s?"C":"S"))),s||(n=t.clone(),n.setHtml("&nbsp;"),e&&n.setAttribute("id",r+"E"),i=this.clone(),i.collapse(),i.insertNode(n)),i=this.clone(),i.collapse(!0),i.insertNode(t),n?(this.setStartAfter(t),this.setEndBefore(n)):this.moveToPosition(t,CKEDITOR.POSITION_AFTER_END),{startNode:e?r+(s?"C":"S"):t,endNode:e?r+"E":n,serializable:e,collapsed:s}},createBookmark2:function(){function e(e){var n=e.container,r=e.offset,i;i=n;var s=r;i=i.type!=CKEDITOR.NODE_ELEMENT||s===0||s==i.getChildCount()?0:i.getChild(s-1).type==CKEDITOR.NODE_TEXT&&i.getChild(s).type==CKEDITOR.NODE_TEXT,i&&(n=n.getChild(r-1),r=n.getLength()),n.type==CKEDITOR.NODE_ELEMENT&&r>1&&(r=n.getChild(r-1).getIndex(!0)+1);if(n.type==CKEDITOR.NODE_TEXT){i=n;for(s=0;(i=i.getPrevious())&&i.type==CKEDITOR.NODE_TEXT;)s+=i.getLength();i=s,n.getText()?r+=i:(s=n.getPrevious(t),i?(r=i,n=s?s.getNext():n.getParent().getFirst()):(n=n.getParent(),r=s?s.getIndex(!0)+1:0))}e.container=n,e.offset=r}var t=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(t){var n=this.collapsed,r={container:this.startContainer,offset:this.startOffset},i={container:this.endContainer,offset:this.endOffset};return t&&(e(r),n||e(i)),{start:r.container.getAddress(t),end:n?null:i.container.getAddress(t),startOffset:r.offset,endOffset:i.offset,normalized:t,collapsed:n,is2:!0}}}(),moveToBookmark:function(e){if(e.is2){var t=this.document.getByAddress(e.start,e.normalized),n=e.startOffset,r=e.end&&this.document.getByAddress(e.end,e.normalized),e=e.endOffset;this.setStart(t,n),r?this.setEnd(r,e):this.collapse(!0)}else t=(n=e.serializable)?this.document.getById(e.startNode):e.startNode,e=n?this.document.getById(e.endNode):e.endNode,this.setStartBefore(t),t.remove(),e?(this.setEndBefore(e),e.remove()):this.collapse(!0)},getBoundaryNodes:function(){var e=this.startContainer,t=this.endContainer,n=this.startOffset,r=this.endOffset,i;if(e.type==CKEDITOR.NODE_ELEMENT){i=e.getChildCount();if(i>n)e=e.getChild(n);else if(i<1)e=e.getPreviousSourceNode();else{for(e=e.$;e.lastChild;)e=e.lastChild;e=new CKEDITOR.dom.node(e),e=e.getNextSourceNode()||e}}if(t.type==CKEDITOR.NODE_ELEMENT){i=t.getChildCount();if(i>r)t=t.getChild(r).getPreviousSourceNode(!0);else if(i<1)t=t.getPreviousSourceNode();else{for(t=t.$;t.lastChild;)t=t.lastChild;t=new CKEDITOR.dom.node(t)}}return e.getPosition(t)&CKEDITOR.POSITION_FOLLOWING&&(e=t),{startNode:e,endNode:t}},getCommonAncestor:function(e,t){var n=this.startContainer,r=this.endContainer,n=n.equals(r)?e&&n.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?n.getChild(this.startOffset):n:n.getCommonAncestor(r);return t&&!n.is?n.getParent():n},optimize:function(){var e=this.startContainer,t=this.startOffset;e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setStartAfter(e):this.setStartBefore(e)),e=this.endContainer,t=this.endOffset,e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setEndAfter(e):this.setEndBefore(e))},optimizeBookmark:function(){var e=this.startContainer,t=this.endContainer;e.is&&e.is("span")&&e.data("cke-bookmark")&&this.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),t&&t.is&&t.is("span")&&t.data("cke-bookmark")&&this.setEndAt(t,CKEDITOR.POSITION_AFTER_END)},trim:function(e,t){var n=this.startContainer,r=this.startOffset,i=this.collapsed;if((!e||i)&&n&&n.type==CKEDITOR.NODE_TEXT){if(r)if(r>=n.getLength())r=n.getIndex()+1,n=n.getParent();else{var s=n.split(r),r=n.getIndex()+1,n=n.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(s,this.endOffset-this.startOffset):n.equals(this.endContainer)&&(this.endOffset=this.endOffset+1)}else r=n.getIndex(),n=n.getParent();this.setStart(n,r);if(i){this.collapse(!0);return}}n=this.endContainer,r=this.endOffset,!t&&!i&&n&&n.type==CKEDITOR.NODE_TEXT&&(r?(r>=n.getLength()||n.split(r),r=n.getIndex()+1):r=n.getIndex(),n=n.getParent(),this.setEnd(n,r))},enlarge:function(e,t){function n(e){return e&&e.type==CKEDITOR.NODE_ELEMENT&&e.hasAttribute("contenteditable")?null:e}var r=RegExp(/[^\s\ufeff]/);switch(e){case CKEDITOR.ENLARGE_INLINE:var i=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var s=this.getCommonAncestor(),o=this.root,u,a,f,l,c,h=!1,p,d;p=this.startContainer;var v=this.startOffset;p.type==CKEDITOR.NODE_TEXT?(v&&(p=!CKEDITOR.tools.trim(p.substring(0,v)).length&&p,h=!!p),p&&!(l=p.getPrevious())&&(f=p.getParent())):(v&&(l=p.getChild(v-1)||p.getLast()),l||(f=p));for(f=n(f);f||l;){if(f&&!l){!c&&f.equals(s)&&(c=!0);if(i?f.isBlockBoundary():!o.contains(f))break;if(!h||f.getComputedStyle("display")!="inline")h=!1,c?u=f:this.setStartBefore(f);l=f.getPrevious()}for(;l;){p=!1;if(l.type==CKEDITOR.NODE_COMMENT)l=l.getPrevious();else{if(l.type==CKEDITOR.NODE_TEXT)d=l.getText(),r.test(d)&&(l=null),p=/[\s\ufeff]$/.test(d);else if((l.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||t&&l.is("br"))&&!l.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[l.getName()]){d=l.getText();if(r.test(d))l=null;else for(var v=l.$.getElementsByTagName("*"),m=0,g;g=v[m++];)if(!CKEDITOR.dtd.$removeEmpty[g.nodeName.toLowerCase()]){l=null;break}l&&(p=!!d.length)}else l=null;p&&(h?c?u=f:f&&this.setStartBefore(f):h=!0);if(l){p=l.getPrevious();if(!f&&!p){f=l,l=null;break}l=p}else f=null}}f&&(f=n(f.getParent()))}p=this.endContainer,v=this.endOffset,f=l=null,c=h=!1;var y=function(e,t){var n=new CKEDITOR.dom.range(o);n.setStart(e,t),n.setEndAt(o,CKEDITOR.POSITION_BEFORE_END);var n=new CKEDITOR.dom.walker(n),i;for(n.guard=function(e){return e.type!=CKEDITOR.NODE_ELEMENT||!e.isBlockBoundary()};i=n.next();){if(i.type!=CKEDITOR.NODE_TEXT)return!1;d=i!=e?i.getText():i.substring(t);if(r.test(d))return!1}return!0};p.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(p.substring(v)).length?h=!0:(h=!p.getLength(),v==p.getLength()?(l=p.getNext())||(f=p.getParent()):y(p,v)&&(f=p.getParent())):(l=p.getChild(v))||(f=p);for(;f||l;){if(f&&!l){!c&&f.equals(s)&&(c=!0);if(i?f.isBlockBoundary():!o.contains(f))break;if(!h||f.getComputedStyle("display")!="inline")h=!1,c?a=f:f&&this.setEndAfter(f);l=f.getNext()}for(;l;){p=!1;if(l.type==CKEDITOR.NODE_TEXT)d=l.getText(),y(l,0)||(l=null),p=/^[\s\ufeff]/.test(d);else if(l.type==CKEDITOR.NODE_ELEMENT){if((l.$.offsetWidth>0||t&&l.is("br"))&&!l.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[l.getName()]){d=l.getText();if(r.test(d))l=null;else{v=l.$.getElementsByTagName("*");for(m=0;g=v[m++];)if(!CKEDITOR.dtd.$removeEmpty[g.nodeName.toLowerCase()]){l=null;break}}l&&(p=!!d.length)}else l=null}else p=1;p&&h&&(c?a=f:this.setEndAfter(f));if(l){p=l.getNext();if(!f&&!p){f=l,l=null;break}l=p}else f=null}f&&(f=n(f.getParent()))}u&&a&&(s=u.contains(a)?a:u,this.setStartBefore(s),this.setEndAfter(s));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:f=new CKEDITOR.dom.range(this.root),o=this.root,f.setStartAt(o,CKEDITOR.POSITION_AFTER_START),f.setEnd(this.startContainer,this.startOffset),f=new CKEDITOR.dom.walker(f);var b,w,E=CKEDITOR.dom.walker.blockBoundary(e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),S=null,x=function(e){if(e.type==CKEDITOR.NODE_ELEMENT&&e.getAttribute("contenteditable")=="false")if(S){if(S.equals(e)){S=null;return}}else S=e;else if(S)return;var t=E(e);return t||(b=e),t},i=function(e){var t=x(e);return!t&&e.is&&e.is("br")&&(w=e),t};f.guard=x,f=f.lastBackward(),b=b||o,this.setStartAt(b,!b.is("br")&&(!f&&this.checkStartOfBlock()||f&&b.contains(f))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){f=this.clone(),f=new CKEDITOR.dom.walker(f);var T=CKEDITOR.dom.walker.whitespaces(),N=CKEDITOR.dom.walker.bookmark();f.evaluator=function(e){return!T(e)&&!N(e)};if((f=f.previous())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("br"))break}f=this.clone(),f.collapse(),f.setEndAt(o,CKEDITOR.POSITION_BEFORE_END),f=new CKEDITOR.dom.walker(f),f.guard=e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?i:x,b=S=w=null,f=f.lastForward(),b=b||o,this.setEndAt(b,!f&&this.checkEndOfBlock()||f&&b.contains(f)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START),w&&this.setEndAfter(w)}},shrink:function(e,t,n){if(!this.collapsed){var e=e||CKEDITOR.SHRINK_TEXT,r=this.clone(),i=this.startContainer,s=this.endContainer,o=this.startOffset,u=this.endOffset,a=1,f=1;i&&i.type==CKEDITOR.NODE_TEXT&&(o?o>=i.getLength()?r.setStartAfter(i):(r.setStartBefore(i),a=0):r.setStartBefore(i)),s&&s.type==CKEDITOR.NODE_TEXT&&(u?u>=s.getLength()?r.setEndAfter(s):(r.setEndAfter(s),f=0):r.setEndBefore(s));var r=new CKEDITOR.dom.walker(r),l=CKEDITOR.dom.walker.bookmark();r.evaluator=function(t){return t.type==(e==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var c;return r.guard=function(t,r){return l(t)?!0:e==CKEDITOR.SHRINK_ELEMENT&&t.type==CKEDITOR.NODE_TEXT||r&&t.equals(c)||n===!1&&t.type==CKEDITOR.NODE_ELEMENT&&t.isBlockBoundary()||t.type==CKEDITOR.NODE_ELEMENT&&t.hasAttribute("contenteditable")?!1:(!r&&t.type==CKEDITOR.NODE_ELEMENT&&(c=t),!0)},a&&(i=r[e==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(i,t?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START),f&&(r.reset(),(r=r[e==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(r,t?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)),!!a||!!f}},insertNode:function(e){this.optimizeBookmark(),this.trim(!1,!0);var t=this.startContainer,n=t.getChild(this.startOffset);n?e.insertBefore(n):t.append(e),e.getParent()&&e.getParent().equals(this.endContainer)&&this.endOffset++,this.setStartBefore(e)},moveToPosition:function(e,t){this.setStartAt(e,t),this.collapse(!0)},moveToRange:function(e){this.setStart(e.startContainer,e.startOffset),this.setEnd(e.endContainer,e.endOffset)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e.type==CKEDITOR.NODE_TEXT?e.getLength():e.getChildCount())},setStart:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex(),e=e.getParent()),this._setStartContainer(e),this.startOffset=t,this.endContainer||(this._setEndContainer(e),this.endOffset=t),r(this)},setEnd:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex()+1,e=e.getParent()),this._setEndContainer(e),this.endOffset=t,this.startContainer||(this._setStartContainer(e),this.startOffset=t),r(this)},setStartAfter:function(e){this.setStart(e.getParent(),e.getIndex()+1)},setStartBefore:function(e){this.setStart(e.getParent(),e.getIndex())},setEndAfter:function(e){this.setEnd(e.getParent(),e.getIndex()+1)},setEndBefore:function(e){this.setEnd(e.getParent(),e.getIndex())},setStartAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setStart(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setStart(e,e.getLength()):this.setStart(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(e)}r(this)},setEndAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setEnd(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setEnd(e,e.getLength()):this.setEnd(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(e)}r(this)},fixBlock:function(e,t){var n=this.createBookmark(),r=this.document.createElement(t);return this.collapse(e),this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),this.extractContents().appendTo(r),r.trim(),r.appendBogus(),this.insertNode(r),this.moveToBookmark(n),r},splitBlock:function(e){var t=new CKEDITOR.dom.elementPath(this.startContainer,this.root),n=new CKEDITOR.dom.elementPath(this.endContainer,this.root),r=t.block,i=n.block,s=null;return t.blockLimit.equals(n.blockLimit)?(e!="br"&&(r||(r=this.fixBlock(!0,e),i=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),i||(i=this.fixBlock(!1,e))),e=r&&this.checkStartOfBlock(),t=i&&this.checkEndOfBlock(),this.deleteContents(),r&&r.equals(i)&&(t?(s=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(i,CKEDITOR.POSITION_AFTER_END),i=null):e?(s=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(r,CKEDITOR.POSITION_BEFORE_START),r=null):(i=this.splitElement(r),r.is("ul","ol")||r.appendBogus())),{previousBlock:r,nextBlock:i,wasStartOfBlock:e,wasEndOfBlock:t,elementPath:s}):null},splitElement:function(e){if(!this.collapsed)return null;this.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);var t=this.extractContents(),n=e.clone(!1);return t.appendTo(n),n.insertAfter(e),this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),n},removeEmptyBlocksAtEnd:function(){function e(e){return function(r){return t(r)||n(r)||r.type==CKEDITOR.NODE_ELEMENT&&r.isEmptyInlineRemoveable()||e.is("table")&&r.is("caption")?!1:!0}}var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(!1);return function(t){for(var n=this.createBookmark(),r=this[t?"endPath":"startPath"](),i=r.block||r.blockLimit,s;i&&!i.equals(r.root)&&!i.getFirst(e(i));)s=i.getParent(),this[t?"setEndAt":"setStartAt"](i,CKEDITOR.POSITION_AFTER_END),i.remove(1),i=s;this.moveToBookmark(n)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(e,n){var r=n==CKEDITOR.START,i=this.clone();return i.collapse(r),i[r?"setStartAt":"setEndAt"](e,r?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),i=new CKEDITOR.dom.walker(i),i.evaluator=t(r),i[r?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var t=this.startContainer,n=this.startOffset;return CKEDITOR.env.ie&&n&&t.type==CKEDITOR.NODE_TEXT&&(t=CKEDITOR.tools.ltrim(t.substring(0,n)),u.test(t)&&this.trim(0,1)),this.trim(),t=new CKEDITOR.dom.elementPath(this.startContainer,this.root),n=this.clone(),n.collapse(!0),n.setStartAt(t.block||t.blockLimit,CKEDITOR.POSITION_AFTER_START),t=new CKEDITOR.dom.walker(n),t.evaluator=e(),t.checkBackward()},checkEndOfBlock:function(){var t=this.endContainer,n=this.endOffset;return CKEDITOR.env.ie&&t.type==CKEDITOR.NODE_TEXT&&(t=CKEDITOR.tools.rtrim(t.substring(n)),u.test(t)&&this.trim(1,0)),this.trim(),t=new CKEDITOR.dom.elementPath(this.endContainer,this.root),n=this.clone(),n.collapse(!1),n.setEndAt(t.block||t.blockLimit,CKEDITOR.POSITION_BEFORE_END),t=new CKEDITOR.dom.walker(n),t.evaluator=e(),t.checkForward()},getPreviousNode:function(e,t,n){var r=this.clone();return r.collapse(1),r.setStartAt(n||this.root,CKEDITOR.POSITION_AFTER_START),n=new CKEDITOR.dom.walker(r),n.evaluator=e,n.guard=t,n.previous()},getNextNode:function(e,t,n){var r=this.clone();return r.collapse(),r.setEndAt(n||this.root,CKEDITOR.POSITION_BEFORE_END),n=new CKEDITOR.dom.walker(r),n.evaluator=e,n.guard=t,n.next()},checkReadOnly:function(){function e(e,t){for(;e;){if(e.type==CKEDITOR.NODE_ELEMENT){if(e.getAttribute("contentEditable")=="false"&&!e.data("cke-editable"))return 0;if(e.is("html")||e.getAttribute("contentEditable")=="true"&&(e.contains(t)||e.equals(t)))break}e=e.getParent()}return 1}return function(){var t=this.startContainer,n=this.endContainer;return!e(t,n)||!e(n,t)}}(),moveToElementEditablePosition:function(e,t){if(e.type==CKEDITOR.NODE_ELEMENT&&!e.isEditable(!1))return this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var n=0;e;){if(e.type==CKEDITOR.NODE_TEXT){t&&this.endContainer&&this.checkEndOfBlock()&&u.test(e.getText())?this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),n=1;break}if(e.type==CKEDITOR.NODE_ELEMENT)if(e.isEditable())this.moveToPosition(e,t?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),n=1;else if(t&&e.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);else if(e.getAttribute("contenteditable")=="false"&&e.is(CKEDITOR.dtd.$block))return this.setStartBefore(e),this.setEndAfter(e),!0;var r=e,i=n,s=void 0;r.type==CKEDITOR.NODE_ELEMENT&&r.isEditable(!1)&&(s=r[t?"getLast":"getFirst"](f)),!i&&!s&&(s=r[t?"getPrevious":"getNext"](f)),e=s}return!!n},moveToClosestEditablePosition:function(e,t){var n=new CKEDITOR.dom.range(this.root),r=0,i,s=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];n.moveToPosition(e,s[t?0:1]);if(e.is(CKEDITOR.dtd.$block)){if(i=n[t?"getNextEditableNode":"getPreviousEditableNode"]())r=1,i.type==CKEDITOR.NODE_ELEMENT&&i.is(CKEDITOR.dtd.$block)&&i.getAttribute("contenteditable")=="false"?(n.setStartAt(i,CKEDITOR.POSITION_BEFORE_START),n.setEndAt(i,CKEDITOR.POSITION_AFTER_END)):n.moveToPosition(i,s[t?1:0])}else r=1;return r&&this.moveToRange(n),!!r},moveToElementEditStart:function(e){return this.moveToElementEditablePosition(e)},moveToElementEditEnd:function(e){return this.moveToElementEditablePosition(e,!0)},getEnclosedNode:function(){var e=this.clone();e.optimize();if(e.startContainer.type!=CKEDITOR.NODE_ELEMENT||e.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var e=new CKEDITOR.dom.walker(e),t=CKEDITOR.dom.walker.bookmark(!1,!0),n=CKEDITOR.dom.walker.whitespaces(!0);e.evaluator=function(e){return n(e)&&t(e)};var r=e.next();return e.reset(),r&&r.equals(e.previous())?r:null},getTouchedStartNode:function(){var e=this.startContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.startOffset)||e},getTouchedEndNode:function(){var e=this.endContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.endOffset-1)||e},getNextEditableNode:n(),getPreviousEditableNode:n(1),scrollIntoView:function(){var e=new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",this.document),t,n,r,i=this.clone();i.optimize(),(r=i.startContainer.type==CKEDITOR.NODE_TEXT)?(n=i.startContainer.getText(),t=i.startContainer.split(i.startOffset),e.insertAfter(i.startContainer)):i.insertNode(e),e.scrollIntoView(),r&&(i.startContainer.setText(n),t.remove()),e.remove()},_setStartContainer:function(e){this.startContainer=e},_setEndContainer:function(e){this.endContainer=e}}}(),CKEDITOR.POSITION_AFTER_START=1,CKEDITOR.POSITION_BEFORE_END=2,CKEDITOR.POSITION_BEFORE_START=3,CKEDITOR.POSITION_AFTER_END=4,CKEDITOR.ENLARGE_ELEMENT=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 e(e){arguments.length<1||(this.range=e,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function t(e){var t=[];return e.forEach(function(e){if(e.getAttribute("contenteditable")=="true")return t.push(e),!1},CKEDITOR.NODE_ELEMENT,!0),t}function n(e,r,i,s){e:{s==null&&(s=t(i));for(var o;o=s.shift();)if(o.getDtd().p){s={element:o,remaining:s};break e}s=null}return s?(o=CKEDITOR.filter.instances[s.element.data("cke-filter")])&&!o.check(r)?n(e,r,i,s.remaining):(r=new CKEDITOR.dom.range(s.element),r.selectNodeContents(s.element),r=r.createIterator(),r.enlargeBr=e.enlargeBr,r.enforceRealBlocks=e.enforceRealBlocks,r.activeFilter=r.filter=o,e._.nestedEditable={element:s.element,container:i,remaining:s.remaining,iterator:r},1):0}function r(e,t,n){return t?(e=e.clone(),e.collapse(!n),e.checkBoundaryOfElement(t,n?CKEDITOR.START:CKEDITOR.END)):!1}var i=/^[\r\n\t ]+$/,s=CKEDITOR.dom.walker.bookmark(!1,!0),o=CKEDITOR.dom.walker.whitespaces(!0),u=function(e){return s(e)&&o(e)},a={dd:1,dt:1,li:1};e.prototype={getNextParagraph:function(e){var t,o,l,p,v,e=e||"p";if(this._.nestedEditable){if(t=this._.nestedEditable.iterator.getNextParagraph(e))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,t;this.activeFilter=this.filter;if(n(this,e,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(e);this._.nestedEditable=null}if(!this.range.root.getDtd()[e])return null;if(!this._.started){var m=this.range.clone();o=m.startPath();var y=m.endPath(),w=!m.collapsed&&r(m,o.block),E=!m.collapsed&&r(m,y.block,1);m.shrink(CKEDITOR.SHRINK_ELEMENT,!0),w&&m.setStartAt(o.block,CKEDITOR.POSITION_BEFORE_END),E&&m.setEndAt(y.block,CKEDITOR.POSITION_AFTER_START),o=m.endContainer.hasAscendant("pre",!0)||m.startContainer.hasAscendant("pre",!0),m.enlarge(this.forceBrBreak&&!o||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(!m.collapsed){o=new CKEDITOR.dom.walker(m.clone()),y=CKEDITOR.dom.walker.bookmark(!0,!0),o.evaluator=y,this._.nextNode=o.next(),o=new CKEDITOR.dom.walker(m.clone()),o.evaluator=y,o=o.previous(),this._.lastNode=o.getNextSourceNode(!0,null,m.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(y=this.range.clone(),y.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),y.checkEndOfBlock()&&(y=new CKEDITOR.dom.elementPath(y.endContainer,y.root),this._.lastNode=(y.block||y.blockLimit).getNextSourceNode(!0)));if(!this._.lastNode||!m.root.contains(this._.lastNode))this._.lastNode=this._.docEndMarker=m.document.createText(""),this._.lastNode.insertAfter(o);m=null}this._.started=1,o=m}y=this._.nextNode,m=this._.lastNode;for(this._.nextNode=null;y;){var w=0,E=y.hasAscendant("pre"),S=y.type!=CKEDITOR.NODE_ELEMENT,x=0;if(S)y.type==CKEDITOR.NODE_TEXT&&i.test(y.getText())&&(S=0);else{var T=y.getName();if(CKEDITOR.dtd.$block[T]&&y.getAttribute("contenteditable")=="false"){t=y,n(this,e,t);break}if(y.isBlockBoundary(this.forceBrBreak&&!E&&{br:1})){if(T=="br")S=1;else if(!o&&!y.getChildCount()&&T!="hr"){t=y,l=y.equals(m);break}o&&(o.setEndAt(y,CKEDITOR.POSITION_BEFORE_START),T!="br"&&(this._.nextNode=y)),w=1}else{if(y.getFirst()){o||(o=this.range.clone(),o.setStartAt(y,CKEDITOR.POSITION_BEFORE_START)),y=y.getFirst();continue}S=1}}S&&!o&&(o=this.range.clone(),o.setStartAt(y,CKEDITOR.POSITION_BEFORE_START)),l=(!w||S)&&y.equals(m);if(o&&!w)for(;!y.getNext(u)&&!l;){T=y.getParent();if(T.isBlockBoundary(this.forceBrBreak&&!E&&{br:1})){w=1,S=0,l||T.equals(m),o.setEndAt(T,CKEDITOR.POSITION_BEFORE_END);break}y=T,S=1,l=y.equals(m),x=1}S&&o.setEndAt(y,CKEDITOR.POSITION_AFTER_END),y=this._getNextSourceNode(y,x,m);if((l=!y)||w&&o)break}if(!t){if(!o)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;t=new CKEDITOR.dom.elementPath(o.startContainer,o.root),y=t.blockLimit,w={div:1,th:1,td:1},t=t.block;if(!t&&y&&!this.enforceRealBlocks&&w[y.getName()]&&o.checkStartOfBlock()&&o.checkEndOfBlock()&&!y.equals(o.root))t=y;else if(!t||this.enforceRealBlocks&&t.is(a))t=this.range.document.createElement(e),o.extractContents().appendTo(t),t.trim(),o.insertNode(t),p=v=!0;else if(t.getName()!="li"){if(!o.checkStartOfBlock()||!o.checkEndOfBlock())t=t.clone(!1),o.extractContents().appendTo(t),t.trim(),v=o.splitBlock(),p=!v.wasStartOfBlock,v=!v.wasEndOfBlock,o.insertNode(t)}else l||(this._.nextNode=t.equals(m)?null:this._getNextSourceNode(o.getBoundaryNodes().endNode,1,m))}return p&&(p=t.getPrevious())&&p.type==CKEDITOR.NODE_ELEMENT&&(p.getName()=="br"?p.remove():p.getLast()&&p.getLast().$.nodeName.toLowerCase()=="br"&&p.getLast().remove()),v&&(p=t.getLast())&&p.type==CKEDITOR.NODE_ELEMENT&&p.getName()=="br"&&(!CKEDITOR.env.needsBrFiller||p.getPrevious(s)||p.getNext(s))&&p.remove(),this._.nextNode||(this._.nextNode=l||t.equals(m)||!m?null:this._getNextSourceNode(t,1,m)),t},_getNextSourceNode:function(e,t,n){function r(e){return!e.equals(n)&&!e.equals(i)}for(var i=this.range.root,e=e.getNextSourceNode(t,null,r);!s(e);)e=e.getNextSourceNode(t,null,r);return e}},CKEDITOR.dom.range.prototype.createIterator=function(){return new e(this)}}(),CKEDITOR.command=function(e,t){this.uiItems=[],this.exec=function(n){return this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed()?!1:(this.editorFocus&&e.focus(),this.fire("exec")===!1?!0:t.exec.call(this,e,n)!==!1)},this.refresh=function(e,n){return!this.readOnly&&e.readOnly?!0:this.context&&!n.isContextFor(this.context)?(this.disable(),!0):this.checkAllowed(!0)?(this.startDisabled||this.enable(),this.modes&&!this.modes[e.mode]&&this.disable(),this.fire("refresh",{editor:e,path:n})===!1?!0:t.refresh&&t.refresh.apply(this,arguments)!==!1):(this.disable(),!0)};var n;this.checkAllowed=function(t){return!t&&typeof n=="boolean"?n:n=e.activeFilter.checkFeature(this)},CKEDITOR.tools.extend(this,t,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!t.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||typeof this.previousState=="undefined"?CKEDITOR.TRISTATE_OFF:this.previousState)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(e){return this.state==e||e!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed()?!1:(this.previousState=this.state,this.state=e,this.fire("state"),!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,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"<!DOCTYPE html>",bodyId:"",bodyClass:"",fullPage:!1,height:200,extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1e4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function e(e,t,n,r,i){var s,u,e=[];for(s in t){u=t[s],u=typeof u=="boolean"?{}:typeof u=="function"?{match:u}:L(u),s.charAt(0)!="$"&&(u.elements=s),n&&(u.featureName=n.toLowerCase());var a=u;a.elements=o(a.elements,/\s+/)||null,a.propertiesOnly=a.propertiesOnly||a.elements===!0;var f=/\s*,\s*/,l=void 0;for(l in _){a[l]=o(a[l],f)||null;var c=a,h=D[l],p=o(a[D[l]],f),d=a[l],v=[],m=!0,y=void 0;p?m=!1:p={};for(y in d)y.charAt(0)=="!"&&(y=y.slice(1),v.push(y),p[y]=!0,m=!1);for(;y=v.pop();)d[y]=d["!"+y],delete d["!"+y];c[h]=(m?!1:p)||null}a.match=a.match||null,r.push(u),e.push(u)}for(var t=i.elements,i=i.generic,b,n=0,r=e.length;n<r;++n){s=L(e[n]),u=s.classes===!0||s.styles===!0||s.attributes===!0,a=s,l=h=f=void 0;for(f in _)a[f]=g(a[f]);c=!0;for(l in D){f=D[l],h=a[f],p=[],d=void 0;for(d in h)d.indexOf("*")>-1?p.push(RegExp("^"+d.replace(/\*/g,".*")+"$")):p.push(d);h=p,h.length&&(a[f]=h,c=!1)}a.nothingRequired=c,a.noProperties=!(a.attributes||a.classes||a.styles);if(s.elements===!0||s.elements===null)i[u?"unshift":"push"](s);else{a=s.elements,delete s.elements;for(b in a)t[b]?t[b][u?"unshift":"push"](s):t[b]=[s]}}}function t(e,t,r,i){if(!e.match||e.match(t))if(i||u(e,t)){e.propertiesOnly||(r.valid=!0),r.allAttributes||(r.allAttributes=n(e.attributes,t.attributes,r.validAttributes)),r.allStyles||(r.allStyles=n(e.styles,t.styles,r.validStyles));if(!r.allClasses){e=e.classes,t=t.classes,i=r.validClasses;if(e)if(e===!0)e=!0;else{for(var s=0,o=t.length,a;s<o;++s)a=t[s],i[a]||(i[a]=e(a));e=!1}else e=!1;r.allClasses=e}}}function n(e,t,n){if(!e)return!1;if(e===!0)return!0;for(var r in t)n[r]||(n[r]=e(r));return!1}function r(e,t,n){if(!e.match||e.match(t)){if(e.noProperties)return!1;n.hadInvalidAttribute=i(e.attributes,t.attributes)||n.hadInvalidAttribute,n.hadInvalidStyle=i(e.styles,t.styles)||n.hadInvalidStyle,e=e.classes,t=t.classes;if(e){for(var r=!1,s=e===!0,o=t.length;o--;)if(s||e(t[o]))t.splice(o,1),r=!0;e=r}else e=!1;n.hadInvalidClass=e||n.hadInvalidClass}}function i(e,t){if(!e)return!1;var n=!1,r=e===!0,i;for(i in t)if(r||e(i))delete t[i],n=!0;return n}function s(e,t,n){return e.disabled||e.customConfig&&!n||!t?!1:(e._.cachedChecks={},!0)}function o(e,t){if(!e)return!1;if(e===!0)return e;if(typeof e=="string")return e=A(e),e=="*"?!0:CKEDITOR.tools.convertArrayToObject(e.split(t));if(CKEDITOR.tools.isArray(e))return e.length?CKEDITOR.tools.convertArrayToObject(e):!1;var n={},r=0,i;for(i in e)n[i]=e[i],r++;return r?n:!1}function u(e,t){if(e.nothingRequired)return!0;var n,r,i,s;if(i=e.requiredClasses){s=t.classes;for(n=0;n<i.length;++n){r=i[n];if(typeof r=="string"){if(CKEDITOR.tools.indexOf(s,r)==-1)return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(s,r))return!1}}return a(t.styles,e.requiredStyles)&&a(t.attributes,e.requiredAttributes)}function a(e,t){if(!t)return!0;for(var n=0,r;n<t.length;++n){r=t[n];if(typeof r=="string"){if(!(r in e))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(e,r))return!1}return!0}function f(e){if(!e)return{};for(var e=e.split(/\s*,\s*/).sort(),t={};e.length;)t[e.shift()]=O;return t}function l(e){for(var t,n,r,i,s={},o=1,e=A(e);t=e.match(P);)(n=t[2])?(r=c(n,"styles"),i=c(n,"attrs"),n=c(n,"classes")):r=i=n=null,s["$"+o++]={elements:t[1],classes:n,styles:r,attributes:i},e=e.slice(t[0].length);return s}function c(e,t){var n=e.match(H[t]);return n?A(n[1]):null}function h(e){var t=e.styleBackup=e.attributes.style,n=e.classBackup=e.attributes["class"];e.styles||(e.styles=CKEDITOR.tools.parseCssText(t||"",1)),e.classes||(e.classes=n?n.split(/\s+/):[])}function p(e,n,i,s){var o=0,u;s.toHtml&&(n.name=n.name.replace(B,"$1"));if(s.doCallbacks&&e.elementCallbacks){e:for(var a=e.elementCallbacks,f=0,l=a.length,c;f<l;++f)if(c=a[f](n)){u=c;break e}if(u)return u}if(s.doTransform)if(u=e._.transformations[n.name]){h(n);for(a=0;a<u.length;++a)E(e,n,u[a]);v(n)}if(s.doFilter){e:{a=n.name,f=e._,e=f.allowedRules.elements[a],u=f.allowedRules.generic,a=f.disallowedRules.elements[a],f=f.disallowedRules.generic,l=s.skipRequired,c={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1};var p,d;if(!e&&!u)e=null;else{h(n);if(a){p=0;for(d=a.length;p<d;++p)if(r(a[p],n,c)===!1){e=null;break e}}if(f){p=0;for(d=f.length;p<d;++p)r(f[p],n,c)}if(e){p=0;for(d=e.length;p<d;++p)t(e[p],n,c,l)}if(u){p=0;for(d=u.length;p<d;++p)t(u[p],n,c,l)}e=c}}if(!e)return i.push(n),k;if(!e.valid)return i.push(n),k;d=e.validAttributes;var g=e.validStyles;u=e.validClasses;var a=n.attributes,y=n.styles,f=n.classes,l=n.classBackup,b=n.styleBackup,w,S,x=[];c=[];var T=/^data-cke-/;p=!1,delete a.style,delete a["class"],delete n.classBackup,delete n.styleBackup;if(!e.allAttributes)for(w in a)d[w]||(T.test(w)?w!=(S=w.replace(/^data-cke-saved-/,""))&&!d[S]&&(delete a[w],p=!0):(delete a[w],p=!0));if(!e.allStyles||e.hadInvalidStyle){for(w in y)e.allStyles||g[w]?x.push(w+":"+y[w]):p=!0;x.length&&(a.style=x.sort().join("; "))}else b&&(a.style=b);if(!e.allClasses||e.hadInvalidClass){for(w=0;w<f.length;++w)(e.allClasses||u[f[w]])&&c.push(f[w]);c.length&&(a["class"]=c.sort().join(" ")),l&&c.length<l.split(/\s+/).length&&(p=!0)}else l&&(a["class"]=l);p&&(o=k);if(!s.skipFinalValidation&&!m(n))return i.push(n),k}return s.toHtml&&(n.name=n.name.replace(j,"cke:$1")),o}function d(e){var t=[],n;for(n in e)n.indexOf("*")>-1&&t.push(n.replace(/\*/g,".*"));return t.length?RegExp("^(?:"+t.join("|")+")$"):null}function v(e){var t=e.attributes,n;delete t.style,delete t["class"];if(n=CKEDITOR.tools.writeCssText(e.styles,!0))t.style=n;e.classes.length&&(t["class"]=e.classes.sort().join(" "))}function m(e){switch(e.name){case"a":if(!e.children.length&&!e.attributes.name)return!1;break;case"img":if(!e.attributes.src)return!1}return!0}function g(e){if(!e)return!1;if(e===!0)return!0;var t=d(e);return function(n){return n in e||t&&n.match(t)}}function y(){return new CKEDITOR.htmlParser.element("br")}function b(e){return e.type==CKEDITOR.NODE_ELEMENT&&(e.name=="br"||C.$block[e.name])}function w(e,t,n){var r=e.name;if(C.$empty[r]||!e.children.length)r=="hr"&&t=="br"?e.replaceWith(y()):(e.parent&&n.push({check:"it",el:e.parent}),e.remove());else if(C.$block[r]||r=="tr")if(t=="br")e.previous&&!b(e.previous)&&(t=y(),t.insertBefore(e)),e.next&&!b(e.next)&&(t=y(),t.insertAfter(e)),e.replaceWithChildren();else{var r=e.children,i;e:{i=C[t];for(var s=0,o=r.length,u;s<o;++s){u=r[s];if(u.type==CKEDITOR.NODE_ELEMENT&&!i[u.name]){i=!1;break e}}i=!0}if(i)e.name=t,e.attributes={},n.push({check:"parent-down",el:e});else{i=e.parent;for(var s=i.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||i.name=="body",a,f,o=r.length;o>0;)u=r[--o],s&&(u.type==CKEDITOR.NODE_TEXT||u.type==CKEDITOR.NODE_ELEMENT&&C.$inline[u.name])?(a||(a=new CKEDITOR.htmlParser.element(t),a.insertAfter(e),n.push({check:"parent-down",el:a})),a.add(u,0)):(a=null,f=C[i.name]||C.span,u.insertAfter(e),i.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&u.type==CKEDITOR.NODE_ELEMENT&&!f[u.name]&&n.push({check:"el-up",el:u}));e.remove()}}else r=="style"?e.remove():(e.parent&&n.push({check:"it",el:e.parent}),e.replaceWithChildren())}function E(e,t,n){var r,i;for(r=0;r<n.length;++r){i=n[r];if((!i.check||e.check(i.check,!1))&&(!i.left||i.left(t))){i.right(t,F);break}}}function S(e,t){var n=t.getDefinition(),r=n.attributes,i=n.styles,s,o,u,a;if(e.name!=n.element)return!1;for(s in r)if(s=="class"){n=r[s].split(/\s+/);for(u=e.classes.join("|");a=n.pop();)if(u.indexOf(a)==-1)return!1}else if(e.attributes[s]!=r[s])return!1;for(o in i)if(e.styles[o]!=i[o])return!1;return!0}function x(e,t){var n,r;return typeof e=="string"?n=e:e instanceof CKEDITOR.style?r=e:(n=e[0],r=e[1]),[{element:n,left:r,right:function(e,n){n.transform(e,t)}}]}function T(e){return function(t){return S(t,e)}}function N(e){return function(t,n){n[e](t)}}var C=CKEDITOR.dtd,k=1,L=CKEDITOR.tools.copy,A=CKEDITOR.tools.trim,O="cke-test",M=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2,CKEDITOR.filter=function(e){this.allowedContent=[],this.disallowedContent=[],this.elementCallbacks=null,this.disabled=!1,this.editor=null,this.id=CKEDITOR.tools.getNextNumber(),this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}},CKEDITOR.filter.instances[this.id]=this;if(e instanceof CKEDITOR.editor){e=this.editor=e,this.customConfig=!0;var t=e.config.allowedContent;t===!0?this.disabled=!0:(t||(this.customConfig=!1),this.allow(t,"config",1),this.allow(e.config.extraAllowedContent,"extra",1),this.allow(M[e.enterMode]+" "+M[e.shiftEnterMode],"default",1),this.disallow(e.config.disallowedContent))}else this.customConfig=!1,this.allow(e,"default",1)},CKEDITOR.filter.instances={},CKEDITOR.filter.prototype={allow:function(t,n,r){if(!s(this,t,r))return!1;var i,o;if(typeof t=="string")t=l(t);else if(t instanceof CKEDITOR.style){if(t.toAllowedContentRules)return this.allow(t.toAllowedContentRules(this.editor),n,r);i=t.getDefinition(),t={},r=i.attributes,t[i.element]=i={styles:i.styles,requiredStyles:i.styles&&CKEDITOR.tools.objectKeys(i.styles)},r&&(r=L(r),i.classes=r["class"]?r["class"].split(/\s+/):null,i.requiredClasses=i.classes,delete r["class"],i.attributes=r,i.requiredAttributes=r&&CKEDITOR.tools.objectKeys(r))}else if(CKEDITOR.tools.isArray(t)){for(i=0;i<t.length;++i)o=this.allow(t[i],n,r);return o}return e(this,t,n,this.allowedContent,this._.allowedRules),!0},applyTo:function(e,t,n,r){if(this.disabled)return!1;var i=this,s=[],o=this.editor&&this.editor.config.protectedSource,u,a=!1,f={doFilter:!n,doTransform:!0,doCallbacks:!0,toHtml:t};e.forEach(function(e){if(e.type==CKEDITOR.NODE_ELEMENT){if(e.attributes["data-cke-filter"]=="off")return!1;if(!t||e.name!="span"||!~CKEDITOR.tools.objectKeys(e.attributes).join("|").indexOf("data-cke-")){u=p(i,e,s,f);if(u&k)a=!0;else if(u&2)return!1}}else if(e.type==CKEDITOR.NODE_COMMENT&&e.value.match(/^\{cke_protected\}(?!\{C\})/)){var n;e:{var r=decodeURIComponent(e.value.replace(/^\{cke_protected\}/,""));n=[];var l,c,h;if(o)for(c=0;c<o.length;++c)if((h=r.match(o[c]))&&h[0].length==r.length){n=!0;break e}r=CKEDITOR.htmlParser.fragment.fromHtml(r),r.children.length==1&&(l=r.children[0]).type==CKEDITOR.NODE_ELEMENT&&p(i,l,n,f),n=!n.length}n||s.push(e)}},null,!0),s.length&&(a=!0);for(var l,e=[],r=M[r||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)],c;n=s.pop();)n.type==CKEDITOR.NODE_ELEMENT?w(n,r,e):n.remove();for(;l=e.pop();){n=l.el;if(n.parent){c=C[n.parent.name]||C.span;switch(l.check){case"it":C.$removeEmpty[n.name]&&!n.children.length?w(n,r,e):m(n)||w(n,r,e);break;case"el-up":n.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!c[n.name]&&w(n,r,e);break;case"parent-down":n.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!c[n.name]&&w(n.parent,r,e)}}}return a},checkFeature:function(e){return this.disabled||!e?!0:(e.toFeature&&(e=e.toFeature(this.editor)),!e.requiredContent||this.check(e.requiredContent))},disable:function(){this.disabled=!0},disallow:function(t){return s(this,t,!0)?(typeof t=="string"&&(t=l(t)),e(this,t,null,this.disallowedContent,this._.disallowedRules),!0):!1},addContentForms:function(e){if(!this.disabled&&e){var t,n,r=[],i;for(t=0;t<e.length&&!i;++t)n=e[t],(typeof n=="string"||n instanceof CKEDITOR.style)&&this.check(n)&&(i=n);if(i){for(t=0;t<e.length;++t)r.push(x(e[t],i));this.addTransformations(r)}}},addElementCallback:function(e){this.elementCallbacks||(this.elementCallbacks=[]),this.elementCallbacks.push(e)},addFeature:function(e){return this.disabled||!e?!0:(e.toFeature&&(e=e.toFeature(this.editor)),this.allow(e.allowedContent,e.name),this.addTransformations(e.contentTransformations),this.addContentForms(e.contentForms),e.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(e.requiredContent):!0)},addTransformations:function(e){var t,n;if(!this.disabled&&e){var r=this._.transformations,i;for(i=0;i<e.length;++i){t=e[i];var s=void 0,o=void 0,u=void 0,a=void 0,f=void 0,l=void 0;n=[];for(o=0;o<t.length;++o)u=t[o],typeof u=="string"?(u=u.split(/\s*:\s*/),a=u[0],f=null,l=u[1]):(a=u.check,f=u.left,l=u.right),s||(s=u,s=s.element?s.element:a?a.match(/^([a-z0-9]+)/i)[0]:s.left.getDefinition().element),f instanceof CKEDITOR.style&&(f=T(f)),n.push({check:a==s?null:a,left:f,right:typeof l=="string"?N(l):l});t=s,r[t]||(r[t]=[]),r[t].push(n)}}},check:function(e,t,n){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(e)){for(var r=e.length;r--;)if(this.check(e[r],t,n))return!0;return!1}var i,s;if(typeof e=="string"){s=e+"<"+(t===!1?"0":"1")+(n?"1":"0")+">";if(s in this._.cachedChecks)return this._.cachedChecks[s];r=l(e).$1,i=r.styles;var o=r.classes;r.name=r.elements,r.classes=o=o?o.split(/\s*,\s*/):[],r.styles=f(i),r.attributes=f(r.attributes),r.children=[],o.length&&(r.attributes["class"]=o.join(" ")),i&&(r.attributes.style=CKEDITOR.tools.writeCssText(r.styles)),i=r}else r=e.getDefinition(),i=r.styles,o=r.attributes||{},i?(i=L(i),o.style=CKEDITOR.tools.writeCssText(i,!0)):i={},i={name:r.element,attributes:o,classes:o["class"]?o["class"].split(/\s+/):[],styles:i,children:[]};var o=CKEDITOR.tools.clone(i),u=[],a;if(t!==!1&&(a=this._.transformations[i.name])){for(r=0;r<a.length;++r)E(this,i,a[r]);v(i)}return p(this,o,u,{doFilter:!0,doTransform:t!==!1,skipRequired:!n,skipFinalValidation:!n}),t=u.length>0?!1:CKEDITOR.tools.objectCompare(i.attributes,o.attributes,!0)?!0:!1,typeof e=="string"&&(this._.cachedChecks[s]=t),t},getAllowedEnterMode:function(){var e=["p","div","br"],t={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(n,r){var i=e.slice(),s;if(this.check(M[n]))return n;for(r||(i=i.reverse());s=i.pop();)if(this.check(s))return t[s];return CKEDITOR.ENTER_BR}}(),destroy:function(){delete CKEDITOR.filter.instances[this.id],delete this._,delete this.allowedContent,delete this.disallowedContent}};var _={styles:1,attributes:1,classes:1},D={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},P=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,H={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},B=/^cke:(object|embed|param)$/,j=/^(object|embed|param)$/,F=CKEDITOR.filter.transformationsTools={sizeToStyle:function(e){this.lengthToStyle(e,"width"),this.lengthToStyle(e,"height")},sizeToAttribute:function(e){this.lengthToAttribute(e,"width"),this.lengthToAttribute(e,"height")},lengthToStyle:function(e,t,n){n=n||t;if(!(n in e.styles)){var r=e.attributes[t];r&&(/^\d+$/.test(r)&&(r+="px"),e.styles[n]=r)}delete e.attributes[t]},lengthToAttribute:function(e,t,n){n=n||t;if(!(n in e.attributes)){var r=e.styles[t],i=r&&r.match(/^(\d+)(?:\.\d*)?px$/);i?e.attributes[n]=i[1]:r==O&&(e.attributes[n]=O)}delete e.styles[t]},alignmentToStyle:function(e){if(!("float"in e.styles)){var t=e.attributes.align;if(t=="left"||t=="right")e.styles["float"]=t}delete e.attributes.align},alignmentToAttribute:function(e){if(!("align"in e.attributes)){var t=e.styles["float"];if(t=="left"||t=="right")e.attributes.align=t}delete e.styles["float"]},matchesStyle:S,transform:function(e,t){if(typeof t=="string")e.name=t;else{var n=t.getDefinition(),r=n.styles,i=n.attributes,s,o,u,a;e.name=n.element;for(s in i)if(s=="class"){n=e.classes.join("|");for(u=i[s].split(/\s+/);a=u.pop();)n.indexOf(a)==-1&&e.classes.push(a)}else e.attributes[s]=i[s];for(o in r)e.styles[o]=r[o]}}}}(),function(){CKEDITOR.focusManager=function(e){return e.focusManager?e.focusManager:(this.hasFocus=!1,this.currentActive=null,this._={editor:e},this)},CKEDITOR.focusManager._={blurDelay:200},CKEDITOR.focusManager.prototype={focus:function(e){this._.timer&&clearTimeout(this._.timer),e&&(this.currentActive=e),!this.hasFocus&&!this._.locked&&((e=CKEDITOR.currentInstance)&&e.focusManager.blur(1),this.hasFocus=!0,(e=this._.editor.container)&&e.addClass("cke_focus"),this._.editor.fire("focus"))},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(e){function t(){if(this.hasFocus){this.hasFocus=!1;var e=this._.editor.container;e&&e.removeClass("cke_focus"),this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var n=CKEDITOR.focusManager._.blurDelay;e||!n?t.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer,t.call(this)},n,this)}},add:function(e,t){var n=e.getCustomData("focusmanager");if(!n||n!=this){n&&n.remove(e);var n="focus",r="blur";t&&(CKEDITOR.env.ie?(n="focusin",r="focusout"):CKEDITOR.event.useCapture=1);var i={blur:function(){e.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(e)}};e.on(n,i.focus,this),e.on(r,i.blur,this),t&&(CKEDITOR.event.useCapture=0),e.setCustomData("focusmanager",this),e.setCustomData("focusmanager_handlers",i)}},remove:function(e){e.removeCustomData("focusmanager");var t=e.removeCustomData("focusmanager_handlers");e.removeListener("blur",t.blur),e.removeListener("focus",t.focus)}}}(),CKEDITOR.keystrokeHandler=function(e){return e.keystrokeHandler?e.keystrokeHandler:(this.keystrokes={},this.blockedKeystrokes={},this._={editor:e},this)},function(){var e,t=function(t){var t=t.data,n=t.getKeystroke(),r=this.keystrokes[n],i=this._.editor;return e=i.fire("key",{keyCode:n,domEvent:t})===!1,e||(r&&(e=i.execCommand(r,{from:"keystrokeHandler"})!==!1),e||(e=!!this.blockedKeystrokes[n])),e&&t.preventDefault(!0),!e},n=function(t){e&&(e=!1,t.data.preventDefault(!0))};CKEDITOR.keystrokeHandler.prototype={attach:function(e){e.on("keydown",t,this),CKEDITOR.env.gecko&&CKEDITOR.env.mac&&e.on("keypress",n,this)}}}(),function(){CKEDITOR.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es: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,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no: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(e,t,n){if(!e||!CKEDITOR.lang.languages[e])e=this.detect(t,e);var r=this,t=function(){r[e].dir=r.rtl[e]?"rtl":"ltr",n(e,r[e])};this[e]?t():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+e+".js"),t,this)},detect:function(e,t){var n=this.languages,t=t||navigator.userLanguage||navigator.language||e,r=t.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),i=r[1],r=r[2];return n[i+"-"+r]?i=i+"-"+r:n[i]||(i=null),CKEDITOR.lang.detect=i?function(){return i}:function(e){return e},i||e}}}(),CKEDITOR.scriptLoader=function(){var e={},t={};return{load:function(n,r,i,s){var o=typeof n=="string";o&&(n=[n]),i||(i=CKEDITOR);var u=n.length,f=[],l=[],c=function(e){r&&(o?r.call(i,e):r.call(i,f,l))};if(u===0)c(!0);else{var h=function(e,t){(t?f:l).push(e),--u<=0&&(s&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),c(t))},p=function(n,r){e[n]=1;var i=t[n];delete t[n];for(var s=0;s<i.length;s++)i[s](n,r)},d=function(n){if(e[n])h(n,!0);else{var i=t[n]||(t[n]=[]);i.push(h);if(!(i.length>1)){var s=new CKEDITOR.dom.element("script");s.setAttributes({type:"text/javascript",src:n}),r&&(CKEDITOR.env.ie&&CKEDITOR.env.version<11?s.$.onreadystatechange=function(){if(s.$.readyState=="loaded"||s.$.readyState=="complete")s.$.onreadystatechange=null,p(n,!0)}:(s.$.onload=function(){setTimeout(function(){p(n,!0)},0)},s.$.onerror=function(){p(n,!1)})),s.appendTo(CKEDITOR.document.getHead())}}};s&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var v=0;v<u;v++)d(n[v])}},queue:function(){function e(){var e;(e=t[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var t=[];return function(n,r){var i=this;t.push({scriptUrl:n,callback:function(){r&&r.apply(this,arguments),t.shift(),e.call(i)}}),t.length==1&&e.call(this)}}()}}(),CKEDITOR.resourceManager=function(e,t){this.basePath=e,this.fileName=t,this.registered={},this.loaded={},this.externals={},this._={waitingList:{}}},CKEDITOR.resourceManager.prototype={add:function(e,t){if(this.registered[e])throw'[CKEDITOR.resourceManager.add] The resource name "'+e+'" is already registered.';var n=this.registered[e]=t||{};return n.name=e,n.path=this.getPath(e),CKEDITOR.fire(e+CKEDITOR.tools.capitalize(this.fileName)+"Ready",n),this.get(e)},get:function(e){return this.registered[e]||null},getPath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(t&&t.dir||this.basePath+e+"/")},getFilePath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(this.getPath(e)+(t?t.file:this.fileName+".js"))},addExternal:function(e,t,n){for(var e=e.split(","),r=0;r<e.length;r++){var i=e[r];n||(t=t.replace(/[^\/]+$/,function(e){return n=e,""})),this.externals[i]={dir:t,file:n||this.fileName+".js"}}},load:function(e,t,n){CKEDITOR.tools.isArray(e)||(e=e?[e]:[]);for(var r=this.loaded,i=this.registered,s=[],o={},u={},a=0;a<e.length;a++){var f=e[a];if(f)if(!r[f]&&!i[f]){var l=this.getFilePath(f);s.push(l),l in o||(o[l]=[]),o[l].push(f)}else u[f]=this.get(f)}CKEDITOR.scriptLoader.load(s,function(e,i){if(i.length)throw'[CKEDITOR.resourceManager.load] Resource name "'+o[i[0]].join(",")+'" was not found at "'+i[0]+'".';for(var s=0;s<e.length;s++)for(var a=o[e[s]],f=0;f<a.length;f++){var l=a[f];u[l]=this.get(l),r[l]=1}t.call(n,u)},this)}},CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin"),CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(e){var t={};return function(n,r,i){var s={},o=function(n){e.call(this,n,function(e){CKEDITOR.tools.extend(s,e);var n=[],u;for(u in e){var a=e[u],f=a&&a.requires;if(!t[u]){if(a.icons)for(var l=a.icons.split(","),h=l.length;h--;)CKEDITOR.skin.addIcon(l[h],a.path+"icons/"+(CKEDITOR.env.hidpi&&a.hidpi?"hidpi/":"")+l[h]+".png");t[u]=1}if(f){f.split&&(f=f.split(","));for(a=0;a<f.length;a++)s[f[a]]||n.push(f[a])}}if(n.length)o.call(this,n);else{for(u in s)a=s[u],a.onLoad&&!a.onLoad._called&&(a.onLoad()===!1&&delete s[u],a.onLoad._called=1);r&&r.call(i||window,s)}},this)};o.call(this,n)}}),CKEDITOR.plugins.setLang=function(e,t,n){var r=this.get(e),e=r.langEntries||(r.langEntries={}),r=r.lang||(r.lang=[]);r.split&&(r=r.split(",")),CKEDITOR.tools.indexOf(r,t)==-1&&r.push(t),e[t]=n},CKEDITOR.ui=function(e){return e.ui?e.ui:(this.items={},this.instances={},this.editor=e,this._={handlers:{}},this)},CKEDITOR.ui.prototype={add:function(e,t,n){n.name=e.toLowerCase();var r=this.items[e]={type:t,command:n.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(r,n)},get:function(e){return this.instances[e]},create:function(e){var t=this.items[e],n=t&&this._.handlers[t.type],r=t&&t.command&&this.editor.getCommand(t.command),n=n&&n.create.apply(this,t.args);return this.instances[e]=n,r&&r.uiItems.push(n),n&&!n.type&&(n.type=t.type),n},addHandler:function(e,t){this._.handlers[e]=t},space:function(e){return CKEDITOR.document.getById(this.spaceId(e))},spaceId:function(e){return this.editor.id+"_"+e}},CKEDITOR.event.implementOn(CKEDITOR.ui),function(){function e(e,r,s){CKEDITOR.event.call(this),e=e&&CKEDITOR.tools.clone(e);if(r!==void 0){if(!(r instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!s)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&s==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!(s==CKEDITOR.ELEMENT_MODE_INLINE?r.is(CKEDITOR.dtd.$editable)||r.is("textarea"):s==CKEDITOR.ELEMENT_MODE_REPLACE?!r.is(CKEDITOR.dtd.$nonBodyContent):1))throw Error('The specified element mode is not supported on element: "'+r.getName()+'".');this.element=r,this.elementMode=s,this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(r.getId()||r.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={},this.commands={},this.templates={},this.name=this.name||t(),this.id=CKEDITOR.tools.getNextId(),this.status="unloaded",this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config),this.ui=new CKEDITOR.ui(this),this.focusManager=new CKEDITOR.focusManager(this),this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this),this.on("readOnly",n),this.on("selectionChange",function(e){i(this,e.data.path)}),this.on("activeFilterChange",function(){i(this,this.elementPath(),!0)}),this.on("mode",n),this.on("instanceReady",function(){this.config.startupFocus&&this.focus()}),CKEDITOR.fire("instanceCreated",null,this),CKEDITOR.add(this),CKEDITOR.tools.setTimeout(function(){o(this,e)},0,this)}function t(){do var e="editor"+ ++h;while(CKEDITOR.instances[e]);return e}function n(){var e=this.commands,t;for(t in e)r(this,e[t])}function r(e,t){t[t.startDisabled?"disable":e.readOnly&&!t.readOnly?"disable":t.modes[e.mode]?"enable":"disable"]()}function i(e,t,n){if(t){var r,i,s=e.commands;for(i in s)r=s[i],(n||r.contextSensitive)&&r.refresh(e,t)}}function s(e){var t=e.config.customConfig;if(!t)return!1;var t=CKEDITOR.getUrl(t),n=p[t]||(p[t]={});return n.fn?(n.fn.call(e,e.config),(CKEDITOR.getUrl(e.config.customConfig)==t||!s(e))&&e.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(t,function(){n.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){},s(e)}),!0}function o(e,t){e.on("customConfigLoaded",function(){if(t){if(t.on)for(var n in t.on)e.on(n,t.on[n]);CKEDITOR.tools.extend(e.config,t,!0),delete e.config.on}n=e.config,e.readOnly=!!n.readOnly||!!(e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.element.is("textarea")?e.element.hasAttribute("disabled"):e.element.isReadOnly():e.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&e.element.hasAttribute("disabled")),e.blockless=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!e.element.is("textarea")&&!CKEDITOR.dtd[e.element.getName()].p:!1,e.tabIndex=n.tabIndex||e.element&&e.element.getAttribute("tabindex")||0,e.activeEnterMode=e.enterMode=e.blockless?CKEDITOR.ENTER_BR:n.enterMode,e.activeShiftEnterMode=e.shiftEnterMode=e.blockless?CKEDITOR.ENTER_BR:n.shiftEnterMode,n.skin&&(CKEDITOR.skinName=n.skin),e.fireOnce("configLoaded"),e.dataProcessor=new CKEDITOR.htmlDataProcessor(e),e.filter=e.activeFilter=new CKEDITOR.filter(e),u(e)}),t&&t.customConfig!=null&&(e.config.customConfig=t.customConfig),s(e)||e.fireOnce("customConfigLoaded")}function u(e){CKEDITOR.skin.loadPart("editor",function(){a(e)})}function a(e){CKEDITOR.lang.load(e.config.language,e.config.defaultLanguage,function(t,n){var r=e.config.title;e.langCode=t,e.lang=CKEDITOR.tools.prototypedCopy(n),e.title=typeof r=="string"||r===!1?r:[e.lang.editor,e.name].join(", "),e.config.contentsLangDirection||(e.config.contentsLangDirection=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.element.getDirection(1):e.lang.dir),e.fire("langLoaded"),f(e)})}function f(e){e.getStylesSet(function(t){e.once("loaded",function(){e.fire("stylesSet",{styles:t})},null,null,1),l(e)})}function l(e){var t=e.config,n=t.plugins,r=t.extraPlugins,i=t.removePlugins;if(r)var s=RegExp("(?:^|,)(?:"+r.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),n=n.replace(s,""),n=n+(","+r);if(i)var o=RegExp("(?:^|,)(?:"+i.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),n=n.replace(o,"");CKEDITOR.env.air&&(n+=",adobeair"),CKEDITOR.plugins.load(n.split(","),function(n){var r=[],i=[],s=[];e.plugins=n;for(var u in n){var a=n[u],f=a.lang,l=null,c=a.requires,h;CKEDITOR.tools.isArray(c)&&(c=c.join(","));if(c&&(h=c.match(o)))for(;c=h.pop();)CKEDITOR.tools.setTimeout(function(e,t){throw Error('Plugin "'+e.replace(",","")+'" cannot be removed from the plugins list, because it\'s required by "'+t+'" plugin.')},0,null,[c,u]);f&&!e.lang[u]&&(f.split&&(f=f.split(",")),CKEDITOR.tools.indexOf(f,e.langCode)>=0?l=e.langCode:(l=e.langCode.replace(/-.*/,""),l=l!=e.langCode&&CKEDITOR.tools.indexOf(f,l)>=0?l:CKEDITOR.tools.indexOf(f,"en")>=0?"en":f[0]),!a.langEntries||!a.langEntries[l]?s.push(CKEDITOR.getUrl(a.path+"lang/"+l+".js")):(e.lang[u]=a.langEntries[l],l=null)),i.push(l),r.push(a)}CKEDITOR.scriptLoader.load(s,function(){for(var n=["beforeInit","init","afterInit"],s=0;s<n.length;s++)for(var o=0;o<r.length;o++){var u=r[o];s===0&&i[o]&&u.lang&&u.langEntries&&(e.lang[u.name]=u.langEntries[i[o]]),u[n[s]]&&u[n[s]](e)}e.fireOnce("pluginsLoaded"),t.keystrokes&&e.setKeystroke(e.config.keystrokes);for(o=0;o<e.config.blockedKeystrokes.length;o++)e.keystrokeHandler.blockedKeystrokes[e.config.blockedKeystrokes[o]]=1;e.status="loaded",e.fireOnce("loaded"),CKEDITOR.fire("instanceLoaded",null,e)})})}function c(){var e=this.element;if(e&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var t=this.getData();return this.config.htmlEncodeOutput&&(t=CKEDITOR.tools.htmlEncode(t)),e.is("textarea")?e.setValue(t):e.setHtml(t),!0}return!1}e.prototype=CKEDITOR.editor.prototype,CKEDITOR.editor=e;var h=0,p={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(e,t){t.name=e.toLowerCase();var n=new CKEDITOR.command(this,t);return this.mode&&r(this,n),this.commands[e]=n},_attachToForm:function(){function e(e){t.updateElement(),t._.required&&!n.getValue()&&t.fire("required")===!1&&e.data.preventDefault()}var t=this,n=t.element,r=new CKEDITOR.dom.element(n.$.form);n.is("textarea")&&r&&(r.on("submit",e),r.$.submit&&r.$.submit.call&&r.$.submit.apply&&(r.$.submit=CKEDITOR.tools.override(r.$.submit,function(t){return function(){e(),t.apply?t.apply(this):t()}})),t.on("destroy",function(){r.removeListener("submit",e)}))},destroy:function(e){this.fire("beforeDestroy"),!e&&c.call(this),this.editable(null),this.filter.destroy(),delete this.filter,delete this.activeFilter,this.status="destroyed",this.fire("destroy"),this.removeAllListeners(),CKEDITOR.remove(this),CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(e){if(!e){e=this.getSelection();if(!e)return null;e=e.getStartElement()}return e?new CKEDITOR.dom.elementPath(e,this.editable()):null},createRange:function(){var e=this.editable();return e?new CKEDITOR.dom.range(e):null},execCommand:function(e,t){var n=this.getCommand(e),r={name:e,commandData:t,command:n};if(n&&n.state!=CKEDITOR.TRISTATE_DISABLED&&this.fire("beforeCommandExec",r)!==!1){r.returnValue=n.exec(r.commandData);if(!n.async&&this.fire("afterCommandExec",r)!==!1)return r.returnValue}return!1},getCommand:function(e){return this.commands[e]},getData:function(e){!e&&this.fire("beforeGetData");var t=this._.data;return typeof t!="string"&&(t=(t=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?t.is("textarea")?t.getValue():t.getHtml():""),t={dataValue:t},!e&&this.fire("getData",t),t.dataValue},getSnapshot:function(){var e=this.fire("getSnapshot");if(typeof e!="string"){var t=this.element;t&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(e=t.is("textarea")?t.getValue():t.getHtml())}return e},loadSnapshot:function(e){this.fire("loadSnapshot",e)},setData:function(e,t,n){var r=!0,i=t;t&&typeof t=="object"&&(n=t.internal,i=t.callback,r=!t.noSnapshot),!n&&r&&this.fire("saveSnapshot"),(i||!n)&&this.once("dataReady",function(e){!n&&r&&this.fire("saveSnapshot"),i&&i.call(e.editor)}),e={dataValue:e},!n&&this.fire("setData",e),this._.data=e.dataValue,!n&&this.fire("afterSetData",e)},setReadOnly:function(e){e=e==null||e,this.readOnly!=e&&(this.readOnly=e,this.keystrokeHandler.blockedKeystrokes[8]=+e,this.editable().setReadOnly(e),this.fire("readOnly"))},insertHtml:function(e,t){this.fire("insertHtml",{dataValue:e,mode:t})},insertText:function(e){this.fire("insertText",e)},insertElement:function(e){this.fire("insertElement",e)},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return this.status=="ready"&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return c.call(this)},setKeystroke:function(){for(var e=this.keystrokeHandler.keystrokes,t=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],n,r,i=t.length;i--;)n=t[i],r=0,CKEDITOR.tools.isArray(n)&&(r=n[1],n=n[0]),r?e[n]=r:delete e[n]},addFeature:function(e){return this.filter.addFeature(e)},setActiveFilter:function(e){e||(e=this.filter),this.activeFilter!==e&&(this.activeFilter=e,this.fire("activeFilterChange"),e===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(e.getAllowedEnterMode(this.enterMode),e.getAllowedEnterMode(this.shiftEnterMode,!0)))},setActiveEnterMode:function(e,t){e=e?this.blockless?CKEDITOR.ENTER_BR:e:this.enterMode,t=t?this.blockless?CKEDITOR.ENTER_BR:t:this.shiftEnterMode;if(this.activeEnterMode!=e||this.activeShiftEnterMode!=t)this.activeEnterMode=e,this.activeShiftEnterMode=t,this.fire("activeEnterModeChange")}})}(),CKEDITOR.ELEMENT_MODE_NONE=0,CKEDITOR.ELEMENT_MODE_REPLACE=1,CKEDITOR.ELEMENT_MODE_APPENDTO=2,CKEDITOR.ELEMENT_MODE_INLINE=3,CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}},function(){var e=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,t={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){for(var r,i,s=0,o;r=this._.htmlPartsRegex.exec(n);){i=r.index,i>s&&(s=n.substring(s,i),o?o.push(s):this.onText(s)),s=this._.htmlPartsRegex.lastIndex;if(i=r[1]){i=i.toLowerCase(),o&&CKEDITOR.dtd.$cdata[i]&&(this.onCDATA(o.join("")),o=null);if(!o){this.onTagClose(i);continue}}if(o)o.push(r[0]);else if(i=r[3]){i=i.toLowerCase();if(!/="/.test(i)){var u={},f,l=r[4];r=!!r[5];if(l)for(;f=e.exec(l);){var c=f[1].toLowerCase();f=f[2]||f[3]||f[4]||"",u[c]=!f&&t[c]?c:CKEDITOR.tools.htmlDecodeAttr(f)}this.onTagOpen(i,u,r),!o&&CKEDITOR.dtd.$cdata[i]&&(o=[])}}else(i=r[2])&&this.onComment(i)}n.length>s&&this.onText(n.substring(s,n.length))}}}(),CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(e){this._.output.push("<",e)},openTagClose:function(e,t){t?this._.output.push(" />"):this._.output.push(">")},attribute:function(e,t){typeof t=="string"&&(t=CKEDITOR.tools.htmlEncodeAttr(t)),this._.output.push(" ",e,'="',t,'"')},closeTag:function(e){this._.output.push("</",e,">")},text:function(e){this._.output.push(e)},comment:function(e){this._.output.push("<!--",e,"-->")},write:function(e){this._.output.push(e)},reset:function(){this._.output=[],this._.indent=!1},getHtml:function(e){var t=this._.output.join("");return e&&this.reset(),t}}}),"use strict",function(){CKEDITOR.htmlParser.node=function(){},CKEDITOR.htmlParser.node.prototype={remove:function(){var e=this.parent.children,t=CKEDITOR.tools.indexOf(e,this),n=this.previous,r=this.next;n&&(n.next=r),r&&(r.previous=n),e.splice(t,1),this.parent=null},replaceWith:function(e){var t=this.parent.children,n=CKEDITOR.tools.indexOf(t,this),r=e.previous=this.previous,i=e.next=this.next;r&&(r.next=e),i&&(i.previous=e),t[n]=e,e.parent=this.parent,this.parent=null},insertAfter:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e),r=e.next;t.splice(n+1,0,this),this.next=e.next,this.previous=e,e.next=this,r&&(r.previous=this),this.parent=e.parent},insertBefore:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e);t.splice(n,0,this),this.next=e,(this.previous=e.previous)&&(e.previous.next=this),e.previous=this,this.parent=e.parent},getAscendant:function(e){var t=typeof e=="function"?e:typeof e=="string"?function(t){return t.name==e}:function(t){return t.name in e},n=this.parent;for(;n&&n.type==CKEDITOR.NODE_ELEMENT;){if(t(n))return n;n=n.parent}return null},wrapWith:function(e){return this.replaceWith(e),e.add(this),e},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(e){return e||{}}}}(),"use strict",CKEDITOR.htmlParser.comment=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(e,t){var n=this.value;return(n=e.onComment(t,n,this))?typeof n!="string"?(this.replaceWith(n),!1):(this.value=n,!0):(this.remove(),!1)},writeHtml:function(e,t){t&&this.filter(t),e.comment(this.value)}}),"use strict",function(){CKEDITOR.htmlParser.text=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(e,t){if(!(this.value=e.onText(t,this.value,this)))return this.remove(),!1},writeHtml:function(e,t){t&&this.filter(t),e.text(this.value)}})}(),"use strict",function(){CKEDITOR.htmlParser.cdata=function(e){this.value=e},CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(e){e.write(this.value)}})}(),"use strict",CKEDITOR.htmlParser.fragment=function(){this.children=[],this.parent=null,this._={isBlockLike:!0,hasInlineStarted:!1}},function(){function e(e){return e.attributes["data-cke-survive"]?!1:e.name=="a"&&e.attributes.href||CKEDITOR.dtd.$removeEmpty[e.name]}var t=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),n={ol:1,ul:1},r=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),i={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(s,o,u){function f(e){var t;if(w.length>0)for(var n=0;n<w.length;n++){var r=w[n],i=r.name,s=CKEDITOR.dtd[i],o=S.name&&CKEDITOR.dtd[S.name];(!o||o[i])&&(!e||!s||s[e]||!CKEDITOR.dtd[e])?(t||(l(),t=1),r=r.clone(),r.parent=S,S=r,w.splice(n,1),n--):i==S.name&&(p(S,S.parent,1),n--)}}function l(){for(;E.length;)p(E.shift(),S)}function h(e){if(e._.isBlockLike&&e.name!="pre"&&e.name!="textarea"){var t=e.children.length,n=e.children[t-1],r;n&&n.type==CKEDITOR.NODE_TEXT&&((r=CKEDITOR.tools.rtrim(n.value))?n.value=r:e.children.length=t-1)}}function p(t,n,r){var n=n||S||y,i=S;t.previous===void 0&&(d(n,t)&&(S=n,m.onTagOpen(u,{}),t.returnPoint=n=S),h(t),(!e(t)||t.children.length)&&n.add(t),t.name=="pre"&&(T=!1),t.name=="textarea"&&(x=!1)),t.returnPoint?(S=t.returnPoint,delete t.returnPoint):S=r?n:i}function d(e,t){if((e==y||e.name=="body")&&u&&(!e.name||CKEDITOR.dtd[e.name][u])){var n,r;return(n=t.attributes&&(r=t.attributes["data-cke-real-element-type"])?r:t.name)&&n in CKEDITOR.dtd.$inline&&!(n in CKEDITOR.dtd.head)&&!t.isOrphan||t.type==CKEDITOR.NODE_TEXT}}function v(e,t){return e in CKEDITOR.dtd.$listItem||e in CKEDITOR.dtd.$tableContent?e==t||e=="dt"&&t=="dd"||e=="dd"&&t=="dt":!1}var m=new CKEDITOR.htmlParser,y=o instanceof CKEDITOR.htmlParser.element?o:typeof o=="string"?new CKEDITOR.htmlParser.element(o):new CKEDITOR.htmlParser.fragment,w=[],E=[],S=y,x=y.name=="textarea",T=y.name=="pre";m.onTagOpen=function(i,s,o,u){s=new CKEDITOR.htmlParser.element(i,s),s.isUnknown&&o&&(s.isEmpty=!0),s.isOptionalClose=u;if(e(s))w.push(s);else{if(i=="pre")T=!0;else{if(i=="br"&&T){S.add(new CKEDITOR.htmlParser.text("\n"));return}i=="textarea"&&(x=!0)}if(i=="br")E.push(s);else{for(;;){u=(o=S.name)?CKEDITOR.dtd[o]||(S._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):r;if(!(!s.isUnknown&&!S.isUnknown&&!u[i]))break;if(S.isOptionalClose)m.onTagClose(o);else if(i in n&&o in n)o=S.children,(o=o[o.length-1])&&o.name=="li"||p(o=new CKEDITOR.htmlParser.element("li"),S),!s.returnPoint&&(s.returnPoint=S),S=o;else if(i in CKEDITOR.dtd.$listItem&&!v(i,o))m.onTagOpen(i=="li"?"ul":"dl",{},0,1);else if(o in t&&!v(i,o))!s.returnPoint&&(s.returnPoint=S),S=S.parent;else{o in CKEDITOR.dtd.$inline&&w.unshift(S);if(!S.parent){s.isOrphan=1;break}p(S,S.parent,1)}}f(i),l(),s.parent=S,s.isEmpty?p(s):S=s}}},m.onTagClose=function(e){for(var t=w.length-1;t>=0;t--)if(e==w[t].name){w.splice(t,1);return}for(var n=[],r=[],i=S;i!=y&&i.name!=e;)i._.isBlockLike||r.unshift(i),n.push(i),i=i.returnPoint||i.parent;if(i!=y){for(t=0;t<n.length;t++){var s=n[t];p(s,s.parent)}S=i,i._.isBlockLike&&l(),p(i,i.parent),i==S&&(S=S.parent),w=w.concat(r)}e=="body"&&(u=!1)},m.onText=function(e){if((!S._.hasInlineStarted||E.length)&&!T&&!x){e=CKEDITOR.tools.ltrim(e);if(e.length===0)return}var n=S.name,s=n?CKEDITOR.dtd[n]||(S._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):r;!x&&!s["#"]&&n in t?(m.onTagOpen(i[n]||""),m.onText(e)):(l(),f(),!T&&!x&&(e=e.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," ")),e=new CKEDITOR.htmlParser.text(e),d(S,e)&&this.onTagOpen(u,{},0,1),S.add(e))},m.onCDATA=function(e){S.add(new CKEDITOR.htmlParser.cdata(e))},m.onComment=function(e){l(),f(),S.add(new CKEDITOR.htmlParser.comment(e))},m.parse(s);for(l();S!=y;)p(S,S.parent,1);return h(y),y},CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(e,t){isNaN(t)&&(t=this.children.length);var n=t>0?this.children[t-1]:null;if(n){if(e._.isBlockLike&&n.type==CKEDITOR.NODE_TEXT){n.value=CKEDITOR.tools.rtrim(n.value);if(n.value.length===0){this.children.pop(),this.add(e);return}}n.next=e}e.previous=n,e.parent=this,this.children.splice(t,0,e),this._.hasInlineStarted||(this._.hasInlineStarted=e.type==CKEDITOR.NODE_TEXT||e.type==CKEDITOR.NODE_ELEMENT&&!e._.isBlockLike)},filter:function(e,t){t=this.getFilterContext(t),e.onRoot(t,this),this.filterChildren(e,!1,t)},filterChildren:function(e,t,n){if(this.childrenFilteredBy!=e.id){n=this.getFilterContext(n),t&&!this.parent&&e.onRoot(n,this),this.childrenFilteredBy=e.id;for(t=0;t<this.children.length;t++)this.children[t].filter(e,n)===!1&&t--}},writeHtml:function(e,t){t&&this.filter(t),this.writeChildrenHtml(e)},writeChildrenHtml:function(e,t,n){var r=this.getFilterContext();n&&!this.parent&&t&&t.onRoot(r,this),t&&this.filterChildren(t,!1,r),t=0,n=this.children;for(r=n.length;t<r;t++)n[t].writeHtml(e)},forEach:function(e,t,n){if(!n&&(!t||this.type==t))var r=e(this);if(r!==!1)for(var n=this.children,i=0;i<n.length;i++)r=n[i],r.type==CKEDITOR.NODE_ELEMENT?r.forEach(e,t):(!t||r.type==t)&&e(r)},getFilterContext:function(e){return e||{}}}}(),"use strict",function(){function e(){this.rules=[]}function t(t,n,r,i){var s,o;for(s in n)(o=t[s])||(o=t[s]=new e),o.add(n[s],r,i)}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(t){this.id=CKEDITOR.tools.getNextNumber(),this.elementNameRules=new e,this.attributeNameRules=new e,this.elementsRules={},this.attributesRules={},this.textRules=new e,this.commentRules=new e,this.rootRules=new e,t&&this.addRules(t,10)},proto:{addRules:function(e,n){var r;typeof n=="number"?r=n:n&&"priority"in n&&(r=n.priority),typeof r!="number"&&(r=10),typeof n!="object"&&(n={}),e.elementNames&&this.elementNameRules.addMany(e.elementNames,r,n),e.attributeNames&&this.attributeNameRules.addMany(e.attributeNames,r,n),e.elements&&t(this.elementsRules,e.elements,r,n),e.attributes&&t(this.attributesRules,e.attributes,r,n),e.text&&this.textRules.add(e.text,r,n),e.comment&&this.commentRules.add(e.comment,r,n),e.root&&this.rootRules.add(e.root,r,n)},applyTo:function(e){e.filter(this)},onElementName:function(e,t){return this.elementNameRules.execOnName(e,t)},onAttributeName:function(e,t){return this.attributeNameRules.execOnName(e,t)},onText:function(e,t,n){return this.textRules.exec(e,t,n)},onComment:function(e,t,n){return this.commentRules.exec(e,t,n)},onRoot:function(e,t){return this.rootRules.exec(e,t)},onElement:function(e,t){for(var n=[this.elementsRules["^"],this.elementsRules[t.name],this.elementsRules.$],r,i=0;i<3;i++)if(r=n[i]){r=r.exec(e,t,this);if(r===!1)return null;if(r&&r!=t)return this.onNode(e,r);if(t.parent&&!t.name)break}return t},onNode:function(e,t){var n=t.type;return n==CKEDITOR.NODE_ELEMENT?this.onElement(e,t):n==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(e,t.value)):n==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(e,t.value)):null},onAttribute:function(e,t,n,r){return(n=this.attributesRules[n])?n.exec(e,r,t,this):r}}}),CKEDITOR.htmlParser.filterRulesGroup=e,e.prototype={add:function(e,t,n){this.rules.splice(this.findIndex(t),0,{value:e,priority:t,options:n})},addMany:function(e,t,n){for(var r=[this.findIndex(t),0],i=0,s=e.length;i<s;i++)r.push({value:e[i],priority:t,options:n});this.rules.splice.apply(this.rules,r)},findIndex:function(e){for(var t=this.rules,n=t.length-1;n>=0&&e<t[n].priority;)n--;return n+1},exec:function(e,t){var n=t instanceof CKEDITOR.htmlParser.node||t instanceof CKEDITOR.htmlParser.fragment,r=Array.prototype.slice.call(arguments,1),i=this.rules,s=i.length,o,u,a,f;for(f=0;f<s;f++){n&&(o=t.type,u=t.name),a=i[f];if(!(e.nonEditable&&!a.options.applyToAll||e.nestedEditable&&a.options.excludeNestedEditable)){a=a.value.apply(null,r);if(a===!1||n&&a&&(a.name!=u||a.type!=o))return a;a!=null&&(r[0]=t=a)}}return t},execOnName:function(e,t){for(var n=0,r=this.rules,i=r.length,s;t&&n<i;n++)s=r[n],!(e.nonEditable&&!s.options.applyToAll||e.nestedEditable&&s.options.excludeNestedEditable)&&(t=t.replace(s.value[0],s.value[1]));return t}}}(),function(){function e(e,t){function u(e){return e||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function a(e,t){return function(i){if(i.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var o=[],a=n(i),l,h;if(a)for(f(a,1)&&o.push(a);a;)s(a)&&(l=r(a))&&f(l)&&((h=r(l))&&!s(h)?o.push(l):(u(c).insertAfter(l),l.remove())),a=a.previous;for(a=0;a<o.length;a++)o[a].remove();if(o=!e||(typeof t=="function"?t(i):t)!==!1)!c&&!CKEDITOR.env.needsBrFiller&&i.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT?o=!1:!c&&!CKEDITOR.env.needsBrFiller&&(document.documentMode>7||i.name in CKEDITOR.dtd.tr||i.name in CKEDITOR.dtd.$listItem)?o=!1:(o=n(i),o=!o||i.name=="form"&&o.name=="input");o&&i.add(u(e))}}}function f(e,t){if((!c||CKEDITOR.env.needsBrFiller)&&e.type==CKEDITOR.NODE_ELEMENT&&e.name=="br"&&!e.attributes["data-cke-eol"])return!0;var n;if(e.type==CKEDITOR.NODE_TEXT&&(n=e.value.match(m))){n.index&&((new CKEDITOR.htmlParser.text(e.value.substring(0,n.index))).insertBefore(e),e.value=n[0]);if(!CKEDITOR.env.needsBrFiller&&c&&(!t||e.parent.name in h))return!0;if(!c)if((n=e.previous)&&n.name=="br"||!n||s(n))return!0}return!1}var l={elements:{}},c=t=="html",h=CKEDITOR.tools.extend({},w),p;for(p in h)"#"in y[p]||delete h[p];for(p in h)l.elements[p]=a(c,e.config.fillEmptyBlocks);return l.root=a(c,!1),l.elements.br=function(e){return function(t){if(t.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var n=t.attributes;if("data-cke-bogus"in n||"data-cke-eol"in n)delete n["data-cke-bogus"];else{for(n=t.next;n&&i(n);)n=n.next;var a=r(t);!n&&s(t.parent)?o(t.parent,u(e)):s(n)&&a&&!s(a)&&u(e).insertBefore(n)}}}}(c),l}function t(e,t){return e!=CKEDITOR.ENTER_BR&&t!==!1?e==CKEDITOR.ENTER_DIV?"div":"p":!1}function n(e){for(e=e.children[e.children.length-1];e&&i(e);)e=e.previous;return e}function r(e){for(e=e.previous;e&&i(e);)e=e.previous;return e}function i(e){return e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(e.value)||e.type==CKEDITOR.NODE_ELEMENT&&e.attributes["data-cke-bookmark"]}function s(e){return e&&(e.type==CKEDITOR.NODE_ELEMENT&&e.name in w||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function o(e,t){var n=e.children[e.children.length-1];e.children.push(t),t.parent=e,n&&(n.next=t,t.previous=n)}function u(e){e=e.attributes,e.contenteditable!="false"&&(e["data-cke-editable"]=e.contenteditable?"true":1),e.contenteditable="false"}function a(e){e=e.attributes;switch(e["data-cke-editable"]){case"true":e.contenteditable="true";break;case"1":delete e.contenteditable}}function f(e){return e.replace(N,function(e,t,n){return"<"+t+n.replace(C,function(e,t){return k.test(t)&&n.indexOf("data-cke-saved-"+t)==-1?" data-cke-saved-"+e+" data-cke-"+CKEDITOR.rnd+"-"+e:e})+">"})}function l(e,t){return e.replace(t,function(e,t,n){return e.indexOf("<textarea")===0&&(e=t+p(n).replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</textarea>"),"<cke:encoded>"+encodeURIComponent(e)+"</cke:encoded>"})}function c(e){return e.replace(O,function(e,t){return decodeURIComponent(t)})}function h(e){return e.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,function(e){return"<!--"+g+"{C}"+encodeURIComponent(e).replace(/--/g,"%2D%2D")+"-->"})}function p(e){return e.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(e,t){return decodeURIComponent(t)})}function d(e,t){var n=t._.dataStore;return e.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(e,t){return decodeURIComponent(t)}).replace(/\{cke_protected_(\d+)\}/g,function(e,t){return n&&n[t]||""})}function v(e,t){for(var n=[],r=t.config.protectedSource,i=t._.dataStore||(t._.dataStore={id:1}),s=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,r=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(r),e=e.replace(/<\!--[\s\S]*?--\>/g,function(e){return"<!--{cke_tempcomment}"+(n.push(e)-1)+"-->"}),o=0;o<r.length;o++)e=e.replace(r[o],function(e){return e=e.replace(s,function(e,t,r){return n[r]}),/cke_temp(comment)?/.test(e)?e:"<!--{cke_temp}"+(n.push(e)-1)+"-->"});return e=e.replace(s,function(e,t,r){return"<!--"+g+(t?"{C}":"")+encodeURIComponent(n[r]).replace(/--/g,"%2D%2D")+"-->"}),e=e.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=>]+))+\s*>/g,function(e){return e.replace(/<\!--\{cke_protected\}([^>]*)--\>/g,function(e,t){return i[i.id]=decodeURIComponent(t),"{cke_protected_"+i.id++ +"}"})}),e=e.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(e,n,r,i){return"<"+n+r+">"+d(p(i),t)+"</"+n+">"})}CKEDITOR.htmlDataProcessor=function(n){var r,i,s=this;this.editor=n,this.dataFilter=r=new CKEDITOR.htmlParser.filter,this.htmlFilter=i=new CKEDITOR.htmlParser.filter,this.writer=new CKEDITOR.htmlParser.basicWriter,r.addRules(E),r.addRules(S,{applyToAll:!0}),r.addRules(e(n,"data"),{applyToAll:!0}),i.addRules(x),i.addRules(T,{applyToAll:!0}),i.addRules(e(n,"html"),{applyToAll:!0}),n.on("toHtml",function(e){var e=e.data,r=e.dataValue,i,r=v(r,n),r=l(r,A),r=f(r),r=l(r,L),r=r.replace(M,"$1cke:$2"),r=r.replace(D,"<cke:$1$2></cke:$1>"),r=r.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),r=r.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");i=e.context||n.editable().getName();var s;CKEDITOR.env.ie&&CKEDITOR.env.version<9&&i=="pre"&&(i="div",r="<pre>"+r+"</pre>",s=1),i=n.document.createElement(i),i.setHtml("a"+r),r=i.getHtml().substr(1),r=r.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),""),s&&(r=r.replace(/^<pre>|<\/pre>$/gi,"")),r=r.replace(_,"$1$2"),r=c(r),r=p(r),i=e.fixForBody===!1?!1:t(e.enterMode,n.config.autoParagraph),r=CKEDITOR.htmlParser.fragment.fromHtml(r,e.context,i),i&&(s=r,!s.children.length&&CKEDITOR.dtd[s.name][i]&&(i=new CKEDITOR.htmlParser.element(i),s.add(i))),e.dataValue=r},null,null,5),n.on("toHtml",function(e){e.data.filter.applyTo(e.data.dataValue,!0,e.data.dontFilter,e.data.enterMode)&&n.fire("dataFiltered")},null,null,6),n.on("toHtml",function(e){e.data.dataValue.filterChildren(s.dataFilter,!0)},null,null,10),n.on("toHtml",function(e){var e=e.data,t=e.dataValue,n=new CKEDITOR.htmlParser.basicWriter;t.writeChildrenHtml(n),t=n.getHtml(!0),e.dataValue=h(t)},null,null,15),n.on("toDataFormat",function(e){var r=e.data.dataValue;e.data.enterMode!=CKEDITOR.ENTER_BR&&(r=r.replace(/^<br *\/?>/i,"")),e.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(r,e.data.context,t(e.data.enterMode,n.config.autoParagraph))},null,null,5),n.on("toDataFormat",function(e){e.data.dataValue.filterChildren(s.htmlFilter,!0)},null,null,10),n.on("toDataFormat",function(e){e.data.filter.applyTo(e.data.dataValue,!1,!0)},null,null,11),n.on("toDataFormat",function(e){var t=e.data.dataValue,r=s.writer;r.reset(),t.writeChildrenHtml(r),t=r.getHtml(!0),t=p(t),t=d(t,n),e.data.dataValue=t},null,null,15)},CKEDITOR.htmlDataProcessor.prototype={toHtml:function(e,t,n,r){var i=this.editor,s,o,u;return t&&typeof t=="object"?(s=t.context,n=t.fixForBody,r=t.dontFilter,o=t.filter,u=t.enterMode):s=t,!s&&s!==null&&(s=i.editable().getName()),i.fire("toHtml",{dataValue:e,context:s,fixForBody:n,dontFilter:r,filter:o||i.filter,enterMode:u||i.enterMode}).dataValue},toDataFormat:function(e,t){var n,r,i;return t&&(n=t.context,r=t.filter,i=t.enterMode),!n&&n!==null&&(n=this.editor.editable().getName()),this.editor.fire("toDataFormat",{dataValue:e,filter:r||this.editor.filter,context:n,enterMode:i||this.editor.enterMode}).dataValue}};var m=/(?:&nbsp;|\xa0)$/,g="{cke_protected}",y=CKEDITOR.dtd,b=["caption","colgroup","col","thead","tfoot","tbody"],w=CKEDITOR.tools.extend({},y.$blockLimit,y.$block),E={elements:{input:u,textarea:u}},S={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},x={elements:{embed:function(e){var t=e.parent;if(t&&t.name=="object"){var n=t.attributes.width,t=t.attributes.height;n&&(e.attributes.width=n),t&&(e.attributes.height=t)}},a:function(e){if(!e.children.length&&!e.attributes.name&&!e.attributes["data-cke-saved-name"])return!1}}},T={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(e){var t=e.attributes;if(t){if(t["data-cke-temp"])return!1;for(var n=["name","href","src"],r,i=0;i<n.length;i++)r="data-cke-saved-"+n[i],r in t&&delete t[n[i]]}return e},table:function(e){e.children.slice(0).sort(function(e,t){var n,r;return e.type==CKEDITOR.NODE_ELEMENT&&t.type==e.type&&(n=CKEDITOR.tools.indexOf(b,e.name),r=CKEDITOR.tools.indexOf(b,t.name)),n>-1&&r>-1&&n!=r||(n=e.parent?e.getIndex():-1,r=t.parent?t.getIndex():-1),n>r?1:-1})},param:function(e){return e.children=[],e.isEmpty=!0,e},span:function(e){e.attributes["class"]=="Apple-style-span"&&delete e.name},html:function(e){delete e.attributes.contenteditable,delete e.attributes["class"]},body:function(e){delete e.attributes.spellcheck,delete e.attributes.contenteditable},style:function(e){var t=e.children[0];t&&t.value&&(t.value=CKEDITOR.tools.trim(t.value)),e.attributes.type||(e.attributes.type="text/css")},title:function(e){var t=e.children[0];!t&&o(e,t=new CKEDITOR.htmlParser.text),t.value=e.attributes["data-cke-title"]||""},input:a,textarea:a},attributes:{"class":function(e){return CKEDITOR.tools.ltrim(e.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(T.attributes.style=function(e){return e.replace(/(^|;)([^\:]+)/g,function(e){return e.toLowerCase()})});var N=/<(a|area|img|input|source)\b([^>]*)>/gi,C=/([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,k=/^(href|src|name)$/i,L=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,A=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,O=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,M=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,_=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,D=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi}(),"use strict",CKEDITOR.htmlParser.element=function(e,t){this.name=e,this.attributes=t||{},this.children=[];var n=e||"",r=n.match(/^cke:(.*)/);r&&(n=r[1]),n=!(!CKEDITOR.dtd.$nonBodyContent[n]&&!CKEDITOR.dtd.$block[n]&&!CKEDITOR.dtd.$listItem[n]&&!CKEDITOR.dtd.$tableContent[n]&&!CKEDITOR.dtd.$nonEditable[n]&&n!="br"),this.isEmpty=!!CKEDITOR.dtd.$empty[e],this.isUnknown=!CKEDITOR.dtd[e],this._={isBlockLike:n,hasInlineStarted:this.isEmpty||!n}},CKEDITOR.htmlParser.cssStyle=function(e){var t={};return((e instanceof CKEDITOR.htmlParser.element?e.attributes.style:e)||"").replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,n,r){n=="font-family"&&(r=r.replace(/["']/g,"")),t[n.toLowerCase()]=r}),{rules:t,populate:function(e){var t=this.toString();t&&(e instanceof CKEDITOR.dom.element?e.setAttribute("style",t):e instanceof CKEDITOR.htmlParser.element?e.attributes.style=t:e.style=t)},toString:function(){var e=[],n;for(n in t)t[n]&&e.push(n,":",t[n],";");return e.join("")}}},function(){function e(e){return function(t){return t.type==CKEDITOR.NODE_ELEMENT&&(typeof e=="string"?t.name==e:t.name in e)}}var t=function(e,t){return e=e[0],t=t[0],e<t?-1:e>t?1:0},n=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:n.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(e,t){var n=this,r,i,t=n.getFilterContext(t);if(t.off)return!0;n.parent||e.onRoot(t,n);for(;;){r=n.name;if(!(i=e.onElementName(t,r)))return this.remove(),!1;n.name=i;if(!(n=e.onElement(t,n)))return this.remove(),!1;if(n!==this)return this.replaceWith(n),!1;if(n.name==r)break;if(n.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(n),!1;if(!n.name)return this.replaceWithChildren(),!1}r=n.attributes;var s,o;for(s in r){o=s;for(i=r[s];;){if(!(o=e.onAttributeName(t,s))){delete r[s];break}if(o==s)break;delete r[s],s=o}o&&((i=e.onAttribute(t,n,o,i))===!1?delete r[o]:r[o]=i)}return n.isEmpty||this.filterChildren(e,!1,t),!0},filterChildren:n.filterChildren,writeHtml:function(e,n){n&&this.filter(n);var r=this.name,i=[],s=this.attributes,o,u;e.openTag(r,s);for(o in s)i.push([o,s[o]]);e.sortAttributes&&i.sort(t),o=0;for(u=i.length;o<u;o++)s=i[o],e.attribute(s[0],s[1]);e.openTagClose(r,this.isEmpty),this.writeChildrenHtml(e),this.isEmpty||e.closeTag(r)},writeChildrenHtml:n.writeChildrenHtml,replaceWithChildren:function(){for(var e=this.children,t=e.length;t;)e[--t].insertAfter(this);this.remove()},forEach:n.forEach,getFirst:function(t){if(!t)return this.children.length?this.children[0]:null;typeof t!="function"&&(t=e(t));for(var n=0,r=this.children.length;n<r;++n)if(t(this.children[n]))return this.children[n];return null},getHtml:function(){var e=new CKEDITOR.htmlParser.basicWriter;return this.writeChildrenHtml(e),e.getHtml()},setHtml:function(e){for(var e=this.children=CKEDITOR.htmlParser.fragment.fromHtml(e).children,t=0,n=e.length;t<n;++t)e[t].parent=this},getOuterHtml:function(){var e=new CKEDITOR.htmlParser.basicWriter;return this.writeHtml(e),e.getHtml()},split:function(e){for(var t=this.children.splice(e,this.children.length-e),n=this.clone(),r=0;r<t.length;++r)t[r].parent=n;return n.children=t,t[0]&&(t[0].previous=null),e>0&&(this.children[e-1].next=null),this.parent.add(n,this.getIndex()+1),n},addClass:function(e){if(!this.hasClass(e)){var t=this.attributes["class"]||"";this.attributes["class"]=t+(t?" ":"")+e}},removeClass:function(e){var t=this.attributes["class"];t&&((t=CKEDITOR.tools.trim(t.replace(RegExp("(?:\\s+|^)"+e+"(?:\\s+|$)")," ")))?this.attributes["class"]=t:delete this.attributes["class"])},hasClass:function(e){var t=this.attributes["class"];return t?RegExp("(?:^|\\s)"+e+"(?=\\s|$)").test(t):!1},getFilterContext:function(e){var t=[];e||(e={off:!1,nonEditable:!1,nestedEditable:!1}),!e.off&&this.attributes["data-cke-processor"]=="off"&&t.push("off",!0),!e.nonEditable&&this.attributes.contenteditable=="false"?t.push("nonEditable",!0):e.nonEditable&&!e.nestedEditable&&this.attributes.contenteditable=="true"&&t.push("nestedEditable",!0);if(t.length)for(var e=CKEDITOR.tools.copy(e),n=0;n<t.length;n+=2)e[t[n]]=t[n+1];return e}},!0)}(),function(){var e={},t=/{([^}]+)}/g,n=/([\\'])/g,r=/\n/g,i=/\r/g;CKEDITOR.template=function(s){if(e[s])this.output=e[s];else{var o=s.replace(n,"\\$1").replace(r,"\\n").replace(i,"\\r").replace(t,function(e,t){return"',data['"+t+"']==undefined?'{"+t+"}':data['"+t+"'],'"});this.output=e[s]=Function("data","buffer","return buffer?buffer.push('"+o+"'):['"+o+"'].join('');")}}}(),delete CKEDITOR.loadFullCore,CKEDITOR.instances={},CKEDITOR.document=new CKEDITOR.dom.document(document),CKEDITOR.add=function(e){CKEDITOR.instances[e.name]=e,e.on("focus",function(){CKEDITOR.currentInstance!=e&&(CKEDITOR.currentInstance=e,CKEDITOR.fire("currentInstance"))}),e.on("blur",function(){CKEDITOR.currentInstance==e&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}),CKEDITOR.fire("instance",null,e)},CKEDITOR.remove=function(e){delete CKEDITOR.instances[e.name]},function(){var e={};CKEDITOR.addTemplate=function(t,n){var r=e[t];return r?r:(r={name:t,source:n},CKEDITOR.fire("template",r),e[t]=new CKEDITOR.template(r.source))},CKEDITOR.getTemplate=function(t){return e[t]}}(),function(){var e=[];CKEDITOR.addCss=function(t){e.push(t)},CKEDITOR.getCss=function(){return e.join("\n")}}(),CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")}),CKEDITOR.TRISTATE_ON=1,CKEDITOR.TRISTATE_OFF=2,CKEDITOR.TRISTATE_DISABLED=0,function(){CKEDITOR.inline=function(e,t){if(!CKEDITOR.env.isCompatible)return null;e=CKEDITOR.dom.element.get(e);if(e.getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var n=new CKEDITOR.editor(t,e,CKEDITOR.ELEMENT_MODE_INLINE),r=e.is("textarea")?e:null;return r?(n.setData(r.getValue(),null,!0),e=CKEDITOR.dom.element.createFromHtml('<div contenteditable="'+!!n.readOnly+'" class="cke_textarea_inline">'+r.getValue()+"</div>",CKEDITOR.document),e.insertAfter(r),r.hide(),r.$.form&&n._attachToForm()):n.setData(e.getHtml(),null,!0),n.on("loaded",function(){n.fire("uiReady"),n.editable(e),n.container=e,n.setData(n.getData(1)),n.resetDirty(),n.fire("contentDom"),n.mode="wysiwyg",n.fire("mode"),n.status="ready",n.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,n)},null,null,1e4),n.on("destroy",function(){r&&(n.container.clearCustomData(),n.container.remove(),r.show()),n.element.clearCustomData(),delete n.element}),n},CKEDITOR.inlineAll=function(){var e,t,n;for(n in CKEDITOR.dtd.$editable)for(var r=CKEDITOR.document.getElementsByTag(n),i=0,s=r.count();i<s;i++)e=r.getItem(i),e.getAttribute("contenteditable")=="true"&&(t={element:e,config:{}},CKEDITOR.fire("inline",t)!==!1&&CKEDITOR.inline(e,t.config))},CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})}(),CKEDITOR.replaceClass="ckeditor",function(){function e(e,r,i,s){if(!CKEDITOR.env.isCompatible)return null;e=CKEDITOR.dom.element.get(e);if(e.getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var o=new CKEDITOR.editor(r,e,s);return s==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.setStyle("visibility","hidden"),o._.required=e.hasAttribute("required"),e.removeAttribute("required")),i&&o.setData(i,null,!0),o.on("loaded",function(){n(o),s==CKEDITOR.ELEMENT_MODE_REPLACE&&o.config.autoUpdateElement&&e.$.form&&o._attachToForm(),o.setMode(o.config.startupMode,function(){o.resetDirty(),o.status="ready",o.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,o)})}),o.on("destroy",t),o}function t(){var e=this.container,t=this.element;e&&(e.clearCustomData(),e.remove()),t&&(t.clearCustomData(),this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(t.show(),this._.required&&t.setAttribute("required","required")),delete this.element)}function n(e){var t=e.name,n=e.element,r=e.elementMode,i=e.fire("uiSpace",{space:"top",html:""}).html,s=e.fire("uiSpace",{space:"bottom",html:""}).html,o=new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'"  dir="{langDir}" lang="{langCode}" role="application"'+(e.title?' aria-labelledby="cke_{name}_arialbl"':"")+">"+(e.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':"")+'<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'),t=CKEDITOR.dom.element.createFromHtml(o.output({id:e.id,name:t,langDir:e.lang.dir,langCode:e.langCode,voiceLabel:e.title,topHtml:i?'<span id="'+e.ui.spaceId("top")+'" class="cke_top cke_reset_all" role="presentation" style="height:auto">'+i+"</span>":"",contentId:e.ui.spaceId("contents"),bottomHtml:s?'<span id="'+e.ui.spaceId("bottom")+'" class="cke_bottom cke_reset_all" role="presentation">'+s+"</span>":"",outerEl:CKEDITOR.env.ie?"span":"div"}));r==CKEDITOR.ELEMENT_MODE_REPLACE?(n.hide(),t.insertAfter(n)):n.append(t),e.container=t,i&&e.ui.space("top").unselectable(),s&&e.ui.space("bottom").unselectable(),n=e.config.width,r=e.config.height,n&&t.setStyle("width",CKEDITOR.tools.cssLength(n)),r&&e.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(r)),t.disableContextMenu(),CKEDITOR.env.webkit&&t.on("focus",function(){e.focus()}),e.fireOnce("uiReady")}CKEDITOR.replace=function(t,n){return e(t,n,null,CKEDITOR.ELEMENT_MODE_REPLACE)},CKEDITOR.appendTo=function(t,n,r){return e(t,n,r,CKEDITOR.ELEMENT_MODE_APPENDTO)},CKEDITOR.replaceAll=function(){for(var e=document.getElementsByTagName("textarea"),t=0;t<e.length;t++){var n=null,r=e[t];if(r.name||r.id){if(typeof arguments[0]=="string"){if(!RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)").test(r.className))continue}else if(typeof arguments[0]=="function"){n={};if(arguments[0](r,n)===!1)continue}this.replace(r,n)}}},CKEDITOR.editor.prototype.addMode=function(e,t){(this._.modes||(this._.modes={}))[e]=t},CKEDITOR.editor.prototype.setMode=function(e,t){var n=this,r=this._.modes;if(e!=n.mode&&!!r&&!!r[e]){n.fire("beforeSetMode",e);if(n.mode){var i=n.checkDirty(),r=n._.previousModeData,s,o=0;n.fire("beforeModeUnload"),n.editable(0),n._.previousMode=n.mode,n._.previousModeData=s=n.getData(1),n.mode=="source"&&r==s&&(n.fire("lockSnapshot",{forceUpdate:!0}),o=1),n.ui.space("contents").setHtml(""),n.mode=""}else n._.previousModeData=n.getData(1);this._.modes[e](function(){n.mode=e,i!==void 0&&!i&&n.resetDirty(),o?n.fire("unlockSnapshot"):e=="wysiwyg"&&n.fire("saveSnapshot"),setTimeout(function(){n.fire("mode"),t&&t.call(n)},0)})}},CKEDITOR.editor.prototype.resize=function(e,t,n,r){var i=this.container,s=this.ui.space("contents"),o=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement,r=r?this.container.getFirst(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.hasClass("cke_inner")}):i;r.setSize("width",e,!0),o&&(o.style.width="1%"),s.setStyle("height",Math.max(t-(n?0:(r.$.offsetHeight||0)-(s.$.clientHeight||0)),0)+"px"),o&&(o.style.width="100%"),this.fire("resize")},CKEDITOR.editor.prototype.getResizable=function(e){return e?this.ui.space("contents"):this.container},CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})}(),CKEDITOR.config.startupMode="wysiwyg",function(){function e(e){var n=e.editor,i=e.data.path,s=i.blockLimit,u=e.data.selection,a=u.getRanges()[0],f;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(u=t(u,i))u.appendBogus(),f=CKEDITOR.env.ie;if(o(n,i.block,s)&&a.collapsed&&!a.getCommonAncestor().isReadOnly()){i=a.clone(),i.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),s=new CKEDITOR.dom.walker(i),s.guard=function(e){return!r(e)||e.type==CKEDITOR.NODE_COMMENT||e.isReadOnly()};if(!s.checkForward()||i.checkStartOfBlock()&&i.checkEndOfBlock())n=a.fixBlock(!0,n.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(n=n.getFirst(r))&&n.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(n.getText()).match(/^(?:&nbsp;|\xa0)$/)&&n.remove(),f=1,e.cancel()}f&&a.select()}function t(e,t){if(e.isFake)return 0;var n=t.block||t.blockLimit,i=n&&n.getLast(r);if(n&&n.isBlockBoundary()&&(!i||i.type!=CKEDITOR.NODE_ELEMENT||!i.isBlockBoundary())&&!n.is("pre")&&!n.getBogus())return n}function n(e){var t=e.data.getTarget();t.is("input")&&(t=t.getAttribute("type"),(t=="submit"||t=="reset")&&e.data.preventDefault())}function r(e){return h(e)&&p(e)}function i(e,t){return function(n){var r=CKEDITOR.dom.element.get(n.data.$.toElement||n.data.$.fromElement||n.data.$.relatedTarget);(!r||!t.equals(r)&&!t.contains(r))&&e.call(this,n)}}function s(e){function t(e){return function(t,i){i&&t.type==CKEDITOR.NODE_ELEMENT&&t.is(s)&&(n=t);if(!i&&r(t)&&(!e||!l(t)))return!1}}var n,i=e.getRanges()[0],e=e.root,s={table:1,ul:1,ol:1,dl:1};if(i.startPath().contains(s)){var o=i.clone();o.collapse(1),o.setStartAt(e,CKEDITOR.POSITION_AFTER_START),e=new CKEDITOR.dom.walker(o),e.guard=t(),e.checkBackward();if(n)return o=i.clone(),o.collapse(),o.setEndAt(n,CKEDITOR.POSITION_AFTER_END),e=new CKEDITOR.dom.walker(o),e.guard=t(!0),n=!1,e.checkForward(),n}return null}function o(e,t,n){return e.config.autoParagraph!==!1&&e.activeEnterMode!=CKEDITOR.ENTER_BR&&e.editable().equals(n)&&!t||t&&t.getAttribute("contenteditable")=="true"}function u(e){e.editor.focus(),e.editor.fire("saveSnapshot")}function a(e){var t=e.editor;t.getSelection().scrollIntoView(),setTimeout(function(){t.fire("saveSnapshot")},0)}function f(e,t,n){for(var r=e.getCommonAncestor(t),t=e=n?t:e;(e=e.getParent())&&!r.equals(e)&&e.getChildCount()==1;)t=e;t.remove()}CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(e,t){this.base(t.$||t),this.editor=e,this.status="unloaded",this.hasFocus=!1,this.setup()},proto:{focus:function(){var e;if(CKEDITOR.env.webkit&&!this.hasFocus){e=this.editor._.previousActive||this.getDocument().getActive();if(this.contains(e)){e.focus();return}}try{this.$[CKEDITOR.env.ie&&this.getDocument().equals(CKEDITOR.document)?"setActive":"focus"]()}catch(t){if(!CKEDITOR.env.ie)throw t}CKEDITOR.env.safari&&!this.isInline()&&(e=CKEDITOR.document.getActive(),e.equals(this.getWindow().getFrame())||this.getWindow().focus())},on:function(e,t){var n=Array.prototype.slice.call(arguments,0);return CKEDITOR.env.ie&&/^focus|blur$/.exec(e)&&(e=e=="focus"?"focusin":"focusout",t=i(t,this),n[0]=e,n[1]=t),CKEDITOR.dom.element.prototype.on.apply(this,n)},attachListener:function(e){!this._.listeners&&(this._.listeners=[]);var t=Array.prototype.slice.call(arguments,1),t=e.on.apply(e,t);return this._.listeners.push(t),t},clearListeners:function(){var e=this._.listeners;try{for(;e.length;)e.pop().removeListener()}catch(t){}},restoreAttrs:function(){var e=this._.attrChanges,t,n;for(n in e)e.hasOwnProperty(n)&&(t=e[n],t!==null?this.setAttribute(n,t):this.removeAttribute(n))},attachClass:function(e){var t=this.getCustomData("classes");this.hasClass(e)||(!t&&(t=[]),t.push(e),this.setCustomData("classes",t),this.addClass(e))},changeAttr:function(e,t){var n=this.getAttribute(e);t!==n&&(!this._.attrChanges&&(this._.attrChanges={}),e in this._.attrChanges||(this._.attrChanges[e]=n),this.setAttribute(e,t))},insertHtml:function(e,t){u(this),d(this,t||"html",e)},insertText:function(e){u(this);var t=this.editor,n=t.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:t.activeEnterMode,t=n==CKEDITOR.ENTER_BR,r=CKEDITOR.tools,e=r.htmlEncode(e.replace(/\r\n/g,"\n")),e=e.replace(/\t/g,"&nbsp;&nbsp; &nbsp;"),n=n==CKEDITOR.ENTER_P?"p":"div";if(!t){var i=/\n{2}/g;if(i.test(e))var s="<"+n+">",o="</"+n+">",e=s+e.replace(i,function(){return o+s})+o}e=e.replace(/\n/g,"<br>"),t||(e=e.replace(RegExp("<br>(?=</"+n+">)"),function(e){return r.repeat(e,2)})),e=e.replace(/^ | $/g,"&nbsp;"),e=e.replace(/(>|\s) /g,function(e,t){return t+"&nbsp;"}).replace(/ (?=<)/g,"&nbsp;"),d(this,"text",e)},insertElement:function(e,t){t?this.insertElementIntoRange(e,t):this.insertElementIntoSelection(e)},insertElementIntoRange:function(e,t){var n=this.editor,r=n.config.enterMode,i=e.getName(),s=CKEDITOR.dtd.$block[i];if(t.checkReadOnly())return!1;t.deleteContents(1),t.startContainer.type==CKEDITOR.NODE_ELEMENT&&t.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})&&v(t);var o,u;if(s)for(;(o=t.getCommonAncestor(0,1))&&(u=CKEDITOR.dtd[o.getName()])&&(!u||!u[i]);)o.getName()in CKEDITOR.dtd.span?t.splitElement(o):t.checkStartOfBlock()&&t.checkEndOfBlock()?(t.setStartBefore(o),t.collapse(!0),o.remove()):t.splitBlock(r==CKEDITOR.ENTER_DIV?"div":"p",n.editable());return t.insertNode(e),!0},insertElementIntoSelection:function(e){u(this);var t=this.editor,n=t.activeEnterMode,t=t.getSelection(),i=t.getRanges()[0],s=e.getName(),s=CKEDITOR.dtd.$block[s];this.insertElementIntoRange(e,i)&&(i.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),s&&((s=e.getNext(function(e){return r(e)&&!l(e)}))&&s.type==CKEDITOR.NODE_ELEMENT&&s.is(CKEDITOR.dtd.$block)?s.getDtd()["#"]?i.moveToElementEditStart(s):i.moveToElementEditEnd(e):!s&&n!=CKEDITOR.ENTER_BR&&(s=i.fixBlock(!0,n==CKEDITOR.ENTER_DIV?"div":"p"),i.moveToElementEditStart(s)))),t.selectRanges([i]),a(this)},setData:function(e,t){t||(e=this.editor.dataProcessor.toHtml(e)),this.setHtml(e),this.fixInitialSelection(),this.status=="unloaded"&&(this.status="ready"),this.editor.fire("dataReady")},getData:function(e){var t=this.getHtml();return e||(t=this.editor.dataProcessor.toDataFormat(t)),t},setReadOnly:function(e){this.setAttribute("contenteditable",!e)},detach:function(){this.removeClass("cke_editable"),this.status="detached";var e=this.editor;this._.detach(),delete e.document,delete e.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function e(){var e=n.getDocument().$,t=e.getSelection(),r;if(t.anchorNode&&t.anchorNode==n.$)r=!0;else if(CKEDITOR.env.webkit){var i=n.getDocument().getActive();i&&i.equals(n)&&!t.anchorNode&&(r=!0)}r&&(r=new CKEDITOR.dom.range(n),r.moveToElementEditStart(n),e=e.createRange(),e.setStart(r.startContainer.$,r.startOffset),e.collapse(!0),t.removeAllRanges(),t.addRange(e))}function t(){var e=n.getDocument().$,t=e.selection,r=n.getDocument().getActive();t.type=="None"&&r.equals(n)&&(t=new CKEDITOR.dom.range(n),e=e.body.createTextRange(),t.moveToElementEditStart(n),t=t.startContainer,t.type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent()),e.moveToElementText(t.$),e.collapse(!0),e.select())}var n=this;CKEDITOR.env.ie&&(CKEDITOR.env.version<9||CKEDITOR.env.quirks)?this.hasFocus&&(this.focus(),t()):this.hasFocus?(this.focus(),e()):this.once("focus",function(){e()},null,null,-999)},setup:function(){var e=this.editor;this.attachListener(e,"beforeGetData",function(){var t=this.getData();this.is("textarea")||e.config.ignoreEmptyParagraph!==!1&&(t=t.replace(c,function(e,t){return t})),e.setData(t,null,1)},this),this.attachListener(e,"getSnapshot",function(e){e.data=this.getData(1)},this),this.attachListener(e,"afterSetData",function(){this.setData(e.getData(1))},this),this.attachListener(e,"loadSnapshot",function(e){this.setData(e.data,1)},this),this.attachListener(e,"beforeFocus",function(){var t=e.getSelection();(t=t&&t.getNative())&&t.type=="Control"||this.focus()},this),this.attachListener(e,"insertHtml",function(e){this.insertHtml(e.data.dataValue,e.data.mode)},this),this.attachListener(e,"insertElement",function(e){this.insertElement(e.data)},this),this.attachListener(e,"insertText",function(e){this.insertText(e.data)},this),this.setReadOnly(e.readOnly),this.attachClass("cke_editable"),this.attachClass(e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"cke_editable_inline":e.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||e.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO?"cke_editable_themed":""),this.attachClass("cke_contents_"+e.config.contentsLangDirection),e.keystrokeHandler.blockedKeystrokes[8]=+e.readOnly,e.keystrokeHandler.attach(this),this.on("blur",function(){this.hasFocus=!1},null,null,-1),this.on("focus",function(){this.hasFocus=!0},null,null,-1),e.focusManager.add(this),this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,e.once("contentDom",function(){e.focusManager.focus(this)},this)),this.isInline()&&this.changeAttr("tabindex",e.tabIndex);if(!this.is("textarea")){e.document=this.getDocument(),e.window=this.getWindow();var t=e.document;this.changeAttr("spellcheck",!e.config.disableNativeSpellChecker);var i=e.config.contentsLangDirection;this.getDirection(1)!=i&&this.changeAttr("dir",i);var o=CKEDITOR.getCss();o&&(i=t.getHead(),i.getCustomData("stylesheet")||(o=t.appendStyleText(o),o=new CKEDITOR.dom.element(o.ownerNode||o.owningElement),i.setCustomData("stylesheet",o),o.data("cke-temp",1))),i=t.getCustomData("stylesheet_ref")||0,t.setCustomData("stylesheet_ref",i+1),this.setCustomData("cke_includeReadonly",!e.config.disableReadonlyStyling),this.attachListener(this,"click",function(e){var e=e.data,t=(new CKEDITOR.dom.elementPath(e.getTarget(),this)).contains("a");t&&e.$.button!=2&&t.isReadOnly()&&e.preventDefault()});var u={8:1,46:1};this.attachListener(e,"key",function(t){if(e.readOnly)return!0;var n=t.data.domEvent.getKey(),r;if(n in u){var t=e.getSelection(),i,o=t.getRanges()[0],a=o.startPath(),f,l,c,n=n==8;CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(i=t.getSelectedElement())||(i=s(t))?(e.fire("saveSnapshot"),o.moveToPosition(i,CKEDITOR.POSITION_BEFORE_START),i.remove(),o.select(),e.fire("saveSnapshot"),r=1):o.collapsed&&((f=a.block)&&(c=f[n?"getPrevious":"getNext"](h))&&c.type==CKEDITOR.NODE_ELEMENT&&c.is("table")&&o[n?"checkStartOfBlock":"checkEndOfBlock"]()?(e.fire("saveSnapshot"),o[n?"checkEndOfBlock":"checkStartOfBlock"]()&&f.remove(),o["moveToElementEdit"+(n?"End":"Start")](c),o.select(),e.fire("saveSnapshot"),r=1):a.blockLimit&&a.blockLimit.is("td")&&(l=a.blockLimit.getAscendant("table"))&&o.checkBoundaryOfElement(l,n?CKEDITOR.START:CKEDITOR.END)&&(c=l[n?"getPrevious":"getNext"](h))?(e.fire("saveSnapshot"),o["moveToElementEdit"+(n?"End":"Start")](c),o.checkStartOfBlock()&&o.checkEndOfBlock()?c.remove():o.select(),e.fire("saveSnapshot"),r=1):(l=a.contains(["td","th","caption"]))&&o.checkBoundaryOfElement(l,n?CKEDITOR.START:CKEDITOR.END)&&(r=1))}return!r}),e.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(t){t.data.getKeystroke()in u&&!this.getFirst(r)&&(this.appendBogus(),t=e.createRange(),t.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),t.select())}),this.attachListener(this,"dblclick",function(t){if(e.readOnly)return!1;t={element:t.data.getTarget()},e.fire("doubleclick",t)}),CKEDITOR.env.ie&&this.attachListener(this,"click",n),CKEDITOR.env.ie||this.attachListener(this,"mousedown",function(t){var n=t.data.getTarget();n.is("img","hr","input","textarea","select")&&!n.isReadOnly()&&(e.getSelection().selectElement(n),n.is("input","textarea","select")&&t.data.preventDefault())}),CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(t){if(t.data.$.button==2){t=t.data.getTarget();if(!t.getOuterHtml().replace(c,"")){var n=e.createRange();n.moveToElementEditStart(t),n.select(!0)}}}),CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(e){e.data.getTarget().is("input","select")&&e.data.preventDefault()}),this.attachListener(this,"mouseup",function(e){e.data.getTarget().is("input","textarea")&&e.data.preventDefault()})),CKEDITOR.env.webkit&&this.attachListener(e,"key",function(t){t=t.data.domEvent.getKey();if(t in u){var n=t==8,r=e.getSelection().getRanges()[0],t=r.startPath();if(r.collapsed){var i;e:{var s=t.block;if(s)if(r[n?"checkStartOfBlock":"checkEndOfBlock"]())if(!r.moveToClosestEditablePosition(s,!n)||!r.collapsed)i=!1;else{if(r.startContainer.type==CKEDITOR.NODE_ELEMENT){var o=r.startContainer.getChild(r.startOffset-(n?1:0));if(o&&o.type==CKEDITOR.NODE_ELEMENT&&o.is("hr")){e.fire("saveSnapshot"),o.remove(),i=!0;break e}}if((r=r.startPath().block)&&(!r||!r.contains(s))){e.fire("saveSnapshot");var a;(a=(n?r:s).getBogus())&&a.remove(),i=e.getSelection(),a=i.createBookmarks(),(n?s:r).moveChildren(n?r:s,!1),t.lastElement.mergeSiblings(),f(s,r,!n),i.selectBookmarks(a),i=!0}}else i=!1;else i=!1}if(!i)return}else{n=r,i=t.block,a=n.endPath().block,!i||!a||i.equals(a)?t=!1:(e.fire("saveSnapshot"),(s=i.getBogus())&&s.remove(),n.deleteContents(),a.getParent()&&(a.moveChildren(i,!1),t.lastElement.mergeSiblings(),f(i,a,!0)),n=e.getSelection().getRanges()[0],n.collapse(1),n.select(),t=!0);if(!t)return}return e.getSelection().scrollIntoView(),e.fire("saveSnapshot"),!1}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1),this.clearListeners(),this.restoreAttrs();var e;if(e=this.removeCustomData("classes"))for(;e.length;)this.removeClass(e.pop());if(!this.is("textarea")){e=this.getDocument();var t=e.getHead();if(t.getCustomData("stylesheet")){var n=e.getCustomData("stylesheet_ref");--n?e.setCustomData("stylesheet_ref",n):(e.removeCustomData("stylesheet_ref"),t.removeCustomData("stylesheet").remove())}}this.editor.fire("contentDomUnload"),delete this.editor}}}),CKEDITOR.editor.prototype.editable=function(e){var t=this._.editable;return t&&e?0:(arguments.length&&(t=this._.editable=e?e instanceof CKEDITOR.editable?e:new CKEDITOR.editable(this,e):(t&&t.detach(),null)),t)};var l=CKEDITOR.dom.walker.bogus(),c=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,h=CKEDITOR.dom.walker.whitespaces(!0),p=CKEDITOR.dom.walker.bookmark(!1,!0);CKEDITOR.on("instanceLoaded",function(t){var n=t.editor;n.on("insertElement",function(e){e=e.data,e.type==CKEDITOR.NODE_ELEMENT&&(e.is("input")||e.is("textarea"))&&(e.getAttribute("contentEditable")!="false"&&e.data("cke-editable",e.hasAttribute("contenteditable")?"true":"1"),e.setAttribute("contentEditable",!1))}),n.on("selectionChange",function(t){if(!n.readOnly){var r=n.getSelection();r&&!r.isLocked&&(r=n.checkDirty(),n.fire("lockSnapshot"),e(t),n.fire("unlockSnapshot"),!r&&n.resetDirty())}})}),CKEDITOR.on("instanceCreated",function(e){var t=e.editor;t.on("mode",function(){var e=t.editable();if(e&&e.isInline()){var n=t.title;e.changeAttr("role","textbox"),e.changeAttr("aria-label",n),n&&e.changeAttr("title",n);var r=t.fire("ariaEditorHelpLabel",{}).label;if(r)if(n=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var i=CKEDITOR.tools.getNextId(),r=CKEDITOR.dom.element.createFromHtml('<span id="'+i+'" class="cke_voice_label">'+r+"</span>");n.append(r),e.changeAttr("aria-describedby",i)}}})}),CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");var d=function(){function e(e){return e.type==CKEDITOR.NODE_ELEMENT}function t(n,r){var i,s,o,u,a=[],l=r.range.startContainer;i=r.range.startPath();for(var l=f[l.getName()],c=0,h=n.getChildren(),p=h.count(),d=-1,v=-1,m=0,g=i.contains(f.$list);c<p;++c)i=h.getItem(c),e(i)?(o=i.getName(),g&&o in CKEDITOR.dtd.$list?a=a.concat(t(i,r)):(u=!!l[o],o=="br"&&i.data("cke-eol")&&(!c||c==p-1)&&(m=(s=c?a[c-1].node:h.getItem(c+1))&&(!e(s)||!s.is("br")),s=s&&e(s)&&f.$block[s.getName()]),d==-1&&!u&&(d=c),u||(v=c),a.push({isElement:1,isLineBreak:m,isBlock:i.isBlockBoundary(),hasBlockSibling:s,node:i,name:o,allowed:u}),s=m=0)):a.push({isElement:0,node:i,allowed:1});return d>-1&&(a[d].firstNotAllowed=1),v>-1&&(a[v].lastNotAllowed=1),a}function n(t,r){var i=[],s=t.getChildren(),o=s.count(),u,a=0,l=f[r],c=!t.is(f.$inline)||t.is("br");for(c&&i.push(" ");a<o;a++)u=s.getItem(a),e(u)&&!u.is(l)?i=i.concat(n(u,r)):i.push(u);return c&&i.push(" "),i}function i(t){return t&&e(t)&&(t.is(f.$removeEmpty)||t.is("a")&&!t.isBlockBoundary())}function s(t,n,r,i){var o=t.clone(),u,a;o.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(u=(new CKEDITOR.dom.walker(o)).next())&&e(u)&&l[u.getName()]&&(a=u.getPrevious())&&e(a)&&!a.getParent().equals(t.startContainer)&&r.contains(a)&&i.contains(u)&&u.isIdentical(a)&&(u.moveChildren(a),u.remove(),s(t,n,r,i))}function u(t,n){function r(t,n){if(n.isBlock&&n.isElement&&!n.node.is("br")&&e(t)&&t.is("br"))return t.remove(),1}var i=n.endContainer.getChild(n.endOffset),s=n.endContainer.getChild(n.endOffset-1);i&&r(i,t[t.length-1]),s&&r(s,t[0])&&(n.setEnd(n.endContainer,n.endOffset-1),n.collapse())}var f=CKEDITOR.dtd,l={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},c={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},h=CKEDITOR.tools.extend({},f.$inline);return delete h.br,function(l,p,d){var v=l.editor,y=v.getSelection().getRanges()[0],w=!1;p=="unfiltered_html"&&(p="html",w=!0);if(!y.checkReadOnly()){var E=(new CKEDITOR.dom.elementPath(y.startContainer,y.root)).blockLimit||y.root,p={type:p,dontFilter:w,editable:l,editor:v,range:y,blockLimit:E,mergeCandidates:[],zombies:[]},v=p.range,w=p.mergeCandidates,S,x,T,N;p.type=="text"&&v.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(S=CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",v.document),v.insertNode(S),v.setStartAfter(S)),x=new CKEDITOR.dom.elementPath(v.startContainer),p.endPath=T=new CKEDITOR.dom.elementPath(v.endContainer);if(!v.collapsed){var E=T.block||T.blockLimit,C=v.getCommonAncestor();E&&!E.equals(C)&&!E.contains(C)&&v.checkEndOfBlock()&&p.zombies.push(E),v.deleteContents()}for(;(N=e(v.startContainer)&&v.startContainer.getChild(v.startOffset-1))&&e(N)&&N.isBlockBoundary()&&x.contains(N);)v.moveToPosition(N,CKEDITOR.POSITION_BEFORE_END);s(v,p.blockLimit,x,T),S&&(v.setEndBefore(S),v.collapse(),S.remove()),S=v.startPath();if(E=S.contains(i,!1,1))v.splitElement(E),p.inlineStylesRoot=E,p.inlineStylesPeak=S.lastElement;S=v.createBookmark(),(E=S.startNode.getPrevious(r))&&e(E)&&i(E)&&w.push(E),(E=S.startNode.getNext(r))&&e(E)&&i(E)&&w.push(E);for(E=S.startNode;(E=E.getParent())&&i(E);)w.push(E);v.moveToBookmark(S);if(S=d){S=p.range;if(p.type=="text"&&p.inlineStylesRoot){N=p.inlineStylesPeak,v=N.getDocument().createText("{cke-peak}");for(w=p.inlineStylesRoot.getParent();!N.equals(w);)v=v.appendTo(N.clone()),N=N.getParent();d=v.getOuterHtml().split("{cke-peak}").join(d)}N=p.blockLimit.getName();if(/^\s+|\s+$/.test(d)&&"span"in CKEDITOR.dtd[N])var k='<span data-cke-marker="1">&nbsp;</span>',d=k+d+k;d=p.editor.dataProcessor.toHtml(d,{context:null,fixForBody:!1,dontFilter:p.dontFilter,filter:p.editor.activeFilter,enterMode:p.editor.activeEnterMode}),N=S.document.createElement("body"),N.setHtml(d),k&&(N.getFirst().remove(),N.getLast().remove());if((k=S.startPath().block)&&(k.getChildCount()!=1||!k.getBogus()))e:{var L;if(N.getChildCount()==1&&e(L=N.getFirst())&&L.is(c)){k=L.getElementsByTag("*"),S=0;for(w=k.count();S<w;S++){v=k.getItem(S);if(!v.is(h))break e}L.moveChildren(L.getParent(1)),L.remove()}}p.dataWrapper=N,S=d}if(S){L=p.range;var k=L.document,A,d=p.blockLimit;S=0;var O;N=[];var M,_,w=v=0,D,P;x=L.startContainer;var E=p.endPath.elements[0],H;T=E.getPosition(x),C=!!E.getCommonAncestor(x)&&T!=CKEDITOR.POSITION_IDENTICAL&&!(T&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),x=t(p.dataWrapper,p);for(u(x,L);S<x.length;S++){T=x[S];if(A=T.isLineBreak){A=L,D=d;var B=void 0,F=void 0;T.hasBlockSibling?A=1:(B=A.startContainer.getAscendant(f.$block,1),!B||!B.is({div:1,p:1})?A=0:(F=B.getPosition(D),F==CKEDITOR.POSITION_IDENTICAL||F==CKEDITOR.POSITION_CONTAINS?A=0:(D=A.splitElement(B),A.moveToPosition(D,CKEDITOR.POSITION_AFTER_START),A=1)))}if(A)w=S>0;else{A=L.startPath(),!T.isBlock&&o(p.editor,A.block,A.blockLimit)&&(_=p.editor.activeEnterMode!=CKEDITOR.ENTER_BR&&p.editor.config.autoParagraph!==!1?p.editor.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":!1)&&(_=k.createElement(_),_.appendBogus(),L.insertNode(_),CKEDITOR.env.needsBrFiller&&(O=_.getBogus())&&O.remove(),L.moveToPosition(_,CKEDITOR.POSITION_BEFORE_END));if((A=L.startPath().block)&&!A.equals(M)){if(O=A.getBogus())O.remove(),N.push(A);M=A}T.firstNotAllowed&&(v=1);if(v&&T.isElement){A=L.startContainer;for(D=null;A&&!f[A.getName()][T.name];){if(A.equals(d)){A=null;break}D=A,A=A.getParent()}if(A)D&&(P=L.splitElement(D),p.zombies.push(P),p.zombies.push(D));else{D=d.getName(),H=!S,A=S==x.length-1,D=n(T.node,D);for(var B=[],F=D.length,I=0,q=void 0,R=0,U=-1;I<F;I++)q=D[I],q==" "?(!R&&(!H||I)&&(B.push(new CKEDITOR.dom.text(" ")),U=B.length),R=1):(B.push(q),R=0);A&&U==B.length&&B.pop(),H=B}}if(H){for(;A=H.pop();)L.insertNode(A);H=0}else L.insertNode(T.node);T.lastNotAllowed&&S<x.length-1&&((P=C?E:P)&&L.setEndAt(P,CKEDITOR.POSITION_AFTER_START),v=0),L.collapse()}}p.dontMoveCaret=w,p.bogusNeededBlocks=N}O=p.range;var z;P=p.bogusNeededBlocks;for(H=O.createBookmark();M=p.zombies.pop();)M.getParent()&&(_=O.clone(),_.moveToElementEditStart(M),_.removeEmptyBlocksAtEnd());if(P)for(;M=P.pop();)CKEDITOR.env.needsBrFiller?M.appendBogus():M.append(O.document.createText(" "));for(;M=p.mergeCandidates.pop();)M.mergeSiblings();O.moveToBookmark(H);if(!p.dontMoveCaret){for(M=e(O.startContainer)&&O.startContainer.getChild(O.startOffset-1);M&&e(M)&&!M.is(f.$empty);){if(M.isBlockBoundary())O.moveToPosition(M,CKEDITOR.POSITION_BEFORE_END);else{if(i(M)&&M.getHtml().match(/(\s|&nbsp;)$/g)){z=null;break}z=O.clone(),z.moveToPosition(M,CKEDITOR.POSITION_BEFORE_END)}M=M.getLast(r)}z&&O.moveToRange(z)}y.select(),a(l)}}}(),v=function(){function e(e){return e=new CKEDITOR.dom.walker(e),e.guard=function(e,t){if(t)return!1;if(e.type==CKEDITOR.NODE_ELEMENT)return e.is(CKEDITOR.dtd.$tableContent)},e.evaluator=function(e){return e.type==CKEDITOR.NODE_ELEMENT},e}function t(e,t,n){return t=e.getDocument().createElement(t),e.append(t,n),t}function n(e){var t=e.count(),n;for(t;t-->0;)n=e.getItem(t),CKEDITOR.tools.trim(n.getHtml())||(n.appendBogus(),CKEDITOR.env.ie&&CKEDITOR.env.version<9&&n.getChildCount()&&n.getFirst().remove())}return function(r){var i=r.startContainer,s=i.getAscendant("table",1),o=!1;n(s.getElementsByTag("td")),n(s.getElementsByTag("th")),s=r.clone(),s.setStart(i,0),s=e(s).lastBackward(),s||(s=r.clone(),s.setEndAt(i,CKEDITOR.POSITION_BEFORE_END),s=e(s).lastForward(),o=!0),s||(s=i),s.is("table")?(r.setStartAt(s,CKEDITOR.POSITION_BEFORE_START),r.collapse(!0),s.remove()):(s.is({tbody:1,thead:1,tfoot:1})&&(s=t(s,"tr",o)),s.is("tr")&&(s=t(s,s.getParent().is("thead")?"th":"td",o)),(i=s.getBogus())&&i.remove(),r.moveToPosition(s,o?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}()}(),function(){function e(){var e=this._.fakeSelection,t;if(e){t=this.getSelection(1);if(!t||!t.isHidden())e.reset(),e=0}if(!e){e=t||this.getSelection(1);if(!e||e.getType()==CKEDITOR.SELECTION_NONE)return}this.fire("selectionCheck",e),t=this.elementPath(),t.compare(this._.selectionPreviousPath)||(CKEDITOR.env.webkit&&(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=t,this.fire("selectionChange",{selection:e,path:t}))}function t(){d=!0,p||(n.call(this),p=CKEDITOR.tools.setTimeout(n,200,this))}function n(){p=null,d&&(CKEDITOR.tools.setTimeout(e,0,this),d=!1)}function r(e){return v(e)||e.type==CKEDITOR.NODE_ELEMENT&&!e.is(CKEDITOR.dtd.$empty)?!0:!1}function i(e){function t(t,n){return!t||t.type==CKEDITOR.NODE_TEXT?!1:e.clone()["moveToElementEdit"+(n?"End":"Start")](t)}if(e.root instanceof CKEDITOR.editable){var n=e.startContainer,i=e.getPreviousNode(r,null,n),s=e.getNextNode(r,null,n);return t(i)||t(s,1)||!i&&!s&&(n.type!=CKEDITOR.NODE_ELEMENT||!n.isBlockBoundary()||!n.getBogus())?!0:!1}return!1}function s(e){return e.getCustomData("cke-fillingChar")}function o(e,t){var n=e&&e.removeCustomData("cke-fillingChar");if(n){if(t!==!1){var r,i=e.getDocument().getSelection().getNative(),s=i&&i.type!="None"&&i.getRangeAt(0);n.getLength()>1&&s&&s.intersectsNode(n.$)&&(r=a(i),s=i.focusNode==n.$&&i.focusOffset>0,i.anchorNode==n.$&&i.anchorOffset>0&&r[0].offset--,s&&r[1].offset--)}n.setText(u(n.getText())),r&&f(e.getDocument().$,r)}}function u(e){return e.replace(/\u200B( )?/g,function(e){return e[1]?" ":""})}function a(e){return[{node:e.anchorNode,offset:e.anchorOffset},{node:e.focusNode,offset:e.focusOffset}]}function f(e,t){var n=e.getSelection(),r=e.createRange();r.setStart(t[0].node,t[0].offset),r.collapse(!0),n.removeAllRanges(),n.addRange(r),n.extend(t[1].node,t[1].offset)}function l(e){var t=CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="'+(CKEDITOR.env.ie?"display:none":"position:fixed;top:0;left:-1000px")+'">&nbsp;</div>',e.document);e.fire("lockSnapshot"),e.editable().append(t);var n=e.getSelection(1),r=e.createRange(),i=n.root.on("selectionchange",function(e){e.cancel()},null,null,0);r.setStartAt(t,CKEDITOR.POSITION_AFTER_START),r.setEndAt(t,CKEDITOR.POSITION_BEFORE_END),n.selectRanges([r]),i.removeListener(),e.fire("unlockSnapshot"),e._.hiddenSelectionContainer=t}function c(e){var t={37:1,39:1,8:1,46:1};return function(n){var r=n.data.getKeystroke();if(t[r]){var i=e.getSelection().getRanges(),s=i[0];i.length==1&&s.collapsed&&(r=s[r<38?"getPreviousEditableNode":"getNextEditableNode"]())&&r.type==CKEDITOR.NODE_ELEMENT&&r.getAttribute("contenteditable")=="false"&&(e.getSelection().fake(r),n.data.preventDefault(),n.cancel())}}}function h(e){for(var t=0;t<e.length;t++){var n=e[t];n.getCommonAncestor().isReadOnly()&&e.splice(t,1);if(!n.collapsed){if(n.startContainer.isReadOnly())for(var r=n.startContainer,i;r;){if((i=r.type==CKEDITOR.NODE_ELEMENT)&&r.is("body")||!r.isReadOnly())break;i&&r.getAttribute("contentEditable")=="false"&&n.setStartAfter(r),r=r.getParent()}r=n.startContainer,i=n.endContainer;var s=n.startOffset,o=n.endOffset,u=n.clone();r&&r.type==CKEDITOR.NODE_TEXT&&(s>=r.getLength()?u.setStartAfter(r):u.setStartBefore(r)),i&&i.type==CKEDITOR.NODE_TEXT&&(o?u.setEndAfter(i):u.setEndBefore(i)),r=new CKEDITOR.dom.walker(u),r.evaluator=function(r){if(r.type==CKEDITOR.NODE_ELEMENT&&r.isReadOnly()){var i=n.clone();return n.setEndBefore(r),n.collapsed&&e.splice(t--,1),r.getPosition(u.endContainer)&CKEDITOR.POSITION_CONTAINS||(i.setStartAfter(r),i.collapsed||e.splice(t+1,0,i)),!0}return!1},r.next()}}return e}var p,d,v=CKEDITOR.dom.walker.invisible(1),m=function(){function e(e){return function(t){var n=t.editor.createRange();return n.moveToClosestEditablePosition(t.selected,e)&&t.editor.getSelection().selectRanges([n]),!1}}function t(e){return function(t){var n=t.editor,r=n.createRange(),i;return(i=r.moveToClosestEditablePosition(t.selected,e))||(i=r.moveToClosestEditablePosition(t.selected,!e)),i&&n.getSelection().selectRanges([r]),n.fire("saveSnapshot"),t.selected.remove(),i||(r.moveToElementEditablePosition(n.editable()),n.getSelection().selectRanges([r])),n.fire("saveSnapshot"),!1}}var n=e(),r=e(1);return{37:n,38:n,39:r,40:r,8:t(),46:t(1)}}();CKEDITOR.on("instanceCreated",function(n){function r(){var e=i.getSelection();e&&e.removeAllRanges()}var i=n.editor;i.on("contentDom",function(){function n(){d=new CKEDITOR.dom.selection(i.getSelection()),d.lock()}function r(){u.removeListener("mouseup",r),l.removeListener("mouseup",r);var e=CKEDITOR.document.$.selection,t=e.createRange();e.type!="None"&&t.parentElement().ownerDocument==s.$&&t.select()}var s=i.document,u=CKEDITOR.document,a=i.editable(),f=s.getBody(),l=s.getDocumentElement(),h=a.isInline(),p,d;CKEDITOR.env.gecko&&a.attachListener(a,"focus",function(e){e.removeListener(),p!==0&&(e=i.getSelection().getNative())&&e.isCollapsed&&e.anchorNode==a.$&&(e=i.createRange(),e.moveToElementEditStart(a),e.select())},null,null,-2),a.attachListener(a,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){p&&CKEDITOR.env.webkit&&(p=i._.previousActive&&i._.previousActive.equals(s.getActive())),i.unlockSelection(p),p=0},null,null,-1),a.attachListener(a,"mousedown",function(){p=0});if(CKEDITOR.env.ie||h)g?a.attachListener(a,"beforedeactivate",n,null,null,-1):a.attachListener(i,"selectionCheck",n,null,null,-1),a.attachListener(a,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){i.lockSelection(d),p=1},null,null,-1),a.attachListener(a,"mousedown",function(){p=0});if(CKEDITOR.env.ie&&!h){var v;a.attachListener(a,"mousedown",function(e){if(e.data.$.button==2){e=i.document.getSelection();if(!e||e.getType()==CKEDITOR.SELECTION_NONE)v=i.window.getScrollPosition()}}),a.attachListener(a,"mouseup",function(e){e.data.$.button==2&&v&&(i.document.$.documentElement.scrollLeft=v.x,i.document.$.documentElement.scrollTop=v.y),v=null}),s.$.compatMode!="BackCompat"&&((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&l.on("mousedown",function(e){function t(e){e=e.data.$;if(r){var t=f.$.createTextRange();try{t.moveToPoint(e.clientX,e.clientY)}catch(n){}r.setEndPoint(s.compareEndPoints("StartToStart",t)<0?"EndToEnd":"StartToStart",t),r.select()}}function n(){l.removeListener("mousemove",t),u.removeListener("mouseup",n),l.removeListener("mouseup",n),r.select()}e=e.data;if(e.getTarget().is("html")&&e.$.y<l.$.clientHeight&&e.$.x<l.$.clientWidth){var r=f.$.createTextRange();try{r.moveToPoint(e.$.clientX,e.$.clientY)}catch(i){}var s=r.duplicate();l.on("mousemove",t),u.on("mouseup",n),l.on("mouseup",n)}}),CKEDITOR.env.version>7&&CKEDITOR.env.version<11&&l.on("mousedown",function(e){e.data.getTarget().is("html")&&(u.on("mouseup",r),l.on("mouseup",r))}))}a.attachListener(a,"selectionchange",e,i),a.attachListener(a,"keyup",t,i),a.attachListener(a,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){i.forceNextSelectionCheck(),i.selectionChange(1)});if(h&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var m;a.attachListener(a,"mousedown",function(){m=1}),a.attachListener(s.getDocumentElement(),"mouseup",function(){m&&t.call(i),m=0})}else a.attachListener(CKEDITOR.env.ie?a:s.getDocumentElement(),"mouseup",t,i);CKEDITOR.env.webkit&&a.attachListener(s,"keydown",function(e){switch(e.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:o(a)}},null,null,-1),a.attachListener(a,"keydown",c(i),null,null,-1)}),i.on("setData",function(){i.unlockSelection(),CKEDITOR.env.webkit&&r()}),i.on("contentDomUnload",function(){i.unlockSelection()}),CKEDITOR.env.ie9Compat&&i.on("beforeDestroy",r,null,null,9),i.on("dataReady",function(){delete i._.fakeSelection,delete i._.hiddenSelectionContainer,i.selectionChange(1)}),i.on("loadSnapshot",function(){var e=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),t=i.editable().getLast(e);t&&t.hasAttribute("data-cke-hidden-sel")&&(t.remove(),CKEDITOR.env.gecko&&(e=i.editable().getFirst(e))&&e.is("br")&&e.getAttribute("_moz_editor_bogus_node")&&e.remove())},null,null,100),i.on("key",function(e){if(i.mode=="wysiwyg"){var t=i.getSelection();if(t.isFake){var n=m[e.data.keyCode];if(n)return n({editor:i,selected:t.getSelectedElement(),selection:t,keyEvent:e})}}})}),CKEDITOR.on("instanceReady",function(e){function t(){var e=r.editable();if(e)if(e=s(e)){var t=r.document.$.getSelection();t.type!="None"&&(t.anchorNode==e.$||t.focusNode==e.$)&&(l=a(t)),i=e.getText(),e.setText(u(i))}}function n(){var e=r.editable();e&&(e=s(e))&&(e.setText(i),l&&(f(r.document.$,l),l=null))}var r=e.editor,i,l;CKEDITOR.env.webkit&&(r.on("selectionChange",function(){var e=r.editable(),t=s(e);t&&(t.getCustomData("ready")?o(e):t.setCustomData("ready",1))},null,null,-1),r.on("beforeSetMode",function(){o(r.editable())},null,null,-1),r.on("beforeUndoImage",t),r.on("afterUndoImage",n),r.on("beforeGetData",t,null,null,0),r.on("getData",n))}),CKEDITOR.editor.prototype.selectionChange=function(n){(n?e:t).call(this)},CKEDITOR.editor.prototype.getSelection=function(e){return(this._.savedSelection||this._.fakeSelection)&&!e?this._.savedSelection||this._.fakeSelection:(e=this.editable())&&this.mode=="wysiwyg"?new CKEDITOR.dom.selection(e):null},CKEDITOR.editor.prototype.lockSelection=function(e){return e=e||this.getSelection(1),e.getType()!=CKEDITOR.SELECTION_NONE?(!e.isLocked&&e.lock(),this._.savedSelection=e,!0):!1},CKEDITOR.editor.prototype.unlockSelection=function(e){var t=this._.savedSelection;return t?(t.unlock(e),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)},CKEDITOR.dom.range.prototype.select=function(){var e=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);return e.selectRanges([this]),e},CKEDITOR.SELECTION_NONE=1,CKEDITOR.SELECTION_TEXT=2,CKEDITOR.SELECTION_ELEMENT=3;var g=typeof window.getSelection!="function",y=1;CKEDITOR.dom.selection=function(e){if(e instanceof CKEDITOR.dom.selection)var t=e,e=e.root;var n=e instanceof CKEDITOR.dom.element;this.rev=t?t.rev:y++,this.document=e instanceof CKEDITOR.dom.document?e:e.getDocument(),this.root=n?e:this.document.getBody(),this.isLocked=0,this._={cache:{}};if(t)return CKEDITOR.tools.extend(this._.cache,t._.cache),this.isFake=t.isFake,this.isLocked=t.isLocked,this;var e=this.getNative(),r,i;if(e)if(e.getRangeAt)r=(i=e.rangeCount&&e.getRangeAt(0))&&new CKEDITOR.dom.node(i.commonAncestorContainer);else{try{i=e.createRange()}catch(s){}r=i&&CKEDITOR.dom.element.get(i.item&&i.item(0)||i.parentElement())}if(!r||r.type!=CKEDITOR.NODE_ELEMENT&&r.type!=CKEDITOR.NODE_TEXT||!this.root.equals(r)&&!this.root.contains(r))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var b={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.dom.selection.prototype={getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=g?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:g?function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_NONE;try{var n=this.getNative(),r=n.type;r=="Text"&&(t=CKEDITOR.SELECTION_TEXT),r=="Control"&&(t=CKEDITOR.SELECTION_ELEMENT),n.createRange().parentElement()&&(t=CKEDITOR.SELECTION_TEXT)}catch(i){}return e.type=t}:function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_TEXT,n=this.getNative();if(!n||!n.rangeCount)t=CKEDITOR.SELECTION_NONE;else if(n.rangeCount==1){var n=n.getRangeAt(0),r=n.startContainer;r==n.endContainer&&r.nodeType==1&&n.endOffset-n.startOffset==1&&b[r.childNodes[n.startOffset].nodeName.toLowerCase()]&&(t=CKEDITOR.SELECTION_ELEMENT)}return e.type=t},getRanges:function(){var e=g?function(){function e(e){return(new CKEDITOR.dom.node(e)).getIndex()}var t=function(t,n){t=t.duplicate(),t.collapse(n);var r=t.parentElement();if(!r.hasChildNodes())return{container:r,offset:0};for(var i=r.children,s,o,u=t.duplicate(),a=0,f=i.length-1,l=-1,c,h;a<=f;){l=Math.floor((a+f)/2),s=i[l],u.moveToElementText(s),c=u.compareEndPoints("StartToStart",t);if(c>0)f=l-1;else{if(!(c<0))return{container:r,offset:e(s)};a=l+1}}if(l==-1||l==i.length-1&&c<0){u.moveToElementText(r),u.setEndPoint("StartToStart",t),u=u.text.replace(/(\r\n|\r)/g,"\n").length,i=r.childNodes;if(!u)return s=i[i.length-1],s.nodeType!=CKEDITOR.NODE_TEXT?{container:r,offset:i.length}:{container:s,offset:s.nodeValue.length};for(r=i.length;u>0&&r>0;)o=i[--r],o.nodeType==CKEDITOR.NODE_TEXT&&(h=o,u-=o.nodeValue.length);return{container:h,offset:-u}}u.collapse(c>0?!0:!1),u.setEndPoint(c>0?"StartToStart":"EndToStart",t),u=u.text.replace(/(\r\n|\r)/g,"\n").length;if(!u)return{container:r,offset:e(s)+(c>0?0:1)};for(;u>0;)try{o=s[c>0?"previousSibling":"nextSibling"],o.nodeType==CKEDITOR.NODE_TEXT&&(u-=o.nodeValue.length,h=o),s=o}catch(p){return{container:r,offset:e(s)}}return{container:h,offset:c>0?-u:h.nodeValue.length+u}};return function(){var e=this.getNative(),n=e&&e.createRange(),r=this.getType();if(!e)return[];if(r==CKEDITOR.SELECTION_TEXT)return e=new CKEDITOR.dom.range(this.root),r=t(n,!0),e.setStart(new CKEDITOR.dom.node(r.container),r.offset),r=t(n),e.setEnd(new CKEDITOR.dom.node(r.container),r.offset),e.endContainer.getPosition(e.startContainer)&CKEDITOR.POSITION_PRECEDING&&e.endOffset<=e.startContainer.getIndex()&&e.collapse(),[e];if(r==CKEDITOR.SELECTION_ELEMENT){for(var r=[],i=0;i<n.length;i++){for(var s=n.item(i),o=s.parentNode,u=0,e=new CKEDITOR.dom.range(this.root);u<o.childNodes.length&&o.childNodes[u]!=s;u++);e.setStart(new CKEDITOR.dom.node(o),u),e.setEnd(new CKEDITOR.dom.node(o),u+1),r.push(e)}return r}return[]}}():function(){var e=[],t,n=this.getNative();if(!n)return e;for(var r=0;r<n.rangeCount;r++){var i=n.getRangeAt(r);t=new CKEDITOR.dom.range(this.root),t.setStart(new CKEDITOR.dom.node(i.startContainer),i.startOffset),t.setEnd(new CKEDITOR.dom.node(i.endContainer),i.endOffset),e.push(t)}return e};return function(t){var n=this._.cache,r=n.ranges;return r||(n.ranges=r=new CKEDITOR.dom.rangeList(e.call(this))),t?h(new CKEDITOR.dom.rangeList(r.slice())):r}}(),getStartElement:function(){var e=this._.cache;if(e.startElement!==void 0)return e.startElement;var t;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var n=this.getRanges()[0];if(n){if(n.collapsed)t=n.startContainer,t.type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent());else{for(n.optimize();;){t=n.startContainer;if(n.startOffset!=(t.getChildCount?t.getChildCount():t.getLength())||!!t.isBlockBoundary())break;n.setStartAfter(t)}t=n.startContainer;if(t.type!=CKEDITOR.NODE_ELEMENT)return t.getParent();t=t.getChild(n.startOffset);if(!t||t.type!=CKEDITOR.NODE_ELEMENT)t=n.startContainer;else for(n=t.getFirst();n&&n.type==CKEDITOR.NODE_ELEMENT;)t=n,n=n.getFirst()}t=t.$}}return e.startElement=t?new CKEDITOR.dom.element(t):null},getSelectedElement:function(){var e=this._.cache;if(e.selectedElement!==void 0)return e.selectedElement;var t=this,n=CKEDITOR.tools.tryThese(function(){return t.getNative().createRange().item(0)},function(){for(var e=t.getRanges()[0].clone(),n,r,i=2;i&&(!(n=e.getEnclosedNode())||n.type!=CKEDITOR.NODE_ELEMENT||!b[n.getName()]||!(r=n));i--)e.shrink(CKEDITOR.SHRINK_ELEMENT);return r&&r.$});return e.selectedElement=n?new CKEDITOR.dom.element(n):null},getSelectedText:function(){var e=this._.cache;if(e.selectedText!==void 0)return e.selectedText;var t=this.getNative(),t=g?t.type=="Control"?"":t.createRange().text:t.toString();return e.selectedText=t},lock:function(){this.getRanges(),this.getStartElement(),this.getSelectedElement(),this.getSelectedText(),this._.cache.nativeSel=null,this.isLocked=1},unlock:function(e){if(this.isLocked){if(e)var t=this.getSelectedElement(),n=!t&&this.getRanges(),r=this.isFake;this.isLocked=0,this.reset(),e&&(e=t||n[0]&&n[0].getCommonAncestor())&&e.getAscendant("body",1)&&(r?this.fake(t):t?this.selectElement(t):this.selectRanges(n))}},reset:function(){this._.cache={},this.isFake=0;var e=this.root.editor;if(e&&e._.fakeSelection&&this.rev==e._.fakeSelection.rev){delete e._.fakeSelection;var t=e._.hiddenSelectionContainer;if(t){var n=e.checkDirty();e.fire("lockSnapshot"),t.remove(),e.fire("unlockSnapshot"),!n&&e.resetDirty()}delete e._.hiddenSelectionContainer}this.rev=y++},selectElement:function(e){var t=new CKEDITOR.dom.range(this.root);t.setStartBefore(e),t.setEndAfter(e),this.selectRanges([t])},selectRanges:function(e){var t=this.root.editor,t=t&&t._.hiddenSelectionContainer;this.reset();if(t)for(var t=this.root,n,r=0;r<e.length;++r)n=e[r],n.endContainer.equals(t)&&(n.endOffset=Math.min(n.endOffset,t.getChildCount()));if(e.length)if(this.isLocked){var s=CKEDITOR.document.getActive();this.unlock(),this.selectRanges(e),this.lock(),s&&!s.equals(this.root)&&s.focus()}else{var u;e:{var a,f;if(e.length==1&&!(f=e[0]).collapsed&&(u=f.getEnclosedNode())&&u.type==CKEDITOR.NODE_ELEMENT){f=f.clone(),f.shrink(CKEDITOR.SHRINK_ELEMENT,!0),(a=f.getEnclosedNode())&&a.type==CKEDITOR.NODE_ELEMENT&&(u=a);if(u.getAttribute("contenteditable")=="false")break e}u=void 0}if(u)this.fake(u);else{if(g){f=CKEDITOR.dom.walker.whitespaces(!0),a=/\ufeff|\u00a0/,t={table:1,tbody:1,tr:1},e.length>1&&(u=e[e.length-1],e[0].setEnd(u.endContainer,u.endOffset)),u=e[0];var e=u.collapsed,l,c,h;if((n=u.getEnclosedNode())&&n.type==CKEDITOR.NODE_ELEMENT&&n.getName()in b&&(!n.is("a")||!n.getText()))try{h=n.$.createControlRange(),h.addElement(n.$),h.select();return}catch(p){}if(u.startContainer.type==CKEDITOR.NODE_ELEMENT&&u.startContainer.getName()in t||u.endContainer.type==CKEDITOR.NODE_ELEMENT&&u.endContainer.getName()in t)u.shrink(CKEDITOR.NODE_ELEMENT,!0),e=u.collapsed;h=u.createBookmark(),t=h.startNode,e||(s=h.endNode),h=u.document.$.body.createTextRange(),h.moveToElementText(t.$),h.moveStart("character",1),s?(a=u.document.$.body.createTextRange(),a.moveToElementText(s.$),h.setEndPoint("EndToEnd",a),h.moveEnd("character",-1)):(l=t.getNext(f),c=t.hasAscendant("pre"),l=!(l&&l.getText&&l.getText().match(a))&&(c||!t.hasPrevious()||t.getPrevious().is&&t.getPrevious().is("br")),c=u.document.createElement("span"),c.setHtml("&#65279;"),c.insertBefore(t),l&&u.document.createText("﻿").insertBefore(t)),u.setStartBefore(t),t.remove(),e?(l?(h.moveStart("character",-1),h.select(),u.document.$.selection.clear()):h.select(),u.moveToPosition(c,CKEDITOR.POSITION_BEFORE_START),c.remove()):(u.setEndBefore(s),s.remove(),h.select())}else{s=this.getNative();if(!s)return;this.removeAllRanges();for(h=0;h<e.length;h++){if(h<e.length-1){l=e[h],c=e[h+1],a=l.clone(),a.setStart(l.endContainer,l.endOffset),a.setEnd(c.startContainer,c.startOffset);if(!a.collapsed){a.shrink(CKEDITOR.NODE_ELEMENT,!0),u=a.getCommonAncestor(),a=a.getEnclosedNode();if(u.isReadOnly()||a&&a.isReadOnly()){c.setStart(l.startContainer,l.startOffset),e.splice(h--,1);continue}}}u=e[h],c=this.document.$.createRange(),u.collapsed&&CKEDITOR.env.webkit&&i(u)&&(l=this.root,o(l,!1),a=l.getDocument().createText("​"),l.setCustomData("cke-fillingChar",a),u.insertNode(a),(l=a.getNext())&&!a.getPrevious()&&l.type==CKEDITOR.NODE_ELEMENT&&l.getName()=="br"?(o(this.root),u.moveToPosition(l,CKEDITOR.POSITION_BEFORE_START)):u.moveToPosition(a,CKEDITOR.POSITION_AFTER_END)),c.setStart(u.startContainer.$,u.startOffset);try{c.setEnd(u.endContainer.$,u.endOffset)}catch(d){if(!(d.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0))throw d;u.collapse(1),c.setEnd(u.endContainer.$,u.endOffset)}s.addRange(c)}}this.reset(),this.root.fire("selectionchange")}}},fake:function(e){var t=this.root.editor;this.reset(),l(t);var n=this._.cache,r=new CKEDITOR.dom.range(this.root);r.setStartBefore(e),r.setEndAfter(e),n.ranges=new CKEDITOR.dom.rangeList(r),n.selectedElement=n.startElement=e,n.type=CKEDITOR.SELECTION_ELEMENT,n.selectedText=n.nativeSel=null,this.isFake=1,this.rev=y++,t._.fakeSelection=this,this.root.fire("selectionchange")},isHidden:function(){var e=this.getCommonAncestor();return e&&e.type==CKEDITOR.NODE_TEXT&&(e=e.getParent()),!!e&&!!e.data("cke-hidden-sel")},createBookmarks:function(e){return e=this.getRanges().createBookmarks(e),this.isFake&&(e.isFake=1),e},createBookmarks2:function(e){return e=this.getRanges().createBookmarks2(e),this.isFake&&(e.isFake=1),e},selectBookmarks:function(e){for(var t=[],n=0;n<e.length;n++){var r=new CKEDITOR.dom.range(this.root);r.moveToBookmark(e[n]),t.push(r)}return e.isFake?this.fake(t[0].getEnclosedNode()):this.selectRanges(t),this},getCommonAncestor:function(){var e=this.getRanges();return e.length?e[0].startContainer.getCommonAncestor(e[e.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var e=this.getNative();try{e&&e[g?"empty":"removeAllRanges"]()}catch(t){}this.reset()}}}}(),"use strict",CKEDITOR.STYLE_BLOCK=1,CKEDITOR.STYLE_INLINE=2,CKEDITOR.STYLE_OBJECT=3,function(){function e(e,t){for(var n,r;e=e.getParent();){if(e.equals(t))break;if(e.getAttribute("data-nostyle"))n=e;else if(!r){var i=e.getAttribute("contentEditable");i=="false"?n=e:i=="true"&&(r=1)}}return n}function t(n){var i=n.document;if(n.collapsed)i=m(this,i),n.insertNode(i),n.moveToPosition(i,CKEDITOR.POSITION_BEFORE_END);else{var s=this.element,o=this._.definition,u,a=o.ignoreReadonly,f=a||o.includeReadonly;f==null&&(f=n.root.getCustomData("cke_includeReadonly"));var l=CKEDITOR.dtd[s];l||(u=!0,l=CKEDITOR.dtd.span),n.enlarge(CKEDITOR.ENLARGE_INLINE,1),n.trim();var c=n.createBookmark(),h=c.startNode,d=c.endNode,v=h,g;if(!a){var y=n.getCommonAncestor(),a=e(h,y),y=e(d,y);a&&(v=a.getNextSourceNode(!0)),y&&(d=y)}for(v.getPosition(d)==CKEDITOR.POSITION_FOLLOWING&&(v=0);v;){a=!1;if(v.equals(d))v=null,a=!0;else{var b=v.type==CKEDITOR.NODE_ELEMENT?v.getName():null,y=b&&v.getAttribute("contentEditable")=="false",w=b&&v.getAttribute("data-nostyle");if(b&&v.data("cke-bookmark")){v=v.getNextSourceNode(!0);continue}if(y&&f&&CKEDITOR.dtd.$block[b])for(var E=v,S=r(E),x=void 0,T=S.length,N=0,E=T&&new CKEDITOR.dom.range(E.getDocument());N<T;++N){var x=S[N],k=CKEDITOR.filter.instances[x.data("cke-filter")];if(k?k.check(this):1)E.selectNodeContents(x),t.call(this,E)}S=b?!l[b]||w?0:y&&!f?0:(v.getPosition(d)|L)==L&&(!o.childRule||o.childRule(v)):1;if(S)if((S=v.getParent())&&((S.getDtd()||CKEDITOR.dtd.span)[s]||u)&&(!o.parentRule||o.parentRule(S))){!g&&(!b||!CKEDITOR.dtd.$removeEmpty[b]||(v.getPosition(d)|L)==L)&&(g=n.clone(),g.setStartBefore(v)),b=v.type;if(b==CKEDITOR.NODE_TEXT||y||b==CKEDITOR.NODE_ELEMENT&&!v.getChildCount()){for(var b=v,O;(a=!b.getNext(C))&&(O=b.getParent(),l[O.getName()])&&(O.getPosition(h)|A)==A&&(!o.childRule||o.childRule(O));)b=O;g.setEndAfter(b)}}else a=!0;else a=!0;v=v.getNextSourceNode(w||y)}if(a&&g&&!g.collapsed){for(var a=m(this,i),y=a.hasAttributes(),w=g.getCommonAncestor(),b={},S={},x={},T={},M,_,P;a&&w;){if(w.getName()==s){for(M in o.attributes)!T[M]&&(P=w.getAttribute(_))&&(a.getAttribute(M)==P?S[M]=1:T[M]=1);for(_ in o.styles)!x[_]&&(P=w.getStyle(_))&&(a.getStyle(_)==P?b[_]=1:x[_]=1)}w=w.getParent()}for(M in S)a.removeAttribute(M);for(_ in b)a.removeStyle(_);y&&!a.hasAttributes()&&(a=null),a?(g.extractContents().appendTo(a),g.insertNode(a),p.call(this,a),a.mergeSiblings(),CKEDITOR.env.ie||a.$.normalize()):(a=new CKEDITOR.dom.element("span"),g.extractContents().appendTo(a),g.insertNode(a),p.call(this,a),a.remove(!0)),g=null}}n.moveToBookmark(c),n.shrink(CKEDITOR.SHRINK_TEXT),n.shrink(CKEDITOR.NODE_ELEMENT,!0)}}function n(e){function t(){for(var e=new CKEDITOR.dom.elementPath(r.getParent()),t=new CKEDITOR.dom.elementPath(f.getParent()),n=null,i=null,s=0;s<e.elements.length;s++){var o=e.elements[s];if(o==e.block||o==e.blockLimit)break;l.checkElementRemovable(o,!0)&&(n=o)}for(s=0;s<t.elements.length;s++){o=t.elements[s];if(o==t.block||o==t.blockLimit)break;l.checkElementRemovable(o,!0)&&(i=o)}i&&f.breakParent(i),n&&r.breakParent(n)}e.enlarge(CKEDITOR.ENLARGE_INLINE,1);var n=e.createBookmark(),r=n.startNode;if(e.collapsed){for(var i=new CKEDITOR.dom.elementPath(r.getParent(),e.root),s,o=0,u;o<i.elements.length&&(u=i.elements[o]);o++){if(u==i.block||u==i.blockLimit)break;if(this.checkElementRemovable(u)){var a;e.collapsed&&(e.checkBoundaryOfElement(u,CKEDITOR.END)||(a=e.checkBoundaryOfElement(u,CKEDITOR.START)))?(s=u,s.match=a?"start":"end"):(u.mergeSiblings(),u.is(this.element)?h.call(this,u):d(u,b(this)[u.getName()]))}}if(s){u=r;for(o=0;;o++){a=i.elements[o];if(a.equals(s))break;if(a.match)continue;a=a.clone(),a.append(u),u=a}u[s.match=="start"?"insertBefore":"insertAfter"](s)}}else{var f=n.endNode,l=this;t();for(i=r;!i.equals(f);)s=i.getNextSourceNode(),i.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(i)&&(i.getName()==this.element?h.call(this,i):d(i,b(this)[i.getName()]),s.type==CKEDITOR.NODE_ELEMENT&&s.contains(r)&&(t(),s=r.getNext())),i=s}e.moveToBookmark(n),e.shrink(CKEDITOR.NODE_ELEMENT,!0)}function r(e){var t=[];return e.forEach(function(e){if(e.getAttribute("contenteditable")=="true")return t.push(e),!1},CKEDITOR.NODE_ELEMENT,!0),t}function i(e){var t=e.getEnclosedNode()||e.getCommonAncestor(!1,!0);(e=(new CKEDITOR.dom.elementPath(t,e.root)).contains(this.element,1))&&!e.isReadOnly()&&g(e,this)}function s(e){var t=e.getCommonAncestor(!0,!0);if(e=(new CKEDITOR.dom.elementPath(t,e.root)).contains(this.element,1)){var t=this._.definition,n=t.attributes;if(n)for(var r in n)e.removeAttribute(r,n[r]);if(t.styles)for(var i in t.styles)t.styles.hasOwnProperty(i)&&e.removeStyle(i)}}function o(e){var t=e.createBookmark(!0),n=e.createIterator();n.enforceRealBlocks=!0,this._.enterMode&&(n.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var r,i=e.document,s;r=n.getNextParagraph();)!r.isReadOnly()&&(n.activeFilter?n.activeFilter.check(this):1)&&(s=m(this,i,r),a(r,s));e.moveToBookmark(t)}function u(e){var t=e.createBookmark(1),n=e.createIterator();n.enforceRealBlocks=!0,n.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var r,i;r=n.getNextParagraph();)this.checkElementRemovable(r)&&(r.is("pre")?((i=this._.enterMode==CKEDITOR.ENTER_BR?null:e.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&r.copyAttributes(i),a(r,i)):h.call(this,r));e.moveToBookmark(t)}function a(e,t){var n=!t;n&&(t=e.getDocument().createElement("div"),e.copyAttributes(t));var r=t&&t.is("pre"),i=e.is("pre"),s=!r&&i;if(r&&!i){i=t,(s=e.getBogus())&&s.remove(),s=e.getHtml(),s=l(s,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,""),s=s.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1"),s=s.replace(/([ \t\n\r]+|&nbsp;)/g," "),s=s.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var o=e.getDocument().createElement("div");o.append(i),i.$.outerHTML="<pre>"+s+"</pre>",i.copyAttributes(o.getFirst()),i=o.getFirst().remove()}else i.setHtml(s);t=i}else s?t=c(n?[e.getHtml()]:f(e),t):e.moveChildren(t);t.replace(e);if(r){var n=t,u;(u=n.getPrevious(k))&&u.type==CKEDITOR.NODE_ELEMENT&&u.is("pre")&&(r=l(u.getHtml(),/\n$/,"")+"\n\n"+l(n.getHtml(),/^\n/,""),CKEDITOR.env.ie?n.$.outerHTML="<pre>"+r+"</pre>":n.setHtml(r),u.remove())}else n&&v(t)}function f(e){var t=[];return l(e.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(e,t,n){return t+"</pre>"+n+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(e,n){t.push(n)}),t}function l(e,t,n){var r="",i="",e=e.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(e,t,n){return t&&(r=t),n&&(i=n),""});return r+e.replace(t,n)+i}function c(e,t){var n;e.length>1&&(n=new CKEDITOR.dom.documentFragment(t.getDocument()));for(var r=0;r<e.length;r++){var i=e[r],i=i.replace(/(\r\n|\r)/g,"\n"),i=l(i,/^[ \t]*\n/,""),i=l(i,/\n$/,""),i=l(i,/^[ \t]+|[ \t]+$/g,function(e,t){return e.length==1?"&nbsp;":t?" "+CKEDITOR.tools.repeat("&nbsp;",e.length-1):CKEDITOR.tools.repeat("&nbsp;",e.length-1)+" "}),i=i.replace(/\n/g,"<br>"),i=i.replace(/[ \t]{2,}/g,function(e){return CKEDITOR.tools.repeat("&nbsp;",e.length-1)+" "});if(n){var s=t.clone();s.setHtml(i),n.append(s)}else t.setHtml(i)}return n||t}function h(e,t){var n=this._.definition,r=n.attributes,n=n.styles,i=b(this)[e.getName()],s=CKEDITOR.tools.isEmpty(r)&&CKEDITOR.tools.isEmpty(n),o;for(o in r)(o!="class"&&!this._.definition.fullMatch||e.getAttribute(o)==w(o,r[o]))&&(!t||o.slice(0,5)!="data-")&&(s=e.hasAttribute(o),e.removeAttribute(o));for(var u in n)if(!this._.definition.fullMatch||e.getStyle(u)==w(u,n[u],true))s=s||!!e.getStyle(u),e.removeStyle(u);d(e,i,S[e.getName()]),s&&(this._.definition.alwaysRemoveElement?v(e,1):!CKEDITOR.dtd.$block[e.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!e.hasAttributes()?v(e):e.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function p(e){for(var t=b(this),n=e.getElementsByTag(this.element),r,i=n.count();--i>=0;)r=n.getItem(i),r.isReadOnly()||h.call(this,r,!0);for(var s in t)if(s!=this.element){n=e.getElementsByTag(s);for(i=n.count()-1;i>=0;i--)r=n.getItem(i),r.isReadOnly()||d(r,t[s])}}function d(e,t,n){if(t=t&&t.attributes)for(var r=0;r<t.length;r++){var i=t[r][0],s;if(s=e.getAttribute(i)){var o=t[r][1];(o===null||o.test&&o.test(s)||typeof o=="string"&&s==o)&&e.removeAttribute(i)}}n||v(e)}function v(e,t){if(!e.hasAttributes()||t)if(CKEDITOR.dtd.$block[e.getName()]){var n=e.getPrevious(k),r=e.getNext(k);n&&(n.type==CKEDITOR.NODE_TEXT||!n.isBlockBoundary({br:1}))&&e.append("br",1),r&&(r.type==CKEDITOR.NODE_TEXT||!r.isBlockBoundary({br:1}))&&e.append("br"),e.remove(!0)}else n=e.getFirst(),r=e.getLast(),e.remove(!0),n&&(n.type==CKEDITOR.NODE_ELEMENT&&n.mergeSiblings(),r&&!n.equals(r)&&r.type==CKEDITOR.NODE_ELEMENT&&r.mergeSiblings())}function m(e,t,n){var r;return r=e.element,r=="*"&&(r="span"),r=new CKEDITOR.dom.element(r,t),n&&n.copyAttributes(r),r=g(r,e),t.getCustomData("doc_processing_style")&&r.hasAttribute("id")?r.removeAttribute("id"):t.setCustomData("doc_processing_style",1),r}function g(e,t){var n=t._.definition,r=n.attributes,n=CKEDITOR.style.getStyleText(n);if(r)for(var i in r)e.setAttribute(i,r[i]);return n&&e.setAttribute("style",n),e}function y(e,t){for(var n in e)e[n]=e[n].replace(N,function(e,n){return t[n]})}function b(e){if(e._.overrides)return e._.overrides;var t=e._.overrides={},n=e._.definition.overrides;if(n){CKEDITOR.tools.isArray(n)||(n=[n]);for(var r=0;r<n.length;r++){var i=n[r],s,o;typeof i=="string"?s=i.toLowerCase():(s=i.element?i.element.toLowerCase():e.element,o=i.attributes),i=t[s]||(t[s]={});if(o){var i=i.attributes=i.attributes||[],u;for(u in o)i.push([u.toLowerCase(),o[u]])}}}return t}function w(e,t,n){var r=new CKEDITOR.dom.element("span");return r[n?"setStyle":"setAttribute"](e,t),r[n?"getStyle":"getAttribute"](e)}function E(e,t,n){for(var r=e.document,i=e.getRanges(),t=t?this.removeFromRange:this.applyToRange,s,o=i.createIterator();s=o.getNextRange();)t.call(this,s,n);e.selectRanges(i),r.removeCustomData("doc_processing_style")}var S={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},x={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},T=/\s*(?:;\s*|$)/,N=/#\((.+?)\)/g,C=CKEDITOR.dom.walker.bookmark(0,1),k=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(e,t){if(typeof e.type=="string")return new CKEDITOR.style.customHandlers[e.type](e);var n=e.attributes;n&&n.style&&(e.styles=CKEDITOR.tools.extend({},e.styles,CKEDITOR.tools.parseCssText(n.style)),delete n.style),t&&(e=CKEDITOR.tools.clone(e),y(e.attributes,t),y(e.styles,t)),n=this.element=e.element?typeof e.element=="string"?e.element.toLowerCase():e.element:"*",this.type=e.type||(S[n]?CKEDITOR.STYLE_BLOCK:x[n]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE),typeof this.element=="object"&&(this.type=CKEDITOR.STYLE_OBJECT),this._={definition:e}},CKEDITOR.style.prototype={apply:function(e){if(e instanceof CKEDITOR.dom.document)return E.call(this,e.getSelection());if(this.checkApplicable(e.elementPath(),e)){var t=this._.enterMode;t||(this._.enterMode=e.activeEnterMode),E.call(this,e.getSelection(),0,e),this._.enterMode=t}},remove:function(e){if(e instanceof CKEDITOR.dom.document)return E.call(this,e.getSelection(),1);if(this.checkApplicable(e.elementPath(),e)){var t=this._.enterMode;t||(this._.enterMode=e.activeEnterMode),E.call(this,e.getSelection(),1,e),this._.enterMode=t}},applyToRange:function(e){return this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?t:this.type==CKEDITOR.STYLE_BLOCK?o:this.type==CKEDITOR.STYLE_OBJECT?i:null,this.applyToRange(e)},removeFromRange:function(e){return this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?n:this.type==CKEDITOR.STYLE_BLOCK?u:this.type==CKEDITOR.STYLE_OBJECT?s:null,this.removeFromRange(e)},applyToObject:function(e){g(e,this)},checkActive:function(e,t){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(e.block||e.blockLimit,!0,t);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var n=e.elements,r=0,i;r<n.length;r++){i=n[r];if(this.type!=CKEDITOR.STYLE_INLINE||i!=e.block&&i!=e.blockLimit){if(this.type==CKEDITOR.STYLE_OBJECT){var s=i.getName();if(!(typeof this.element=="string"?s==this.element:s in this.element))continue}if(this.checkElementRemovable(i,!0,t))return!0}}}return!1},checkApplicable:function(e,t,n){t&&t instanceof CKEDITOR.filter&&(n=t);if(n&&!n.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!e.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!e.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(e,t){var n=this._.definition;if(!e||!n.ignoreReadonly&&e.isReadOnly())return!1;var r=e.getName();if(typeof this.element=="string"?r==this.element:r in this.element){if(!t&&!e.hasAttributes())return!0;if(r=n._AC)n=r;else{var r={},i=0,s=n.attributes;if(s)for(var o in s)i++,r[o]=s[o];if(o=CKEDITOR.style.getStyleText(n))r.style||i++,r.style=o;r._length=i,n=n._AC=r}if(!n._length)return!0;for(var u in n)if(u!="_length"){i=e.getAttribute(u)||"";if(u=="style")e:{r=n[u],typeof r=="string"&&(r=CKEDITOR.tools.parseCssText(r)),typeof i=="string"&&(i=CKEDITOR.tools.parseCssText(i,!0)),o=void 0;for(o in r)if(!(o in i)||i[o]!=r[o]&&r[o]!="inherit"&&i[o]!="inherit"){r=!1;break e}r=!0}else r=n[u]==i;if(r){if(!t)return!0}else if(t)return!1}if(t)return!0}return!1},checkElementRemovable:function(e,t,n){if(this.checkElementMatch(e,t,n))return!0;if(t=b(this)[e.getName()]){var r;if(!(t=t.attributes))return!0;for(n=0;n<t.length;n++){r=t[n][0];if(r=e.getAttribute(r)){var i=t[n][1];if(i===null)return!0;if(typeof i=="string"){if(r==i)return!0}else if(i.test(r))return!0}}}return!1},buildPreview:function(e){var t=this._.definition,n=[],r=t.element;r=="bdo"&&(r="span");var n=["<",r],i=t.attributes;if(i)for(var s in i)n.push(" ",s,'="',i[s],'"');return(i=CKEDITOR.style.getStyleText(t))&&n.push(' style="',i,'"'),n.push(">",e||t.name,"</",r,">"),n.join("")},getDefinition:function(){return this._.definition}},CKEDITOR.style.getStyleText=function(e){var t=e._ST;if(t)return t;var t=e.styles,n=e.attributes&&e.attributes.style||"",r="";n.length&&(n=n.replace(T,";"));for(var i in t){var s=t[i],o=(i+":"+s).replace(T,";");s=="inherit"?r+=o:n+=o}return n.length&&(n=CKEDITOR.tools.normalizeCssText(n,!0)),e._ST=n+r},CKEDITOR.style.customHandlers={},CKEDITOR.style.addCustomHandler=function(e){var t=function(e){this._={definition:e},this.setup&&this.setup(e)};return t.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},e,!0),this.customHandlers[e.type]=t};var L=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,A=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED}(),CKEDITOR.styleCommand=function(e,t){this.requiredContent=this.allowedContent=this.style=e,CKEDITOR.tools.extend(this,t,!0)},CKEDITOR.styleCommand.prototype.exec=function(e){e.focus(),this.state==CKEDITOR.TRISTATE_OFF?e.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&e.removeStyle(this.style)},CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet"),CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet),CKEDITOR.loadStylesSet=function(e,t,n){CKEDITOR.stylesSet.addExternal(e,t,""),CKEDITOR.stylesSet.load(e,n)},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(e,t){var n=this._.styleStateChangeCallbacks;n||(n=this._.styleStateChangeCallbacks=[],this.on("selectionChange",function(e){for(var t=0;t<n.length;t++){var r=n[t],i=r.style.checkActive(e.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;r.fn.call(this,i)}})),n.push({style:e,fn:t})},applyStyle:function(e){e.apply(this)},removeStyle:function(e){e.remove(this)},getStylesSet:function(e){if(this._.stylesDefinitions)e(this._.stylesDefinitions);else{var t=this,n=t.config.stylesCombo_stylesSet||t.config.stylesSet;if(n===!1)e(null);else if(n instanceof Array)t._.stylesDefinitions=n,e(n);else{n||(n="default");var n=n.split(":"),r=n[0];CKEDITOR.stylesSet.addExternal(r,n[1]?n.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),""),CKEDITOR.stylesSet.load(r,function(n){t._.stylesDefinitions=n[r],e(t._.stylesDefinitions)})}}}}),CKEDITOR.dom.comment=function(e,t){typeof e=="string"&&(e=(t?t.$:document).createComment(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node,CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<!--"+this.$.nodeValue+"-->"}}),"use strict",function(){var e={},t={},n;for(n in CKEDITOR.dtd.$blockLimit)n in CKEDITOR.dtd.$list||(e[n]=1);for(n in CKEDITOR.dtd.$block)n in CKEDITOR.dtd.$blockLimit||n in CKEDITOR.dtd.$empty||(t[n]=1);CKEDITOR.dom.elementPath=function(n,r){var i=null,s=null,o=[],u=n,f,r=r||n.getDocument().getBody();do if(u.type==CKEDITOR.NODE_ELEMENT){o.push(u);if(!this.lastElement){this.lastElement=u;if(u.is(CKEDITOR.dtd.$object)||u.getAttribute("contenteditable")=="false")continue}if(u.equals(r))break;if(!s){f=u.getName(),u.getAttribute("contenteditable")=="true"?s=u:!i&&t[f]&&(i=u);if(e[f]){var l;if(l=!i){if(f=f=="div"){e:{f=u.getChildren(),l=0;for(var c=f.count();l<c;l++){var h=f.getItem(l);if(h.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[h.getName()]){f=!0;break e}}f=!1}f=!f}l=f}l?i=u:s=u}}}while(u=u.getParent());s||(s=r),this.block=i,this.blockLimit=s,this.root=r,this.elements=o}}(),CKEDITOR.dom.elementPath.prototype={compare:function(e){var t=this.elements,e=e&&e.elements;if(!e||t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0},contains:function(e,t,n){var r;typeof e=="string"&&(r=function(t){return t.getName()==e}),e instanceof CKEDITOR.dom.element?r=function(t){return t.equals(e)}:CKEDITOR.tools.isArray(e)?r=function(t){return CKEDITOR.tools.indexOf(e,t.getName())>-1}:typeof e=="function"?r=e:typeof e=="object"&&(r=function(t){return t.getName()in e});var i=this.elements,s=i.length;t&&s--,n&&(i=Array.prototype.slice.call(i,0),i.reverse());for(t=0;t<s;t++)if(r(i[t]))return i[t];return null},isContextFor:function(e){var t;return e in CKEDITOR.dtd.$block?(t=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!t.getDtd()[e]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}},CKEDITOR.dom.text=function(e,t){typeof e=="string"&&(e=(t?t.$:document).createTextNode(e)),this.$=e},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},getText:function(){return this.$.nodeValue},setText:function(e){this.$.nodeValue=e},split:function(e){var t=this.$.parentNode,n=t.childNodes.length,r=this.getLength(),i=this.getDocument(),s=new CKEDITOR.dom.text(this.$.splitText(e),i);return t.childNodes.length==n&&(e>=r?(s=i.createText(""),s.insertAfter(this)):(e=i.createText(""),e.insertAfter(s),e.remove())),s},substring:function(e,t){return typeof t!="number"?this.$.nodeValue.substr(e):this.$.nodeValue.substring(e,t)}}),function(){function e(e,t,n){var r=e.serializable,i=t[n?"endContainer":"startContainer"],s=n?"endOffset":"startOffset",o=r?t.document.getById(e.startNode):e.startNode,e=r?t.document.getById(e.endNode):e.endNode;return i.equals(o.getPrevious())?(t.startOffset=t.startOffset-i.getLength()-e.getPrevious().getLength(),i=e.getNext()):i.equals(e.getPrevious())&&(t.startOffset=t.startOffset-i.getLength(),i=e.getNext()),i.equals(o.getParent())&&t[s]++,i.equals(e.getParent())&&t[s]++,t[n?"endContainer":"startContainer"]=i,t}CKEDITOR.dom.rangeList=function(e){return e instanceof CKEDITOR.dom.rangeList?e:(e?e instanceof CKEDITOR.dom.range&&(e=[e]):e=[],CKEDITOR.tools.extend(e,t))};var t={createIterator:function(){var e=this,t=CKEDITOR.dom.walker.bookmark(),n=[],r;return{getNextRange:function(i){r=r===void 0?0:r+1;var s=e[r];if(s&&e.length>1){if(!r)for(var o=e.length-1;o>=0;o--)n.unshift(e[o].createBookmark(!0));if(i)for(var u=0;e[r+u+1];){for(var f=s.document,i=0,o=f.getById(n[u].endNode),f=f.getById(n[u+1].startNode);;){o=o.getNextSourceNode(!1);if(f.equals(o))i=1;else if(t(o)||o.type==CKEDITOR.NODE_ELEMENT&&o.isBlockBoundary())continue;break}if(!i)break;u++}for(s.moveToBookmark(n.shift());u--;)o=e[++r],o.moveToBookmark(n.shift()),s.setEnd(o.endContainer,o.endOffset)}return s}}},createBookmarks:function(t){for(var n=[],r,i=0;i<this.length;i++){n.push(r=this[i].createBookmark(t,!0));for(var s=i+1;s<this.length;s++)this[s]=e(r,this[s]),this[s]=e(r,this[s],!0)}return n},createBookmarks2:function(e){for(var t=[],n=0;n<this.length;n++)t.push(this[n].createBookmark2(e));return t},moveToBookmarks:function(e){for(var t=0;t<this.length;t++)this[t].moveToBookmark(e[t])}}}(),function(){function e(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function t(t){var n=CKEDITOR.skin["ua_"+t],r=CKEDITOR.env;if(n)for(var n=n.split(",").sort(function(e,t){return e>t?-1:1}),i=0,s;i<n.length;i++){s=n[i],r.ie&&(s.replace(/^ie/,"")==r.version||r.quirks&&s=="iequirks")&&(s="ie");if(r[s]){t+="_"+n[i];break}}return CKEDITOR.getUrl(e()+t+".css")}function n(e,n){s[e]||(CKEDITOR.document.appendStyleSheet(t(e)),s[e]=1),n&&n()}function r(e){var t=e.getById(o);return t||(t=e.getHead().append("style"),t.setAttribute("id",o),t.setAttribute("type","text/css")),t}function i(e,t,n){var r,i,s;if(CKEDITOR.env.webkit){t=t.split("}").slice(0,-1);for(i=0;i<t.length;i++)t[i]=t[i].split("{")}for(var o=0;o<e.length;o++)if(CKEDITOR.env.webkit)for(i=0;i<t.length;i++){s=t[i][1];for(r=0;r<n.length;r++)s=s.replace(n[r][0],n[r][1]);e[o].$.sheet.addRule(t[i][0],s)}else{s=t;for(r=0;r<n.length;r++)s=s.replace(n[r][0],n[r][1]);CKEDITOR.env.ie&&CKEDITOR.env.version<11?e[o].$.styleSheet.cssText=e[o].$.styleSheet.cssText+s:e[o].$.innerHTML=e[o].$.innerHTML+s}}var s={};CKEDITOR.skin={path:e,loadPart:function(t,r){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e()+"skin.js"),function(){n(t,r)}):n(t,r)},getPath:function(e){return CKEDITOR.getUrl(t(e))},icons:{},addIcon:function(e,t,n,r){e=e.toLowerCase(),this.icons[e]||(this.icons[e]={path:t,offset:n||0,bgsize:r||"16px"})},getIconStyle:function(e,t,n,r,i){var s;return e&&(e=e.toLowerCase(),t&&(s=this.icons[e+"-rtl"]),s||(s=this.icons[e])),e=n||s&&s.path||"",r=r||s&&s.offset,i=i||s&&s.bgsize||"16px",e&&"background-image:url("+CKEDITOR.getUrl(e)+");background-position:0 "+r+"px;background-size:"+i+";"}},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(e){var t=r(CKEDITOR.document);return(this.setUiColor=function(e){this.uiColor=e;var n=CKEDITOR.skin.chameleon,r="",s="";typeof n=="function"&&(r=n(this,"editor"),s=n(this,"panel")),e=[[a,e]],i([t],r,e),i(u,s,e)}).call(this,e)}});var o="cke_ui_color",u=[],a=/\$color/g;CKEDITOR.on("instanceLoaded",function(e){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var t=e.editor,e=function(e){e=(e.data[0]||e.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!e.getById("cke_ui_color")){e=r(e),u.push(e);var n=t.getUiColor();n&&i([e],CKEDITOR.skin.chameleon(t,"panel"),[[a,n]])}};t.on("panelShow",e),t.on("menuShow",e),t.config.uiColor&&t.setUiColor(t.config.uiColor)}})}(),function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var e=CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>',CKEDITOR.document);e.appendTo(CKEDITOR.document.getHead());try{var t=e.getComputedStyle("border-top-color"),n=e.getComputedStyle("border-right-color");CKEDITOR.env.hc=!!t&&t==n}catch(r){CKEDITOR.env.hc=!1}e.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc"),CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}"),CKEDITOR.status="loaded",CKEDITOR.fireOnce("loaded");if(e=CKEDITOR._.pending){delete CKEDITOR._.pending;for(t=0;t<e.length;t++)CKEDITOR.editor.prototype.constructor.apply(e[t][0],e[t][1]),CKEDITOR.add(e[t][0])}}(),CKEDITOR.skin.name="moono",CKEDITOR.skin.ua_editor="ie,iequirks,ie7,ie8,gecko",CKEDITOR.skin.ua_dialog="ie,iequirks,ie7,ie8",CKEDITOR.skin.chameleon=function(){var e=function(){return function(e,t){for(var n=e.match(/[^#]./g),r=0;r<3;r++){var i=n,s=r,o;o=parseInt(n[r],16),o=("0"+(t<0?0|o*(1+t):0|o+(255-o)*t).toString(16)).slice(-2),i[s]=o}return"#"+n.join("")}}(),t=function(){var e=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");return function(t,n){return e.output({from:t,to:n})}}(),n={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};return function(r,i){var s=r.uiColor,s={id:"."+r.id,defaultBorder:e(s,-0.1),defaultGradient:t(e(s,.9),s),lightGradient:t(e(s,1),e(s,.7)),mediumGradient:t(e(s,.8),e(s,.5)),ckeButtonOn:t(e(s,.6),e(s,.7)),ckeResizer:e(s,-0.4),ckeToolbarSeparator:e(s,.5),ckeColorauto:e(s,.8),dialogBody:e(s,.7),dialogTabSelected:t("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:e(s,-0.6),elementsPathBg:s,menubuttonIcon:e(s,.5),menubuttonIconHover:e(s,.3)};return n[i].output(s).replace(/\[/g,"{").replace(/\]/g,"}")}}(),CKEDITOR.plugins.add("dialogui",{onLoad:function(){var e=function(e){this._||(this._={}),this._["default"]=this._.initValue=e["default"]||"",this._.required=e.required||!1;for(var t=[this._],n=1;n<arguments.length;n++)t.push(arguments[n]);return t.push(!0),CKEDITOR.tools.extend.apply(CKEDITOR.tools,t),this._},t={build:function(e,t,n){return new CKEDITOR.ui.dialog.textInput(e,t,n)}},n={build:function(e,t,n){return new CKEDITOR.ui.dialog[t.type](e,t,n)}},r={isChanged:function(){return this.getValue()!=this.getInitValue()},reset:function(e){this.setValue(this.getInitValue(),e)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},i=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(e,t){this._.domOnChangeRegistered||(e.on("load",function(){this.getInputElement().on("change",function(){e.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0),this.on("change",t)}},!0),s=/^on([A-Z]\w+)/,o=function(e){for(var t in e)(s.test(t)||t=="title"||t=="type")&&delete e[t];return e};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(t,n,r,i){if(!(arguments.length<4)){var s=e.call(this,n);s.labelId=CKEDITOR.tools.getNextId()+"_label",this._.children=[];var o={role:n.role||"presentation"};n.includeLabel&&(o["aria-labelledby"]=s.labelId),CKEDITOR.ui.dialog.uiElement.call(this,t,n,r,"div",null,o,function(){var e=[],r=n.required?" cke_required":"";return n.labelLayout!="horizontal"?e.push('<label class="cke_dialog_ui_labeled_label'+r+'" ',' id="'+s.labelId+'"',s.inputId?' for="'+s.inputId+'"':"",(n.labelStyle?' style="'+n.labelStyle+'"':"")+">",n.label,"</label>",'<div class="cke_dialog_ui_labeled_content"',n.controlStyle?' style="'+n.controlStyle+'"':"",' role="presentation">',i.call(this,t,n),"</div>"):(r={type:"hbox",widths:n.widths,padding:0,children:[{type:"html",html:'<label class="cke_dialog_ui_labeled_label'+r+'" id="'+s.labelId+'" for="'+s.inputId+'"'+(n.labelStyle?' style="'+n.labelStyle+'"':"")+">"+CKEDITOR.tools.htmlEncode(n.label)+"</span>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content"'+(n.controlStyle?' style="'+n.controlStyle+'"':"")+">"+i.call(this,t,n)+"</span>"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(t,r,e)),e.join("")})}},textInput:function(t,n,r){if(!(arguments.length<3)){e.call(this,n);var i=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",s={"class":"cke_dialog_ui_input_"+n.type,id:i,type:n.type};n.validate&&(this.validate=n.validate),n.maxLength&&(s.maxlength=n.maxLength),n.size&&(s.size=n.size),n.inputStyle&&(s.style=n.inputStyle);var o=this,u=!1;t.on("load",function(){o.getInputElement().on("keydown",function(e){e.data.getKeystroke()==13&&(u=!0)}),o.getInputElement().on("keyup",function(e){e.data.getKeystroke()==13&&u&&(t.getButton("ok")&&setTimeout(function(){t.getButton("ok").click()},0),u=!1)},null,null,1e3)}),CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){var e=['<div class="cke_dialog_ui_input_',n.type,'" role="presentation"'];n.width&&e.push('style="width:'+n.width+'" '),e.push("><input "),s["aria-labelledby"]=this._.labelId,this._.required&&(s["aria-required"]=this._.required);for(var t in s)e.push(t+'="'+s[t]+'" ');return e.push(" /></div>"),e.join("")})}},textarea:function(t,n,r){if(!(arguments.length<3)){e.call(this,n);var i=this,s=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",o={};n.validate&&(this.validate=n.validate),o.rows=n.rows||5,o.cols=n.cols||20,o["class"]="cke_dialog_ui_input_textarea "+(n["class"]||""),typeof n.inputStyle!="undefined"&&(o.style=n.inputStyle),n.dir&&(o.dir=n.dir),CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){o["aria-labelledby"]=this._.labelId,this._.required&&(o["aria-required"]=this._.required);var e=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="',s,'" '],t;for(t in o)e.push(t+'="'+CKEDITOR.tools.htmlEncode(o[t])+'" ');return e.push(">",CKEDITOR.tools.htmlEncode(i._["default"]),"</textarea></div>"),e.join("")})}},checkbox:function(t,n,r){if(!(arguments.length<3)){var i=e.call(this,n,{"default":!!n["default"]});n.validate&&(this.validate=n.validate),CKEDITOR.ui.dialog.uiElement.call(this,t,n,r,"span",null,null,function(){var e=CKEDITOR.tools.extend({},n,{id:n.id?n.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),r=[],s=CKEDITOR.tools.getNextId()+"_label",u={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":s};return o(e),n["default"]&&(u.checked="checked"),typeof e.inputStyle!="undefined"&&(e.style=e.inputStyle),i.checkbox=new CKEDITOR.ui.dialog.uiElement(t,e,r,"input",null,u),r.push(' <label id="',s,'" for="',u.id,'"'+(n.labelStyle?' style="'+n.labelStyle+'"':"")+">",CKEDITOR.tools.htmlEncode(n.label),"</label>"),r.join("")})}},radio:function(t,n,r){if(!(arguments.length<3)){e.call(this,n),this._["default"]||(this._["default"]=this._.initValue=n.items[0][1]),n.validate&&(this.validate=n.valdiate);var i=[],s=this;n.role="radiogroup",n.includeLabel=!0,CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){for(var e=[],r=[],u=(n.id?n.id:CKEDITOR.tools.getNextId())+"_radio",a=0;a<n.items.length;a++){var f=n.items[a],l=f[2]!==void 0?f[2]:f[0],h=f[1]!==void 0?f[1]:f[0],p=CKEDITOR.tools.getNextId()+"_radio_input",d=p+"_label",p=CKEDITOR.tools.extend({},n,{id:p,title:null,type:null},!0),l=CKEDITOR.tools.extend({},p,{title:l},!0),v={type:"radio","class":"cke_dialog_ui_radio_input",name:u,value:h,"aria-labelledby":d},m=[];s._["default"]==h&&(v.checked="checked"),o(p),o(l),typeof p.inputStyle!="undefined"&&(p.style=p.inputStyle),p.keyboardFocusable=!0,i.push(new CKEDITOR.ui.dialog.uiElement(t,p,m,"input",null,v)),m.push(" "),new CKEDITOR.ui.dialog.uiElement(t,l,m,"label",null,{id:d,"for":v.id},f[0]),e.push(m.join(""))}return new CKEDITOR.ui.dialog.hbox(t,i,e,r),r.join("")}),this._.children=i}},button:function(t,n,r){if(arguments.length){typeof n=="function"&&(n=n(t.getParentEditor())),e.call(this,n,{disabled:n.disabled||!1}),CKEDITOR.event.implementOn(this);var i=this;t.on("load",function(){var e=this.getElement();(function(){e.on("click",function(e){i.click(),e.data.preventDefault()}),e.on("keydown",function(e){e.data.getKeystroke()in{32:1}&&(i.click(),e.data.preventDefault())})})(),e.unselectable()},this);var s=CKEDITOR.tools.extend({},n);delete s.style;var o=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,t,s,r,"a",null,{style:n.style,href:"javascript:void(0)",title:n.label,hidefocus:"true","class":n["class"],role:"button","aria-labelledby":o},'<span id="'+o+'" class="cke_dialog_ui_button">'+CKEDITOR.tools.htmlEncode(n.label)+"</span>")}},select:function(t,n,r){if(!(arguments.length<3)){var i=e.call(this,n);n.validate&&(this.validate=n.validate),i.inputId=CKEDITOR.tools.getNextId()+"_select",CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){var e=CKEDITOR.tools.extend({},n,{id:n.id?n.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),r=[],s=[],u={id:i.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};r.push('<div class="cke_dialog_ui_input_',n.type,'" role="presentation"'),n.width&&r.push('style="width:'+n.width+'" '),r.push(">"),n.size!==void 0&&(u.size=n.size),n.multiple!==void 0&&(u.multiple=n.multiple),o(e);for(var a=0,f;a<n.items.length&&(f=n.items[a]);a++)s.push('<option value="',CKEDITOR.tools.htmlEncode(f[1]!==void 0?f[1]:f[0]).replace(/"/g,"&quot;"),'" /> ',CKEDITOR.tools.htmlEncode(f[0]));return typeof e.inputStyle!="undefined"&&(e.style=e.inputStyle),i.select=new CKEDITOR.ui.dialog.uiElement(t,e,r,"select",null,u,s.join("")),r.push("</div>"),r.join("")})}},file:function(t,n,r){if(!(arguments.length<3)){n["default"]===void 0&&(n["default"]="");var i=CKEDITOR.tools.extend(e.call(this,n),{definition:n,buttons:[]});n.validate&&(this.validate=n.validate),t.on("load",function(){CKEDITOR.document.getById(i.frameId).getParent().addClass("cke_dialog_ui_input_file")}),CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){i.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var e=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',i.frameId,'" title="',n.label,'" src="javascript:void('];return e.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0"),e.push(')"></iframe>'),e.join("")})}},fileButton:function(t,n,r){var i=this;if(!(arguments.length<3)){e.call(this,n),n.validate&&(this.validate=n.validate);var s=CKEDITOR.tools.extend({},n),o=s.onClick;s.className=(s.className?s.className+" ":"")+"cke_dialog_ui_button",s.onClick=function(e){var r=n["for"];if(!o||o.call(this,e)!==!1)t.getContentElement(r[0],r[1]).submit(),this.disable()},t.on("load",function(){t.getContentElement(n["for"][0],n["for"][1])._.buttons.push(i)}),CKEDITOR.ui.dialog.button.call(this,t,s,r)}},html:function(){var e=/^\s*<[\w:]+\s+([^>]*)?>/,t=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,n=/\/$/;return function(r,i,s){if(!(arguments.length<3)){var o=[],u=i.html;u.charAt(0)!="<"&&(u="<span>"+u+"</span>");var f=i.focus;if(f){var l=this.focus;this.focus=function(){(typeof f=="function"?f:l).call(this),this.fire("focus")},i.isFocusable&&(this.isFocusable=this.isFocusable),this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,r,i,o,"span",null,null,""),o=o.join("").match(e),u=u.match(t)||["","",""],n.test(u[1])&&(u[1]=u[1].slice(0,-1),u[2]="/"+u[2]),s.push([u[1]," ",o[1]||"",u[2]].join(""))}}}(),fieldset:function(e,t,n,r,i){var s=i.label;this._={children:t},CKEDITOR.ui.dialog.uiElement.call(this,e,i,r,"fieldset",null,null,function(){var e=[];s&&e.push("<legend"+(i.labelStyle?' style="'+i.labelStyle+'"':"")+">"+s+"</legend>");for(var t=0;t<n.length;t++)e.push(n[t]);return e.join("")})}},!0),CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement,CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(e){var t=CKEDITOR.document.getById(this._.labelId);return t.getChildCount()<1?(new CKEDITOR.dom.text(e,CKEDITOR.document)).appendTo(t):t.getChild(0).$.nodeValue=e,this},getLabel:function(){var e=CKEDITOR.document.getById(this._.labelId);return!e||e.getChildCount()<1?"":e.getChild(0).getText()},eventProcessors:i},!0),CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var e=this.getElement();e&&e.removeClass("cke_disabled")},disable:function(){this._.disabled=!0,this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(e,t){this.on("click",function(){t.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0),CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},focus:function(){var e=this.selectParentTab();setTimeout(function(){var t=e.getInputElement();t&&t.$.focus()},0)},select:function(){var e=this.selectParentTab();setTimeout(function(){var t=e.getInputElement();t&&(t.$.focus(),t.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(e){return!e&&(e=""),CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},keyboardFocusable:!0},r,!0),CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput,CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(e,t,n){var r=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),i=this.getInputElement().$;return r.$.text=e,r.$.value=t===void 0||t===null?e:t,n===void 0||n===null?CKEDITOR.env.ie?i.add(r.$):i.add(r.$,null):i.add(r.$,n),this},remove:function(e){return this.getInputElement().$.remove(e),this},clear:function(){for(var e=this.getInputElement().$;e.length>0;)e.remove(0);return this},keyboardFocusable:!0},r,!0),CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(e,t){this.getInputElement().$.checked=e,!t&&this.fire("change",{value:e})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(e,t){return!CKEDITOR.env.ie||CKEDITOR.env.version>8?i.onChange.apply(this,arguments):(e.on("load",function(){var e=this._.checkbox.getElement();e.on("propertychange",function(t){t=t.data.$,t.propertyName=="checked"&&this.fire("change",{value:e.$.checked})},this)},this),this.on("change",t),null)}},keyboardFocusable:!0},r,!0),CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setValue:function(e,t){for(var n=this._.children,r,i=0;i<n.length&&(r=n[i]);i++)r.getElement().$.checked=r.getValue()==e;!t&&this.fire("change",{value:e})},getValue:function(){for(var e=this._.children,t=0;t<e.length;t++)if(e[t].getElement().$.checked)return e[t].getValue();return null},accessKeyUp:function(){var e=this._.children,t;for(t=0;t<e.length;t++)if(e[t].getElement().$.checked){e[t].getElement().focus();return}e[0].getElement().focus()},eventProcessors:{onChange:function(e,t){return CKEDITOR.env.ie?(e.on("load",function(){for(var e=this._.children,t=this,n=0;n<e.length;n++)e[n].getElement().on("propertychange",function(e){e=e.data.$,e.propertyName=="checked"&&this.$.checked&&t.fire("change",{value:this.getAttribute("value")})})},this),this.on("change",t),null):i.onChange.apply(this,arguments)}}},r,!0),CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,r,{getInputElement:function(){var e=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return e.$.forms.length>0?new CKEDITOR.dom.element(e.$.forms[0].elements[0]):this.getElement()},submit:function(){return this.getInputElement().getParent().$.submit(),this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(e){var t=/^on([A-Z]\w+)/,n,r=function(e,t,n,r){e.on("formLoaded",function(){e.getInputElement().on(n,r,e)})},i;for(i in e)if(n=i.match(t))this.eventProcessors[i]?this.eventProcessors[i].call(this,this._.dialog,e[i]):r(this,this._.dialog,n[1].toLowerCase(),e[i]);return this},reset:function(){function e(){n.$.open();var e="";r.size&&(e=r.size-(CKEDITOR.env.ie?7:0));var f=t.frameId+"_input";n.$.write(['<html dir="'+u+'" lang="'+a+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+u+'" lang="'+a+'" action="',CKEDITOR.tools.htmlEncode(r.action),'"><label id="',t.labelId,'" for="',f,'" style="display:none">',CKEDITOR.tools.htmlEncode(r.label),'</label><input style="width:100%" id="',f,'" aria-labelledby="',t.labelId,'" type="file" name="',CKEDITOR.tools.htmlEncode(r.id||"cke_upload"),'" size="',CKEDITOR.tools.htmlEncode(e>0?e:""),'" /></form></body></html><script>',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+s+");","window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction("+o+")}","</script>"].join("")),n.$.close();for(e=0;e<i.length;e++)i[e].enable()}var t=this._,n=CKEDITOR.document.getById(t.frameId).getFrameDocument(),r=t.definition,i=t.buttons,s=this.formLoadedNumber,o=this.formUnloadNumber,u=t.dialog._.editor.lang.dir,a=t.dialog._.editor.langCode;s||(s=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),o=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(s),CKEDITOR.tools.removeFunction(o)})),CKEDITOR.env.gecko?setTimeout(e,500):e()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(e,t){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0),this.on("change",t)}},keyboardFocusable:!0},!0),CKEDITOR.ui.dialog.fileButton.prototype=new CKEDITOR.ui.dialog.button,CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype),CKEDITOR.dialog.addUIElement("text",t),CKEDITOR.dialog.addUIElement("password",t),CKEDITOR.dialog.addUIElement("textarea",n),CKEDITOR.dialog.addUIElement("checkbox",n),CKEDITOR.dialog.addUIElement("radio",n),CKEDITOR.dialog.addUIElement("button",n),CKEDITOR.dialog.addUIElement("select",n),CKEDITOR.dialog.addUIElement("file",n),CKEDITOR.dialog.addUIElement("fileButton",n),CKEDITOR.dialog.addUIElement("html",n),CKEDITOR.dialog.addUIElement("fieldset",{build:function(e,t,n){for(var r=t.children,i,s=[],o=[],u=0;u<r.length&&(i=r[u]);u++){var a=[];s.push(a),o.push(CKEDITOR.dialog._.uiElementBuilders[i.type].build(e,i,a))}return new CKEDITOR.ui.dialog[t.type](e,o,s,n,t)}})}}),CKEDITOR.DIALOG_RESIZE_NONE=0,CKEDITOR.DIALOG_RESIZE_WIDTH=1,CKEDITOR.DIALOG_RESIZE_HEIGHT=2,CKEDITOR.DIALOG_RESIZE_BOTH=3,function(){function e(){for(var e=this._.tabIdList.length,t=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+e,n=t-1;n>t-e;n--)if(this._.tabs[this._.tabIdList[n%e]][0].$.offsetHeight)return this._.tabIdList[n%e];return null}function t(){for(var e=this._.tabIdList.length,t=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),n=t+1;n<t+e;n++)if(this._.tabs[this._.tabIdList[n%e]][0].$.offsetHeight)return this._.tabIdList[n%e];return null}function n(e,t){for(var n=e.$.getElementsByTagName("input"),r=0,i=n.length;r<i;r++){var s=new CKEDITOR.dom.element(n[r]);s.getAttribute("type").toLowerCase()=="text"&&(t?(s.setAttribute("value",s.getCustomData("fake_value")||""),s.removeCustomData("fake_value")):(s.setCustomData("fake_value",s.getAttribute("value")),s.setAttribute("value","")))}}function r(e,t){var n=this.getInputElement();n&&(e?n.removeAttribute("aria-invalid"):n.setAttribute("aria-invalid",!0)),e||(this.select?this.select():this.focus()),t&&alert(t),this.fire("validated",{valid:e,msg:t})}function i(){var e=this.getInputElement();e&&e.removeAttribute("aria-invalid")}function s(e){var e=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",v).output({id:CKEDITOR.tools.getNextNumber(),editorId:e.id,langDir:e.lang.dir,langCode:e.langCode,editorDialogClass:"cke_editor_"+e.name.replace(/\./g,"\\.")+"_dialog",closeTitle:e.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),t=e.getChild([0,0,0,0,0]),n=t.getChild(0),r=t.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var i="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())";CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="'+i+'" tabIndex="-1"></iframe>').appendTo(t.getParent())}return n.unselectable(),r.unselectable(),{element:e,parts:{dialog:e.getChild(0),title:n,close:r,tabs:t.getChild(2),contents:t.getChild([3,0,0,0]),footer:t.getChild([3,0,1,0])}}}function o(e,t,n){this.element=t,this.focusIndex=n,this.tabIndex=0,this.isFocusable=function(){return!t.getAttribute("disabled")&&t.isVisible()},this.focus=function(){e._.currentFocusIndex=this.focusIndex,this.element.focus()},t.on("keydown",function(e){e.data.getKeystroke()in{32:1,13:1}&&this.fire("click")}),t.on("focus",function(){this.fire("mouseover")}),t.on("blur",function(){this.fire("mouseout")})}function u(e){function t(){e.layout()}var n=CKEDITOR.document.getWindow();n.on("resize",t),e.on("hide",function(){n.removeListener("resize",t)})}function a(e,t){this._={dialog:e},CKEDITOR.tools.extend(this,t)}function f(e){function t(t){var n=e.getSize(),a=CKEDITOR.document.getWindow().getViewPaneSize(),f=t.data.$.screenX,l=t.data.$.screenY,c=f-r.x,h=l-r.y;r={x:f,y:l},i.x=i.x+c,i.y=i.y+h,e.move(i.x+u[3]<o?-u[3]:i.x-u[1]>a.width-n.width-o?a.width-n.width+(s.lang.dir=="rtl"?0:u[1]):i.x,i.y+u[0]<o?-u[0]:i.y-u[2]>a.height-n.height-o?a.height-n.height+u[2]:i.y,1),t.data.preventDefault()}function n(){CKEDITOR.document.removeListener("mousemove",t),CKEDITOR.document.removeListener("mouseup",n);if(CKEDITOR.env.ie6Compat){var e=x.getChild(0).getFrameDocument();e.removeListener("mousemove",t),e.removeListener("mouseup",n)}}var r=null,i=null,s=e.getParentEditor(),o=s.config.dialog_magnetDistance,u=CKEDITOR.skin.margins||[0,0,0,0];typeof o=="undefined"&&(o=20),e.parts.title.on("mousedown",function(s){r={x:s.data.$.screenX,y:s.data.$.screenY},CKEDITOR.document.on("mousemove",t),CKEDITOR.document.on("mouseup",n),i=e.getPosition();if(CKEDITOR.env.ie6Compat){var o=x.getChild(0).getFrameDocument();o.on("mousemove",t),o.on("mouseup",n)}s.data.preventDefault()},e)}function l(e){function r(r){var i=u.lang.dir=="rtl",h=c.width,p=c.height,d=h+(r.data.$.screenX-t)*(i?-1:1)*(e._.moved?1:2),v=p+(r.data.$.screenY-n)*(e._.moved?1:2),m=e._.element.getFirst(),m=i&&m.getComputedStyle("right"),g=e.getPosition();g.y+v>l.height&&(v=l.height-g.y),(i?m:g.x)+d>l.width&&(d=l.width-(i?m:g.x));if(o==CKEDITOR.DIALOG_RESIZE_WIDTH||o==CKEDITOR.DIALOG_RESIZE_BOTH)h=Math.max(s.minWidth||0,d-a);if(o==CKEDITOR.DIALOG_RESIZE_HEIGHT||o==CKEDITOR.DIALOG_RESIZE_BOTH)p=Math.max(s.minHeight||0,v-f);e.resize(h,p),e._.moved||e.layout(),r.data.preventDefault()}function i(){CKEDITOR.document.removeListener("mouseup",i),CKEDITOR.document.removeListener("mousemove",r),h&&(h.remove(),h=null);if(CKEDITOR.env.ie6Compat){var e=x.getChild(0).getFrameDocument();e.removeListener("mouseup",i),e.removeListener("mousemove",r)}}var t,n,s=e.definition,o=s.resizable;if(o!=CKEDITOR.DIALOG_RESIZE_NONE){var u=e.getParentEditor(),a,f,l,c,h,p=CKEDITOR.tools.addFunction(function(s){c=e.getSize();var o=e.parts.contents;o.$.getElementsByTagName("iframe").length&&(h=CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>'),o.append(h)),f=c.height-e.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks)),a=c.width-e.parts.contents.getSize("width",1),t=s.screenX,n=s.screenY,l=CKEDITOR.document.getWindow().getViewPaneSize(),CKEDITOR.document.on("mousemove",r),CKEDITOR.document.on("mouseup",i),CKEDITOR.env.ie6Compat&&(o=x.getChild(0).getFrameDocument(),o.on("mousemove",r),o.on("mouseup",i)),s.preventDefault&&s.preventDefault()});e.on("load",function(){var t="";o==CKEDITOR.DIALOG_RESIZE_WIDTH?t=" cke_resizer_horizontal":o==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(t=" cke_resizer_vertical"),t=CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer'+t+" cke_resizer_"+u.lang.dir+'" title="'+CKEDITOR.tools.htmlEncode(u.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+p+', event )">'+(u.lang.dir=="ltr"?"◢":"◣")+"</div>"),e.parts.footer.append(t,1)}),u.on("destroy",function(){CKEDITOR.tools.removeFunction(p)})}}function c(e){e.data.preventDefault(1)}function h(e){var t=CKEDITOR.document.getWindow(),n=e.config,r=n.dialog_backgroundCoverColor||"white",i=n.dialog_backgroundCoverOpacity,s=n.baseFloatZIndex,n=CKEDITOR.tools.genKey(r,i,s),o=S[n];o?o.show():(s=['<div tabIndex="-1" style="position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",s,"; top: 0px; left: 0px; ",CKEDITOR.env.ie6Compat?"":"background-color: "+r,'" class="cke_dialog_background_cover">'],CKEDITOR.env.ie6Compat&&(r="<html><body style=\\'background-color:"+r+";\\'></body></html>",s.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'),s.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+r+"' );document.close();")+"})())"),s.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')),s.push("</div>"),o=CKEDITOR.dom.element.createFromHtml(s.join("")),o.setOpacity(i!==void 0?i:.5),o.on("keydown",c),o.on("keypress",c),o.on("keyup",c),o.appendTo(CKEDITOR.document.getBody()),S[n]=o),e.focusManager.add(o),x=o;var e=function(){var e=t.getViewPaneSize();o.setStyles({width:e.width+"px",height:e.height+"px"})},u=function(){var e=t.getScrollPosition(),n=CKEDITOR.dialog._.currentTop;o.setStyles({left:e.x+"px",top:e.y+"px"});if(n)do e=n.getPosition(),n.move(e.x,e.y);while(n=n._.parentDialog)};E=e,t.on("resize",e),e(),(!CKEDITOR.env.mac||!CKEDITOR.env.webkit)&&o.focus();if(CKEDITOR.env.ie6Compat){var a=function(){u(),arguments.callee.prevScrollHandler.apply(this,arguments)};t.$.setTimeout(function(){a.prevScrollHandler=window.onscroll||function(){},window.onscroll=a},0),u()}}function p(e){x&&(e.focusManager.remove(x),e=CKEDITOR.document.getWindow(),x.hide(),e.removeListener("resize",E),CKEDITOR.env.ie6Compat&&e.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),E=null)}var d=CKEDITOR.tools.cssLength,v='<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';CKEDITOR.dialog=function(n,o){function u(){var e=x._.focusList;e.sort(function(e,t){return e.tabIndex!=t.tabIndex?t.tabIndex-e.tabIndex:e.focusIndex-t.focusIndex});for(var t=e.length,n=0;n<t;n++)e[n].focusIndex=n}function a(e){var t=x._.focusList,e=e||0;if(!(t.length<1)){var n=x._.currentFocusIndex;try{t[n].getInputElement().$.blur()}catch(r){}for(var i=n=(n+e+t.length)%t.length;e&&!t[i].isFocusable();){i=(i+e+t.length)%t.length;if(i==n)break}t[i].focus(),t[i].type=="text"&&t[i].select()}}function c(r){if(x==CKEDITOR.dialog._.currentTop){var i=r.data.getKeystroke(),s=n.lang.dir=="rtl";b=E=0;if(i==9||i==CKEDITOR.SHIFT+9)i=i==CKEDITOR.SHIFT+9,x._.tabBarMode?(i=i?e.call(x):t.call(x),x.selectPage(i),x._.tabs[i][0].focus()):a(i?-1:1),b=1;else if(i==CKEDITOR.ALT+121&&!x._.tabBarMode&&x.getPageCount()>1)x._.tabBarMode=!0,x._.tabs[x._.currentTabId][0].focus(),b=1;else if(i!=37&&i!=39||!x._.tabBarMode)if(i!=13&&i!=32||!x._.tabBarMode)if(i==13)i=r.data.getTarget(),!i.is("a","button","select","textarea")&&(!i.is("input")||i.$.type!="button")&&((i=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(i.click,0,i),b=1),E=1;else{if(i!=27)return;(i=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(i.click,0,i):this.fire("cancel",{hide:!0}).hide!==!1&&this.hide(),E=1}else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=-1,a(1),b=1;else i=i==(s?39:37)?e.call(x):t.call(x),x.selectPage(i),x._.tabs[i][0].focus(),b=1;h(r)}}function h(e){b?e.data.preventDefault(1):E&&e.data.stopPropagation()}var p=CKEDITOR.dialog._.dialogDefinitions[o],d=CKEDITOR.tools.clone(m),v=n.config.dialog_buttonsOrder||"OS",g=n.lang.dir,y={},b,E;(v=="OS"&&CKEDITOR.env.mac||v=="rtl"&&g=="ltr"||v=="ltr"&&g=="rtl")&&d.buttons.reverse(),p=CKEDITOR.tools.extend(p(n),d),p=CKEDITOR.tools.clone(p),p=new w(this,p),d=s(n),this._={editor:n,element:d.element,name:o,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1},this.parts=d.parts,CKEDITOR.tools.setTimeout(function(){n.fire("ariaWidget",this.parts.contents)},0,this),d={position:CKEDITOR.env.ie6Compat?"absolute":"fixed",top:0,visibility:"hidden"},d[g=="rtl"?"right":"left"]=0,this.parts.dialog.setStyles(d),CKEDITOR.event.call(this),this.definition=p=CKEDITOR.fire("dialogDefinition",{name:o,definition:p},n).definition;if(!("removeDialogTabs"in n._)&&n.config.removeDialogTabs){d=n.config.removeDialogTabs.split(";");for(g=0;g<d.length;g++){v=d[g].split(":");if(v.length==2){var S=v[0];y[S]||(y[S]=[]),y[S].push(v[1])}}n._.removeDialogTabs=y}if(n._.removeDialogTabs&&(y=n._.removeDialogTabs[o]))for(g=0;g<y.length;g++)p.removeContents(y[g]);p.onLoad&&this.on("load",p.onLoad),p.onShow&&this.on("show",p.onShow),p.onHide&&this.on("hide",p.onHide),p.onOk&&this.on("ok",function(e){n.fire("saveSnapshot"),setTimeout(function(){n.fire("saveSnapshot")},0),p.onOk.call(this,e)===!1&&(e.data.hide=!1)}),p.onCancel&&this.on("cancel",function(e){p.onCancel.call(this,e)===!1&&(e.data.hide=!1)});var x=this,T=function(e){var t=x._.contents,n=!1,r;for(r in t)for(var i in t[r])if(n=e.call(this,t[r][i]))return};this.on("ok",function(e){T(function(t){if(t.validate){var n=t.validate(this),i=typeof n=="string"||n===!1;return i&&(e.data.hide=!1,e.stop()),r.call(t,!i,typeof n=="string"?n:void 0),i}})},this,null,0),this.on("cancel",function(e){T(function(t){if(t.isChanged())return!n.config.dialog_noConfirmCancel&&!confirm(n.lang.common.confirmCancel)&&(e.data.hide=!1),!0})},this,null,0),this.parts.close.on("click",function(e){this.fire("cancel",{hide:!0}).hide!==!1&&this.hide(),e.data.preventDefault()},this),this.changeFocus=a;var N=this._.element;n.focusManager.add(N,1),this.on("show",function(){N.on("keydown",c,this),CKEDITOR.env.gecko&&N.on("keypress",h,this)}),this.on("hide",function(){N.removeListener("keydown",c),CKEDITOR.env.gecko&&N.removeListener("keypress",h),T(function(e){i.apply(e)})}),this.on("iframeAdded",function(e){(new CKEDITOR.dom.document(e.data.iframe.$.contentWindow.document)).on("keydown",c,this,null,0)}),this.on("show",function(){u();if(n.config.dialog_startupFocusTab&&x._.pageCount>1)x._.tabBarMode=!0,x._.tabs[x._.currentTabId][0].focus();else if(!this._.hasFocus){this._.currentFocusIndex=-1;if(p.onFocus){var e=p.onFocus.call(this);e&&e.focus()}else a(1)}},this,null,4294967295),CKEDITOR.env.ie6Compat&&this.on("load",function(){var e=this.getElement(),t=e.getFirst();t.remove(),t.appendTo(e)},this),f(this),l(this),(new CKEDITOR.dom.text(p.title,CKEDITOR.document)).appendTo(this.parts.title);for(g=0;g<p.contents.length;g++)(y=p.contents[g])&&this.addPage(y);this.parts.tabs.on("click",function(e){var t=e.data.getTarget();t.hasClass("cke_dialog_tab")&&(t=t.$.id,this.selectPage(t.substring(4,t.lastIndexOf("_"))),this._.tabBarMode&&(this._.tabBarMode=!1,this._.currentFocusIndex=-1,a(1)),e.data.preventDefault())},this),g=[],y=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:p.buttons},g).getChild(),this.parts.footer.setHtml(g.join(""));for(g=0;g<y.length;g++)this._.buttons[y[g].id]=y[g]},CKEDITOR.dialog.prototype={destroy:function(){this.hide(),this._.element.remove()},resize:function(){return function(e,t){if(!this._.contentSize||this._.contentSize.width!=e||this._.contentSize.height!=t)CKEDITOR.dialog.fire("resize",{dialog:this,width:e,height:t},this._.editor),this.fire("resize",{width:e,height:t},this._.editor),this.parts.contents.setStyles({width:e+"px",height:t+"px"}),this._.editor.lang.dir=="rtl"&&this._.position&&(this._.position.x=CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)),this._.contentSize={width:e,height:t}}}(),getSize:function(){var e=this._.element.getFirst();return{width:e.$.offsetWidth||0,height:e.$.offsetHeight||0}},move:function(e,t,n){var r=this._.element.getFirst(),i=this._.editor.lang.dir=="rtl",s=r.getComputedStyle("position")=="fixed";CKEDITOR.env.ie&&r.setStyle("zoom","100%");if(!s||!this._.position||this._.position.x!=e||this._.position.y!=t)this._.position={x:e,y:t},s||(s=CKEDITOR.document.getWindow().getScrollPosition(),e+=s.x,t+=s.y),i&&(s=this.getSize(),e=CKEDITOR.document.getWindow().getViewPaneSize().width-s.width-e),t={top:(t>0?t:0)+"px"},t[i?"right":"left"]=(e>0?e:0)+"px",r.setStyles(t),n&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var e=this._.element,t=this.definition;!e.getParent()||!e.getParent().equals(CKEDITOR.document.getBody())?e.appendTo(CKEDITOR.document.getBody()):e.setStyle("display","block"),this.resize(this._.contentSize&&this._.contentSize.width||t.width||t.minWidth,this._.contentSize&&this._.contentSize.height||t.height||t.minHeight),this.reset(),this.selectPage(this.definition.contents[0].id),CKEDITOR.dialog._.currentZIndex===null&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex),this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex=CKEDITOR.dialog._.currentZIndex+10),CKEDITOR.dialog._.currentTop===null?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,h(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this),e.on("keydown",N),e.on("keyup",C),this._.hasFocus=!1;for(var n in t.contents)if(t.contents[n]){var e=t.contents[n],r=this._.tabs[e.id],i=e.requiredContent,s=0;if(r){for(var o in this._.contents[e.id]){var a=this._.contents[e.id][o];a.type!="hbox"&&a.type!="vbox"&&!!a.getInputElement()&&(a.requiredContent&&!this._.editor.activeFilter.check(a.requiredContent)?a.disable():(a.enable(),s++))}!s||i&&!this._.editor.activeFilter.check(i)?r[0].addClass("cke_dialog_tab_disabled"):r[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout(),u(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(e){e.setInitValue&&e.setInitValue()})},100,this)},layout:function(){var e=this.parts.dialog,t=this.getSize(),n=CKEDITOR.document.getWindow().getViewPaneSize(),r=(n.width-t.width)/2,i=(n.height-t.height)/2;CKEDITOR.env.ie6Compat||(t.height+(i>0?i:0)>n.height||t.width+(r>0?r:0)>n.width?e.setStyle("position","absolute"):e.setStyle("position","fixed")),this.move(this._.moved?this._.position.x:r,this._.moved?this._.position.y:i)},foreach:function(e){for(var t in this._.contents)for(var n in this._.contents[t])e.call(this,this._.contents[t][n]);return this},reset:function(){var e=function(e){e.reset&&e.reset(1)};return function(){return this.foreach(e),this}}(),setupContent:function(){var e=arguments;this.foreach(function(t){t.setup&&t.setup.apply(t,e)})},commitContent:function(){var e=arguments;this.foreach(function(t){CKEDITOR.env.ie&&this._.currentFocusIndex==t.focusIndex&&t.getInputElement().$.blur(),t.commit&&t.commit.apply(t,e)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{}),this._.editor.fire("dialogHide",this),this.selectPage(this._.tabIdList[0]);var e=this._.element;e.setStyle("display","none"),this.parts.dialog.setStyle("visibility","hidden");for(L(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var t=this._.parentDialog.getElement().getFirst();t.setStyle("z-index",parseInt(t.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else p(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex=CKEDITOR.dialog._.currentZIndex-10;else{CKEDITOR.dialog._.currentZIndex=null,e.removeListener("keydown",N),e.removeListener("keyup",C);var n=this._.editor;n.focus(),setTimeout(function(){n.focusManager.unlock(),CKEDITOR.env.iOS&&n.window.focus()},0)}delete this._.parentDialog,this.foreach(function(e){e.resetInitValue&&e.resetInitValue()})}},addPage:function(e){if(!e.requiredContent||this._.editor.filter.check(e.requiredContent)){for(var t=[],n=e.label?' title="'+CKEDITOR.tools.htmlEncode(e.label)+'"':"",r=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:e.elements,expand:!!e.expand,padding:e.padding,style:e.style||"width: 100%;"},t),i=this._.contents[e.id]={},s=r.getChild(),o=0;r=s.shift();)!r.notAllowed&&r.type!="hbox"&&r.type!="vbox"&&o++,i[r.id]=r,typeof r.getChild=="function"&&s.push.apply(s,r.getChild());o||(e.hidden=!0),t=CKEDITOR.dom.element.createFromHtml(t.join("")),t.setAttribute("role","tabpanel"),r=CKEDITOR.env,i="cke_"+e.id+"_"+CKEDITOR.tools.getNextNumber(),n=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',this._.pageCount>0?" cke_last":"cke_first",n,e.hidden?' style="display:none"':"",' id="',i,'"',r.gecko&&!r.hc?"":' href="javascript:void(0)"',' tabIndex="-1" hidefocus="true" role="tab">',e.label,"</a>"].join("")),t.setAttribute("aria-labelledby",i),this._.tabs[e.id]=[n,t],this._.tabIdList.push(e.id),!e.hidden&&this._.pageCount++,this._.lastTab=n,this.updateStyle(),t.setAttribute("name",e.id),t.appendTo(this.parts.contents),n.unselectable(),this.parts.tabs.append(n),e.accessKey&&(k(this,this,"CTRL+"+e.accessKey,O,A),this._.accessKeyMap["CTRL+"+e.accessKey]=e.id)}},selectPage:function(e){if(this._.currentTabId!=e&&!this._.tabs[e][0].hasClass("cke_dialog_tab_disabled")&&this.fire("selectPage",{page:e,currentPage:this._.currentTabId})!==!1){for(var t in this._.tabs){var r=this._.tabs[t][0],i=this._.tabs[t][1];t!=e&&(r.removeClass("cke_dialog_tab_selected"),i.hide()),i.setAttribute("aria-hidden",t!=e)}var s=this._.tabs[e];s[0].addClass("cke_dialog_tab_selected"),CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(n(s[1]),s[1].show(),setTimeout(function(){n(s[1],1)},0)):s[1].show(),this._.currentTabId=e,this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,e)}},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(t){var n=this._.tabs[t]&&this._.tabs[t][0];n&&this._.pageCount!=1&&n.isVisible()&&(t==this._.currentTabId&&this.selectPage(e.call(this)),n.hide(),this._.pageCount--,this.updateStyle())},showPage:function(e){if(e=this._.tabs[e]&&this._.tabs[e][0])e.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(e,t){var n=this._.contents[e];return n&&n[t]},getValueOf:function(e,t){return this.getContentElement(e,t).getValue()},setValueOf:function(e,t,n){return this.getContentElement(e,t).setValue(n)},getButton:function(e){return this._.buttons[e]},click:function(e){return this._.buttons[e].click()},disableButton:function(e){return this._.buttons[e].disable()},enableButton:function(e){return this._.buttons[e].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(e,t){if(typeof t=="undefined")t=this._.focusList.length,this._.focusList.push(new o(this,e,t));else{this._.focusList.splice(t,0,new o(this,e,t));for(var n=t+1;n<this._.focusList.length;n++)this._.focusList[n].focusIndex++}}},CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(e,t){if(!this._.dialogDefinitions[e]||typeof t=="function")this._.dialogDefinitions[e]=t},exists:function(e){return!!this._.dialogDefinitions[e]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(e,t,n){return e=e.config.removeDialogTabs,!e||!e.match(RegExp("(?:^|;)"+t+":"+n+"(?:$|;)","i"))},okButton:function(){var e=function(e,t){return t=t||{},CKEDITOR.tools.extend({id:"ok",type:"button",label:e.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(e){e=e.data.dialog,e.fire("ok",{hide:!0}).hide!==!1&&e.hide()}},t,!0)};return e.type="button",e.override=function(t){return CKEDITOR.tools.extend(function(n){return e(n,t)},{type:"button"},!0)},e}(),cancelButton:function(){var e=function(e,t){return t=t||{},CKEDITOR.tools.extend({id:"cancel",type:"button",label:e.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(e){e=e.data.dialog,e.fire("cancel",{hide:!0}).hide!==!1&&e.hide()}},t,!0)};return e.type="button",e.override=function(t){return CKEDITOR.tools.extend(function(n){return e(n,t)},{type:"button"},!0)},e}(),addUIElement:function(e,t){this._.uiElementBuilders[e]=t}}),CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null},CKEDITOR.event.implementOn(CKEDITOR.dialog),CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);var m={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},g=function(e,t,n){for(var r=0,i;i=e[r];r++){if(i.id==t)return i;if(n&&i[n])if(i=g(i[n],t,n))return i}return null},y=function(e,t,n,r,i){if(n){for(var s=0,o;o=e[s];s++){if(o.id==n)return e.splice(s,0,t),t;if(r&&o[r])if(o=y(o[r],t,n,r,!0))return o}if(i)return null}return e.push(t),t},b=function(e,t,n){for(var r=0,i;i=e[r];r++){if(i.id==t)return e.splice(r,1);if(n&&i[n])if(i=b(i[n],t,n))return i}return null},w=function(e,t){this.dialog=e;for(var n=t.contents,r=0,i;i=n[r];r++)n[r]=i&&new a(e,i);CKEDITOR.tools.extend(this,t)};w.prototype={getContents:function(e){return g(this.contents,e)},getButton:function(e){return g(this.buttons,e)},addContents:function(e,t){return y(this.contents,e,t)},addButton:function(e,t){return y(this.buttons,e,t)},removeContents:function(e){b(this.contents,e)},removeButton:function(e){b(this.buttons,e)}},a.prototype={get:function(e){return g(this.elements,e,"children")},add:function(e,t){return y(this.elements,e,t,"children")},remove:function(e){b(this.elements,e,"children")}};var E,S={},x,T={},N=function(e){var t=e.data.$.ctrlKey||e.data.$.metaKey,n=e.data.$.altKey,r=e.data.$.shiftKey,i=String.fromCharCode(e.data.$.keyCode);(t=T[(t?"CTRL+":"")+(n?"ALT+":"")+(r?"SHIFT+":"")+i])&&t.length&&(t=t[t.length-1],t.keydown&&t.keydown.call(t.uiElement,t.dialog,t.key),e.data.preventDefault())},C=function(e){var t=e.data.$.ctrlKey||e.data.$.metaKey,n=e.data.$.altKey,r=e.data.$.shiftKey,i=String.fromCharCode(e.data.$.keyCode);(t=T[(t?"CTRL+":"")+(n?"ALT+":"")+(r?"SHIFT+":"")+i])&&t.length&&(t=t[t.length-1],t.keyup&&(t.keyup.call(t.uiElement,t.dialog,t.key),e.data.preventDefault()))},k=function(e,t,n,r,i){(T[n]||(T[n]=[])).push({uiElement:e,dialog:t,key:n,keyup:i||e.accessKeyUp,keydown:r||e.accessKeyDown})},L=function(e){for(var t in T){for(var n=T[t],r=n.length-1;r>=0;r--)(n[r].dialog==e||n[r].uiElement==e)&&n.splice(r,1);n.length===0&&delete T[t]}},A=function(e,t){e._.accessKeyMap[t]&&e.selectPage(e._.accessKeyMap[t])},O=function(){};(function(){CKEDITOR.ui.dialog={uiElement:function(e,t,n,r,i,s,o){if(!(arguments.length<4)){var u=(r.call?r(t):r)||"div",a=["<",u," "],f=(i&&i.call?i(t):i)||{},l=(s&&s.call?s(t):s)||{},c=(o&&o.call?o.call(this,e,t):o)||"",h=this.domId=l.id||CKEDITOR.tools.getNextId()+"_uiElement";t.requiredContent&&!e.getParentEditor().filter.check(t.requiredContent)&&(f.display="none",this.notAllowed=!0),l.id=h;var p={};t.type&&(p["cke_dialog_ui_"+t.type]=1),t.className&&(p[t.className]=1),t.disabled&&(p.cke_disabled=1);for(var d=l["class"]&&l["class"].split?l["class"].split(" "):[],h=0;h<d.length;h++)d[h]&&(p[d[h]]=1);d=[];for(h in p)d.push(h);l["class"]=d.join(" "),t.title&&(l.title=t.title),p=(t.style||"").split(";"),t.align&&(d=t.align,f["margin-left"]=d=="left"?0:"auto",f["margin-right"]=d=="right"?0:"auto");for(h in f)p.push(h+":"+f[h]);t.hidden&&p.push("display:none");for(h=p.length-1;h>=0;h--)p[h]===""&&p.splice(h,1);p.length>0&&(l.style=(l.style?l.style+"; ":"")+p.join("; "));for(h in l)a.push(h+'="'+CKEDITOR.tools.htmlEncode(l[h])+'" ');a.push(">",c,"</",u,">"),n.push(a.join("")),(this._||(this._={})).dialog=e,typeof t.isChanged=="boolean"&&(this.isChanged=function(){return t.isChanged}),typeof t.isChanged=="function"&&(this.isChanged=t.isChanged),typeof t.setValue=="function"&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(e){return function(n){e.call(this,t.setValue.call(this,n))}})),typeof t.getValue=="function"&&(this.getValue=CKEDITOR.tools.override(this.getValue,function(e){return function(){return t.getValue.call(this,e.call(this))}})),CKEDITOR.event.implementOn(this),this.registerEvents(t),this.accessKeyUp&&this.accessKeyDown&&t.accessKey&&k(this,e,"CTRL+"+t.accessKey);var v=this;e.on("load",function(){var t=v.getInputElement();if(t){var n=v.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?"cke_dialog_ui_focused":"";t.on("focus",function(){e._.tabBarMode=!1,e._.hasFocus=!0,v.fire("focus"),n&&this.addClass(n)}),t.on("blur",function(){v.fire("blur"),n&&this.removeClass(n)})}}),CKEDITOR.tools.extend(this,t),this.keyboardFocusable&&(this.tabIndex=t.tabIndex||0,this.focusIndex=e._.focusList.push(this)-1,this.on("focus",function(){e._.currentFocusIndex=v.focusIndex}))}},hbox:function(e,t,n,r,i){if(!(arguments.length<4)){this._||(this._={});var s=this._.children=t,o=i&&i.widths||null,u=i&&i.height||null,a,f={role:"presentation"};i&&i.align&&(f.align=i.align),CKEDITOR.ui.dialog.uiElement.call(this,e,i||{type:"hbox"},r,"table",{},f,function(){var e=['<tbody><tr class="cke_dialog_ui_hbox">'];for(a=0;a<n.length;a++){var t="cke_dialog_ui_hbox_child",r=[];a===0&&(t="cke_dialog_ui_hbox_first"),a==n.length-1&&(t="cke_dialog_ui_hbox_last"),e.push('<td class="',t,'" role="presentation" '),o?o[a]&&r.push("width:"+d(o[a])):r.push("width:"+Math.floor(100/n.length)+"%"),u&&r.push("height:"+d(u)),i&&i.padding!==void 0&&r.push("padding:"+d(i.padding)),CKEDITOR.env.ie&&CKEDITOR.env.quirks&&s[a].align&&r.push("text-align:"+s[a].align),r.length>0&&e.push('style="'+r.join("; ")+'" '),e.push(">",n[a],"</td>")}return e.push("</tr></tbody>"),e.join("")})}},vbox:function(e,t,n,r,i){if(!(arguments.length<3)){this._||(this._={});var s=this._.children=t,o=i&&i.width||null,u=i&&i.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,e,i||{type:"vbox"},r,"div",null,{role:"presentation"},function(){var t=['<table role="presentation" cellspacing="0" border="0" '];t.push('style="'),i&&i.expand&&t.push("height:100%;"),t.push("width:"+d(o||"100%"),";"),CKEDITOR.env.webkit&&t.push("float:none;"),t.push('"'),t.push('align="',CKEDITOR.tools.htmlEncode(i&&i.align||(e.getParentEditor().lang.dir=="ltr"?"left":"right")),'" '),t.push("><tbody>");for(var r=0;r<n.length;r++){var a=[];t.push('<tr><td role="presentation" '),o&&a.push("width:"+d(o||"100%")),u?a.push("height:"+d(u[r])):i&&i.expand&&a.push("height:"+Math.floor(100/n.length)+"%"),i&&i.padding!==void 0&&a.push("padding:"+d(i.padding)),CKEDITOR.env.ie&&CKEDITOR.env.quirks&&s[r].align&&a.push("text-align:"+s[r].align),a.length>0&&t.push('style="',a.join("; "),'" '),t.push(' class="cke_dialog_ui_vbox_child">',n[r],"</td></tr>")}return t.push("</tbody></table>"),t.join("")})}}}})(),CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(e,t){return this.getInputElement().setValue(e),!t&&this.fire("change",{value:e}),this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var e=this.getInputElement();(e=e.getParent())&&e.$.className.search("cke_dialog_page_contents")==-1;);return e?(e=e.getAttribute("name"),this._.dialog._.currentTabId!=e&&this._.dialog.selectPage(e),this):this},focus:function(){return this.selectParentTab().getInputElement().focus(),this},registerEvents:function(e){var t=/^on([A-Z]\w+)/,n,r=function(e,t,n,r){t.on("load",function(){e.getInputElement().on(n,r,e)})},i;for(i in e)if(n=i.match(t))this.eventProcessors[i]?this.eventProcessors[i].call(this,this._.dialog,e[i]):r(this,this._.dialog,n[1].toLowerCase(),e[i]);return this},eventProcessors:{onLoad:function(e,t){e.on("load",t,this)},onShow:function(e,t){e.on("show",t,this)},onHide:function(e,t){e.on("hide",t,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var e=this.getElement();this.getInputElement().setAttribute("disabled","true"),e.addClass("cke_disabled")},enable:function(){var e=this.getElement();this.getInputElement().removeAttribute("disabled"),e.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return!this.isEnabled()||!this.isVisible()?!1:!0}},CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(e){return arguments.length<1?this._.children.concat():(e.splice||(e=[e]),e.length<2?this._.children[e[0]]:this._.children[e[0]]&&this._.children[e[0]].getChild?this._.children[e[0]].getChild(e.slice(1,e.length)):null)}},!0),CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox,function(){var e={build:function(e,t,n){for(var r=t.children,i,s=[],o=[],u=0;u<r.length&&(i=r[u]);u++){var a=[];s.push(a),o.push(CKEDITOR.dialog._.uiElementBuilders[i.type].build(e,i,a))}return new CKEDITOR.ui.dialog[t.type](e,o,s,n,t)}};CKEDITOR.dialog.addUIElement("hbox",e),CKEDITOR.dialog.addUIElement("vbox",e)}(),CKEDITOR.dialogCommand=function(e,t){this.dialogName=e,CKEDITOR.tools.extend(this,t,!0)},CKEDITOR.dialogCommand.prototype={exec:function(e){e.openDialog(this.dialogName)},canUndo:!1,editorFocus:1},function(){var e=/^([a]|[^a])+$/,t=/^\d*$/,n=/^\d*(?:\.\d+)?$/,r=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,i=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,s=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1,CKEDITOR.VALIDATE_AND=2,CKEDITOR.dialog.validate={functions:function(){var e=arguments;return function(){var t=this&&this.getValue?this.getValue():e[0],n,r=CKEDITOR.VALIDATE_AND,i=[],s;for(s=0;s<e.length;s++){if(typeof e[s]!="function")break;i.push(e[s])}s<e.length&&typeof e[s]=="string"&&(n=e[s],s++),s<e.length&&typeof e[s]=="number"&&(r=e[s]);var o=r==CKEDITOR.VALIDATE_AND?!0:!1;for(s=0;s<i.length;s++)o=r==CKEDITOR.VALIDATE_AND?o&&i[s](t):o||i[s](t);return o?!0:n}},regex:function(e,t){return function(n){return n=this&&this.getValue?this.getValue():n,e.test(n)?!0:t}},notEmpty:function(t){return this.regex(e,t)},integer:function(e){return this.regex(t,e)},number:function(e){return this.regex(n,e)},cssLength:function(e){return this.functions(function(e){return i.test(CKEDITOR.tools.trim(e))},e)},htmlLength:function(e){return this.functions(function(e){return r.test(CKEDITOR.tools.trim(e))},e)},inlineStyle:function(e){return this.functions(function(e){return s.test(CKEDITOR.tools.trim(e))},e)},equals:function(e,t){return this.functions(function(t){return t==e},t)},notEqual:function(e,t){return this.functions(function(t){return t!=e},t)}},CKEDITOR.on("instanceDestroyed",function(e){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var t;t=CKEDITOR.dialog._.currentTop;)t.hide();for(var n in S)S[n].remove();S={}}var e=e.editor._.storedDialogs,r;for(r in e)e[r].destroy()})}(),CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(e,t){var n=null,r=CKEDITOR.dialog._.dialogDefinitions[e];CKEDITOR.dialog._.currentTop===null&&h(this);if(typeof r=="function")n=this._.storedDialogs||(this._.storedDialogs={}),n=n[e]||(n[e]=new CKEDITOR.dialog(this,e)),t&&t.call(n,n),n.show();else{if(r=="failed")throw p(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+e+'" failed when loading definition.');typeof r=="string"&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(r),function(){typeof CKEDITOR.dialog._.dialogDefinitions[e]!="function"&&(CKEDITOR.dialog._.dialogDefinitions[e]="failed"),this.openDialog(e,t)},this,0,1)}return CKEDITOR.skin.loadPart("dialog"),n}})}(),CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(e){e.on("doubleclick",function(t){t.data.dialog&&e.openDialog(t.data.dialog)},null,null,999)}}),function(){CKEDITOR.plugins.add("a11yhelp",{requires:"dialog",availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},init:function(e){var t=this;e.addCommand("a11yHelp",{exec:function(){var n=e.langCode,n=t.availableLangs[n]?n:t.availableLangs[n.replace(/-.*/,"")]?n.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(t.path+"dialogs/lang/"+n+".js"),function(){e.lang.a11yhelp=t.langEntries[n],e.openDialog("a11yHelp")})},modes:{wysiwyg:1,source:1},readOnly:1,canUndo:!1}),e.setKeystroke(CKEDITOR.ALT+48,"a11yHelp"),CKEDITOR.dialog.add("a11yHelp",this.path+"dialogs/a11yhelp.js"),e.on("ariaEditorHelpLabel",function(t){t.data.label=e.lang.common.editorHelp})}})}(),CKEDITOR.plugins.add("about",{requires:"dialog",init:function(e){var t=e.addCommand("about",new CKEDITOR.dialogCommand("about"));t.modes={wysiwyg:1,source:1},t.canUndo=!1,t.readOnly=1,e.ui.addButton&&e.ui.addButton("About",{label:e.lang.about.title,command:"about",toolbar:"about"}),CKEDITOR.dialog.add("about",this.path+"dialogs/about.js")}}),CKEDITOR.plugins.add("basicstyles",{init:function(e){var t=0,n=function(n,i,s,o){if(o){var o=new CKEDITOR.style(o),u=r[s];u.unshift(o),e.attachStyleStateChange(o,function(t){!e.readOnly&&e.getCommand(s).setState(t)}),e.addCommand(s,new CKEDITOR.styleCommand(o,{contentForms:u})),e.ui.addButton&&e.ui.addButton(n,{label:i,command:s,toolbar:"basicstyles,"+(t+=10)})}},r={bold:["strong","b",["span",function(e){return e=e.styles["font-weight"],e=="bold"||+e>=700}]],italic:["em","i",["span",function(e){return e.styles["font-style"]=="italic"}]],underline:["u",["span",function(e){return e.styles["text-decoration"]=="underline"}]],strike:["s","strike",["span",function(e){return e.styles["text-decoration"]=="line-through"}]],subscript:["sub"],superscript:["sup"]},i=e.config,s=e.lang.basicstyles;n("Bold",s.bold,"bold",i.coreStyles_bold),n("Italic",s.italic,"italic",i.coreStyles_italic),n("Underline",s.underline,"underline",i.coreStyles_underline),n("Strike",s.strike,"strike",i.coreStyles_strike),n("Subscript",s.subscript,"subscript",i.coreStyles_subscript),n("Superscript",s.superscript,"superscript",i.coreStyles_superscript),e.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}}),CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"},CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"},CKEDITOR.config.coreStyles_underline={element:"u"},CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"},CKEDITOR.config.coreStyles_subscript={element:"sub"},CKEDITOR.config.coreStyles_superscript={element:"sup"},function(){var e={exec:function(e){var t=e.getCommand("blockquote").state,n=e.getSelection(),r=n&&n.getRanges()[0];if(r){var i=n.createBookmarks();if(CKEDITOR.env.ie){var s=i[0].startNode,o=i[0].endNode,u;if(s&&s.getParent().getName()=="blockquote")for(u=s;u=u.getNext();)if(u.type==CKEDITOR.NODE_ELEMENT&&u.isBlockBoundary()){s.move(u,!0);break}if(o&&o.getParent().getName()=="blockquote")for(u=o;u=u.getPrevious();)if(u.type==CKEDITOR.NODE_ELEMENT&&u.isBlockBoundary()){o.move(u);break}}var a=r.createIterator();a.enlargeBr=e.config.enterMode!=CKEDITOR.ENTER_BR;if(t==CKEDITOR.TRISTATE_OFF){for(s=[];t=a.getNextParagraph();)s.push(t);s.length<1&&(t=e.document.createElement(e.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),o=i.shift(),r.insertNode(t),t.append(new CKEDITOR.dom.text("﻿",e.document)),r.moveToBookmark(o),r.selectNodeContents(t),r.collapse(!0),o=r.createBookmark(),s.push(t),i.unshift(o)),u=s[0].getParent(),r=[];for(o=0;o<s.length;o++)t=s[o],u=u.getCommonAncestor(t.getParent());for(t={table:1,tbody:1,tr:1,ol:1,ul:1};t[u.getName()];)u=u.getParent();for(o=null;s.length>0;){for(t=s.shift();!t.getParent().equals(u);)t=t.getParent();t.equals(o)||r.push(t),o=t}for(;r.length>0;){t=r.shift();if(t.getName()=="blockquote"){for(o=new CKEDITOR.dom.documentFragment(e.document);t.getFirst();)o.append(t.getFirst().remove()),s.push(o.getLast());o.replace(t)}else s.push(t)}r=e.document.createElement("blockquote");for(r.insertBefore(s[0]);s.length>0;)t=s.shift(),r.append(t)}else if(t==CKEDITOR.TRISTATE_ON){o=[];for(u={};t=a.getNextParagraph();){for(s=r=null;t.getParent();){if(t.getParent().getName()=="blockquote"){r=t.getParent(),s=t;break}t=t.getParent()}r&&s&&!s.getCustomData("blockquote_moveout")&&(o.push(s),CKEDITOR.dom.element.setMarker(u,s,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(u),t=[],s=[];for(u={};o.length>0;)a=o.shift(),r=a.getParent(),a.getPrevious()?a.getNext()?(a.breakParent(a.getParent()),s.push(a.getNext())):a.remove().insertAfter(r):a.remove().insertBefore(r),r.getCustomData("blockquote_processed")||(s.push(r),CKEDITOR.dom.element.setMarker(u,r,"blockquote_processed",!0)),t.push(a);CKEDITOR.dom.element.clearAllMarkers(u);for(o=s.length-1;o>=0;o--){r=s[o];e:{u=r;for(var a=0,f=u.getChildCount(),l=void 0;a<f&&(l=u.getChild(a));a++)if(l.type==CKEDITOR.NODE_ELEMENT&&l.isBlockBoundary()){u=!1;break e}u=!0}u&&r.remove()}if(e.config.enterMode==CKEDITOR.ENTER_BR)for(r=!0;t.length;){a=t.shift();if(a.getName()=="div"){o=new CKEDITOR.dom.documentFragment(e.document),r&&a.getPrevious()&&(a.getPrevious().type!=CKEDITOR.NODE_ELEMENT||!a.getPrevious().isBlockBoundary())&&o.append(e.document.createElement("br"));for(r=a.getNext()&&(a.getNext().type!=CKEDITOR.NODE_ELEMENT||!a.getNext().isBlockBoundary());a.getFirst();)a.getFirst().remove().appendTo(o);r&&o.append(e.document.createElement("br")),o.replace(a),r=!1}}}n.selectBookmarks(i),e.focus()}},refresh:function(e,t){this.setState(e.elementPath(t.block||t.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(t){t.blockless||(t.addCommand("blockquote",e),t.ui.addButton&&t.ui.addButton("Blockquote",{label:t.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})}(),"use strict",function(){function e(e){function t(){var t=e.editable();t.on(y,function(e){(!CKEDITOR.env.ie||!v)&&h(e)}),CKEDITOR.env.ie&&t.on("paste",function(t){m||(i(),t.data.preventDefault(),h(t),o("paste")||e.openDialog("paste"))}),CKEDITOR.env.ie&&(t.on("contextmenu",s,null,null,0),t.on("beforepaste",function(e){e.data&&!e.data.$.ctrlKey&&!e.data.$.shiftKey&&s()},null,null,0)),t.on("beforecut",function(){!v&&a(e)});var n;t.attachListener(CKEDITOR.env.ie?t:e.document.getDocumentElement(),"mouseup",function(){n=setTimeout(function(){p()},0)}),e.on("destroy",function(){clearTimeout(n)}),t.on("keyup",p)}function n(t){return{type:t,canUndo:t=="cut",startDisabled:!0,exec:function(){this.type=="cut"&&a();var t,n=this.type;if(CKEDITOR.env.ie)t=o(n);else try{t=e.document.$.execCommand(n,!1,null)}catch(r){t=!1}return t||alert(e.lang.clipboard[this.type+"Error"]),t}}}function r(){return{canUndo:!1,async:!0,exec:function(e,t){var n=function(t,n){t&&u(t.type,t.dataValue,!!n),e.fire("afterCommandExec",{name:"paste",command:r,returnValue:!!t})},r=this;typeof t=="string"?n({type:"auto",dataValue:t},1):e.getClipboardData(n)}}}function i(){m=1,setTimeout(function(){m=0},100)}function s(){v=1,setTimeout(function(){v=0},10)}function o(t){var n=e.document,r=n.getBody(),i=!1,s=function(){i=!0};return r.on(t,s),(CKEDITOR.env.version>7?n.$:n.$.selection.createRange()).execCommand(t),r.removeListener(t,s),i}function u(t,n,r){return t={type:t},r&&e.fire("beforePaste",t)===!1||!n?!1:(t.dataValue=n,e.fire("paste",t))}function a(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var t=e.getSelection(),n,r,i;t.getType()==CKEDITOR.SELECTION_ELEMENT&&(n=t.getSelectedElement())&&(r=t.getRanges()[0],i=e.document.createText(""),i.insertBefore(n),r.setStartBefore(i),r.setEndAfter(n),t.selectRanges([r]),setTimeout(function(){n.getParent()&&(i.remove(),t.selectElement(n))},0))}}function f(t,n){var r=e.document,i=e.editable(),s=function(e){e.cancel()},o;if(!r.getById("cke_pastebin")){var u=e.getSelection(),a=u.createBookmarks();CKEDITOR.env.ie&&u.root.fire("selectionchange");var f=new CKEDITOR.dom.element((CKEDITOR.env.webkit||i.is("body"))&&!CKEDITOR.env.ie?"body":"div",r);f.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var l=0,r=r.getWindow();CKEDITOR.env.webkit?(i.append(f),f.addClass("cke_editable"),i.is("body")||(l=i.getComputedStyle("position")!="static"?i:CKEDITOR.dom.element.get(i.$.offsetParent),l=l.getDocumentPosition().y)):i.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(f),f.setStyles({position:"absolute",top:r.getScrollPosition().y-l+10+"px",width:"1px",height:Math.max(1,r.getViewPaneSize().height-20)+"px",overflow:"hidden",margin:0,padding:0}),CKEDITOR.env.safari&&f.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text")),(l=f.getParent().isReadOnly())?(f.setOpacity(0),f.setAttribute("contenteditable",!0)):f.setStyle(e.config.contentsLangDirection=="ltr"?"left":"right","-1000px"),e.on("selectionChange",s,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)o=i.once("blur",s,null,null,-100);l&&f.focus(),l=new CKEDITOR.dom.range(f),l.selectNodeContents(f);var c=l.select();CKEDITOR.env.ie&&(o=i.once("blur",function(){e.lockSelection(c)}));var h=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=h),o&&o.removeListener(),CKEDITOR.env.ie&&i.focus(),u.selectBookmarks(a),f.remove();var t;CKEDITOR.env.webkit&&(t=f.getFirst())&&t.is&&t.hasClass("Apple-style-span")&&(f=t),e.removeListener("selectionChange",s),n(f.getHtml())},0)}}function l(){if(CKEDITOR.env.ie){e.focus(),i();var t=e.focusManager;t.lock();if(e.editable().fire(y)&&!o("paste"))return t.unlock(),!1;t.unlock()}else try{if(e.editable().fire(y)&&!e.document.$.execCommand("Paste",!1,null))throw 0}catch(n){return!1}return!0}function c(t){if(e.mode=="wysiwyg")switch(t.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:t=e.editable(),i(),!CKEDITOR.env.ie&&t.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:e.fire("saveSnapshot"),setTimeout(function(){e.fire("saveSnapshot")},50)}}function h(t){var n={type:"auto"},r=e.fire("beforePaste",n);f(t,function(e){e=e.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,""),r&&u(n.type,e,0,1)})}function p(){if(e.mode=="wysiwyg"){var t=d("paste");e.getCommand("cut").setState(d("cut")),e.getCommand("copy").setState(d("copy")),e.getCommand("paste").setState(t),e.fire("pasteState",t)}}function d(t){if(g&&t in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if(t=="paste")return CKEDITOR.TRISTATE_OFF;var t=e.getSelection(),n=t.getRanges();return t.getType()==CKEDITOR.SELECTION_NONE||n.length==1&&n[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var v=0,m=0,g=0,y=CKEDITOR.env.ie?"beforepaste":"paste";(function(){e.on("key",c),e.on("contentDom",t),e.on("selectionChange",function(e){g=e.data.selection.getRanges()[0].checkReadOnly(),p()}),e.contextMenu&&e.contextMenu.addListener(function(e,t){return g=t.getRanges()[0].checkReadOnly(),{cut:d("cut"),copy:d("copy"),paste:d("paste")}})})(),function(){function t(t,n,r,i,s){var o=e.lang.clipboard[n];e.addCommand(n,r),e.ui.addButton&&e.ui.addButton(t,{label:o,command:n,toolbar:"clipboard,"+i}),e.addMenuItems&&e.addMenuItem(n,{label:o,command:n,group:"clipboard",order:s})}t("Cut","cut",n("cut"),10,1),t("Copy","copy",n("copy"),20,4),t("Paste","paste",r(),30,8)}(),e.getClipboardData=function(t,n){function r(e){e.removeListener(),e.cancel(),n(e.data)}function i(e){e.removeListener(),e.cancel(),a=!0,n({type:u,dataValue:e.data})}function s(){this.customTitle=t&&t.title}var o=!1,u="auto",a=!1;n||(n=t,t=null),e.on("paste",r,null,null,0),e.on("beforePaste",function(e){e.removeListener(),o=!0,u=e.data.type},null,null,1e3),l()===!1&&(e.removeListener("paste",r),o&&e.fire("pasteDialog",s)?(e.on("pasteDialogCommit",i),e.on("dialogHide",function(e){e.removeListener(),e.data.removeListener("pasteDialogCommit",i),setTimeout(function(){a||n(null)},10)})):n(null))}}function t(e){if(CKEDITOR.env.webkit){if(!e.match(/^[^<]*$/g)&&!e.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!e.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!e.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else{if(!CKEDITOR.env.gecko)return"html";if(!e.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}return"htmlifiedtext"}function n(e,t){function n(e){return CKEDITOR.tools.repeat("</p><p>",~~(e/2))+(e%2==1?"<br>":"")}return t=t.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>"),t=t.replace(/<\/?[A-Z]+>/g,function(e){return e.toLowerCase()}),t.match(/^[^<]$/)?t:(CKEDITOR.env.webkit&&t.indexOf("<div>")>-1&&(t=t.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>"),t.match(/<div>(<br>|)<\/div>/)&&(t="<p>"+t.replace(/(<div>(<br>|)<\/div>)+/g,function(e){return n(e.split("</div><div>").length+1)})+"</p>"),t=t.replace(/<\/div><div>/g,"<br>"),t=t.replace(/<\/?div>/g,"")),CKEDITOR.env.gecko&&e.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(t=t.replace(/^<br><br>$/,"<br>")),t.indexOf("<br><br>")>-1&&(t="<p>"+t.replace(/(<br>){2,}/g,function(e){return n(e.length/4)})+"</p>")),s(e,t))}function r(){var e=new CKEDITOR.htmlParser.filter,t={blockquote:1,dl:1,fieldset:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ol:1,p:1,table:1,ul:1},n=CKEDITOR.tools.extend({br:0},CKEDITOR.dtd.$inline),r={p:1,br:1,"cke:br":1},i=CKEDITOR.dtd,s=CKEDITOR.tools.extend({area:1,basefont:1,embed:1,iframe:1,map:1,object:1,param:1},CKEDITOR.dtd.$nonBodyContent,CKEDITOR.dtd.$cdata),o=function(e){delete e.name,e.add(new CKEDITOR.htmlParser.text(" "))},u=function(e){for(var t=e,n;(t=t.next)&&t.name&&t.name.match(/^h\d$/);){n=new CKEDITOR.htmlParser.element("cke:br"),n.isEmpty=!0;for(e.add(n);n=t.children.shift();)e.add(n)}};return e.addRules({elements:{h1:u,h2:u,h3:u,h4:u,h5:u,h6:u,img:function(e){var e=CKEDITOR.tools.trim(e.attributes.alt||""),t=" ";return e&&!e.match(/(^http|\.(jpe?g|gif|png))/i)&&(t=" ["+e+"] "),new CKEDITOR.htmlParser.text(t)},td:o,th:o,$:function(e){var o=e.name,u;if(s[o])return!1;e.attributes={};if(o=="br")return e;if(t[o])e.name="p";else if(n[o])delete e.name;else if(i[o]){u=new CKEDITOR.htmlParser.element("cke:br"),u.isEmpty=!0;if(CKEDITOR.dtd.$empty[o])return u;e.add(u,0),u=u.clone(),u.isEmpty=!0,e.add(u),delete e.name}return r[e.name]||delete e.name,e}}},{applyToAll:!0}),e}function i(e,t,n){var t=new CKEDITOR.htmlParser.fragment.fromHtml(t),r=new CKEDITOR.htmlParser.basicWriter;t.writeHtml(r,n);var t=r.getHtml(),t=t.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g,"$1").replace(/(<cke:br \/>){2,}/g,"<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g,"$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g,"$1").replace(/<(cke:)?br( \/)?>/g,"<br>").replace(/<p><\/p>/g,""),i=0,t=t.replace(/<\/?p>/g,function(e){if(e=="<p>"){if(++i>1)return"</p><p>"}else if(--i>0)return"</p><p>";return e}).replace(/<p><\/p>/g,"");return s(e,t)}function s(e,t){return e.enterMode==CKEDITOR.ENTER_BR?t=t.replace(/(<\/p><p>)+/g,function(e){return CKEDITOR.tools.repeat("<br>",e.length/7*2)}).replace(/<\/?p>/g,""):e.enterMode==CKEDITOR.ENTER_DIV&&(t=t.replace(/<(\/)?p>/g,"<$1div>")),t}CKEDITOR.plugins.add("clipboard",{requires:"dialog",init:function(s){var o;e(s),CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js")),s.on("paste",function(e){var t=e.data.dataValue,n=CKEDITOR.dtd.$block;t.indexOf("Apple-")>-1&&(t=t.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi," "),e.data.type!="html"&&(t=t.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(e,t){return t.replace(/\t/g,"&nbsp;&nbsp; &nbsp;")})),t.indexOf('<br class="Apple-interchange-newline">')>-1&&(e.data.startsWithEOL=1,e.data.preSniffing="html",t=t.replace(/<br class="Apple-interchange-newline">/,"")),t=t.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(t.match(/^<[^<]+cke_(editable|contents)/i)){var r,i,s=new CKEDITOR.dom.element("div");for(s.setHtml(t);s.getChildCount()==1&&(r=s.getFirst())&&r.type==CKEDITOR.NODE_ELEMENT&&(r.hasClass("cke_editable")||r.hasClass("cke_contents"));)s=i=r;i&&(t=i.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?t=t.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(t,r){return r.toLowerCase()in n?(e.data.preSniffing="html","<"+r):t}):CKEDITOR.env.webkit?t=t.replace(/<\/(\w+)><div><br><\/div>$/,function(t,r){return r in n?(e.data.endsWithEOL=1,"</"+r+">"):t}):CKEDITOR.env.gecko&&(t=t.replace(/(\s)<br>$/,"$1")),e.data.dataValue=t},null,null,3),s.on("paste",function(e){var e=e.data,u=e.type,a=e.dataValue,l,h=s.config.clipboard_defaultContentType||"html";l=u=="html"||e.preSniffing=="html"?"html":t(a),l=="htmlifiedtext"?a=n(s.config,a):u=="text"&&l=="html"&&(a=i(s.config,a,o||(o=r(s)))),e.startsWithEOL&&(a='<br data-cke-eol="1">'+a),e.endsWithEOL&&(a+='<br data-cke-eol="1">'),u=="auto"&&(u=l=="html"||h=="html"?"html":"text"),e.type=u,e.dataValue=a,delete e.preSniffing,delete e.startsWithEOL,delete e.endsWithEOL},null,null,6),s.on("paste",function(e){e=e.data,s.insertHtml(e.dataValue,e.type),setTimeout(function(){s.fire("afterPaste")},0)},null,null,1e3),s.on("pasteDialog",function(e){setTimeout(function(){s.openDialog("paste",e.data)},0)})}})}(),function(){CKEDITOR.plugins.add("panel",{beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}}),CKEDITOR.UI_PANEL="panel",CKEDITOR.ui.panel=function(e,t){t&&CKEDITOR.tools.extend(this,t),CKEDITOR.tools.extend(this,{className:"",css:[]}),this.id=CKEDITOR.tools.getNextId(),this.document=e,this.isFramed=this.forceIFrame||this.css.length,this._={blocks:{}}},CKEDITOR.ui.panel.handler={create:function(e){return new CKEDITOR.ui.panel(e)}};var e=CKEDITOR.addTemplate("panel",'<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),t=CKEDITOR.addTemplate("panel-frame",'<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),n=CKEDITOR.addTemplate("panel-frame-inner",'<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');CKEDITOR.ui.panel.prototype={render:function(r,i){this.getHolderElement=function(){var e=this._.holder;if(!e){if(this.isFramed){var e=this.document.getById(this.id+"_frame"),t=e.getParent(),e=e.getFrameDocument();CKEDITOR.env.iOS&&t.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"}),t=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0,this.onLoad&&this.onLoad()},this)),e.write(n.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+t+");"},s))),e.getWindow().$.CKEDITOR=CKEDITOR,e.on("keydown",function(e){var t=e.data.getKeystroke(),n=this.document.getById(this.id).getAttribute("dir");this._.onKeyDown&&this._.onKeyDown(t)===!1?e.data.preventDefault():(t==27||t==(n=="rtl"?39:37))&&this.onEscape&&this.onEscape(t)===!1&&e.data.preventDefault()},this),e=e.getBody(),e.unselectable(),CKEDITOR.env.air&&CKEDITOR.tools.callFunction(t)}else e=this.document.getById(this.id);this._.holder=e}return e};var s={editorId:r.id,id:this.id,langCode:r.langCode,dir:r.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":r.config.baseFloatZIndex+1};if(this.isFramed){var o=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";s.frame=t.output({id:this.id+"_frame",src:o})}return o=e.output(s),i&&i.push(o),o},addBlock:function(e,t){return t=this._.blocks[e]=t instanceof CKEDITOR.ui.panel.block?t:new CKEDITOR.ui.panel.block(this.getHolderElement(),t),this._.currentBlock||this.showBlock(e),t},getBlock:function(e){return this._.blocks[e]},showBlock:function(e){var e=this._.blocks[e],t=this._.currentBlock,n=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");return t&&t.hide(),this._.currentBlock=e,CKEDITOR.fire("ariaWidget",n),e._.focusIndex=-1,this._.onKeyDown=e.onKeyDown&&CKEDITOR.tools.bind(e.onKeyDown,e),e.show(),e},destroy:function(){this.element&&this.element.remove()}},CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(e,t){this.element=e.append(e.getDocument().createElement("div",{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}})),t&&CKEDITOR.tools.extend(this,t),this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]}),this.keys={},this._.focusIndex=-1,this.element.disableContextMenu()},_:{markItem:function(e){e!=-1&&(e=this.element.getElementsByTag("a").getItem(this._.focusIndex=e),CKEDITOR.env.webkit&&e.getDocument().getWindow().focus(),e.focus(),this.onMark&&this.onMark(e))}},proto:{show:function(){this.element.setStyle("display","")},hide:function(){(!this.onHide||this.onHide.call(this)!==!0)&&this.element.setStyle("display","none")},onKeyDown:function(e,t){var n=this.keys[e];switch(n){case"next":for(var r=this._.focusIndex,n=this.element.getElementsByTag("a"),i;i=n.getItem(++r);)if(i.getAttribute("_cke_focus")&&i.$.offsetWidth){this._.focusIndex=r,i.focus();break}if(!i&&!t)return this._.focusIndex=-1,this.onKeyDown(e,1);return!1;case"prev":r=this._.focusIndex;for(n=this.element.getElementsByTag("a");r>0&&(i=n.getItem(--r));){if(i.getAttribute("_cke_focus")&&i.$.offsetWidth){this._.focusIndex=r,i.focus();break}i=null}if(!i&&!t)return this._.focusIndex=n.count(),this.onKeyDown(e,1);return!1;case"click":case"mouseup":return r=this._.focusIndex,(i=r>=0&&this.element.getElementsByTag("a").getItem(r))&&(i.$[n]?i.$[n]():i.$["on"+n]()),!1}return!0}}})}(),CKEDITOR.plugins.add("floatpanel",{requires:"panel"}),function(){function e(e,n,r,i,s){var s=CKEDITOR.tools.genKey(n.getUniqueId(),r.getUniqueId(),e.lang.dir,e.uiColor||"",i.css||"",s||""),o=t[s];return o||(o=t[s]=new CKEDITOR.ui.panel(n,i),o.element=r.append(CKEDITOR.dom.element.createFromHtml(o.render(e),n)),o.element.setStyles({display:"none",position:"absolute"})),o}var t={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(t,n,r,i){function s(){l.hide()}r.forceIFrame=1,r.toolbarRelated&&t.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(n=CKEDITOR.document.getById("cke_"+t.name));var o=n.getDocument(),i=e(t,o,n,r,i||0),u=i.element,f=u.getFirst(),l=this;u.disableContextMenu(),this.element=u,this._={editor:t,panel:i,parentElement:n,definition:r,document:o,iframe:f,children:[],dir:t.lang.dir},t.on("mode",s),t.on("resize",s),CKEDITOR.env.iOS||o.getWindow().on("resize",s)},proto:{addBlock:function(e,t){return this._.panel.addBlock(e,t)},addListBlock:function(e,t){return this._.panel.addListBlock(e,t)},getBlock:function(e){return this._.panel.getBlock(e)},showBlock:function(e,t,n,r,i,s){var o=this._.panel,u=o.showBlock(e);this.allowBlur(!1),e=this._.editor.editable(),this._.returnFocus=e.hasFocus?e:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement),this._.hideTimeout=0;var a=this.element,e=this._.iframe,e=CKEDITOR.env.ie?e:new CKEDITOR.dom.window(e.$.contentWindow),f=a.getDocument(),l=this._.parentElement.getPositionedAncestor(),c=t.getDocumentPosition(f),f=l?l.getDocumentPosition(f):{x:0,y:0},h=this._.dir=="rtl",p=c.x+(r||0)-f.x,d=c.y+(i||0)-f.y;!h||n!=1&&n!=4?!h&&(n==2||n==3)&&(p+=t.$.offsetWidth-1):p+=t.$.offsetWidth;if(n==3||n==4)d+=t.$.offsetHeight-1;this._.panel._.offsetParentId=t.getId(),a.setStyles({top:d+"px",left:0,display:""}),a.setOpacity(0),a.getFirst().removeStyle("width"),this._.editor.focusManager.add(e),this._.blurSet||(CKEDITOR.event.useCapture=!0,e.on("blur",function(e){function t(){delete this._.returnFocus,this.hide()}this.allowBlur()&&e.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(t,0,this)):t.call(this))},this),e.on("focus",function(){this._.focused=!0,this.hideChild(),this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(e.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),e.on("touchend",function(){this._.hideTimeout=0,this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1),o.onEscape=CKEDITOR.tools.bind(function(e){if(this.onEscape&&this.onEscape(e)===!1)return!1},this),CKEDITOR.tools.setTimeout(function(){var e=CKEDITOR.tools.bind(function(){a.removeStyle("width");if(u.autoSize){var e=u.element.getDocument(),e=(CKEDITOR.env.webkit?u.element:e.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&e>0&&(e+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3),a.setStyle("width",e+10+"px"),e=u.element.$.scrollHeight,CKEDITOR.env.ie&&CKEDITOR.env.quirks&&e>0&&(e+=(a.$.offsetHeight||0)-(a.$.clientHeight||0)+3),a.setStyle("height",e+"px"),o._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");h&&(p-=a.$.offsetWidth),a.setStyle("left",p+"px");var t=o.element.getWindow(),e=a.$.getBoundingClientRect(),t=t.getViewPaneSize(),n=e.width||e.right-e.left,r=e.height||e.bottom-e.top,i=h?e.right:t.width-e.left,f=h?t.width-e.right:e.left;h?i<n&&(p=f>n?p+n:t.width>n?p-e.left:p-e.right+t.width):i<n&&(p=f>n?p-n:t.width>n?p-e.right+t.width:p-e.left),n=e.top,t.height-e.top<r&&(d=n>r?d-r:t.height>r?d-e.bottom+t.height:d-e.top),CKEDITOR.env.ie&&(t=e=new CKEDITOR.dom.element(a.$.offsetParent),t.getName()=="html"&&(t=t.getDocument().getBody()),t.getComputedStyle("direction")=="rtl"&&(p=CKEDITOR.env.ie8Compat?p-a.getDocument().getDocumentElement().$.scrollLeft*2:p-(e.$.scrollWidth-e.$.clientWidth)));var e=a.getFirst(),l;(l=e.getCustomData("activePanel"))&&l.onHide&&l.onHide.call(this,1),e.setCustomData("activePanel",this),a.setStyles({top:d+"px",left:p+"px"}),a.setOpacity(1),s&&s()},this);o.isLoaded?e():o.onLoad=e,CKEDITOR.tools.setTimeout(function(){var e=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus(),u.element.focus(),CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=e),this.allowBlur(!0),this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this),this.visible=1,this.onShow&&this.onShow.call(this)},focus:function(){if(CKEDITOR.env.webkit){var e=CKEDITOR.document.getActive();e&&!e.equals(this._.iframe)&&e.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var e=this._.iframe.getFrameDocument().getActive();e&&e.is("a")&&(this._.lastFocused=e)},hide:function(e){if(this.visible&&(!this.onHide||this.onHide.call(this)!==!0)){this.hideChild(),CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur(),this.element.setStyle("display","none"),this.visible=0,this.element.getFirst().removeCustomData("activePanel");if(e=e&&this._.returnFocus)CKEDITOR.env.webkit&&e.type&&e.getWindow().$.focus(),e.focus();delete this._.lastFocused,this._.editor.fire("panelHide",this)}},allowBlur:function(e){var t=this._.panel;return e!==void 0&&(t.allowBlur=e),t.allowBlur},showAsChild:function(e,t,n,r,i,s){if(this._.activeChild!=e||e._.panel._.offsetParentId!=n.getId())this.hideChild(),e.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=e,this._.focused=!1,e.showBlock(t,n,r,i,s),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){e.element.getChild(0).$.style.cssText+=""},100)},hideChild:function(e){var t=this._.activeChild;t&&(delete t.onHide,delete this._.activeChild,t.hide(),e&&this.focus())}}}),CKEDITOR.on("instanceDestroyed",function(){var e=CKEDITOR.tools.isEmpty(CKEDITOR.instances),n;for(n in t){var r=t[n];e?r.destroy():r.element.hide()}e&&(t={})})}(),CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(e){for(var t=e.config.menu_groups.split(","),n=e._.menuGroups={},r=e._.menuItems={},i=0;i<t.length;i++)n[t[i]]=i+1;e.addMenuGroup=function(e,t){n[e]=t||100},e.addMenuItem=function(e,t){n[t.group]&&(r[e]=new CKEDITOR.menuItem(this,e,t))},e.addMenuItems=function(e){for(var t in e)this.addMenuItem(t,e[t])},e.getMenuItem=function(e){return r[e]},e.removeMenuItem=function(e){delete r[e]}}}),function(){function e(e){e.sort(function(e,t){return e.group<t.group?-1:e.group>t.group?1:e.order<t.order?-1:e.order>t.order?1:0})}var t='<span class="cke_menuitem"><a id="{id}" class="cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href="{href}" title="{title}" tabindex="-1"_cke_focus=1 hidefocus="true" role="{role}" aria-haspopup="{hasPopup}" aria-disabled="{disabled}" {ariaChecked}';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(t+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(t+=' onblur="this.style.cssText = this.style.cssText;"');var t=t+(' onmouseover="CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout="CKEDITOR.tools.callFunction({moveOutFn},{index});" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},{index}); return false;">'),n=CKEDITOR.addTemplate("menuItem",t+'<span class="cke_menubutton_inner"><span class="cke_menubutton_icon"><span class="cke_button_icon cke_button__{iconName}_icon" style="{iconStyle}"></span></span><span class="cke_menubutton_label">{label}</span>{arrowHtml}</span></a></span>'),r=CKEDITOR.addTemplate("menuArrow",'<span class="cke_menuarrow"><span>{label}</span></span>');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(e,t){t=this._.definition=t||{},this.id=CKEDITOR.tools.getNextId(),this.editor=e,this.items=[],this._.listeners=[],this._.level=t.level||1;var n=CKEDITOR.tools.extend({},t.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),r=n.block.attributes=n.attributes||{};!r.role&&(r.role="menu"),this._.panelDefinition=n},_:{onShow:function(){var e=this.editor.getSelection(),t=e&&e.getStartElement(),n=this.editor.elementPath(),r=this._.listeners;this.removeAll();for(var i=0;i<r.length;i++){var s=r[i](t,e,n);if(s)for(var o in s){var u=this.editor.getMenuItem(o);u&&(!u.command||this.editor.getCommand(u.command).state)&&(u.state=s[o],this.add(u))}}},onClick:function(e){this.hide(),e.onClick?e.onClick():e.command&&this.editor.execCommand(e.command)},onEscape:function(e){var t=this.parent;return t?t._.panel.hideChild(1):e==27&&this.hide(1),!1},onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(e){var t=this._.subMenu,n=this.items[e];if(n=n.getItems&&n.getItems()){t?t.removeAll():(t=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},!0)),t.parent=this,t._.onClick=CKEDITOR.tools.bind(this._.onClick,this));for(var r in n){var i=this.editor.getMenuItem(r);i&&(i.state=n[r],t.add(i))}var s=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+(""+e));setTimeout(function(){t.show(s,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(e){e.order||(e.order=this.items.length),this.items.push(e)},removeAll:function(){this.items=[]},show:function(t,n,r,i){if(!this.parent){this._.onShow();if(!this.items.length)return}var n=n||(this.editor.lang.dir=="rtl"?2:1),s=this.items,o=this.editor,u=this._.panel,f=this._.element;if(!u){u=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level),u.onEscape=CKEDITOR.tools.bind(function(e){if(this._.onEscape(e)===!1)return!1},this),u.onShow=function(){u._.panel.getHolderElement().getParent().addClass("cke cke_reset_all")},u.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this),f=u.addBlock(this.id,this._.panelDefinition.block),f.autoSize=!0;var l=f.keys;l[40]="next",l[9]="next",l[38]="prev",l[CKEDITOR.SHIFT+9]="prev",l[o.lang.dir=="rtl"?37:39]=CKEDITOR.env.ie?"mouseup":"click",l[32]=CKEDITOR.env.ie?"mouseup":"click",CKEDITOR.env.ie&&(l[13]="mouseup"),f=this._.element=f.element,l=f.getDocument(),l.getBody().setStyle("overflow","hidden"),l.getElementsByTag("html").getItem(0).setStyle("overflow","hidden"),this._.itemOverFn=CKEDITOR.tools.addFunction(function(e){clearTimeout(this._.showSubTimeout),this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,o.config.menu_subMenuDelay||400,this,[e])},this),this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this),this._.itemClickFn=CKEDITOR.tools.addFunction(function(e){var t=this.items[e];t.state==CKEDITOR.TRISTATE_DISABLED?this.hide(1):t.getItems?this._.showSubMenu(e):this._.onClick(t)},this)}e(s);for(var l=o.elementPath(),l=['<div class="cke_menu'+(l&&l.direction()!=o.lang.dir?" cke_mixed_dir_content":"")+'" role="presentation">'],c=s.length,h=c&&s[0].group,p=0;p<c;p++){var d=s[p];h!=d.group&&(l.push('<div class="cke_menuseparator" role="separator"></div>'),h=d.group),d.render(this,p,l)}l.push("</div>"),f.setHtml(l.join("")),CKEDITOR.ui.fire("ready",this),this.parent?this.parent._.panel.showAsChild(u,this.id,t,n,r,i):u.showBlock(this.id,t,n,r,i),o.fire("menuShow",[u])},addListener:function(e){this._.listeners.push(e)},hide:function(e){this._.onHide&&this._.onHide(),this._.panel&&this._.panel.hide(e)}}}),CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(e,t,n){CKEDITOR.tools.extend(this,n,{order:0,className:"cke_menubutton__"+t}),this.group=e._.menuGroups[this.group],this.editor=e,this.name=t},proto:{render:function(e,t,i){var s=e.id+(""+t),o=typeof this.state=="undefined"?CKEDITOR.TRISTATE_OFF:this.state,u="",a=o==CKEDITOR.TRISTATE_ON?"on":o==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(u=' aria-checked="'+(o==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var f=this.getItems,l="&#"+(this.editor.lang.dir=="rtl"?"9668":"9658")+";",c=this.name;this.icon&&!/\./.test(this.icon)&&(c=this.icon),e={id:s,name:this.name,iconName:c,label:this.label,cls:this.className||"",state:a,hasPopup:f?"true":"false",disabled:o==CKEDITOR.TRISTATE_DISABLED,title:this.label,href:"javascript:void('"+(this.label||"").replace("'")+"')",hoverFn:e._.itemOverFn,moveOutFn:e._.itemOutFn,clickFn:e._.itemClickFn,index:t,iconStyle:CKEDITOR.skin.getIconStyle(c,this.editor.lang.dir=="rtl",c==this.icon?null:this.icon,this.iconOffset),arrowHtml:f?r.output({label:l}):"",role:this.role?this.role:"menuitem",ariaChecked:u},n.output(e,i)}}})}(),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,$:function(e){this.base.call(this,e,{panel:{className:"cke_menu_panel",attributes:{"aria-label":e.lang.contextmenu.options}}})},proto:{addTarget:function(e,t){e.on("contextmenu",function(e){var e=e.data,r=CKEDITOR.env.webkit?n:CKEDITOR.env.mac?e.$.metaKey:e.$.ctrlKey;if(!t||!r){e.preventDefault();if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var r=this.editor,i=(new CKEDITOR.dom.elementPath(e.getTarget(),r.editable())).contains(function(e){return e.hasAttribute("contenteditable")},!0);i&&i.getAttribute("contenteditable")=="false"&&r.getSelection().fake(i)}var i=e.getTarget().getDocument(),s=e.getTarget().getDocument().getDocumentElement(),r=!i.equals(CKEDITOR.document),i=i.getWindow().getScrollPosition(),o=r?e.$.clientX:e.$.pageX||i.x+e.$.clientX,u=r?e.$.clientY:e.$.pageY||i.y+e.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(s,null,o,u)},CKEDITOR.env.ie?200:0,this)}},this);if(CKEDITOR.env.webkit){var n,r=function(){n=0};e.on("keydown",function(e){n=CKEDITOR.env.mac?e.data.$.metaKey:e.data.$.ctrlKey}),e.on("keyup",r),e.on("contextmenu",r)}},open:function(e,t,n,r){this.editor.focus(),e=e||CKEDITOR.document.getDocumentElement(),this.editor.selectionChange(1),this.show(e,t,n,r)}}})},beforeInit:function(e){var t=e.contextMenu=new CKEDITOR.plugins.contextMenu(e);e.on("contentDom",function(){t.addTarget(e.editable(),e.config.browserContextMenuOnCtrl!==!1)}),e.addCommand("contextMenu",{exec:function(){e.contextMenu.open(e.document.getBody())}}),e.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu"),e.setKeystroke(CKEDITOR.CTRL+CKEDITOR.SHIFT+121,"contextMenu")}}),function(){function t(t,r){function s(e){e=l.list[e];if(e.equals(t.editable())||e.getAttribute("contenteditable")=="true"){var n=t.createRange();n.selectNodeContents(e),n.select()}else t.getSelection().selectElement(e);t.focus()}function o(){f&&f.setHtml(n),delete l.list}var u=t.ui.spaceId("path"),f,l=t._.elementsPath,h=l.idBase;r.html=r.html+('<span id="'+u+'_label" class="cke_voice_label">'+t.lang.elementspath.eleLabel+'</span><span id="'+u+'" class="cke_path" role="group" aria-labelledby="'+u+'_label">'+n+"</span>"),t.on("uiReady",function(){var e=t.ui.space("path");e&&t.focusManager.add(e,1)}),l.onClick=s;var p=CKEDITOR.tools.addFunction(s),d=CKEDITOR.tools.addFunction(function(e,n){var r=l.idBase,i,n=new CKEDITOR.dom.event(n);i=t.lang.dir=="rtl";switch(n.getKeystroke()){case i?39:37:case 9:return(i=CKEDITOR.document.getById(r+(e+1)))||(i=CKEDITOR.document.getById(r+"0")),i.focus(),!1;case i?37:39:case CKEDITOR.SHIFT+9:return(i=CKEDITOR.document.getById(r+(e-1)))||(i=CKEDITOR.document.getById(r+(l.list.length-1))),i.focus(),!1;case 27:return t.focus(),!1;case 13:case 32:return s(e),!1}return!0});t.on("selectionChange",function(){for(var e=[],r=l.list=[],s=[],o=l.filters,a=!0,v=t.elementPath().elements,g,y=v.length;y--;){var w=v[y],E=0;g=w.data("cke-display-name")?w.data("cke-display-name"):w.data("cke-real-element-type")?w.data("cke-real-element-type"):w.getName(),a=w.hasAttribute("contenteditable")?w.getAttribute("contenteditable")=="true":a,!a&&!w.hasAttribute("contenteditable")&&(E=1);for(var S=0;S<o.length;S++){var x=o[S](w,g);if(x===!1){E=1;break}g=x||g}E||(r.unshift(w),s.unshift(g))}r=r.length;for(o=0;o<r;o++)g=s[o],a=t.lang.elementspath.eleTitle.replace(/%1/,g),g=i.output({id:h+o,label:a,text:g,jsTitle:"javascript:void('"+g+"')",index:o,keyDownFn:d,clickFn:p}),e.unshift(g);f||(f=CKEDITOR.document.getById(u)),s=f,s.setHtml(e.join("")+n),t.fire("elementsPathUpdate",{space:s})}),t.on("readOnly",o),t.on("contentDomUnload",o),t.addCommand("elementsPathFocus",e),t.setKeystroke(CKEDITOR.ALT+122,"elementsPathFocus")}var e;e={editorFocus:!1,readOnly:1,exec:function(e){(e=CKEDITOR.document.getById(e._.elementsPath.idBase+"0"))&&e.focus(CKEDITOR.env.ie||CKEDITOR.env.air)}};var n='<span class="cke_path_empty">&nbsp;</span>',r="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(r+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(r+=' onblur="this.style.cssText = this.style.cssText;"');var i=CKEDITOR.addTemplate("pathItem",'<a id="{id}" href="{jsTitle}" tabindex="-1" class="cke_path_item" title="{label}"'+r+' hidefocus="true"  onkeydown="return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick="CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role="button" aria-label="{label}">{text}</a>');CKEDITOR.plugins.add("elementspath",{init:function(e){e._.elementsPath={idBase:"cke_elementspath_"+CKEDITOR.tools.getNextNumber()+"_",filters:[]},e.on("uiSpace",function(n){n.data.space=="bottom"&&t(e,n.data)})}})}(),function(){function e(e,r){var i,s;r.on("refresh",function(e){var r=[t],i;for(i in e.data.states)r.push(e.data.states[i]);this.setState(CKEDITOR.tools.search(r,n)?n:t)},r,null,100),r.on("exec",function(t){i=e.getSelection(),s=i.createBookmarks(1),t.data||(t.data={}),t.data.done=!1},r,null,0),r.on("exec",function(){e.forceNextSelectionCheck(),i.selectBookmarks(s)},r,null,100)}var t=CKEDITOR.TRISTATE_DISABLED,n=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(t){var n=CKEDITOR.plugins.indent.genericDefinition;e(t,t.addCommand("indent",new n(!0))),e(t,t.addCommand("outdent",new n)),t.ui.addButton&&(t.ui.addButton("Indent",{label:t.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),t.ui.addButton("Outdent",{label:t.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"})),t.on("dirChanged",function(e){var n=t.createRange(),r=e.data.node;n.setStartBefore(r),n.setEndAfter(r);for(var i=new CKEDITOR.dom.walker(n),s;s=i.next();)if(s.type==CKEDITOR.NODE_ELEMENT)if(!s.equals(r)&&s.getDirection())n.setStartAfter(s),i=new CKEDITOR.dom.walker(n);else{var o=t.config.indentClasses;if(o)for(var u=e.data.dir=="ltr"?["_rtl",""]:["","_rtl"],a=0;a<o.length;a++)s.hasClass(o[a]+u[0])&&(s.removeClass(o[a]+u[0]),s.addClass(o[a]+u[1]));o=s.getStyle("margin-right"),u=s.getStyle("margin-left"),o?s.setStyle("margin-left",o):s.removeStyle("margin-left"),u?s.setStyle("margin-right",u):s.removeStyle("margin-right")}})}}),CKEDITOR.plugins.indent={genericDefinition:function(e){this.isIndent=!!e,this.startDisabled=!this.isIndent},specificDefinition:function(e,t,n){this.name=t,this.editor=e,this.jobs={},this.enterBr=e.config.enterMode==CKEDITOR.ENTER_BR,this.isIndent=!!n,this.relatedGlobal=n?"indent":"outdent",this.indentKey=n?9:CKEDITOR.SHIFT+9,this.database={}},registerCommands:function(e,t){e.on("pluginsLoaded",function(){for(var e in t)(function(e,t){var n=e.getCommand(t.relatedGlobal),r;for(r in t.jobs)n.on("exec",function(n){n.data.done||(e.fire("lockSnapshot"),t.execJob(e,r)&&(n.data.done=!0),e.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(t.database))},this,null,r),n.on("refresh",function(n){n.data.states||(n.data.states={}),n.data.states[t.name+"@"+r]=t.refreshJob(e,r,n.data.path)},this,null,r);e.addFeature(t)})(this,t[e])})}},CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}},CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(e,n){var r=this.jobs[n];if(r.state!=t)return r.exec.call(this,e)},refreshJob:function(e,n,r){return n=this.jobs[n],n.state=e.activeFilter.checkFeature(this)?n.refresh.call(this,e,r):t,n.state},getContext:function(e){return e.contains(this.context)}}}(),function(){function e(e){function r(t){for(var r=a.startContainer,u=a.endContainer;r&&!r.getParent().equals(t);)r=r.getParent();for(;u&&!u.getParent().equals(t);)u=u.getParent();if(!r||!u)return!1;for(var f=r,r=[],l=!1;!l;)f.equals(u)&&(l=!0),r.push(f),f=f.getNext();if(r.length<1)return!1;f=t.getParents(!0);for(u=0;u<f.length;u++)if(f[u].getName&&o[f[u].getName()]){t=f[u];break}for(var f=i.isIndent?1:-1,u=r[0],r=r[r.length-1],l=CKEDITOR.plugins.list.listToArray(t,s),c=l[r.getCustomData("listarray_index")].indent,u=u.getCustomData("listarray_index");u<=r.getCustomData("listarray_index");u++){l[u].indent=l[u].indent+f;if(f>0){var h=l[u].parent;l[u].parent=new CKEDITOR.dom.element(h.getName(),h.getDocument())}}for(u=r.getCustomData("listarray_index")+1;u<l.length&&l[u].indent>c;u++)l[u].indent=l[u].indent+f;r=CKEDITOR.plugins.list.arrayToList(l,s,null,e.config.enterMode,t.getDirection());if(!i.isIndent){var p;if((p=t.getParent())&&p.is("li"))for(var f=r.listNode.getChildren(),v=[],m,u=f.count()-1;u>=0;u--)(m=f.getItem(u))&&m.is&&m.is("li")&&v.push(m)}r&&r.listNode.replace(t);if(v&&v.length)for(u=0;u<v.length;u++){for(m=t=v[u];(m=m.getNext())&&m.is&&m.getName()in o;)CKEDITOR.env.needsNbspFiller&&!t.getFirst(n)&&t.append(a.document.createText(" ")),t.append(m);t.insertAfter(p)}return r&&e.fire("contentDomInvalidated"),!0}for(var i=this,s=this.database,o=this.context,u=e.getSelection(),u=(u&&u.getRanges()).createIterator(),a;a=u.getNextRange();){for(var f=a.getCommonAncestor();f&&(f.type!=CKEDITOR.NODE_ELEMENT||!o[f.getName()]);)f=f.getParent();f||(f=a.startPath().contains(o))&&a.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);if(!f){var l=a.getEnclosedNode();l&&l.type==CKEDITOR.NODE_ELEMENT&&l.getName()in o&&(a.setStartAt(l,CKEDITOR.POSITION_AFTER_START),a.setEndAt(l,CKEDITOR.POSITION_BEFORE_END),f=l)}f&&a.startContainer.type==CKEDITOR.NODE_ELEMENT&&a.startContainer.getName()in o&&(l=new CKEDITOR.dom.walker(a),l.evaluator=t,a.startContainer=l.next()),f&&a.endContainer.type==CKEDITOR.NODE_ELEMENT&&a.endContainer.getName()in o&&(l=new CKEDITOR.dom.walker(a),l.evaluator=t,a.endContainer=l.previous());if(f)return r(f)}return 0}function t(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.is("li")}function n(e){return r(e)&&i(e)}var r=CKEDITOR.dom.walker.whitespaces(!0),i=CKEDITOR.dom.walker.bookmark(!1,!0),s=CKEDITOR.TRISTATE_DISABLED,o=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(t){function n(t){r.specificDefinition.apply(this,arguments),this.requiredContent=["ul","ol"],t.on("key",function(e){if(t.mode=="wysiwyg"&&e.data.keyCode==this.indentKey){var n=this.getContext(t.elementPath());n&&(!this.isIndent||!CKEDITOR.plugins.indentList.firstItemInPath(this.context,t.elementPath(),n))&&(t.execCommand(this.relatedGlobal),e.cancel())}},this),this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(e,t){var n=this.getContext(t),r=CKEDITOR.plugins.indentList.firstItemInPath(this.context,t,n);return!n||!this.isIndent||r?s:o}:function(e,t){return!this.getContext(t)||this.isIndent?s:o},exec:CKEDITOR.tools.bind(e,this)}}var r=CKEDITOR.plugins.indent;r.registerCommands(t,{indentlist:new n(t,"indentlist",!0),outdentlist:new n(t,"outdentlist")}),CKEDITOR.tools.extend(n.prototype,r.specificDefinition.prototype,{context:{ol:1,ul:1}})}}),CKEDITOR.plugins.indentList={},CKEDITOR.plugins.indentList.firstItemInPath=function(e,n,r){var i=n.contains(t);return r||(r=n.contains(e)),r&&i&&i.equals(r.getFirst(t))}}(),function(){function e(e,t,n){function r(n){(f=a[n?"getFirst":"getLast"]())&&(!f.is||!f.isBlockBoundary())&&(l=t.root[n?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))&&(!l.is||!l.isBlockBoundary({br:1}))&&e.document.createElement("br")[n?"insertBefore":"insertAfter"](f)}for(var i=CKEDITOR.plugins.list.listToArray(t.root,n),s=[],o=0;o<t.contents.length;o++){var u=t.contents[o];(u=u.getAscendant("li",!0))&&!u.getCustomData("list_item_processed")&&(s.push(u),CKEDITOR.dom.element.setMarker(n,u,"list_item_processed",!0))}u=null;for(o=0;o<s.length;o++)u=s[o].getCustomData("listarray_index"),i[u].indent=-1;for(o=u+1;o<i.length;o++)if(i[o].indent>i[o-1].indent+1){s=i[o-1].indent+1-i[o].indent;for(u=i[o].indent;i[o]&&i[o].indent>=u;)i[o].indent=i[o].indent+s,o++;o--}var a=CKEDITOR.plugins.list.arrayToList(i,n,null,e.config.enterMode,t.root.getAttribute("dir")).listNode,f,l;r(!0),r(),a.replace(t.root),e.fire("contentDomInvalidated")}function t(e,t){this.name=e,this.context=this.type=t,this.allowedContent=t+" li",this.requiredContent=t}function n(e,t,n,r){for(var i,s;i=e[r?"getLast":"getFirst"](p);)(s=i.getDirection(1))!==t.getDirection(1)&&i.setAttribute("dir",s),i.remove(),n?i[r?"insertBefore":"insertAfter"](n):t.append(i,r)}function r(e){function t(t){var r=e[t?"getPrevious":"getNext"](l);r&&r.type==CKEDITOR.NODE_ELEMENT&&r.is(e.getName())&&(n(e,r,null,!t),e.remove(),e=r)}t(),t(1)}function i(e){return e.type==CKEDITOR.NODE_ELEMENT&&(e.getName()in CKEDITOR.dtd.$block||e.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[e.getName()]["#"]}function s(e,t,i){e.fire("saveSnapshot"),i.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var s=i.extractContents();t.trim(!1,!0);var u=t.createBookmark(),a=new CKEDITOR.dom.elementPath(t.startContainer),f=a.block,a=a.lastElement.getAscendant("li",1)||f,h=new CKEDITOR.dom.elementPath(i.startContainer),p=h.contains(CKEDITOR.dtd.$listItem),h=h.contains(CKEDITOR.dtd.$list);f?(f=f.getBogus())&&f.remove():h&&(f=h.getPrevious(l))&&c(f)&&f.remove(),(f=s.getLast())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("br")&&f.remove(),(f=t.startContainer.getChild(t.startOffset))?s.insertBefore(f):t.startContainer.append(s),p&&(s=o(p))&&(a.contains(p)?(n(s,p.getParent(),p),s.remove()):a.append(s));for(;i.checkStartOfBlock()&&i.checkEndOfBlock();){h=i.startPath(),s=h.block;if(!s)break;s.is("li")&&(a=s.getParent(),s.equals(a.getLast(l))&&s.equals(a.getFirst(l))&&(s=a)),i.moveToPosition(s,CKEDITOR.POSITION_BEFORE_START),s.remove()}i=i.clone(),s=e.editable(),i.setEndAt(s,CKEDITOR.POSITION_BEFORE_END),i=new CKEDITOR.dom.walker(i),i.evaluator=function(e){return l(e)&&!c(e)},(i=i.next())&&i.type==CKEDITOR.NODE_ELEMENT&&i.getName()in CKEDITOR.dtd.$list&&r(i),t.moveToBookmark(u),t.select(),e.fire("saveSnapshot")}function o(e){return(e=e.getLast(l))&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in u?e:null}var u={ol:1,ul:1},a=CKEDITOR.dom.walker.whitespaces(),f=CKEDITOR.dom.walker.bookmark(),l=function(e){return!a(e)&&!f(e)},c=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(e,t,n,r,i){if(!u[e.getName()])return[];r||(r=0),n||(n=[]);for(var s=0,o=e.getChildCount();s<o;s++){var a=e.getChild(s);a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(a,t,n,r+1);if(a.$.nodeName.toLowerCase()=="li"){var f={parent:e,indent:r,element:a,contents:[]};i?f.grandparent=i:(f.grandparent=e.getParent(),f.grandparent&&f.grandparent.$.nodeName.toLowerCase()=="li"&&(f.grandparent=f.grandparent.getParent())),t&&CKEDITOR.dom.element.setMarker(t,a,"listarray_index",n.length),n.push(f);for(var l=0,c=a.getChildCount(),h;l<c;l++)h=a.getChild(l),h.type==CKEDITOR.NODE_ELEMENT&&u[h.getName()]?CKEDITOR.plugins.list.listToArray(h,t,n,r+1,f.grandparent):f.contents.push(h)}}return n},arrayToList:function(e,t,n,r,i){n||(n=0);if(!e||e.length<n+1)return null;for(var s,o=e[n].parent.getDocument(),a=new CKEDITOR.dom.documentFragment(o),c=null,h=n,p=Math.max(e[n].indent,0),d=null,v,m,g=r==CKEDITOR.ENTER_P?"p":"div";;){var y=e[h];s=y.grandparent,v=y.element.getDirection(1);if(y.indent==p){if(!c||e[h].parent.getName()!=c.getName())c=e[h].parent.clone(!1,1),i&&c.setAttribute("dir",i),a.append(c);d=c.append(y.element.clone(0,1)),v!=c.getDirection(1)&&d.setAttribute("dir",v);for(s=0;s<y.contents.length;s++)d.append(y.contents[s].clone(1,1));h++}else if(y.indent==Math.max(p,0)+1)y=e[h-1].element.getDirection(1),h=CKEDITOR.plugins.list.arrayToList(e,null,h,r,y!=v?v:null),!d.getChildCount()&&CKEDITOR.env.needsNbspFiller&&o.$.documentMode<=7&&d.append(o.createText(" ")),d.append(h.listNode),h=h.nextIndex;else{if(y.indent!=-1||!!n||!s)return null;u[s.getName()]?(d=y.element.clone(!1,!0),v!=s.getDirection(1)&&d.setAttribute("dir",v)):d=new CKEDITOR.dom.documentFragment(o);var c=s.getDirection(1)!=v,b=y.element,w=b.getAttribute("class"),E=b.getAttribute("style"),S=d.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(r!=CKEDITOR.ENTER_BR||c||E||w),x,T=y.contents.length,N;for(s=0;s<T;s++){x=y.contents[s];if(f(x)&&T>1)S?N=x.clone(1,1):d.append(x.clone(1,1));else if(x.type==CKEDITOR.NODE_ELEMENT&&x.isBlockBoundary()){c&&!x.getDirection()&&x.setAttribute("dir",v),m=x;var C=b.getAttribute("style");C&&m.setAttribute("style",C.replace(/([^;])$/,"$1;")+(m.getAttribute("style")||"")),w&&x.addClass(w),m=null,N&&(d.append(N),N=null),d.append(x.clone(1,1))}else S?(m||(m=o.createElement(g),d.append(m),c&&m.setAttribute("dir",v)),E&&m.setAttribute("style",E),w&&m.setAttribute("class",w),N&&(m.append(N),N=null),m.append(x.clone(1,1))):d.append(x.clone(1,1))}N&&((m||d).append(N),N=null),d.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&h!=e.length-1&&(CKEDITOR.env.needsBrFiller&&(v=d.getLast())&&v.type==CKEDITOR.NODE_ELEMENT&&v.is("br")&&v.remove(),v=d.getLast(l),(!v||v.type!=CKEDITOR.NODE_ELEMENT||!v.is(CKEDITOR.dtd.$block))&&d.append(o.createElement("br"))),v=d.$.nodeName.toLowerCase(),(v=="div"||v=="p")&&d.appendBogus(),a.append(d),c=null,h++}m=null;if(e.length<=h||Math.max(e[h].indent,0)<p)break}if(t)for(e=a.getFirst();e;){if(e.type==CKEDITOR.NODE_ELEMENT){CKEDITOR.dom.element.clearMarkers(t,e);if(e.getName()in CKEDITOR.dtd.$listItem){n=e,o=i=r=void 0;if(r=n.getDirection()){for(i=n.getParent();i&&!(o=i.getDirection());)i=i.getParent();r==o&&n.removeAttribute("dir")}}}e=e.getNextSourceNode()}return{listNode:a,nextIndex:h}}};var h=/^h[1-6]$/,p=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);t.prototype={exec:function(t){this.refresh(t,t.elementPath());var n=t.config,i=t.getSelection(),s=i&&i.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var o=t.editable();if(o.getFirst(l)){var a=s.length==1&&s[0];(n=a&&a.getEnclosedNode())&&n.is&&this.type==n.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else n.enterMode==CKEDITOR.ENTER_BR?o.appendBogus():s[0].fixBlock(1,n.enterMode==CKEDITOR.ENTER_P?"p":"div"),i.selectRanges(s)}for(var n=i.createBookmarks(!0),o=[],f={},s=s.createIterator(),c=0;(a=s.getNextRange())&&++c;){var p=a.getBoundaryNodes(),d=p.startNode,v=p.endNode;d.type==CKEDITOR.NODE_ELEMENT&&d.getName()=="td"&&a.setStartAt(p.startNode,CKEDITOR.POSITION_AFTER_START),v.type==CKEDITOR.NODE_ELEMENT&&v.getName()=="td"&&a.setEndAt(p.endNode,CKEDITOR.POSITION_BEFORE_END),a=a.createIterator();for(a.forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;p=a.getNextParagraph();)if(!p.getCustomData("list_block")){CKEDITOR.dom.element.setMarker(f,p,"list_block",1);for(var m=t.elementPath(p),d=m.elements,v=0,m=m.blockLimit,y,b=d.length-1;b>=0&&(y=d[b]);b--)if(u[y.getName()]&&m.contains(y)){m.removeCustomData("list_group_object_"+c),(d=y.getCustomData("list_group_object"))?d.contents.push(p):(d={root:y,contents:[p]},o.push(d),CKEDITOR.dom.element.setMarker(f,y,"list_group_object",d)),v=1;break}v||(v=m,v.getCustomData("list_group_object_"+c)?v.getCustomData("list_group_object_"+c).contents.push(p):(d={root:v,contents:[p]},CKEDITOR.dom.element.setMarker(f,v,"list_group_object_"+c,d),o.push(d)))}}for(y=[];o.length>0;){d=o.shift();if(this.state==CKEDITOR.TRISTATE_OFF)if(u[d.root.getName()]){s=t,c=d,d=f,a=y,v=CKEDITOR.plugins.list.listToArray(c.root,d),m=[];for(p=0;p<c.contents.length;p++)b=c.contents[p],(b=b.getAscendant("li",!0))&&!b.getCustomData("list_item_processed")&&(m.push(b),CKEDITOR.dom.element.setMarker(d,b,"list_item_processed",!0));for(var b=c.root.getDocument(),w=void 0,E=void 0,p=0;p<m.length;p++){var S=m[p].getCustomData("listarray_index"),w=v[S].parent;w.is(this.type)||(E=b.createElement(this.type),w.copyAttributes(E,{start:1,type:1}),E.removeStyle("list-style-type"),v[S].parent=E)}d=CKEDITOR.plugins.list.arrayToList(v,d,null,s.config.enterMode),v=void 0,m=d.listNode.getChildCount();for(p=0;p<m&&(v=d.listNode.getChild(p));p++)v.getName()==this.type&&a.push(v);d.listNode.replace(c.root),s.fire("contentDomInvalidated")}else{v=t,p=d,a=y,m=p.contents,s=p.root.getDocument(),c=[],m.length==1&&m[0].equals(p.root)&&(d=s.createElement("div"),m[0].moveChildren&&m[0].moveChildren(d),m[0].append(d),m[0]=d),p=p.contents[0].getParent();for(b=0;b<m.length;b++)p=p.getCommonAncestor(m[b].getParent());w=v.config.useComputedState,v=d=void 0,w=w===void 0||w;for(b=0;b<m.length;b++)for(E=m[b];S=E.getParent();){if(S.equals(p)){c.push(E),!v&&E.getDirection()&&(v=1),E=E.getDirection(w),d!==null&&(d=d&&d!=E?null:E);break}E=S}if(!(c.length<1)){m=c[c.length-1].getNext(),b=s.createElement(this.type),a.push(b);for(w=a=void 0;c.length;)a=c.shift(),w=s.createElement("li"),a.is("pre")||h.test(a.getName())||a.getAttribute("contenteditable")=="false"?a.appendTo(w):(a.copyAttributes(w),d&&a.getDirection()&&(w.removeStyle("direction"),w.removeAttribute("dir")),a.moveChildren(w),a.remove()),w.appendTo(b);d&&v&&b.setAttribute("dir",d),m?b.insertBefore(m):b.appendTo(p)}}else this.state==CKEDITOR.TRISTATE_ON&&u[d.root.getName()]&&e.call(this,t,d,f)}for(b=0;b<y.length;b++)r(y[b]);CKEDITOR.dom.element.clearAllMarkers(f),i.selectBookmarks(n),t.focus()},refresh:function(e,t){var n=t.contains(u,1),r=t.blockLimit||t.root;n&&r.contains(n)?this.setState(n.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(e){e.blockless||(e.addCommand("numberedlist",new t("numberedlist","ol")),e.addCommand("bulletedlist",new t("bulletedlist","ul")),e.ui.addButton&&(e.ui.addButton("NumberedList",{label:e.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),e.ui.addButton("BulletedList",{label:e.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),e.on("key",function(t){var n=t.data.domEvent.getKey(),r;if(e.mode=="wysiwyg"&&n in{8:1,46:1}){var a=e.getSelection().getRanges()[0],f=a&&a.startPath();if(a&&a.collapsed){var h=n==8,p=e.editable(),v=new CKEDITOR.dom.walker(a.clone());v.evaluator=function(e){return l(e)&&!c(e)},v.guard=function(e,t){return!t||e.type!=CKEDITOR.NODE_ELEMENT||!e.is("table")},n=a.clone();if(h){var m;(m=f.contains(u))&&a.checkBoundaryOfElement(m,CKEDITOR.START)&&(m=m.getParent())&&m.is("li")&&(m=o(m))?(r=m,m=m.getPrevious(l),n.moveToPosition(m&&c(m)?m:r,CKEDITOR.POSITION_BEFORE_START)):(v.range.setStartAt(p,CKEDITOR.POSITION_AFTER_START),v.range.setEnd(a.startContainer,a.startOffset),(m=v.previous())&&m.type==CKEDITOR.NODE_ELEMENT&&(m.getName()in u||m.is("li"))&&(m.is("li")||(v.range.selectNodeContents(m),v.reset(),v.evaluator=i,m=v.previous()),r=m,n.moveToElementEditEnd(r))),r?(s(e,n,a),t.cancel()):(n=f.contains(u))&&a.checkBoundaryOfElement(n,CKEDITOR.START)&&(r=n.getFirst(l),a.checkBoundaryOfElement(r,CKEDITOR.START)&&(m=n.getPrevious(l),o(r)?m&&(a.moveToElementEditEnd(m),a.select()):e.execCommand("outdent"),t.cancel()))}else(r=f.contains("li"))?(v.range.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),r=(f=r.getLast(l))&&i(f)?f:r,p=0,(m=v.next())&&m.type==CKEDITOR.NODE_ELEMENT&&m.getName()in u&&m.equals(f)?(p=1,m=v.next()):a.checkBoundaryOfElement(r,CKEDITOR.END)&&(p=1),p&&m&&(a=a.clone(),a.moveToElementEditStart(m),s(e,n,a),t.cancel())):(v.range.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),(m=v.next())&&m.type==CKEDITOR.NODE_ELEMENT&&m.is(u)&&(m=m.getFirst(l),f.block&&a.checkStartOfBlock()&&a.checkEndOfBlock()?(f.block.remove(),a.moveToElementEditStart(m),a.select()):o(m)?(a.moveToElementEditStart(m),a.select()):(a=a.clone(),a.moveToElementEditStart(m),s(e,n,a)),t.cancel()));setTimeout(function(){e.selectionChange(1)})}}}))}})}(),function(){function e(e,t,n){n=e.config.forceEnterMode||n,e.mode=="wysiwyg"&&(t||(t=e.activeEnterMode),e.elementPath().isContextFor("p")||(t=CKEDITOR.ENTER_BR,n=1),e.fire("saveSnapshot"),t==CKEDITOR.ENTER_BR?o(e,t,null,n):u(e,t,null,n),e.fire("saveSnapshot"))}function t(e){for(var e=e.getSelection().getRanges(!0),t=e.length-1;t>0;t--)e[t].deleteContents();return e[0]}function n(e){var t=e.startContainer.getAscendant(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.getAttribute("contenteditable")=="true"},!0);return e.root.equals(t)?e:(t=new CKEDITOR.dom.range(t),t.moveToRange(e),t)}CKEDITOR.plugins.add("enterkey",{init:function(t){t.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(t){e(t)}}),t.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(t){e(t,t.activeShiftEnterMode,1)}}),t.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var r=CKEDITOR.dom.walker.whitespaces(),i=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(e,s,u,f){if(u=u||t(e)){var u=n(u),l=u.document,p=u.checkStartOfBlock(),d=u.checkEndOfBlock(),v=e.elementPath(u.startContainer),m=v.block,y=s==CKEDITOR.ENTER_DIV?"div":"p",w;if(p&&d){if(m&&(m.is("li")||m.getParent().is("li"))){m.is("li")||(m=m.getParent()),u=m.getParent(),w=u.getParent();var f=!m.hasPrevious(),E=!m.hasNext(),y=e.getSelection(),S=y.createBookmarks(),p=m.getDirection(1),d=m.getAttribute("class"),x=m.getAttribute("style"),T=w.getDirection(1)!=p,e=e.enterMode!=CKEDITOR.ENTER_BR||T||x||d;if(w.is("li"))f||E?m[f?"insertBefore":"insertAfter"](w):m.breakParent(w);else{if(e)v.block.is("li")?(w=l.createElement(s==CKEDITOR.ENTER_P?"p":"div"),T&&w.setAttribute("dir",p),x&&w.setAttribute("style",x),d&&w.setAttribute("class",d),m.moveChildren(w)):w=v.block,f||E?w[f?"insertBefore":"insertAfter"](u):(m.breakParent(u),w.insertAfter(u));else{m.appendBogus(!0);if(f||E)for(;l=m[f?"getFirst":"getLast"]();)l[f?"insertBefore":"insertAfter"](u);else for(m.breakParent(u);l=m.getLast();)l.insertAfter(u)}m.remove()}y.selectBookmarks(S);return}if(m&&m.getParent().is("blockquote")){m.breakParent(m.getParent()),m.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||m.getPrevious().remove(),m.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||m.getNext().remove(),u.moveToElementEditStart(m),u.select();return}}else if(m&&m.is("pre")&&!d){o(e,s,u,f);return}if(p=u.splitBlock(y)){s=p.previousBlock,m=p.nextBlock,v=p.wasStartOfBlock,e=p.wasEndOfBlock,m?(S=m.getParent(),S.is("li")&&(m.breakParent(S),m.move(m.getNext(),1))):s&&(S=s.getParent())&&S.is("li")&&(s.breakParent(S),S=s.getNext(),u.moveToElementEditStart(S),s.move(s.getPrevious()));if(!v&&!e)m.is("li")&&(w=u.clone(),w.selectNodeContents(m),w=new CKEDITOR.dom.walker(w),w.evaluator=function(e){return!(i(e)||r(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$inline&&!(e.getName()in CKEDITOR.dtd.$empty))},(S=w.next())&&S.type==CKEDITOR.NODE_ELEMENT&&S.is("ul","ol")&&(CKEDITOR.env.needsBrFiller?l.createElement("br"):l.createText(" ")).insertBefore(S)),m&&u.moveToElementEditStart(m);else{if(s){if(s.is("li")||!a.test(s.getName())&&!s.is("pre"))w=s.clone()}else m&&(w=m.clone());w?f&&!w.is("li")&&w.renameNode(y):S&&S.is("li")?w=S:(w=l.createElement(y),s&&(E=s.getDirection())&&w.setAttribute("dir",E));if(l=p.elementPath){f=0;for(y=l.elements.length;f<y;f++){S=l.elements[f];if(S.equals(l.block)||S.equals(l.blockLimit))break;CKEDITOR.dtd.$removeEmpty[S.getName()]&&(S=S.clone(),w.moveChildren(S),w.append(S))}}w.appendBogus(),w.getParent()||u.insertNode(w),w.is("li")&&w.removeAttribute("value"),CKEDITOR.env.ie&&v&&(!e||!s.getChildCount())&&(u.moveToElementEditStart(e?s:w),u.select()),u.moveToElementEditStart(v&&!e?m:w)}u.select(),u.scrollIntoView()}}},enterBr:function(e,n,r,i){if(r=r||t(e)){var s=r.document,o=r.checkEndOfBlock(),l=new CKEDITOR.dom.elementPath(e.getSelection().getStartElement()),c=l.block,p=c&&l.block.getName();!i&&p=="li"?u(e,n,r,i):(!i&&o&&a.test(p)?(o=c.getDirection())?(s=s.createElement("div"),s.setAttribute("dir",o),s.insertAfter(c),r.setStart(s,0)):(s.createElement("br").insertAfter(c),CKEDITOR.env.gecko&&s.createText("").insertAfter(c),r.setStartAt(c.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(e=p=="pre"&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?s.createText("\r"):s.createElement("br"),r.deleteContents(),r.insertNode(e),CKEDITOR.env.needsBrFiller?(s.createText("﻿").insertAfter(e),o&&(c||l.blockLimit).appendBogus(),e.getNext().$.nodeValue="",r.setStartAt(e.getNext(),CKEDITOR.POSITION_AFTER_START)):r.setStartAt(e,CKEDITOR.POSITION_AFTER_END)),r.collapse(!0),r.select(),r.scrollIntoView())}}};var s=CKEDITOR.plugins.enterkey,o=s.enterBr,u=s.enterBlock,a=/^h[1-6]$/}(),function(){function e(e,t){var n={},r=[],i={nbsp:" ",shy:"­",gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},e=e.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(e,s){var o=t?"&"+s+";":i[s];return n[o]=t?i[s]:"&"+s+";",r.push(o),""});if(!t&&e){var e=e.split(","),s=document.createElement("div"),o;s.innerHTML="&"+e.join(";&")+";",o=s.innerHTML,s=null;for(s=0;s<o.length;s++){var u=o.charAt(s);n[u]="&"+e[s]+";",r.push(u)}}return n.regex=r.join(t?"|":""),n}CKEDITOR.plugins.add("entities",{afterInit:function(t){function n(e){return f[e]}function r(e){return i.entities_processNumerical=="force"||!o[e]?"&#"+e.charCodeAt(0)+";":o[e]}var i=t.config;if(t=(t=t.dataProcessor)&&t.htmlFilter){var s=[];i.basicEntities!==!1&&s.push("nbsp,gt,lt,amp"),i.entities&&(s.length&&s.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"),i.entities_latin&&s.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"),i.entities_greek&&s.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"),i.entities_additional&&s.push(i.entities_additional));var o=e(s.join(",")),u=o.regex?"["+o.regex+"]":"a^";delete o.regex,i.entities&&i.entities_processNumerical&&(u="[^ -~]|"+u);var u=RegExp(u,"g"),f=e("nbsp,gt,lt,amp,shy",!0),l=RegExp(f.regex,"g");t.addRules({text:function(e){return e.replace(l,n).replace(u,r)}},{applyToAll:!0,excludeNestedEditable:!0})}}})}(),CKEDITOR.config.basicEntities=!0,CKEDITOR.config.entities=!0,CKEDITOR.config.entities_latin=!0,CKEDITOR.config.entities_greek=!0,CKEDITOR.config.entities_additional="#39",CKEDITOR.plugins.add("popup"),CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{popup:function(e,t,n,r){t=t||"80%",n=n||"70%",typeof t=="string"&&t.length>1&&t.substr(t.length-1,1)=="%"&&(t=parseInt(window.screen.width*parseInt(t,10)/100,10)),typeof n=="string"&&n.length>1&&n.substr(n.length-1,1)=="%"&&(n=parseInt(window.screen.height*parseInt(n,10)/100,10)),t<640&&(t=640),n<420&&(n=420);var i=parseInt((window.screen.height-n)/2,10),s=parseInt((window.screen.width-t)/2,10),r=(r||"location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes")+",width="+t+",height="+n+",top="+i+",left="+s,o=window.open("",null,r,!0);if(!o)return!1;try{navigator.userAgent.toLowerCase().indexOf(" chrome/")==-1&&(o.moveTo(s,i),o.resizeTo(t,n)),o.focus(),o.location.href=e}catch(u){window.open(e,null,r,!0)}return!0}}),function(){function e(e,t){var n=[];if(!t)return e;for(var r in t)n.push(r+"="+encodeURIComponent(t[r]));return e+(e.indexOf("?")!=-1?"&":"?")+n.join("&")}function t(e){return e+="",e.charAt(0).toUpperCase()+e.substr(1)}function n(){var n=this.getDialog(),r=n.getParentEditor();r._.filebrowserSe=this;var i=r.config["filebrowser"+t(n.getName())+"WindowWidth"]||r.config.filebrowserWindowWidth||"80%",n=r.config["filebrowser"+t(n.getName())+"WindowHeight"]||r.config.filebrowserWindowHeight||"70%",s=this.filebrowser.params||{};s.CKEditor=r.name,s.CKEditorFuncNum=r._.filebrowserFn,s.langCode||(s.langCode=r.langCode),s=e(this.filebrowser.url,s),r.popup(s,i,n,r.config.filebrowserWindowFeatures||r.config.fileBrowserWindowFeatures)}function r(){var e=this.getDialog();return e.getParentEditor()._.filebrowserSe=this,!e.getContentElement(this["for"][0],this["for"][1]).getInputElement().$.value||!e.getContentElement(this["for"][0],this["for"][1]).getAction()?!1:!0}function i(t,n,r){var i=r.params||{};i.CKEditor=t.name,i.CKEditorFuncNum=t._.filebrowserFn,i.langCode||(i.langCode=t.langCode),n.action=e(r.url,i),n.filebrowser=r}function s(e,o,u,a){if(a&&a.length)for(var f,l=a.length;l--;){f=a[l],(f.type=="hbox"||f.type=="vbox"||f.type=="fieldset")&&s(e,o,u,f.children);if(f.filebrowser){typeof f.filebrowser=="string"&&(f.filebrowser={action:f.type=="fileButton"?"QuickUpload":"Browse",target:f.filebrowser});if(f.filebrowser.action=="Browse"){var h=f.filebrowser.url;h===void 0&&(h=e.config["filebrowser"+t(o)+"BrowseUrl"],h===void 0&&(h=e.config.filebrowserBrowseUrl)),h&&(f.onClick=n,f.filebrowser.url=h,f.hidden=!1)}else if(f.filebrowser.action=="QuickUpload"&&f["for"]){h=f.filebrowser.url,h===void 0&&(h=e.config["filebrowser"+t(o)+"UploadUrl"],h===void 0&&(h=e.config.filebrowserUploadUrl));if(h){var p=f.onClick;f.onClick=function(e){var t=e.sender;return p&&p.call(t,e)===!1?!1:r.call(t,e)},f.filebrowser.url=h,f.hidden=!1,i(e,u.getContents(f["for"][0]).get(f["for"][1]),f.filebrowser)}}}}}function o(e,t,n){if(n.indexOf(";")!==-1){for(var n=n.split(";"),r=0;r<n.length;r++)if(o(e,t,n[r]))return!0;return!1}return(e=e.getContents(t).get(n).filebrowser)&&e.url}function u(e,t){var n=this._.filebrowserSe.getDialog(),r=this._.filebrowserSe["for"],i=this._.filebrowserSe.filebrowser.onSelect;r&&n.getContentElement(r[0],r[1]).reset();if((typeof t!="function"||t.call(this._.filebrowserSe)!==!1)&&(!i||i.call(this._.filebrowserSe,e,t)!==!1)){typeof t=="string"&&t&&alert(t);if(e){r=this._.filebrowserSe,n=r.getDialog();if(r=r.filebrowser.target||null){r=r.split(":");if(i=n.getContentElement(r[0],r[1]))i.setValue(e),n.selectPage(r[0])}}}}CKEDITOR.plugins.add("filebrowser",{requires:"popup",init:function(e){e._.filebrowserFn=CKEDITOR.tools.addFunction(u,e),e.on("destroy",function(){CKEDITOR.tools.removeFunction(this._.filebrowserFn)})}}),CKEDITOR.on("dialogDefinition",function(e){if(e.editor.plugins.filebrowser)for(var t=e.data.definition,n,r=0;r<t.contents.length;++r)if(n=t.contents[r])s(e.editor,e.data.name,t,n.elements),n.hidden&&n.filebrowser&&(n.hidden=!o(t,n.id,n.filebrowser))})}(),function(){function e(e){var r=e.config,i=e.fire("uiSpace",{space:"top",html:""}).html,s=function(){function i(e,t,r){u.setStyle(t,n(r)),u.setStyle("position",e)}function o(e){var t=f.getDocumentPosition();switch(e){case"top":i("absolute","top",t.y-v-y);break;case"pin":i("fixed","top",E);break;case"bottom":i("absolute","top",t.y+(p.height||p.bottom-p.top)+y)}a=e}var a,f,l,p,d,v,m,g=r.floatSpaceDockedOffsetX||0,y=r.floatSpaceDockedOffsetY||0,w=r.floatSpacePinnedOffsetX||0,E=r.floatSpacePinnedOffsetY||0;return function(r){if(f=e.editable()){r&&r.name=="focus"&&u.show(),u.removeStyle("left"),u.removeStyle("right"),l=u.getClientRect(),p=f.getClientRect(),d=t.getViewPaneSize(),v=l.height,m="pageXOffset"in t.$?t.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;if(a){v+y<=p.top?o("top"):v+y>d.height-p.bottom?o("pin"):o("bottom");var r=d.width/2,r=p.left>0&&p.right<d.width&&p.width>l.width?e.config.contentsLangDirection=="rtl"?"right":"left":r-p.left>p.right-r?"left":"right",i;l.width>d.width?(r="left",i=0):(i=r=="left"?p.left>0?p.left:0:p.right<d.width?d.width-p.right:0,i+l.width>d.width&&(r=r=="left"?"right":"left",i=0)),u.setStyle(r,n((a=="pin"?w:g)+i+(a=="pin"?0:r=="left"?m:-m)))}else a="pin",o("pin"),s(r)}}}();if(i){var o=new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}"'+(e.title?' aria-labelledby="cke_{name}_arialbl"':" ")+">"+(e.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':" ")+'<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),u=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(o.output({content:i,id:e.id,langDir:e.lang.dir,langCode:e.langCode,name:e.name,style:"display:none;z-index:"+(r.baseFloatZIndex-1),topId:e.ui.spaceId("top"),voiceLabel:e.title}))),a=CKEDITOR.tools.eventsBuffer(500,s),f=CKEDITOR.tools.eventsBuffer(100,s);u.unselectable(),u.on("mousedown",function(e){e=e.data,e.getTarget().hasAscendant("a",1)||e.preventDefault()}),e.on("focus",function(n){s(n),e.on("change",a.input),t.on("scroll",f.input),t.on("resize",f.input)}),e.on("blur",function(){u.hide(),e.removeListener("change",a.input),t.removeListener("scroll",f.input),t.removeListener("resize",f.input)}),e.on("destroy",function(){t.removeListener("scroll",f.input),t.removeListener("resize",f.input),u.clearCustomData(),u.remove()}),e.focusManager.hasFocus&&u.show(),e.focusManager.add(u,1)}}var t=CKEDITOR.document.getWindow(),n=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(t){t.on("loaded",function(){e(this)},null,null,20)}})}(),CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var e=CKEDITOR.addTemplate("panel-list",'<ul role="presentation" class="cke_panel_list">{items}</ul>'),t=CKEDITOR.addTemplate("panel-list-item",'<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')"  {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),n=CKEDITOR.addTemplate("panel-list-group",'<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),r=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(e,t){return this.addBlock(e,new CKEDITOR.ui.listBlock(this.getHolderElement(),t))},CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(e,t){var t=t||{},n=t.attributes||(t.attributes={});(this.multiSelect=!!t.multiSelect)&&(n["aria-multiselectable"]=!0),!n.role&&(n.role="listbox"),this.base.apply(this,arguments),this.element.setAttribute("role",n.role),n=this.keys,n[40]="next",n[9]="next",n[38]="prev",n[CKEDITOR.SHIFT+9]="prev",n[32]=CKEDITOR.env.ie?"mouseup":"click",CKEDITOR.env.ie&&(n[13]="mouseup"),this._.pendingHtml=[],this._.pendingList=[],this._.items={},this._.groups={}},_:{close:function(){if(this._.started){var t=e.output({items:this._.pendingList.join("")});this._.pendingList=[],this._.pendingHtml.push(t),delete this._.started}},getClick:function(){return this._.click||(this._.click=CKEDITOR.tools.addFunction(function(e){var t=this.toggle(e);this.onClick&&this.onClick(e,t)},this)),this._.click}},proto:{add:function(e,n,i){var s=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0),this._.items[e]=s;var o;o=CKEDITOR.tools.htmlEncodeAttr(e).replace(r,"\\'"),e={id:s,val:o,onclick:CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(i||e),text:n||e},this._.pendingList.push(t.output(e))},startGroup:function(e){this._.close();var t=CKEDITOR.tools.getNextId();this._.groups[e]=t,this._.pendingHtml.push(n.output({id:t,label:e}))},commit:function(){this._.close(),this.element.appendHtml(this._.pendingHtml.join("")),delete this._.size,this._.pendingHtml=[]},toggle:function(e){var t=this.isMarked(e);return t?this.unmark(e):this.mark(e),!t},hideGroup:function(e){var t=(e=this.element.getDocument().getById(this._.groups[e]))&&e.getNext();e&&(e.setStyle("display","none"),t&&t.getName()=="ul"&&t.setStyle("display","none"))},hideItem:function(e){this.element.getDocument().getById(this._.items[e]).setStyle("display","none")},showAll:function(){var e=this._.items,t=this._.groups,n=this.element.getDocument(),r;for(r in e)n.getById(e[r]).setStyle("display","");for(var i in t)e=n.getById(t[i]),r=e.getNext(),e.setStyle("display",""),r&&r.getName()=="ul"&&r.setStyle("display","")},mark:function(e){this.multiSelect||this.unmarkAll();var e=this._.items[e],t=this.element.getDocument().getById(e);t.addClass("cke_selected"),this.element.getDocument().getById(e+"_option").setAttribute("aria-selected",!0),this.onMark&&this.onMark(t)},unmark:function(e){var t=this.element.getDocument(),e=this._.items[e],n=t.getById(e);n.removeClass("cke_selected"),t.getById(e+"_option").removeAttribute("aria-selected"),this.onUnmark&&this.onUnmark(n)},unmarkAll:function(){var e=this._.items,t=this.element.getDocument(),n;for(n in e){var r=e[n];t.getById(r).removeClass("cke_selected"),t.getById(r+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(e){return this.element.getDocument().getById(this._.items[e]).hasClass("cke_selected")},focus:function(e){this._.focusIndex=-1;var t=this.element.getElementsByTag("a"),n,r=-1;if(e){for(n=this.element.getDocument().getById(this._.items[e]).getFirst();e=t.getItem(++r);)if(e.equals(n)){this._.focusIndex=r;break}}else this.element.focus();n&&setTimeout(function(){n.focus()},0)}}})}}),function(){var e='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;"');var e=e+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),e=e+'>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',t=CKEDITOR.addTemplate("buttonArrow",'<span class="cke_button_arrow">'+(CKEDITOR.env.hc?"&#9660;":"")+"</span>"),n=CKEDITOR.addTemplate("button",e);CKEDITOR.plugins.add("button",{beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}}),CKEDITOR.UI_BUTTON="button",CKEDITOR.ui.button=function(e){CKEDITOR.tools.extend(this,e,{title:e.label,click:e.click||function(t){t.execCommand(e.command)}}),this._={}},CKEDITOR.ui.button.handler={create:function(e){return new CKEDITOR.ui.button(e)}},CKEDITOR.ui.button.prototype={render:function(e,r){function i(){var t=e.mode;t&&(t=this.modes[t]?d[t]!==void 0?d[t]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,t=e.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:t,this.setState(t),this.refresh&&this.refresh())}var s=CKEDITOR.env,o=this._.id=CKEDITOR.tools.getNextId(),u="",a=this.command,f;this._.editor=e;var l={id:o,button:this,editor:e,focus:function(){CKEDITOR.document.getById(o).focus()},execute:function(){this.button.click(e)},attach:function(e){this.button.attach(e)}},c=CKEDITOR.tools.addFunction(function(e){if(l.onkey)return e=new CKEDITOR.dom.event(e),l.onkey(l,e.getKeystroke())!==!1}),h=CKEDITOR.tools.addFunction(function(e){var t;return l.onfocus&&(t=l.onfocus(l,new CKEDITOR.dom.event(e))!==!1),t}),p=0;l.clickFn=f=CKEDITOR.tools.addFunction(function(){p&&(e.unlockSelection(1),p=0),l.execute(),s.iOS&&e.focus()});if(this.modes){var d={};e.on("beforeModeUnload",function(){e.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(d[e.mode]=this._.state)},this),e.on("activeFilterChange",i,this),e.on("mode",i,this),!this.readOnly&&e.on("readOnly",i,this)}else a&&(a=e.getCommand(a))&&(a.on("state",function(){this.setState(a.state)},this),u+=a.state==CKEDITOR.TRISTATE_ON?"on":a.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");this.directional&&e.on("contentDirChanged",function(t){var n=CKEDITOR.document.getById(this._.id),r=n.getFirst(),t=t.data;t!=e.lang.dir?n.addClass("cke_"+t):n.removeClass("cke_ltr").removeClass("cke_rtl"),r.setAttribute("style",CKEDITOR.skin.getIconStyle(m,t=="rtl",this.icon,this.iconOffset))},this),a||(u+="off");var v=this.name||this.command,m=v;return this.icon&&!/\./.test(this.icon)&&(m=this.icon,this.icon=null),u={id:o,name:v,iconName:m,label:this.label,cls:this.className||"",state:u,ariaDisabled:u=="disabled"?"true":"false",title:this.title,titleJs:s.gecko&&!s.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:c,focusFn:h,clickFn:f,style:CKEDITOR.skin.getIconStyle(m,e.lang.dir=="rtl",this.icon,this.iconOffset),arrowHtml:this.hasArrow?t.output():""},n.output(u,r),this.onRender&&this.onRender(),l},setState:function(e){if(this._.state==e)return!1;this._.state=e;var t=CKEDITOR.document.getById(this._.id);return t?(t.setState(e,"cke_button"),e==CKEDITOR.TRISTATE_DISABLED?t.setAttribute("aria-disabled",!0):t.removeAttribute("aria-disabled"),this.hasArrow?(e=e==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(e)):e==CKEDITOR.TRISTATE_ON?t.setAttribute("aria-pressed",!0):t.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(e){if(this._.feature)return this._.feature;var t=this;return!this.allowedContent&&!this.requiredContent&&this.command&&(t=e.getCommand(this.command)||t),this._.feature=t}},CKEDITOR.ui.prototype.addButton=function(e,t){this.add(e,CKEDITOR.UI_BUTTON,t)}}(),CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}),function(){var e='<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" title="{title}" tabindex="-1"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;"');var e=e+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">'+(CKEDITOR.env.hc?"&#9660;":CKEDITOR.env.air?"&nbsp;":"")+"</span></span></a></span>"),t=CKEDITOR.addTemplate("combo",e);CKEDITOR.UI_RICHCOMBO="richcombo",CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(e){CKEDITOR.tools.extend(this,e,{canGroup:!1,title:e.label,modes:{wysiwyg:1},editorFocus:1}),e=this.panel||{},delete this.panel,this.id=CKEDITOR.tools.getNextNumber(),this.document=e.parent&&e.parent.getDocument()||CKEDITOR.document,e.className="cke_combopanel",e.block={multiSelect:e.multiSelect,attributes:e.attributes},e.toolbarRelated=!0,this._={panelDefinition:e,items:{}}},proto:{renderHtml:function(e){var t=[];return this.render(e,t),t.join("")},render:function(e,n){function r(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var t=this.modes[e.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;e.readOnly&&!this.readOnly&&(t=CKEDITOR.TRISTATE_DISABLED),this.setState(t),this.setValue(""),t!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var i=CKEDITOR.env,s="cke_"+this.id,o=CKEDITOR.tools.addFunction(function(t){c&&(e.unlockSelection(1),c=0),a.execute(t)},this),u=this,a={id:s,combo:this,focus:function(){CKEDITOR.document.getById(s).getChild(1).focus()},execute:function(t){var n=u._;if(n.state!=CKEDITOR.TRISTATE_DISABLED){u.createPanel(e);if(n.on)n.panel.hide();else{u.commit();var r=u.getValue();r?n.list.mark(r):n.list.unmarkAll(),n.panel.showBlock(u.id,new CKEDITOR.dom.element(t),4)}}},clickFn:o};e.on("activeFilterChange",r,this),e.on("mode",r,this),e.on("selectionChange",r,this),!this.readOnly&&e.on("readOnly",r,this);var f=CKEDITOR.tools.addFunction(function(t,n){var t=new CKEDITOR.dom.event(t),r=t.getKeystroke();r==40&&e.once("panelShow",function(e){e.data._.panel._.currentBlock.onKeyDown(40)});switch(r){case 13:case 32:case 40:CKEDITOR.tools.callFunction(o,n);break;default:a.onkey(a,r)}t.preventDefault()}),l=CKEDITOR.tools.addFunction(function(){a.onfocus&&a.onfocus()}),c=0;return a.keyDownFn=f,i={id:s,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:i.gecko&&!i.hc?"":(this.title||"").replace("'",""),keydownFn:f,focusFn:l,clickFn:o},t.output(i,n),this.onRender&&this.onRender(),a},createPanel:function(e){if(!this._.panel){var t=this._.panelDefinition,n=this._.panelDefinition.block,r=t.parent||CKEDITOR.document.getBody(),i="cke_combopanel__"+this.name,s=new CKEDITOR.ui.floatPanel(e,r,t),o=s.addListBlock(this.id,n),u=this;s.onShow=function(){this.element.addClass(i),u.setState(CKEDITOR.TRISTATE_ON),u._.on=1,u.editorFocus&&!e.focusManager.hasFocus&&e.focus(),u.onOpen&&u.onOpen(),e.once("panelShow",function(){o.focus(!o.multiSelect&&u.getValue())})},s.onHide=function(t){this.element.removeClass(i),u.setState(u.modes&&u.modes[e.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),u._.on=0,!t&&u.onClose&&u.onClose()},s.onEscape=function(){s.hide(1)},o.onClick=function(e,t){u.onClick&&u.onClick.call(u,e,t),s.hide()},this._.panel=s,this._.list=o,s.getBlock(this.id).onHide=function(){u._.on=0,u.setState(CKEDITOR.TRISTATE_OFF)},this.init&&this.init()}},setValue:function(e,t){this._.value=e;var n=this.document.getById("cke_"+this.id+"_text");n&&(!e&&!t?(t=this.label,n.addClass("cke_combo_inlinelabel")):n.removeClass("cke_combo_inlinelabel"),n.setText(typeof t!="undefined"?t:e))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(e){this._.list.mark(e)},hideItem:function(e){this._.list.hideItem(e)},hideGroup:function(e){this._.list.hideGroup(e)},showAll:function(){this._.list.showAll()},add:function(e,t,n){this._.items[e]=n||e,this._.list.add(e,t,n)},startGroup:function(e){this._.list.startGroup(e)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this)),this._.committed=1},setState:function(e){if(this._.state!=e){var t=this.document.getById("cke_"+this.id);t.setState(e,"cke_combo"),e==CKEDITOR.TRISTATE_DISABLED?t.setAttribute("aria-disabled",!0):t.removeAttribute("aria-disabled"),this._.state=e}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))}},statics:{handler:{create:function(e){return new CKEDITOR.ui.richCombo(e)}}}}),CKEDITOR.ui.prototype.addRichCombo=function(e,t){this.add(e,CKEDITOR.UI_RICHCOMBO,t)}}(),CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(e){if(!e.blockless){for(var t=e.config,n=e.lang.format,r=t.format_tags.split(";"),i={},s=0,o=[],u=0;u<r.length;u++){var a=r[u],f=new CKEDITOR.style(t["format_"+a]);if(!e.filter.customConfig||e.filter.check(f))s++,i[a]=f,i[a]._.enterMode=e.config.enterMode,o.push(f)}s!==0&&e.ui.addRichCombo("Format",{label:n.label,title:n.panelTitle,toolbar:"styles,20",allowedContent:o,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(t.contentsCss),multiSelect:!1,attributes:{"aria-label":n.panelTitle}},init:function(){this.startGroup(n.panelTitle);for(var e in i){var t=n["tag_"+e];this.add(e,i[e].buildPreview(t),t)}},onClick:function(t){e.focus(),e.fire("saveSnapshot");var t=i[t],n=e.elementPath();e[t.checkActive(n,e)?"removeStyle":"applyStyle"](t),setTimeout(function(){e.fire("saveSnapshot")},0)},onRender:function(){e.on("selectionChange",function(t){var n=this.getValue(),t=t.data.path;this.refresh();for(var r in i)if(i[r].checkActive(t,e)){r!=n&&this.setValue(r,e.lang.format["tag_"+r]);return}this.setValue("")},this)},onOpen:function(){this.showAll();for(var t in i)e.activeFilter.check(i[t])||this.hideItem(t)},refresh:function(){var t=e.elementPath();if(t){if(t.isContextFor("p"))for(var n in i)if(e.activeFilter.check(i[n]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}}),CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div",CKEDITOR.config.format_p={element:"p"},CKEDITOR.config.format_div={element:"div"},CKEDITOR.config.format_pre={element:"pre"},CKEDITOR.config.format_address={element:"address"},CKEDITOR.config.format_h1={element:"h1"},CKEDITOR.config.format_h2={element:"h2"},CKEDITOR.config.format_h3={element:"h3"},CKEDITOR.config.format_h4={element:"h4"},CKEDITOR.config.format_h5={element:"h5"},CKEDITOR.config.format_h6={element:"h6"},function(){var e={canUndo:!1,exec:function(e){var t=e.document.createElement("hr");e.insertElement(t)},allowedContent:"hr",requiredContent:"hr"};CKEDITOR.plugins.add("horizontalrule",{init:function(t){t.blockless||(t.addCommand("horizontalrule",e),t.ui.addButton&&t.ui.addButton("HorizontalRule",{label:t.lang.horizontalrule.toolbar,command:"horizontalrule",toolbar:"insert,40"}))}})}(),CKEDITOR.plugins.add("htmlwriter",{init:function(e){var t=new CKEDITOR.htmlWriter;t.forceSimpleAmpersand=e.config.forceSimpleAmpersand,t.indentationChars=e.config.dataIndentationChars||"	",e.dataProcessor.writer=t}}),CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,$:function(){this.base(),this.indentationChars="	",this.selfClosingEnd=" />",this.lineBreakChars="\n",this.sortAttributes=1,this._.indent=0,this._.indentation="",this._.inPre=0,this._.rules={};var e=CKEDITOR.dtd,t;for(t in CKEDITOR.tools.extend({},e.$nonBodyContent,e.$block,e.$listItem,e.$tableContent))this.setRules(t,{indent:!e[t]["#"],breakBeforeOpen:1,breakBeforeClose:!e[t]["#"],breakAfterClose:1,needsSpace:t in e.$block&&!(t in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1}),this.setRules("title",{indent:0,breakAfterOpen:0}),this.setRules("style",{indent:0,breakBeforeClose:1}),this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(e){var t=this._.rules[e];this._.afterCloser&&t&&t.needsSpace&&this._.needsSpace&&this._.output.push("\n"),this._.indent?this.indentation():t&&t.breakBeforeOpen&&(this.lineBreak(),this.indentation()),this._.output.push("<",e),this._.afterCloser=0},openTagClose:function(e,t){var n=this._.rules[e];t?(this._.output.push(this.selfClosingEnd),n&&n.breakAfterClose&&(this._.needsSpace=n.needsSpace)):(this._.output.push(">"),n&&n.indent&&(this._.indentation=this._.indentation+this.indentationChars)),n&&n.breakAfterOpen&&this.lineBreak(),e=="pre"&&(this._.inPre=1)},attribute:function(e,t){typeof t=="string"&&(this.forceSimpleAmpersand&&(t=t.replace(/&amp;/g,"&")),t=CKEDITOR.tools.htmlEncodeAttr(t)),this._.output.push(" ",e,'="',t,'"')},closeTag:function(e){var t=this._.rules[e];t&&t.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length)),this._.indent?this.indentation():t&&t.breakBeforeClose&&(this.lineBreak(),this.indentation()),this._.output.push("</",e,">"),e=="pre"&&(this._.inPre=0),t&&t.breakAfterClose&&(this.lineBreak(),this._.needsSpace=t.needsSpace),this._.afterCloser=1},text:function(e){this._.indent&&(this.indentation(),!this._.inPre&&(e=CKEDITOR.tools.ltrim(e))),this._.output.push(e)},comment:function(e){this._.indent&&this.indentation(),this._.output.push("<!--",e,"-->")},lineBreak:function(){!this._.inPre&&this._.output.length>0&&this._.output.push(this.lineBreakChars),this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation),this._.indent=0},reset:function(){this._.output=[],this._.indent=0,this._.indentation="",this._.afterCloser=0,this._.inPre=0},setRules:function(e,t){var n=this._.rules[e];n?CKEDITOR.tools.extend(n,t,!0):this._.rules[e]=t}}}),function(){function e(e,t){t||(t=e.getSelection().getSelectedElement());if(t&&t.is("img")&&!t.data("cke-realelement")&&!t.isReadOnly())return t}function t(e){var t=e.getStyle("float");if(t=="inherit"||t=="none")t=0;return t||(t=e.getAttribute("align")),t}CKEDITOR.plugins.add("image",{requires:"dialog",init:function(t){if(!t.plugins.image2){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var n="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";CKEDITOR.dialog.isTabEnabled(t,"image","advanced")&&(n="img[alt,dir,id,lang,longdesc,!src,title]{*}(*)"),t.addCommand("image",new CKEDITOR.dialogCommand("image",{allowedContent:n,requiredContent:"img[alt,src]",contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]})),t.ui.addButton&&t.ui.addButton("Image",{label:t.lang.common.image,command:"image",toolbar:"insert,10"}),t.on("doubleclick",function(e){var t=e.data.element;t.is("img")&&!t.data("cke-realelement")&&!t.isReadOnly()&&(e.data.dialog="image")}),t.addMenuItems&&t.addMenuItems({image:{label:t.lang.image.menu,command:"image",group:"image"}}),t.contextMenu&&t.contextMenu.addListener(function(n){if(e(t,n))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(n){function r(r){var i=n.getCommand("justify"+r);i&&((r=="left"||r=="right")&&i.on("exec",function(i){var s=e(n),o;s&&(o=t(s),o==r?(s.removeStyle("float"),r==t(s)&&s.removeAttribute("align")):s.setStyle("float",r),i.cancel())}),i.on("refresh",function(i){var s=e(n);s&&(s=t(s),this.setState(s==r?CKEDITOR.TRISTATE_ON:r=="right"||r=="left"?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),i.cancel())}))}n.plugins.image2||(r("left"),r("right"),r("center"),r("block"))}})}(),CKEDITOR.config.image_removeLinkByEmptyURL=!0,function(){function e(e,t){var n=r.exec(e),i=r.exec(t);if(n){if(!n[2]&&i[2]=="px")return i[1];if(n[2]=="px"&&!i[2])return i[1]+"px"}return t}var t=CKEDITOR.htmlParser.cssStyle,n=CKEDITOR.tools.cssLength,r=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,i={elements:{$:function(n){var r=n.attributes;if((r=(r=(r=r&&r["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(r)))&&r.children[0])&&n.attributes["data-cke-resizable"]){var i=(new t(n)).rules,n=r.attributes,s=i.width,i=i.height;s&&(n.width=e(n.width,s)),i&&(n.height=e(n.height,i))}return r}}};CKEDITOR.plugins.add("fakeobjects",{init:function(e){e.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(e){(e=(e=e.dataProcessor)&&e.htmlFilter)&&e.addRules(i,{applyToAll:!0})}}),CKEDITOR.editor.prototype.createFakeElement=function(e,r,i,s){var o=this.lang.fakeobjects,o=o[i]||o.unknown,r={"class":r,"data-cke-realelement":encodeURIComponent(e.getOuterHtml()),"data-cke-real-node-type":e.type,alt:o,title:o,align:e.getAttribute("align")||""};return CKEDITOR.env.hc||(r.src=CKEDITOR.tools.transparentImageData),i&&(r["data-cke-real-element-type"]=i),s&&(r["data-cke-resizable"]=s,i=new t,s=e.getAttribute("width"),e=e.getAttribute("height"),s&&(i.rules.width=n(s)),e&&(i.rules.height=n(e)),i.populate(r)),this.document.createElement("img",{attributes:r})},CKEDITOR.editor.prototype.createFakeParserElement=function(e,r,i,s){var o=this.lang.fakeobjects,o=o[i]||o.unknown,u;return u=new CKEDITOR.htmlParser.basicWriter,e.writeHtml(u),u=u.getHtml(),r={"class":r,"data-cke-realelement":encodeURIComponent(u),"data-cke-real-node-type":e.type,alt:o,title:o,align:e.attributes.align||""},CKEDITOR.env.hc||(r.src=CKEDITOR.tools.transparentImageData),i&&(r["data-cke-real-element-type"]=i),s&&(r["data-cke-resizable"]=s,s=e.attributes,e=new t,i=s.width,s=s.height,i!==void 0&&(e.rules.width=n(i)),s!==void 0&&(e.rules.height=n(s)),e.populate(r)),new CKEDITOR.htmlParser.element("img",r)},CKEDITOR.editor.prototype.restoreRealElement=function(t){if(t.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var n=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(t.data("cke-realelement")),this.document);if(t.data("cke-resizable")){var r=t.getStyle("width"),t=t.getStyle("height");r&&n.setAttribute("width",e(n.getAttribute("width"),r)),t&&n.setAttribute("height",e(n.getAttribute("height"),t))}return n}}(),"use strict",function(){function e(e){return e.replace(/'/g,"\\$&")}function t(e){for(var t,n=e.length,r=[],i=0;i<n;i++)t=e.charCodeAt(i),r.push(t);return"String.fromCharCode("+r.join(",")+")"}function n(t,n){var r=t.plugins.link,i=r.compiledProtectionFunction.params,s,o;o=[r.compiledProtectionFunction.name,"("];for(var u=0;u<i.length;u++)r=i[u].toLowerCase(),s=n[r],u>0&&o.push(","),o.push("'",s?e(encodeURIComponent(n[r])):"","'");return o.push(")"),o.join("")}function r(e){var e=e.config.emailProtection||"",t;return e&&e!="encode"&&(t={},e.replace(/^([^(]+)\(([^)]+)\)$/,function(e,n,r){t.name=n,t.params=[],r.replace(/[^,\s]+/g,function(e){t.params.push(e)})})),t}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function e(e){return n.replace(/%1/g,e=="rtl"?"right":"left").replace(/%2/g,"cke_contents_"+e)}var t="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",n=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+t+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+t+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(e("ltr")+e("rtl"))},init:function(e){var t="a[!href]";CKEDITOR.dialog.isTabEnabled(e,"link","advanced")&&(t=t.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)")),CKEDITOR.dialog.isTabEnabled(e,"link","target")&&(t=t.replace("]",",target,onclick]")),e.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:t,requiredContent:"a[href]"})),e.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"})),e.addCommand("unlink",new CKEDITOR.unlinkCommand),e.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand),e.setKeystroke(CKEDITOR.CTRL+76,"link"),e.ui.addButton&&(e.ui.addButton("Link",{label:e.lang.link.toolbar,command:"link",toolbar:"links,10"}),e.ui.addButton("Unlink",{label:e.lang.link.unlink,command:"unlink",toolbar:"links,20"}),e.ui.addButton("Anchor",{label:e.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"})),CKEDITOR.dialog.add("link",this.path+"dialogs/link.js"),CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js"),e.on("doubleclick",function(t){var n=CKEDITOR.plugins.link.getSelectedLink(e)||t.data.element;n.isReadOnly()||(n.is("a")?(t.data.dialog=n.getAttribute("name")&&(!n.getAttribute("href")||!n.getChildCount())?"anchor":"link",t.data.link=n):CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,n)&&(t.data.dialog="anchor"))},null,null,0),e.on("doubleclick",function(t){t.data.dialog in{link:1,anchor:1}&&t.data.link&&e.getSelection().selectElement(t.data.link)},null,null,20),e.addMenuItems&&e.addMenuItems({anchor:{label:e.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:e.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:e.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:e.lang.link.unlink,command:"unlink",group:"link",order:5}}),e.contextMenu&&e.contextMenu.addListener(function(t){if(!t||t.isReadOnly())return null;t=CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,t);if(!t&&!(t=CKEDITOR.plugins.link.getSelectedLink(e)))return null;var n={};return t.getAttribute("href")&&t.getChildCount()&&(n={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF}),t&&t.hasAttribute("name")&&(n.anchor=n.removeAnchor=CKEDITOR.TRISTATE_OFF),n}),this.compiledProtectionFunction=r(e)},afterInit:function(e){e.dataProcessor.dataFilter.addRules({elements:{a:function(t){return t.attributes.name?t.children.length?null:e.createFakeParserElement(t,"cke_anchor","anchor"):null}}});var t=e._.elementsPath&&e._.elementsPath.filters;t&&t.push(function(t,n){if(n=="a"&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,t)||t.getAttribute("name")&&(!t.getAttribute("href")||!t.getChildCount())))return"anchor"})}});var i=/^javascript:/,s=/^mailto:([^?]+)(?:\?(.+))?$/,o=/subject=([^;?:@&=$,\/]*)/,u=/body=([^;?:@&=$,\/]*)/,a=/^#(.*)$/,f=/^((?:http|https|ftp|news):\/\/)?(.*)$/,l=/^(_(?:self|top|parent|blank))$/,c=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,h=/^javascript:([^(]+)\(([^)]+)\)$/,p=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,d=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,v={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(e){var t=e.getSelection(),n=t.getSelectedElement();return n&&n.is("a")?n:(t=t.getRanges()[0])?(t.shrink(CKEDITOR.SHRINK_TEXT),e.elementPath(t.getCommonAncestor()).contains("a",1)):null},getEditorAnchors:function(e){for(var t=e.editable(),n=t.isInline()&&!e.plugins.divarea?e.document:t,t=n.getElementsByTag("a"),n=n.getElementsByTag("img"),r=[],i=0,s;s=t.getItem(i++);)(s.data("cke-saved-name")||s.hasAttribute("name"))&&r.push({name:s.data("cke-saved-name")||s.getAttribute("name"),id:s.getAttribute("id")});for(i=0;s=n.getItem(i++);)(s=this.tryRestoreFakeAnchor(e,s))&&r.push({name:s.getAttribute("name"),id:s.getAttribute("id")});return r},fakeAnchor:!0,tryRestoreFakeAnchor:function(e,t){if(t&&t.data("cke-real-element-type")&&t.data("cke-real-element-type")=="anchor"){var n=e.restoreRealElement(t);if(n.data("cke-saved-name"))return n}},parseLinkAttributes:function(e,t){var n=t&&(t.data("cke-saved-href")||t.getAttribute("href"))||"",r=e.plugins.link.compiledProtectionFunction,g=e.config.emailProtection,y,b={};n.match(i)&&(g=="encode"?n=n.replace(c,function(e,t,n){return"mailto:"+String.fromCharCode.apply(String,t.split(","))+(n&&n.replace(/\\'/g,"'"))}):g&&n.replace(h,function(e,t,n){if(t==r.name){b.type="email";for(var e=b.email={},t=/(^')|('$)/g,n=n.match(/[^,\s]+/g),i=n.length,s,o,u=0;u<i;u++)s=decodeURIComponent,o=n[u].replace(t,"").replace(/\\'/g,"'"),o=s(o),s=r.params[u].toLowerCase(),e[s]=o;e.address=[e.name,e.domain].join("@")}}));if(!b.type)if(g=n.match(a))b.type="anchor",b.anchor={},b.anchor.name=b.anchor.id=g[1];else if(g=n.match(s)){y=n.match(o),n=n.match(u),b.type="email";var w=b.email={};w.address=g[1],y&&(w.subject=decodeURIComponent(y[1])),n&&(w.body=decodeURIComponent(n[1]))}else n&&(y=n.match(f))&&(b.type="url",b.url={},b.url.protocol=y[1],b.url.url=y[2]);if(t){if(n=t.getAttribute("target"))b.target={type:n.match(l)?n:"frame",name:n};else if(n=(n=t.data("cke-pa-onclick")||t.getAttribute("onclick"))&&n.match(p))for(b.target={type:"popup",name:n[1]};g=d.exec(n[2]);)g[2]!="yes"&&g[2]!="1"||g[1]in{height:1,width:1,top:1,left:1}?isFinite(g[2])&&(b.target[g[1]]=g[2]):b.target[g[1]]=!0;var n={},E;for(E in v)(g=t.getAttribute(E))&&(n[v[E]]=g);if(E=t.data("cke-saved-name")||n.advName)n.advName=E;CKEDITOR.tools.isEmpty(n)||(b.advanced=n)}return b},getLinkAttributes:function(r,i){var s=r.config.emailProtection||"",o={};switch(i.type){case"url":var s=i.url&&i.url.protocol!==void 0?i.url.protocol:"http://",u=i.url&&CKEDITOR.tools.trim(i.url.url)||"";o["data-cke-saved-href"]=u.indexOf("/")===0?u:s+u;break;case"anchor":s=i.anchor&&i.anchor.id,o["data-cke-saved-href"]="#"+(i.anchor&&i.anchor.name||s||"");break;case"email":var a=i.email,u=a.address;switch(s){case"":case"encode":var f=encodeURIComponent(a.subject||""),l=encodeURIComponent(a.body||""),a=[];f&&a.push("subject="+f),l&&a.push("body="+l),a=a.length?"?"+a.join("&"):"",s=="encode"?(s=["javascript:void(location.href='mailto:'+",t(u)],a&&s.push("+'",e(a),"'"),s.push(")")):s=["mailto:",u,a];break;default:s=u.split("@",2),a.name=s[0],a.domain=s[1],s=["javascript:",n(r,a)]}o["data-cke-saved-href"]=s.join("")}if(i.target)if(i.target.type=="popup"){for(var s=["window.open(this.href, '",i.target.name||"","', '"],c=["resizable","status","location","toolbar","menubar","fullscreen","scrollbars","dependent"],u=c.length,f=function(e){i.target[e]&&c.push(e+"="+i.target[e])},a=0;a<u;a++)c[a]=c[a]+(i.target[c[a]]?"=yes":"=no");f("width"),f("left"),f("height"),f("top"),s.push(c.join(","),"'); return false;"),o["data-cke-pa-onclick"]=s.join("")}else i.target.type!="notSet"&&i.target.name&&(o.target=i.target.name);if(i.advanced){for(var h in v)(s=i.advanced[v[h]])&&(o[h]=s);o.name&&(o["data-cke-saved-name"]=o.name)}o["data-cke-saved-href"]&&(o.href=o["data-cke-saved-href"]),h=CKEDITOR.tools.extend({target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1},v);for(var p in o)delete h[p];return{set:o,removed:CKEDITOR.tools.objectKeys(h)}}},CKEDITOR.unlinkCommand=function(){},CKEDITOR.unlinkCommand.prototype={exec:function(e){var t=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});e.removeStyle(t)},refresh:function(e,t){var n=t.lastElement&&t.lastElement.getAscendant("a",!0);n&&n.getName()=="a"&&n.getAttribute("href")&&n.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]"},CKEDITOR.removeAnchorCommand=function(){},CKEDITOR.removeAnchorCommand.prototype={exec:function(e){var t=e.getSelection(),n=t.createBookmarks(),r;if(t&&(r=t.getSelectedElement())&&(r.getChildCount()?r.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,r)))r.remove(1);else if(r=CKEDITOR.plugins.link.getSelectedLink(e))r.hasAttribute("href")?(r.removeAttributes({name:1,"data-cke-saved-name":1}),r.removeClass("cke_anchor")):r.remove(1);t.selectBookmarks(n)},requiredContent:"a[name]"},CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0})}(),"use strict",function(){function e(e,t,n){return l(t)&&l(n)&&n.equals(t.getNext(function(e){return!(J(e)||K(e)||c(e))}))}function t(e){this.upper=e[0],this.lower=e[1],this.set.apply(this,e.slice(2))}function n(e){var t=e.element;if(t&&l(t)&&(t=t.getAscendant(e.triggers,!0))&&e.editable.contains(t)){var n=s(t);if(n.getAttribute("contenteditable")=="true")return t;if(n.is(e.triggers))return n}return null}function r(e,t,n){return b(e,t),b(e,n),e=t.size.bottom,n=n.size.top,e&&n?0|(e+n)/2:e||n}function i(e,t,n){return t=t[n?"getPrevious":"getNext"](function(t){return t&&t.type==CKEDITOR.NODE_TEXT&&!J(t)||l(t)&&!c(t)&&!f(e,t)})}function s(e,t){if(e.data("cke-editable"))return null;for(t||(e=e.getParent());e;){if(e.data("cke-editable"))break;if(e.hasAttribute("contenteditable"))return e;e=e.getParent()}return null}function o(e){var t=e.doc,n=N('<span contenteditable="false" style="'+W+"position:absolute;border-top:1px dashed "+e.boxColor+'"></span>',t),r=CKEDITOR.getUrl(this.path+"images/"+(C.hidpi?"hidpi/":"")+"icon"+(e.rtl?"-rtl":"")+".png");x(n,{attach:function(){return this.wrap.getParent()||this.wrap.appendTo(e.editable,!0),this},lineChildren:[x(N('<span title="'+e.editor.lang.magicline.title+'" contenteditable="false">&#8629;</span>',t),{base:W+"height:17px;width:17px;"+(e.rtl?"left":"right")+":17px;background:url("+r+") center no-repeat "+e.boxColor+";cursor:pointer;"+(C.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(C.hidpi?"background-size: 9px 10px;":""),looks:["top:-8px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","2px",1),"top:-17px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","2px 2px 0px 0px",1),"top:-1px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","0px 0px 2px 2px",1)]}),x(N(V,t),{base:X+"left:0px;border-left-color:"+e.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"]}),x(N(V,t),{base:X+"right:0px;border-right-color:"+e.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"]})],detach:function(){return this.wrap.getParent()&&this.wrap.remove(),this},mouseNear:function(){b(e,this);var t=e.holdDistance,n=this.size;return n&&e.mouse.y>n.top-t&&e.mouse.y<n.bottom+t&&e.mouse.x>n.left-t&&e.mouse.x<n.right+t?!0:!1},place:function(){var t=e.view,n=e.editable,r=e.trigger,i=r.upper,s=r.lower,o=i||s,u=o.getParent(),a={};this.trigger=r,i&&b(e,i,!0),s&&b(e,s,!0),b(e,u,!0),e.inInlineMode&&w(e,!0),u.equals(n)?(a.left=t.scroll.x,a.right=-t.scroll.x,a.width=""):(a.left=o.size.left-o.size.margin.left+t.scroll.x-(e.inInlineMode?t.editable.left+t.editable.border.left:0),a.width=o.size.outerWidth+o.size.margin.left+o.size.margin.right+t.scroll.x,a.right=""),i&&s?a.top=i.size.margin.bottom===s.size.margin.top?0|i.size.bottom+i.size.margin.bottom/2:i.size.margin.bottom<s.size.margin.top?i.size.bottom+i.size.margin.bottom:i.size.bottom+i.size.margin.bottom-s.size.margin.top:i?s||(a.top=i.size.bottom+i.size.margin.bottom):a.top=s.size.top-s.size.margin.top,r.is(H)||a.top>t.scroll.y-15&&a.top<t.scroll.y+5?(a.top=e.inInlineMode?0:t.scroll.y,this.look(H)):r.is(B)||a.top>t.pane.bottom-5&&a.top<t.pane.bottom+15?(a.top=e.inInlineMode?t.editable.height+t.editable.padding.top+t.editable.padding.bottom:t.pane.bottom-1,this.look(B)):(e.inInlineMode&&(a.top=a.top-(t.editable.top+t.editable.border.top)),this.look(j)),e.inInlineMode&&(a.top--,a.top=a.top+t.editable.scroll.top,a.left=a.left+t.editable.scroll.left);for(var f in a)a[f]=CKEDITOR.tools.cssLength(a[f]);this.setStyles(a)},look:function(e){if(this.oldLook!=e){for(var t=this.lineChildren.length,n;t--;)(n=this.lineChildren[t]).setAttribute("style",n.base+n.looks[0|e/2]);this.oldLook=e}},wrap:new T("span",e.doc)});for(t=n.lineChildren.length;t--;)n.lineChildren[t].appendTo(n);n.look(j),n.appendTo(n.wrap),n.unselectable(),n.lineChildren[0].on("mouseup",function(t){n.detach(),u(e,function(t){var n=e.line.trigger;t[n.is(O)?"insertBefore":"insertAfter"](n.is(O)?n.lower:n.upper)},!0),e.editor.focus(),!C.ie&&e.enterMode!=CKEDITOR.ENTER_BR&&e.hotNode.scrollIntoView(),t.data.preventDefault(!0)}),n.on("mousedown",function(e){e.data.preventDefault(!0)}),e.line=n}function u(e,t,n){var r=new CKEDITOR.dom.range(e.doc),i=e.editor,o;C.ie&&e.enterMode==CKEDITOR.ENTER_BR?o=e.doc.createText(F):(o=(o=s(e.element,!0))&&o.data("cke-enter-mode")||e.enterMode,o=new T(A[o],e.doc),o.is("br")||e.doc.createText(F).appendTo(o)),n&&i.fire("saveSnapshot"),t(o),r.moveToPosition(o,CKEDITOR.POSITION_AFTER_START),i.getSelection().selectRanges([r]),e.hotNode=o,n&&i.fire("saveSnapshot")}function a(e,t){return{canUndo:!0,modes:{wysiwyg:1},exec:function(){function r(n){var r=C.ie&&C.version<9?" ":F,i=e.hotNode&&e.hotNode.getText()==r&&e.element.equals(e.hotNode)&&e.lastCmdDirection===!!t;u(e,function(r){i&&e.hotNode&&e.hotNode.remove(),r[t?"insertAfter":"insertBefore"](n),r.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!t}),e.lastCmdDirection=!!t}),!C.ie&&e.enterMode!=CKEDITOR.ENTER_BR&&e.hotNode.scrollIntoView(),e.line.detach()}return function(o){var o=o.getSelection().getStartElement(),u,o=o.getAscendant(U,1);if(!d(e,o)&&o&&!o.equals(e.editable)&&!o.contains(e.editable)){(u=s(o))&&u.getAttribute("contenteditable")=="false"&&(o=u),e.element=o,u=i(e,o,!t);var a;l(u)&&u.is(e.triggers)&&u.is(R)&&(!i(e,u,!t)||(a=i(e,u,!t))&&l(a)&&a.is(e.triggers))?r(u):(a=n(e,o),l(a)&&(i(e,a,!t)?(o=i(e,a,!t))&&l(o)&&o.is(e.triggers)&&r(a):r(a)))}}}()}}function f(e,t){if(!t||t.type!=CKEDITOR.NODE_ELEMENT||!t.$)return!1;var n=e.line;return n.wrap.equals(t)||n.wrap.contains(t)}function l(e){return e&&e.type==CKEDITOR.NODE_ELEMENT&&e.$}function c(e){if(!l(e))return!1;var t;return(t=h(e))||(l(e)?(t={left:1,right:1,center:1},t=!!t[e.getComputedStyle("float")]||!!t[e.getAttribute("align")]):t=!1),t}function h(e){return!!{absolute:1,fixed:1}[e.getComputedStyle("position")]}function p(e,t){return l(t)?t.is(e.triggers):null}function d(e,t){if(!t)return!1;for(var n=t.getParents(1),r=n.length;r--;)for(var i=e.tabuList.length;i--;)if(n[r].hasAttribute(e.tabuList[i]))return!0;return!1}function v(e,t,n){return t=t[n?"getLast":"getFirst"](function(t){return e.isRelevant(t)&&!t.is(q)}),t?(b(e,t),n?t.size.top>e.mouse.y:t.size.bottom<e.mouse.y):!1}function m(e){var n=e.editable,r=e.mouse,i=e.view,s=e.triggerOffset;w(e);var o=r.y>(e.inInlineMode?i.editable.top+i.editable.height/2:Math.min(i.editable.height,i.pane.height)/2),n=n[o?"getLast":"getFirst"](function(e){return!J(e)&&!K(e)});return n?(f(e,n)&&(n=e.line.wrap[o?"getPrevious":"getNext"](function(e){return!J(e)&&!K(e)})),!l(n)||c(n)||!p(e,n)?null:(b(e,n),!o&&n.size.top>=0&&r.y>0&&r.y<n.size.top+s?(e=e.inInlineMode||i.scroll.y===0?H:j,new t([null,n,O,D,e])):o&&n.size.bottom<=i.pane.height&&r.y>n.size.bottom-s&&r.y<i.pane.height?(e=e.inInlineMode||n.size.bottom>i.pane.height-s&&n.size.bottom<i.pane.height?B:j,new t([n,null,M,D,e])):null)):null}function g(e){var r=e.mouse,s=e.view,o=e.triggerOffset,u=n(e);if(!u)return null;b(e,u);var o=Math.min(o,0|u.size.outerHeight/2),a=[],f,h;if(r.y>u.size.top-1&&r.y<u.size.top+o)h=!1;else{if(!(r.y>u.size.bottom-o&&r.y<u.size.bottom+1))return null;h=!0}if(c(u)||v(e,u,h)||u.getParent().is(I))return null;var d=i(e,u,!h);if(d){if(d&&d.type==CKEDITOR.NODE_TEXT)return null;if(l(d)){if(c(d)||!p(e,d)||d.getParent().is(I))return null;a=[d,u][h?"reverse":"concat"]().concat([_,D])}}else u.equals(e.editable[h?"getLast":"getFirst"](e.isRelevant))?(w(e),h&&r.y>u.size.bottom-o&&r.y<s.pane.height&&u.size.bottom>s.pane.height-o&&u.size.bottom<s.pane.height?f=B:r.y>0&&r.y<u.size.top+o&&(f=H)):f=j,a=[null,u][h?"reverse":"concat"]().concat([h?M:O,D,f,u.equals(e.editable[h?"getLast":"getFirst"](e.isRelevant))?h?B:H:j]);return 0 in a?new t(a):null}function y(e,t,n,r){for(var i=function(){var n=C.ie?t.$.currentStyle:e.win.$.getComputedStyle(t.$,"");return C.ie?function(e){return n[CKEDITOR.tools.cssStyleToDomStyle(e)]}:function(e){return n.getPropertyValue(e)}}(),s=t.getDocumentPosition(),o={},u={},a={},f={},l=G.length;l--;)o[G[l]]=parseInt(i("border-"+G[l]+"-width"),10)||0,a[G[l]]=parseInt(i("padding-"+G[l]),10)||0,u[G[l]]=parseInt(i("margin-"+G[l]),10)||0;return(!n||r)&&E(e,r),f.top=s.y-(n?0:e.view.scroll.y),f.left=s.x-(n?0:e.view.scroll.x),f.outerWidth=t.$.offsetWidth,f.outerHeight=t.$.offsetHeight,f.height=f.outerHeight-(a.top+a.bottom+o.top+o.bottom),f.width=f.outerWidth-(a.left+a.right+o.left+o.right),f.bottom=f.top+f.outerHeight,f.right=f.left+f.outerWidth,e.inInlineMode&&(f.scroll={top:t.$.scrollTop,left:t.$.scrollLeft}),x({border:o,padding:a,margin:u,ignoreScroll:n},f,!0)}function b(e,t,n){if(!l(t))return t.size=null;if(t.size){if(t.size.ignoreScroll==n&&t.size.date>new Date-z)return null}else t.size={};return x(t.size,y(e,t,n),{date:+(new Date)},!0)}function w(e,t){e.view.editable=y(e,e.editable,t,!0)}function E(e,t){e.view||(e.view={});var n=e.view;if(t||!(n&&n.date>new Date-z)){var r=e.win,n=r.getScrollPosition(),r=r.getViewPaneSize();x(e.view,{scroll:{x:n.x,y:n.y,width:e.doc.$.documentElement.scrollWidth-r.width,height:e.doc.$.documentElement.scrollHeight-r.height},pane:{width:r.width,height:r.height,bottom:r.height+n.y},date:+(new Date)},!0)}}function S(e,n,r,i){for(var s=i,o=i,u=0,a=!1,f=!1,l=e.view.pane.height,c=e.mouse;c.y+u<l&&c.y-u>0;){a||(a=n(s,i)),f||(f=n(o,i)),!a&&c.y-u>0&&(s=r(e,{x:c.x,y:c.y-u})),!f&&c.y+u<l&&(o=r(e,{x:c.x,y:c.y+u}));if(a&&f)break;u+=2}return new t([s,o,null,null])}CKEDITOR.plugins.add("magicline",{init:function(e){var r=e.config,s=r.magicline_triggerOffset||30,p={editor:e,enterMode:r.enterMode,triggerOffset:s,holdDistance:0|s*(r.magicline_holdDistance||.5),boxColor:r.magicline_color||"#ff0000",rtl:r.contentsLangDirection=="rtl",tabuList:["data-cke-hidden-sel"].concat(r.magicline_tabuList||[]),triggers:r.magicline_everywhere?U:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},v,b,S;p.isRelevant=function(e){return l(e)&&!f(p,e)&&!c(e)},e.on("contentDom",function(){var s=e.editable(),l=e.document,c=e.window;x(p,{editable:s,inInlineMode:s.isInline(),doc:l,win:c,hotNode:null},!0),p.boundary=p.inInlineMode?p.editable:p.doc.getDocumentElement(),s.is(L.$inline)||(p.inInlineMode&&!h(s)&&s.setStyles({position:"relative",top:null,left:null}),o.call(this,p),E(p),s.attachListener(e,"beforeUndoImage",function(){p.line.detach()}),s.attachListener(e,"beforeGetData",function(){p.line.wrap.getParent()&&(p.line.detach(),e.once("getData",function(){p.line.attach()},null,null,1e3))},null,null,0),s.attachListener(p.inInlineMode?l:l.getWindow().getFrame(),"mouseout",function(t){if(e.mode=="wysiwyg")if(p.inInlineMode){var n=t.data.$.clientX,t=t.data.$.clientY;E(p),w(p,!0);var r=p.view.editable,i=p.view.scroll;if(!(n>r.left-i.x&&n<r.right-i.x)||!(t>r.top-i.y&&t<r.bottom-i.y))clearTimeout(S),S=null,p.line.detach()}else clearTimeout(S),S=null,p.line.detach()}),s.attachListener(s,"keyup",function(){p.hiddenMode=0}),s.attachListener(s,"keydown",function(t){if(e.mode=="wysiwyg")switch(t.data.getKeystroke()){case 2228240:case 16:p.hiddenMode=1,p.line.detach()}}),s.attachListener(p.inInlineMode?s:l,"mousemove",function(t){b=!0;if(e.mode=="wysiwyg"&&!e.readOnly&&!S){var n={x:t.data.$.clientX,y:t.data.$.clientY};S=setTimeout(function(){p.mouse=n,S=p.trigger=null,E(p),b&&!p.hiddenMode&&e.focusManager.hasFocus&&!p.line.mouseNear()&&(p.element=$(p,!0))&&((p.trigger=m(p)||g(p)||Q(p))&&!d(p,p.trigger.upper||p.trigger.lower)?p.line.attach().place():(p.trigger=null,p.line.detach()),b=!1)},30)}}),s.attachListener(c,"scroll",function(){e.mode=="wysiwyg"&&(p.line.detach(),C.webkit&&(p.hiddenMode=1,clearTimeout(v),v=setTimeout(function(){p.mouseDown||(p.hiddenMode=0)},50)))}),s.attachListener(k?l:c,"mousedown",function(){e.mode=="wysiwyg"&&(p.line.detach(),p.hiddenMode=1,p.mouseDown=1)}),s.attachListener(k?l:c,"mouseup",function(){p.hiddenMode=0,p.mouseDown=0}),e.addCommand("accessPreviousSpace",a(p)),e.addCommand("accessNextSpace",a(p,!0)),e.setKeystroke([[r.magicline_keystrokePrevious,"accessPreviousSpace"],[r.magicline_keystrokeNext,"accessNextSpace"]]),e.on("loadSnapshot",function(){var t,n,r,i;for(i in{p:1,br:1,div:1}){t=e.document.getElementsByTag(i);for(r=t.count();r--;)if((n=t.getItem(r)).data("cke-magicline-hot")){p.hotNode=n,p.lastCmdDirection=n.data("cke-magicline-dir")==="true"?!0:!1;return}}}),this.backdoor={accessFocusSpace:u,boxTrigger:t,isLine:f,getAscendantTrigger:n,getNonEmptyNeighbour:i,getSize:y,that:p,triggerEdge:g,triggerEditable:m,triggerExpand:Q})},this)}});var x=CKEDITOR.tools.extend,T=CKEDITOR.dom.element,N=T.createFromHtml,C=CKEDITOR.env,k=CKEDITOR.env.ie&&CKEDITOR.env.version<9,L=CKEDITOR.dtd,A={},O=128,M=64,_=32,D=16,P=8,H=4,B=2,j=1,F=" ",I=L.$listItem,q=L.$tableContent,R=x({},L.$nonEditable,L.$empty),U=L.$block,z=100,W="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",X=W+"border-color:transparent;display:block;border-style:solid;",V="<span>"+F+"</span>";A[CKEDITOR.ENTER_BR]="br",A[CKEDITOR.ENTER_P]="p",A[CKEDITOR.ENTER_DIV]="div",t.prototype={set:function(e,t,n){return this.properties=e+t+(n||j),this},is:function(e){return(this.properties&e)==e}};var $=function(){function e(e,t){var n=e.$.elementFromPoint(t.x,t.y);return n&&n.nodeType?new CKEDITOR.dom.element(n):null}return function(t,n,r){if(!t.mouse)return null;var i=t.doc,s=t.line.wrap,r=r||t.mouse,o=e(i,r);return n&&f(t,o)&&(s.hide(),o=e(i,r),s.show()),!o||o.type!=CKEDITOR.NODE_ELEMENT||!o.$||C.ie&&C.version<9&&!t.boundary.equals(o)&&!t.boundary.contains(o)?null:o}}(),J=CKEDITOR.dom.walker.whitespaces(),K=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),Q=function(){function t(t){var i=t.element,s,o,u;if(!l(i)||i.contains(t.editable)||i.isReadOnly())return null;u=S(t,function(e,t){return!t.equals(e)},function(e,t){return $(e,!0,t)},i),s=u.upper,o=u.lower;if(e(t,s,o))return u.set(_,P);if(s&&i.contains(s))for(;!s.getParent().equals(i);)s=s.getParent();else s=i.getFirst(function(e){return n(t,e)});if(o&&i.contains(o))for(;!o.getParent().equals(i);)o=o.getParent();else o=i.getLast(function(e){return n(t,e)});if(!s||!o)return null;b(t,s),b(t,o);if(t.mouse.y>s.size.top&&t.mouse.y<o.size.bottom){for(var i=Number.MAX_VALUE,a,f,c,h;o&&!o.equals(s);){if(!(f=s.getNext(t.isRelevant)))break;a=Math.abs(r(t,s,f)-t.mouse.y),a<i&&(i=a,c=s,h=f),s=f,b(t,s)}return!!c&&!!h&&t.mouse.y>c.size.top&&t.mouse.y<h.size.bottom?(u.upper=c,u.lower=h,u.set(_,P)):null}return null}function n(e,t){return!(t&&t.type==CKEDITOR.NODE_TEXT||K(t)||c(t)||f(e,t)||t.type==CKEDITOR.NODE_ELEMENT&&t.$&&t.is("br"))}return function(n){var r=t(n),i;if(i=r){i=r.upper;var s=r.lower;i=!i||!s||c(s)||c(i)||s.equals(i)||i.equals(s)||s.contains(i)||i.contains(s)?!1:p(n,i)&&p(n,s)&&e(n,i,s)?!0:!1}return i?r:null}}(),G=["top","left","right","bottom"]}(),CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51,CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52,function(){function e(e){if(!e||e.type!=CKEDITOR.NODE_ELEMENT||e.getName()!="form")return[];for(var t=[],n=["style","className"],r=0;r<n.length;r++){var i=e.$.elements.namedItem(n[r]);i&&(i=new CKEDITOR.dom.element(i),t.push([i,i.nextSibling]),i.remove())}return t}function t(e,t){if(e&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()=="form"&&t.length>0)for(var n=t.length-1;n>=0;n--){var r=t[n][0],i=t[n][1];i?r.insertBefore(i):r.appendTo(e)}}function n(n,r){var i=e(n),s={},o=n.$;return r||(s["class"]=o.className||"",o.className=""),s.inline=o.style.cssText||"",r||(o.style.cssText="position: static; overflow: visible"),t(i),s}function r(n,r){var i=e(n),s=n.$;"class"in r&&(s.className=r["class"]),"inline"in r&&(s.style.cssText=r.inline),t(i)}function i(e){if(!e.editable().isInline()){var t=CKEDITOR.instances,n;for(n in t){var r=t[n];r.mode=="wysiwyg"&&!r.readOnly&&(r=r.document.getBody(),r.setAttribute("contentEditable",!1),r.setAttribute("contentEditable",!0))}e.editable().hasFocus&&(e.toolbox.focus(),e.focus())}}CKEDITOR.plugins.add("maximize",{init:function(e){function t(){var t=u.getViewPaneSize();e.resize(t.width,t.height,null,!0)}if(e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var s=e.lang,o=CKEDITOR.document,u=o.getWindow(),a,f,l,h=CKEDITOR.TRISTATE_OFF;e.addCommand("maximize",{modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},readOnly:1,editorFocus:!1,exec:function(){var p=e.container.getFirst(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.hasClass("cke_inner")}),d=e.ui.space("contents");if(e.mode=="wysiwyg"){var v=e.getSelection();a=v&&v.getRanges(),f=u.getScrollPosition()}else{var m=e.editable().$;a=!CKEDITOR.env.ie&&[m.selectionStart,m.selectionEnd],f=[m.scrollLeft,m.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){u.on("resize",t),l=u.getScrollPosition();for(v=e.container;v=v.getParent();)v.setCustomData("maximize_saved_styles",n(v)),v.setStyle("z-index",e.config.baseFloatZIndex-5);d.setCustomData("maximize_saved_styles",n(d,!0)),p.setCustomData("maximize_saved_styles",n(p,!0)),d={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0},o.getDocumentElement().setStyles(d),!CKEDITOR.env.gecko&&o.getDocumentElement().setStyle("position","fixed"),(!CKEDITOR.env.gecko||!CKEDITOR.env.quirks)&&o.getBody().setStyles(d),CKEDITOR.env.ie?setTimeout(function(){u.$.scrollTo(0,0)},0):u.$.scrollTo(0,0),p.setStyle("position",CKEDITOR.env.gecko&&CKEDITOR.env.quirks?"fixed":"absolute"),p.$.offsetLeft,p.setStyles({"z-index":e.config.baseFloatZIndex-5,left:"0px",top:"0px"}),p.addClass("cke_maximized"),t(),d=p.getDocumentPosition(),p.setStyles({left:-1*d.x+"px",top:-1*d.y+"px"}),CKEDITOR.env.gecko&&i(e)}else if(this.state==CKEDITOR.TRISTATE_ON){u.removeListener("resize",t),d=[d,p];for(v=0;v<d.length;v++)r(d[v],d[v].getCustomData("maximize_saved_styles")),d[v].removeCustomData("maximize_saved_styles");for(v=e.container;v=v.getParent();)r(v,v.getCustomData("maximize_saved_styles")),v.removeCustomData("maximize_saved_styles");CKEDITOR.env.ie?setTimeout(function(){u.$.scrollTo(l.x,l.y)},0):u.$.scrollTo(l.x,l.y),p.removeClass("cke_maximized"),CKEDITOR.env.webkit&&(p.setStyle("display","inline"),setTimeout(function(){p.setStyle("display","block")},0)),e.fire("resize")}this.toggleState();if(v=this.uiItems[0])d=this.state==CKEDITOR.TRISTATE_OFF?s.maximize.maximize:s.maximize.minimize,v=CKEDITOR.document.getById(v._.id),v.getChild(1).setHtml(d),v.setAttribute("title",d),v.setAttribute("href",'javascript:void("'+d+'");');e.mode=="wysiwyg"?a?(CKEDITOR.env.gecko&&i(e),e.getSelection().selectRanges(a),(m=e.getSelection().getStartElement())&&m.scrollIntoView(!0)):u.$.scrollTo(f.x,f.y):(a&&(m.selectionStart=a[0],m.selectionEnd=a[1]),m.scrollLeft=f[0],m.scrollTop=f[1]),a=f=null,h=this.state,e.fire("maximize",this.state)},canUndo:!1}),e.ui.addButton&&e.ui.addButton("Maximize",{label:s.maximize.maximize,command:"maximize",toolbar:"tools,10"}),e.on("mode",function(){var t=e.getCommand("maximize");t.setState(t.state==CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:h)},null,null,100)}}})}(),function(){function e(e,t,n){var r=CKEDITOR.cleanWord;return r?n():(e=CKEDITOR.getUrl(e.config.pasteFromWordCleanupFile||t+"filter/default.js"),CKEDITOR.scriptLoader.load(e,n,null,!0)),!r}function t(e){e.data.type="html"}CKEDITOR.plugins.add("pastefromword",{requires:"clipboard",init:function(n){var r=0,i=this.path;n.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(e){var n=this;r=1,e.once("beforePaste",t),e.getClipboardData({title:e.lang.pastefromword.title},function(t){t&&e.fire("paste",{type:"html",dataValue:t.dataValue}),e.fire("afterCommandExec",{name:"pastefromword",command:n,returnValue:!!t})})}}),n.ui.addButton&&n.ui.addButton("PasteFromWord",{label:n.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"}),n.on("pasteState",function(e){n.getCommand("pastefromword").setState(e.data)}),n.on("paste",function(t){var s=t.data,o=s.dataValue;if(o&&(r||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(o))){var u=e(n,i,function(){if(u)n.fire("paste",s);else if(!n.config.pasteFromWordPromptCleanup||r||confirm(n.lang.pastefromword.confirmCleanup))s.dataValue=CKEDITOR.cleanWord(o,n);r=0});u&&t.cancel()}},null,null,3)}})}(),function(){var e={canUndo:!1,async:!0,exec:function(t){t.getClipboardData({title:t.lang.pastetext.title},function(n){n&&t.fire("paste",{type:"text",dataValue:n.dataValue}),t.fire("afterCommandExec",{name:"pastetext",command:e,returnValue:!!n})})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(t){t.addCommand("pastetext",e),t.ui.addButton&&t.ui.addButton("PasteText",{label:t.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"}),t.config.forcePasteAsPlainText&&t.on("beforePaste",function(e){e.data.type!="html"&&(e.data.type="text")}),t.on("pasteState",function(e){t.getCommand("pastetext").setState(e.data)})}})}(),CKEDITOR.plugins.add("removeformat",{init:function(e){e.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat),e.ui.addButton&&e.ui.addButton("RemoveFormat",{label:e.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}}),CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(e){for(var t=e._.removeFormatRegex||(e._.removeFormatRegex=RegExp("^(?:"+e.config.removeFormatTags.replace(/,/g,"|")+")$","i")),n=e._.removeAttributes||(e._.removeAttributes=e.config.removeFormatAttributes.split(",")),r=CKEDITOR.plugins.removeformat.filter,i=e.getSelection().getRanges(),s=i.createIterator(),o=function(e){return e.type==CKEDITOR.NODE_ELEMENT},u;u=s.getNextRange();){u.collapsed||u.enlarge(CKEDITOR.ENLARGE_ELEMENT);var a=u.createBookmark(),f=a.startNode,l=a.endNode,c=function(n){for(var i=e.elementPath(n),s=i.elements,o=1,u;u=s[o];o++){if(u.equals(i.block)||u.equals(i.blockLimit))break;t.test(u.getName())&&r(e,u)&&n.breakParent(u)}};c(f);if(l){c(l);for(f=f.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);f;){if(f.equals(l))break;if(f.isReadOnly()){if(f.getPosition(l)&CKEDITOR.POSITION_CONTAINS)break;f=f.getNext(o)}else c=f.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),(f.getName()!="img"||!f.data("cke-realelement"))&&r(e,f)&&(t.test(f.getName())?f.remove(1):(f.removeAttributes(n),e.fire("removeFormatCleanup",f))),f=c}}u.moveToBookmark(a)}e.forceNextSelectionCheck(),e.getSelection().selectRanges(i)}}},filter:function(e,t){for(var n=e._.removeFormatFilters||[],r=0;r<n.length;r++)if(n[r](t)===!1)return!1;return!0}},CKEDITOR.editor.prototype.addRemoveFormatFilter=function(e){this._.removeFormatFilters||(this._.removeFormatFilters=[]),this._.removeFormatFilters.push(e)},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",CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign",CKEDITOR.plugins.add("resize",{init:function(e){function s(s){var o=t,a=n,l=o+(s.data.$.screenX-r)*(f=="rtl"?-1:1),s=a+(s.data.$.screenY-i);c&&(o=Math.max(u.resize_minWidth,Math.min(l,u.resize_maxWidth))),h&&(a=Math.max(u.resize_minHeight,Math.min(s,u.resize_maxHeight))),e.resize(c?o:null,a)}function o(){CKEDITOR.document.removeListener("mousemove",s),CKEDITOR.document.removeListener("mouseup",o),e.document&&(e.document.removeListener("mousemove",s),e.document.removeListener("mouseup",o))}var t,n,r,i,u=e.config,a=e.ui.spaceId("resizer"),f=e.element?e.element.getDirection(1):"ltr";!u.resize_dir&&(u.resize_dir="vertical"),u.resize_maxWidth===void 0&&(u.resize_maxWidth=3e3),u.resize_maxHeight===void 0&&(u.resize_maxHeight=3e3),u.resize_minWidth===void 0&&(u.resize_minWidth=750),u.resize_minHeight===void 0&&(u.resize_minHeight=250);if(u.resize_enabled!==!1){var l=null,c=(u.resize_dir=="both"||u.resize_dir=="horizontal")&&u.resize_minWidth!=u.resize_maxWidth,h=(u.resize_dir=="both"||u.resize_dir=="vertical")&&u.resize_minHeight!=u.resize_maxHeight,p=CKEDITOR.tools.addFunction(function(a){l||(l=e.getResizable()),t=l.$.offsetWidth||0,n=l.$.offsetHeight||0,r=a.screenX,i=a.screenY,u.resize_minWidth>t&&(u.resize_minWidth=t),u.resize_minHeight>n&&(u.resize_minHeight=n),CKEDITOR.document.on("mousemove",s),CKEDITOR.document.on("mouseup",o),e.document&&(e.document.on("mousemove",s),e.document.on("mouseup",o)),a.preventDefault&&a.preventDefault()});e.on("destroy",function(){CKEDITOR.tools.removeFunction(p)}),e.on("uiSpace",function(t){if(t.data.space=="bottom"){var n="";c&&!h&&(n=" cke_resizer_horizontal"),!c&&h&&(n=" cke_resizer_vertical");var r='<span id="'+a+'" class="cke_resizer'+n+" cke_resizer_"+f+'" title="'+CKEDITOR.tools.htmlEncode(e.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+p+', event)">'+(f=="ltr"?"◢":"◣")+"</span>";f=="ltr"&&n=="ltr"?t.data.html=t.data.html+r:t.data.html=r+t.data.html}},e,null,100),e.on("maximize",function(t){e.ui.space("resizer")[t.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}}),CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var e=function(e){var t=this._,n=t.menu;t.state!==CKEDITOR.TRISTATE_DISABLED&&(t.on&&n?n.hide():(t.previousState=t.state,n||(n=t.menu=new CKEDITOR.menu(e,{panel:{className:"cke_menu_panel",attributes:{"aria-label":e.lang.common.options}}}),n.onHide=CKEDITOR.tools.bind(function(){var n=this.command?e.getCommand(this.command).modes:this.modes;this.setState(!n||n[e.mode]?t.previousState:CKEDITOR.TRISTATE_DISABLED),t.on=0},this),this.onMenu&&n.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),t.on=1,setTimeout(function(){n.show(CKEDITOR.document.getById(t.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(t){delete t.panel,this.base(t),this.hasArrow=!0,this.click=e},statics:{handler:{create:function(e){return new CKEDITOR.ui.menuButton(e)}}}})},beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}}),CKEDITOR.UI_MENUBUTTON="menubutton","use strict",CKEDITOR.plugins.add("scayt",{requires:"menubutton,dialog",tabToOpen:null,dialogName:"scaytDialog",init:function(e){var t=this,n=CKEDITOR.plugins.scayt;this.bindEvents(e),this.parseConfig(e),this.addRule(e),CKEDITOR.dialog.add(this.dialogName,CKEDITOR.getUrl(this.path+"dialogs/options.js")),this.addMenuItems(e);var r=e.lang.scayt,i=CKEDITOR.env;e.ui.add("Scayt",CKEDITOR.UI_MENUBUTTON,{label:r.text_title,title:e.plugins.wsc?e.lang.wsc.title:r.text_title,modes:{wysiwyg:!i.ie||!(i.version<8||i.quirks)},toolbar:"spellchecker,20",refresh:function(){var t=e.ui.instances.Scayt.getState();e.scayt&&(t=n.state[e.name]?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),e.fire("scaytButtonState",t)},onRender:function(){var t=this;e.on("scaytButtonState",function(e){typeof e.data!==void 0&&t.setState(e.data)})},onMenu:function(){var t=e.scayt;return e.getMenuItem("scaytToggle").label=e.lang.scayt[t&&n.state[e.name]?"btn_disable":"btn_enable"],t={scaytToggle:CKEDITOR.TRISTATE_OFF,scaytOptions:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytLangs:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytDict:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,WSC:e.plugins.wsc?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED},e.config.scayt_uiTabs[0]||delete t.scaytOptions,e.config.scayt_uiTabs[1]||delete t.scaytLangs,e.config.scayt_uiTabs[2]||delete t.scaytDict,t}}),e.contextMenu&&e.addMenuItems&&(e.contextMenu.addListener(function(){var n=e.scayt,r;if(n){var i=n.getSelectionNode();if(i=i?i.getAttribute(n.getNodeAttribute()):i)r=t.menuGenerator(e,i,t),n.showBanner("."+e.contextMenu._.definition.panel.className.split(" ").join(" ."))}return r}),e.contextMenu._.onHide=CKEDITOR.tools.override(e.contextMenu._.onHide,function(t){return function(){var n=e.scayt;return n&&n.hideBanner(),t.apply(this)}}))},addMenuItems:function(e){var t=this,n=CKEDITOR.plugins.scayt;e.addMenuGroup("scaytButton");var r=e.config.scayt_contextMenuItemsOrder.split("|");if(r&&r.length)for(var i=0;i<r.length;i++)e.addMenuGroup("scayt_"+r[i],i-10);r={scaytToggle:{label:e.lang.scayt.btn_enable,group:"scaytButton",onClick:function(){var t=e.scayt;n.state[e.name]=!n.state[e.name],n.state[e.name]===!0?t||n.createScayt(e):t&&n.destroy(e)}},scaytAbout:{label:e.lang.scayt.btn_about,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="about",e.lockSelection(),e.openDialog(t.dialogName)}},scaytOptions:{label:e.lang.scayt.btn_options,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="options",e.lockSelection(),e.openDialog(t.dialogName)}},scaytLangs:{label:e.lang.scayt.btn_langs,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="langs",e.lockSelection(),e.openDialog(t.dialogName)}},scaytDict:{label:e.lang.scayt.btn_dictionaries,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="dictionaries",e.lockSelection(),e.openDialog(t.dialogName)}}},e.plugins.wsc&&(r.WSC={label:e.lang.wsc.toolbar,group:"scaytButton",onClick:function(){var t=CKEDITOR.plugins.scayt,n=e.scayt,r=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.container.getText():e.document.getBody().getText();(r=r.replace(/\s/g,""))?(n&&t.state[e.name]&&n.setMarkupPaused&&n.setMarkupPaused(!0),e.lockSelection(),e.execCommand("checkspell")):alert("Nothing to check!")}}),e.addMenuItems(r)},bindEvents:function(e){function t(){var t=e.scayt;t&&(t.removeMarkupInSelectionNode(),t.fire("startSpellCheck"))}var n=CKEDITOR.plugins.scayt,r=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE;CKEDITOR.on("dialogDefinition",function(e){e.data.name==="scaytDialog"&&e.data.definition.dialog.on("cancel",function(){return!1},this,null,-1)});var i=function(){e.scayt&&n.destroy(e)},s=function(){n.state[e.name]&&!e.readOnly&&n.createScayt(e)},o=function(){var t=e.editable();t.attachListener(t,"focus",function(){var t=CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state[e.name]&&e.scayt,n,i;if((r||t)&&e._.savedSelection)for(var t=e._.savedSelection.getSelectedElement(),t=!t&&e._.savedSelection.getRanges(),s=0;s<t.length;s++)i=t[s],n=i.startContainer.getText().length,(n<i.startOffset||n<i.endOffset)&&e.unlockSelection(!1)},this,null,-10)},u=function(){r?(e.on("blur",i),e.on("focus",s),e.focusManager.hasFocus&&s()):s(),o()};e.on("contentDom",u),e.on("beforeCommandExec",function(t){var r;if(t.data.name in n.options.disablingCommandExec&&e.mode=="wysiwyg"){if(r=e.scayt)n.destroy(e),e.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED)}else if(t.data.name==="bold"||t.data.name==="italic"||t.data.name==="underline"||t.data.name==="strike"||t.data.name==="subscript"||t.data.name==="superscript")if(r=e.scayt)r.removeMarkupInSelectionNode(),setTimeout(function(){r.fire("startSpellCheck")},0)}),e.on("beforeSetMode",function(t){if(t.data=="source"){if(t=e.scayt)n.destroy(e),e.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED);e.document&&(e.document.getBody().removeAttribute("_jquid"),e.document.getBody().removeAttribute("dir"))}}),e.on("afterCommandExec",function(t){var n;e.mode=="wysiwyg"&&(t.data.name=="undo"||t.data.name=="redo")&&(n=e.scayt)&&setTimeout(function(){n.fire("startSpellCheck")},250)}),e.on("readOnly",function(t){var r;t&&(r=e.scayt,t.editor.readOnly===!0?r&&r.fire("removeMarkupInDocument",{}):r?r.fire("startSpellCheck"):t.editor.mode=="wysiwyg"&&n.state[t.editor.name]===!0&&(n.createScayt(e),t.editor.fire("scaytButtonState",CKEDITOR.TRISTATE_ON)))}),e.on("beforeDestroy",i),e.on("setData",function(){i(),e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&u()},this,null,50),e.on("insertElement",function(){CKEDITOR.env.ie?setTimeout(function(){t()},50):t()},this,null,50),e.on("insertHtml",function(){t()},this,null,50),e.on("insertText",function(){t()},this,null,50),e.on("scaytDialogShown",function(t){t.data.selectPage(e.scayt.tabToOpen)})},parseConfig:function(e){var t=CKEDITOR.plugins.scayt;t.replaceOldOptionsNames(e.config),typeof e.config.scayt_autoStartup!="boolean"&&(e.config.scayt_autoStartup=!1),t.state[e.name]=e.config.scayt_autoStartup,e.config.scayt_contextCommands||(e.config.scayt_contextCommands="ignore|ignoreall|add"),e.config.scayt_contextMenuItemsOrder||(e.config.scayt_contextMenuItemsOrder="suggest|moresuggest|control"),e.config.scayt_sLang||(e.config.scayt_sLang="en_US");if(e.config.scayt_maxSuggestions===void 0||typeof e.config.scayt_maxSuggestions!="number"||e.config.scayt_maxSuggestions<0)e.config.scayt_maxSuggestions=5;if(e.config.scayt_customDictionaryIds===void 0||typeof e.config.scayt_customDictionaryIds!="string")e.config.scayt_customDictionaryIds="";if(e.config.scayt_userDictionaryName===void 0||typeof e.config.scayt_userDictionaryName!="string")e.config.scayt_userDictionaryName=null;if(typeof e.config.scayt_uiTabs=="string"&&e.config.scayt_uiTabs.split(",").length===3){var n=[],r=[];e.config.scayt_uiTabs=e.config.scayt_uiTabs.split(","),CKEDITOR.tools.search(e.config.scayt_uiTabs,function(e){Number(e)===1||Number(e)===0?(r.push(!0),n.push(Number(e))):r.push(!1)}),e.config.scayt_uiTabs=CKEDITOR.tools.search(r,!1)===null?n:[1,1,1]}else e.config.scayt_uiTabs=[1,1,1];typeof e.config.scayt_serviceProtocol!="string"&&(e.config.scayt_serviceProtocol=null),typeof e.config.scayt_serviceHost!="string"&&(e.config.scayt_serviceHost=null),typeof e.config.scayt_servicePort!="string"&&(e.config.scayt_servicePort=null),typeof e.config.scayt_servicePath!="string"&&(e.config.scayt_servicePath=null),e.config.scayt_moreSuggestions||(e.config.scayt_moreSuggestions="on"),typeof e.config.scayt_customerId!="string"&&(e.config.scayt_customerId="1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2"),typeof e.config.scayt_srcUrl!="string"&&(t=document.location.protocol,t=t.search(/https?:/)!=-1?t:"http:",e.config.scayt_srcUrl=t+"//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js"),typeof CKEDITOR.config.scayt_handleCheckDirty!="boolean"&&(CKEDITOR.config.scayt_handleCheckDirty=!0),typeof CKEDITOR.config.scayt_handleUndoRedo!="boolean"&&(CKEDITOR.config.scayt_handleUndoRedo=!0);if(e.config.scayt_disableOptionsStorage){var t=CKEDITOR.tools.isArray(e.config.scayt_disableOptionsStorage)?e.config.scayt_disableOptionsStorage:typeof e.config.scayt_disableOptionsStorage=="string"?[e.config.scayt_disableOptionsStorage]:void 0,i=["all","options","lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],s=["lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],o=CKEDITOR.tools.search,u=CKEDITOR.tools.indexOf;e.config.scayt_disableOptionsStorage=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],a=!!o(e,"options");if(!o(i,r)||a&&o(s,function(e){if(e==="lang")return!1}))return;o(s,r)&&s.splice(u(s,r),1);if(r==="all"||a&&o(e,"lang"))return[];r==="options"&&(s=["lang"])}return t=t.concat(s)}(t)}},addRule:function(e){var t=e.dataProcessor,n=t&&t.htmlFilter,r=e._.elementsPath&&e._.elementsPath.filters,t=t&&t.dataFilter,i=e.addRemoveFormatFilter,s=function(t){var n=CKEDITOR.plugins.scayt;if(e.scayt&&t.hasAttribute(n.options.data_attribute_name))return!1},o=function(t){var n=CKEDITOR.plugins.scayt,r=!0;return e.scayt&&t.hasAttribute(n.options.data_attribute_name)&&(r=!1),r};r&&r.push(s),t&&t.addRules({elements:{span:function(t){var n=CKEDITOR.plugins.scayt;return n&&n.state[e.name]&&t.classes&&CKEDITOR.tools.search(t.classes,n.options.misspelled_word_class)&&(t.classes&&t.parent.type===CKEDITOR.NODE_DOCUMENT_FRAGMENT?(delete t.attributes.style,delete t.name):delete t.classes[CKEDITOR.tools.indexOf(t.classes,n.options.misspelled_word_class)]),t}}}),n&&n.addRules({elements:{span:function(t){var n=CKEDITOR.plugins.scayt;return n&&n.state[e.name]&&t.hasClass(n.options.misspelled_word_class)&&t.attributes[n.options.data_attribute_name]&&(t.removeClass(n.options.misspelled_word_class),delete t.attributes[n.options.data_attribute_name],delete t.name),t}}}),i&&i.call(e,o)},scaytMenuDefinition:function(e){var t=this,e=e.scayt;return{scayt_ignore:{label:e.getLocal("btn_ignore"),group:"scayt_control",order:1,exec:function(e){e.scayt.ignoreWord()}},scayt_ignoreall:{label:e.getLocal("btn_ignoreAll"),group:"scayt_control",order:2,exec:function(e){e.scayt.ignoreAllWords()}},scayt_add:{label:e.getLocal("btn_addWord"),group:"scayt_control",order:3,exec:function(e){var t=e.scayt;setTimeout(function(){t.addWordToUserDictionary()},10)}},option:{label:e.getLocal("btn_options"),group:"scayt_control",order:4,exec:function(e){e.scayt.tabToOpen="options",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return e.config.scayt_uiTabs[0]==1?!0:!1}},language:{label:e.getLocal("btn_langs"),group:"scayt_control",order:5,exec:function(e){e.scayt.tabToOpen="langs",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return e.config.scayt_uiTabs[1]==1?!0:!1}},dictionary:{label:e.getLocal("btn_dictionaries"),group:"scayt_control",order:6,exec:function(e){e.scayt.tabToOpen="dictionaries",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return e.config.scayt_uiTabs[2]==1?!0:!1}},about:{label:e.getLocal("btn_about"),group:"scayt_control",order:7,exec:function(e){e.scayt.tabToOpen="about",e.lockSelection(),e.openDialog(t.dialogName)}}}},buildSuggestionMenuItems:function(e,t){var n={},r={},i=e.scayt;if(t.length>0&&t[0]!=="no_any_suggestions")for(var s=0;s<t.length;s++){var o="scayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[s].replace(" ","_");e.addCommand(o,this.createCommand(CKEDITOR.plugins.scayt.suggestions[s])),s<e.config.scayt_maxSuggestions?(e.addMenuItem(o,{label:t[s],command:o,group:"scayt_suggest",order:s+1}),n[o]=CKEDITOR.TRISTATE_OFF):(e.addMenuItem(o,{label:t[s],command:o,group:"scayt_moresuggest",order:s+1}),r[o]=CKEDITOR.TRISTATE_OFF,e.config.scayt_moreSuggestions==="on"&&(e.addMenuItem("scayt_moresuggest",{label:i.getLocal("btn_moreSuggestions"),group:"scayt_moresuggest",order:10,getItems:function(){return r}}),n.scayt_moresuggest=CKEDITOR.TRISTATE_OFF))}else n.no_scayt_suggest=CKEDITOR.TRISTATE_DISABLED,e.addCommand("no_scayt_suggest",{exec:function(){}}),e.addMenuItem("no_scayt_suggest",{label:i.getLocal("btn_noSuggestions")||"no_scayt_suggest",command:"no_scayt_suggest",group:"scayt_suggest",order:0});return n},menuGenerator:function(e,t){var n=e.scayt,r=this.scaytMenuDefinition(e),i={},s=e.config.scayt_contextCommands.split("|");n.fire("getSuggestionsList",{lang:n.getLang(),word:t}),i=this.buildSuggestionMenuItems(e,CKEDITOR.plugins.scayt.suggestions);if(e.config.scayt_contextCommands=="off")return i;for(var o in r)if(CKEDITOR.tools.indexOf(s,o.replace("scayt_",""))!=-1||e.config.scayt_contextCommands=="all")i[o]=CKEDITOR.TRISTATE_OFF,typeof r[o].verification=="function"&&!r[o].verification(e)&&delete i[o],e.addCommand(o,{exec:r[o].exec}),e.addMenuItem(o,{label:e.lang.scayt[r[o].label]||r[o].label,command:o,group:r[o].group,order:r[o].order});return i},createCommand:function(e){return{exec:function(t){t.scayt.replaceSelectionNode({word:e})}}}}),CKEDITOR.plugins.scayt={state:{},suggestions:[],loadingHelper:{loadOrder:[]},isLoading:!1,options:{disablingCommandExec:{source:!0,newpage:!0,templates:!0},data_attribute_name:"data-scayt-word",misspelled_word_class:"scayt-misspell-word"},backCompatibilityMap:{scayt_service_protocol:"scayt_serviceProtocol",scayt_service_host:"scayt_serviceHost",scayt_service_port:"scayt_servicePort",scayt_service_path:"scayt_servicePath",scayt_customerid:"scayt_customerId"},replaceOldOptionsNames:function(e){for(var t in e)t in this.backCompatibilityMap&&(e[this.backCompatibilityMap[t]]=e[t],delete e[t])},createScayt:function(e){var t=this;this.loadScaytLibrary(e,function(e){var n={lang:e.config.scayt_sLang,container:e.editable().$.nodeName=="BODY"?e.document.getWindow().$.frameElement:e.editable().$,customDictionary:e.config.scayt_customDictionaryIds,userDictionaryName:e.config.scayt_userDictionaryName,localization:e.langCode,customer_id:e.config.scayt_customerId,debug:e.config.scayt_debug,data_attribute_name:t.options.data_attribute_name,misspelled_word_class:t.options.misspelled_word_class,"options-to-restore":e.config.scayt_disableOptionsStorage,focused:e.editable().hasFocus,ignoreElementsRegex:e.config.scayt_elementsToIgnore};e.config.scayt_serviceProtocol&&(n.service_protocol=e.config.scayt_serviceProtocol),e.config.scayt_serviceHost&&(n.service_host=e.config.scayt_serviceHost),e.config.scayt_servicePort&&(n.service_port=e.config.scayt_servicePort),e.config.scayt_servicePath&&(n.service_path=e.config.scayt_servicePath),n=new SCAYT.CKSCAYT(n,function(){},function(){}),n.subscribe("suggestionListSend",function(e){for(var t={},n=[],r=0;r<e.suggestionList.length;r++)t["word_"+e.suggestionList[r]]||(t["word_"+e.suggestionList[r]]=e.suggestionList[r],n.push(e.suggestionList[r]));CKEDITOR.plugins.scayt.suggestions=n}),e.scayt=n,e.fire("scaytButtonState",e.readOnly?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_ON)})},destroy:function(e){e.scayt&&e.scayt.destroy(),delete e.scayt,e.fire("scaytButtonState",CKEDITOR.TRISTATE_OFF)},loadScaytLibrary:function(e,t){var n=this;typeof window.SCAYT=="undefined"||typeof window.SCAYT.CKSCAYT!="function"?(this.loadingHelper[e.name]=t,this.loadingHelper.loadOrder.push(e.name),CKEDITOR.scriptLoader.load(e.config.scayt_srcUrl,function(){var e;CKEDITOR.fireOnce("scaytReady");for(var t=0;t<n.loadingHelper.loadOrder.length;t++)e=n.loadingHelper.loadOrder[t],typeof n.loadingHelper[e]=="function"&&n.loadingHelper[e](CKEDITOR.instances[e]),delete n.loadingHelper[e];n.loadingHelper.loadOrder=[]})):window.SCAYT&&typeof window.SCAYT.CKSCAYT=="function"&&(CKEDITOR.fireOnce("scaytReady"),e.scayt||typeof t=="function"&&t(e))}},CKEDITOR.on("scaytReady",function(){if(CKEDITOR.config.scayt_handleCheckDirty===!0){var e=CKEDITOR.editor.prototype;e.checkDirty=CKEDITOR.tools.override(e.checkDirty,function(e){return function(){var t=null,n=this.scayt;if(!CKEDITOR.plugins.scayt||!CKEDITOR.plugins.scayt.state[this.name]||!this.scayt)t=e.call(this);else if(t=this.status=="ready")var r=n.removeMarkupFromString(this.getSnapshot()),n=n.removeMarkupFromString(this._.previousValue),t=t&&n!==r;return t}}),e.resetDirty=CKEDITOR.tools.override(e.resetDirty,function(e){return function(){var t=this.scayt;!CKEDITOR.plugins.scayt||!CKEDITOR.plugins.scayt.state[this.name]||!this.scayt?e.call(this):this._.previousValue=t.removeMarkupFromString(this.getSnapshot())}})}if(CKEDITOR.config.scayt_handleUndoRedo===!0){var e=CKEDITOR.plugins.undo.Image.prototype,t=typeof e.equalsContent=="function"?"equalsContent":"equals";e[t]=CKEDITOR.tools.override(e[t],function(e){return function(t){var n=t.editor.scayt,r=this.contents,i=t.contents,s=null;return CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state[t.editor.name]&&t.editor.scayt&&(this.contents=n.removeMarkupFromString(r)||"",t.contents=n.removeMarkupFromString(i)||""),s=e.apply(this,arguments),this.contents=r,t.contents=i,s}})}}),function(){var e={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(e){this.toggleState(),this.refresh(e)},refresh:function(e){if(e.document){var t=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";e.editable()[t]("cke_show_borders")}}};CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var e;e=(CKEDITOR.env.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:[".%1 table.%2,",".%1 table.%2 > tr > td, .%1 table.%2 > tr > th,",".%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,",".%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,",".%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th","{","border : #d3d3d3 1px dotted","}"]).join("").replace(/%2/g,"cke_show_border").replace(/%1/g,"cke_show_borders "),CKEDITOR.addCss(e)},init:function(t){var n=t.addCommand("showborders",e);n.canUndo=!1,t.config.startupShowBorders!==!1&&n.setState(CKEDITOR.TRISTATE_ON),t.on("mode",function(){n.state!=CKEDITOR.TRISTATE_DISABLED&&n.refresh(t)},null,null,100),t.on("contentDom",function(){n.state!=CKEDITOR.TRISTATE_DISABLED&&n.refresh(t)}),t.on("removeFormatCleanup",function(e){e=e.data,t.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&e.is("table")&&(!e.hasAttribute("border")||parseInt(e.getAttribute("border"),10)<=0)&&e.addClass("cke_show_border")})},afterInit:function(e){var t=e.dataProcessor,e=t&&t.dataFilter,t=t&&t.htmlFilter;e&&e.addRules({elements:{table:function(e){var e=e.attributes,t=e["class"],n=parseInt(e.border,10);(!n||n<=0)&&(!t||t.indexOf("cke_show_border")==-1)&&(e["class"]=(t||"")+" cke_show_border")}}}),t&&t.addRules({elements:{table:function(e){var e=e.attributes,t=e["class"];t&&(e["class"]=t.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/,""))}}})}}),CKEDITOR.on("dialogDefinition",function(e){var t=e.data.name;if(t=="table"||t=="tableProperties"){e=e.data.definition,t=e.getContents("info").get("txtBorder"),t.commit=CKEDITOR.tools.override(t.commit,function(e){return function(t,n){e.apply(this,arguments);var r=parseInt(this.getValue(),10);n[!r||r<=0?"addClass":"removeClass"]("cke_show_border")}});if(e=(e=e.getContents("advanced"))&&e.get("advCSSClasses"))e.setup=CKEDITOR.tools.override(e.setup,function(e){return function(){e.apply(this,arguments),this.setValue(this.getValue().replace(/cke_show_border/,""))}}),e.commit=CKEDITOR.tools.override(e.commit,function(e){return function(t,n){e.apply(this,arguments),parseInt(n.getAttribute("border"),10)||n.addClass("cke_show_border")}})}})}(),function(){CKEDITOR.plugins.add("sourcearea",{init:function(t){function n(){var e=i&&this.equals(CKEDITOR.document.getActive());this.hide(),this.setStyle("height",this.getParent().$.clientHeight+"px"),this.setStyle("width",this.getParent().$.clientWidth+"px"),this.show(),e&&this.focus()}if(t.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var r=CKEDITOR.plugins.sourcearea;t.addMode("source",function(r){var i=t.ui.space("contents").getDocument().createElement("textarea");i.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",t.config.sourceAreaTabSize||4))),i.setAttribute("dir","ltr"),i.addClass("cke_source cke_reset cke_enable_context_menu"),t.ui.space("contents").append(i),i=t.editable(new e(t,i)),i.setData(t.getData(1)),CKEDITOR.env.ie&&(i.attachListener(t,"resize",n,i),i.attachListener(CKEDITOR.document.getWindow(),"resize",n,i),CKEDITOR.tools.setTimeout(n,0,i)),t.fire("ariaWidget",this),r()}),t.addCommand("source",r.commands.source),t.ui.addButton&&t.ui.addButton("Source",{label:t.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"}),t.on("mode",function(){t.getCommand("source").setState(t.mode=="source"?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var i=CKEDITOR.env.ie&&CKEDITOR.env.version==9}}});var e=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(e){this.setValue(e),this.status="ready",this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(e){this[(e?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){e.baseProto.detach.call(this),this.clearCustomData(),this.remove()}}})}(),CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(e){e.mode=="wysiwyg"&&e.fire("saveSnapshot"),e.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED),e.setMode(e.mode=="source"?"wysiwyg":"source")},canUndo:!1}}},CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ru:1,si:1,sk:1,sl:1,sq:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(e){var t=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js"),e.addCommand("specialchar",{exec:function(){var n=e.langCode,n=t.availableLangs[n]?n:t.availableLangs[n.replace(/-.*/,"")]?n.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(t.path+"dialogs/lang/"+n+".js"),function(){CKEDITOR.tools.extend(e.lang.specialchar,t.langEntries[n]),e.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1}),e.ui.addButton&&e.ui.addButton("SpecialChar",{label:e.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}}),CKEDITOR.config.specialChars="! &quot; # $ % &amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ &euro; &lsquo; &rsquo; &ldquo; &rdquo; &ndash; &mdash; &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml; &copy; &ordf; &laquo; &not; &reg; &macr; &deg; &sup2; &sup3; &acute; &micro; &para; &middot; &cedil; &sup1; &ordm; &raquo; &frac14; &frac12; &frac34; &iquest; &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &times; &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; &divide; &oslash; &ugrave; &uacute; &ucirc; &uuml; &yacute; &thorn; &yuml; &OElig; &oelig; &#372; &#374 &#373 &#375; &sbquo; &#8219; &bdquo; &hellip; &trade; &#9658; &bull; &rarr; &rArr; &hArr; &diams; &asymp;".split(" "),function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(e){var t=e.config,n=e.lang.stylescombo,r={},i=[],s=[];e.on("stylesSet",function(n){if(n=n.data.styles){for(var o,u,f,l=0,h=n.length;l<h;l++){o=n[l];if(!(e.blockless&&o.element in CKEDITOR.dtd.$block)){u=o.name,o=new CKEDITOR.style(o);if(!e.filter.customConfig||e.filter.check(o))o._name=u,o._.enterMode=t.enterMode,o._.type=f=o.assignedTo||o.type,o._.weight=l+(f==CKEDITOR.STYLE_OBJECT?1:f==CKEDITOR.STYLE_BLOCK?2:3)*1e3,r[u]=o,i.push(o),s.push(o)}}i.sort(function(e,t){return e._.weight-t._.weight})}}),e.ui.addRichCombo("Styles",{label:n.label,title:n.panelTitle,toolbar:"styles,10",allowedContent:s,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(t.contentsCss),multiSelect:!0,attributes:{"aria-label":n.panelTitle}},init:function(){var e,t,r,s,o,u;o=0;for(u=i.length;o<u;o++)e=i[o],t=e._name,s=e._.type,s!=r&&(this.startGroup(n["panelTitle"+s]),r=s),this.add(t,e.type==CKEDITOR.STYLE_OBJECT?t:e.buildPreview(),t);this.commit()},onClick:function(t){e.focus(),e.fire("saveSnapshot");var t=r[t],n=e.elementPath();e[t.checkActive(n,e)?"removeStyle":"applyStyle"](t),e.fire("saveSnapshot")},onRender:function(){e.on("selectionChange",function(t){for(var n=this.getValue(),t=t.data.path.elements,i=0,s=t.length,o;i<s;i++){o=t[i];for(var u in r)if(r[u].checkElementRemovable(o,!0,e)){u!=n&&this.setValue(u);return}}this.setValue("")},this)},onOpen:function(){var t=e.getSelection().getSelectedElement(),t=e.elementPath(t),i=[0,0,0,0];this.showAll(),this.unmarkAll();for(var s in r){var o=r[s],u=o._.type;o.checkApplicable(t,e,e.activeFilter)?i[u]++:this.hideItem(s),o.checkActive(t,e)&&this.mark(s)}i[CKEDITOR.STYLE_BLOCK]||this.hideGroup(n["panelTitle"+CKEDITOR.STYLE_BLOCK]),i[CKEDITOR.STYLE_INLINE]||this.hideGroup(n["panelTitle"+CKEDITOR.STYLE_INLINE]),i[CKEDITOR.STYLE_OBJECT]||this.hideGroup(n["panelTitle"+CKEDITOR.STYLE_OBJECT])},refresh:function(){var t=e.elementPath();if(t){for(var n in r)if(r[n].checkApplicable(t,e,e.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){r={},i=[]}})}})}(),function(){function e(e){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(t){if(t.editable().hasFocus){var n=t.getSelection(),r;if(r=(new CKEDITOR.dom.elementPath(n.getCommonAncestor(),n.root)).contains({td:1,th:1},1)){var n=t.createRange(),i=CKEDITOR.tools.tryThese(function(){var t=r.getParent().$.cells[r.$.cellIndex+(e?-1:1)];return t.parentNode.parentNode,t},function(){var t=r.getParent(),t=t.getAscendant("table").$.rows[t.$.rowIndex+(e?-1:1)];return t.cells[e?t.cells.length-1:0]});if(!i&&!e){for(var s=r.getAscendant("table").$,i=r.getParent().$.cells,s=new CKEDITOR.dom.element(s.insertRow(-1),t.document),o=0,u=i.length;o<u;o++)s.append((new CKEDITOR.dom.element(i[o],t.document)).clone(!1,!1)).appendBogus();n.moveToElementEditStart(s)}else{if(!i)return!0;i=new CKEDITOR.dom.element(i),n.moveToElementEditStart(i),(!n.checkStartOfBlock()||!n.checkEndOfBlock())&&n.selectNodeContents(i)}return n.select(!0),!0}}return!1}}}var t={editorFocus:!1,modes:{wysiwyg:1,source:1}},n={exec:function(e){e.container.focusNext(!0,e.tabIndex)}},r={exec:function(e){e.container.focusPrevious(!0,e.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(i){for(var s=i.config.enableTabKeyTools!==!1,o=i.config.tabSpaces||0,u="";o--;)u+=" ";u&&i.on("key",function(e){e.data.keyCode==9&&(i.insertText(u),e.cancel())}),s&&i.on("key",function(e){(e.data.keyCode==9&&i.execCommand("selectNextCell")||e.data.keyCode==CKEDITOR.SHIFT+9&&i.execCommand("selectPreviousCell"))&&e.cancel()}),i.addCommand("blur",CKEDITOR.tools.extend(n,t)),i.addCommand("blurBack",CKEDITOR.tools.extend(r,t)),i.addCommand("selectNextCell",e()),i.addCommand("selectPreviousCell",e(!0))}})}(),CKEDITOR.dom.element.prototype.focusNext=function(e,t){var n=t===void 0?this.getTabIndex():t,r,i,s,o,u,a;if(n<=0)for(u=this.getNextSourceNode(e,CKEDITOR.NODE_ELEMENT);u;){if(u.isVisible()&&u.getTabIndex()===0){s=u;break}u=u.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(u=this.getDocument().getBody().getFirst();u=u.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!r)if(!i&&u.equals(this)){i=!0;if(e){if(!(u=u.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;r=1}}else i&&!this.contains(u)&&(r=1);if(u.isVisible()&&!((a=u.getTabIndex())<0)){if(r&&a==n){s=u;break}a>n&&(!s||!o||a<o)?(s=u,o=a):!s&&a===0&&(s=u,o=a)}}s&&s.focus()},CKEDITOR.dom.element.prototype.focusPrevious=function(e,t){for(var n=t===void 0?this.getTabIndex():t,r,i,s,o=0,u,a=this.getDocument().getBody().getLast();a=a.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!r)if(!i&&a.equals(this)){i=!0;if(e){if(!(a=a.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;r=1}}else i&&!this.contains(a)&&(r=1);if(a.isVisible()&&!((u=a.getTabIndex())<0))if(n<=0){if(r&&u===0){s=a;break}u>o&&(s=a,o=u)}else{if(r&&u==n){s=a;break}u<n&&(!s||u>o)&&(s=a,o=u)}}s&&s.focus()},CKEDITOR.plugins.add("table",{requires:"dialog",init:function(e){function t(e){return CKEDITOR.tools.extend(e||{},{contextSensitive:1,refresh:function(e,t){this.setState(t.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!e.blockless){var n=e.lang.table;e.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];"+(e.plugins.dialogadvtab?"table"+e.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"]]})),e.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",t())),e.addCommand("tableDelete",t({exec:function(e){var t=e.elementPath().contains("table",1);if(t){var n=t.getParent(),r=e.editable();n.getChildCount()==1&&!n.is("td","th")&&!n.equals(r)&&(t=n),e=e.createRange(),e.moveToPosition(t,CKEDITOR.POSITION_BEFORE_START),t.remove(),e.select()}}})),e.ui.addButton&&e.ui.addButton("Table",{label:n.toolbar,command:"table",toolbar:"insert,30"}),CKEDITOR.dialog.add("table",this.path+"dialogs/table.js"),CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js"),e.addMenuItems&&e.addMenuItems({table:{label:n.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:n.deleteTable,command:"tableDelete",group:"table",order:1}}),e.on("doubleclick",function(e){e.data.element.is("table")&&(e.data.dialog="tableProperties")}),e.contextMenu&&e.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}}),function(){function e(e){function t(e){!(n.length>0)&&e.type==CKEDITOR.NODE_ELEMENT&&h.test(e.getName())&&!e.getCustomData("selected_cell")&&(CKEDITOR.dom.element.setMarker(r,e,"selected_cell",!0),n.push(e))}for(var e=e.getRanges(),n=[],r={},i=0;i<e.length;i++){var s=e[i];if(s.collapsed)s=s.getCommonAncestor(),(s=s.getAscendant("td",!0)||s.getAscendant("th",!0))&&n.push(s);else{var s=new CKEDITOR.dom.walker(s),o;for(s.guard=t;o=s.next();)(o.type!=CKEDITOR.NODE_ELEMENT||!o.is(CKEDITOR.dtd.table))&&(o=o.getAscendant("td",!0)||o.getAscendant("th",!0))&&!o.getCustomData("selected_cell")&&(CKEDITOR.dom.element.setMarker(r,o,"selected_cell",!0),n.push(o))}}return CKEDITOR.dom.element.clearAllMarkers(r),n}function t(t,n){for(var r=e(t),i=r[0],s=i.getAscendant("table"),i=i.getDocument(),o=r[0].getParent(),u=o.$.rowIndex,r=r[r.length-1],a=r.getParent().$.rowIndex+r.$.rowSpan-1,r=new CKEDITOR.dom.element(s.$.rows[a]),u=n?u:a,o=n?o:r,r=CKEDITOR.tools.buildTableMap(s),s=r[u],u=n?r[u-1]:r[u+1],r=r[0].length,i=i.createElement("tr"),a=0;s[a]&&a<r;a++){var f;s[a].rowSpan>1&&u&&s[a]==u[a]?(f=s[a],f.rowSpan=f.rowSpan+1):(f=(new CKEDITOR.dom.element(s[a])).clone(),f.removeAttribute("rowSpan"),f.appendBogus(),i.append(f),f=f.$),a+=f.colSpan-1}n?i.insertBefore(o):i.insertAfter(o)}function n(t){if(t instanceof CKEDITOR.dom.selection){for(var r=e(t),i=r[0].getAscendant("table"),s=CKEDITOR.tools.buildTableMap(i),t=r[0].getParent().$.rowIndex,r=r[r.length-1],o=r.getParent().$.rowIndex+r.$.rowSpan-1,r=[],u=t;u<=o;u++){for(var a=s[u],f=new CKEDITOR.dom.element(i.$.rows[u]),l=0;l<a.length;l++){var c=new CKEDITOR.dom.element(a[l]),h=c.getParent().$.rowIndex;c.$.rowSpan==1?c.remove():(c.$.rowSpan=c.$.rowSpan-1,h==u&&(h=s[u+1],h[l-1]?c.insertAfter(new CKEDITOR.dom.element(h[l-1])):(new CKEDITOR.dom.element(i.$.rows[u+1])).append(c,1))),l+=c.$.colSpan-1}r.push(f)}s=i.$.rows,i=new CKEDITOR.dom.element(s[o+1]||(t>0?s[t-1]:null)||i.$.parentNode);for(u=r.length;u>=0;u--)n(r[u]);return i}return t instanceof CKEDITOR.dom.element&&(i=t.getAscendant("table"),i.$.rows.length==1?i.remove():t.remove()),null}function r(e,t){for(var n=t?Infinity:0,r=0;r<e.length;r++){var i;i=e[r];for(var s=t,o=i.getParent().$.cells,u=0,a=0;a<o.length;a++){var f=o[a],u=u+(s?1:f.colSpan);if(f==i.$)break}i=u-1;if(t?i<n:i>n)n=i}return n}function i(t,n){for(var i=e(t),s=i[0].getAscendant("table"),o=r(i,1),i=r(i),o=n?o:i,u=CKEDITOR.tools.buildTableMap(s),s=[],i=[],a=u.length,f=0;f<a;f++)s.push(u[f][o]),i.push(n?u[f][o-1]:u[f][o+1]);for(f=0;f<a;f++)s[f]&&(s[f].colSpan>1&&i[f]==s[f]?(o=s[f],o.colSpan=o.colSpan+1):(o=(new CKEDITOR.dom.element(s[f])).clone(),o.removeAttribute("colSpan"),o.appendBogus(),o[n?"insertBefore":"insertAfter"].call(o,new CKEDITOR.dom.element(s[f])),o=o.$),f+=o.rowSpan-1)}function s(e,t){var n=e.getStartElement();if(n=n.getAscendant("td",1)||n.getAscendant("th",1)){var r=n.clone();r.appendBogus(),t?r.insertBefore(n):r.insertAfter(n)}}function o(t){if(t instanceof CKEDITOR.dom.selection){var t=e(t),n=t[0]&&t[0].getAscendant("table"),r;e:{var i=0;r=t.length-1;for(var s={},a,f;a=t[i++];)CKEDITOR.dom.element.setMarker(s,a,"delete_cell",!0);for(i=0;a=t[i++];)if((f=a.getPrevious())&&!f.getCustomData("delete_cell")||(f=a.getNext())&&!f.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(s),r=f;break e}CKEDITOR.dom.element.clearAllMarkers(s),f=t[0].getParent(),(f=f.getPrevious())?r=f.getLast():(f=t[r].getParent(),r=(f=f.getNext())?f.getChild(0):null)}for(f=t.length-1;f>=0;f--)o(t[f]);r?u(r,!0):n&&n.remove()}else t instanceof CKEDITOR.dom.element&&(n=t.getParent(),n.getChildCount()==1?n.remove():t.remove())}function u(e,t){var n=e.getDocument(),r=CKEDITOR.document;CKEDITOR.env.ie&&CKEDITOR.env.version==10&&(r.focus(),n.focus()),n=new CKEDITOR.dom.range(n),n["moveToElementEdit"+(t?"End":"Start")](e)||(n.selectNodeContents(e),n.collapse(t?!1:!0)),n.select(!0)}function a(e,t,n){e=e[t];if(typeof n=="undefined")return e;for(t=0;e&&t<e.length;t++){if(n.is&&e[t]==n.$)return t;if(t==n)return new CKEDITOR.dom.element(e[t])}return n.is?-1:null}function f(t,n,r){var i=e(t),s;if((n?i.length!=1:i.length<2)||(s=t.getCommonAncestor())&&s.type==CKEDITOR.NODE_ELEMENT&&s.is("table"))return!1;var o,t=i[0];s=t.getAscendant("table");var u=CKEDITOR.tools.buildTableMap(s),f=u.length,l=u[0].length,c=t.getParent().$.rowIndex,h=a(u,c,t);if(n){var p;try{var d=parseInt(t.getAttribute("rowspan"),10)||1;o=parseInt(t.getAttribute("colspan"),10)||1,p=u[n=="up"?c-d:n=="down"?c+d:c][n=="left"?h-o:n=="right"?h+o:h]}catch(v){return!1}if(!p||t.$==p)return!1;i[n=="up"||n=="left"?"unshift":"push"](new CKEDITOR.dom.element(p))}for(var n=t.getDocument(),m=c,d=p=0,g=!r&&new CKEDITOR.dom.documentFragment(n),y=0,n=0;n<i.length;n++){o=i[n];var b=o.getParent(),w=o.getFirst(),E=o.$.colSpan,S=o.$.rowSpan,b=b.$.rowIndex,x=a(u,b,o),y=y+E*S,d=Math.max(d,x-h+E);p=Math.max(p,b-c+S),r||(E=o,(S=E.getBogus())&&S.remove(),E.trim(),o.getChildren().count()&&(b!=m&&w&&(!w.isBlockBoundary||!w.isBlockBoundary({br:1}))&&(m=g.getLast(CKEDITOR.dom.walker.whitespaces(!0)))&&(!m.is||!m.is("br"))&&g.append("br"),o.moveChildren(g)),n?o.remove():o.setHtml("")),m=b}if(r)return p*d==y;g.moveChildren(t),t.appendBogus(),d>=l?t.removeAttribute("rowSpan"):t.$.rowSpan=p,p>=f?t.removeAttribute("colSpan"):t.$.colSpan=d,r=new CKEDITOR.dom.nodeList(s.$.rows),i=r.count();for(n=i-1;n>=0;n--)s=r.getItem(n),s.$.cells.length||(s.remove(),i++);return t}function l(t,n){var r=e(t);if(r.length>1)return!1;if(n)return!0;var r=r[0],i=r.getParent(),s=i.getAscendant("table"),o=CKEDITOR.tools.buildTableMap(s),u=i.$.rowIndex,f=a(o,u,r),l=r.$.rowSpan,c;if(l>1){c=Math.ceil(l/2);for(var l=Math.floor(l/2),i=u+c,s=new CKEDITOR.dom.element(s.$.rows[i]),o=a(o,i),h,i=r.clone(),u=0;u<o.length;u++){h=o[u];if(h.parentNode==s.$&&u>f){i.insertBefore(new CKEDITOR.dom.element(h));break}h=null}h||s.append(i)}else{l=c=1,s=i.clone(),s.insertAfter(i),s.append(i=r.clone()),h=a(o,u);for(f=0;f<h.length;f++)h[f].rowSpan++}return i.appendBogus(),r.$.rowSpan=c,i.$.rowSpan=l,c==1&&r.removeAttribute("rowSpan"),l==1&&i.removeAttribute("rowSpan"),i}function c(t,n){var r=e(t);if(r.length>1)return!1;if(n)return!0;var r=r[0],i=r.getParent(),s=i.getAscendant("table"),s=CKEDITOR.tools.buildTableMap(s),o=a(s,i.$.rowIndex,r),u=r.$.colSpan;if(u>1)i=Math.ceil(u/2),u=Math.floor(u/2);else{for(var u=i=1,f=[],l=0;l<s.length;l++){var c=s[l];f.push(c[o]),c[o].rowSpan>1&&(l+=c[o].rowSpan-1)}for(s=0;s<f.length;s++)f[s].colSpan++}return s=r.clone(),s.insertAfter(r),s.appendBogus(),r.$.colSpan=i,s.$.colSpan=u,i==1&&r.removeAttribute("colSpan"),u==1&&s.removeAttribute("colSpan"),s}var h=/^(?:td|th)$/;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(r){function a(e){return CKEDITOR.tools.extend(e||{},{contextSensitive:1,refresh:function(e,t){this.setState(t.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function h(e,t){var n=r.addCommand(e,t);r.addFeature(n)}var p=r.lang.table;h("cellProperties",new CKEDITOR.dialogCommand("cellProperties",a({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:"table"}))),CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js"),h("rowDelete",a({requiredContent:"table",exec:function(e){e=e.getSelection(),u(n(e))}})),h("rowInsertBefore",a({requiredContent:"table",exec:function(e){e=e.getSelection(),t(e,!0)}})),h("rowInsertAfter",a({requiredContent:"table",exec:function(e){e=e.getSelection(),t(e)}})),h("columnDelete",a({requiredContent:"table",exec:function(t){for(var t=t.getSelection(),t=e(t),n=t[0],r=t[t.length-1],t=n.getAscendant("table"),i=CKEDITOR.tools.buildTableMap(t),s,o,a=[],f=0,l=i.length;f<l;f++)for(var c=0,h=i[f].length;c<h;c++)i[f][c]==n.$&&(s=c),i[f][c]==r.$&&(o=c);for(f=s;f<=o;f++)for(c=0;c<i.length;c++)r=i[c],n=new CKEDITOR.dom.element(t.$.rows[c]),r=new CKEDITOR.dom.element(r[f]),r.$&&(r.$.colSpan==1?r.remove():r.$.colSpan=r.$.colSpan-1,c+=r.$.rowSpan-1,n.$.cells.length||a.push(n));o=t.$.rows[0]&&t.$.rows[0].cells,s=new CKEDITOR.dom.element(o[s]||(s?o[s-1]:t.$.parentNode)),a.length==l&&t.remove(),s&&u(s,!0)}})),h("columnInsertBefore",a({requiredContent:"table",exec:function(e){e=e.getSelection(),i(e,!0)}})),h("columnInsertAfter",a({requiredContent:"table",exec:function(e){e=e.getSelection(),i(e)}})),h("cellDelete",a({requiredContent:"table",exec:function(e){e=e.getSelection(),o(e)}})),h("cellMerge",a({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(e){u(f(e.getSelection()),!0)}})),h("cellMergeRight",a({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(e){u(f(e.getSelection(),"right"),!0)}})),h("cellMergeDown",a({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(e){u(f(e.getSelection(),"down"),!0)}})),h("cellVerticalSplit",a({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(e){u(l(e.getSelection()))}})),h("cellHorizontalSplit",a({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(e){u(c(e.getSelection()))}})),h("cellInsertBefore",a({requiredContent:"table",exec:function(e){e=e.getSelection(),s(e,!0)}})),h("cellInsertAfter",a({requiredContent:"table",exec:function(e){e=e.getSelection(),s(e)}})),r.addMenuItems&&r.addMenuItems({tablecell:{label:p.cell.menu,group:"tablecell",order:1,getItems:function(){var t=r.getSelection(),n=e(t);return{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:f(t,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:f(t,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:f(t,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:l(t,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:c(t,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_properties:n.length>0?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED}}},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",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",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},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",command:"columnDelete",order:15}}),r.contextMenu&&r.contextMenu.addListener(function(e,t,n){return(e=n.contains({td:1,th:1},1))&&!e.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getSelectedCells:e},CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)}(),CKEDITOR.tools.buildTableMap=function(e){for(var e=e.$.rows,t=-1,n=[],r=0;r<e.length;r++){t++,!n[t]&&(n[t]=[]);for(var i=-1,s=0;s<e[r].cells.length;s++){var o=e[r].cells[s];for(i++;n[t][i];)i++;for(var u=isNaN(o.colSpan)?1:o.colSpan,o=isNaN(o.rowSpan)?1:o.rowSpan,a=0;a<o;a++){n[t+a]||(n[t+a]=[]);for(var f=0;f<u;f++)n[t+a][i+f]=e[r].cells[s]}i+=u-1}}return n},function(){function e(e){function n(){for(var n=r(),s=CKEDITOR.tools.clone(e.config.toolbarGroups)||t(e),o=0;o<s.length;o++){var u=s[o];if(u!="/"){typeof u=="string"&&(u=s[o]={name:u});var l,c=u.groups;if(c)for(var h=0;h<c.length;h++)l=c[h],(l=n[l])&&i(u,l);(l=n[u.name])&&i(u,l)}}return s}function r(){var t={},n,r,i;for(n in e.ui.items)r=e.ui.items[n],i=r.toolbar||"others",i=i.split(","),r=i[0],i=parseInt(i[1]||-1,10),t[r]||(t[r]=[]),t[r].push({name:n,order:i});for(r in t)t[r]=t[r].sort(function(e,t){return e.order==t.order?0:t.order<0?-1:e.order<0?1:e.order<t.order?-1:1});return t}function i(t,n){if(n.length){t.items?t.items.push(e.ui.create("-")):t.items=[];for(var r;r=n.shift();)r=typeof r=="string"?r:r.name,(!o||CKEDITOR.tools.indexOf(o,r)==-1)&&(r=e.ui.create(r))&&e.addFeature(r)&&t.items.push(r)}}function s(e){var t=[],n,r,s;for(n=0;n<e.length;++n)r=e[n],s={},r=="/"?t.push(r):CKEDITOR.tools.isArray(r)?(i(s,CKEDITOR.tools.clone(r)),t.push(s)):r.items&&(i(s,CKEDITOR.tools.clone(r.items)),s.name=r.name,t.push(s));return t}var o=e.config.removeButtons,o=o&&o.split(","),u=e.config.toolbar;return typeof u=="string"&&(u=e.config["toolbar_"+u]),e.toolbar=u?s(u):n()}function t(e){return e._.toolbarGroups||(e._.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"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var n=function(){this.toolbars=[],this.focusCommandExecuted=!1};n.prototype.focus=function(){for(var e=0,t;t=this.toolbars[e++];)for(var n=0,r;r=t.items[n++];)if(r.focus){r.focus();return}};var r={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(e){e.toolbox&&(e.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){e.toolbox.focus()},100):e.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(t){var i,s=function(e,n){var r,o=t.lang.dir=="rtl",u=t.config.toolbarGroupCycling,a=o?37:39,o=o?39:37,u=u===void 0||u;switch(n){case 9:case CKEDITOR.SHIFT+9:for(;!r||!r.items.length;){r=n==9?(r?r.next:e.toolbar.next)||t.toolbox.toolbars[0]:(r?r.previous:e.toolbar.previous)||t.toolbox.toolbars[t.toolbox.toolbars.length-1];if(r.items.length)for(e=r.items[i?r.items.length-1:0];e&&!e.focus;)(e=i?e.previous:e.next)||(r=0)}return e&&e.focus(),!1;case a:r=e;do r=r.next,!r&&u&&(r=e.toolbar.items[0]);while(r&&!r.focus);return r?r.focus():s(e,9),!1;case 40:return e.button&&e.button.hasArrow?(t.once("panelShow",function(e){e.data._.panel._.currentBlock.onKeyDown(40)}),e.execute()):s(e,n==40?a:o),!1;case o:case 38:r=e;do r=r.previous,!r&&u&&(r=e.toolbar.items[e.toolbar.items.length-1]);while(r&&!r.focus);return r?r.focus():(i=1,s(e,CKEDITOR.SHIFT+9),i=0),!1;case 27:return t.focus(),!1;case 13:case 32:return e.execute(),!1}return!0};t.on("uiSpace",function(r){if(r.data.space==t.config.toolbarLocation){r.removeListener(),t.toolbox=new n;var i=CKEDITOR.tools.getNextId(),o=['<span id="',i,'" class="cke_voice_label">',t.lang.toolbar.toolbars,"</span>",'<span id="'+t.ui.spaceId("toolbox")+'" class="cke_toolbox" role="group" aria-labelledby="',i,'" onmousedown="return false;">'],i=t.config.toolbarStartupExpanded!==!1,u,f;t.config.toolbarCanCollapse&&t.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&o.push('<span class="cke_toolbox_main"'+(i?">":' style="display:none">'));for(var l=t.toolbox.toolbars,h=e(t),p=0;p<h.length;p++){var d,v=0,m,g=h[p],y;if(g){u&&(o.push("</span>"),f=u=0);if(g==="/")o.push('<span class="cke_toolbar_break"></span>');else{y=g.items||g;for(var w=0;w<y.length;w++){var E=y[w],S;if(E)if(E.type==CKEDITOR.UI_SEPARATOR)f=u&&E;else{S=E.canGroup!==!1;if(!v){d=CKEDITOR.tools.getNextId(),v={id:d,items:[]},m=g.name&&(t.lang.toolbar.toolbarGroups[g.name]||g.name),o.push('<span id="',d,'" class="cke_toolbar"',m?' aria-labelledby="'+d+'_label"':"",' role="toolbar">'),m&&o.push('<span id="',d,'_label" class="cke_voice_label">',m,"</span>"),o.push('<span class="cke_toolbar_start"></span>');var x=l.push(v)-1;x>0&&(v.previous=l[x-1],v.previous.next=v)}S?u||(o.push('<span class="cke_toolgroup" role="presentation">'),u=1):u&&(o.push("</span>"),u=0),d=function(e){e=e.render(t,o),x=v.items.push(e)-1,x>0&&(e.previous=v.items[x-1],e.previous.next=e),e.toolbar=v,e.onkey=s,e.onfocus=function(){t.toolbox.focusCommandExecuted||t.focus()}},f&&(d(f),f=0),d(E)}}u&&(o.push("</span>"),f=u=0),v&&o.push('<span class="cke_toolbar_end"></span></span>')}}}t.config.toolbarCanCollapse&&o.push("</span>");if(t.config.toolbarCanCollapse&&t.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var T=CKEDITOR.tools.addFunction(function(){t.execCommand("toolbarCollapse")});t.on("destroy",function(){CKEDITOR.tools.removeFunction(T)}),t.addCommand("toolbarCollapse",{readOnly:1,exec:function(e){var t=e.ui.space("toolbar_collapser"),n=t.getPrevious(),r=e.ui.space("contents"),i=n.getParent(),s=parseInt(r.$.style.height,10),o=i.$.offsetHeight,u=t.hasClass("cke_toolbox_collapser_min");u?(n.show(),t.removeClass("cke_toolbox_collapser_min"),t.setAttribute("title",e.lang.toolbar.toolbarCollapse)):(n.hide(),t.addClass("cke_toolbox_collapser_min"),t.setAttribute("title",e.lang.toolbar.toolbarExpand)),t.getFirst().setText(u?"▲":"◀"),r.setStyle("height",s-(i.$.offsetHeight-o)+"px"),e.fire("resize")},modes:{wysiwyg:1,source:1}}),t.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse"),o.push('<a title="'+(i?t.lang.toolbar.toolbarCollapse:t.lang.toolbar.toolbarExpand)+'" id="'+t.ui.spaceId("toolbar_collapser")+'" tabIndex="-1" class="cke_toolbox_collapser'),i||o.push(" cke_toolbox_collapser_min"),o.push('" onclick="CKEDITOR.tools.callFunction('+T+')">','<span class="cke_arrow">&#9650;</span>',"</a>")}o.push("</span>"),r.data.html=r.data.html+o.join("")}}),t.on("destroy",function(){if(this.toolbox){var e,t=0,n,r,i;for(e=this.toolbox.toolbars;t<e.length;t++){r=e[t].items;for(n=0;n<r.length;n++)i=r[n],i.clickFn&&CKEDITOR.tools.removeFunction(i.clickFn),i.keyDownFn&&CKEDITOR.tools.removeFunction(i.keyDownFn)}}}),t.on("uiReady",function(){var e=t.ui.space("toolbox");e&&t.focusManager.add(e,1)}),t.addCommand("toolbarFocus",r),t.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus"),t.ui.add("-",CKEDITOR.UI_SEPARATOR,{}),t.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(e,t){return t.push('<span class="cke_toolbar_separator" role="separator"></span>'),{}}}}})}}),CKEDITOR.ui.prototype.addToolbarGroup=function(e,n,r){var i=t(this.editor),s=n===0,o={name:e};if(r){if(r=CKEDITOR.tools.search(i,function(e){return e.name==r})){!r.groups&&(r.groups=[]);if(n){n=CKEDITOR.tools.indexOf(r.groups,n);if(n>=0){r.groups.splice(n+1,0,e);return}}s?r.groups.splice(0,0,e):r.groups.push(e);return}n=null}n&&(n=CKEDITOR.tools.indexOf(i,function(e){return e.name==n})),s?i.splice(0,0,e):typeof n=="number"?i.splice(n+1,0,o):i.push(e)}}(),CKEDITOR.UI_SEPARATOR="separator",CKEDITOR.config.toolbarLocation="top","use strict",function(){var e=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],t={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(t){function r(e){o.enabled&&e.data.command.canUndo!==!1&&o.save()}function i(){o.enabled=t.readOnly?!1:t.mode=="wysiwyg",o.onChange()}var o=t.undoManager=new n(t),u=o.editingHandler=new s(o),f=t.addCommand("undo",{exec:function(){o.undo()&&(t.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),l=t.addCommand("redo",{exec:function(){o.redo()&&(t.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});t.setKeystroke([[e[0],"undo"],[e[1],"redo"],[e[2],"redo"]]),o.onChange=function(){f.setState(o.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),l.setState(o.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)},t.on("beforeCommandExec",r),t.on("afterCommandExec",r),t.on("saveSnapshot",function(e){o.save(e.data&&e.data.contentOnly)}),t.on("contentDom",u.attachListeners,u),t.on("instanceReady",function(){t.fire("saveSnapshot")}),t.on("beforeModeUnload",function(){t.mode=="wysiwyg"&&o.save(!0)}),t.on("mode",i),t.on("readOnly",i),t.ui.addButton&&(t.ui.addButton("Undo",{label:t.lang.undo.undo,command:"undo",toolbar:"undo,10"}),t.ui.addButton("Redo",{label:t.lang.undo.redo,command:"redo",toolbar:"undo,20"})),t.resetUndo=function(){o.reset(),t.fire("saveSnapshot")},t.on("updateSnapshot",function(){o.currentImage&&o.update()}),t.on("lockSnapshot",function(e){e=e.data,o.lock(e&&e.dontUpdate,e&&e.forceUpdate)}),t.on("unlockSnapshot",o.unlock,o)}}),CKEDITOR.plugins.undo={};var n=CKEDITOR.plugins.undo.UndoManager=function(e){this.strokesRecorded=[0,0],this.locked=null,this.previousKeyGroup=-1,this.limit=e.config.undoStackSize||20,this.strokesLimit=25,this.editor=e,this.reset()};n.prototype={type:function(e,t){var r=n.getKeyGroup(e),i=this.strokesRecorded[r]+1,t=t||i>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange()),t?(i=0,this.editor.fire("saveSnapshot")):this.editor.fire("change"),this.strokesRecorded[r]=i,this.previousKeyGroup=r},keyGroupChanged:function(e){return n.getKeyGroup(e)!=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(e,t,n){var i=this.editor;if(this.locked||i.status!="ready"||i.mode!="wysiwyg")return!1;var s=i.editable();if(!s||s.status!="ready")return!1;s=this.snapshots,t||(t=new r(i));if(t.contents===!1)return!1;if(this.currentImage)if(t.equalsContent(this.currentImage)){if(e||t.equalsSelection(this.currentImage))return!1}else n!==!1&&i.fire("change");return s.splice(this.index+1,s.length-this.index-1),s.length==this.limit&&s.shift(),this.index=s.push(t)-1,this.currentImage=t,n!==!1&&this.refreshState(),!0},restoreImage:function(e){var t=this.editor,n;e.bookmarks&&(t.focus(),n=t.getSelection()),this.locked={level:999},this.editor.loadSnapshot(e.contents),e.bookmarks?n.selectBookmarks(e.bookmarks):CKEDITOR.env.ie&&(n=this.editor.document.getBody().$.createTextRange(),n.collapse(!0),n.select()),this.locked=null,this.index=e.index,this.currentImage=this.snapshots[this.index],this.update(),this.refreshState(),t.fire("change")},getNextImage:function(e){var t=this.snapshots,n=this.currentImage,r;if(n)if(e)for(r=this.index-1;r>=0;r--){e=t[r];if(!n.equalsContent(e))return e.index=r,e}else for(r=this.index+1;r<t.length;r++){e=t[r];if(!n.equalsContent(e))return e.index=r,e}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 e=this.getNextImage(!0);if(e)return this.restoreImage(e),!0}return!1},redo:function(){if(this.redoable()){this.save(!0);if(this.redoable()){var e=this.getNextImage(!1);if(e)return this.restoreImage(e),!0}}return!1},update:function(e){if(!this.locked){e||(e=new r(this.editor));for(var t=this.index,n=this.snapshots;t>0&&this.currentImage.equalsContent(n[t-1]);)t-=1;n.splice(t,this.index-t+1,e),this.index=t,this.currentImage=e}},updateSelection:function(e){if(!this.snapshots.length)return!1;var t=this.snapshots,n=t[t.length-1];return n.equalsContent(e)&&!n.equalsSelection(e)?(this.currentImage=t[t.length-1]=e,!0):!1},lock:function(e,t){if(this.locked)this.locked.level++;else if(e)this.locked={level:1};else{var n=null;if(t)n=!0;else{var i=new r(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(i)&&(n=i)}this.locked={update:n,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var e=this.locked.update;this.locked=null;if(e===!0)this.update();else if(e){var t=new r(this.editor,!0);e.equalsContent(t)||this.update()}}}},n.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1},n.keyGroups={PRINTABLE:0,FUNCTIONAL:1},n.isNavigationKey=function(e){return!!n.navigationKeyCodes[e]},n.getKeyGroup=function(e){var r=n.keyGroups;return t[e]?r.FUNCTIONAL:r.PRINTABLE},n.getOppositeKeyGroup=function(e){var t=n.keyGroups;return e==t.FUNCTIONAL?t.PRINTABLE:t.FUNCTIONAL},n.ieFunctionalKeysBug=function(e){return CKEDITOR.env.ie&&n.getKeyGroup(e)==n.keyGroups.FUNCTIONAL};var r=CKEDITOR.plugins.undo.Image=function(e,t){this.editor=e,e.fire("beforeUndoImage");var n=e.getSnapshot();CKEDITOR.env.ie&&n&&(n=n.replace(/\s+data-cke-expando=".*?"/g,"")),this.contents=n,t||(this.bookmarks=(n=n&&e.getSelection())&&n.createBookmarks2(!0)),e.fire("afterUndoImage")},i=/\b(?:href|src|name)="[^"]*?"/gi;r.prototype={equalsContent:function(e){var t=this.contents,e=e.contents;return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(t=t.replace(i,""),e=e.replace(i,"")),t!=e?!1:!0},equalsSelection:function(e){var t=this.bookmarks,e=e.bookmarks;if(t||e){if(!t||!e||t.length!=e.length)return!1;for(var n=0;n<t.length;n++){var r=t[n],i=e[n];if(r.startOffset!=i.startOffset||r.endOffset!=i.endOffset||!CKEDITOR.tools.arrayCompare(r.start,i.start)||!CKEDITOR.tools.arrayCompare(r.end,i.end))return!1}}return!0}};var s=CKEDITOR.plugins.undo.NativeEditingHandler=function(e){this.undoManager=e,this.ignoreInputEvent=!1,this.keyEventsStack=new o,this.lastKeydownImage=null};s.prototype={onKeydown:function(t){var i=t.data.getKey();if(i!==229)if(CKEDITOR.tools.indexOf(e,t.data.getKeystroke())>-1)t.data.preventDefault();else{this.keyEventsStack.cleanUp(t),t=this.undoManager,this.keyEventsStack.getLast(i)||this.keyEventsStack.push(i),this.lastKeydownImage=new r(t.editor);if(n.isNavigationKey(i)||this.undoManager.keyGroupChanged(i))if(t.strokesRecorded[0]||t.strokesRecorded[1])t.save(!1,this.lastKeydownImage,!1),t.resetType()}},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var e=this.keyEventsStack.getLast();e||(e=this.keyEventsStack.push(0)),this.keyEventsStack.increment(e.keyCode),this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(e.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(e){var t=this.undoManager,e=e.data.getKey(),i=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(e);if(!n.ieFunctionalKeysBug(e)||!this.lastKeydownImage||!this.lastKeydownImage.equalsContent(new r(t.editor,!0)))i>0?t.type(e):n.isNavigationKey(e)&&this.onNavigationKey(!0)},onNavigationKey:function(e){var t=this.undoManager;(e||!t.save(!0,null,!1))&&t.updateSelection(new r(t.editor)),t.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},attachListeners:function(){var e=this.undoManager.editor,t=e.editable(),r=this;t.attachListener(t,"keydown",function(e){r.onKeydown(e),n.ieFunctionalKeysBug(e.data.getKey())&&r.onInput()},null,null,999),t.attachListener(t,CKEDITOR.env.ie?"keypress":"input",r.onInput,r,null,999),t.attachListener(t,"keyup",r.onKeyup,r,null,999),t.attachListener(t,"paste",r.ignoreInputEventListener,r,null,999),t.attachListener(t,"drop",r.ignoreInputEventListener,r,null,999),t.attachListener(t.isInline()?t:e.document.getDocumentElement(),"click",function(){r.onNavigationKey()},null,null,999),t.attachListener(this.undoManager.editor,"blur",function(){r.keyEventsStack.remove(9)},null,null,999)}};var o=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};o.prototype={push:function(e){return this.stack[this.stack.push({keyCode:e,inputs:0})-1]},getLastIndex:function(e){if(typeof e!="number")return this.stack.length-1;for(var t=this.stack.length;t--;)if(this.stack[t].keyCode==e)return t;return-1},getLast:function(e){return e=this.getLastIndex(e),e!=-1?this.stack[e]:null},increment:function(e){this.getLast(e).inputs++},remove:function(e){e=this.getLastIndex(e),e!=-1&&this.stack.splice(e,1)},resetInputs:function(e){if(typeof e=="number")this.getLast(e).inputs=0;else for(e=this.stack.length;e--;)this.stack[e].inputs=0},getTotalInputs:function(){for(var e=this.stack.length,t=0;e--;)t+=this.stack[e].inputs;return t},cleanUp:function(e){e=e.data.$,!e.ctrlKey&&!e.metaKey&&this.remove(17),e.shiftKey||this.remove(16),e.altKey||this.remove(18)}}}(),CKEDITOR.plugins.add("wsc",{requires:"dialog",parseApi:function(e){e.config.wsc_onFinish=typeof e.config.wsc_onFinish=="function"?e.config.wsc_onFinish:function(){},e.config.wsc_onClose=typeof e.config.wsc_onClose=="function"?e.config.wsc_onClose:function(){}},parseConfig:function(e){e.config.wsc_customerId=e.config.wsc_customerId||CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk",e.config.wsc_customDictionaryIds=e.config.wsc_customDictionaryIds||CKEDITOR.config.wsc_customDictionaryIds||"",e.config.wsc_userDictionaryName=e.config.wsc_userDictionaryName||CKEDITOR.config.wsc_userDictionaryName||"",e.config.wsc_customLoaderScript=e.config.wsc_customLoaderScript||CKEDITOR.config.wsc_customLoaderScript,CKEDITOR.config.wsc_cmd=e.config.wsc_cmd||CKEDITOR.config.wsc_cmd||"spell",CKEDITOR.config.wsc_version="v4.3.0-26-g5bcf855",CKEDITOR.config.wsc_removeGlobalVariable=!0},init:function(e){var t=CKEDITOR.env;this.parseConfig(e),this.parseApi(e),e.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes={wysiwyg:!CKEDITOR.env.opera&&!CKEDITOR.env.air&&document.domain==window.location.hostname&&(!t.ie||!(t.version<8||t.quirks))},typeof e.plugins.scayt=="undefined"&&e.ui.addButton&&e.ui.addButton("SpellChecker",{label:e.lang.wsc.toolbar,click:function(e){var t=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.container.getText():e.document.getBody().getText();(t=t.replace(/\s/g,""))?e.execCommand("checkspell"):alert("Nothing to check!")},toolbar:"spellchecker,10"}),CKEDITOR.dialog.add("checkspell",this.path+(CKEDITOR.env.ie&&CKEDITOR.env.version<=7?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}}),function(){function e(e){var n=this.editor,r=e.document,i=r.body,s=r.getElementById("cke_actscrpt");s&&s.parentNode.removeChild(s),(s=r.getElementById("cke_shimscrpt"))&&s.parentNode.removeChild(s),(s=r.getElementById("cke_basetagscrpt"))&&s.parentNode.removeChild(s),i.contentEditable=!0,CKEDITOR.env.ie&&(i.hideFocus=!0,i.disabled=!0,i.removeAttribute("disabled")),delete this._.isLoadingData,this.$=i,r=new CKEDITOR.dom.document(r),this.setup(),this.fixInitialSelection(),CKEDITOR.env.ie&&(r.getDocumentElement().addClass(r.$.compatMode),n.config.enterMode!=CKEDITOR.ENTER_P&&this.attachListener(r,"selectionchange",function(){var e=r.getBody(),t=n.getSelection(),i=t&&t.getRanges()[0];i&&e.getHtml().match(/^<p>(?:&nbsp;|<br>)<\/p>$/i)&&i.startContainer.equals(e)&&setTimeout(function(){i=n.getSelection().getRanges()[0],i.startContainer.equals("body")||(e.getFirst().remove(1),i.moveToElementEditEnd(e),i.select())},0)})),(CKEDITOR.env.webkit||CKEDITOR.env.ie&&CKEDITOR.env.version>10)&&r.getDocumentElement().on("mousedown",function(e){e.data.getTarget().is("html")&&setTimeout(function(){n.editable().focus()})}),t(n);try{n.document.$.execCommand("2D-position",!1,!0)}catch(o){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&n.document.$.compatMode=="CSS1Compat")&&this.attachListener(this,"keydown",function(e){var t=e.data.getKeystroke();if(t==33||t==34)if(CKEDITOR.env.ie)setTimeout(function(){n.getSelection().scrollIntoView()},0);else if(n.window.$.innerHeight>this.$.offsetHeight){var r=n.createRange();r[t==33?"moveToElementEditStart":"moveToElementEditEnd"](this),r.select(),e.data.preventDefault()}}),CKEDITOR.env.ie&&this.attachListener(r,"blur",function(){try{r.$.selection.empty()}catch(e){}}),CKEDITOR.env.iOS&&this.attachListener(r,"touchend",function(){e.focus()}),i=n.document.getElementsByTag("title").getItem(0),i.data("cke-title",i.getText()),CKEDITOR.env.ie&&(n.document.$.title=this._.docTitle),CKEDITOR.tools.setTimeout(function(){this.status=="unloaded"&&(this.status="ready"),n.fire("contentDom"),this._.isPendingFocus&&(n.focus(),this._.isPendingFocus=!1),setTimeout(function(){n.fire("dataReady")},0),CKEDITOR.env.ie&&setTimeout(function(){if(n.document){var e=n.document.$.body;e.runtimeStyle.marginBottom="0px",e.runtimeStyle.marginBottom=""}},1e3)},0,this)}function t(e){function t(){var t;e.editable().attachListener(e,"selectionChange",function(){var r=e.getSelection().getSelectedElement();r&&(t&&(t.detachEvent("onresizestart",n),t=null),r.$.attachEvent("onresizestart",n),t=r.$)})}function n(e){e.returnValue=!1}if(CKEDITOR.env.gecko)try{var r=e.document.$;r.execCommand("enableObjectResizing",!1,!e.config.disableObjectResizing),r.execCommand("enableInlineTableEditing",!1,!e.config.disableNativeTableHandles)}catch(i){}else CKEDITOR.env.ie&&CKEDITOR.env.version<11&&e.config.disableObjectResizing&&t(e)}function n(){var e=[];if(CKEDITOR.document.$.documentMode>=8){e.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");var t=[],n;for(n in CKEDITOR.dtd.$removeEmpty)t.push("html.CSS1Compat "+n+"[contenteditable=false]");e.push(t.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(e.push("html{height:100% !important}"),e.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));return e.push("html{cursor:text;*cursor:auto}"),e.push("img,input,textarea{cursor:default}"),e.join("\n")}CKEDITOR.plugins.add("wysiwygarea",{init:function(e){e.config.fullPage&&e.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"}),e.addMode("wysiwyg",function(t){function n(n){n&&n.removeListener(),e.editable(new r(e,s.$.contentWindow.document.body)),e.setData(e.getData(1),t)}var i="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",i=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent(i)+"}())":"",s=CKEDITOR.dom.element.createFromHtml('<iframe src="'+i+'" frameBorder="0"></iframe>');s.setStyles({width:"100%",height:"100%"}),s.addClass("cke_wysiwyg_frame cke_reset");var o=e.ui.space("contents");o.append(s),(i=CKEDITOR.env.ie||CKEDITOR.env.gecko)&&s.on("load",n);var u=e.title,f=e.fire("ariaEditorHelpLabel",{}).label;u&&(CKEDITOR.env.ie&&f&&(u+=", "+f),s.setAttribute("title",u));if(f){var u=CKEDITOR.tools.getNextId(),l=CKEDITOR.dom.element.createFromHtml('<span id="'+u+'" class="cke_voice_label">'+f+"</span>");o.append(l,1),s.setAttribute("aria-describedby",u)}e.on("beforeModeUnload",function(e){e.removeListener(),l&&l.remove()}),s.setAttributes({tabIndex:e.tabIndex,allowTransparency:"true"}),!i&&n(),CKEDITOR.env.webkit&&(i=function(){o.setStyle("width","100%"),s.hide(),s.setSize("width",o.getSize("width")),o.removeStyle("width"),s.show()},s.setCustomData("onResize",i),CKEDITOR.document.getWindow().on("resize",i)),e.fire("ariaWidget",s)})}}),CKEDITOR.editor.prototype.addContentsCss=function(e){var t=this.config,n=t.contentsCss;CKEDITOR.tools.isArray(n)||(t.contentsCss=n?[n]:[]),t.contentsCss.push(e)};var r=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments),this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(t){CKEDITOR.tools.setTimeout(e,0,this,t)},this),this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(e,t){var r=this.editor;if(t)this.setHtml(e),this.fixInitialSelection(),r.fire("dataReady");else{this._.isLoadingData=!0,r._.dataStore={id:1};var i=r.config,s=i.fullPage,o=i.docType,u=CKEDITOR.tools.buildStyleHtml(n()).replace(/<style>/,'<style data-cke-temp="1">');s||(u+=CKEDITOR.tools.buildStyleHtml(r.config.contentsCss));var a=i.baseHref?'<base href="'+i.baseHref+'" data-cke-temp="1" />':"";s&&(e=e.replace(/<!DOCTYPE[^>]*>/i,function(e){return r.docType=o=e,""}).replace(/<\?xml\s[^\?]*\?>/i,function(e){return r.xmlDeclaration=e,""})),e=r.dataProcessor.toHtml(e),s?(/<body[\s|>]/.test(e)||(e="<body>"+e),/<html[\s|>]/.test(e)||(e="<html>"+e+"</html>"),/<head[\s|>]/.test(e)?/<title[\s|>]/.test(e)||(e=e.replace(/<head[^>]*>/,"$&<title></title>")):e=e.replace(/<html[^>]*>/,"$&<head><title></title></head>"),a&&(e=e.replace(/<head[^>]*?>/,"$&"+a)),e=e.replace(/<\/head\s*>/,u+"$&"),e=o+e):e=i.docType+'<html dir="'+i.contentsLangDirection+'" lang="'+(i.contentsLanguage||r.langCode)+'"><head><title>'+this._.docTitle+"</title>"+a+u+"</head><body"+(i.bodyId?' id="'+i.bodyId+'"':"")+(i.bodyClass?' class="'+i.bodyClass+'"':"")+">"+e+"</body></html>",CKEDITOR.env.gecko&&(e=e.replace(/<body/,'<body contenteditable="true" '),CKEDITOR.env.version<2e4&&(e=e.replace(/<body[^>]*>/,"$&<!-- cke-content-start -->"))),i='<script id="cke_actscrpt" type="text/javascript"'+(CKEDITOR.env.ie?' defer="defer" ':"")+">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded=1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"</script>",CKEDITOR.env.ie&&CKEDITOR.env.version<9&&(i+='<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)</script>'),a&&CKEDITOR.env.ie&&CKEDITOR.env.version<10&&(i+='<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;</script>'),e=e.replace(/(?=\s*<\/(:?head)>)/,i),this.clearCustomData(),this.clearListeners(),r.fire("contentDomUnload");var f=this.getDocument();try{f.write(e)}catch(l){setTimeout(function(){f.write(e)},0)}}},getData:function(e){if(e)return this.getHtml();var e=this.editor,t=e.config,n=t.fullPage,r=n&&e.docType,i=n&&e.xmlDeclaration,s=this.getDocument(),n=n?s.getDocumentElement().getOuterHtml():s.getBody().getHtml();return CKEDITOR.env.gecko&&t.enterMode!=CKEDITOR.ENTER_BR&&(n=n.replace(/<br>(?=\s*(:?$|<\/body>))/,"")),n=e.dataProcessor.toDataFormat(n),i&&(n=i+"\n"+n),r&&(n=r+"\n"+n),n},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:r.baseProto.focus.call(this)},detach:function(){var e=this.editor,t=e.document,e=e.window.getFrame();r.baseProto.detach.call(this),this.clearCustomData(),t.getDocumentElement().clearCustomData(),e.clearCustomData(),CKEDITOR.tools.removeFunction(this._.frameLoadedHandler),(t=e.removeCustomData("onResize"))&&t.removeListener(),e.remove()}}})}(),CKEDITOR.config.disableObjectResizing=!1,CKEDITOR.config.disableNativeTableHandles=!0,CKEDITOR.config.disableNativeSpellChecker=!0,CKEDITOR.config.contentsCss=CKEDITOR.getUrl("contents.css"),CKEDITOR.config.plugins="dialogui,dialog,a11yhelp,about,basicstyles,blockquote,clipboard,panel,floatpanel,menu,contextmenu,elementspath,indent,indentlist,list,enterkey,entities,popup,filebrowser,floatingspace,listblock,button,richcombo,format,horizontalrule,htmlwriter,image,fakeobjects,link,magicline,maximize,pastefromword,pastetext,removeformat,resize,menubutton,scayt,showborders,sourcearea,specialchar,stylescombo,tab,table,tabletools,toolbar,undo,wsc,wysiwygarea",CKEDITOR.config.skin="moono",function(){var e=function(e,t){for(var n=CKEDITOR.getUrl("plugins/"+t),e=e.split(","),r=0;r<e.length;r++)CKEDITOR.skin.icons[e[r]]={path:n,offset:-e[++r],bgsize:e[++r]}};CKEDITOR.env.hidpi?e("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,,creatediv,456,,docprops-rtl,480,,docprops,504,,find-rtl,528,,find,552,,replace,576,,flash,600,,button,624,,checkbox,648,,form,672,,hiddenfield,696,,imagebutton,720,,radio,744,,select-rtl,768,,select,792,,textarea-rtl,816,,textarea,840,,textfield-rtl,864,,textfield,888,,horizontalrule,912,,iframe,936,,image,960,,indent-rtl,984,,indent,1008,,outdent-rtl,1032,,outdent,1056,,justifyblock,1080,,justifycenter,1104,,justifyleft,1128,,justifyright,1152,,language,1176,,anchor-rtl,1200,,anchor,1224,,link,1248,,unlink,1272,,bulletedlist-rtl,1296,,bulletedlist,1320,,numberedlist-rtl,1344,,numberedlist,1368,,mathjax,1392,,maximize,1416,,newpage-rtl,1440,,newpage,1464,,pagebreak-rtl,1488,,pagebreak,1512,,pastefromword-rtl,1536,,pastefromword,1560,,pastetext-rtl,1584,,pastetext,1608,,placeholder,1632,,preview-rtl,1656,,preview,1680,,print,1704,,removeformat,1728,,save,1752,,scayt,1776,,selectall,1800,,showblocks-rtl,1824,,showblocks,1848,,smiley,1872,,source-rtl,1896,,source,1920,,sourcedialog-rtl,1944,,sourcedialog,1968,,specialchar,1992,,table,2016,,templates-rtl,2040,,templates,2064,,uicolor,2088,,redo-rtl,2112,,redo,2136,,undo-rtl,2160,,undo,2184,,simplebox,4416,auto,spellchecker,2232,","icons_hidpi.png"):e("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,codesnippet,384,auto,bgcolor,408,auto,textcolor,432,auto,creatediv,456,auto,docprops-rtl,480,auto,docprops,504,auto,find-rtl,528,auto,find,552,auto,replace,576,auto,flash,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,imagebutton,720,auto,radio,744,auto,select-rtl,768,auto,select,792,auto,textarea-rtl,816,auto,textarea,840,auto,textfield-rtl,864,auto,textfield,888,auto,horizontalrule,912,auto,iframe,936,auto,image,960,auto,indent-rtl,984,auto,indent,1008,auto,outdent-rtl,1032,auto,outdent,1056,auto,justifyblock,1080,auto,justifycenter,1104,auto,justifyleft,1128,auto,justifyright,1152,auto,language,1176,auto,anchor-rtl,1200,auto,anchor,1224,auto,link,1248,auto,unlink,1272,auto,bulletedlist-rtl,1296,auto,bulletedlist,1320,auto,numberedlist-rtl,1344,auto,numberedlist,1368,auto,mathjax,1392,auto,maximize,1416,auto,newpage-rtl,1440,auto,newpage,1464,auto,pagebreak-rtl,1488,auto,pagebreak,1512,auto,pastefromword-rtl,1536,auto,pastefromword,1560,auto,pastetext-rtl,1584,auto,pastetext,1608,auto,placeholder,1632,auto,preview-rtl,1656,auto,preview,1680,auto,print,1704,auto,removeformat,1728,auto,save,1752,auto,scayt,1776,auto,selectall,1800,auto,showblocks-rtl,1824,auto,showblocks,1848,auto,smiley,1872,auto,source-rtl,1896,auto,source,1920,auto,sourcedialog-rtl,1944,auto,sourcedialog,1968,auto,specialchar,1992,auto,table,2016,auto,templates-rtl,2040,auto,templates,2064,auto,uicolor,2088,auto,redo-rtl,2112,auto,redo,2136,auto,undo-rtl,2160,auto,undo,2184,auto,simplebox,2208,auto,spellchecker,2232,auto","icons.png")}()}(),define("ckeditor",function(){}),function(e){function n(){var e=arguments[0],t=n.cache;if(!t[e]||!t.hasOwnProperty(e))t[e]=n.parse(e);return n.format.call(null,t[e],arguments)}function i(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function s(e,t){return Array(t+1).join(e)}var t={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};n.format=function(e,r){var o=1,u=e.length,a="",f,l=[],c,h,p,d,v,m,g=!0,y="";for(c=0;c<u;c++){a=i(e[c]);if(a==="string")l[l.length]=e[c];else if(a==="array"){p=e[c];if(p[2]){f=r[o];for(h=0;h<p[2].length;h++){if(!f.hasOwnProperty(p[2][h]))throw new Error(n("[sprintf] property '%s' does not exist",p[2][h]));f=f[p[2][h]]}}else p[1]?f=r[p[1]]:f=r[o++];i(f)=="function"&&(f=f());if(t.not_string.test(p[8])&&t.not_json.test(p[8])&&i(f)!="number"&&isNaN(f))throw new TypeError(n("[sprintf] expecting number but found %s",i(f)));t.number.test(p[8])&&(g=f>=0);switch(p[8]){case"b":f=f.toString(2);break;case"c":f=String.fromCharCode(f);break;case"d":case"i":f=parseInt(f,10);break;case"j":f=JSON.stringify(f,null,p[6]?parseInt(p[6]):0);break;case"e":f=p[7]?f.toExponential(p[7]):f.toExponential();break;case"f":f=p[7]?parseFloat(f).toFixed(p[7]):parseFloat(f);break;case"g":f=p[7]?parseFloat(f).toPrecision(p[7]):parseFloat(f);break;case"o":f=f.toString(8);break;case"s":f=(f=String(f))&&p[7]?f.substring(0,p[7]):f;break;case"u":f>>>=0;break;case"x":f=f.toString(16);break;case"X":f=f.toString(16).toUpperCase()}t.json.test(p[8])?l[l.length]=f:(t.number.test(p[8])&&(!g||p[3])?(y=g?"+":"-",f=f.toString().replace(t.sign,"")):y="",v=p[4]?p[4]==="0"?"0":p[4].charAt(1):" ",m=p[6]-(y+f).length,d=p[6]?m>0?s(v,m):"":"",l[l.length]=p[5]?y+f+d:v==="0"?y+d+f:d+y+f)}}return l.join("")},n.cache={},n.parse=function(e){var n=e,r=[],i=[],s=0;while(n){if((r=t.text.exec(n))!==null)i[i.length]=r[0];else if((r=t.modulo.exec(n))!==null)i[i.length]="%";else{if((r=t.placeholder.exec(n))===null)throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){s|=1;var o=[],u=r[2],a=[];if((a=t.key.exec(u))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=a[1];while((u=u.substring(a[0].length))!=="")if((a=t.key_access.exec(u))!==null)o[o.length]=a[1];else{if((a=t.index_access.exec(u))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=a[1]}r[2]=o}else s|=2;if(s===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=r}n=n.substring(r[0].length)}return i};var r=function(e,t,r){return r=(t||[]).slice(0),r.splice(0,0,e),n.apply(null,r)};typeof exports!="undefined"?(exports.sprintf=n,exports.vsprintf=r):(e.sprintf=n,e.vsprintf=r,typeof define=="function"&&define.amd&&define("sprintf",[],function(){return{sprintf:n,vsprintf:r}}))}(typeof window=="undefined"?this:window),function(e){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal,"undefined"!=typeof e&&(e.extend(e.fn,{ckeditorGet:function(){var e=this.eq(0).data("ckeditorInstance");if(!e)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return e},ckeditor:function(t,n){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!e.isFunction(t))var r=n,n=t,t=r;var i=[],n=n||{};this.each(function(){var r=e(this),s=r.data("ckeditorInstance"),o=r.data("_ckeditorInstanceLock"),u=this,f=new e.Deferred;i.push(f.promise());if(s&&!o)t&&t.apply(s,[this]),f.resolve();else if(o)s.once("instanceReady",function(){setTimeout(function(){s.element?(s.element.$==u&&t&&t.apply(s,[u]),f.resolve()):setTimeout(arguments.callee,100)},0)},null,null,9999);else{if(n.autoUpdateElement||"undefined"==typeof n.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)n.autoUpdateElementJquery=!0;n.autoUpdateElement=!1,r.data("_ckeditorInstanceLock",!0),s=e(this).is("textarea")?CKEDITOR.replace(u,n):CKEDITOR.inline(u,n),r.data("ckeditorInstance",s),s.on("instanceReady",function(n){var i=n.editor;setTimeout(function(){if(i.element){n.removeListener(),i.on("dataReady",function(){r.trigger("dataReady.ckeditor",[i])}),i.on("setData",function(e){r.trigger("setData.ckeditor",[i,e.data])}),i.on("getData",function(e){r.trigger("getData.ckeditor",[i,e.data])},999),i.on("destroy",function(){r.trigger("destroy.ckeditor",[i])}),i.on("save",function(){return e(u.form).submit(),!1},null,null,20);if(i.config.autoUpdateElementJquery&&r.is("textarea")&&e(u.form).length){var s=function(){r.ckeditor(function(){i.updateElement()})};e(u.form).submit(s),e(u.form).bind("form-pre-serialize",s),r.bind("destroy.ckeditor",function(){e(u.form).unbind("submit",s),e(u.form).unbind("form-pre-serialize",s)})}i.on("destroy",function(){r.removeData("ckeditorInstance")}),r.removeData("_ckeditorInstanceLock"),r.trigger("instanceReady.ckeditor",[i]),t&&t.apply(i,[u]),f.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var s=new e.Deferred;return this.promise=s.promise(),e.when.apply(this,i).then(function(){s.resolve()}),this.editor=this.eq(0).data("ckeditorInstance"),this}}),CKEDITOR.config.jqueryOverrideVal&&(e.fn.val=CKEDITOR.tools.override(e.fn.val,function(t){return function(n){if(arguments.length){var r=this,i=[],s=this.each(function(){var r=e(this),s=r.data("ckeditorInstance");if(r.is("textarea")&&s){var o=new e.Deferred;return s.setData(n,function(){o.resolve()}),i.push(o.promise()),!0}return t.call(r,n)});if(i.length){var o=new e.Deferred;return e.when.apply(this,i).done(function(){o.resolveWith(r)}),o.promise()}return s}var s=e(this).eq(0),u=s.data("ckeditorInstance");return s.is("textarea")&&u?u.getData():t.call(s)}})))}(window.jQuery),define("jqueryAdapter",function(){}),define("pasteFromWordPlugin",[],function(){"use strict";var e=function(e,t){var n=e.document.createElement("p");n.setHtml(t),e.insertElement(n)};return function(t){return{init:function(n){n.addCommand("pasteFromWordDialog",{dialogName:"pasteFromWordDialog",exec:function(){var r=$("<div/>");$("body").append(r),t.start([{name:"ckeditor/plugins/paste-from-word@husky",options:{el:r,title:n.lang.pastefromword.title,info:n.lang.clipboard.copyError,enterMode:n.config.enterMode,message:n.lang.clipboard.pasteMsg,saveCallback:function(i){t.stop(r),e(n,i)}}}])}}),n.ui.addButton("PasteFromWord",{label:n.lang.pastefromword.toolbar,command:"pasteFromWordDialog",toolbar:"clipboard,50"})}}}}),function(e,t){typeof define=="function"&&define.amd?define("html.sortable",["jquery"],t):typeof exports=="object"?module.exports=t(require("jquery")):e.sortable=t(e.jQuery)}(this,function(e){var t,n,r=e(),i=[],s=function(e){e.off("dragstart.h5s"),e.off("dragend.h5s"),e.off("selectstart.h5s"),e.off("dragover.h5s"),e.off("dragenter.h5s"),e.off("drop.h5s")},o=function(e){e.off("dragover.h5s"),e.off("dragenter.h5s"),e.off("drop.h5s")},u=function(e,t){e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text",""),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(t.item,t.x,t.y)},a=function(e,t){return t.x||(t.x=parseInt(e.pageX-t.draggedItem.offset().left)),t.y||(t.y=parseInt(e.pageY-t.draggedItem.offset().top)),t},f=function(e){return{item:e[0],draggedItem:e}},l=function(e,t){var n=f(t);n=a(e,n),u(e,n)},c=function(e,t){return typeof e=="undefined"?t:e},h=function(e){e.removeData("opts"),e.removeData("connectWith"),e.removeData("items"),e.removeAttr("aria-dropeffect")},p=function(e){e.removeAttr("aria-grabbed"),e.removeAttr("draggable"),e.removeAttr("role")},d=function(e,t){return e[0]===t[0]?!0:e.data("connectWith")!==undefined?e.data("connectWith")===t.data("connectWith"):!1},v=function(e){var t=e.data("opts")||{},n=e.children(t.items),r=t.handle?n.find(t.handle):n;o(e),h(e),r.off("mousedown.h5s"),s(n),p(n)},m=function(t){var n=t.data("opts"),r=t.children(n.items),i=n.handle?r.find(n.handle):r;t.attr("aria-dropeffect","move"),i.attr("draggable","true");var s=(document||window.document).createElement("span");typeof s.dragDrop=="function"&&!n.disableIEFix&&i.on("mousedown.h5s",function(){r.index(this)!==-1?this.dragDrop():e(this).parents(n.items)[0].dragDrop()})},g=function(e){var t=e.data("opts"),n=e.children(t.items),r=t.handle?n.find(t.handle):n;e.attr("aria-dropeffect","none"),r.attr("draggable",!1),r.off("mousedown.h5s")},y=function(e){var t=e.data("opts"),n=e.children(t.items),r=t.handle?n.find(t.handle):n;s(n),r.off("mousedown.h5s"),o(e)},b=function(s,o){var a=e(s),f=String(o);return o=e.extend({connectWith:!1,placeholder:null,dragImage:null,disableIEFix:!1,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1},o),a.each(function(){var s=e(this);if(/enable|disable|destroy/.test(f)){b[f](s);return}o=c(s.data("opts"),o),s.data("opts",o),y(s);var a=s.children(o.items),h,p,v,g=o.placeholder===null?e("<"+(/^ul|ol$/i.test(this.tagName)?"li":"div")+' class="'+o.placeholderClass+'"/>'):e(o.placeholder).addClass(o.placeholderClass);if(!s.attr("data-sortable-id")){var w=i.length;i[w]=s,s.attr("data-sortable-id",w),a.attr("data-item-sortable-id",w)}s.data("items",o.items),r=r.add(g),o.connectWith&&s.data("connectWith",o.connectWith),m(s),a.attr("role","option"),a.attr("aria-grabbed","false");if(o.hoverClass){var E="sortable-over";typeof o.hoverClass=="string"&&(E=o.hoverClass),a.hover(function(){e(this).addClass(E)},function(){e(this).removeClass(E)})}a.on("dragstart.h5s",function(r){r.stopImmediatePropagation(),o.dragImage?(u(r.originalEvent,{item:o.dragImage,x:0,y:0}),console.log("WARNING: dragImage option is deprecated and will be removed in the future!")):l(r.originalEvent,e(this),o.dragImage),t=e(this),t.addClass(o.draggingClass),t.attr("aria-grabbed","true"),h=t.index(),n=t.height(),p=e(this).parent(),t.parent().triggerHandler("sortstart",{item:t,placeholder:g,startparent:p})}),a.on("dragend.h5s",function(){if(!t)return;t.removeClass(o.draggingClass),t.attr("aria-grabbed","false"),t.show(),r.detach(),v=e(this).parent(),t.parent().triggerHandler("sortstop",{item:t,startparent:p}),(h!==t.index()||p.get(0)!==v.get(0))&&t.parent().triggerHandler("sortupdate",{item:t,index:v.children(v.data("items")).index(t),oldindex:a.index(t),elementIndex:t.index(),oldElementIndex:h,startparent:p,endparent:v}),t=null,n=null}),e(this).add([g]).on("drop.h5s",function(n){if(!d(s,e(t).parent()))return;return n.stopPropagation(),r.filter(":visible").after(t),t.trigger("dragend.h5s"),!1}),a.add([this]).on("dragover.h5s dragenter.h5s",function(i){if(!d(s,e(t).parent()))return;i.preventDefault(),i.originalEvent.dataTransfer.dropEffect="move";if(a.is(this)){var u=e(this).height();o.forcePlaceholderSize&&g.height(n);if(u>n){var f=u-n,l=e(this).offset().top;if(g.index()<e(this).index()&&i.originalEvent.pageY<l+f)return!1;if(g.index()>e(this).index()&&i.originalEvent.pageY>l+u-f)return!1}t.hide(),g.index()<e(this).index()?e(this).after(g):e(this).before(g),r.not(g).detach()}else!r.is(this)&&!e(this).children(o.items).length&&(r.detach(),e(this).append(g));return!1})})};return b.destroy=function(e){v(e)},b.enable=function(e){m(e)},b.disable=function(e){g(e)},e.fn.sortable=function(e){return b(this,e)},b}),function(e){"use strict";function a(e){var t;if(e===null||e===undefined)return!1;if(n.isArray(e))return e.length>0;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return!0;for(t in e)if(e.hasOwnProperty(t)&&a(e[t]))return!0;return!1}var t=function(){function e(e){this.options=e}return e.prototype.toString=function(){return JSON&&JSON.stringify?JSON.stringify(this.options):this.options},e}(),n=function(){function e(e){return Object.prototype.toString.apply(e)==="[object Array]"}function t(e){return Object.prototype.toString.apply(e)==="[object String]"}function n(e){return Object.prototype.toString.apply(e)==="[object Number]"}function r(e){return Object.prototype.toString.apply(e)==="[object Boolean]"}function i(e,t){var n="",r=!0,i;for(i=0;i<e.length;i+=1)r?r=!1:n+=t,n+=e[i];return n}function s(e,t){var n=[],r=0;for(;r<e.length;r+=1)n.push(t(e[r]));return n}function o(e,t){var n=[],r=0;for(;r<e.length;r+=1)t(e[r])&&n.push(e[r]);return n}function u(e){if(typeof e!="object"||e===null)return e;Object.freeze(e);var t,n;for(n in e)e.hasOwnProperty(n)&&(t=e[n],typeof t=="object"&&a(t));return e}function a(e){return typeof Object.freeze=="function"?u(e):e}return{isArray:e,isString:t,isNumber:n,isBoolean:r,join:i,map:s,filter:o,deepFreeze:a}}(),r=function(){function e(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function t(e){return e>="0"&&e<="9"}function n(e){return t(e)||e>="a"&&e<="f"||e>="A"&&e<="F"}return{isAlpha:e,isDigit:t,isHexDigit:n}}(),i=function(){function t(t){var n="",r=e.encode(t),i,s;for(s=0;s<r.length;s+=1)i=r.charCodeAt(s),n+="%"+(i<16?"0":"")+i.toString(16).toUpperCase();return n}function n(e,t){return e.charAt(t)==="%"&&r.isHexDigit(e.charAt(t+1))&&r.isHexDigit(e.charAt(t+2))}function i(e,t){return parseInt(e.substr(t,2),16)}function s(t){if(!n(t,0))return!1;var r=i(t,1),s=e.numBytes(r);if(s===0)return!1;for(var o=1;o<s;o+=1)if(!n(t,3*o)||!e.isValidFollowingCharCode(i(t,3*o+1)))return!1;return!0}function o(t,r){var s=t.charAt(r);if(!n(t,r))return s;var o=i(t,r+1),u=e.numBytes(o);if(u===0)return s;for(var a=1;a<u;a+=1)if(!n(t,r+3*a)||!e.isValidFollowingCharCode(i(t,r+3*a+1)))return s;return t.substr(r,3*u)}var e={encode:function(e){return unescape(encodeURIComponent(e))},numBytes:function(e){return e<=127?1:194<=e&&e<=223?2:224<=e&&e<=239?3:240<=e&&e<=244?4:0},isValidFollowingCharCode:function(e){return 128<=e&&e<=191}};return{encodeCharacter:t,isPctEncoded:s,pctCharAt:o}}(),s=function(){function e(e){return r.isAlpha(e)||r.isDigit(e)||e==="_"||i.isPctEncoded(e)}function t(e){return r.isAlpha(e)||r.isDigit(e)||e==="-"||e==="."||e==="_"||e==="~"}function n(e){return e===":"||e==="/"||e==="?"||e==="#"||e==="["||e==="]"||e==="@"||e==="!"||e==="$"||e==="&"||e==="("||e===")"||e==="*"||e==="+"||e===","||e===";"||e==="="||e==="'"}return{isVarchar:e,isUnreserved:t,isReserved:n}}(),o=function(){function e(e,t){var n="",r,o="";if(typeof e=="number"||typeof e=="boolean")e=e.toString();for(r=0;r<e.length;r+=o.length)o=e.charAt(r),n+=s.isUnreserved(o)||t&&s.isReserved(o)?o:i.encodeCharacter(o);return n}function t(t){return e(t,!0)}function n(e,t){var n=i.pctCharAt(e,t);return n.length>1?n:s.isReserved(n)||s.isUnreserved(n)?n:i.encodeCharacter(n)}function r(e){var t="",n,r="";for(n=0;n<e.length;n+=r.length)r=i.pctCharAt(e,n),r.length>1?t+=r:t+=s.isReserved(r)||s.isUnreserved(r)?r:i.encodeCharacter(r);return t}return{encode:e,encodePassReserved:t,encodeLiteral:r,encodeLiteralCharacter:n}}(),u=function(){function t(t){e[t]={symbol:t,separator:t==="?"?"&":t===""||t==="+"||t==="#"?",":t,named:t===";"||t==="&"||t==="?",ifEmpty:t==="&"||t==="?"?"=":"",first:t==="+"?"":t,encode:t==="+"||t==="#"?o.encodePassReserved:o.encode,toString:function(){return this.symbol}}}var e={};return t(""),t("+"),t("#"),t("."),t("/"),t(";"),t("?"),t("&"),{valueOf:function(t){return e[t]?e[t]:"=,!@|".indexOf(t)>=0?null:e[""]}}}(),f=function(){function e(e){this.literal=o.encodeLiteral(e)}return e.prototype.expand=function(){return this.literal},e.prototype.toString=e.prototype.expand,e}(),l=function(){function e(e){function d(){var n=e.substring(f,h);if(n.length===0)throw new t({expressionText:e,message:"a varname must be specified",position:h});a={varname:n,exploded:!1,maxLength:null},f=null}function v(){if(l===h)throw new t({expressionText:e,message:"after a ':' you have to specify the length",position:h});a.maxLength=parseInt(e.substring(l,h),10),l=null}var n,o=[],a=null,f=null,l=null,h,p="";n=function(n){var r=u.valueOf(n);if(r===null)throw new t({expressionText:e,message:"illegal use of reserved operator",position:h,operator:n});return r}(e.charAt(0)),h=n.symbol.length,f=h;for(;h<e.length;h+=p.length){p=i.pctCharAt(e,h);if(f!==null){if(p==="."){if(f===h)throw new t({expressionText:e,message:"a varname MUST NOT start with a dot",position:h});continue}if(s.isVarchar(p))continue;d()}if(l!==null){if(h===l&&p==="0")throw new t({expressionText:e,message:"A :prefix must not start with digit 0",position:h});if(r.isDigit(p)){if(h-l>=4)throw new t({expressionText:e,message:"A :prefix must have max 4 digits",position:h});continue}v()}if(p===":"){if(a.maxLength!==null)throw new t({expressionText:e,message:"only one :maxLength is allowed per varspec",position:h});if(a.exploded)throw new t({expressionText:e,message:"an exploeded varspec MUST NOT be varspeced",position:h});l=h+1;continue}if(p==="*"){if(a===null)throw new t({expressionText:e,message:"exploded without varspec",position:h});if(a.exploded)throw new t({expressionText:e,message:"exploded twice",position:h});if(a.maxLength)throw new t({expressionText:e,message:"an explode (*) MUST NOT follow to a prefix",position:h});a.exploded=!0;continue}if(p===","){o.push(a),a=null,f=h+1;continue}throw new t({expressionText:e,message:"illegal character",character:p,position:h})}return f!==null&&d(),l!==null&&v(),o.push(a),new c(e,n,o)}function n(n){var r,i,s=[],o=null,u=0;for(r=0;r<n.length;r+=1){i=n.charAt(r);if(u!==null){if(i==="}")throw new t({templateText:n,message:"unopened brace closed",position:r});i==="{"&&(u<r&&s.push(new f(n.substring(u,r))),u=null,o=r);continue}if(o!==null){if(i==="{")throw new t({templateText:n,message:"brace already opened",position:r});if(i==="}"){if(o+1===r)throw new t({templateText:n,message:"empty braces",position:o});try{s.push(e(n.substring(o+1,r)))}catch(a){throw a.prototype===t.prototype?new t({templateText:n,message:a.options.message,position:o+a.options.position,details:a.options}):a}o=null,u=r+1}continue}throw new Error("reached unreachable code")}if(o!==null)throw new t({templateText:n,message:"unclosed brace",position:o});return u<n.length&&s.push(new f(n.substr(u))),new h(n,s)}return n}(),c=function(){function e(e){return JSON&&JSON.stringify?JSON.stringify(e):e}function t(e){if(!a(e))return!0;if(n.isString(e))return e==="";if(n.isNumber(e)||n.isBoolean(e))return!1;if(n.isArray(e))return e.length===0;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function r(e){var t=[],n;for(n in e)e.hasOwnProperty(n)&&t.push({name:n,value:e[n]});return t}function i(e,t,n){this.templateText=e,this.operator=t,this.varspecs=n}function s(e,t,n){var r="";n=n.toString();if(t.named){r+=o.encodeLiteral(e.varname);if(n==="")return r+=t.ifEmpty,r;r+="="}return e.maxLength!==null&&(n=n.substr(0,e.maxLength)),r+=t.encode(n),r}function u(e){return a(e.value)}function f(e,i,s){var f=[],l="";if(i.named){l+=o.encodeLiteral(e.varname);if(t(s))return l+=i.ifEmpty,l;l+="="}return n.isArray(s)?(f=s,f=n.filter(f,a),f=n.map(f,i.encode),l+=n.join(f,",")):(f=r(s),f=n.filter(f,u),f=n.map(f,function(e){return i.encode(e.name)+","+i.encode(e.value)}),l+=n.join(f,",")),l}function l(e,i,s){var f=n.isArray(s),l=[];return f?(l=s,l=n.filter(l,a),l=n.map(l,function(n){var r=o.encodeLiteral(e.varname);return t(n)?r+=i.ifEmpty:r+="="+i.encode(n),r})):(l=r(s),l=n.filter(l,u),l=n.map(l,function(e){var n=o.encodeLiteral(e.name);return t(e.value)?n+=i.ifEmpty:n+="="+i.encode(e.value),n})),n.join(l,i.separator)}function c(e,t){var i=[],s="";return n.isArray(t)?(i=t,i=n.filter(i,a),i=n.map(i,e.encode),s+=n.join(i,e.separator)):(i=r(t),i=n.filter(i,function(e){return a(e.value)}),i=n.map(i,function(t){return e.encode(t.name)+"="+e.encode(t.value)}),s+=n.join(i,e.separator)),s}return i.prototype.toString=function(){return this.templateText},i.prototype.expand=function(r){var i=[],o,u,h,p,d=!1,v=this.operator;for(o=0;o<this.varspecs.length;o+=1){u=this.varspecs[o],h=r[u.varname];if(h===null||h===undefined)continue;u.exploded&&(d=!0),p=n.isArray(h);if(typeof h=="string"||typeof h=="number"||typeof h=="boolean")i.push(s(u,v,h));else{if(u.maxLength&&a(h))throw new Error("Prefix modifiers are not applicable to variables that have composite values. You tried to expand "+this+" with "+e(h));u.exploded?a(h)&&(v.named?i.push(l(u,v,h)):i.push(c(v,h))):(v.named||!t(h))&&i.push(f(u,v,h))}}return i.length===0?"":v.first+n.join(i,v.separator)},i}(),h=function(){function e(e,t){this.templateText=e,this.expressions=t,n.deepFreeze(this)}return e.prototype.toString=function(){return this.templateText},e.prototype.expand=function(e){var t,n="";for(t=0;t<this.expressions.length;t+=1)n+=this.expressions[t].expand(e);return n},e.parse=l,e.UriTemplateError=t,e}();e(h)}(function(e){"use strict";typeof module!="undefined"?module.exports=e:typeof define=="function"?define("uri-template",[],function(){return e}):typeof window!="undefined"?window.UriTemplate=e:global.UriTemplate=e}),function(e){var t=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return typeof e=="string"},isNumber:function(e){return typeof e=="number"},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return typeof e=="undefined"},toStr:function(n){return t.isUndefined(n)||n===null?"":n+""},bind:e.proxy,each:function(t,n){function r(e,t){return n(t,e)}e.each(t,r)},map:e.map,filter:e.grep,every:function(t,n){var r=!0;return t?(e.each(t,function(e,i){if(!(r=n.call(null,i,e,t)))return!1}),!!r):r},some:function(t,n){var r=!1;return t?(e.each(t,function(e,i){if(r=n.call(null,i,e,t))return!1}),!!r):r},mixin:e.extend,getUniqueId:function(){var e=0;return function(){return e++}}(),templatify:function(n){function r(){return String(n)}return e.isFunction(n)?n:r},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r,i;return function(){var s=this,o=arguments,u,a;return u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r,clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},throttle:function(e,t){var n,r,i,s,o,u;return o=0,u=function(){o=new Date,i=null,s=e.apply(n,r)},function(){var a=new Date,f=t-(a-o);return n=this,r=arguments,f<=0?(clearTimeout(i),i=null,o=a,s=e.apply(n,r)):i||(i=setTimeout(u,f)),s}},noop:function(){}}}(),n="0.10.5",r=function(){"use strict";function e(e){return e=t.toStr(e),e?e.split(/\s+/):[]}function n(e){return e=t.toStr(e),e?e.split(/\W+/):[]}function r(e){return function(){var r=[].slice.call(arguments,0);return function(i){var s=[];return t.each(r,function(n){s=s.concat(e(t.toStr(i[n])))}),s}}}return{nonword:n,whitespace:e,obj:{nonword:r(n),whitespace:r(e)}}}(),i=function(){"use strict";function n(n){this.maxSize=t.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function r(){this.head=this.tail=null}function i(e,t){this.key=e,this.val=t,this.prev=this.next=null}return t.mixin(n.prototype,{set:function(t,n){var r=this.list.tail,s;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]),(s=this.hash[t])?(s.val=n,this.list.moveToFront(s)):(s=new i(t,n),this.list.add(s),this.hash[t]=s,this.size++)},get:function(t){var n=this.hash[t];if(n)return this.list.moveToFront(n),n.val},reset:function(){this.size=0,this.hash={},this.list=new r}}),t.mixin(r.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(e){this.remove(e),this.add(e)}}),n}(),s=function(){"use strict";function i(e){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix))}function s(){return(new Date).getTime()}function o(e){return JSON.stringify(t.isUndefined(e)?null:e)}function u(e){return JSON.parse(e)}var e,n;try{e=window.localStorage,e.setItem("~~~","!"),e.removeItem("~~~")}catch(r){e=null}return e&&window.JSON?n={_prefix:function(e){return this.prefix+e},_ttlKey:function(e){return this._prefix(e)+this.ttlKey},get:function(t){return this.isExpired(t)&&this.remove(t),u(e.getItem(this._prefix(t)))},set:function(n,r,i){return t.isNumber(i)?e.setItem(this._ttlKey(n),o(s()+i)):e.removeItem(this._ttlKey(n)),e.setItem(this._prefix(n),o(r))},remove:function(t){return e.removeItem(this._ttlKey(t)),e.removeItem(this._prefix(t)),this},clear:function(){var t,n,r=[],i=e.length;for(t=0;t<i;t++)(n=e.key(t)).match(this.keyMatcher)&&r.push(n.replace(this.keyMatcher,""));for(t=r.length;t--;)this.remove(r[t]);return this},isExpired:function(n){var r=u(e.getItem(this._ttlKey(n)));return t.isNumber(r)&&s()>r?!0:!1}}:n={get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(i.prototype,n),i}(),o=function(){"use strict";function u(t){t=t||{},this.cancelled=!1,this.lastUrl=null,this._send=t.transport?a(t.transport):e.ajax,this._get=t.rateLimiter?t.rateLimiter(this._get):this._get,this._cache=t.cache===!1?new i(0):o}function a(n){return function(i,s){function u(e){t.defer(function(){o.resolve(e)})}function a(e){t.defer(function(){o.reject(e)})}var o=e.Deferred();return n(i,s,u,a),o}}var n=0,r={},s=6,o=new i(10);return u.setMaxPendingRequests=function(t){s=t},u.resetCache=function(){o.reset()},t.mixin(u.prototype,{_get:function(e,t,i){function a(t){i&&i(null,t),o._cache.set(e,t)}function f(){i&&i(!0)}function l(){n--,delete r[e],o.onDeckRequestArgs&&(o._get.apply(o,o.onDeckRequestArgs),o.onDeckRequestArgs=null)}var o=this,u;if(this.cancelled||e!==this.lastUrl)return;(u=r[e])?u.done(a).fail(f):n<s?(n++,r[e]=this._send(e,t).done(a).fail(f).always(l)):this.onDeckRequestArgs=[].slice.call(arguments,0)},get:function(e,n,r){var i;return t.isFunction(n)&&(r=n,n={}),this.cancelled=!1,this.lastUrl=e,(i=this._cache.get(e))?t.defer(function(){r&&r(null,i)}):this._get(e,n,r),!!i},cancel:function(){this.cancelled=!0}}),u}(),u=function(){"use strict";function n(t){t=t||{},(!t.datumTokenizer||!t.queryTokenizer)&&e.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}function r(e){return e=t.filter(e,function(e){return!!e}),e=t.map(e,function(e){return e.toLowerCase()}),e}function i(){return{ids:[],children:{}}}function s(e){var t={},n=[];for(var r=0,i=e.length;r<i;r++)t[e[r]]||(t[e[r]]=!0,n.push(e[r]));return n}function o(e,t){function u(e,t){return e-t}var n=0,r=0,i=[];e=e.sort(u),t=t.sort(u);var s=e.length,o=t.length;while(n<s&&r<o)e[n]<t[r]?n++:e[n]>t[r]?r++:(i.push(e[n]),n++,r++);return i}return t.mixin(n.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(e){var n=this;e=t.isArray(e)?e:[e],t.each(e,function(e){var s,o;s=n.datums.push(e)-1,o=r(n.datumTokenizer(e)),t.each(o,function(e){var t,r,o;t=n.trie,r=e.split("");while(o=r.shift())t=t.children[o]||(t.children[o]=i()),t.ids.push(s)})})},get:function(n){var i=this,u,a;return u=r(this.queryTokenizer(n)),t.each(u,function(e){var t,n,r,s;if(a&&a.length===0)return!1;t=i.trie,n=e.split("");while(t&&(r=n.shift()))t=t.children[r];if(!t||n.length!==0)return a=[],!1;s=t.ids.slice(0),a=a?o(a,s):s}),a?t.map(s(a),function(e){return i.datums[e]}):[]},reset:function(){this.datums=[],this.trie=i()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),a=function(){"use strict";function r(e){return e.local||null}function i(r){var i,s;s={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}};if(i=r.prefetch||null)i=t.isString(i)?{url:i}:i,i=t.mixin(s,i),i.thumbprint=n+i.thumbprint,i.ajax.type=i.ajax.type||"GET",i.ajax.dataType=i.ajax.dataType||"json",!i.url&&e.error("prefetch requires url to be set");return i}function s(n){function s(e){return function(n){return t.debounce(n,e)}}function o(e){return function(n){return t.throttle(n,e)}}var r,i;i={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}};if(r=n.remote||null)r=t.isString(r)?{url:r}:r,r=t.mixin(i,r),r.rateLimiter=/^throttle$/i.test(r.rateLimitBy)?o(r.rateLimitWait):s(r.rateLimitWait),r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",delete r.rateLimitBy,delete r.rateLimitWait,!r.url&&e.error("remote requires url to be set");return r}return{local:r,prefetch:i,remote:s}}();(function(n){"use strict";function l(t){(!t||!t.local&&!t.prefetch&&!t.remote)&&e.error("one of local, prefetch, or remote is required"),this.limit=t.limit||5,this.sorter=c(t.sorter),this.dupDetector=t.dupDetector||h,this.local=a.local(t),this.prefetch=a.prefetch(t),this.remote=a.remote(t),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new u({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),this.storage=this.cacheKey?new s(this.cacheKey):null}function c(e){function n(t){return t.sort(e)}function r(e){return e}return t.isFunction(e)?n:r}function h(){return!1}var i,f;return i=n.Bloodhound,f={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.Bloodhound=l,l.noConflict=function(){return n.Bloodhound=i,l},l.tokenizers=r,t.mixin(l.prototype,{_loadPrefetch:function(n){function o(e){r.clear(),r.add(n.filter?n.filter(e):e),r._saveToStorage(r.index.serialize(),n.thumbprint,n.ttl)}var r=this,i,s;return(i=this._readFromStorage(n.thumbprint))?(this.index.bootstrap(i),s=e.Deferred().resolve()):s=e.ajax(n.url,n.ajax).done(o),s},_getFromRemote:function(t,n){function o(e,t){e?n([]):n(r.remote.filter?r.remote.filter(t):t)}var r=this,i,s;if(!this.transport)return;return t=t||"",s=encodeURIComponent(t),i=this.remote.replace?this.remote.replace(this.remote.url,t):this.remote.url.replace(this.remote.wildcard,s),this.transport.get(i,this.remote.ajax,o)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(t,n,r){this.storage&&(this.storage.set(f.data,t,r),this.storage.set(f.protocol,location.protocol,r),this.storage.set(f.thumbprint,n,r))},_readFromStorage:function(t){var n={},r;return this.storage&&(n.data=this.storage.get(f.data),n.protocol=this.storage.get(f.protocol),n.thumbprint=this.storage.get(f.thumbprint)),r=n.thumbprint!==t||n.protocol!==location.protocol,n.data&&!r?n.data:null},_initialize:function(){function u(){r.add(t.isFunction(i)?i():i)}var r=this,i=this.local,s;return s=this.prefetch?this._loadPrefetch(this.prefetch):e.Deferred().resolve(),i&&s.done(u),this.transport=this.remote?new o(this.remote):null,this.initPromise=s.promise()},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){this.index.add(t)},get:function(n,r){function u(e){var n=s.slice(0);t.each(e,function(e){var r;return r=t.some(n,function(t){return i.dupDetector(e,t)}),!r&&n.push(e),n.length<i.limit}),r&&r(i.sorter(n))}var i=this,s=[],o=!1;s=this.index.get(n),s=this.sorter(s).slice(0,this.limit),s.length<this.limit?o=this._getFromRemote(n,u):this._cancelLastRemoteRequest(),o||(s.length>0||!this.transport)&&r&&r(s)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&o.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),l})(this);var f=function(){return{wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'}}(),l=function(){"use strict";var e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&t.mixin(e.input,{marginTop:"-1px"}),e}(),c=function(){"use strict";function r(t){(!t||!t.el)&&e.error("EventBus initialized without el"),this.$el=e(t.el)}var n="typeahead:";return t.mixin(r.prototype,{trigger:function(e){var t=[].slice.call(arguments,1);this.$el.trigger(n+e,t)}}),r}(),h=function(){"use strict";function n(t,n,r,i){var s;if(!r)return this;n=n.split(e),r=i?f(r,i):r,this._callbacks=this._callbacks||{};while(s=n.shift())this._callbacks[s]=this._callbacks[s]||{sync:[],async:[]},this._callbacks[s][t].push(r);return this}function r(e,t,r){return n.call(this,"async",e,t,r)}function i(e,t,r){return n.call(this,"sync",e,t,r)}function s(t){var n;if(!this._callbacks)return this;t=t.split(e);while(n=t.shift())delete this._callbacks[n];return this}function o(n){var r,i,s,o,a;if(!this._callbacks)return this;n=n.split(e),s=[].slice.call(arguments,1);while((r=n.shift())&&(i=this._callbacks[r]))o=u(i.sync,this,[r].concat(s)),a=u(i.async,this,[r].concat(s)),o()&&t(a);return this}function u(e,t,n){function r(){var r;for(var i=0,s=e.length;!r&&i<s;i+=1)r=e[i].apply(t,n)===!1;return!r}return r}function a(){var e;return window.setImmediate?e=function(t){setImmediate(function(){t()})}:e=function(t){setTimeout(function(){t()},0)},e}function f(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}var e=/\s+/,t=a();return{onSync:i,onAsync:r,off:s,trigger:o}}(),p=function(e){"use strict";function r(e,n,r){var i=[],s;for(var o=0,u=e.length;o<u;o++)i.push(t.escapeRegExChars(e[o]));return s=r?"\\b("+i.join("|")+")\\b":"("+i.join("|")+")",n?new RegExp(s):new RegExp(s,"i")}var n={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(s){function u(t){var n,r,i;if(n=o.exec(t.data))i=e.createElement(s.tagName),s.className&&(i.className=s.className),r=t.splitText(n.index),r.splitText(n[0].length),i.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(i,r);return!!n}function a(e,t){var n,r=3;for(var i=0;i<e.childNodes.length;i++)n=e.childNodes[i],n.nodeType===r?i+=t(n)?1:0:a(n,t)}var o;s=t.mixin({},n,s);if(!s.node||!s.pattern)return;s.pattern=t.isArray(s.pattern)?s.pattern:[s.pattern],o=r(s.pattern,s.caseSensitive,s.wordsOnly),a(s.node,u)}}(window.document),d=function(){"use strict";function r(r){var s=this,o,u,a,f;r=r||{},r.input||e.error("input is missing"),o=t.bind(this._onBlur,this),u=t.bind(this._onFocus,this),a=t.bind(this._onKeydown,this),f=t.bind(this._onInput,this),this.$hint=e(r.hint),this.$input=e(r.input).on("blur.tt",o).on("focus.tt",u).on("keydown.tt",a),this.$hint.length===0&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(e){if(n[e.which||e.keyCode])return;t.defer(t.bind(s._onInput,s,e))}):this.$input.on("input.tt",f),this.query=this.$input.val(),this.$overflowHelper=i(this.$input)}function i(t){return e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function s(e,t){return r.normalizeQuery(e)===r.normalizeQuery(t)}function o(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var n;return n={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},r.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(r.prototype,h,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(t){var r=n[t.which||t.keyCode];this._managePreventDefault(r,t),r&&this._shouldTrigger(r,t)&&this.trigger(r+"Keyed",t)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(t,n){var r,i,s;switch(t){case"tab":i=this.getHint(),s=this.getInputValue(),r=i&&i!==s&&!o(n);break;case"up":case"down":r=!o(n);break;default:r=!1}r&&n.preventDefault()},_shouldTrigger:function(t,n){var r;switch(t){case"tab":r=!o(n);break;default:r=!0}return r},_checkInputValue:function(){var t,n,r;t=this.getInputValue(),n=s(t,this.query),r=n?this.query.length!==t.length:!1,this.query=t,n?r&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(t){this.query=t},getInputValue:function(){return this.$input.val()},setInputValue:function(t,n){this.$input.val(t),n?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,n,r,i;t=this.getInputValue(),n=this.getHint(),r=t!==n&&n.indexOf(t)===0,i=t!==""&&r&&!this.hasOverflow(),!i&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var e,n,r;return e=this.$input.val().length,n=this.$input[0].selectionStart,t.isNumber(n)?n===e:document.selection?(r=document.selection.createRange(),r.moveStart("character",-e),e===r.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),r}(),v=function(){"use strict";function s(n){n=n||{},n.templates=n.templates||{},n.source||e.error("missing source"),n.name&&!a(n.name)&&e.error("invalid dataset name: "+n.name),this.query=null,this.highlight=!!n.highlight,this.name=n.name||t.getUniqueId(),this.source=n.source,this.displayFn=o(n.display||n.displayKey),this.templates=u(n.templates,this.displayFn),this.$el=e(f.dataset.replace("%CLASS%",this.name))}function o(e){function n(t){return t[e]}return e=e||"value",t.isFunction(e)?e:n}function u(e,n){function r(e){return"<p>"+n(e)+"</p>"}return{empty:e.empty&&t.templatify(e.empty),header:e.header&&t.templatify(e.header),footer:e.footer&&t.templatify(e.footer),suggestion:e.suggestion||r}}function a(e){return/^[_a-zA-Z0-9-]+$/.test(e)}var n="ttDataset",r="ttValue",i="ttDatum";return s.extractDatasetName=function(r){return e(r).data(n)},s.extractValue=function(n){return e(n).data(r)},s.extractDatum=function(n){return e(n).data(i)},t.mixin(s.prototype,h,{_render:function(o,u){function h(){return a.templates.empty({query:o,isEmpty:!0})}function d(){function h(t){var s;return s=e(f.suggestion).append(a.templates.suggestion(t)).data(n,a.name).data(r,a.displayFn(t)).data(i,t),s.children().each(function(){e(this).css(l.suggestionChild)}),s}var s,c;return s=e(f.suggestions).css(l.suggestions),c=t.map(u,h),s.append.apply(s,c),a.highlight&&p({className:"tt-highlight",node:s[0],pattern:o}),s}function v(){return a.templates.header({query:o,isEmpty:!c})}function m(){return a.templates.footer({query:o,isEmpty:!c})}if(!this.$el)return;var a=this,c;this.$el.empty(),c=u&&u.length,!c&&this.templates.empty?this.$el.html(h()).prepend(a.templates.header?v():null).append(a.templates.footer?m():null):c&&this.$el.html(d()).prepend(a.templates.header?v():null).append(a.templates.footer?m():null),this.trigger("rendered")},getRoot:function(){return this.$el},update:function(t){function r(e){!n.canceled&&t===n.query&&n._render(t,e)}var n=this;this.query=t,this.canceled=!1,this.source(t,r)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),s}(),m=function(){"use strict";function n(n){var i=this,s,o,u;n=n||{},n.menu||e.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=t.map(n.datasets,r),s=t.bind(this._onSuggestionClick,this),o=t.bind(this._onSuggestionMouseEnter,this),u=t.bind(this._onSuggestionMouseLeave,this),this.$menu=e(n.menu).on("click.tt",".tt-suggestion",s).on("mouseenter.tt",".tt-suggestion",o).on("mouseleave.tt",".tt-suggestion",u),t.each(this.datasets,function(e){i.$menu.append(e.getRoot()),e.onSync("rendered",i._onRendered,i)})}function r(e){return new v(e)}return t.mixin(n.prototype,h,{_onSuggestionClick:function(n){this.trigger("suggestionClicked",e(n.currentTarget))},_onSuggestionMouseEnter:function(n){this._removeCursor(),this._setCursor(e(n.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function n(e){return e.isEmpty()}this.isEmpty=t.every(this.datasets,n),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(t,n){t.first().addClass("tt-cursor"),!n&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(t){var n,r,i,s;if(!this.isOpen)return;r=this._getCursor(),n=this._getSuggestions(),this._removeCursor(),i=n.index(r)+t,i=(i+1)%(n.length+1)-1;if(i===-1){this.trigger("cursorRemoved");return}i<-1&&(i=n.length-1),this._setCursor(s=n.eq(i)),this._ensureVisible(s)},_ensureVisible:function(t){var n,r,i,s;n=t.position().top,r=n+t.outerHeight(!0),i=this.$menu.scrollTop(),s=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),n<0?this.$menu.scrollTop(i+n):s<r&&this.$menu.scrollTop(i+(r-s))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(t){this.$menu.css(t==="ltr"?l.ltr:l.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(t){var n=null;return t.length&&(n={raw:v.extractDatum(t),value:v.extractValue(t),datasetName:v.extractDatasetName(t)}),n},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(n){function r(e){e.update(n)}t.each(this.datasets,r)},empty:function(){function n(e){e.clear()}t.each(this.datasets,n),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function n(e){e.destroy()}this.$menu.off(".tt"),this.$menu=null,t.each(this.datasets,n)}}),n}(),g=function(){"use strict";function r(n){var r,s,o;n=n||{},n.input||e.error("missing input"),this.isActivated=!1,this.autoselect=!!n.autoselect,this.minLength=t.isNumber(n.minLength)?n.minLength:1,this.$node=i(n.input,n.withHint),r=this.$node.find(".tt-dropdown-menu"),s=this.$node.find(".tt-input"),o=this.$node.find(".tt-hint"),s.on("blur.tt",function(e){var n,i,o;n=document.activeElement,i=r.is(n),o=r.has(n).length>0,t.isMsie()&&(i||o)&&(e.preventDefault(),e.stopImmediatePropagation(),t.defer(function(){s.focus()}))}),r.on("mousedown.tt",function(e){e.preventDefault()}),this.eventBus=n.eventBus||new c({el:s}),this.dropdown=(new m({menu:r,datasets:n.datasets})).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=(new d({input:s,hint:o})).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function i(t,r){var i,o,u,a;i=e(t),o=e(f.wrapper).css(l.wrapper),u=e(f.dropdown).css(l.dropdown),a=i.clone().css(l.hint).css(s(i)),a.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1}),i.data(n,{dir:i.attr("dir"),autocomplete:i.attr("autocomplete"),spellcheck:i.attr("spellcheck"),style:i.attr("style")}),i.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(r?l.input:l.inputWithNoHint);try{!i.attr("dir")&&i.attr("dir","auto")}catch(c){}return i.wrap(o).parent().prepend(r?a:null).append(u)}function s(e){return{backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}}function o(e){var r=e.find(".tt-input");t.each(r.data(n),function(e,n){t.isUndefined(e)?r.removeAttr(n):r.attr(n,e)}),r.detach().removeData(n).removeClass("tt-input").insertAfter(e),e.remove()}var n="ttAttrs";return t.mixin(r.prototype,{_onSuggestionClicked:function(t,n){var r;(r=this.dropdown.getDatumForSuggestion(n))&&this._select(r)},_onCursorMoved:function(){var t=this.dropdown.getDatumForCursor();this.input.setInputValue(t.value,!0),this.eventBus.trigger("cursorchanged",t.raw,t.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(t,n){var r,i;r=this.dropdown.getDatumForCursor(),i=this.dropdown.getDatumForTopSuggestion(),r?(this._select(r),n.preventDefault()):this.autoselect&&i&&(this._select(i),n.preventDefault())},_onTabKeyed:function(t,n){var r;(r=this.dropdown.getDatumForCursor())?(this._select(r),n.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){this.dir==="rtl"&&this._autocomplete()},_onRightKeyed:function(){this.dir==="ltr"&&this._autocomplete()},_onQueryChanged:function(t,n){this.input.clearHintIfInvalid(),n.length>=this.minLength?this.dropdown.update(n):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var t;this.dir!==(t=this.input.getLanguageDirection())&&(this.dir=t,this.$node.css("direction",t),this.dropdown.setLanguageDirection(t))},_updateHint:function(){var n,r,i,s,o,u;n=this.dropdown.getDatumForTopSuggestion(),n&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(r=this.input.getInputValue(),i=d.normalizeQuery(r),s=t.escapeRegExChars(i),o=new RegExp("^(?:"+s+")(.+$)","i"),u=o.exec(n.value),u?this.input.setHint(r+u[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(t){var n,r,i,s;n=this.input.getHint(),r=this.input.getQuery(),i=t||this.input.isCursorAtEnd(),n&&r!==n&&i&&(s=this.dropdown.getDatumForTopSuggestion(),s&&this.input.setInputValue(s.value),this.eventBus.trigger("autocompleted",s.raw,s.datasetName))},_select:function(n){this.input.setQuery(n.value),this.input.setInputValue(n.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",n.raw,n.datasetName),this.dropdown.close(),t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(n){n=t.toStr(n),this.isActivated?this.input.setInputValue(n):(this.input.setQuery(n),this.input.setInputValue(n,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),o(this.$node),this.$node=null}}),r}();(function(){"use strict";var n,r,i;n=e.fn.typeahead,r="ttTypeahead",i={initialize:function(i,s){function o(){var n=e(this),o,u;t.each(s,function(e){e.highlight=!!i.highlight}),u=new g({input:n,eventBus:o=new c({el:n}),withHint:t.isUndefined(i.hint)?!0:!!i.hint,minLength:i.minLength,autoselect:i.autoselect,datasets:s}),n.data(r,u)}return s=t.isArray(s)?s:[].slice.call(arguments,1),i=i||{},this.each(o)},open:function(){function n(){var t=e(this),n;(n=t.data(r))&&n.open()}return this.each(n)},close:function(){function n(){var t=e(this),n;(n=t.data(r))&&n.close()}return this.each(n)},val:function(n){function i(){var t=e(this),i;(i=t.data(r))&&i.setVal(n)}function s(e){var t,n;if(t=e.data(r))n=t.getVal();return n}return arguments.length?this.each(i):s(this.first())},destroy:function(){function n(){var t=e(this),n;if(n=t.data(r))n.destroy(),t.removeData(r)}return this.each(n)}},e.fn.typeahead=function(t){var n;return i[t]&&t!=="initialize"?(n=this.filter(function(){return!!e(this).data(r)}),i[t].apply(n,[].slice.call(arguments,1))):i.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this}})()}(window.jQuery),define("typeahead",function(){}),function(){var e,t,n,r,i,s,o,u,a=[].slice,f={}.hasOwnProperty,l=function(e,t){function r(){this.constructor=e}for(var n in t)f.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};o=function(){},t=function(){function e(){}return e.prototype.addEventListener=e.prototype.on,e.prototype.on=function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},e.prototype.emit=function(){var e,t,n,r,i,s;r=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],this._callbacks=this._callbacks||{},n=this._callbacks[r];if(n)for(i=0,s=n.length;i<s;i++)t=n[i],t.apply(this,e);return this},e.prototype.removeListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.off=function(e,t){var n,r,i,s,o;if(!this._callbacks||arguments.length===0)return this._callbacks={},this;r=this._callbacks[e];if(!r)return this;if(arguments.length===1)return delete this._callbacks[e],this;for(i=s=0,o=r.length;s<o;i=++s){n=r[i];if(n===t){r.splice(i,1);break}}return this},e}(),e=function(e){function i(e,t){var r,s,o;this.element=e,this.version=i.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],typeof this.element=="string"&&(this.element=document.querySelector(this.element));if(!this.element||this.element.nodeType==null)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");i.instances.push(this),this.element.dropzone=this,r=(o=i.optionsForElement(this.element))!=null?o:{},this.options=n({},this.defaultOptions,r,t!=null?t:{});if(this.options.forceFallback||!i.isBrowserSupported())return this.options.fallback.call(this);this.options.url==null&&(this.options.url=this.element.getAttribute("action"));if(!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(s=this.getExistingFallback())&&s.parentNode&&s.parentNode.removeChild(s),this.options.previewsContainer!==!1&&(this.options.previewsContainer?this.previewsContainer=i.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(this.options.clickable===!0?this.clickableElements=[this.element]:this.clickableElements=i.getElements(this.options.clickable,"clickable")),this.init()}var n,r;return l(i,e),i.prototype.Emitter=t,i.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],i.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,filesizeBase:1e3,maxFiles:null,filesizeBase:1e3,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,capture:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(e,t){return t()},init:function(){return o},forceFallback:!1,fallback:function(){var e,t,n,r,s,o;this.element.className=""+this.element.className+" dz-browser-not-supported",o=this.element.getElementsByTagName("div");for(r=0,s=o.length;r<s;r++){e=o[r];if(/(^| )dz-message($| )/.test(e.className)){t=e,e.className="dz-message";continue}}return t||(t=i.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(t)),n=t.getElementsByTagName("span")[0],n&&(n.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,n,r;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},n=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,t.optWidth==null&&t.optHeight==null?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):t.optWidth==null?t.optWidth=n*t.optHeight:t.optHeight==null&&(t.optHeight=1/n*t.optWidth),r=t.optWidth/t.optHeight,e.height<t.optHeight||e.width<t.optWidth?(t.trgHeight=t.srcHeight,t.trgWidth=t.srcWidth):n>r?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*r):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/r),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:o,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:o,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t,n,r,s,o,u,a,f,l,c,h,p,d;this.element===this.previewsContainer&&this.element.classList.add("dz-started");if(this.previewsContainer){e.previewElement=i.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]");for(s=0,a=c.length;s<a;s++)t=c[s],t.textContent=e.name;h=e.previewElement.querySelectorAll("[data-dz-size]");for(o=0,f=h.length;o<f;o++)t=h[o],t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=i.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),e.previewElement.appendChild(e._removeLink)),n=function(t){return function(n){return n.preventDefault(),n.stopPropagation(),e.status===i.UPLOADING?i.confirm(t.options.dictCancelUploadConfirmation,function(){return t.removeFile(e)}):t.options.dictRemoveFileConfirmation?i.confirm(t.options.dictRemoveFileConfirmation,function(){return t.removeFile(e)}):t.removeFile(e)}}(this),p=e.previewElement.querySelectorAll("[data-dz-remove]"),d=[];for(u=0,l=p.length;u<l;u++)r=p[u],d.push(r.addEventListener("click",n));return d}},removedfile:function(e){var t;return e.previewElement&&(t=e.previewElement)!=null&&t.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){var n,r,i,s;if(e.previewElement){e.previewElement.classList.remove("dz-file-preview"),s=e.previewElement.querySelectorAll("[data-dz-thumbnail]");for(r=0,i=s.length;r<i;r++)n=s[r],n.alt=e.name,n.src=t;return setTimeout(function(t){return function(){return e.previewElement.classList.add("dz-image-preview")}}(this),1)}},error:function(e,t){var n,r,i,s,o;if(e.previewElement){e.previewElement.classList.add("dz-error"),typeof t!="String"&&t.error&&(t=t.error),s=e.previewElement.querySelectorAll("[data-dz-errormessage]"),o=[];for(r=0,i=s.length;r<i;r++)n=s[r],o.push(n.textContent=t);return o}},errormultiple:o,processing:function(e){if(e.previewElement){e.previewElement.classList.add("dz-processing");if(e._removeLink)return e._removeLink.textContent=this.options.dictCancelUpload}},processingmultiple:o,uploadprogress:function(e,t,n){var r,i,s,o,u;if(e.previewElement){o=e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),u=[];for(i=0,s=o.length;i<s;i++)r=o[i],r.nodeName==="PROGRESS"?u.push(r.value=t):u.push(r.style.width=""+t+"%");return u}},totaluploadprogress:o,sending:o,sendingmultiple:o,success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:o,canceled:function(e){return this.emit("error",e,"Upload canceled.")},canceledmultiple:o,complete:function(e){e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile);if(e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:o,maxfilesexceeded:o,maxfilesreached:o,queuecomplete:o,previewTemplate:'<div class="dz-preview dz-file-preview">\n  <div class="dz-image"><img data-dz-thumbnail /></div>\n  <div class="dz-details">\n    <div class="dz-size"><span data-dz-size></span></div>\n    <div class="dz-filename"><span data-dz-name></span></div>\n  </div>\n  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n  <div class="dz-error-message"><span data-dz-errormessage></span></div>\n  <div class="dz-success-mark">\n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n      <title>Check</title>\n      <defs></defs>\n      <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n        <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n      </g>\n    </svg>\n  </div>\n  <div class="dz-error-mark">\n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n      <title>Error</title>\n      <defs></defs>\n      <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n        <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n          <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n        </g>\n      </g>\n    </svg>\n  </div>\n</div>'},n=function(){var e,t,n,r,i,s,o;r=arguments[0],n=2<=arguments.length?a.call(arguments,1):[];for(s=0,o=n.length;s<o;s++){t=n[s];for(e in t)i=t[e],r[e]=i}return r},i.prototype.getAcceptedFiles=function(){var e,t,n,r,i;r=this.files,i=[];for(t=0,n=r.length;t<n;t++)e=r[t],e.accepted&&i.push(e);return i},i.prototype.getRejectedFiles=function(){var e,t,n,r,i;r=this.files,i=[];for(t=0,n=r.length;t<n;t++)e=r[t],e.accepted||i.push(e);return i},i.prototype.getFilesWithStatus=function(e){var t,n,r,i,s;i=this.files,s=[];for(n=0,r=i.length;n<r;n++)t=i[n],t.status===e&&s.push(t);return s},i.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(i.QUEUED)},i.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(i.UPLOADING)},i.prototype.getActiveFiles=function(){var e,t,n,r,s;r=this.files,s=[];for(t=0,n=r.length;t<n;t++)e=r[t],(e.status===i.UPLOADING||e.status===i.QUEUED)&&s.push(e);return s},i.prototype.init=function(){var e,t,n,r,s,o,u;this.element.tagName==="form"&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(n=function(e){return function(){return e.hiddenFileInput&&document.body.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(e.options.maxFiles==null||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",e.options.acceptedFiles!=null&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),e.options.capture!=null&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.body.appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,r,i,s;r=e.hiddenFileInput.files;if(r.length)for(i=0,s=r.length;i<s;i++)t=r[i],e.addFile(t);return n()})}}(this),n()),this.URL=(o=window.URL)!=null?o:window.webkitURL,u=this.events;for(r=0,s=u.length;r<s;r++)e=u[r],this.on(e,this.options[e]);return this.on("uploadprogress",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("canceled",function(e){return function(t){return e.emit("complete",t)}}(this)),this.on("complete",function(e){return function(t){if(e.getUploadingFiles().length===0&&e.getQueuedFiles().length===0)return setTimeout(function(){return e.emit("queuecomplete")},0)}}(this)),t=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(e){return function(t){return e.emit("dragstart",t)}}(this),dragenter:function(e){return function(n){return t(n),e.emit("dragenter",n)}}(this),dragover:function(e){return function(n){var r;try{r=n.dataTransfer.effectAllowed}catch(i){}return n.dataTransfer.dropEffect="move"===r||"linkMove"===r?"move":"copy",t(n),e.emit("dragover",n)}}(this),dragleave:function(e){return function(t){return e.emit("dragleave",t)}}(this),drop:function(e){return function(n){return t(n),e.drop(n)}}(this),dragend:function(e){return function(t){return e.emit("dragend",t)}}(this)}}],this.clickableElements.forEach(function(e){return function(t){return e.listeners.push({element:t,events:{click:function(n){if(t!==e.element||n.target===e.element||i.elementInside(n.target,e.element.querySelector(".dz-message")))return e.hiddenFileInput.click()}}})}}(this)),this.enable(),this.options.init.call(this)},i.prototype.destroy=function(){var e;this.disable(),this.removeAllFiles(!0);if((e=this.hiddenFileInput)!=null?e.parentNode:void 0)this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null;return delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)},i.prototype.updateTotalUploadProgress=function(){var e,t,n,r,i,s,o,u;r=0,n=0,e=this.getActiveFiles();if(e.length){u=this.getActiveFiles();for(s=0,o=u.length;s<o;s++)t=u[s],r+=t.upload.bytesSent,n+=t.upload.total;i=100*r/n}else i=100;return this.emit("totaluploadprogress",i,n,r)},i.prototype._getParamName=function(e){return typeof this.options.paramName=="function"?this.options.paramName(e):""+this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")},i.prototype.getFallbackForm=function(){var e,t,n,r;return(e=this.getExistingFallback())?e:(n='<div class="dz-fallback">',this.options.dictFallbackText&&(n+="<p>"+this.options.dictFallbackText+"</p>"),n+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',t=i.createElement(n),this.element.tagName!=="FORM"?(r=i.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>'),r.appendChild(t)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),r!=null?r:t)},i.prototype.getExistingFallback=function(){var e,t,n,r,i,s;t=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++){t=e[n];if(/(^| )fallback($| )/.test(t.className))return t}},s=["div","form"];for(r=0,i=s.length;r<i;r++){n=s[r];if(e=t(this.element.getElementsByTagName(n)))return e}},i.prototype.setupEventListeners=function(){var e,t,n,r,i,s,o;s=this.listeners,o=[];for(r=0,i=s.length;r<i;r++)e=s[r],o.push(function(){var r,i;r=e.events,i=[];for(t in r)n=r[t],i.push(e.element.addEventListener(t,n,!1));return i}());return o},i.prototype.removeEventListeners=function(){var e,t,n,r,i,s,o;s=this.listeners,o=[];for(r=0,i=s.length;r<i;r++)e=s[r],o.push(function(){var r,i;r=e.events,i=[];for(t in r)n=r[t],i.push(e.element.removeEventListener(t,n,!1));return i}());return o},i.prototype.disable=function(){var e,t,n,r,i;this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),r=this.files,i=[];for(t=0,n=r.length;t<n;t++)e=r[t],i.push(this.cancelUpload(e));return i},i.prototype.enable=function(){return this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()},i.prototype.filesize=function(e){var t,n,r,i,s,o,u,a;o=["TB","GB","MB","KB","b"],r=i=null;for(n=u=0,a=o.length;u<a;n=++u){s=o[n],t=Math.pow(this.options.filesizeBase,4-n)/10;if(e>=t){r=e/Math.pow(this.options.filesizeBase,4-n),i=s;break}}return r=Math.round(10*r)/10,"<strong>"+r+"</strong> "+i},i.prototype._updateMaxFilesReachedClass=function(){return this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},i.prototype.drop=function(e){var t,n;if(!e.dataTransfer)return;this.emit("drop",e),t=e.dataTransfer.files,t.length&&(n=e.dataTransfer.items,n&&n.length&&n[0].webkitGetAsEntry!=null?this._addFilesFromItems(n):this.handleFiles(t))},i.prototype.paste=function(e){var t,n;if((e!=null?(n=e.clipboardData)!=null?n.items:void 0:void 0)==null)return;this.emit("paste",e),t=e.clipboardData.items;if(t.length)return this._addFilesFromItems(t)},i.prototype.handleFiles=function(e){var t,n,r,i;i=[];for(n=0,r=e.length;n<r;n++)t=e[n],i.push(this.addFile(t));return i},i.prototype._addFilesFromItems=function(e){var t,n,r,i,s;s=[];for(r=0,i=e.length;r<i;r++)n=e[r],n.webkitGetAsEntry!=null&&(t=n.webkitGetAsEntry())?t.isFile?s.push(this.addFile(n.getAsFile())):t.isDirectory?s.push(this._addFilesFromDirectory(t,t.name)):s.push(void 0):n.getAsFile!=null?n.kind==null||n.kind==="file"?s.push(this.addFile(n.getAsFile())):s.push(void 0):s.push(void 0);return s},i.prototype._addFilesFromDirectory=function(e,t){var n,r;return n=e.createReader(),r=function(e){return function(n){var r,i,s;for(i=0,s=n.length;i<s;i++)r=n[i],r.isFile?r.file(function(n){if(e.options.ignoreHiddenFiles&&n.name.substring(0,1)===".")return;return n.fullPath=""+t+"/"+n.name,e.addFile(n)}):r.isDirectory&&e._addFilesFromDirectory(r,""+t+"/"+r.name)}}(this),n.readEntries(r,function(e){return typeof console!="undefined"&&console!==null?typeof console.log=="function"?console.log(e):void 0:void 0})},i.prototype.accept=function(e,t){return e.size>this.options.maxFilesize*1024*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(e,this.options.acceptedFiles)?this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)},i.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=i.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},i.prototype.enqueueFiles=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++)t=e[n],this.enqueueFile(t);return null},i.prototype.enqueueFile=function(e){if(e.status!==i.ADDED||e.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");e.status=i.QUEUED;if(this.options.autoProcessQueue)return setTimeout(function(e){return function(){return e.processQueue()}}(this),0)},i.prototype._thumbnailQueue=[],i.prototype._processingThumbnail=!1,i.prototype._enqueueThumbnail=function(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=this.options.maxThumbnailFilesize*1024*1024)return this._thumbnailQueue.push(e),setTimeout(function(e){return function(){return e._processThumbnailQueue()}}(this),0)},i.prototype._processThumbnailQueue=function(){if(this._processingThumbnail||this._thumbnailQueue.length===0)return;return this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(e){return function(){return e._processingThumbnail=!1,e._processThumbnailQueue()}}(this))},i.prototype.removeFile=function(e){e.status===i.UPLOADING&&this.cancelUpload(e),this.files=u(this.files,e),this.emit("removedfile",e);if(this.files.length===0)return this.emit("reset")},i.prototype.removeAllFiles=function(e){var t,n,r,s;e==null&&(e=!1),s=this.files.slice();for(n=0,r=s.length;n<r;n++)t=s[n],(t.status!==i.UPLOADING||e)&&this.removeFile(t);return null},i.prototype.createThumbnail=function(e,t){var n;return n=new FileReader,n.onload=function(r){return function(){if(e.type==="image/svg+xml"){r.emit("thumbnail",e,n.result),t!=null&&t();return}return r.createThumbnailFromUrl(e,n.result,t)}}(this),n.readAsDataURL(e)},i.prototype.createThumbnailFromUrl=function(e,t,n){var r;return r=document.createElement("img"),r.onload=function(t){return function(){var i,o,u,a,f,l,c,h;e.width=r.width,e.height=r.height,u=t.options.resize.call(t,e),u.trgWidth==null&&(u.trgWidth=u.optWidth),u.trgHeight==null&&(u.trgHeight=u.optHeight),i=document.createElement("canvas"),o=i.getContext("2d"),i.width=u.trgWidth,i.height=u.trgHeight,s(o,r,(f=u.srcX)!=null?f:0,(l=u.srcY)!=null?l:0,u.srcWidth,u.srcHeight,(c=u.trgX)!=null?c:0,(h=u.trgY)!=null?h:0,u.trgWidth,u.trgHeight),a=i.toDataURL("image/png"),t.emit("thumbnail",e,a);if(n!=null)return n()}}(this),n!=null&&(r.onerror=n),r.src=t},i.prototype.processQueue=function(){var e,t,n,r;t=this.options.parallelUploads,n=this.getUploadingFiles().length,e=n;if(n>=t)return;r=this.getQueuedFiles();if(!(r.length>0))return;if(this.options.uploadMultiple)return this.processFiles(r.slice(0,t-n));while(e<t){if(!r.length)return;this.processFile(r.shift()),e++}},i.prototype.processFile=function(e){return this.processFiles([e])},i.prototype.processFiles=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++)t=e[n],t.processing=!0,t.status=i.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)},i.prototype._getFilesWithXhr=function(e){var t,n;return n=function(){var n,r,i,s;i=this.files,s=[];for(n=0,r=i.length;n<r;n++)t=i[n],t.xhr===e&&s.push(t);return s}.call(this)},i.prototype.cancelUpload=function(e){var t,n,r,s,o,u,a;if(e.status===i.UPLOADING){n=this._getFilesWithXhr(e.xhr);for(r=0,o=n.length;r<o;r++)t=n[r],t.status=i.CANCELED;e.xhr.abort();for(s=0,u=n.length;s<u;s++)t=n[s],this.emit("canceled",t);this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else if((a=e.status)===i.ADDED||a===i.QUEUED)e.status=i.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]);if(this.options.autoProcessQueue)return this.processQueue()},r=function(){var e,t;return t=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],typeof t=="function"?t.apply(this,e):t},i.prototype.uploadFile=function(e){return this.uploadFiles([e])},i.prototype.uploadFiles=function(e){var t,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j;S=new XMLHttpRequest;for(x=0,k=e.length;x<k;x++)t=e[x],t.xhr=S;v=r(this.options.method,e),w=r(this.options.url,e),S.open(v,w,!0),S.withCredentials=!!this.options.withCredentials,y=null,o=function(n){return function(){var r,i,s;s=[];for(r=0,i=e.length;r<i;r++)t=e[r],s.push(n._errorProcessing(e,y||n.options.dictResponseError.replace("{{statusCode}}",S.status),S));return s}}(this),b=function(n){return function(r){var i,s,o,u,a,f,l,c,h;if(r!=null){s=100*r.loaded/r.total;for(o=0,f=e.length;o<f;o++)t=e[o],t.upload={progress:s,total:r.total,bytesSent:r.loaded}}else{i=!0,s=100;for(u=0,l=e.length;u<l;u++){t=e[u];if(t.upload.progress!==100||t.upload.bytesSent!==t.upload.total)i=!1;t.upload.progress=s,t.upload.bytesSent=t.upload.total}if(i)return}h=[];for(a=0,c=e.length;a<c;a++)t=e[a],h.push(n.emit("uploadprogress",t,s,t.upload.bytesSent));return h}}(this),S.onload=function(t){return function(n){var r;if(e[0].status===i.CANCELED)return;if(S.readyState!==4)return;y=S.responseText;if(S.getResponseHeader("content-type")&&~S.getResponseHeader("content-type").indexOf("application/json"))try{y=JSON.parse(y)}catch(s){n=s,y="Invalid JSON response from server."}return b(),200<=(r=S.status)&&r<300?t._finished(e,y,n):o()}}(this),S.onerror=function(t){return function(){if(e[0].status===i.CANCELED)return;return o()}}(this),g=(_=S.upload)!=null?_:S,g.onprogress=b,f={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&n(f,this.options.headers);for(u in f)a=f[u],S.setRequestHeader(u,a);s=new FormData;if(this.options.params){D=this.options.params;for(d in D)E=D[d],s.append(d,E)}for(T=0,L=e.length;T<L;T++)t=e[T],this.emit("sending",t,S,s);this.options.uploadMultiple&&this.emit("sendingmultiple",e,S,s);if(this.element.tagName==="FORM"){P=this.element.querySelectorAll("input, textarea, select, button");for(N=0,A=P.length;N<A;N++){c=P[N],h=c.getAttribute("name"),p=c.getAttribute("type");if(c.tagName==="SELECT"&&c.hasAttribute("multiple")){H=c.options;for(C=0,O=H.length;C<O;C++)m=H[C],m.selected&&s.append(h,m.value)}else(!p||(B=p.toLowerCase())!=="checkbox"&&B!=="radio"||c.checked)&&s.append(h,c.value)}}for(l=M=0,j=e.length-1;0<=j?M<=j:M>=j;l=0<=j?++M:--M)s.append(this._getParamName(l),e[l],e[l].name);return S.send(s)},i.prototype._finished=function(e,t,n){var r,s,o;for(s=0,o=e.length;s<o;s++)r=e[s],r.status=i.SUCCESS,this.emit("success",r,t,n),this.emit("complete",r);this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e));if(this.options.autoProcessQueue)return this.processQueue()},i.prototype._errorProcessing=function(e,t,n){var r,s,o;for(s=0,o=e.length;s<o;s++)r=e[s],r.status=i.ERROR,this.emit("error",r,t,n),this.emit("complete",r);this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e));if(this.options.autoProcessQueue)return this.processQueue()},i}(t),e.version="4.0.1",e.options={},e.optionsForElement=function(t){return t.getAttribute("id")?e.options[n(t.getAttribute("id"))]:void 0},e.instances=[],e.forElement=function(e){typeof e=="string"&&(e=document.querySelector(e));if((e!=null?e.dropzone:void 0)==null)throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},e.autoDiscover=!0,e.discover=function(){var t,n,r,i,s,o;document.querySelectorAll?r=document.querySelectorAll(".dropzone"):(r=[],t=function(e){var t,n,i,s;s=[];for(n=0,i=e.length;n<i;n++)t=e[n],/(^| )dropzone($| )/.test(t.className)?s.push(r.push(t)):s.push(void 0);return s},t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))),o=[];for(i=0,s=r.length;i<s;i++)n=r[i],e.optionsForElement(n)!==!1?o.push(new e(n)):o.push(void 0);return o},e.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],e.isBrowserSupported=function(){var t,n,r,i,s;t=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){s=e.blacklistedBrowsers;for(r=0,i=s.length;r<i;r++){n=s[r];if(n.test(navigator.userAgent)){t=!1;continue}}}else t=!1;else t=!1;return t},u=function(e,t){var n,r,i,s;s=[];for(r=0,i=e.length;r<i;r++)n=e[r],n!==t&&s.push(n);return s},n=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})},e.createElement=function(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.childNodes[0]},e.elementInside=function(e,t){if(e===t)return!0;while(e=e.parentNode)if(e===t)return!0;return!1},e.getElement=function(e,t){var n;typeof e=="string"?n=document.querySelector(e):e.nodeType!=null&&(n=e);if(n==null)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return n},e.getElements=function(e,t){var n,r,i,s,o,u,a,f;if(e instanceof Array){i=[];try{for(s=0,u=e.length;s<u;s++)r=e[s],i.push(this.getElement(r,t))}catch(l){n=l,i=null}}else if(typeof e=="string"){i=[],f=document.querySelectorAll(e);for(o=0,a=f.length;o<a;o++)r=f[o],i.push(r)}else e.nodeType!=null&&(i=[e]);if(i==null||!i.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return i},e.confirm=function(e,t,n){if(window.confirm(e))return t();if(n!=null)return n()},e.isValidFile=function(e,t){var n,r,i,s,o;if(!t)return!0;t=t.split(","),r=e.type,n=r.replace(/\/.*$/,"");for(s=0,o=t.length;s<o;s++){i=t[s],i=i.trim();if(i.charAt(0)==="."){if(e.name.toLowerCase().indexOf(i.toLowerCase(),e.name.length-i.length)!==-1)return!0}else if(/\/\*$/.test(i)){if(n===i.replace(/\/.*$/,""))return!0}else if(r===i)return!0}return!1},typeof jQuery!="undefined"&&jQuery!==null&&(jQuery.fn.dropzone=function(t){return this.each(function(){return new e(this,t)})}),typeof module!="undefined"&&module!==null?module.exports=e:window.Dropzone=e,e.ADDED="added",e.QUEUED="queued",e.ACCEPTED=e.QUEUED,e.UPLOADING="uploading",e.PROCESSING=e.UPLOADING,e.CANCELED="canceled",e.ERROR="error",e.SUCCESS="success",i=function(e){var t,n,r,i,s,o,u,a,f,l;u=e.naturalWidth,o=e.naturalHeight,n=document.createElement("canvas"),n.width=1,n.height=o,r=n.getContext("2d"),r.drawImage(e,0,0),i=r.getImageData(0,0,1,o).data,l=0,s=o,a=o;while(a>l)t=i[(a-1)*4+3],t===0?s=a:l=a,a=s+l>>1;return f=a/o,f===0?1:f},s=function(e,t,n,r,s,o,u,a,f,l){var c;return c=i(t),e.drawImage(t,n,r,s,o,u,a,f,l/c)},r=function(e,t){var n,r,i,s,o,u,a,f,l;i=!1,l=!0,r=e.document,f=r.documentElement,n=r.addEventListener?"addEventListener":"attachEvent",a=r.addEventListener?"removeEventListener":"detachEvent",u=r.addEventListener?"":"on",s=function(n){if(n.type==="readystatechange"&&r.readyState!=="complete")return;(n.type==="load"?e:r)[a](u+n.type,s,!1);if(!i&&(i=!0))return t.call(e,n.type||n)},o=function(){var e;try{f.doScroll("left")}catch(t){e=t,setTimeout(o,50);return}return s("poll")};if(r.readyState!=="complete"){if(r.createEventObject&&f.doScroll){try{l=!e.frameElement}catch(c){}l&&o()}return r[n](u+"DOMContentLoaded",s,!1),r[n](u+"readystatechange",s,!1),e[n](u+"load",s,!1)}},e._autoDiscoverFunction=function(){if(e.autoDiscover)return e.discover()},r(window,e._autoDiscoverFunction)}.call(this),define("dropzone",["jquery"],function(e){return function(){var t,n;return t||e.Dropzone}}(this)),function(e){"use strict";var t={prefilled:null,CapitalizeFirstLetter:!1,preventSubmitOnEnter:!0,isClearInputOnEsc:!0,externalTagId:!1,prefillIdFieldName:"Id",prefillValueFieldName:"Value",AjaxPush:null,AjaxPushAllTags:null,AjaxPushParameters:null,delimiters:[9,13,44],backspace:[8],maxTags:0,hiddenTagListName:null,hiddenTagListId:null,replace:!0,output:null,deleteTagsOnBackspace:!0,tagsContainer:null,tagCloseIcon:"x",tagClass:"",validator:null,onlyTagList:!1,tagList:null,fillInputOnTagRemove:!1},n={pushTag:function(t,n,i){var s=e(this),o=s.data("opts"),u,a,f,l,c=s.data("tlis"),h=s.data("tlid"),p,d,v,m,g,y,b,w;t=r.trimTag(t,o.delimiterChars);if(!t||t.length<=0)return;if(o.onlyTagList&&undefined!==o.tagList&&o.tagList){var E=o.tagList;e.each(E,function(e,t){E[e]=t.toLowerCase()});var S=e.inArray(t.toLowerCase(),E);if(-1===S)return}o.CapitalizeFirstLetter&&t.length>1&&(t=t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());if(o.validator&&!o.validator(t)){s.trigger("tm:invalid",t);return}if(o.maxTags>0&&c.length>=o.maxTags)return;u=!1,a=jQuery.map(c,function(e){return e.toLowerCase()}),p=e.inArray(t.toLowerCase(),a),-1!==p&&(u=!0);if(u){s.trigger("tm:duplicated",t);if(o.blinkClass)for(var x=0;x<6;++x)e("#"+s.data("tm_rndid")+"_"+h[p]).queue(function(t){e(this).toggleClass(o.blinkClass),t()}).delay(100);else e("#"+s.data("tm_rndid")+"_"+h[p]).stop().animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100)}else o.externalTagId===!0?(i===undefined&&e.error("externalTagId is not passed for tag -"+t),l=i):(f=Math.max.apply(null,h),f=f===-Infinity?0:f,l=++f),n||s.trigger("tm:pushing",[t,l]),c.push(t),h.push(l),n||o.AjaxPush!==null&&o.AjaxPushAllTags==null&&e.inArray(t,o.prefilled)===-1&&e.post(o.AjaxPush,e.extend({tag:t},o.AjaxPushParameters)),d=s.data("tm_rndid")+"_"+l,v=s.data("tm_rndid")+"_Remover_"+l,m=e("<span/>").text(t).html(),g='<span class="'+r.tagClasses.call(s)+'" id="'+d+'">',g+="<span>"+m+"</span>",g+='<a href="#" class="tm-tag-remove" id="'+v+'" TagIdToRemove="'+l+'">',g+=o.tagCloseIcon+"</a></span> ",y=e(g),o.tagsContainer!==null?e(o.tagsContainer).append(y):h.length>1?(w=s.siblings("#"+s.data("tm_rndid")+"_"+h[h.length-2]),w.after(y)):s.before(y),y.find("#"+v).on("click",s,function(t){t.preventDefault();var n=parseInt(e(this).attr("TagIdToRemove"));r.spliceTag.call(s,n,t.data)}),r.refreshHiddenTagList.call(s),n||s.trigger("tm:pushed",[t,l]),r.showOrHide.call(s);s.val("")},popTag:function(){var t=e(this),n,i,s=t.data("tlis"),o=t.data("tlid");o.length>0&&(n=o.pop(),i=s[s.length-1],t.trigger("tm:popping",[i,n]),s.pop(),e("#"+t.data("tm_rndid")+"_"+n).remove(),r.refreshHiddenTagList.call(t),t.trigger("tm:popped",[i,n]))},empty:function(){var t=e(this),n=t.data("tlis"),i=t.data("tlid"),s;while(i.length>0)s=i.pop(),n.pop(),e("#"+t.data("tm_rndid")+"_"+s).remove(),r.refreshHiddenTagList.call(t);t.trigger("tm:emptied",null),r.showOrHide.call(t)},tags:function(){var e=this,t=e.data("tlis");return t}},r={showOrHide:function(){var e=this,t=e.data("opts"),n=e.data("tlis");t.maxTags>0&&n.length<t.maxTags&&(e.show(),e.trigger("tm:show")),t.maxTags>0&&n.length>=t.maxTags&&(e.hide(),e.trigger("tm:hide"))},tagClasses:function(){var t=e(this),n=t.data("opts"),r=n.tagBaseClass,i=n.inputBaseClass,s;return s=r,t.attr("class")&&e.each(t.attr("class").split(" "),function(e,t){t.indexOf(i+"-")!==-1&&(s+=" "+r+t.substring(i.length))}),s+=n.tagClass?" "+n.tagClass:"",s},trimTag:function(t,n){var r;t=e.trim(t),r=0;for(r;r<t.length;r++)if(e.inArray(t.charCodeAt(r),n)!==-1)break;return t.substring(0,r)},refreshHiddenTagList:function(){var t=e(this),n=t.data("tlis"),r=t.data("lhiddenTagList");r&&e(r).val(n.join(t.data("opts").baseDelimiter)).change(),t.trigger("tm:refresh",n.join(t.data("opts").baseDelimiter))},killEvent:function(e){e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation(),e.preventDefault()},keyInArray:function(t,n){return e.inArray(t.which,n)!==-1},applyDelimiter:function(t){var r=e(this);n.pushTag.call(r,e(this).val()),t.preventDefault()},prefill:function(t){var r=e(this),i=r.data("opts");e.each(t,function(e,t){i.externalTagId===!0?n.pushTag.call(r,t[i.prefillValueFieldName],!0,t[i.prefillIdFieldName]):n.pushTag.call(r,t,!0)})},pushAllTags:function(t,n){var r=e(this),i=r.data("opts"),s=r.data("tlis");i.AjaxPushAllTags&&(t.type!=="tm:pushed"||e.inArray(n,i.prefilled)===-1)&&e.post(i.AjaxPush,e.extend({tags:s.join(i.baseDelimiter)},i.AjaxPushParameters))},spliceTag:function(t){var n=this,i=n.data("tlis"),s=n.data("tlid"),o=e.inArray(t,s),u;-1!==o&&(u=i[o],n.trigger("tm:splicing",[u,t]),e("#"+n.data("tm_rndid")+"_"+t).remove(),i.splice(o,1),s.splice(o,1),r.refreshHiddenTagList.call(n),n.trigger("tm:spliced",[u,t])),r.showOrHide.call(n)},init:function(i){var s=e.extend({},t,i),o,u;return s.hiddenTagListName=s.hiddenTagListName===null?"hidden-"+this.attr("name"):s.hiddenTagListName,o=s.delimeters||s.delimiters,u=[9,13,17,18,19,37,38,39,40],s.delimiterChars=[],s.delimiterKeys=[],e.each(o,function(t,n){e.inArray(n,u)!==-1?s.delimiterKeys.push(n):s.delimiterChars.push(n)}),s.baseDelimiter=String.fromCharCode(s.delimiterChars[0]||44),s.tagBaseClass="tm-tag",s.inputBaseClass="tm-input",e.isFunction(s.validator)||(s.validator=null),this.each(function(){var t=e(this),i="",o="",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(t.data("tagManager"))return!1;t.data("tagManager",!0);for(var a=0;a<5;a++)o+=u.charAt(Math.floor(Math.random()*u.length));t.data("tm_rndid",o),t.data("opts",s).data("tlis",[]).data("tlid",[]),s.output===null?(i=e("<input/>",{type:"hidden",name:s.hiddenTagListName}),t.after(i),t.data("lhiddenTagList",i)):t.data("lhiddenTagList",e(s.output)),s.AjaxPushAllTags&&(t.on("tm:spliced",r.pushAllTags),t.on("tm:popped",r.pushAllTags),t.on("tm:pushed",r.pushAllTags)),t.on("focus keypress",function(t){e(this).popover&&e(this).popover("hide")}),s.isClearInputOnEsc&&t.on("keyup",function(t){t.which===27&&(e(this).val(""),r.killEvent(t))}),t.on("keypress",function(e){r.keyInArray(e,s.delimiterChars)&&r.applyDelimiter.call(t,e)}),t.on("keydown",function(e){e.which===13&&s.preventSubmitOnEnter&&r.killEvent(e),r.keyInArray(e,s.delimiterKeys)&&r.applyDelimiter.call(t,e)}),s.deleteTagsOnBackspace&&t.on("keydown",function(i){r.keyInArray(i,s.backspace)&&e(this).val().length<=0&&(n.popTag.call(t),r.killEvent(i))}),s.fillInputOnTagRemove&&t.on("tm:popped",function(t,n){e(this).val(n)}),t.change(function(e){/webkit/.test(navigator.userAgent.toLowerCase())||t.focus(),r.killEvent(e)});if(s.prefilled!==null)typeof s.prefilled=="object"?r.prefill.call(t,s.prefilled):typeof s.prefilled=="string"?r.prefill.call(t,s.prefilled.split(s.baseDelimiter)):typeof s.prefilled=="function"&&r.prefill.call(t,s.prefilled());else if(s.output!==null){if(e(s.output)&&e(s.output).val())var f=e(s.output);r.prefill.call(t,e(s.output).val().split(s.baseDelimiter))}}),this}};e.fn.tagsManager=function(t){var i=e(this);return 0 in this?n[t]?n[t].apply(i,Array.prototype.slice.call(arguments,1)):typeof t=="object"||!t?r.init.apply(this,arguments):(e.error("Method "+t+" does not exist."),!1):this}}(jQuery),define("tagsManager",function(){}),define("type/husky-select",["type/default","form/util"],function(e){"use strict";return function(t,n){var r={id:"id",label:"value",required:!1},i={setValue:function(e){if(e===undefined||e===""||e===null)return;typeof e=="object"?this.$el.data({selection:e[this.options.id],selectionValues:e[this.options.label]}).trigger("data-changed"):this.$el.data({selection:e}).trigger("data-changed")},getValue:function(){var e={},t=this.$el.data("selection"),n=this.$el.data("selection-values"),r=this.$el.attr("data-mapper-return-value");if(!t||t.length===0)return undefined;if(typeof r!="undefined"){if(r==="id")return Array.isArray(t)?t[0]:t;if(r==="value")return Array.isArray(n)?n[0]:n}return this.$el.attr("data-mapper-property-type")==="string"?Array.isArray(n)?n[0]:n:(e[this.options.label]=Array.isArray(n)?n[0]:n,e[this.options.id]=Array.isArray(t)?t[0]:t,e)},needsValidation:function(){var e=this.getValue();return!!e},validate:function(){var e=this.getValue();return typeof e=="object"&&e.hasOwnProperty("id")?!!e.id:e!==""&&typeof e!="undefined"}};return new e(t,r,n,"husky-select",i)}}),define("type/husky-auto-complete",["type/default","form/util"],function(e){"use strict";return function(t,n){var r={id:"id",name:"name",required:!1},i={setValue:function(e){var n=t.find("input");n.length||(t.data("value",e),t.attr("data-value",JSON.stringify(e))),n.data("id",e[this.options.id]),n.attr("data-id",e[this.options.id]),n.typeahead("val",e[this.options.name])},getValue:function(){var e=t.find("input");if(!e.data("id")||e.data("id")==="null")return;var n={};return n[this.options.id]=e.data("id"),n[this.options.name]=e.val(),n},needsValidation:function(){var e=this.getValue();return!!e},validate:function(){var e=this.getValue();return typeof e=="object"&&e.hasOwnProperty("id")?!!e.id:e!==""&&typeof e!="undefined"}};return new e(t,r,n,"husky-auto-complete",i)}}),define("services/husky/url-validator",[],function(){"use strict";function n(){}var e={regex:"(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00A1-\\uFFFF0-9]+-?)*[a-z\\u00A1-\\uFFFF0-9]+)(?:\\.(?:[a-z\\u00A1-\\uFFFF0-9]+-?)*[a-z\\u00A1-\\uFFFF0-9]+)*(?:\\.(?:[a-z\\u00A1-\\uFFFF]{2,})))(?::\\d{2,5})?(?:/[^\\s]*)?",regexOptions:"im",defaultProtocols:["http://","https://","ftp://","ftps://"],specificPartKey:3,schemeKey:1,urlKey:0},t=function(t){var n=_.map(t,function(e){return e.replace("://","")}),r=t.indexOf("//")>-1,i=[r?"((":"(",n.join("|"),r?"):)?":"):","\\/{2}"].join(""),s=[];return s.push("^("),t.length>0&&(s.push(i),s.push(")(")),s.push(e.regex),s.push(")$"),new RegExp(s.join(""),e.regexOptions)};return n.prototype.getDefaultSchemes=function(){return e.defaultProtocols},n.prototype.test=function(e,n){return n||(n=this.getDefaultSchemes()),t(n).test(e)},n.prototype.match=function(n,r){r||(r=this.getDefaultSchemes());if(!n)return!1;var i=n.match(t(r));return i?{scheme:i[e.schemeKey],specificPart:i[e.specificPartKey]}:i},new n}),define("type/husky-input",["type/default","services/husky/url-validator"],function(e,t){"use strict";return function(n,r){var i={id:"id",label:"value",required:!1,dateFormat:"d",timeFormat:"t"},s={phone:function(e){var t=/^[0-9 \\(\\)/+-]*$/;return t.test(e)},password:function(e){var t=/^.{6,30}$/;return t.test(e)},email:function(e){var t=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))){2,6}$/i;return t.test(e)},url:function(e){return t.test(e,[])},time:function(e){return Globalize.parseDate(e,this.options.timeFormat)!==null},color:function(e){var t=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;return t.test(e)}},o={"default":function(e){this.$el.data({value:e}).trigger("data-changed")},time:function(e){var t=Globalize.parseDate(e,"HH:mm:ss");o.default.call(this,Globalize.format(t,this.options.timeFormat))}},u={"default":function(){return this.$el.find("input").val()},time:function(){var e=u.default.call(this),t=Globalize.parseDate(e,this.options.timeFormat);return e===""?e:Globalize.format(t,"HH:mm:ss")},date:function(){return this.$el.data("value")}},a={setValue:function(e){var t=this.$el.data("auraSkin"),n=o[t]||o.default;n.call(this,e)},getValue:function(){var e=this.$el.data("auraSkin"),t=u[e]||u.default;return t.call(this)},needsValidation:function(){var e=this.getInputValue();return e!==""},getInputValue:function(){var e=this.$el.data("auraSkin");return e==="data"?u.date.call(this):u.default.call(this)},validate:function(){var e=this.getInputValue(),t=this.$el.data("auraSkin");return!t||!s[t]?!0:s[t].call(this,e)}};return new e(n,i,r,"husky-input",a)}}),define("type/url-input",["type/default","services/husky/url-validator"],function(e,t){"use strict";return function(n,r){var i={schemes:t.getDefaultSchemes()},s={dataKey:"url-data",dataChangedEvent:"data-changed"},o={setValue:function(e){var n=t.match(e,this.options.schemes);!n||(this.$el.data(s.dataKey,n),this.$el.trigger(s.dataChangedEvent))},getValue:function(){var e=this.$el.data(s.dataKey);return!e||!e.scheme||!e.specificPart?null:e.scheme+e.specificPart},needsValidation:function(){return this.getValue()!==null},validate:function(){var e=this.getValue();return t.test(e,this.options.schemes)}};return new e(n,i,r,"url-input",o)}}),require.config({paths:{sprintf:"bower_components/sprintf/sprintf"}}),define("services/husky/util",["sprintf"],function(e){"use strict";function s(){}var t=null,n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},r=function(e,t){var n=$.Deferred(),r=document.createElement("canvas"),i;return r.width=e.get(0).width,r.height=e.get(0).height,i=r.getContext("2d"),i.drawImage(e.get(0),0,0),r.toBlob(function(e){n.resolve(e)},t),n.promise()},i=function(e,t){var n=0,r=-1,i,s,o;for(s=0;s<e.length;s++){i=!1;for(o=r+1;o<t.length;o++)if(e[s]===t[o]){n+=1,r=s,i=!0;break}if(!i)break}return n};return s.prototype.compare=function(e,t){if(typeof e=="object"&&typeof t=="object")return JSON.stringify(e)===JSON.stringify(t)},s.prototype.typeOf=function(e){var t=typeof e;return t==="object"&&(e?e instanceof Array&&(t="array"):t="null"),t},s.prototype.isEqual=_.isEqual,s.prototype.isEmpty=_.isEmpty,s.prototype.foreach=function(e,t){if(e.length&&e.length>0)for(var n=-1,r=e.length;++n<r;)t(e[n],n)},s.prototype.load=function(e,t,n){var r=new $.Deferred,i={url:e,data:t||null,dataType:"json",success:function(e,t){r.resolve(e,t)}.bind(this),error:function(e,t,n){r.reject(t,n)}};return typeof n!="undefined"&&(i.dataType=n),this.ajax(i),r.promise()},s.prototype.save=function(e,t,n){var r=$.Deferred();return this.ajax({headers:{"Content-Type":"application/json"},url:e,type:t,data:JSON.stringify(n),success:function(e,t){r.resolve(e,t)}.bind(this),error:function(e,t,n){r.reject(e,t,n)}}),r.promise()},s.prototype.cropMiddle=function(e,t,n){var r;return!e||e.length<=t||!e.slice?e:(n||(n="..."),r=Math.floor((t-n.length)/2),e.slice(0,r)+n+e.slice(-r))},s.prototype.cropFront=function(e,t,n){return!e||e.length<=t||!e.slice?e:(n=n||"...",n+e.slice(-(t-n.length)))},s.prototype.cropTail=function(e,t,n){return!e||e.length<=t||!e.slice?e:(n=n||"...",e.slice(0,t-n.length)+n)},s.prototype.contains=function(e,t){return _.contains(e,t)},s.prototype.isAlphaNumeric=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++){t=e.charCodeAt(n);if(!(t>47&&t<58)&&!(t>64&&t<91)&&!(t>96&&t<123))return!1}return!0},s.prototype.uniqueId=function(e){return _.uniqueId(e)},s.prototype.delay=function(e,t){return _.delay(e,t)},s.prototype.union=function(){return _.union.apply(this,arguments)},s.prototype.each=$.each,s.prototype.ajax=$.ajax,s.prototype.ajaxError=function(e){$(document).ajaxError(e)},s.prototype.when=function(){return $.when.apply(null,arguments)},s.prototype.deepCopy=function(e){var t={};return $.isArray(e)&&(t=[]),$.extend(!0,t,e)},s.prototype.arrayGetColumn=function(e,t){if(s.prototype.typeOf(e)==="array"&&e.length>0&&s.prototype.typeOf(e[0])==="object"){var n=[];return s.prototype.foreach(e,function(e){n.push(e[t])}.bind(this)),n}return e},s.prototype.removeFromArray=function(e,t){return $.grep(e,function(e){return t.indexOf(e)==-1})},s.prototype.getParameterByName=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)"),r=n.exec(t);return r===null?"":decodeURIComponent(r[1].replace(/\+/g," "))},s.prototype.template=_.template,s.prototype.extend=$.extend,s.prototype.Deferred=$.Deferred,s.prototype.arrayMap=_.map,s.prototype.object=_.object,s.prototype.escapeHtml=function(e){return e?String(e).replace(/[&<>"'\/]/g,function(e){return n[e]}):e},s.prototype.capitalizeFirstLetter=function(e){return e.slice?e.charAt(0).toUpperCase()+e.slice(1):e},s.prototype.formatBytes=function(e){if(e===0)return"0 Byte";var t=1e3,n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.floor(Math.log(e)/Math.log(t));return(e/Math.pow(t,r)).toFixed(2)+" "+n[r]},s.prototype.compareURIs=function(e,t){var n=e.split("/"),r=t.split("/"),s,o;return s=i(n,r),o=n.length-s,s-o},s.prototype.sprintf=e.sprintf,s.prototype.loadImageAsBlob=function(e,t){var n=$("<div/>"),i=$('<img crossOrigin="Anonymous" src="'+e+'"/>'),s=$.Deferred();return n.width(0),n.height(0),n.css("visibility","hidden"),$("body").append(n),i.on("load",function(){r(i,t).then(function(e){n.remove(),s.resolve(e)})}),n.append(i),s},s.getInstance=function(){return t==null&&(t=new s),t},s.getInstance()}),define("services/husky/mediator",[],function(){"use strict";function t(){}var e=null;return t.getInstance=function(){return e==null&&(e=new t),e},t.prototype.on=window.Husky.on,t.prototype.once=window.Husky.once,t.prototype.off=window.Husky.off,t.prototype.emit=window.Husky.emit,t.getInstance()}),define("services/husky/translator",[],function(){"use strict";function t(){}var e=null;return t.getInstance=function(){return e==null&&(e=new t),e},t.prototype.translate=window.Husky.translate,t.getInstance()}),define("services/husky/storage",[],function(){"use strict";function e(){this.values={}}e.prototype.set=function(e,t){this.values[e]=t},e.prototype.remove=function(e,t){delete this.values[e]},e.prototype.has=function(e){return this.values.hasOwnProperty(e)},e.prototype.get=function(e){if(!this.has(e))throw'Value for key "'+e+'" does not exist';return this.values[e]},e.prototype.getWithDefault=function(e,t){return this.has(e)?this.get(e):t};var t={};return{get:function(n,r){var i=n+"."+r;return t.hasOwnProperty(i)||(t[i]=new e),t[i]}}}),define("bower_components/aura/lib/platform",[],function(){typeof Function.prototype.bind!="function"&&(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice.call(arguments,1);return function(){return t.apply(e,Array.prototype.concat.apply(n,arguments))}}),typeof Array.isArray!="function"&&(Array.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"}),Object.create||(Object.create=function(e){function t(){}if(arguments.length>1)throw new Error("Object.create implementation only accepts the first parameter.");return t.prototype=e,new t}),Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(i){if(typeof i!="object"&&typeof i!="function"||i===null)throw new TypeError("Object.keys called on non-object");var s=[];for(var o in i)e.call(i,o)&&s.push(o);if(t)for(var u=0;u<r;u++)e.call(i,n[u])&&s.push(n[u]);return s}}())}),function(){window.jQuery?define("jquery",[],function(){return window.jQuery}):require.config({paths:{jquery:"bower_components/jquery/jquery"},shim:{jquery:{exports:"$"}}}),window._?define("underscore",[],function(){return window._}):require.config({paths:{underscore:"bower_components/underscore/underscore"},shim:{underscore:{exports:"_"}}}),define("bower_components/aura/lib/base",["module","underscore","jquery","./platform"],function(e,t,n,r){require.s.contexts._.config.paths.aura||require.config({paths:{aura:e.id.replace(/base$/,"")}});var i={};return i.dom={find:function(e,t){return t=t||document,n(t).find(e)},contains:function(e,t){return n.contains(t||document,e)},data:function(e,t){return n(e).data(t)}},i.data={deferred:n.Deferred,when:n.when},i.util={each:n.each,extend:n.extend,uniq:t.uniq,_:t,decamelize:function(e,t){return t=t===undefined?"_":t,e.replace(/([A-Z])/g,t+"$1").toLowerCase()}},i.events={listen:function(e,t,r,i){return n(e).on(t,r,i)},bindAll:function(){return t.bindAll.apply(this,arguments)}},i.template={parse:t.template},i})}(),define("bower_components/aura/lib/logger",[],function(){"use strict";function n(t){return this.name=t,this._log=e,this._warn=e,this._error=e,this._enabled=!1,this}var e=function(){},t=window.console||{};return n.prototype.isEnabled=function(){return this._enabled},n.prototype.setName=function(e){this.name=e},n.prototype.enable=function(){if(Function.prototype.bind&&typeof t=="object"){var n=["log","warn","error"];for(var r=0;r<n.length;r++)t[n[r]]=Function.prototype.call.bind(t[n[r]],t)}return this._log=t.log||e,this._warn=t.warn||this._log,this._error=t.error||this._log,this._enabled=!0,this},n.prototype.write=function(e,n){var r=Array.prototype.slice.call(n);r.unshift(this.name+":"),e.apply(t,r)},n.prototype.log=function(){this.write(this._log,arguments)},n.prototype.warn=function(){this.write(this._warn,arguments)},n.prototype.error=function(){this.write(this._error,arguments)},n}),define("bower_components/aura/lib/aura.extensions",["./base","./logger"],function(e,t){function u(){return this._extensions=[],this.initStatus=i(),this}function a(){var e=r.call(arguments),t;for(var n=0,i=e.length;n<i;n++){t=e[n];if(typeof t=="function")return t}return function(){}}function f(e){return typeof e=="function"?e.apply(undefined,r.call(arguments,1)):e}function l(e){var t=i(),n=e.ref,r=e.context,o=c(n,r);return o.fail(t.reject),o.done(function(e){if(!e)return t.resolve();var n=s(a(e,e.initialize)(r));n.done(function(){t.resolve(e)}),n.fail(t.reject)}),t.promise()}function c(e,t){var n=i(),r=function(e){e=f(e,t);if(e&&e.require&&e.require.paths){var r=Object.keys(e.require.paths)||[];require.config(e.require),require(r,function(){n.resolve(e)},s)}else n.resolve(e)},s=function(t){o.error("Error loading ext:",e,t),n.reject(t)};return typeof e=="string"?require([e],r,s):r(e),n}var n=e.util._,r=Array.prototype.slice,i=e.data.deferred,s=e.data.when,o=(new t("Extensions")).enable();return u.prototype.add=function(e){if(n.include(this._extensions,e)){var t=e.ref.toString()+" is already registered.";throw t+="Extensions can only be added once.",new Error(t)}if(this.initStarted)throw new Error("Init extensions already called");return this._extensions.push(e),this},u.prototype.onReady=function(e){return this.initStatus.then(e),this},u.prototype.onFailure=function(e){return this.initStatus.fail(e),this},u.prototype.init=function(){if(this.initStarted)throw new Error("Init extensions already called");this.initStarted=!0;var e=n.compact(this._extensions.slice(0)),t=[],r=this.initStatus;return function i(n){if(n){var o=l(n);t.push(o),o.done(function(){i(e.shift())}),o.fail(function(e){e||(e="Unknown error while loading an extension"),e instanceof Error||(e=new Error(e)),r.reject(e)})}else e.length===0&&s.apply(undefined,t).done(function(){r.resolve(Array.prototype.slice.call(arguments))})}(e.shift()),r.promise()},u}),define("bower_components/aura/lib/aura",["./base","./aura.extensions","./logger"],function(e,t,n){function o(i){function l(e){typeof e=="string"&&(e=u.sandboxes.get(e));if(e){var t=["aura","sandbox","stop"].join(u.config.mediator.delimiter);return r.invoke(e._children,"stop"),u.core.mediator.emit(t,e),e._component&&(e._component.invokeWithCallbacks("remove"),e._component.invokeWithCallbacks("destroy")),e.stopped=!0,e.el&&u.core.dom.find(e.el).remove(),a[e.ref]=null,delete a[e.ref],e}}if(this instanceof o){var s=new t,u=this;u.ref=r.uniqueId("aura_"),u.config=i=i||{},u.config.sources=u.config.sources||{"default":"./aura_components"};var a={},f=Object.create(e);u.sandboxes={},u.sandboxes.create=function(e,t){e=e||r.uniqueId("sandbox-");if(a[e])throw new Error("Sandbox with ref "+e+" already exists.");var s=Object.create(f);s.ref=e||r.uniqueId("sandbox-"),s.logger=new n(s.ref),a[s.ref]=s;var o=i.debug;return(o===!0||o.enable&&(o.components.length===0||o.components.indexOf(e)!==-1))&&s.logger.enable(),r.extend(s,t||{}),s},u.sandboxes.get=function(e){return a[e]},u.use=function(e){return s.add({ref:e,context:u}),u},u.components={},u.components.addSource=function(e,t){if(i.sources[e])throw new Error("Components source '"+e+"' is already registered");return i.sources[e]=t,u},u.core=Object.create(e),u.start=function(t){if(u.started)return u.logger.error("Aura already started!"),s.initStatus;u.logger.log("Starting Aura");var n=t||{};return typeof t=="string"?n={components:u.core.dom.find(t)}:Array.isArray(t)?n={components:t}:t&&t.widgets&&!t.components?n.components=t.widgets:n.components===undefined&&(n.components=u.core.dom.find(u.config.components||"body")),s.onReady(function(t){e.util.each(t,function(e,t){t&&typeof t.afterAppStart=="function"&&t.afterAppStart(u)})}),s.onFailure(function(){u.logger.error("Error initializing app:",u.config.name,arguments),u.stop()}),u.startOptions=n,u.started=!0,s.init()},u.stop=function(){u.started=!1},u.cleanUp=function(){r.defer(function(){r.each(a,function(e){!!e&&!!e.el&&!u.core.dom.contains($(e.el)[0],document)&&e.stop()})})},u.sandbox=f,u.logger=new n(u.ref),u.sandbox.stop=function(e){var t=u.sandboxes.get(e);t&&l(t);try{$.find(e)}catch(n){return n}e?u.core.dom.find(e,this.el).each(function(e,t){var n=u.core.dom.find(t).data("__sandbox_ref__");l(n)}):l(this)},i.debug=i.debug||{};var c=i.debug;return c===!0&&(i.debug=c={enable:!0}),c.enable&&(c.components?c.components=c.components.split(" "):c.components=[],u.logger.enable(),u.use("aura/ext/debug")),u.use("aura/ext/mediator"),u.use("aura/ext/components"),u}return new o(i)}var r=e.util._,i=function(){},s=Object.freeze||i;return o}),define("husky",["bower_components/aura/lib/aura"],function(e){"use strict";function t(n){if(!(this instanceof t))return new t(n);e.call(this,n);var r=this;r.components.addSource("husky","./husky_components"),r.use("./husky_extensions/jquery"),r.use("./husky_extensions/backbone"),r.use("./husky_extensions/collection"),r.use("./husky_extensions/model"),r.use("./husky_extensions/html.sortable"),r.use("./husky_extensions/husky-validation"),r.use("./husky_extensions/util"),r.use("./husky_extensions/confirm"),r.use("./husky_extensions/template"),r.use("./husky_extensions/globalize"),r.use("./husky_extensions/uri-template"),r.use("./husky_extensions/ckeditor-extension"),r.use("./husky_extensions/typeahead"),r.use("./husky_extensions/tagmanager"),r.use("./husky_extensions/dropzone"),r.use("./husky_extensions/colorpicker"),r.use("./husky_extensions/datepicker"),r.use("./husky_extensions/itembox"),r.use("./husky_extensions/itemgrid"),r.use("./husky_extensions/cache-factory"),r.use("./husky_extensions/infinite-scroll"),r.use(function(e){window.Husky=e.sandboxes.create("husky-sandbox")})}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.version="0.1.0",t}),define("__component__$navigation@husky",[],function(){"use strict";var e={skeleton:['<nav class="navigation<% if (collapsed === "true") {%> collapsed<% } %>">','   <div class="navigation-content">','       <div class="fa-chevron-left navigation-close-icon"></div>','       <div class="wrapper">','           <header class="navigation-header">','               <div class="logo"></div>','               <div class="navigation-header-title"><% if (data.title) { %> <%= translate(data.title) %><% } %></div>',"           </header>",'           <div id="navigation-item-container" class="navigation-item-container"></div>',"       </div>","       <footer>","       </footer>","   </div>","</nav>"].join(""),mainItem:['<li class="js-navigation-items navigation-items" id="<%= item.id %>" data-id="<%= item.id %>">','   <div <% if (!!item.items && item.items.length > 0) { %> class="navigation-items-toggle" <% } %> >','       <a class="<% if (!!item.action || !!item.event) { %>js-navigation-item <% } %>navigation-item" href="#">','           <span class="<%= icon %> navigation-item-icon"></span>','           <span class="navigation-item-title"><%= translate(item.title) %></span>',"       </a>","       <% if (!!item.items && item.items.length > 0) { %>",'           <a class="fa-chevron-right navigation-toggle-icon" href="#"></a>',"       <% } %>","   </div>","</li>"].join(""),subToggleItem:['   <li class="js-navigation-items navigation-subitems" id="<%= item.id %>" data-id="<%= item.id %>">','       <div class="navigation-subitems-toggle">','           <a class="<% if (!!item.action || !!item.event) { %>js-navigation-item <% } %> navigation-item" href="#"><%= translate(item.title) %></a>','           <a class="fa-chevron-right navigation-toggle-icon" href="#"></a>',"       </div>","</li>"].join(""),subItem:['<li class="js-navigation-sub-item" id="<%= item.id %>" data-id="<%= item.id %>">','   <a href="#"><%= translate(item.title) %></a>',"</li>"].join(""),footer:['<div class="user">','   <span class="fa-user pic"></span>','   <div class="name"><%= userName %></div>',"</div>",'<div class="options">','   <div class="locale-dropdown"></div>','       <a href="<%= logoutRoute %>" title="Logout" class="fa-lock logout"></a>',"   </div>",'<div class="version"><%= system %> (<%= version %>, <a href="#"><%= versionHistory %></a>)</div>'].join("")},t={footerTemplate:"",collapsed:!1,resizeWidth:1300,forceCollapse:!1,systemName:"Sulu 2.0",footer:!0,logoutRoute:"/logout",translations:{versionHistory:"navigation.version-history",user:"navigation.user"}},n={COMPONENT_CLASS:"husky-navigation",UNCOLLAPSED_WIDTH:250,COLLAPSED_WIDTH:50,ITEM_LABEL_HEIGHT:50,TRANSITIONEND_EVENT:"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",HIDDEN_CLASS:"disappeared"},r="husky.navigation.",i=r+"header.clicked",s=r+"item.select",o=r+"select-item",u=r+"select-id",a=r+"collapsed",f=r+"uncollapsed",l=r+"collapse",c=r+"uncollapse",h=r+"size.change",p=r+"size.changed",d=r+"user-locale.changed",v=r+"version-history.clicked",m=r+"username.clicked",g=r+"show",y=r+"size.update",b=r+"hide";return{initialize:function(){this.sandbox.logger.log("Initialized Navigation"),this.options=this.sandbox.util.extend(!0,{},t,this.options),this.stayCollapsed=!1,this.hidden=!1,this.tooltipsEnabled=!0,this.animating=!1,this.items=[],this.bindDOMEvents(),this.bindCustomEvents(),!this.options.url||this.sandbox.util.load(this.options.url,null,"json").then(function(e){this.options.data=e,this.render(),this.sandbox.emit("husky.navigation.initialized")}.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this))},render:function(){this.sandbox.dom.addClass(this.$el,n.COMPONENT_CLASS),this.renderSkeleton(),this.renderNavigationItems(this.options.data),this.renderFooter(),this.resizeListener(),!!this.options.selectAction&&this.options.selectAction.length>0&&this.preselectItem(this.options.selectAction)},renderSkeleton:function(){this.sandbox.dom.html(this.$el,this.sandbox.template.parse(e.skeleton,this.sandbox.util.extend(!0,{},this.options,{translate:this.sandbox.translate}))),this.$navigation=this.$find(".navigation"),this.$navigationContent=this.$find(".navigation-content")},renderNavigationItems:function(t){var n,r,i;this.sandbox.util.foreach(t.items,function(t){if(!t.items||!t.items.length)return;r=this.sandbox.dom.createElement('<div class="section">'),i=this.sandbox.dom.createElement('<ul class="section-items">');var s;!t.title||!(s=this.sandbox.translate(t.title))?!!n&&n.children().length>0&&this.sandbox.dom.append(r,'<hr class="section-headline-divider"/>'):this.sandbox.dom.append(r,'<div class="section-headline"><span class="section-headline-title">'+s.toUpperCase()+"</span></div>"),this.sandbox.dom.append(r,i),this.sandbox.dom.append("#navigation-item-container",r),this.sandbox.util.foreach(t.items,function(t){n=this.sandbox.dom.createElement(this.sandbox.template.parse(e.mainItem,{item:t,icon:t.icon?"fa-"+t.icon:"",translate:this.sandbox.translate})),this.sandbox.dom.append(i,n),t.items&&t.items.length>0&&this.renderSubNavigationItems(t,n),t.domObject=n,this.items.push(t)}.bind(this))}.bind(this))},renderSubNavigationItems:function(t,n){var r,i,s=this.sandbox.dom.createElement('<ul class="navigation-items-list" />');this.sandbox.dom.append(n,s),this.sandbox.util.foreach(t.items,function(n){n.parentTitle=t.title,this.items.push(n),!!n.items&&n.items.length>0?(r=this.sandbox.dom.createElement(this.sandbox.template.parse(e.subToggleItem,{item:n,translate:this.sandbox.translate})),this.renderSubNavigationItems(n,this.sandbox.dom.find("div",r))):r=this.sandbox.dom.createElement(this.sandbox.template.parse(e.subItem,{item:n,translate:this.sandbox.translate})),this.sandbox.dom.append(s,r),i=this.sandbox.dom.find("a",r),this.sandbox.dom.width(i)+20<this.sandbox.dom.get(i,0).scrollWidth&&this.sandbox.dom.attr(i,{title:this.sandbox.dom.html(i)}),n.domObject=r}.bind(this))},renderFooter:function(){if(this.options.footer===!0){var t=this.sandbox.dom.find("footer",this.$el);this.sandbox.dom.html(t,_.template(e.footer)({userName:this.sandbox.util.escapeHtml(this.options.userName),system:this.options.systemName,version:this.options.systemVersion,versionHistory:this.sandbox.translate(this.options.translations.versionHistory),logoutRoute:this.options.logoutRoute})),this.sandbox.start([{name:"select@husky",options:{el:this.sandbox.dom.find(".locale-dropdown",t),instanceName:"navigation-locale",value:"name",data:this.options.userLocales,preSelectedElements:[this.options.userLocale],style:"small",emitValues:!0}}])}},collapsedFooterClickHandler:function(){this.unCollapse(!0),this.sandbox.dom.one(this.sandbox.dom.$window,n.TRANSITIONEND_EVENT,this.checkBottomHit.bind(this,null,this.sandbox.dom.find("footer",this.$el)))},bindDOMEvents:function(){this.sandbox.dom.on(this.$el,"click",this.toggleItems.bind(this),".navigation-items-toggle, .navigation-subitems-toggle"),this.sandbox.dom.on(this.$el,"click",function(e){e.preventDefault(),this.selectMenuItem(e.currentTarget),_.delay(this.resizeListener.bind(this),700)}.bind(this),".js-navigation-sub-item, .js-navigation-item"),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(i)}.bind(this),".navigation-header div"),this.sandbox.dom.on(this.sandbox.dom.window,"resize",this.resizeListener.bind(this)),this.sandbox.dom.on(this.$el,"click",this.collapse.bind(this),".navigation.collapseIcon .navigation-close-icon"),this.sandbox.dom.on(this.$el,"click",this.collapsedFooterClickHandler.bind(this),".navigation.collapsed footer"),this.sandbox.dom.on(this.$el,"mouseenter",function(e){this.showToolTip.call(this,this.sandbox.translate(this.options.translations.user),e)}.bind(this),".navigation.collapsed footer"),this.sandbox.dom.on(this.$el,"mouseenter",this.showToolTip.bind(this,""),".navigation.collapsed .navigation-items"),this.sandbox.dom.on(this.$el,"mouseleave",this.hideToolTip.bind(this),".navigation.collapsed .navigation-items, .navigation.collapsed, .navigation.collapsed footer"),this.sandbox.dom.on(this.$el,n.TRANSITIONEND_EVENT,function(){this.sandbox.emit(p,this.sandbox.dom.width(this.$navigation)),this.tooltipsEnabled=!0}.bind(this)),this.sandbox.dom.on(this.$el,n.TRANSITIONEND_EVENT,function(e){e.stopPropagation()}.bind(this),".navigation *"),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(v)}.bind(this),"footer .version a"),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(m)}.bind(this),"footer .user")},bindCustomEvents:function(){this.sandbox.on("husky.navigation.footer.set",function(e){this.options=this.sandbox.util.extend(!0,{},this.options,e),this.renderFooter()}.bind(this)),this.sandbox.on("husky.select.navigation-locale.selected.item",function(e){this.sandbox.emit(d,e)}.bind(this)),this.sandbox.on(l,function(e){this.stayCollapsed=typeof e=="boolean"?e:!1,this.collapse()}.bind(this)),this.sandbox.on(c,function(e){this.stayCollapsed=!1,this.unCollapse(e)}.bind(this)),this.sandbox.on(b,this.hide.bind(this)),this.sandbox.on(g,this.show.bind(this)),this.sandbox.on(y,this.resizeListener.bind(this)),this.sandbox.on(o,this.preselectItem.bind(this)),this.sandbox.on(u,this.selectItem.bind(this))},resizeListener:function(){var e=this.sandbox.dom.width(this.sandbox.dom.window);e<=this.options.resizeWidth||this.stayCollapsed===!0?this.collapse():this.sandbox.dom.hasClass(this.$navigation,"collapsed")&&this.unCollapse()},showToolTip:function(e,t){if(this.tooltipsEnabled===!0){var n,r=t.currentTarget;e||(e=this.sandbox.dom.html(this.sandbox.dom.find(".navigation-item-title",t.currentTarget))),this.$tooltip||(this.$tooltip=this.sandbox.dom.createElement('<div class="navigation-tooltip">'+e+"</div>"),this.sandbox.dom.append("body",this.$tooltip)),n=this.sandbox.dom.offset(r),this.sandbox.dom.css(this.$tooltip,{top:n.top+(this.sandbox.dom.outerHeight(r)-30)/2})}},hideToolTip:function(){!this.$tooltip||(this.sandbox.dom.remove(this.$tooltip),this.$tooltip=null)},preselectItem:function(e){var t=0,n,r,i,s;this.sandbox.util.foreach(this.items,function(i){if(!i||!i.action)return;n=this.sandbox.util.compareURIs(i.action,e),n>t&&(r=i,t=n)}.bind(this)),!!r&&t>0?(s=r.domObject,this.sandbox.dom.hasClass(s,"js-navigation-sub-item")&&(i=this.sandbox.dom.closest(s,".navigation-items"),this.sandbox.dom.hasClass(i,"is-expanded")||this.toggleItems(null,i)),this.selectMenuItem(s,!1),this.checkBottomHit(null,s)):this.unmarkSelectedItem()},selectItem:function(e,t){var n=this.getItemById(e),r=n.domObject,i;if($(r).hasClass("is-selected"))return;this.sandbox.dom.hasClass(r,"js-navigation-sub-item")&&(i=this.sandbox.dom.closest(r,".navigation-items"),this.sandbox.dom.hasClass(i,"is-expanded")||this.toggleItems(null,i)),this.selectMenuItem(r,!1,t),this.checkBottomHit(null,r)},toggleItems:function(e,t){e?e.preventDefault():e={currentTarget:t};var n=this.sandbox.dom.closest(e.currentTarget,".js-navigation-items"),r=this.sandbox.dom.find("ul:first",n),i,s,o=this.sandbox.dom.hasClass(n,"is-expanded"),u;t||(u=this.showIfCollapsed()),o&&!u?(s=this.sandbox.dom.find(".fa-chevron-down",e.currentTarget),this.animateSlideUp(n,s)):this.collapsed!==!0&&(s=this.sandbox.dom.find(".fa-chevron-right",e.currentTarget),this.animateSlideDown(n,s,r)),i=this.getItemById(this.sandbox.dom.data(n,"id")),this.sandbox.emit("husky.navigation.item.toggle",!o,i)},animateSlideUp:function(e,t){this.animating===!1&&(this.animating=!0,this.sandbox.dom.animate(e,{height:n.ITEM_LABEL_HEIGHT},{duration:180,complete:function(){this.animating=!1}.bind(this)}),this.sandbox.dom.removeClass(e,"is-expanded"),this.sandbox.dom.removeClass(t,"fa-chevron-down"),this.sandbox.dom.prependClass(t,"fa-chevron-right"))},animateSlideDown:function(e,t,r){if(this.animating===!1){this.animating=!0;var i=n.ITEM_LABEL_HEIGHT+this.sandbox.dom.outerHeight(r);this.sandbox.dom.stop(e),this.sandbox.dom.animate(e,{height:i+30},{duration:120}),this.sandbox.dom.animate(e,{height:i},{duration:100,complete:function(){this.animating=!1}.bind(this)}),this.sandbox.dom.addClass(e,"is-expanded"),this.sandbox.dom.removeClass(t,"fa-chevron-right"),this.sandbox.dom.prependClass(t,"fa-chevron-down"),this.sandbox.dom.one(e,n.TRANSITIONEND_EVENT,this.checkBottomHit.bind(this))}},checkBottomHit:function(e,t){var n,r,i,s,o,u;e?u=e.currentTarget:u=t,s=this.sandbox.dom.offset(u).top,i=this.sandbox.dom.height(u),n=s+i,r=this.sandbox.dom.height(this.sandbox.dom.window),o=this.sandbox.dom.scrollTop(this.$navigationContent),n>r&&(i<r?this.sandbox.dom.scrollAnimate(o+(n-r+40),this.$navigationContent):this.sandbox.dom.scrollAnimate(s,this.$navigationContent))},removeHeightforExpanded:function(){var e=this.sandbox.dom.find(".is-expanded",this.$el),t,n;for(t=-1,n=e.length;++t<n;)this.sandbox.dom.removeAttr(e[t],"style")},setHeightForExpanded:function(){var e=this.sandbox.dom.find(".is-expanded",this.$el),t,r,i;for(r=-1,i=e.length;++r<i;)t=n.ITEM_LABEL_HEIGHT+this.sandbox.dom.outerHeight(this.sandbox.dom.find(".navigation-items-list",e[r])),this.sandbox.dom.css(e[r],{height:t})},showIfCollapsed:function(){return this.sandbox.dom.hasClass(this.$navigation,"collapsed")?(this.unCollapse(!0),!0):!1},collapse:function(){this.hidden===!1&&(this.sandbox.dom.addClass(this.$navigation,"collapsed"),this.sandbox.dom.removeClass(this.$navigation,"collapseIcon"),this.removeHeightforExpanded(),this.collapsed||(this.sandbox.dom.css(this.$el,{width:""}),this.sandbox.emit(a,n.COLLAPSED_WIDTH),this.sandbox.emit(h,n.COLLAPSED_WIDTH),this.collapsed=!0,this.tooltipsEnabled=!1))},unCollapse:function(e){(this.stayCollapsed===!1||e===!0)&&this.hidden===!1&&(e?(this.sandbox.dom.width(this.$el,this.sandbox.dom.width(this.$navigation)),this.sandbox.dom.addClass(this.$navigation,"collapseIcon")):(this.sandbox.dom.removeClass(this.$navigation,"collapseIcon"),this.sandbox.dom.css(this.$el,{width:""})),this.sandbox.dom.removeClass(this.$navigation,"collapsed"),this.hideToolTip(),this.setHeightForExpanded(),this.collapsed&&(this.sandbox.emit(f,n.UNCOLLAPSED_WIDTH,e),e||this.sandbox.emit(h,n.UNCOLLAPSED_WIDTH),this.collapsed=!this.collapsed,this.tooltipsEnabled=!1))},selectMenuItem:function(e,t,n){var r=$(e),i,s;r.hasClass("js-navigation-item")&&(r=$(e).closest("li"));if(r.hasClass("is-selected"))return;if($(e).parent().hasClass("navigation-items-toggle")||$(e).parent().hasClass("navigation-subitems-toggle"))return;i=this.getItemById(this.sandbox.dom.data(r,"id")),s=this.sandbox.util.extend(!0,{},i,n);if(!!i.event&&t!==!1){this.emitItemSelectEvent(s);return}t!==!1&&this.emitItemSelectEvent(s),this.markItemSelected(r)},markItemSelected:function(e){this.unmarkSelectedItem(),e.addClass("is-selected"),e.closest(".js-navigation-items").addClass("is-active")},unmarkSelectedItem:function(){this.sandbox.dom.removeClass(this.$find(".is-selected"),"is-selected"),this.sandbox.dom.removeClass(this.$find(".is-active"),"is-active")},emitItemSelectEvent:function(e){e.event?this.sandbox.emit("husky.navigation.item.event."+e.event,e.eventArgs):this.sandbox.emit(s,e)},getItemById:function(e){for(var t=-1,n=this.items.length;++t<n;)if(e==this.items[t].id)return this.items[t];return null},show:function(){this.sandbox.dom.removeClass(this.$navigation,n.HIDDEN_CLASS),!this.currentNavigationWidth||(this.sandbox.dom.removeAttr(this.$navigation,"style"),this.currentNavigationWidth=null,this.hidden=!1)},hide:function(){this.sandbox.dom.addClass(this.$navigation,n.HIDDEN_CLASS),this.currentNavigationWidth=this.sandbox.dom.width(this.$navigation),this.sandbox.dom.width(this.$navigation,0),this.hidden=!0}}}),define("__component__$column-options@husky",[],function(){"use strict";var e={url:null,data:[],trigger:null,instanceName:null,header:{disabled:!1,title:"Column Options"},footer:{disabled:!1},hidden:!1},t={listItem:['<li class="column-options-list-item" data-id="<%= id %>" draggable="true">','   <span class="move">&#8942;</span>','   <span class="text"><%= title %></span>','   <span class="<%= toggleIcon %> visibility-toggle"></span>',"</li>"].join(""),header:['<div class="column-options-header">','   <span class="title"><%= title %></span>','   <a href="#" class="fa-times close-button"></a>',"</div>"].join("")},n={visible:"fa-eye",hidden:"fa-eye-slash"},r=function(){return c.call(this,"initialized")},i=function(){return c.call(this,"item.enabled")},s=function(){return c.call(this,"item.disabled")},o=function(){return c.call(this,"saved")},u=function(){return c.call(this,"get-selected")},a=function(){return c.call(this,"get-all")},f=function(){this.sandbox.dom.on(this.$el,"click",g.bind(this),this.$container),this.sandbox.dom.on(this.$el,"mouseover",d.bind(this),"li"),this.sandbox.dom.on(this.$el,"mouseout",v.bind(this),"li"),this.sandbox.dom.on(this.$el,"click",S.bind(this),".visibility-toggle")},l=function(){this.sandbox.on(u.call(this),h.bind(this)),this.sandbox.on(a.call(this),p.bind(this))},c=function(e){return"husky.column-options."+(this.options.instanceName?this.options.instanceName+".":"")+e},h=function(e){var t,n,r=this.sandbox.dom.find("li:not(.disabled)",this.$el);n=[],this.sandbox.util.foreach(r,function(e){t=this.sandbox.dom.data(e,"id"),n.push(this.items[t])}.bind(this)),e(n)},p=function(e){var t,n,r=this.sandbox.dom.find("li",this.$el);n=[],this.sandbox.util.foreach(r,function(e){t=this.sandbox.dom.data(e,"id"),n.push(this.items[t])}.bind(this)),e(n)},d=function(e){this.sandbox.dom.addClass(e.currentTarget,"hover-style")},v=function(e){this.sandbox.dom.removeClass(e.currentTarget,"hover-style")},m=function(e){if(!e.id||!!this.items[e.id])do e.id=this.sandbox.util._.uniqueId();while(!!this.items[e.id])},g=function(e){e.preventDefault(),e.stopPropagation()},y=function(){var e=this.sandbox.dom.find(".column-options-list-item",this.$list),t=[],n;this.sandbox.util.foreach(e,function(e){n=this.sandbox.dom.data(e,"id"),t.push(this.items[n])}.bind(this)),this.data=t,this.options.data=this.data,p.call(this,function(e){this.sandbox.emit(o.call(this),e)}.bind(this))},b=function(){this.sandbox.dom.remove(this.$el)},w=function(){var e;this.items=[],this.sandbox.util.foreach(this.data,function(r){m.call(this,r),this.items[r.id]=r,e=this.sandbox.dom.createElement(this.sandbox.template.parse(t.listItem,{id:r.id,toggleIcon:r.default===!0||r.default==="true"?"":n.visible,title:this.sandbox.translate(r.translation)})),this.sandbox.dom.append(this.$list,e),typeof r.disabled!="undefined"&&r.disabled!=="false"&&r.disabled!==!1&&S.call(this,{currentTarget:this.sandbox.dom.find(".visibility-toggle",e),doNotEmitEvents:!0,preventDefault:function(){}})}.bind(this))},E=function(){if(this.overlayLoaded===!1){var e=this.sandbox.dom.createElement("<div/>");this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"overlay@husky",options:{el:e,container:this.$el,data:this.$list,okCallback:function(){y.call(this),b.call(this)}.bind(this),closeCallback:function(){b.call(this)}.bind(this),instanceName:"column-options-"+this.options.instanceName,title:this.options.header.title,openOnStart:!this.options.hidden,removeOnClose:!0}}]),this.overlayLoaded=!0}},S=function(e){e.preventDefault();var t=this.sandbox.dom.parent(e.currentTarget),r=this.sandbox.dom.hasClass(t,"disabled"),o=this.sandbox.dom.data(t,"id"),u=this.items[o],a=n.visible,f=n.hidden;if(r)this.numVisible++,this.sandbox.dom.removeClass(e.currentTarget,f),this.sandbox.dom.prependClass(e.currentTarget,a);else{if(this.numVisible===1)return;this.numVisible--,this.sandbox.dom.prependClass(e.currentTarget,f),this.sandbox.dom.removeClass(e.currentTarget,a)}this.sandbox.dom.toggleClass(t,"disabled"),u.disabled=!r,e.doNotEmitEvents||this.sandbox.emit(r?i.call(this):s.call(this),u)};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.overlayLoaded=!1,this.options.trigger=this.options.trigger||this.$el,this.options.url?this.sandbox.util.load(this.options.url).then(this.render.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.data?this.render(this.options.data):this.sandbox.logger.log("no data provided for tabs!"),f.call(this),l.call(this)},render:function(e){this.numVisible=e.length,this.options.data=e,this.data=this.sandbox.util.extend(!0,[],this.options.data),this.sandbox.dom.addClass(this.$el,"column-options-parent"),this.$list=this.sandbox.dom.createElement('<ul class="column-options-list" />'),w.call(this),this.sandbox.dom.sortable(this.$list,{handle:".move"}),E.call(this),this.sandbox.emit(r.call(this))},rerender:function(){this.data=this.sandbox.util.extend(!0,[],this.options.data),this.sandbox.dom.html(this.$list,""),w.call(this),this.sandbox.dom.sortable(this.$list,{handle:".move"})}}}),define("husky_components/datagrid/decorators/table-view",[],function(){"use strict";var e={editable:!1,removeRow:!1,selectItem:{type:"checkbox",inFirstCell:!1},noItemsText:"This list is empty",addRowTop:!0,excludeFields:[""],cssClass:"",thumbnailFormat:"sulu-50x50",showHead:!0,hideChildrenAtBeginning:!0,openChildId:null,highlightSelected:!1,icons:[],cssClasses:[],removeIcon:"trash-o",emptyIcon:"fa-coffee",noImgIcon:"fa-coffee",actionIcon:"pencil",actionIconColumn:null,croppedMaxLength:35,openPathToSelectedChildren:!0,cropContents:!0,editableOptions:{}},t={selectedRowClass:"selected",isSelectableClass:"is-selectable",sortableClass:"is-sortable",skeletonClass:"husky-table",containerClass:"table-container",overflowClass:"overflow",emptyListElementClass:"empty-list",rowRemoverClass:"row-remover",checkboxClass:"checkbox",radioClass:"radio",cellFitClass:"fit",tableClass:"table",rowClass:"row",thumbSrcKey:"url",thumbAltKey:"alt",evenClass:"even",oddClass:"odd",headerCellClass:"header-cell",ascSortedClass:"sorted-asc",descSortedClass:"sorted-desc",headerCellLoaderClass:"header-loader",headerLoadingClass:"is-loading",editableItemClass:"editable",editableInputClass:"editable-input",inputWrapperClass:"input-wrapper",editedErrorClass:"server-validation-error",newRecordId:"newrecord",gridIconClass:"grid-icon",gridBadgeClass:"badge",gridImageClass:"grid-image",childWrapperClass:"child-wrapper",parentClass:"children-toggler",noChildrenClass:"no-children",toggleIconClass:"toggle-icon",collapsedIcon:"fa-caret-right",expandedIcon:"fa-caret-down",checkboxCellClass:"checkbox-cell",thumbnailCellClass:"thumbnail-cell",textContainerClass:"cell-content",renderingClass:"rendering",actionClass:"has-action",inactiveClass:"inactive",childIndent:28},n={CHECKBOX:"checkbox",RADIO:"radio"},r={skeleton:['<div class="'+t.skeletonClass+'">','   <div class="'+t.containerClass+'"></div>',"</div>"].join(""),table:'<table class="'+t.tableClass+'"></table>',header:"<thead></thead>",body:"<tbody></tbody>",row:'<tr class="'+t.rowClass+'"></tr>',headerCell:'<th class="'+t.headerCellClass+'"></th>',cell:"<td></td>",textContainer:'<span class="'+t.textContainerClass+'"><%= content %></span>',headerCellLoader:'<div class="'+t.headerCellLoaderClass+'"></div>',removeCellContent:'<span class="fa-<%= icon %> '+t.rowRemoverClass+'"></span>',editableCellContent:{string:['<span class="'+t.editableItemClass+'"><%= value %></span>','<div class="'+t.inputWrapperClass+'">','   <input type="text" class="form-element husky-validate '+t.editableInputClass+'" value="<%= value %>">',"</div>"].join(""),select:['<select class="form-element husky-validate '+t.editableInputClass+'">',"<% _.each(options.values, function(title, index) { %>",'   <option value="<%= index %>" <% if (value === index) { %>selected<% } %>><%= translate(title) %></option>',"<% }); %>","</select>"].join("")},img:['<div class="'+t.gridImageClass+'">',"<% if (!!src) { %>",'   <img alt="<%= alt %>" src="<%= src %>"/>',"<% } else { %>",'   <div class="<%= noImgIcon %> empty"></div>',"<% } %>","</div>"].join(""),childWrapper:'<div class="'+t.childWrapperClass+'"></div>',toggleIcon:'<span class="'+t.toggleIconClass+'"></span>',icon:['<span class="',t.gridIconClass,' <%= cssClass %> <%= align %>" data-icon-index="<%= index %>">','   <span class="fa-<%= icon %>"></span>',"</span>"].join(""),badge:['<span class="'+t.gridBadgeClass+' <%= cssClass %>">','   <% if(!!icon) { %><span class="fa-<%= icon %>"></span><% } %>',"   <% if(!!title) { %><%= title %><% } %>","</span> "].join(""),checkbox:['<div class="custom-checkbox">','   <input class="'+t.checkboxClass+'" type="checkbox" data-form="false"/>','   <span class="icon"></span>',"</div>"].join(""),radio:['<div class="custom-radio">','    <input class="'+t.radioClass+'" name="<%= name %>" type="radio" data-form="false"/>','    <span class="icon"></span>',"</div>"].join(""),empty:['<div class="'+t.emptyListElementClass+'">','   <div class="<%= emptyIcon %> icon"></div>',"   <span><%= text %></span>","</div>"].join("")},i=function(){return this.datagrid.createEventName.call(this.datagrid,"update.table")},s=function(){return this.datagrid.createEventName.call(this.datagrid,"table.open-parents")},o=function(){return this.datagrid.createEventName.call(this.datagrid,"radio.selected")},u=function(){return this.datagrid.createEventName.call(this.datagrid,"children.collapsed")},a=function(){return this.datagrid.createEventName.call(this.datagrid,"children.expanded")};return{initialize:function(t,n){this.datagrid=t,this.keys={id:this.datagrid.options.idKey},this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n),this.editStatuses={},this.bindCustomEvents(),this.setVariables()},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.onResize.bind(this)),this.sandbox.on(s.call(this),this.openParents.bind(this));if(!!this.options.openPathToSelectedChildren){var e="";this.datagrid.options.instanceName?e="husky.datagrid."+this.datagrid.options.instanceName+".view.rendered":e="husky.datagrid.view.rendered",this.sandbox.on(e,this.openPathToSelectedChildren.bind(this))}},openPathToSelectedChildren:function(){this.sandbox.util.each(this.datagrid.selectedItems,function(e,t){this.openParents(t)}.bind(this))},unbindCustomEvents:function(){this.sandbox.off(i.call(this),this.onResize.bind(this)),this.sandbox.off(s.call(this),this.openParents.bind(this))},render:function(e,n){this.$el=this.sandbox.dom.createElement(r.skeleton),this.sandbox.dom.append(n,this.$el),this.addViewClasses(),this.addActionIcon(),this.data=e,this.renderTable(),this.bindDomEvents(),this.datagrid.options.resizeListeners===!0&&this.onResize(),!this.options.openChildId||(this.openParents(this.options.openChildId),this.options.openChildId=null),this.renderChildrenHidden=!1,this.sandbox.dom.removeClass(this.$el,t.renderingClass),this.rendered=!0},destroy:function(){this.sandbox.stop(this.sandbox.dom.find("*",this.$el)),this.sandbox.dom.remove(this.$el),this.setVariables()},addRecord:function(e,t){var n=t?!1:this.options.addRowTop;this.removeEmptyIndicator(),this.renderBodyRow(e,n),this.setAlternateClasses()},removeRecord:function(e){this.table.rows[e].$el.siblings().each(function(t,n){$(n).data("parent")===e&&this.removeRecord($(n).data("id"))}.bind(this)),this.deselectRecord(e),this.datagrid.removeRecord.call(this.datagrid,e),this.sandbox.dom.remove(this.table.rows[e].$el),delete this.table.rows[e],Object.keys(this.table.rows).length===0&&(this.toggleSelectAllItem(!1),this.renderEmptyIndicator())},onResize:function(){this.containerIsOverflown()===!0?this.overflowHandler():this.underflowHandler()},setVariables:function(){this.rendered=!1,this.$el=null,this.table={},this.data=null,this.rowClicked={},this.isFocusoutHandlerEnabled=this.options.editable===!0||this.options.editable==="true",this.renderChildrenHidden=this.options.hideChildrenAtBeginning,this.tableCropped=!1,this.cropBreakPoint=null,this.icons=this.sandbox.util.extend(!0,[],this.options.icons),this.badges=this.sandbox.util.extend(!0,[],this.options.badges),this.cssClasses=this.sandbox.util.extend(!0,[],this.options.cssClasses)},addViewClasses:function(){this.sandbox.dom.addClass(this.$el,this.options.cssClass),this.sandbox.dom.addClass(this.$el,t.renderingClass),(this.options.highlightSelected===!0||!!this.options.selectItem)&&this.options.editable!==!0&&this.sandbox.dom.addClass(this.$el,t.isSelectableClass)},addActionIcon:function(){typeof this.datagrid.options.actionCallback=="function"&&!!this.datagrid.matchings&&this.datagrid.matchings.length>0&&!!this.options.actionIcon&&this.icons.push({icon:this.options.actionIcon,column:this.options.actionIconColumn||this.datagrid.matchings[0].attribute,align:"left",callback:this.datagrid.options.actionCallback,actionIcon:!0})},renderTable:function(){this.table.$el=this.sandbox.dom.createElement(r.table),this.table.$container=this.sandbox.dom.find("."+t.containerClass,this.$el),this.options.showHead===!0&&this.renderHeader(),this.renderBody(),this.sandbox.dom.append(this.table.$container,this.table.$el),this.setAlternateClasses()},renderHeader:function(){this.table.header={},this.table.header.$el=this.sandbox.dom.createElement(r.header),this.table.header.$row=this.sandbox.dom.createElement(r.row),this.sandbox.dom.append(this.table.header.$el,this.table.header.$row),this.renderHeaderSelectItem(),this.renderHeaderCells(),this.renderHeaderRemoveItem(),this.sandbox.dom.append(this.table.$el,this.table.header.$el)},renderHeaderSelectItem:function(){if(!!this.options.selectItem&&!!this.options.selectItem.type){var e=this.sandbox.dom.createElement(r.headerCell);this.sandbox.dom.addClass(e,t.checkboxCellClass),this.options.selectItem.type===n.CHECKBOX&&this.sandbox.dom.html(e,r.checkbox),this.sandbox.dom.prepend(this.table.header.$row,e)}},renderHeaderCells:function(){var e;this.table.header.cells={},this.sandbox.util.foreach(this.datagrid.matchings,function(t){e=this.sandbox.dom.createElement(r.headerCell),!!t.class&&typeof t.class===this.datagrid.types.STRING&&this.sandbox.dom.addClass(e,t.class),this.sandbox.dom.html(e,this.sandbox.util.template(r.textContainer)({content:this.sandbox.translate(t.content)})),this.sandbox.dom.data(e,"attribute",t.attribute),this.table.header.cells[t.attribute]={$el:e,sortable:t.sortable},this.sandbox.dom.append(this.table.header.$row,this.table.header.cells[t.attribute].$el),this.setHeaderCellClasses(t.attribute)}.bind(this))},setHeaderCellClasses:function(e){if(this.datagrid.options.sortable===!0){var n=this.table.header.cells[e].$el,r;this.table.header.cells[e].sortable===!0&&(this.sandbox.dom.addClass(n,t.sortableClass),e===this.datagrid.sort.attribute&&(r=this.datagrid.sort.direction==="asc"?t.ascSortedClass:t.descSortedClass,this.sandbox.dom.addClass(n,r)))}},renderHeaderRemoveItem:function(){if(this.options.removeRow===!0){var e=this.sandbox.dom.createElement(r.headerCell);this.sandbox.dom.addClass(e,t.cellFitClass),this.sandbox.dom.append(this.table.header.$row,e)}},renderBody:function(){this.table.$body=this.sandbox.dom.createElement(r.body),this.table.rows={},this.data.embedded.length>0?this.sandbox.util.foreach(this.data.embedded,function(e){this.renderBodyRow(e)}.bind(this)):this.renderEmptyIndicator(),this.sandbox.dom.append(this.table.$el,this.table.$body)},renderRowSelectItem:function(e,i){if(this.datagrid.options.onlySelectLeaves===!0&&!!this.table.rows[e].hasChildren)return"";if(!!this.options.selectItem&&!!this.options.selectItem.type&&(this.options.selectItem.inFirstCell===!1||i===!0)){var s=this.sandbox.dom.createElement(r.cell);this.sandbox.dom.addClass(s,t.cellFitClass),this.options.selectItem.type===n.CHECKBOX?this.sandbox.dom.html(s,r.checkbox):this.options.selectItem.type===n.RADIO&&this.sandbox.dom.html(s,this.sandbox.util.template(r.radio)({name:"datagrid-"+this.datagrid.options.instanceName}));if(i===!0)return this.sandbox.dom.html(s);this.sandbox.dom.addClass(s,t.checkboxCellClass),this.sandbox.dom.prepend(this.table.rows[e].$el,s)}},renderBodyRow:function(e,n){this.removeNewRecordRow();var i=this.sandbox.dom.createElement(r.row),s=this.table.rows[e.id]?this.table.rows[e.id].$el:null,o=this.hasParent(e);e.id=e[this.keys.id]?e[this.keys.id]:t.newRecordId,this.sandbox.dom.data(i,"id",e.id),!e.parent||this.sandbox.dom.data(i,"parent",e.parent),o&&(this.table.rows[e.parent]||this.renderBodyRow(this.data.embedded[this.datagrid.getRecordIndexById(e.parent)],n),this.table.rows[e.parent].childrenLoaded=!0),this.table.rows[e.id]={$el:i,cells:{},childrenLoaded:this.table.rows[e.id]?this.table.rows[e.id].childrenLoaded:!1,childrenExpanded:!1,parent:o?e.parent:null,hasChildren:e[this.datagrid.options.childrenPropertyName]?e[this.datagrid.options.childrenPropertyName]:!1,selectedChildren:0,level:1},(typeof this.datagrid.options.clickCallback=="function"||typeof this.datagrid.options.actionCallback=="function"||this.table.rows[e.id].hasChildren===!0)&&this.sandbox.dom.addClass(i,t.actionClass),typeof this.datagrid.options.clickCallback!="function"&&this.table.rows[e.id].hasChildren===!1&&this.sandbox.dom.addClass(i,t.inactiveClass),this.renderRowSelectItem(e.id),this.renderBodyCellsForRow(e),this.renderRowRemoveItem(e.id),this.insertBodyRow(e,s,n),this.executeRowPostRenderActions(e)},insertBodyRow:function(e,t,n){var r=this.table.rows[e.parent]?this.table.rows[e.parent].$el:null,i=n===!0?this.sandbox.dom.prepend:this.sandbox.dom.append;!t||!t.length?!r||!r.length?i(this.table.$body,this.table.rows[e.id].$el):(this.renderChildrenHidden===!0?(this.sandbox.dom.hide(this.table.rows[e.id].$el),this.changeChildrenToggleIcon(e.parent,!1)):(this.table.rows[e.parent].childrenExpanded=!0,this.changeChildrenToggleIcon(e.parent,!0)),this.sandbox.dom.after(this.getLastChildElementOfParent(r)||r,this.table.rows[e.id].$el)):(this.sandbox.dom.after(t,this.table.rows[e.id].$el),this.sandbox.dom.remove(t))},getLastChildElementOfParent:function(e){var t=e.siblings().filter(function(){return $(this).data("parent")===e.data("id")});return t.length>0?t.last():null},executeRowPostRenderActions:function(e){this.datagrid.itemIsSelected.call(this.datagrid,e.id)?this.toggleSelectRecord(e.id,!0):this.toggleSelectAllItem(!1),this.options.editable===!0&&e.id===t.newRecordId&&this.showInput(e.id)},renderBodyCellsForRow:function(e){this.sandbox.util.foreach(this.datagrid.matchings,function(t,n){this.options.excludeFields.indexOf(t.attribute)===-1&&this.renderBodyCell(e,t,n)}.bind(this))},renderRowRemoveItem:function(e){if(this.options.removeRow===!0){var n=this.sandbox.dom.createElement(r.cell);this.sandbox.dom.html(n,this.sandbox.util.template(r.removeCellContent)({icon:this.options.removeIcon})),this.sandbox.dom.addClass(n,t.cellFitClass),this.sandbox.dom.append(this.table.rows[e].$el,n)}},renderBodyCell:function(e,n,i){var s=this.sandbox.dom.createElement(r.cell),o=this.getCellContent(e,n,s),u,a=!1;!!this.datagrid.options.childrenPropertyName&&i===0&&(o=this.wrapChildrenCellContent(o,e)),!!this.options.selectItem&&this.options.selectItem.inFirstCell===!0&&i===0&&(this.sandbox.dom.attr(s,"colspan",2),u=this.renderRowSelectItem(e.id,!0),typeof o===this.datagrid.types.STRING?o=u+o:this.sandbox.dom.prepend(o,u)),!!n.class&&typeof n.class===this.datagrid.types.STRING&&this.sandbox.dom.addClass(s,n.class),n.type===this.datagrid.types.THUMBNAILS&&(this.sandbox.dom.addClass(s,t.thumbnailCellClass),this.sandbox.dom.addClass(s,t.cellFitClass)),this.sandbox.dom.html(s,o),this.sandbox.dom.data(s,"attribute",n.attribute),!!this.sandbox.dom.find("."+t.textContainerClass,s).length&&this.sandbox.dom.children(this.sandbox.dom.find("."+t.textContainerClass,s)).length===0&&(a=!0),this.table.rows[e.id].cells[n.attribute]={$el:s,originalData:e[n.attribute],originalContent:this.sandbox.dom.text(s),editable:!!n.editable,croppable:a},this.sandbox.dom.append(this.table.rows[e.id].$el,this.table.rows[e.id].cells[n.attribute].$el)},getCellContent:function(e,n,i){var s=e[n.attribute];if(!n.type||n.type!==this.datagrid.types.THUMBNAILS){if(!n.type||n.type===this.datagrid.types.STRING||n.type===this.datagrid.types.TITLE)s=this.sandbox.util.escapeHtml(s);s=this.datagrid.processContentFilter(n.attribute,s,n.type,Object.keys(this.table.rows).length,e.hasOwnProperty("id")?e.id:null)}else s=this.datagrid.manipulateContent(s,n.type,this.options.thumbnailFormat),s=this.sandbox.util.template(r.img)({alt:s[t.thumbAltKey],src:s[t.thumbSrcKey],noImgIcon:typeof this.options.noImgIcon=="function"?this.options.noImgIcon(e):this.options.noImgIcon});return this.options.editable===!0&&n.editable===!0?s=this.getEditableCellContent(s,n.attribute,n.type):s=this.sandbox.util.template(r.textContainer)({content:s}),!this.icons||(s=this.addIconsToCellContent(s,n,i,e)),!this.badges||(s=this.addBadgesToCellContent(s,n,e)),!this.cssClasses||(s=this.addCssClassesToCellContent(s,n,e)),s},wrapChildrenCellContent:function(e,n){var i=this.sandbox.dom.createElement(r.childWrapper),s,o=0;return n[this.datagrid.options.childrenPropertyName]?(this.sandbox.dom.addClass(i,t.parentClass),s=this.sandbox.dom.createElement(r.toggleIcon),this.sandbox.dom.prependClass(s,t.collapsedIcon),this.sandbox.dom.prepend(i,s)):this.sandbox.dom.addClass(i,t.noChildrenClass),this.hasParent(n)&&(this.table.rows[n.id].level=this.table.rows[n.parent].level+1,o=t.childIndent*(this.table.rows[n.id].level-1)),this.datagrid.options.onlySelectLeaves==1&&this.table.rows[n.id].hasChildren==1&&(o+=40),!o||this.sandbox.dom.css(i,{"padding-left":o+"px"}),this.sandbox.dom.append(i,e),i},hasParent:function(e){return!!e.parent&&!!this.data.embedded[this.datagrid.getRecordIndexById(e.parent)]},getEditableCellContent:function(e,t,n){n=n?n:this.datagrid.types.STRING;var i=this.options.editableOptions[t]?this.options.editableOptions[t]:{};return this.sandbox.util.template(r.editableCellContent[n],{value:e,options:i,translate:this.sandbox.translate})},addIconsToCellContent:function(e,n,i,s){var o;return this.sandbox.util.foreach(this.icons,function(u,a){var f=u.icon;typeof f=="function"&&(f=f(s)),u.column===n.attribute&&(!u.disableCallback||u.disableCallback(s))&&(o=this.sandbox.util.template(r.icon,{icon:f,align:u.align,cssClass:u.cssClass,index:a}),typeof e=="object"?this.sandbox.dom.append(e,o):typeof e===this.datagrid.types.STRING&&(e+=o),u.actionIcon===!0&&this.sandbox.dom.addClass(i,t.actionClass))}.bind(this)),e},addBadgesToCellContent:function(e,t,n){var i;return this.sandbox.util.foreach(this.badges,function(s){if(s.column===t.attribute){!s.callback||(s=s.callback(n,s));if(!s)return;i=this.sandbox.util.template(r.badge)(this.sandbox.util.extend(!0,{cssClass:null,title:null,icon:null},s)),typeof e=="object"?this.sandbox.dom.prepend(e,i):typeof e===this.datagrid.types.STRING&&(e=i+e)}}.bind(this)),e},addCssClassesToCellContent:function(e,t,n){return this.sandbox.util.foreach(this.cssClasses,function(r){if(r.column===t.attribute){!r.callback||(r=r.callback(n,r));if(!r)return;typeof e=="object"?$(e).wrap(['<span class="',r,'" />'].join("")):typeof e===this.datagrid.types.STRING&&(e=['<span class="',r,'">',e,"</span>"].join(""))}}.bind(this)),e},renderEmptyIndicator:function(){this.sandbox.dom.append(this.$el,this.sandbox.util.template(r.empty)({text:this.sandbox.translate(this.options.noItemsText),emptyIcon:this.options.emptyIcon}))},removeNewRecordRow:function(){!this.table.rows[t.newRecordId]||(this.sandbox.dom.remove(this.table.rows[t.newRecordId].$el),delete this.table.rows[t.newRecordId])},containerIsOverflown:function(){return this.table.$container?this.sandbox.dom.get(this.table.$container,0).scrollWidth>this.sandbox.dom.width(this.table.$container):!1},overflowHandler:function(){!this.options.cropContents||this.toggleCropTable(!0),this.containerIsOverflown()===!0&&this.sandbox.dom.addClass(this.$el,t.overflowClass)},underflowHandler:function(){this.tableCropped===!0&&(!!this.options.cropContents&&this.sandbox.dom.width(this.table.$container)>this.cropBreakPoint&&this.toggleCropTable(!1),this.containerIsOverflown()===!1&&this.sandbox.dom.removeClass(this.$el,t.overflowClass))},toggleCropTable:function(e){if(this.tableCropped!==e){var n,r;this.sandbox.util.each(this.table.rows,function(i,s){this.sandbox.util.each(s.cells,function(i,s){s.croppable===!0&&(n=this.sandbox.dom.find("."+t.textContainerClass,s.$el),e===!0?(r=this.sandbox.util.cropMiddle(s.originalContent,this.options.croppedMaxLength),this.sandbox.dom.attr(n,"title",s.originalContent),this.tableCropped=!0,this.cropBreakPoint=this.sandbox.dom.width(this.table.$container)):(r=s.originalContent,this.sandbox.dom.removeAttr(n,"title"),this.tableCropped=!1),this.sandbox.dom.text(n,r))}.bind(this))}.bind(this))}},bindDomEvents:function(){this.sandbox.dom.on(this.table.$body,"click",this.selectItemChangeHandler.bind(this),"."+t.checkboxClass+", ."+t.radioClass),this.sandbox.dom.on(this.table.$body,"click",this.bodyRowClickHandler.bind(this),"."+t.rowClass),this.sandbox.dom.on(this.table.$body,"dblclick",this.bodyRowDblClickHandler.bind(this),"."+t.rowClass),this.sandbox.dom.on(this.table.$body,"click",this.cellActionCallback.bind(this),"td."+t.actionClass),this.options.removeRow===!0&&this.sandbox.dom.on(this.table.$body,"click",this.removeItemClickHandler.bind(this),"."+t.rowRemoverClass),!this.table.header||(this.sandbox.dom.on(this.table.header.$el,"change",this.allSelectItemChangeHandler.bind(this)),this.datagrid.options.sortable===!0&&this.sandbox.dom.on(this.table.header.$el,"click",this.sortItemClickHandler.bind(this),"."+t.headerCellClass+"."+t.sortableClass)),this.options.editable===!0&&(this.sandbox.dom.on(this.table.$body,"click",this.editableItemClickHandler.bind(this),"."+t.editableItemClass),this.sandbox.dom.on(this.table.$body,"focusout",this.editableInputFocusoutHandler.bind(this),"."+t.editableInputClass),this.sandbox.dom.on(this.table.$body,"keydown",this.editableInputKeyHandler.bind(this),"."+t.editableInputClass),this.sandbox.dom.on(this.table.$body,"change",this.editableInputEventHandler.bind(this),"."+t.editableInputClass)),!this.icons||this.sandbox.dom.on(this.table.$body,"click",this.iconClickHandler.bind(this),"."+t.gridIconClass),this.sandbox.dom.on(this.table.$body.find("img"),"error",function(){$(this).remove()}),this.sandbox.dom.on(this.table.$body.find("img"),"load",function(){$(this).parent().find(".fa-coffee").remove()}),this.sandbox.dom.on(this.table.$body,"click",this.radioButtonClickHandler.bind(this),'input[type="radio"]')},radioButtonClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id"),r=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"td"),"attribute");this.sandbox.emit(o.call(this),n,r)},iconClickHandler:function(e){var n=this.icons[this.sandbox.dom.data(e.currentTarget,"icon-index")],r=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id");typeof r!="undefined"&&!!n&&typeof n.callback=="function"&&(e.stopPropagation(),n.callback(r,this.datagrid.getRecordById(r)))},sortItemClickHandler:function(e){this.sandbox.dom.stopPropagation(e);if(this.sandbox.dom.hasClass(e.currentTarget,t.headerLoadingClass))return!1;var n=this.sandbox.dom.data(e.currentTarget,"attribute"),r="asc";this.datagrid.sort.attribute===n&&this.datagrid.sort.direction===r&&(r="desc"),this.startHeaderCellLoader(n),this.datagrid.sortGrid.call(this.datagrid,n,r)},editableItemClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id"),r=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"td"),"attribute");this.showInput(n,r)},showInput:function(e,n){var r,i,s,o;n||(i=this.sandbox.dom.find("."+t.editableInputClass,this.table.rows[e].$el),n=this.sandbox.dom.data(this.sandbox.dom.parents(i[0],"td"),"attribute")),r=this.table.rows[e].cells[n].$el,s=this.sandbox.dom.find("."+t.editableInputClass,r),o=this.sandbox.dom.find("."+t.inputWrapperClass,r),this.sandbox.dom.show(o),this.sandbox.dom.focus(s),this.sandbox.dom.select(s),this.editStatuses[e]=!0},editableInputKeyHandler:function(e){this.removeEditedErrorCallback($(e.currentTarget).parents("."+t.rowClass).data("id")),e.keyCode===13&&this.editableInputEventHandler(e)},editableInputFocusoutHandler:function(e){!this.isFocusoutHandlerEnabled||this.editableInputEventHandler(e)},editableInputEventHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),r=this.sandbox.dom.data(n,"id");(!!this.editStatuses[r]||$(e.currentTarget).is("select"))&&this.editRow(r),this.editStatuses[r]=!1},editRow:function(e){var n={};this.sandbox.util.each(this.table.rows[e].cells,function(e,r){!this.sandbox.dom.find("."+t.editableInputClass,r.$el).length||(n[e]=this.sandbox.dom.val(this.sandbox.dom.find("."+t.editableInputClass,r.$el)))}.bind(this)),this.saveRow(e,n,this.editedSuccessCallback.bind(this),this.editedErrorCallback.bind(this,e))},editedSuccessCallback:function(e){var n;!e.id||!this.table.rows[e.id]?!this.table.rows[t.newRecordId]||(n=this.table.rows[t.newRecordId].$el):n=this.table.rows[e.id].$el,!!n&&!!n.length&&(this.sandbox.dom.hide(this.sandbox.dom.find("."+t.inputWrapperClass,n)),this.renderBodyRow(e,this.options.addRowTop))},editedErrorCallback:function(e){var n=this.table.rows[e].$el;this.sandbox.dom.addClass(this.sandbox.dom.find("."+t.inputWrapperClass,n),t.editedErrorClass)},removeEditedErrorCallback:function(e){var n=this.table.rows[e].$el;n.find("."+t.inputWrapperClass).removeClass(t.editedErrorClass),this.editStatuses[e]=!0},saveRow:function(e,n,r,i){var s=!1,o;this.sandbox.util.each(this.table.rows[e].cells,function(e,t){t.editable===!0&&t.originalData!==n[e]&&(s=!0)}.bind(this)),o=this.sandbox.util.extend(!0,{},this.data.embedded[this.datagrid.getRecordIndexById(e)],n),e===t.newRecordId&&delete o.id,s===!0?this.datagrid.saveGrid.call(this.datagrid,o,this.datagrid.getUrlWithoutParams.call(this.datagrid),r,i,this.options.addRowTop):typeof r=="function"&&r(o)},startHeaderCellLoader:function(e){var n=this.sandbox.dom.createElement(r.headerCellLoader);this.sandbox.dom.addClass(this.table.header.cells[e].$el,t.headerLoadingClass),this.sandbox.dom.append(this.sandbox.dom.find("."+t.textContainerClass,this.table.header.cells[e].$el),n),this.sandbox.start([{name:"loader@husky",options:{el:n,size:"10px",color:"#999999"}}])},bodyRowClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var t=this.sandbox.dom.data(e.currentTarget,"id");!!t&&!!this.table.rows&&!!this.table.rows[t]&&(!this.table.rows[t].hasChildren||this.toggleChildren(t)),this.rowClickCallback(e)},bodyRowDblClickHandler:function(e){this.sandbox.dom.stopPropagation(e),this.rowActionCallback(e)},rowClickCallback:function(e){var t=this.sandbox.dom.data(e.currentTarget,"id");this.rowClicked[t]||(this.rowClicked[t]=!0,this.datagrid.itemClicked.call(this.datagrid,t),this.sandbox.util.delay(function(){this.rowClicked[t]=!1}.bind(this),500))},rowActionCallback:function(e){var t=this.sandbox.dom.data(e.currentTarget,"id");this.datagrid.itemAction.call(this.datagrid,t)},cellActionCallback:function(e){var t=this.sandbox.dom.data(this.sandbox.dom.parent(e.currentTarget),"id");!!this.table.rows[t]&&!this.table.rows[t].hasChildren&&this.datagrid.itemAction.call(this.datagrid,t)},removeItemClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id");this.removeRecord(n)},selectItemChangeHandler:function(e){!e.type||this.sandbox.dom.stopPropagation(e);var r=this.sandbox.dom.data(this.sandbox.dom.parents(e.target,"."+t.rowClass),"id"),i=this.sandbox.dom.is(e.target,":checked");this.options.selectItem.type===n.CHECKBOX?this.toggleSelectRecord(r,i):this.options.selectItem.type===n.RADIO&&this.uniqueSelectRecord(r)},allSelectItemChangeHandler:function(e){if(this.data.embedded.length==0)return this.sandbox.dom.prop(e.target,"checked",!1),!1;this.sandbox.dom.stopPropagation(e);var t=this.sandbox.dom.is(e.target,":checked");t===!0?this.selectAllRecords():this.deselectAllRecords()},selectAllRecords:function(){this.datagrid.selectAllItems.call(this.datagrid),this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass,this.table.$body),"checked",!0),this.sandbox.dom.addClass(this.sandbox.dom.find("."+t.rowClass,this.table.$body),t.selectedRowClass)},deselectAllRecords:function(){this.datagrid.deselectAllItems.call(this.datagrid),this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass,this.table.$body),"checked",!1),this.sandbox.dom.removeClass(this.sandbox.dom.find("."+t.rowClass,this.table.$body),t.selectedRowClass),this.updateSelectAll()},selectRecord:function(e){this.toggleSelectRecord(e,!0)},deselectRecord:function(e){this.toggleSelectRecord(e,!1)},toggleSelectRecord:function(e,n){n===!0?(this.datagrid.setItemSelected.call(this.datagrid,e),this.table.rows[e]&&(this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass+", ."+t.radioClass,this.table.rows[e].$el),"checked",!0),this.sandbox.dom.addClass(this.table.rows[e].$el,t.selectedRowClass),this.indeterminateSelectParents(e))):(this.datagrid.setItemUnselected.call(this.datagrid,e),this.table.rows[e]&&(this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass+", ."+t.radioClass,this.table.rows[e].$el),"checked",!1),this.table.rows[e].selectedChildren>0&&this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass+", ."+t.radioClass,this.table.rows[e].$el),"indeterminate",!0),this.sandbox.dom.removeClass(this.table.rows[e].$el,t.selectedRowClass),this.indeterminateUnselectParents(e))),this.updateSelectAll()},toggleSelectAllItem:function(e){!this.table.header||this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass,this.table.header.$el),"checked",e)},updateSelectAll:function(){!this.table.header||this.toggleSelectAllItem(this.datagrid.getSelectedItemIds.call(this.datagrid).length===this.data.embedded.length)},uniqueSelectRecord:function(e){this.datagrid.deselectAllItems.call(this.datagrid),this.datagrid.setItemSelected.call(this.datagrid,e)},removeEmptyIndicator:function(){this.sandbox.dom.remove(this.sandbox.dom.find("."+t.emptyListElementClass,this.$el))},changeChildrenToggleIcon:function(e,n){var r=this.sandbox.dom.find("."+t.toggleIconClass,this.table.rows[e].$el);!!r&&!!r.length&&(n===!0?(this.sandbox.dom.removeClass(r,t.collapsedIcon),this.sandbox.dom.prependClass(r,t.expandedIcon)):(this.sandbox.dom.removeClass(r,t.expandedIcon),this.sandbox.dom.prependClass(r,t.collapsedIcon)))},toggleChildren:function(e){this.table.rows[e].childrenLoaded===!0?this.table.rows[e].childrenExpanded===!0?(this.hideChildren(e),this.sandbox.emit(u.call(this))):(this.showChildren(e),this.sandbox.emit(a.call(this))):this.loadChildren(e)},hideChildren:function(e){this.sandbox.util.each(this.table.rows,function(t,n){n.parent==e&&(!n.hasChildren||this.hideChildren(t),this.sandbox.dom.hide(n.$el))}.bind(this)),this.table.rows[e].childrenExpanded=!1,this.changeChildrenToggleIcon(e,!1),this.setAlternateClasses()},showChildren:function(e){this.sandbox.util.each(this.table.rows,function(t,n){n.parent==e&&this.sandbox.dom.show(n.$el)}.bind(this)),this.table.rows[e].childrenExpanded=!0,this.changeChildrenToggleIcon(e,!0),this.setAlternateClasses()},loadChildren:function(e){var n=$('<div style="margin-right: -3px"/>'),r=$(this.table.rows[e].$el).find("."+t.toggleIconClass);this.sandbox.dom.append(r,n),this.sandbox.dom.removeClass(r,t.collapsedIcon),this.sandbox.start([{name:"loader@husky",options:{el:n,size:"8px",color:"#999999"}}]),this.datagrid.loadChildren.call(this.datagrid,e).then(function(){this.sandbox.stop(n)}.bind(this)),this.table.rows[e].childrenLoaded=!0},openParents:function(e){if(!!this.table.rows[e]){var t=this.table.rows[e].parent;!t||(!this.table.rows[t].parent||this.openParents(t),this.showChildren(t))}},indeterminateSelectParents:function(e){var n=this.table.rows[e].parent,r;!n||(this.table.rows[n].selectedChildren+=1,r=this.table.rows[n].$el.find("."+t.checkboxClass),r.prop("checked")||r.prop("indeterminate",!0),this.indeterminateSelectParents(n))},indeterminateUnselectParents:function(e){var n=this.table.rows[e].parent,r;!n||(this.table.rows[n].selectedChildren-=1,r=this.table.rows[n].$el.find("."+t.checkboxClass),this.table.rows[n].selectedChildren===0&&!!r.prop("indeterminate")&&r.prop("indeterminate",!1),this.indeterminateUnselectParents(n))},setAlternateClasses:function(){var e=this.sandbox.dom.find("."+t.rowClass,this.table.$body);this.sandbox.dom.removeClass(e,t.evenClass),this.sandbox.dom.removeClass(e,t.oddClass),this.sandbox.dom.addClass(this.sandbox.dom.filter(e,":visible:even"),t.evenClass),this.sandbox.dom.addClass(this.sandbox.dom.filter(e,":visible:odd"),t.oddClass)},collapseAllChildren:function(){for(var e=0,t=this.data.embedded.length;e<t;e++)this.hideChildren(this.data.embedded[e].id)},showSelected:function(e){var t=this.datagrid.$find("tbody .row:not(.selected)");e?t.hide():t.show()}}}),define("husky_components/datagrid/decorators/tiles-view",[],function(){"use strict";var e={icon:"fa-folder",showAddNewTile:!0,addNewIcon:"fa-plus-circle",fields:{title:["title"],description:["elementsCount"]},translations:{items:"public.items",addNew:"public.add-new"}},t={tile:['<div class="tile">','   <span class="<%= icon %> icon"></span>','   <span title="<%- title %>" class="title"><%- title %></span>','   <span class="description"><%- description %></span>',"</div>"].join(""),addNewTile:['<div class="add-new-tile">','   <span class="<%= icon %> icon"></span>','   <span class="title"><%- title %></span>',"</div>"].join("")},n=function(e){var t=this.sandbox.util.extend(!1,{},e),n;return this.datagrid.matchings.forEach(function(e){n=null,e.type===this.datagrid.types.COUNT&&(n=this.sandbox.translate(this.options.translations.items)),t[e.attribute]=this.datagrid.processContentFilter.call(this.datagrid,e.attribute,t[e.attribute],e.type,n)}.bind(this)),t},r=function(){return this.datagrid.createEventName.call(this.datagrid,"tiles.add-clicked")};return{initialize:function(t,n){this.datagrid=t,this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n)},render:function(e,t){this.rendered=!1,this.$el=null,this.$tiles={},this.renderContainer(t),e.embedded.map(this.renderRecord.bind(this)),!this.options.showAddNewTile||this.renderAddNewTile(),this.bindDomEvents(),this.rendered=!0},bindDomEvents:function(){this.$el.on("click",".tile",function(e){this.datagrid.itemAction.call(this.datagrid,$(e.currentTarget).data("id"))}.bind(this))},renderContainer:function(e){this.$el=$('<div class="tiles-view"/>'),e.append(this.$el)},renderAddNewTile:function(){var e=$(_.template(t.addNewTile,{icon:this.options.addNewIcon,title:this.sandbox.translate(this.options.translations.addNew)}));e.on("click",function(){this.sandbox.emit(r.call(this))}.bind(this)),this.$el.append(e)},renderRecord:function(e){e=n.call(this,e);var r=this.getTitle(e),i=this.getDescription(e),s,o,u,a;this.$tiles[e.id]=$(_.template(t.tile,{icon:this.options.icon,title:r,description:this.sandbox.util.cropMiddle(i,18)})),this.$tiles[e.id].data("id",e.id),this.$el.append(this.$tiles[e.id]),s=this.$tiles[e.id].find(".title"),o=parseInt(s.css("line-height").replace("px","")),u=s.height()/o,a=s.get(0).scrollWidth>s.innerWidth(),(u>2||!!a)&&this.$tiles[e.id].find(".title").html(this.sandbox.util.cropMiddle(r,18))},getTitle:function(e){var t="";return this.options.fields.title.forEach(function(n){t+=e[n]+" "}),t.trim()},getDescription:function(e){var t="";return this.options.fields.description.forEach(function(n){t+=e[n]+" "}),t.trim()},destroy:function(){this.$el.remove()}}}),define("husky_components/datagrid/decorators/dropdown-pagination",[],function(){"use strict";var e={showElementsSteps:[10,20,50,100,200],limit:20},t={paginationClass:"pagination-wrapper dropdowns",paginationElementClass:"pagination",prevClass:"previous",nextClass:"next",inputClass:"page-input",pageLabelClass:"page-label",sizeChangeClass:"size-change",loaderClass:"pagination-loader"},n={pageLabel:['<div class="',t.pageLabelClass,'">','    <%= translate("pagination.page") %>','    <input type="text" class="form-element ',t.inputClass,'" value="<%= i %>" />','    <%= translate("pagination.of") %> <%= pages %>',"</div>"].join(""),pageChanger:['<span class="inline-block"><%= label %></span>','<div class="',t.nextClass,' pagination-prev pull-right pointer <%= prevButtonClass %>"></div>','<div class="'+t.prevClass+' pagination-next pull-right pointer <%= nextButtonClass %>"></div>'].join(""),loader:['<div class="',t.loaderClass,'"></div>'].join(""),showElements:['<div class="show-elements">','<span class="text"><%= translate(text) %>:</span>','<div class="'+t.sizeChangeClass+' dropdown-trigger">',"<%= desc %>",'<span class="dropdown-toggle"></span>',"</div>","</div>"].join("")},r={show:"pagination.show",elementsOf:"pagination.elements-of",elementsPerPage:"pagination.elements-per-page"};return{initialize:function(t,n){this.datagrid=t,this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n),this.setVariables(),this.bindCustomEvents()},getHeight:function(){return this.sandbox.dom.outerHeight(this.$paginationContainer,!0)},render:function(e,n){this.$el=n,this.data=e,this.$paginationContainer=this.sandbox.dom.createElement('<div class="'+t.paginationClass+'"/>'),this.preparePagination(),this.sandbox.dom.append(this.$el,this.$paginationContainer),this.bindDomEvents()},getLimit:function(){return this.options.limit},setVariables:function(){this.$el=null,this.$paginationContainer=null,this.data=null},destroy:function(){this.sandbox.stop(this.sandbox.dom.find("*",this.$paginationContainer)),this.unbindDomEvents(),this.sandbox.dom.remove(this.$paginationContainer)},bindCustomEvents:function(){this.sandbox.on("husky.dropdown."+this.datagrid.options.instanceName+"-pagination-dropdown-show.item.click",function(e){if(this.data.limit!==e.id||this.data.embedded.length===this.data.total)this.startLoader(),this.datagrid.changePage.call(this.datagrid,null,1,e.id)}.bind(this))},startLoader:function(){var e=this.sandbox.dom.createElement(n.loader);this.sandbox.dom.append(this.$paginationContainer,e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"20px",color:"#999999"}}])},bindDomEvents:function(){var e=this.sandbox.dom.find("input."+t.inputClass,this.$el),n=parseInt(e.css("font-size"),10),r=parseInt(e.css("min-width"),10),i=parseInt(e.css("max-width"),10);this.sandbox.dom.on(this.sandbox.dom.find("."+t.nextClass,this.$el),"click",this.nextPage.bind(this)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.prevClass,this.$el),"click",this.prevPage.bind(this)),this.sandbox.dom.on(e,"focusout",this.inputHandler.bind(this)),this.sandbox.dom.on(e,"keydown",function(){if(event.which===13){this.inputHandler(event);return}var t=50+e.val().length*n/2;t>r&&t<=i&&e.css({width:t+"px"})}.bind(this))},inputHandler:function(e){var t=this.sandbox.dom.find(e.currentTarget),n=parseInt(t.val(),10);if(isNaN(n)){t.val(this.data.page);return}n<1&&(n=1),n>this.data.pages&&(n=this.data.pages);if(n===this.data.page){t.val(this.data.page);return}this.startLoader(),this.datagrid.changePage.call(this.datagrid,null,n)},nextPage:function(){!this.data.links.next||(this.startLoader(),this.datagrid.changePage.call(this.datagrid,this.data.links.next.href))},prevPage:function(){!this.data.links.previous||(this.startLoader(),this.datagrid.changePage.call(this.datagrid,this.data.links.previous.href))},unbindDomEvents:function(){this.sandbox.dom.unbind(this.sandbox.dom.find("*",this.$paginationContainer)),this.sandbox.dom.unbind(this.$paginationContainer)},preparePagination:function(){var e,i,s,o;this.data.total>this.options.showElementsSteps[0]&&(o=this.data.limit,i=this.sandbox.dom.createElement(this.sandbox.util.template(n.showElements)({desc:o,text:r.elementsPerPage,translate:this.sandbox.translate})),this.sandbox.dom.append(this.$paginationContainer,"<span></span>"),this.sandbox.dom.append(this.$paginationContainer,i),this.prepareShowElementsDropdown()),parseInt(this.data.pages,10)>1&&(e=this.sandbox.dom.createElement("<div/>"),e.addClass(t.paginationElementClass),this.sandbox.dom.append(this.$paginationContainer,e),s=this.renderPaginationRow(this.data.page,this.data.pages),this.sandbox.dom.append(e,this.sandbox.util.template(n.pageChanger,{label:s,prevButtonClass:this.data.page<this.data.pages?"":"disabled",nextButtonClass:this.data.page>1?"":"disabled"})))},renderPaginationRow:function(e,t){var r={translate:this.sandbox.translate,i:e,pages:t};return this.sandbox.util.template(n.pageLabel,r)},prepareShowElementsDropdown:function(){var e,n,r=[];for(e=-1,n=this.options.showElementsSteps.length;++e<n;)r.push({id:this.options.showElementsSteps[e],name:this.options.showElementsSteps[e]});this.sandbox.start([{name:"dropdown@husky",options:{el:this.sandbox.dom.find("."+t.sizeChangeClass,this.$paginationContainer),setParentDropDown:!0,instanceName:this.datagrid.options.instanceName+"-pagination-dropdown-show",alignment:"left",verticalAlignment:this.options.verticalAlignment,data:r}}])}}}),define("husky_components/datagrid/decorators/infinite-scroll-pagination",[],function(){"use strict";var e={scrollContainer:".page",reachedBottomMessage:"you reached the end of the list",scrollOffset:0,limit:50},t={paginationClass:"pagination-wrapper infinite-scroll",paginationElementClass:"pagination",loaderClass:"pagination-loader"},n={paginationContainer:['<div class="'+t.paginationClass+'">','   <div class="'+t.loaderClass+'"/>','   <span class="pagination-message"><%= reachedBottomMessage %></span>',"</div>"].join("")};return{initialize:function(t,n){this.datagrid=t,this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n),this.setVariables()},setVariables:function(){this.$el=null,this.$paginationContainer=null,this.$loader=null,this.data=null},getHeight:function(){return this.sandbox.dom.outerHeight(this.$paginationContainer,!0)},render:function(e,r){this.$el=r,this.data=e,this.$paginationContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.paginationContainer,{reachedBottomMessage:this.sandbox.translate(this.options.reachedBottomMessage)})),this.$loader=$(this.$paginationContainer).find("."+t.loaderClass),this.sandbox.dom.append(this.$el,this.$paginationContainer),this.startLoader(),this.bindInfiniteScroll(),this.fillScrollContainer()},startLoader:function(){this.sandbox.start([{name:"loader@husky",options:{el:this.$loader,size:"40px",color:"#cccccc"}}])},getLimit:function(){return this.options.limit},destroy:function(){this.sandbox.stop(this.sandbox.dom.find("*",this.$paginationContainer)),this.sandbox.dom.unbind(this.sandbox.dom.find("*",this.$paginationContainer)),this.sandbox.infiniteScroll.destroy(this.options.scrollContainer),this.sandbox.dom.remove(this.$paginationContainer)},bindInfiniteScroll:function(){this.sandbox.infiniteScroll.initialize(this.options.scrollContainer,this.appendNextPage.bind(this),this.options.scrollOffset)},fillScrollContainer:function(){var e=$(this.options.scrollContainer);e[0].clientHeight>=e[0].scrollHeight&&!!this.datagrid.data.links&&!!this.datagrid.data.links.next&&this.appendNextPage().then(function(){this.fillScrollContainer()}.bind(this))},appendNextPage:function(){var e=$.Deferred();return!this.datagrid.data.links||!this.datagrid.data.links.next?(!this.$paginationContainer.data("showReachedEnd")||this.$paginationContainer.addClass("reached-end"),e.resolve()):(this.$paginationContainer.addClass("loading"),this.sandbox.util.load(this.datagrid.data.links.next.href).then(function(t){this.updateDatagrid(t),this.$paginationContainer.data("showReachedEnd",!0),this.$paginationContainer.removeClass("loading"),e.resolve()}.bind(this))),e},updateDatagrid:function(e){this.datagrid.data.links=this.datagrid.parseLinks(e._links),this.datagrid.data.total=e.total,this.datagrid.data.page=e.page,this.datagrid.data.pages=e.pages,this.datagrid.data.limit=e.limit,this.addRecordsToDatagrid(e._embedded[this.datagrid.options.resultKey])},addRecordsToDatagrid:function(e){var t=[];e.forEach(function(e){!e.id||(t.push(e),this.datagrid.data.embedded.push(e))}.bind(this)),this.datagrid.gridViews[this.datagrid.viewId].addRecords?this.datagrid.gridViews[this.datagrid.viewId].addRecords(t,!0):t.forEach(function(e){this.datagrid.gridViews[this.datagrid.viewId].addRecord(e,!0)}.bind(this))}}}),function(){"use strict";define("__component__$datagrid@husky",["husky_components/datagrid/decorators/table-view","husky_components/datagrid/decorators/tiles-view","husky_components/datagrid/decorators/dropdown-pagination","husky_components/datagrid/decorators/infinite-scroll-pagination","services/husky/storage"],function(e,t,n,r,i){var s={view:"table",viewOptions:{table:{},thumbnail:{}},pagination:"dropdown",paginationOptions:{dropdown:{},"infinite-scroll":{}},contentFilters:null,sortable:!0,matchings:[],url:null,saveParams:{},data:null,instanceName:"",searchInstanceName:null,storageName:null,searchFields:[],columnOptionsInstanceName:null,defaultMeasureUnit:"px",preselected:[],onlySelectLeaves:!1,childrenPropertyName:!1,resizeListeners:!0,resultKey:"items",selectedCounter:!1,selectedCounterText:"public.elements-selected",selectedCounterShowSelectedText:"public.show-selected",selectedCounterShowAllText:"public.show-all",viewSpacingBottom:110,clickCallback:null,actionCallback:null,idKey:"id",childrenKey:"children"},o={STRING:"string",DATE:"date",DATETIME:"datetime",THUMBNAILS:"thumbnails",TITLE:"title",BYTES:"bytes",RADIO:"radio",CHECKBOX:"checkbox",CHECKBOX_READONLY:"checkbox_readonly",COUNT:"count",TRANSLATION:"translation",NUMBER:"number",CURRENCY:"currency"},u={views:{table:e,tiles:t},paginations:{dropdown:n,"infinite-scroll":r}},a={bytes:function(e){return this.sandbox.util.formatBytes(e)},title:function(e){return e},date:function(e){var t=this.sandbox.date.format(e);return t!==null?t:e},datetime:function(e){var t=this.sandbox.date.format(e,!0);return t!==null?t:e},translation:function(e){return this.sandbox.translate(e)},number:function(e){return this.sandbox.numberFormat(e,"n")},currency:function(e){return this.sandbox.numberFormat(e,"c")},count:function(e,t){return t?e+" "+t:e},thumbnails:function(e,t){var n={url:null,alt:null};return!!e&&!!e[t]&&(typeof e[t]=="object"?(n.url=e[t].url,n.alt=e[t].alt):(n.url=e[t],n.alt="")),n},radio:function(e,t,n){return this.sandbox.util.template(f.radio,{checked:!!e,columnName:n})},checkbox:function(e,t,n){return this.sandbox.util.template(f.checkbox,{checked:!!e,columnName:n,readonly:!1})},checkbox_readonly:function(e,t,n){return this.sandbox.util.template(f.checkbox,{checked:!!e,columnName:n,readonly:!0})}},f={radio:['<div class="custom-radio custom-filter">','   <input name="radio-<%= columnName %>" type="radio" class="form-element" <% if (checked) { print("checked")} %>/>','   <span class="icon"></span>',"</div>"].join(""),checkbox:['<div class="custom-checkbox custom-filter">','   <input name="radio-<%= columnName %>" type="checkbox" class="form-element"','       <% if (readonly) { %>readonly="readonly"<% } %>',"       <% if (checked) { %>checked<% } %>/>",'   <span class="icon"></span>',"</div>"].join(""),selectedCounter:['<span class="selected-elements invisible smaller-font grey-font">','    <span class="number">0</span>',"    &nbsp;<%= text %>",'    <span class="show-selected-container" <% if (!showSelectedLink) { %>style="display: none;"<% } %>>','        &nbsp;(<span class="show-selected"><%= showText %></span>)',"    </span>","</span>"].join("")},l="husky.datagrid.",c=function(){return this.createEventName("initialized")},h=function(){return this.createEventName("view.rendered")},p=function(){return this.createEventName("page.change")},d=function(){return this.createEventName("updated")},v=function(){return this.createEventName("loaded")},m=function(){return this.createEventName("item.deselect")},g=function(){return this.createEventName("number.selections")},y=function(){return this.createEventName("item.select")},b=function(){return this.createEventName("item.click")},w=function(){return this.createEventName("all.deselect")},E=function(){return this.createEventName("all.select")},S=function(){return this.createEventName("selected.update")},x=function(){return this.createEventName("updated")},T=function(){return this.createEventName("data.save.failed")},N=function(){return this.createEventName("loading.failed")},C=function(){return this.createEventName("data.changed")},k=function(){return this.createEventName("data.provide")},L=function(){return this.createEventName("view.change")},A=function(){return this.createEventName("change")},O=function(){return this.createEventName("pagination.change")},M=function(){return this.createEventName("change.page")},_=function(){return this.createEventName("record.add")},D=function(){return this.createEventName("records.add")},P=function(){return this.createEventName("record.remove")},H=function(){return this.createEventName("records.remove")},B=function(){return this.createEventName("records.change")},j=function(){return this.createEventName("records.set")},F=function(){return this.createEventName("records.get")},I=function(){return this.createEventName("page-size.changed")},q=function(){return this.createEventName("update")},R=function(){return this.createEventName("data.search")},U=function(){return this.createEventName("data.sort")},z=function(){return this.createEventName("url.update")},W=function(){return this.createEventName("data.get")},X=function(){return this.createEventName("data.set")},V=function(){return this.createEventName("items.get-selected")},$=function(){return this.createEventName("medium-loader.show")},J=function(){return this.createEventName("medium-loader.hide")},K=function(){return this.createEventName("select.item")},Q=function(){return this.createEventName("deselect.item")},G=function(){return this.createEventName("toggle.item")},Y=function(){return this.createEventName("items.deselect")},Z=function(e,t,n){if(e.indexOf(t+"=")>=0){var r=e.substring(0,e.indexOf(t+"=")),i=e.substring(e.indexOf(t+"="));i=i.substring(i.indexOf("=")+1),i=i.indexOf("&")>=0?i.substring(i.indexOf("&")):"",n?e=r+t+"="+n+i:e.substr(e.indexOf(t+"=")-1,1)==="&"?e=e.substring(0,r.length-1)+i:e=r+i.substring(1,i.length)}else!n||(e.indexOf("?")<0?e+="?"+t+"="+n:e+="&"+t+"="+n);return e};return{createEventName:function(e){return l+(this.options.instanceName?this.options.instanceName+".":"")+e},initialize:function(){this.sandbox.logger.log("initialized datagrid"),this.options=this.sandbox.util.extend(!0,{},s,this.options),this.storage=i.get("datagrid",this.options.storageName||this.sandbox.util.uniqueId("datgrid")),this.matchings=[],this.requestFields=[],this.selectedItems=[],this.decorators=this.sandbox.util.extend(!0,{},u),this.types=o,this.gridViews={},this.viewId=this.options.view,this.paginations={},this.paginationId=this.options.pagination,this.$loader=null,this.$mediumLoader=null,this.isLoading=!1,this.$element=this.sandbox.dom.$('<div class="husky-datagrid"/>'),this.$el.append(this.$element),this.dataGridWindowResize=null,this.sort={attribute:null,direction:null},this.bindCustomEvents(),this.bindDOMEvents(),this.renderMediumLoader(),this.loadAndInitializeDecorators().then(function(){this.options.selectedCounter===!0&&this.renderSelectedCounter(),this.loadAndEvaluateMatchings().then(function(){this.preSelectItems(),this.loadAndRenderData(),this.sandbox.emit(c.call(this))}.bind(this))}.bind(this))},remove:function(){this.unbindWindowResize(),this.destroy()},loadAndRenderData:function(){var e,t;this.options.url?(this.storage.has("url")?e=this.storage.get("url"):(e=this.options.url,t=e.indexOf("?")===-1?"?":"&",this.requestFields.length>0&&(e+=t+"fields="+this.requestFields.join(","),t="&")),this.sandbox.logger.log("load data from url"),this.loading(),this.load({url:e,success:function(e){this.sandbox.emit(v.call(this),e)}.bind(this)})):!this.options.data||(this.sandbox.logger.log("load data from array"),this.data={},!this.options.resultKey||!this.options.data[this.options.resultKey]?this.data.embedded=this.parseEmbedded(this.options.data):this.data.embedded=this.parseEmbedded(this.options.data[this.options.resultKey]),this.render(),!this.paginations[this.paginationId]||this.paginations[this.paginationId].render(this.data,this.$element))},loadAndEvaluateMatchings:function(){var e=this.sandbox.data.deferred(),t=this.options.matchings;return typeof t===o.STRING?(this.loading(),this.loadMatchings({url:t,success:function(t){this.filterMatchings(t),e.resolve()}.bind(this)})):(this.filterMatchings(t),e.resolve()),e},loadMatchings:function(e){this.sandbox.dom.addClass(this.$find(".selected-elements"),"invisible"),this.sandbox.util.load(e.url).then(function(t){this.updateSelectedCounter(),this.isLoading===!0&&this.stopLoading(),this.destroy(),!!e.success&&typeof e.success=="function"&&e.success(t)}.bind(this)).fail(function(e,t,n){this.sandbox.emit(N.call(this),e,t,n)}.bind(this))},filterMatchings:function(e){var t;this.matchings=[],this.requestFields=[],this.sandbox.util.foreach(e,function(e){t={};if(e.disabled!=="true"&&e.disabled!==!0){for(var n in e)n==="translation"?t.content=this.sandbox.translate(e.translation):n==="name"?t.attribute=e.name:n==="sortable"?(t.sortable=e.sortable,typeof e.sortable===o.STRING&&(t.sortable=JSON.parse(e.sortable))):t[n]=e[n];this.matchings.push(t),this.requestFields.push(e.name)}else e.name===this.options.idKey&&this.requestFields.push(e.name)}.bind(this))},render:function(){this.renderView(),!this.paginations[this.paginationId]||this.paginations[this.paginationId].render(this.data,this.$element),this.options.resizeListeners===!0&&this.windowResizeListener()},renderSelectedCounter:function(){this.sandbox.dom.append(this.$element,this.sandbox.util.template(f.selectedCounter,{text:this.sandbox.translate(this.options.selectedCounterText),showText:this.sandbox.translate(this.options.selectedCounterShowSelectedText),showSelectedLink:!!this.gridViews[this.viewId].showSelected})),this.updateSelectedCounter()},renderView:function(){this.gridViews[this.viewId].render(this.data,this.$element),this.updateSelectedCounter(),this.sandbox.emit(h.call(this))},preSelectItems:function(){var e=this.sandbox.dom.data(this.$el,"selected"),t=[];!e||(this.options.preselected=this.sandbox.util.union(this.options.preselected,e)),this.sandbox.util.foreach(this.options.preselected,function(e){typeof e=="object"?t.push(e.id):t.push(e)}.bind(this)),this.options.preselected=t,this.setSelectedItems(this.options.preselected),this.setSelectedItemsToData()},setSelectedItemsToData:function(){this.sandbox.dom.removeAttr(this.$el,"data-selected"),this.sandbox.dom.data(this.$el,"selected",this.getSelectedItemIds())},destroy:function(){!!this.gridViews[this.viewId]&&!!this.gridViews[this.viewId].rendered&&(this.gridViews[this.viewId].destroy(),!this.paginations[this.paginationId]||this.paginations[this.paginationId].destroy())},rerenderView:function(){this.gridViews[this.viewId].destroy(),this.renderView()},rerenderPagination:function(){!this.paginations[this.paginationId]||(this.paginations[this.paginationId].destroy(),this.paginations[this.paginationId].render(this.data,this.$element))},load:function(e){var t;return this.currentUrl=this.getUrl(e),e.data||(e.data={}),t=this.getSelectedItemIds(),t=this.options.expandIds?t.concat(this.options.expandIds):t,t.length&&(e.data.expandIds=t.join(",")),this.sandbox.dom.addClass(this.$find(".selected-elements"),"invisible"),this.sandbox.util.load(this.currentUrl,e.data).then(function(t){this.sandbox.dom.removeClass(this.$find(".selected-elements"),"invisible"),this.isLoading===!0&&this.stopLoading(),this.destroy(),this.parseData(t),this.getSortingFromUrl(this.currentUrl),this.render(),!!e.success&&typeof e.success=="function"&&e.success(t)}.bind(this)).fail(function(e,t,n){this.sandbox.emit(N.call(this),e,t,n)}.bind(this))},setData:function(e){this.destroy(),!e.resultKey||!e[e.resultKey]?this.data.embedded=e:this.data.embedded=e[e.resultKey],!this.paginations[this.paginationId]||this.paginations[this.paginationId].render(this.data,this.$element),this.render()},getSortingFromUrl:function(e){if(e.indexOf("sortOrder")>-1&&e.indexOf("sortBy")>-1){var t=this.sandbox.util.getParameterByName("sortBy",e),n=this.sandbox.util.getParameterByName("sortOrder",e);!!t&&!!n&&(this.sort.attribute=t,this.sort.direction=n)}},loading:function(){this.sandbox.dom.is(this.$element,":visible")&&(this.sandbox.dom.height(this.$element,this.sandbox.dom.outerHeight(this.$element)),this.sandbox.dom.width(this.$element,this.sandbox.dom.outerWidth(this.$element))),this.sandbox.dom.addClass(this.$element,"loading"),this.$loader||(this.$loader=this.sandbox.dom.createElement('<div class="datagrid-loader"/>'),this.sandbox.dom.hide(this.$loader),this.sandbox.dom.append(this.$element,this.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.$loader,size:"100px",color:"#cccccc"}}])),this.sandbox.dom.show(this.$loader),this.isLoading=!0},stopLoading:function(){return this.isLoading=!1,this.sandbox.dom.hide(this.$loader),this.sandbox.dom.removeClass(this.$element,"loading"),this.sandbox.dom.height(this.$element,""),this.sandbox.dom.width(this.$element,""),this.$element},loadAndInitializeDecorators:function(){var e=this.sandbox.data.deferred();return this.loadAndInitializePagination(this.paginationId).then(function(){this.loadAndInitializeView(this.viewId).then(function(){e.resolve()}.bind(this))}.bind(this)),e},renderMediumLoader:function(){this.$mediumLoader=this.sandbox.dom.createElement('<div class="medium-loader"/>'),this.sandbox.dom.append(this.$element,this.$mediumLoader),this.sandbox.start([{name:"loader@husky",options:{el:this.$mediumLoader,size:"50px",color:"#cccccc"}}])},showMediumLoader:function(){this.sandbox.dom.addClass(this.$mediumLoader,"show")},hideMediumLoader:function(){this.sandbox.dom.removeClass(this.$mediumLoader,"show")},parseData:function(e){this.data={},this.data.links=this.parseLinks(e._links),this.data.embedded=this.parseEmbedded(e._embedded[this.options.resultKey]),this.data.total=e.total,this.data.page=e.page,this.data.pages=e.pages,this.data.limit=e.limit},parseEmbedded:function(e,t){var n=[];for(var r=0,i=e.length;r<i;r++){var s=[];!t||(e[r].parent=t),e[r].id=e[r][this.options.idKey],e[r][this.options.childrenPropertyName]||(e[r][this.options.childrenPropertyName]=!1),e[r].hasOwnProperty(this.options.childrenKey)&&(s=this.parseEmbedded(e[r][this.options.childrenKey],e[r].id),e[r][this.options.childrenPropertyName]=s.length>0),n.push(e[r]),n=n.concat(s)}return n},parseLinks:function(e){var t={};return this.sandbox.util.each(e,function(e,n){t[e]={href:decodeURI(n.href)}}.bind(this)),t},loadAndInitializeView:function(e){this.viewId=e;var t=this.sandbox.data.deferred();return this.gridViews[this.viewId]?t.resolve():this.decorators.views[this.viewId]?(this.gridViews[this.viewId]=this.decorators.views[this.viewId],this.initializeViewDecorator(),t.resolve()):require([e],function(e){typeof e=="function"&&(e=new e),this.gridViews[this.viewId]=e,this.initializeViewDecorator(),t.resolve()}.bind(this)),t},initializeViewDecorator:function(){this.isViewValid(this.gridViews[this.viewId])?this.gridViews[this.viewId].initialize(this,this.options.viewOptions[this.viewId]):this.sandbox.logger.log("Error: View does not meet the configured requirements. See the documentation")},isViewValid:function(e){return!e||typeof e.initialize=="undefined"||typeof e.render=="undefined"||typeof e.destroy=="undefined"?!1:!0},loadAndInitializePagination:function(e){this.paginationId=e;var t=this.sandbox.data.deferred();return!e||!!this.paginations[this.paginationId]?t.resolve():this.decorators.paginations[this.paginationId]?(this.paginations[this.paginationId]=this.decorators.paginations[this.paginationId],this.initializePaginationDecorator(),t.resolve()):require([e],function(e){this.decorators.paginations[this.paginationId]=e,this.initializePaginationDecorator(),t.resolve()}.bind(this)),t},initializePaginationDecorator:function(){this.isPaginationValid(this.paginations[this.paginationId])?this.paginations[this.paginationId].initialize(this,this.options.paginationOptions[this.paginationId]):this.sandbox.logger.log("Error: Pagination does not meet the configured requirements. See the documentation")},changeView:function(e,t){if(e!==this.viewId||!!t)return this.destroy(),this.loadAndInitializeView(e).then(function(){this.extendViewOptions(t),this.render()}.bind(this))},changePagination:function(e){e!==this.paginationId&&(this.destroy(),this.loadAndInitializePagination(e).then(function(){this.render()}.bind(this)))},change:function(e,t,n,r,i){if(i===this.paginationId&&view===this.viewId)return;this.showMediumLoader(),this.changePage(null,e,t).then(function(){this.changeView(n,r).then(function(){this.changePagination(i),this.hideMediumLoader()}.bind(this))}.bind(this))},extendViewOptions:function(e){!!e&&!!this.gridViews[this.viewId].extendOptions&&this.gridViews[this.viewId].extendOptions(e)},isPaginationValid:function(e){return!e||typeof e.initialize=="undefined"||typeof e.render=="undefined"||typeof e.getLimit=="undefined"||typeof e.destroy=="undefined"?!1:!0},getUrl:function(e){if(!this.data||!this.data.links){var t="?",n=e.url;return!!this.options.pagination&&!!this.paginations[this.paginationId].getLimit()&&(e.url.indexOf("?")!==-1&&(t="&"),n=e.url+t+"limit="+this.paginations[this.paginationId].getLimit(),e.page>1&&(n+="&page="+e.page)),n}return e.url},getNumberAndUnit:function(e){e=String(e);var t=e.match(/(\d+)\s*(.*)/);return t[2]||(t[2]=this.options.defaultMeasureUnit),{number:parseInt(t[1],10),unit:t[2]}},manipulateContent:function(e,t,n,r){return typeof t=="function"?t(e,n,r):a.hasOwnProperty(t)?a[t].call(this,e,n,r):e},processContentFilter:function(e,t,n,r,i){if(!!this.options.contentFilters&&this.options.contentFilters.hasOwnProperty(e)){if(typeof this.options.contentFilters[e]=="function")return this.options.contentFilters[e].call(this,t,r,i);if(typeof this.options.contentFilters[e]===o.STRING)return n=this.options.contentFilters[e],this.manipulateContent(t,n,r,e)}else if(!!n)return this.manipulateContent(t,n,r);return t},resetSortingOptions:function(){this.sort.attribute=null,this.sort.direction=null},bindDOMEvents:function(){this.options.resizeListeners===!0&&(this.dataGridWindowResize=this.windowResizeListener.bind(this),this.sandbox.dom.on(this.sandbox.dom.$window,"resize."+this.createEventName("dom"),this.dataGridWindowResize)),this.options.selectedCounter&&this.sandbox.dom.on(this.$el,"click",this.toggleSelectedClickHandler.bind(this),".selected-elements .show-selected")},toggleSelectedClickHandler:function(e){this.sandbox.dom.stopPropagation(e);if(!this.gridViews[this.viewId].showSelected)return;this.show=!this.show,this.gridViews[this.viewId].showSelected(this.show),!this.show||!this.paginations[this.paginationId]?this.rerenderPagination():this.paginations[this.paginationId].destroy(),this.updateSelectedCounter()},unbindWindowResize:function(){this.sandbox.dom.off(this.sandbox.dom.$window,"resize."+this.createEventName("dom"))},bindCustomEvents:function(){this.options.resizeListeners===!0&&this.sandbox.on("husky.navigation.size.changed",this.windowResizeListener.bind(this)),this.sandbox.on(q.call(this),this.updateGrid.bind(this)),this.sandbox.on(X.call(this),this.setData.bind(this)),this.sandbox.on(W.call(this),this.provideData.bind(this)),this.sandbox.on(R.call(this),this.searchGrid.bind(this)),this.sandbox.on(z.call(this),this.updateUrl.bind(this)),this.sandbox.on(L.call(this),this.changeView.bind(this)),this.sandbox.on(A.call(this),this.change.bind(this)),this.sandbox.on(O.call(this),this.changePagination.bind(this)),this.sandbox.on(_.call(this),this.addRecordHandler.bind(this)),this.sandbox.on(D.call(this),this.addRecordsHandler.bind(this)),this.sandbox.on(P.call(this),this.removeRecordHandler.bind(this)),this.sandbox.on(H.call(this),this.removeRecordsHandler.bind(this)),this.sandbox.on(B.call(this),this.changeRecordsHandler.bind(this)),this.sandbox.on(j.call(this),this.setRecordsHandler.bind(this)),this.sandbox.on(F.call(this),this.getRecordsHandler.bind(this)),this.sandbox.on(g.call(this),this.updateSelectedCounter.bind(this)),this.sandbox.on($.call(this),this.showMediumLoader.bind(this)),this.sandbox.on(J.call(this),this.hideMediumLoader.bind(this)),this.sandbox.on(S.call(this),this.updateSelection.bind(this)),this.sandbox.on(K.call(this),this.selectItem.bind(this)),this.sandbox.on(Q.call(this),this.deselectItem.bind(this)),this.sandbox.on(G.call(this),this.toggleItem.bind(this)),this.sandbox.on(Y.call(this),function(){this.gridViews[this.viewId].deselectAllRecords()}.bind(this)),this.sandbox.on(V.call(this),function(e,t){if(!t)e(this.sandbox.util.deepCopy(this.getSelectedItemIds()));else{var n=this.getSelectedItemIds(),r=[];this.sandbox.util.foreach(n,function(e){r.push(this.getRecordById(e))}.bind(this)),e(n,r)}}.bind(this)),this.sandbox.on(M.call(this),function(e,t){isNaN(e)||this.changePage(null,e,t)}.bind(this)),this.startColumnOptionsListener(),this.startSearchListener()},startSearchListener:function(){if(this.options.searchInstanceName!==null){var e="."+this.options.searchInstanceName;this.sandbox.on("husky.search"+e,this.searchGrid.bind(this)),this.sandbox.on("husky.search"+e+".reset",this.searchGrid.bind(this,""))}},startColumnOptionsListener:function(){if(this.options.columnOptionsInstanceName!==null){var e=this.options.columnOptionsInstanceName!==""?"."+this.options.columnOptionsInstanceName:"";this.sandbox.on("husky.column-options"+e+".saved",this.filterGrid.bind(this))}},getUrlWithoutParams:function(){var e=this.data.links.self.href;return e.indexOf("?")!==-1?e.substring(0,e.indexOf("?")):e},getRecordIndexById:function(e){if(!!this.data&&!!this.data.embedded)for(var t=-1,n=this.data.embedded.length;++t<n;)if(this.data.embedded[t].id===e)return t;return null},getRecordById:function(e){for(var t=-1,n=this.data.embedded.length;++t<n;)if(this.data.embedded[t].id===e)return this.data.embedded[t];return null},provideData:function(){this.sandbox.emit(k.call(this),this.data)},windowResizeListener:function(){!!this.gridViews[this.viewId]&&!!this.gridViews[this.viewId].onResize&&this.gridViews[this.viewId].onResize()},addRecordHandler:function(e){if(!this.gridViews[this.viewId].addRecord)return;!e[this.options.idKey]||this.pushRecords([e]),this.gridViews[this.viewId].addRecord(e,!1),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},addRecordsHandler:function(e,t){if(!this.gridViews[this.viewId].addRecord)return;this.sandbox.util.foreach(e,function(e){!e[this.options.idKey]||(this.pushRecords([e]),this.gridViews[this.viewId].addRecord(e,!1))}.bind(this)),typeof t=="function"&&t(),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},removeRecordHandler:function(e){if(!this.gridViews[this.viewId].removeRecord||!e)return;this.gridViews[this.viewId].removeRecord(e),this.removeRecordFromSelected(e),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},removeRecordsHandler:function(e){if(!this.gridViews[this.viewId].removeRecord||!e)return;this.sandbox.util.foreach(e,function(e){this.gridViews[this.viewId].removeRecord(e),this.removeRecordFromSelected(e)}.bind(this)),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},removeRecordFromSelected:function(e){var t=this.selectedItems.indexOf(e);t>-1&&this.selectedItems.splice(t,1)},changeRecordsHandler:function(e){this.sandbox.dom.isArray(e)||(e=[e]),this.sandbox.util.foreach(e,function(e){this.changeRecord(e)}.bind(this)),this.rerenderView(),this.rerenderPagination()},setRecordsHandler:function(e){this.data.embedded=[],this.pushRecords(e),this.rerenderView(),this.rerenderPagination()},getRecordsHandler:function(e){e(this.sandbox.util.deepCopy(this.data.embedded))},itemClicked:function(e){typeof this.options.clickCallback=="function"&&this.options.clickCallback(e,this.data.embedded[this.getRecordIndexById(e)]),this.sandbox.emit(b.call(this),e,this.data.embedded[this.getRecordIndexById(e)])},itemAction:function(e){typeof this.options.actionCallback=="function"&&this.options.actionCallback(e,this.data.embedded[this.getRecordIndexById(e)])},getRemainingViewHeight:function(){var e=this.sandbox.dom.height(this.sandbox.dom.window)-this.sandbox.dom.offset(this.$element).top;return!!this.paginations[this.paginationId]&&!!this.paginations[this.paginationId].getHeight&&(e-=this.paginations[this.paginationId].getHeight()),e-=this.options.viewSpacingBottom,e},updateSelectedCounter:function(){this.options.selectedCounter===!0&&(this.sandbox.dom.html(this.$find(".selected-elements .number"),this.getSelectedItemIds().length),this.getSelectedItemIds().length===0?this.sandbox.dom.addClass(this.$find(".selected-elements"),"invisible"):this.sandbox.dom.removeClass(this.$find(".selected-elements"),"invisible"),!!this.gridViews[this.viewId]&&!!this.gridViews[this.viewId].showSelected&&this.getSelectedItemIds().length===0&&(this.show===!0&&!!this.gridViews[this.viewId].rendered&&this.gridViews[this.viewId].showSelected(!1),this.show=!1),this.show?this.sandbox.dom.text(this.$find(".show-selected"),this.sandbox.translate(this.options.selectedCounterShowAllText)):this.sandbox.dom.text(this.$find(".show-selected"),this.sandbox.translate(this.options.selectedCounterShowSelectedText)),this.gridViews[this.viewId].showSelected?this.sandbox.dom.show(this.$find(".show-selected-container")):this.sandbox.dom.hide(this.$find(".show-selected-container")))},deselectAllItems:function(){this.selectedItems=[],this.sandbox.emit(w.call(this)),this.sandbox.emit(g.call(this),0),this.setSelectedItemsToData()},selectAllItems:function(){var e,t;for(e=-1,t=this.data.embedded.length;++e<t;)this.setItemSelected(this.data.embedded[e].id);this.sandbox.emit(E.call(this),this.selectedItems),this.sandbox.emit(g.call(this),this.selectedItems.length),this.setSelectedItemsToData()},updateSelection:function(e){var t,n;this.gridViews[this.viewId].deselectAllRecords();for(t=-1,n=e.length;++t<n;)this.gridViews[this.viewId].selectRecord(e[t])},selectItem:function(e){this.gridViews[this.viewId].selectRecord(e)},deselectItem:function(e){!this.gridViews[this.viewId].deselectRecord||this.gridViews[this.viewId].deselectRecord(e)},toggleItem:function(e){this.itemIsSelected(e)?this.deselectItem(e):this.selectItem(e)},getSelectedItemIds:function(){return this.selectedItems},setSelectedItems:function(e){var t=0,n,r,i;for(n=-1,r=e.length;++n<r;)this.selectedItems.indexOf(e[n])===-1&&this.selectingAllowed(e[n])?(this.selectedItems.push(e[n]),t++):(i=this.selectedItems.indexOf(e[n]))!==-1&&this.selectedItems.splice(i,1);this.sandbox.emit(g.call(this),t)},itemIsSelected:function(e){return this.selectedItems.indexOf(e)!==-1},setItemSelected:function(e){return this.selectedItems.indexOf(e)===-1?(this.selectedItems.push(e),this.sandbox.emit(y.call(this),e,this.getRecordById(e)),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length),this.setSelectedItemsToData(),!0):!1},setItemUnselected:function(e){var t;return(t=this.selectedItems.indexOf(e))!==-1?(this.selectedItems.splice(t,1),this.sandbox.emit(m.call(this),e),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length),this.setSelectedItemsToData(),!0):!1},selectingAllowed:function(e){var t=this.getRecordIndexById(e);return this.options.onlySelectLeaves===!0&&this.data.embedded[t][this.options.childrenPropertyName]?!1:!0},updateUrl:function(e){var t,n;t=this.currentUrl;for(n in e)t=Z.call(this,t,n,e[n]);this.storage.set("url",t),this.destroy(),this.loading(),this.load({url:t,success:function(e){this.sandbox.emit(d.call(this),e)}.bind(this)})},updateRecord:function(e){for(var t=-1,n=this.data.embedded.length;++t<n;)if(e[this.options.idKey]===this.data.embedded[t].id)return this.data.embedded[t]=e,!0;return!1},changeRecord:function(e){if(!e[this.options.idKey])return this.sandbox.logger.log("Error: Failed changing a record. Must contain id-property"),!1;for(var t=-1,n=this.data.embedded.length;++t<n;)if(e[this.options.idKey]===this.data.embedded[t].id)return this.data.embedded[t]=this.sandbox.util.extend(!0,{},this.data.embedded[t],e),!0},removeRecord:function(e){if(!!e){var t,n;for(t=-1,n=this.data.embedded.length;++t<n;)if(e===this.data.embedded[t].id)return this.removeRecordFromSelected(e),this.data.embedded.splice(t,1),this.rerenderPagination(),!0}return!1},pushRecords:function(e){for(var t=-1,n=e.length;++t<n;)this.data.embedded.push(e[t]);this.rerenderPagination()},unshiftRecords:function(e){for(var t=-1,n=e.length;++t<n;)this.data.embedded.unshift(e[t]),this.rerenderPagination()},changePage:function(e,t,n){if(!!this.data.links.pagination||!!e){var r=this.sandbox.data.deferred();this.show=!1,this.updateSelectedCounter();var i,s;if(!e){if(!t||t>this.data.pages||t<1)return this.sandbox.logger.log("invalid page number or reached start/end!"),r.resolve(),r;n?this.data.limit!==n&&this.sandbox.emit(I.call(this),n,this.paginationId):n=this.data.limit,s=this.sandbox.uritemplate.parse(this.data.links.pagination.href),i=this.sandbox.uritemplate.expand(s,{page:t,limit:n})}else i=e;return this.viewId==="table"&&this.storage.set("url",i),this.sandbox.emit(p.call(this),i),this.load({url:i,success:function(){r.resolve(),this.sandbox.emit(d.call(this),"changed page")}.bind(this)}),r}},updateGrid:function(){!this.data.links.self||(this.resetSortingOptions(),this.load({url:this.data.links.self.href,success:function(){this.sandbox.emit(d.call(this))}.bind(this)}))},filterGrid:function(e){if(!!this.data.links.filter){var t,n;this.filterMatchings(e),t=this.sandbox.uritemplate.parse(this.data.links.filter.href),n=this.sandbox.uritemplate.expand(t,{fieldsList:this.requestFields.join(",")}),this.destroy(),this.loading(),this.load({url:n,success:function(){this.sandbox.emit(d.call(this))}.bind(this)})}},sortGrid:function(e,t){if(this.options.sortable===!0&&!!this.data.links.sortable){var n,r;!e||(this.sort.attribute=e,this.sort.direction=t,n=this.sandbox.uritemplate.parse(this.data.links.sortable.href),r=this.sandbox.uritemplate.expand(n,{sortBy:e,sortOrder:t}),this.sandbox.emit(U.call(this),{attribute:e,direction:t}),this.load({url:r,success:function(e){this.sandbox.emit(d.call(this),e)}.bind(this)}))}},loadChildren:function(e){var t=this.sandbox.data.deferred();if(!this.data.links.children)t.resolve();else{var n=this.sandbox.uritemplate.parse(this.data.links.children.href),r=this.sandbox.uritemplate.expand(n,{parentId:e});this.sandbox.util.load(this.getUrl({url:r})).then(function(e){this.addRecordsHandler(e._embedded[this.options.resultKey]),t.resolve()}.bind(this)).fail(function(e,n){this.sandbox.logger.error(e,n),t.fail()}.bind(this))}return t},searchGrid:function(e,t){if(!!this.data.links.find){var n,r;n=this.sandbox.uritemplate.parse(this.data.links.find.href),t?r=this.sandbox.uritemplate.expand(n,{searchString:e,searchFields:t}):r=this.sandbox.uritemplate.expand(n,{searchString:e,searchFields:this.options.searchFields.join(",")}),e!==""?this.storage.set("url",r):this.storage.remove("url"),this.destroy(),this.loading(),this.load({url:r,success:function(){this.sandbox.emit(d.call(this))}.bind(this)})}},saveGrid:function(e,t,n,r,i){var s="POST",o=!0;!e.id||(s="PUT",o=!1,t=t+"/"+e.id);for(var u in this.options.saveParams)t=Z.call(this,t,u,this.options.saveParams[u]);this.sandbox.emit(C.call(this)),this.sandbox.util.save(t,s,e).then(function(e,t){this.sandbox.emit(x.call(this),e,t),typeof n=="function"&&n(e,t),o===!1?this.updateRecord(e):i===!0?this.unshiftRecords([e]):this.pushRecords([e])}.bind(this)).fail(function(t,n,i){this.sandbox.emit(T.call(this),t,n,i,e),typeof r=="function"&&r(t,n,i)}.bind(this))}}})}(),define("__component__$dropdown@husky",["underscore"],function(e){"use strict";var t="Husky.Ui.DropDown",n={url:"",data:[],trigger:"",triggerOutside:!1,shadow:!0,toggleClassOn:null,valueName:"name",infoName:"info",clickedName:"clickedInfo",setParentDropDown:!1,excludeItems:[],instanceName:"undefined",alignment:"left",verticalAlignment:"bottom",translateLabels:!0,clickDelay:1e3};return{initialize:function(){this.name=t,this.options=this.sandbox.util.extend({},n,this.options),this.$element=this.sandbox.dom.createElement("<div/>",{"class":"husky-drop-down"}),this.sandbox.dom.append(this.options.el,this.$element),this.render(),this.sandbox.emit("husky.dropdown."+this.options.instanceName+".initialized")},render:function(){var e=["dropdown-menu"];this.options.shadow===!0&&e.push("dropdown-shadow"),this.$dropDown=this.sandbox.dom.createElement("<div/>",{"class":e.join(" ")}),this.$dropDownList=this.sandbox.dom.createElement("<ul/>"),this.sandbox.dom.append(this.$element,this.$dropDown),this.sandbox.dom.append(this.$dropDown,this.$dropDownList),this.hideDropDown(),this.options.setParentDropDown&&this.sandbox.dom.addClass(this.sandbox.dom.parent(this.$element),"dropdown"),this.options.alignment==="right"&&this.sandbox.dom.addClass(this.$dropDown,"dropdown-align-right"),this.options.verticalAlignment==="top"&&this.sandbox.dom.addClass(this.$dropDown,"dropdown-align-top"),this.bindDOMEvents(),this.bindCustomEvents(),this.prepareData()},bindDOMEvents:function(){this.sandbox.dom.off(this.$element),this.options.trigger!==""?this.options.triggerOutside?($(this.options.trigger).addClass("husky-dropdown-trigger"),this.sandbox.dom.on(this.options.trigger,"click",this.triggerClick.bind(this))):($(this.options.el).addClass("husky-dropdown-trigger"),this.sandbox.dom.on(this.options.el,"click",this.triggerClick.bind(this),this.options.trigger)):($(this.options.el).addClass("husky-dropdown-trigger"),this.sandbox.dom.on(this.options.el,"click",this.triggerClick.bind(this))),this.sandbox.dom.on(this.$dropDownList,"click",function(e){this.sandbox.dom.hasClass(e.currentTarget,"disabled")||this.clickItem(this.sandbox.dom.data(e.currentTarget,"id"))}.bind(this),'li:not(".divider")')},bindCustomEvents:function(){this.sandbox.on(this.getEvent("toggle"),this.triggerClick.bind(this)),this.sandbox.on(this.getEvent("show"),this.showDropDown.bind(this)),this.sandbox.on(this.getEvent("hide"),this.hideDropDown.bind(this)),this.sandbox.on(this.getEvent("item.enable"),this.itemEnable.bind(this)),this.sandbox.on(this.getEvent("item.disable"),this.itemDisable.bind(this)),this.sandbox.on(this.getEvent("item.toggle"),this.itemToggle.bind(this))},getEvent:function(e){return"husky.dropdown."+this.options.instanceName+"."+e},itemToggle:function(e,t){t===!0?this.itemEnable(e):this.itemDisable(e)},itemEnable:function(e){this.sandbox.dom.removeClass(this.$find('li[data-id="'+e+'"]'),"disabled")},itemDisable:function(e){this.sandbox.dom.addClass(this.$find('li[data-id="'+e+'"]'),"disabled")},clickItem:function(t){var n=this.getItemById(t),r=this.$el.find('*[data-id="'+t+'"]'),i;if(!n)return;!n.callback||typeof n.callback!="function"?!this.options.clickCallback||typeof this.options.clickCallback!="function"?this.sandbox.emit(this.getEvent("item.click"),n,this.$el):this.options.clickCallback(n,this.$el):n.callback.call(this);if(!n[this.options.clickedName])return this.hideDropDown();i=r.find(".info, .info-clicked"),r.addClass("highlight-animation"),i.addClass("clicked"),e.delay(function(){return r.removeClass("highlight-animation"),i.removeClass("clicked"),this.hideDropDown()}.bind(this),this.options.clickDelay)},getItemById:function(e){for(var t=0,n=this.options.data.length,r;t<n;++t){r=this.options.data[t];if(typeof r.id!="undefined"&&r.id.toString()===e.toString())return r}},triggerClick:function(e){var t=$(e.target);if(t.hasClass("husky-dropdown-item")||t.parents().hasClass("husky-dropdown-item"))return;this.toggleDropDown()},prepareData:function(){this.options.data.length>0?this.generateDropDown(this.options.data):this.loadData()},loadData:function(){var e=this.getUrl();this.sandbox.logger.log(this.name,"load: "+e),this.sandbox.util.ajax({url:e,success:function(e){this.sandbox.logger.log(this.name,"load","success"),e.total>0&&e.items.length===e.total?this.options.data=e.items:this.options.data=[],this.generateDropDown(this.options.data)}.bind(this),error:function(){this.sandbox.logger.log(this.name,"load","error"),this.options.data=[],this.generateDropDown(this.options.data)}.bind(this)}),setTimeout(function(){this.sandbox.emit(this.getEvent("data.load"))}.bind(this),200)},generateDropDown:function(e){this.clearDropDown(),e.length>0?e.forEach(function(e){if(e.divider!==!0){if(this.isVisible(e)){var t=e[this.options.valueName],n=e[this.options.infoName],r=e[this.options.clickedName],i;this.options.translateLabels&&(t=this.sandbox.translate(t),n=this.sandbox.translate(n),r=this.sandbox.translate(r)),t=this.sandbox.util.cropMiddle(t,35),i=['<li class="husky-dropdown-item" data-id="',e.id,'">','<span class="label">',t,"</span>",n!==undefined?'<span class="info">'+n+"</span>":"",r!==undefined?'<span class="info-clicked">'+r+"</span>":"","</li>"].join(""),this.sandbox.dom.append(this.$dropDownList,i)}}else this.sandbox.dom.append(this.$dropDownList,'<li class="divider"/>')}.bind(this)):this.sandbox.dom.append(this.$dropDownList,"<li>No data received</li>"),this.sandbox.emit(this.getEvent("rendered"))},isVisible:function(e){var t=!0;return this.options.excludeItems.forEach(function(n){e.id===n.id&&(t=!1)}.bind(this)),t},clearDropDown:function(){this.sandbox.dom.remove(this.sandbox.dom.children(this.sandbox.dom.children(this.$dropDown,"ul"),"li"))},toggleDropDown:function(){this.sandbox.logger.log(this.name,"toggle dropdown"),this.sandbox.dom.is(this.$dropDown,":visible")?this.hideDropDown():this.showDropDown()},showDropDown:function(){this.sandbox.logger.log(this.name,"show dropdown"),this.sandbox.dom.removeClass(this.$dropDown,"top"),this.sandbox.dom.one(this.sandbox.dom.window,"click",this.hideDropDown.bind(this)),this.sandbox.dom.show(this.$dropDown),this.sandbox.emit("husky.dropdown."+this.options.instanceName+".showing"),!this.options.toggleClassOn||this.sandbox.dom.addClass(this.options.toggleClassOn,"is-active"),this.sandbox.dom.offset(this.$dropDown).top-this.sandbox.dom.scrollTop(this.sandbox.dom.window)+this.sandbox.dom.outerHeight(this.$dropDown)>this.sandbox.dom.height(this.sandbox.dom.window)&&this.sandbox.dom.addClass(this.$dropDown,"top")},hideDropDown:function(e){if(!!e){var t=$(e.target);if(t.is(".husky-dropdown-trigger:not(.husky-dropdown-item), .highlight-animation")||t.parents().is(".husky-dropdown-trigger:not(.husky-dropdown-item), .highlight-animation")){this.sandbox.dom.one(this.sandbox.dom.window,"click",this.hideDropDown.bind(this));return}}this.sandbox.logger.log(this.name,"hide dropdown"),this.sandbox.dom.off(this.sandbox.dom.window,"click",this.hideDropDown.bind(this)),this.sandbox.dom.hide(this.$dropDown),!this.options.toggleClassOn||this.sandbox.dom.removeClass(this.options.toggleClassOn,"is-active")},getUrl:function(){return this.options.url}}}),define("__component__$matrix@husky",[],function(){"use strict";var e="is-active",t="td:last-child > span:last-child";return{initialize:function(){this.$element=this.sandbox.dom.createElement('<div class="husky-matrix"/>'),this.prepare(),this.sandbox.dom.append(this.$el,this.$element),this.bindDOMEvents(),this.bindCustomEvents()},bindDOMEvents:function(){this.sandbox.dom.on(this.$element,"click",this.toggleIcon.bind(this),'tbody > tr > td.value > span[class^="fa-"]'),this.sandbox.dom.on(this.$element,"click",this.toggleRow.bind(this),t)},bindCustomEvents:function(){this.sandbox.on("husky.matrix.set-all",this.setAllActive.bind(this)),this.sandbox.on("husky.matrix.unset-all",this.unsetAllActive.bind(this))},toggleIcon:function(n){var r=n.currentTarget,i=this.sandbox.dom.parent(r),s=this.sandbox.dom.parent(i),o=this.sandbox.dom.find('span[class^="fa-"]',i),u,a=this.sandbox.dom.find(t,s);this.sandbox.dom.toggleClass(r,e),u=this.sandbox.dom.find('span[class^="fa-"].'+e,i),u.length==0?this.sandbox.dom.html(a,this.options.captions.all):this.sandbox.dom.html(a,this.options.captions.none),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(r,"section"),value:this.sandbox.dom.data(r,"value"),activated:this.sandbox.dom.hasClass(r,e)})},toggleRow:function(n){var r=this.sandbox.dom.parent(this.sandbox.dom.parent(n.currentTarget)),i=this.sandbox.dom.find('span[class^="fa-"]',r),s=this.sandbox.dom.find('span[class^="fa-"].'+e,r),o=this.sandbox.dom.find(t,r),u;s.length==0?(this.sandbox.dom.addClass(i,e),this.sandbox.dom.html(o,this.options.captions.none),u=!0):(this.sandbox.dom.removeClass(i,e),this.sandbox.dom.html(o,this.options.captions.all),u=!1),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(i,"section"),value:this.options.values.horizontal[r.data("row-count")],activated:u})},setAllActive:function(){var n=this.sandbox.dom.find('span[class^="fa-"]',this.$element),r=this.sandbox.dom.find("tbody > tr",this.$element);this.sandbox.dom.addClass(n,e),this.sandbox.dom.each(r,function(e,n){var r=this.sandbox.dom.find(t,n);this.sandbox.dom.html(r,this.options.captions.none),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(this.sandbox.dom.find("td.section",n),"section"),value:this.options.values.horizontal[$(n).data("row-count")],activated:!0})}.bind(this))},unsetAllActive:function(){var n=this.sandbox.dom.find('span[class^="fa-"]',this.$element),r=this.sandbox.dom.find("tbody > tr",this.$element);this.sandbox.dom.removeClass(n,e),this.sandbox.dom.each(r,function(e,n){var r=this.sandbox.dom.find(t,n);this.sandbox.dom.html(r,this.options.captions.all),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(this.sandbox.dom.find("td.section",n),"section"),value:this.options.values.horizontal[$(n).data("row-count")],activated:!1})}.bind(this))},prepare:function(){this.$element.append(this.prepareTable())},prepareTable:function(){var e;return e=this.sandbox.dom.createElement('<table class="table matrix"/>'),this.sandbox.dom.append(e,this.prepareTableHead()),!this.options.captions.vertical||this.sandbox.dom.append(e,this.prepareTableBody()),e},prepareTableHead:function(){var e=this.sandbox.dom.createElement("<thead/>"),t=this.sandbox.dom.createElement("<tr/>"),n=this.sandbox.dom.createElement('<th class="section"/>'),r,i;return!this.options.captions.general||(r=this.sandbox.dom.createElement('<th class="general"/>'),this.sandbox.dom.html(r,this.options.captions.general),this.sandbox.dom.append(t,r)),this.sandbox.dom.html(n,this.options.captions.type),this.sandbox.dom.append(t,n),typeof this.options.captions.horizontal=="string"?(i=this.sandbox.dom.createElement("<th/>"),this.sandbox.dom.html(i,this.options.captions.horizontal),this.sandbox.dom.append(t,i)):this.options.captions.horizontal.forEach(function(e){var n=this.sandbox.dom.createElement("<th/>");this.sandbox.dom.html(n,e),this.sandbox.dom.append(t,n)}.bind(this)),this.sandbox.dom.append(e,t),e},prepareTableBody:function(){var e=this.sandbox.dom.createElement("<tbody/>"),t;for(t=0;t<this.options.captions.vertical.length;t++)this.prepareTableRow(e,t);return e},prepareTableRow:function(e,t){var n=this.sandbox.dom.createElement("<tr/>"),r=this.sandbox.dom.createElement('<td class="section"/>'),i=this.sandbox.dom.createElement('<td class="value"></td>'),s;n.data("row-count",t),!this.options.captions.general||this.sandbox.dom.append(n,this.sandbox.dom.createElement("<td/>")),this.sandbox.dom.html(r,this.options.captions.vertical[t]),this.sandbox.dom.data(r,"section",this.options.values.vertical[t]),this.sandbox.dom.append(n,r),s=this.prepareTableColumn(i,this.options.values.horizontal[t],this.options.values.vertical[t],this.options.data[t]),this.sandbox.dom.append(n,i),i.append(['<span class="all pointer">',s?this.options.captions.none:this.options.captions.all,"</span>"].join("")),this.sandbox.dom.append(n,i),this.sandbox.dom.append(e,n)},prepareTableColumn:function(t,n,r,i){var s=!1,o,u,a;for(a=0;a<n.length;a++)n[a].title?o='title="'+this.sandbox.translate(n[a].title)+'"':o="",u=this.sandbox.dom.createElement("<span "+o+' class="fa-'+n[a].icon+' matrix-icon pointer"/>'),this.sandbox.dom.data(u,"value",n[a].value),this.sandbox.dom.data(u,"section",r),!!i&&!!i[a]&&(this.sandbox.dom.addClass(u,e),s=!0),this.sandbox.dom.append(t,u);return s}}}),define("__component__$search@husky",["services/husky/storage"],function(e){"use strict";var t={skeleton:['<a href="#" class="fa-search fa-flip-horizontal search-icon" />','<a href="#" class="fa-times-circle remove-icon" />','<input id="search-input" type="text" class="form-element input-round search-input" placeholder="<%= placeholderText %>"/>'].join("")},n={instanceName:null,storageName:null,placeholderText:"public.search",appearance:"gray",slide:!1},r={slideClass:"search-slide",slideCollapsedClass:"slide-collapsed",slideExpandedClass:"slide-expanded"},i=function(){return this.getEventName()},s=function(){return this.getEventName("reset")},o=function(){return this.getEventName("clear")},u=function(){return this.getEventName("initialized")};return{initialize:function(){this.sandbox.logger.log("initialize",this),this.options=this.sandbox.util.extend({},n,this.options),this.storage=e.get("search",this.options.storageName||this.sandbox.util.uniqueId("search")),this.render(),this.bindDOMEvents(),this.bindCustomEvents(),this.sandbox.emit(u.call(this))},bindCustomEvents:function(){this.sandbox.on(o.call(this),function(){this.removeSearch(null,!0)}.bind(this))},render:function(){this.sandbox.dom.addClass(this.$el,"search-container"),this.sandbox.dom.addClass(this.$el,this.options.appearance),this.options.slide===!0&&(this.sandbox.dom.addClass(this.$el,r.slideClass),this.collapse()),this.sandbox.dom.html(this.$el,this.sandbox.template.parse(t.skeleton,{placeholderText:this.sandbox.translate(this.options.placeholderText)})),this.storage.has("searchString")&&(this.$el.find("input").val(this.storage.get("searchString")),this.$el.find(".remove-icon").show(),this.searchSubmitted=!0)},bindDOMEvents:function(){this.sandbox.dom.on(this.$el,"click",this.selectInput.bind(this),"input"),this.sandbox.dom.on(this.$el,"keyup onchange",this.checkKeyPressed.bind(this),"#search-input"),this.sandbox.dom.on(this.$find("input"),"focus",function(){this.sandbox.dom.addClass(this.$el,"focus")}.bind(this)),this.sandbox.dom.on(this.$el,"click",this.submitSearch.bind(this),".search-icon"),this.sandbox.dom.on(this.$el,"click",this.removeSearch.bind(this),".remove-icon"),this.sandbox.dom.on(this.$find("input"),"blur",function(){this.sandbox.dom.removeClass(this.$el,"focus")}.bind(this)),this.options.slide===!0&&(this.sandbox.dom.on(this.$find("input"),"focus",this.expand.bind(this)),this.sandbox.dom.on(this.$find("input"),"blur",this.collapse.bind(this))),this.$el.on("keydown keyup",function(e){e.stopPropagation()}.bind(this))},collapse:function(){this.sandbox.dom.removeClass(this.$el,r.slideExpandedClass),this.sandbox.dom.addClass(this.$el,r.slideCollapsedClass)},expand:function(){this.sandbox.dom.removeClass(this.$el,r.slideCollapsedClass),this.sandbox.dom.addClass(this.$el,r.slideExpandedClass)},resetSearch:function(e){e||this.sandbox.emit(s.call(this)),this.searchSubmitted=!1,this.storage.remove("searchString")},checkKeyPressed:function(e){var t;t=this.sandbox.dom.prev(e.currentTarget,".remove-icon"),this.sandbox.dom.val(e.currentTarget).length>0?this.sandbox.dom.show(t):this.sandbox.dom.hide(t),e.keyCode===13?this.submitSearch():e.keyCode===27&&this.removeSearch()},submitSearch:function(e){!e||this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.val(this.sandbox.dom.find("#search-input",this.$el));if(t===""){this.searchSubmitted&&this.resetSearch();return}this.searchSubmitted=!0,this.storage.set("searchString",t),this.sandbox.emit(i.call(this),t)},removeSearch:function(e,t){e?this.sandbox.dom.preventDefault(e):e={target:this.sandbox.dom.find(".remove-icon",this.$el),currentTarget:this.sandbox.dom.find(".remove-icon",this.$el)};var n=this.sandbox.dom.next(e.currentTarget,"input");this.sandbox.dom.hide(e.target),this.sandbox.dom.val(n,""),this.searchSubmitted&&this.resetSearch(t)},selectInput:function(e){this.sandbox.dom.trigger(e.currentTarget,"select")},getEventName:function(e){var t="husky.search";return e?e="."+e:e="",this.options.instanceName&&(t+="."+this.options.instanceName),t+e}}}),define("services/husky/logger",[],function(){"use strict";function e(){}return e.prototype=window.Husky.logger,new e}),define("services/husky/expression",["underscore","services/husky/logger"],function(e,t){"use strict";function n(){}return n.prototype.evaluate=function(n,r){for(var i=0,s=n.length;i<s;i++){var o=e.extend({property:null,operator:null,value:null},n[i]);if(!r.hasOwnProperty(o.property))return t.warn('property "'+o.property+'" does not exists in data'),!1;switch(o.operator){case"eq":if(r[o.property]!==o.value)return!1;break;case"neq":if(r[o.property]===o.value)return!1;break;default:return t.error('operator "'+o.operator+'" is not implemented.'),!1}}return!0},new n}),define("__component__$tabs@husky",["services/husky/expression"],function(e){"use strict";var t={url:null,data:[],instanceName:"",preselect:!0,preselector:"url",forceReload:!1,callback:null,forceSelect:!0,values:{},preSelectEvent:{enabled:!1,triggerSelectItem:!0}},n=function(){return this.createEventName("activate")},r=function(){return this.createEventName("deactivate")},i=function(){return this.createEventName("item.show")},s=function(){return this.createEventName("item.hide")},o=function(){return this.createEventName("item.select")},u=function(){return this.createEventName("item.preselect")},a=function(){return this.createEventName("item.clicked")},f=function(){return this.createEventName("getSelected")},l=function(){return this.createEventName("update")},c=function(){return this.createEventName("update-notification")},h=function(){return this.createEventName("updated")},p=function(){return this.createEventName("initialized")},d=function(e){e.preventDefault(),this.sandbox.emit(u.call(this),e),!this.options.preSelectEvent.triggerSelectItem||v.call(this,e)},v=function(e){e.preventDefault();if(this.active!==!0||this.sandbox.dom.hasClass(e.currentTarget,"is-selected")===!0)return!1;var t=this.items[this.sandbox.dom.data(e.currentTarget,"id")];!t||(this.sandbox.dom.removeClass(this.sandbox.dom.find(".is-selected",this.$el),"is-selected"),this.sandbox.dom.addClass(e.currentTarget,"is-selected"),this.sandbox.dom.addClass(this.$marker,"animate"),m.call(this),t.hasOwnProperty("callback")&&typeof t.callback=="function"?t.callback.call(this,t):!this.options.callback||typeof this.options.callback!="function"?g.call(this,t):this.options.callback.call(this,t))},m=function(){var e=this.$find("li.is-selected");!e.length||(this.sandbox.dom.width(this.$marker,this.sandbox.dom.outerWidth(e)),this.sandbox.dom.css(this.$marker,{left:this.sandbox.dom.position(e).left+"px"}))},g=function(e){e.forceReload=e.forceReload&&typeof e.forceReload!="undefined"?e.forceReload:this.options.forceReload,this.sandbox.emit(o.call(this),e)},y=function(e){this.sandbox.dom.show(this.domItems[e]),this.sandbox.dom.removeClass(this.$marker,"animate"),m.call(this)},b=function(e){this.sandbox.dom.hide(this.domItems[e]),this.sandbox.dom.removeClass(this.$marker,"animate"),m.call(this)},w=function(t){var n=0;this.sandbox.util.foreach(this.data,function(r){var i=this.$find('li[data-id="'+r.id+'"]');!!r.displayConditions&&!e.evaluate(r.displayConditions,t)?this.sandbox.dom.hide(i):(this.sandbox.dom.show(i),++n)}.bind(this)),n>=2?this.$el.show():this.$el.hide(),this.sandbox.emit(h.call(this),n),m.call(this)},E=function(e,t){var n=this.$find('li[data-id="'+e+'"] a');if(!!t)return n.attr("data-badge",t);n.removeAttr("data-badge")},S=function(){this.options.preSelectEvent.enabled?this.sandbox.dom.on(this.$el,"click",d.bind(this),"li"):this.sandbox.dom.on(this.$el,"click",v.bind(this),"li")},x=function(){this.sandbox.on(f.call(this),function(e){var t=this.sandbox.dom.find(".is-selected",this.options.el);e.call(this.items[this.sandbox.dom.data(t,"id")])}.bind(this)),this.sandbox.on(n.call(this),this.activate.bind(this)),this.sandbox.on(r.call(this),this.deactivate.bind(this)),this.sandbox.on(i.call(this),y.bind(this)),this.sandbox.on(s.call(this),b.bind(this)),this.sandbox.on(a.call(this),v.bind(this)),this.sandbox.on(l.call(this),w.bind(this)),this.sandbox.on(c.call(this),E.bind(this))};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},t,this.options),this.active=!0,this.$marker=null,this.items=[],this.domItems={},S.call(this),x.call(this),this.options.url?this.sandbox.util.load(this.options.url).then(function(e){this.render(e,this.options.values)}.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.data?this.render(this.options.data,this.options.values):this.sandbox.logger.log("no data provided for tabs!")},createEventName:function(e){var t=this.options.instanceName?this.options.instanceName+".":"";return"husky.tabs."+t+e},setMinWidth:function(e){this.sandbox.dom.addClass(e,"is-selected"),this.sandbox.dom.css(e,{"min-width":this.sandbox.dom.outerWidth(e)+"px"}),this.sandbox.dom.removeClass(e,"is-selected")},deactivate:function(){this.active=!1,this.sandbox.dom.addClass(this.sandbox.dom.find(".tabs-container",this.$el),"deactivated")},activate:function(){this.active=!0,this.sandbox.dom.removeClass(this.sandbox.dom.find(".tabs-container",this.$el),"deactivated")},generateIds:function(e){return this.sandbox.util.foreach(e,function(e){e.id||(e.id=this.getRandId())}.bind(this)),e},getRandId:function(){return Math.floor(Math.random()*16777215e8).toString(16)},render:function(t,n){this.data=this.generateIds(t);var r=this.sandbox.dom.createElement('<div class="tabs-container"></div>'),i=this.sandbox.dom.createElement("<ul/>"),s=null,o=null;this.$marker=this.sandbox.dom.createElement('<div class="marker"></div>'),this.sandbox.dom.append(r,this.$marker),this.sandbox.dom.append(this.$el,r),this.sandbox.dom.append(r,i),this.items=[],this.domItems={};var u=0;this.sandbox.util.foreach(this.data,function(t,r){this.items[t.id]=t,o=this.sandbox.dom.createElement(['<li data-id="'+t.id+'">','    <a href="#" ',t.notificationBadge?'data-badge="'+t.notificationBadge:"",'">',this.sandbox.translate(t.name),"    </a>","</li>"].join("")),this.sandbox.dom.append(i,o),!!t.disabled&&t.disabled.toString()==="true"||!!t.displayConditions&&!e.evaluate(t.displayConditions,n)?this.sandbox.dom.hide(o):++u,this.setMinWidth(o),!!this.options.preselect&&(this.options.preselector==="url"&&!!this.options.fragment&&this.options.fragment===t.action||this.options.preselector==="position"&&(r+1).toString()===this.options.preselect.toString()||this.options.preselector==="name"&&t.name===this.options.preselect)&&(this.sandbox.dom.addClass(o,"is-selected"),s=t),this.domItems[t.id]=o}.bind(this)),!s&&this.options.forceSelect&&(s=this.options.data[0],this.sandbox.dom.addClass(this.sandbox.dom.find("li",i).eq(0),"is-selected")),m.call(this),this.sandbox.emit(p.call(this),s,u),u<2&&this.$el.hide()}}}),define("__component__$toolbar@husky",[],function(){"use strict";var e={url:null,buttons:[],instanceName:"",dropdownItemsKey:"_embedded",searchOptions:null,hasSearch:!1,groups:[{id:1,align:"left"}],skin:"default",small:!1,showTitleAsTooltip:!1,showTitle:!0,responsive:!1},t={dropdownOptions:{}},n={collapsedWidth:50,dropdownToggleWidth:5,loaderWhiteColor:"white",loaderDarkColor:"#cccccc",markedClass:"marked"},r={dropdownMenu:".toolbar-dropdown-menu"},i={skeleton:['<div class="husky-toolbar">',"</div>"].join("")},s=function(){return ut.call(this,"initialized")},o=function(){return ut.call(this,"dropdown.opened")},u=function(){return ut.call(this,"dropdown.closed")},a=function(){return ut.call(this,"button.changed")},f=function(){return ut.call(this,"item.select")},l=function(){return ut.call(this,"item.enable")},c=function(){return ut.call(this,"item.disable")},h=function(){return ut.call(this,"item.loading")},p=function(){return ut.call(this,"item.change")},d=function(){return ut.call(this,"item.reset")},v=function(){return ut.call(this,"item.hide")},m=function(){return ut.call(this,"item.show")},g=function(){return ut.call(this,"item.mark")},y=function(){return ut.call(this,"item.unmark")},b=function(){return ut.call(this,"button.set")},w=function(){return ut.call(this,"items.set")},E=function(){return ut.call(this,"collapse")},S=function(){return ut.call(this,"expand")},x=function(){this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this),"li .content"),this.sandbox.dom.on(this.$el,"click",H.bind(this),"li"),this.sandbox.dom.on(this.$el,"click",F.bind(this),"li"),this.options.responsive===!0&&$(window).on("resize.husky-toolbar-"+this.options.instanceName,k.bind(this))},T=function(){this.sandbox.on(c.call(this),function(e,t){!this.items[e]||M.call(this,!1,e,t)}.bind(this)),this.sandbox.on(l.call(this),function(e,t){!this.items[e]||M.call(this,!0,e,t)}.bind(this)),this.sandbox.on(h.call(this),function(e){!this.items[e]||P.call(this,e)}.bind(this)),this.sandbox.on(v.call(this),function(e){!this.items[e]||_.call(this,this.items[e].$el)}.bind(this)),this.sandbox.on(m.call(this),function(e){!this.items[e]||D.call(this,this.items[e].$el)}.bind(this)),this.sandbox.on(E.call(this),function(e){Y.call(this),typeof e=="function"&&e()}.bind(this)),this.sandbox.on(S.call(this),function(e){Z.call(this),typeof e=="function"&&e()}.bind(this)),this.sandbox.on(g.call(this),K.bind(this)),this.sandbox.on(y.call(this),Q.bind(this)),this.sandbox.on(p.call(this),N.bind(this)),this.sandbox.on(d.call(this),C.bind(this)),this.sandbox.on(b.call(this),function(e,t){R.call(this,this.items[e].$el,t)}.bind(this)),this.sandbox.on(w.call(this),function(e,t,n){!this.items[e]||(t.length>0?(rt.call(this,this.items[e]),this.sandbox.dom.removeAttr(this.sandbox.dom.find(".dropdown-toggle",this.items[e].$el),"style"),this.items[e].dropdownItems=t,W.call(this,this.items[e].$el,this.items[e]),!n||N.call(this,this.items[e].id,n).then(function(t){if(!this.items[e].dropdownOptions||typeof this.items[e].dropdownOptions.preSelectedCallback!="function")return;this.items[e].dropdownOptions.preSelectedCallback(t)}.bind(this))):(rt.call(this,this.items[e]),this.sandbox.dom.hide(this.sandbox.dom.find(".dropdown-toggle",this.items[e].$el))))}.bind(this))},N=function(e,t,n){if(!this.items[e])return;var r=this.items[e],i=$.Deferred();return r.initialized.then(function(){var e=B.call(this,t,r);e===!0&&(e=0),R.call(this,r.$el,r.dropdownItems[e]),this.sandbox.emit(g.call(this),r.dropdownItems[e].id),(n===!0||!!r.dropdownItems[e].callback&&typeof r.dropdownItems[e].callback=="function")&&r.dropdownItems[e].callback(),i.resolve(r.dropdownItems[e])}.bind(this)),i.promise()},C=function(e){if(!this.items[e])return;this.items[e].initialized.then(function(){q.call(this,this.items[e].$el)}.bind(this))},k=function(){this.$el.width()<this.$el[0].scrollWidth?this.collapsed?L.call(this):(this.expandedWidth=this.$find(".husky-toolbar").outerWidth(),Y.call(this),L.call(this)):this.collapsed&&this.$el.width()>=this.expandedWidth?(Z.call(this),this.expandedWidth=this.$find(".husky-toolbar").outerWidth(),L.call(this)):L.call(this)},L=function(){this.$el.width()<this.$el[0].scrollWidth?this.$el.addClass("overflown"):this.$el.removeClass("overflown")},A=function(){var e=this.$el.scrollLeft();this.$el.css({overflow:"visible"}),this.$find(".husky-toolbar").css({"margin-left":-1*e+"px"})},O=function(){this.$el.removeAttr("style"),this.$find(".husky-toolbar").removeAttr("style")},M=function(e,t,n){if(!this.items[t])return;var r=this.items[t],i=this.sandbox.dom.find('[data-id="'+t+'"]',this.$el);this.items[t].disabled=!e,r.loading&&(r.loading=!1,this.sandbox.stop(this.sandbox.dom.find(".item-loader",i)),this.sandbox.dom.remove(this.sandbox.dom.find(".item-loader",i)),this.sandbox.dom.removeClass(i,"is-loading"),this.sandbox.dom.width(i,"")),n!==!1&&(this.sandbox.dom.addClass(i,"highlight-animation"),this.sandbox.dom.on(i,"animationend webkitAnimationEnd oanimationend MSAnimationEnd",function(e){this.sandbox.dom.removeClass(e.currentTarget,"highlight-animation")}.bind(this))),e?this.sandbox.dom.removeClass(i,"disabled"):this.sandbox.dom.addClass(i,"disabled"),this.options.responsive===!0&&k.call(this)},_=function(e){var t=e.parent(".toolbar-dropdown-menu");this.sandbox.dom.addClass(e,"hidden"),t.length>0&&J.call(this,t)},D=function(e){var t=e.parent(".toolbar-dropdown-menu");this.sandbox.dom.removeClass(e,"hidden"),t.length>0&&J.call(this,t)},P=function(e){var t=this.items[e],r=this.sandbox.dom.find('[data-id="'+e+'"]',this.$el),i,s=n.loaderWhiteColor;if(t.loading)return;t.loading=!0,this.sandbox.dom.width(r,this.sandbox.dom.width(r)),this.sandbox.dom.addClass(r,"is-loading"),i=this.sandbox.dom.createElement('<span class="item-loader"></span>'),this.sandbox.dom.append(r,i),this.sandbox.dom.hasClass(r,"highlight-white")&&(s=n.loaderDarkColor),this.sandbox.start([{name:"loader@husky",options:{el:i,size:this.options.small?"14px":"20px",color:s}}]),this.options.responsive===!0&&k.call(this)},H=function(e){e.preventDefault(),e.stopPropagation();var t=this.sandbox.dom.$(e.currentTarget),n=this.sandbox.dom.data(t,"id"),i=this.items[n],s;if(!!this.sandbox.dom.find(".dropdown-toggle",t).length){if(!i||i.disabled||i.dropdownOptions.onlyOnClickOnArrow===!0&&!this.sandbox.dom.hasClass(e.target,"dropdown-toggle")||!V(t.children(".toolbar-dropdown-menu")))return!1;this.sandbox.dom.hasClass(t,"is-expanded")&&(s=!0),j.call(this),s||(this.sandbox.dom.one("body","click",j.bind(this)),this.options.responsive===!0&&A.call(this),this.sandbox.dom.addClass(t,"is-expanded"),this.sandbox.dom.show(this.sandbox.dom.find(r.dropdownMenu,t)),this.sandbox.emit(o.call(this)))}},B=function(e,t){for(var n=-1,r=t.dropdownItems.length;++n<r;)if(t.dropdownItems[n].id===e)return n;return e},j=function(){this.sandbox.dom.removeClass(this.sandbox.dom.find(".is-expanded",this.$el),"is-expanded"),this.sandbox.dom.hide(this.$find(r.dropdownMenu)),this.options.responsive===!0&&O.call(this),this.sandbox.emit(u.call(this))},F=function(e){this.sandbox.dom.stopPropagation(e),this.sandbox.dom.preventDefault(e);var t=this.items[this.sandbox.dom.data(e.currentTarget,"id")],n=this.items[t.parentId]?this.items[t.parentId].$el:null;if(t.loading||!!t.dropdownItems&&t.dropdownOptions.onlyOnClickOnArrow!==!0&&!!V($(e.currentTarget).children(".toolbar-dropdown-menu"))||this.sandbox.dom.hasClass(e.target,"dropdown-toggle"))return!1;j.call(this),!!t.parentId&&!!this.items[t.parentId].dropdownOptions&&this.items[t.parentId].dropdownOptions.markSelected===!0&&K.call(this,t.id);if(!!t.disabled)return!1;I.call(this,t,n)},I=function(e,t){var n,r=e._original||e,i=this.sandbox.dom.find(".content",this.items[e.id].$el);!i.length||this.sandbox.dom.click(this.sandbox.dom.children(i)),e.parentId&&(n=this.items[e.parentId],!n.dropdownOptions.changeButton||R.call(this,t,e),!n.dropdownOptions||typeof n.dropdownOptions.callback=="function"&&n.dropdownOptions.callback(r)),e.callback?e.callback():this.sandbox.emit(f.call(this),e)},q=function(e){var t=this.sandbox.dom.find("span",e),n=this.sandbox.dom.data(e).id,i=this.items[n];this.sandbox.dom.removeClass(t.eq(0),""),i.icon=i.defaultIcon,!i.defaultIcon||this.sandbox.dom.addClass(t.eq(0),U.call(this,i)),i.title=this.sandbox.translate(i.defaultTitle),this.sandbox.dom.html(t.eq(1),i.title),this.items[n].title=i.title,!i.dropdownItems||this.sandbox.dom.removeClass(r.dropdownMenu+" li","marked"),this.options.responsive===!0&&k.call(this),this.sandbox.emit(a.call(this))},R=function(e,t){var n=this.sandbox.dom.find("span",e),r=this.sandbox.dom.data(e).id;!t.icon||(this.sandbox.dom.removeClass(n.eq(0),""),this.sandbox.dom.addClass(n.eq(0),U.call(this,t)),this.items[r].icon=t.icon),!t.title||(t.title=this.sandbox.translate(t.title),this.sandbox.dom.html(n.eq(1),t.title),this.items[r].icon=t.title),this.options.responsive===!0&&k.call(this),this.sandbox.emit(a.call(this))},U=function(e){var t,n="",r=z.call(this,e);return e.icon&&(t=[],t.push(r),t.push("icon"),n=t.join(" ")),n},z=function(e){return"fa-"+e.icon},W=function(e,t){var n=this.sandbox.dom.createElement('<ul class="toolbar-dropdown-menu" />');!!t.dropdownOptions&&!!t.dropdownOptions.maxHeight&&n.css("maxHeight",t.dropdownOptions.maxHeight),this.sandbox.dom.append(e,n),this.sandbox.util.foreach(t.dropdownItems,function(e){if(e.divider){if(this.items[t.id].dropdownItems.length<=2)return;this.sandbox.dom.append(n,'<li class="divider"></li>');return}e.parentId=t.id,nt.call(this,e);var r=this.sandbox.dom.createElement('<li data-id="'+e.id+'"></li>');this.sandbox.dom.append(n,r);if(!e.initialize||typeof e.initialize!="function")return X.call(this,n,r,e);var i=e.initialize(e,r,this.sandbox);if(!i.then)return X.call(this,n,r,i);i.then(function(e){X.call(this,n,r,e)}.bind(this))}.bind(this)),J.call(this,n)},X=function(e,t,n){n.title=this.sandbox.translate(n.title),typeof n.link!="undefined"&&!1===n.link?(t.addClass("no-link"),t.html(n.title)):t.append('<a href="#">'+n.title+"</a>"),n.$el=t,this.items[n.id]=n,n.hidden===!0&&this.sandbox.dom.addClass(t,"hidden"),n.disabled===!0&&this.sandbox.dom.addClass(t,"disabled"),n.marked===!0&&K.call(this,n.id),!n.styleClass||t.addClass(n.styleClass)},V=function(e){return e.children("li:not(.hidden)").length},J=function(e){var t=e.siblings(".dropdown-toggle");V(e)?t.css("display",""):t.css("display","none")},K=function(e){!!this.items[e]&&!!this.items[e].parentId&&!this.items[e].disabled&&(this.sandbox.util.each(this.items,function(t,r){r.parentId===this.items[e].parentId&&this.sandbox.dom.removeClass(r.$el,n.markedClass)}.bind(this)),this.sandbox.dom.addClass(this.items[e].$el,n.markedClass))},Q=function(e){!!this.items[e]&&!!this.items[e].parentId&&this.sandbox.dom.removeClass(this.items[e].$el,n.markedClass)},G=function(e,t){var n,r,i,s,o,u,a;this.items[t].dropdownItems=[];for(u=-1,a=e.length;++u<a;)this.items[t].dropdownOptions.idAttribute?n=e[u][this.items[t].dropdownOptions.idAttribute]:!e[u].id||(n=e[u].id),this.items[t].dropdownOptions.titleAttribute?r=e[u][this.items[t].dropdownOptions.titleAttribute]:!e[u].title||(r=e[u].title),!this.items[t].dropdownOptions.languageNamespace||(r+=this.items[t].dropdownOptions.languageNamespace+r),r=this.sandbox.translate(r),!e[u].icon||(i=e[u].icon),!e[u].callback||(s=e[u].callback),e[u].divider?o=e[u].divider:o=!1,this.items[t].dropdownItems[u]={id:n,title:r,icon:i,callback:s,divider:o,_original:e[u]};this.sandbox.emit(w.call(this),t,this.items[t].dropdownItems,this.items[t].dropdownOptions.preSelected)},Y=function(){for(var e in this.items)this.items.hasOwnProperty(e)&&et.call(this,this.items[e],!0);this.collapsed=!0},Z=function(){for(var e in this.items)this.items.hasOwnProperty(e)&&et.call(this,this.items[e],!1);this.collapsed=!1},et=function(e,t){!e.parentId&&!!e.icon&&(t===!0?this.sandbox.dom.hide(this.sandbox.dom.find(".title",e.$el)):this.sandbox.dom.removeAttr(this.sandbox.dom.find(".title",e.$el),"style"))},tt=function(e){for(var t=-1,n=e.length;++t<n;)typeof e[t].position!="number"&&(e[t].position=9e3);return e=e.sort(function(e,t){return e.position-t.position}),e},nt=function(e){if(!e.id||!!this.items[e.id])do e.id=this.sandbox.util.uniqueId();while(!!this.items[e.id]);e.disabled||(e.disabled=!1)},rt=function(e){if(!!e.dropdownItems){this.sandbox.dom.remove(this.sandbox.dom.find(r.dropdownMenu,e.$el)),this.sandbox.dom.hide(this.sandbox.dom.find(".dropdown-toggle",e.$el));for(var t=-1,n=e.dropdownItems.length;++t<n;)delete this.items[e.dropdownItems[t].id];e.dropdownItems=[]}},it=function(e){var t;this.sandbox.dom.removeClass(e),this.sandbox.dom.addClass(e,"toolbar-search"),this.sandbox.dom.append(e,'<div id="'+this.options.instanceName+'-toolbar-search"/>'),t={el:"#"+this.options.instanceName+"-toolbar-search",instanceName:this.options.instanceName,appearance:"white small",slide:!0},t=this.sandbox.util.extend(!0,{},t,this.options.searchOptions),this.sandbox.start([{name:"search@husky",options:t}])},st=function(e){this.options.skin!=="default"&&this.sandbox.dom.addClass(e,this.options.skin)},ot=function(e){var t={id:"search",align:"right"};return this.options.groups.unshift(t),e.push({id:"search",hasSearch:!0,group:"search"}),e},ut=function(e){return"husky.toolbar."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.collapsed=!1,this.itemGroups={},this.items={},this.expandedWidth=0,this.options.url?this.sandbox.util.load(this.options.url).then(this.render.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.buttons?this.render(this.options.buttons):this.sandbox.logger.log("no data provided for tabs!"),x.call(this),T.call(this),this.options.responsive===!0&&k.call(this),this.sandbox.emit(s.call(this))},destroy:function(){$(window).off("resize.husky-toolbar-"+this.options.instanceName)},render:function(e){var n,r,i,s;this.options.hasSearch===!0&&(e=ot.call(this,e)),this.renderSkeleton(),e=tt.call(this,e),this.sandbox.util.foreach(e,function(e){e=this.sandbox.util.extend(!0,{},e,t),e.title=this.sandbox.translate(e.title),nt.call(this,e);var o=this.sandbox.data.deferred();e.defaultTitle=e.title,e.defaultIcon=e.icon,this.items[e.id]=e,this.items[e.id].initialized=o.promise(),n=["toolbar-item"],!e["class"]||n.push(e["class"]),e.hidden&&n.push("hidden"),e.disabled&&n.push("disabled"),!e.group||!this.itemGroups[e.group]?r=this.itemGroups[Object.keys(this.itemGroups)[0]]:r=this.itemGroups[e.group],i=this.sandbox.dom.createElement('<li class="'+n.join(" ")+'" data-id="'+e.id+'"/>');if(e.hasSearch===!0)it.call(this,i);else{!e.icon||this.sandbox.dom.append(i,'<span class="'+U.call(this,e)+'" />');if(!!e.content){var u=this.sandbox.dom.createElement('<span class="content"/>');this.sandbox.dom.append(u,e.content),this.sandbox.dom.append(i,u),this.sandbox.start(u)}s="",!!e.title&&(this.options.showTitle===!0||e.showTitle===!0)&&(s=e.title),this.sandbox.dom.append(i,'<span class="title">'+s+"</span>"),this.sandbox.dom.append(i,this.sandbox.dom.createElement('<span class="dropdown-toggle" />')),this.sandbox.dom.hide(this.sandbox.dom.find(".dropdown-toggle",i)),this.options.showTitleAsTooltip===!0&&this.sandbox.dom.attr(i,{title:s}),e.hidden===!0&&_.call(this,i),!e.dropdownOptions||!e.dropdownOptions.url?(!e.dropdownItems||(this.sandbox.dom.removeAttr(this.sandbox.dom.find(".dropdown-toggle",i),"style"),W.call(this,i,e)),o.resolve()):this.sandbox.util.load(e.dropdownOptions.url).then(function(t){var n=t[this.options.dropdownItemsKey];!e.dropdownOptions.resultKey||(n=n[e.dropdownOptions.resultKey]),!e.dropdownItems||(n=e.dropdownOptions.concatRequestedItemsFirst?e.dropdownItems.concat(n):n.concat(e.dropdownItems)),G.call(this,n,e.id),o.resolve()}.bind(this)).fail(function(e){this.sandbox.logger.log("dorpdown-items could not be loaded",e)}.bind(this))}this.sandbox.dom.append(r,i),this.items[e.id].$el=i}.bind(this))},renderSkeleton:function(){var e,t,n,r;r=this.sandbox.dom.createElement(i.skeleton),this.options.small===!0&&this.sandbox.dom.addClass(r,"small"),st.call(this,r);for(e=-1,t=this.options.groups.length;++e<t;)n=this.sandbox.dom.createElement('<ul class="group"/>'),this.options.groups[e].align?this.sandbox.dom.addClass(n,this.options.groups[e].align):this.sandbox.dom.addClass(n,"left"),this.sandbox.dom.append(r,n),this.itemGroups[this.options.groups[e].id]=n;this.sandbox.dom.append(this.$el,r),this.sandbox.dom.addClass(this.sandbox.dom.last(this.sandbox.dom.find(".group.left",this.$el)),"last"),this.options.responsive===!0&&this.$el.addClass("husky-toolbar-responsive")}}}),define("__component__$auto-complete@husky",[],function(){"use strict";var e={prefetchUrl:"",localData:[],remoteUrl:"",getParameter:"query",valueKey:"name",resultKey:"countries",value:null,instanceName:"undefined",noNewValues:!1,suggestionClass:"suggestion",suggestionIcon:"",autoCompleteIcon:"search",stickToInput:!1,hint:!1,emptyOnBlur:!1,excludes:[],selectCallback:null,fields:[],dropdownSizeClass:"",footerContent:"",limit:5},t={main:['<div class="husky-auto-complete <%= dropdownSizeClass %>">','    <div class="front">','       <a class="fa-<%= autoCompleteIcon %>"></a>',"    </div>",'    <div class="input"></div>','    <div class="back">','       <div class="loader" style="display: none;"></div>',"    </div>","</div>"].join("")},n="husky.auto-complete.",r=function(){return p.call(this,"initialized")},i=function(){return p.call(this,"prefetch-data")},s=function(){return p.call(this,"remote-data-load")},o=function(){return p.call(this,"remote-data")},u=function(){return p.call(this,"request-match")},a=function(){return p.call(this,"select")},f=function(){return p.call(this,"selection-removed")},l=function(){return p.call(this,"set-excludes")},c=function(){return p.call(this,"is-matched")},h=function(){return p.call(this,"footer.clicked")},p=function(e){return n+(this.options.instanceName?this.options.instanceName+".":"")+e};return{getValueID:function(){return this.options.value?this.options.value.id:null},getValueName:function(){return this.options.value?this.sandbox.util.escapeHtml(this.options.value[this.options.valueKey]):""},initialize:function(){this.sandbox.logger.log("initialize",this),this.sandbox.logger.log(arguments),this.options=this.sandbox.util.extend({},e,this.options),this.suggestionTpl=null,this.footerTpl=null,this.data=null,this.matched=!0,this.matches=[],this.excludes=this.parseExcludes(this.options.excludes),this.localData={},this.localData._embedded={},this.localData._embedded[this.options.resultKey]=this.options.localData,this.setTemplates(),this.render(),this.bindDomEvents(),this.setCustomEvents(),this.sandbox.emit(r.call(this),this.$valueField)},setTemplates:function(){var e="";this.options.suggestionIcon!==""&&(e='<span class="fa-'+this.options.suggestionIcon+' icon"></span>'),this.options.fields.length?this.suggestionTpl=this.sandbox.util.template('<div class="'+this.options.suggestionClass+'" data-id="<%= context[\'id \']%>">'+'   <div class="border">'+'       <div class="text">'+"           <% _.each(fields, function(field, idx) { %>"+'           <div class="suggestion-column" style="width: <%= field.width %>;"><%= context[field.id] %></div>'+"           <% }) %>"+"       </div>"+"   </div>"+"</div>"):this.suggestionTpl=this.sandbox.util.template('<div class="'+this.options.suggestionClass+'" data-id="<%= context[\'id \']%>">'+'   <div class="border">'+e+'       <div class="text"><%= context[this.options.valueKey] %></div>'+"   </div>"+"</div>"),!this.options.footerContent||(this.footerTpl=this.sandbox.util.template('<div class="auto-complete-footer">'+this.options.footerContent+"</div>"))},buildSuggestionTemplate:function(e){var t;if(this.suggestionTpl!==null)return t=this.sandbox.dom.createElement(this.suggestionTpl({context:e,fields:this.options.fields})),this.isExcluded(e)&&this.sandbox.dom.addClass(t,"disabled"),this.sandbox.dom.html(this.sandbox.dom.append(this.sandbox.dom.$("<div/>"),t))},renderMain:function(){this.sandbox.dom.html(this.$el,this.sandbox.template.parse(t.main,{autoCompleteIcon:this.options.autoCompleteIcon,dropdownSizeClass:this.options.dropdownSizeClass}))},render:function(){this.renderMain(),this.initValueField(),this.appendValueField(),this.sandbox.start([{name:"loader@husky",options:{el:this.$el.find(".loader"),color:"#ccc",size:"20px"}}]),this.bindTypeahead()},initValueField:function(){this.$valueField=this.sandbox.dom.createElement('<input id="'+this.options.instanceName+'" '+'class="husky-validate" '+'type="text" '+'autofill="false" '+'autocomplete="off"'+'data-id="'+this.getValueID()+'" '+'value="'+this.getValueName()+'"/>')},appendValueField:function(){!this.$valueField.length||this.sandbox.dom.append(this.sandbox.dom.find(".input",this.$el),this.$valueField)},bindTypeahead:function(){var e=this.options.remoteUrl.indexOf("?")===-1?"?":"&",t={name:this.options.instanceName,local:this.handleData(this.localData),limit:this.options.limit,displayKey:this.options.valueKey,templates:{suggestion:function(e){return this.matches.push(e),this.matched=!0,this.buildSuggestionTemplate(e)}.bind(this),footer:function(){return this.footerTpl?this.footerTpl():null}.bind(this)}};!this.options.prefetchUrl||(t.prefetch={url:this.options.prefetchUrl,ttl:1,filter:function(e){return this.sandbox.emit(i.call(this),this.handleData(e)),this.data}.bind(this)}),!this.options.remoteUrl||(t.remote={url:this.options.remoteUrl+e+this.options.getParameter+"=%QUERY",ajax:{beforeSend:function(){this.sandbox.emit(s.call(this)),this.showLoader()}.bind(this)},filter:function(e){return this.sandbox.emit(o.call(this),this.handleData(e)),this.hideLoader(),this.data}.bind(this)}),this.sandbox.autocomplete.init(this.$valueField,t),this.options.stickToInput===!1&&this.sandbox.dom.css(this.sandbox.dom.find(".twitter-typeahead",this.$el),"position","static"),this.options.hint===!1&&this.sandbox.dom.remove(this.sandbox.dom.find(".tt-hint",this.$el))},showLoader:function(){this.$el.find(".loader").show()},hideLoader:function(){this.$el.find(".loader").hide()},isExcluded:function(e){for(var t=-1,n=this.excludes.length;++t<n;){if(e.id!==null&&e.id===this.excludes[t].id)return!0;if(e[this.options.valueKey]!==null&&e[this.options.valueKey]===this.excludes[t][this.options.valueKey])return!0}return!1},setCustomEvents:function(){this.sandbox.on(l.call(this),function(e){this.excludes=this.parseExcludes(e)}.bind(this)),this.sandbox.on(c.call(this),function(e){this.isMatchedExactly()===!0&&this.getClosestMatch()!==null?e(!0):this.checkMatches(this.getValueFieldValue(),e,!0)}.bind(this)),this.sandbox.on("husky.auto-complete."+this.options.instanceName+".select",function(e){this.selectedElement=e}.bind(this))},parseExcludes:function(e){var t=[];return!e.length||this.sandbox.util.foreach(e,function(e){typeof e!="object"?t.push({id:null,name:e}):t.push(e)}.bind(this)),t},bindDomEvents:function(){this.sandbox.dom.on(this.$valueField,"typeahead:selected",function(e,t){this.isExcluded(t)?(this.sandbox.dom.stopPropagation(e),this.clearValueFieldValue()):(this.sandbox.emit(a.call(this),t),this.setValueFieldId(t.id),typeof this.options.selectCallback=="function"&&this.options.selectCallback.call(this,t,e))}.bind(this)),this.sandbox.dom.on(this.$valueField,"keypress",function(e){e.keyCode!==13&&(this.matched=!1,this.matches=[])}.bind(this)),this.sandbox.dom.on(this.sandbox.dom.find(".tt-dropdown-menu",this.$el),"click",function(){return!1}.bind(this),".disabled"),this.sandbox.dom.on(this.$valueField,"blur",function(){this.options.emptyOnBlur===!1?this.handleBlur():this.clearValueFieldValue()}.bind(this)),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.dom.blur(this.$valueField),this.clearValueFieldValue(),this.sandbox.emit(h.call(this))}.bind(this),".auto-complete-footer"),this.sandbox.dom.on(this.$valueField,"focusout",function(){if(this.sandbox.dom.val(this.$valueField)===""){var e=this.sandbox.dom.attr(this.$valueField,"data-id");e!=null&&e!=="null"&&(this.sandbox.dom.removeAttr(this.$valueField,"data-id"),this.sandbox.dom.data(this.$valueField,"id","null"),this.sandbox.emit(f.call(this)))}}.bind(this))},handleBlur:function(){this.selectedElement?this.selectedElement=null:this.options.noNewValues===!0?this.isMatched()===!0&&this.getClosestMatch()!==null?(this.setValueFieldValue(this.getClosestMatch().name),this.setValueFieldId(this.getClosestMatch().id)):this.getValueFieldValue()!==""&&this.checkMatches(this.getValueFieldValue(),function(e){e===!0?(this.setValueFieldValue(this.getClosestMatch().name),this.setValueFieldId(this.getClosestMatch().id)):this.clearValueFieldValue()}.bind(this),!1):this.isMatchedExactly()===!0&&this.getClosestMatch()!==null&&(this.setValueFieldValue(this.getClosestMatch().name),this.setValueFieldId(this.getClosestMatch().id))},checkMatches:function(e,t,n){var r=this.options.remoteUrl.indexOf("?")===-1?"?":"&";this.sandbox.emit(u.call(this)),this.sandbox.util.ajax({url:this.options.remoteUrl+r+this.options.getParameter+"="+e,success:function(e){this.matches=this.handleData(e),n!==!0?this.matches.length>0?t(!0):t(!1):this.isMatchedExactly()===!0?t(!0):t(!1)}.bind(this),error:function(e){this.sandbox.logger.log("Error requesting auto-complete-matches",e),t(!1)}.bind(this)})},getClosestMatch:function(){return!this.matches.length||this.getValueFieldValue()===""?null:this.matches[0]},getValueFieldValue:function(){return this.sandbox.dom.val(this.$valueField)},setValueFieldValue:function(e){this.sandbox.autocomplete.setValue(this.$valueField,e)},clearValueFieldValue:function(){this.sandbox.autocomplete.setValue(this.$valueField,"")},setValueFieldId:function(e){this.sandbox.dom.attr(this.$valueField,{"data-id":e}),this.sandbox.dom.data(this.$valueField,"id",e)},isMatched:function(){return this.matched},isMatchedExactly:function(){return this.getClosestMatch()!==null&&this.getValueFieldValue().toLowerCase()===this.getClosestMatch().name.toLowerCase()?!0:!1},handleData:function(e){return typeof e=="object"?(this.data=[],this.sandbox.util.foreach(e._embedded[this.options.resultKey],function(e){this.isExcluded(e)===!1&&this.data.push(e)}.bind(this)),this.data):!1}}}),define("__component__$auto-complete-list@husky",[],function(){"use strict";var e={instanceName:"undefined",items:[],itemsUrl:"",resultKey:"tags",suggestions:[],suggestionsHeadline:"",suggestionsUrl:"",suggestionsKey:"suggestions",label:"",inputSelector:".husky-auto-complete-container",autocomplete:!0,localData:[],prefetchUrl:"",remoteUrl:"",autocompleteOptions:{},getParameter:"query",maxListItems:0,CapitalizeFirstLetter:!1,listItemClass:"auto-complete-list-selection",suggestionDeactivatedClass:"deactivated",AjaxPush:"",AjaxPushAllItems:!1,AjaxPushParameters:null,togglerSelector:".toggler",arrowDownClass:"fa-caret-down",arrowUpClass:"fa-caret-up",slideDuration:500,elementTagDataName:"tags",autoCompleteIcon:"search",suggestionIcon:"tag",delimiters:[9,188,13],noNewTags:!1,valueKey:"name"},t={main:['<div class="auto-complete-list-container">',"    <label>","        <%= label %>",'        <div class="auto-complete-list">','           <div class="husky-auto-complete-container"></div>','           <div class="toggler"></div>',"        </div>","    </label>","</div>"].join(""),suggestion:['<div class="auto-complete-list-suggestions">',"    <h5><%= headline %></h5>","    <ul></ul>","</div>"].join("")},n="up",r="down",i="husky.auto-complete-list.",s=function(){return g.call(this,"initialized")},o=function(){return g.call(this,"set-tags")},u=function(){return g.call(this,"get-tags")},a=function(){return g.call(this,"item-request")},f=function(){return g.call(this,"sug-request")},l=function(){return g.call(this,"sug-added")},c=function(){return g.call(this,"item-deleted")},h=function(){return g.call(this,"data-loaded")},p=function(){return g.call(this,"item-added")},d=function(){return g.call(this,"items-added")},v=function(){return g.call(this,"sug-closed")},m=function(){return g.call(this,"sug-opened")},g=function(e){return i+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.sandbox.logger.log("initialize",this),this.setVars(),this.options=this.sandbox.util.extend({},e,this.options),this.renderMain(),this.initInputCont(),this.initSuggestions(),this.initItems(),this.options.autocomplete===!0?this.sandbox.on("husky.auto-complete."+this.options.instanceName+".initialized",function(){this.sandbox.emit(s.call(this))}.bind(this)):this.sandbox.emit(s.call(this))},setVars:function(){this.suggestions=[],this.$suggestions=null,this.$input=null,this.tagApi=null,this.toggler=null,this.$inputCont=null},renderMain:function(){this.sandbox.dom.html(this.$el,_.template(t.main)({label:this.options.label}))},initInputCont:function(){return this.$inputCont=this.sandbox.dom.find(this.options.inputSelector,this.$el),this.$inputCont.length?!0:(this.sandbox.logger.log("Initializing input-container failed."),!1)},startPlugins:function(){this.options.autocomplete===!0?(this.bindStartTmEvent(),this.startAutocomplete()):(this.initInput(),this.appendInput(),this.startTagmanager(),this.bindEvents())},initInput:function(){this.$input=this.sandbox.dom.createElement('<input type="text" autocomplete="off"/>')},appendInput:function(){!this.$input.length||this.sandbox.dom.append(this.$inputCont,this.$input)},startAutocomplete:function(){this.sandbox.start([{name:"auto-complete@husky",options:this.sandbox.util.extend({el:this.$inputCont,emptyOnBlur:!0,instanceName:this.options.instanceName,localData:this.options.localData,prefetchUrl:this.options.prefetchUrl,remoteUrl:this.options.remoteUrl,getParameter:this.options.getParameter,suggestionIcon:this.options.suggestionIcon,autoCompleteIcon:this.options.autoCompleteIcon,resultKey:this.options.resultKey,footerContent:this.options.footerContent,valueKey:this.options.valueKey},this.options.autocompleteOptions)}])},startTagmanager:function(){this.tagApi=this.sandbox.autocompleteList.init(this.$input,{tagClass:this.options.listItemClass,prefilled:this.options.items,tagCloseIcon:"",maxTags:this.options.maxListItems,AjaxPush:this.options.AjaxPush,AjaxPushAllTags:this.options.AjaxPushAllItems,AjaxPushParameters:this.options.AjaxPushParameters,CapitalizeFirstLetter:this.options.CapitalizeFirstLetter,delimiters:[]}),this.setElementDataTags()},bindStartTmEvent:function(){this.sandbox.once("husky.auto-complete."+this.options.instanceName+".initialized",function(e){this.$input=e,this.startTagmanager(),this.bindEvents()}.bind(this))},bindEvents:function(){this.sandbox.on(u.call(this),function(e){typeof e=="function"?e(this.getTags()):this.sandbox.logger.log("Error: Callback is not a function")}.bind(this)),this.sandbox.on(o.call(this),function(e){this.pushTags(e)}.bind(this)),this.sandbox.on(p.call(this),function(){this.setElementDataTags(),this.sandbox.emit("husky.auto-complete."+this.options.instanceName+".set-excludes",this.getTags())}.bind(this)),this.sandbox.on(c.call(this),function(){this.sandbox.emit("husky.auto-complete."+this.options.instanceName+".set-excludes",this.getTags())}.bind(this)),this.sandbox.on("husky.auto-complete."+this.options.instanceName+".select",function(e){this.pushTag(e[this.options.valueKey])}.bind(this)),this.sandbox.dom.on(this.$input,"keydown",function(e){e.keyCode===8&&this.sandbox.dom.val(this.$input).trim()===""&&(this.itemDeleteHandler(),this.setElementDataTags()),this.options.delimiters.indexOf(e.keyCode)!==-1&&this.pushTagHandler(e,this.sandbox.dom.val(this.$input).trim())}.bind(this)),this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.hasClass(e.target,"tm-tag-remove")===!0&&(this.itemDeleteHandler(),this.setElementDataTags())}.bind(this)),this.toggler!==null&&this.sandbox.dom.on(this.toggler.$el,"click",function(e){this.sandbox.dom.preventDefault(e),this.changeToggler(),this.toggleSuggestions()}.bind(this))},pushTagHandler:function(e,t){e.keyCode!==9&&this.sandbox.dom.preventDefault(e),this.options.noNewTags!==!0?this.pushTag(t):this.sandbox.emit("husky.auto-complete."+this.options.instanceName+".is-matched",function(e){e===!0&&this.pushTag(t)}.bind(this))},setElementDataTags:function(){var e=this.getTags();this.sandbox.dom.data(this.$el,this.options.elementTagDataName,e)},initItems:function(){this.options.itemsUrl!==""?this.requestItems():this.startPlugins()},requestItems:function(){this.sandbox.util.ajax({url:this.options.itemsUrl,success:function(e){this.options.items=this.options.items.concat(e._embedded[this.options.resultKey]),this.startPlugins(),h.call(this)}.bind(this),error:function(e){this.sandbox.logger.log(e)}.bind(this)}),this.sandbox.emit(a.call(this))},initSuggestions:function(){this.options.suggestionsUrl!==""?this.requestSuggestions():(this.loadSuggestions(),this.renderSuggestions(),this.initToggler())},requestSuggestions:function(){this.sandbox.util.ajax({url:this.options.suggestionsUrl,success:function(e){this.options.suggestions=this.options.suggestions.concat(e[this.options.suggestionsKey]),this.loadSuggestions(),this.renderSuggestions(),this.initToggler()}.bind(this),error:function(e){this.sandbox.logger.log(e)}.bind(this)}),this.sandbox.emit(f.call(this))},loadSuggestions:function(){if(!!this.options.suggestions.length)for(var e=-1,t=this.options.suggestions.length;++e<t;)this.suggestions[e]={name:this.options.suggestions[e],$el:this.sandbox.dom.createElement("<li/>")},this.sandbox.dom.html(this.suggestions[e].$el,this.suggestions[e][this.options.valueKey])},renderSuggestions:function(){if(!!this.options.suggestions.length){var e,n,r=-1,i=this.suggestions.length;e=this.sandbox.dom.parseHTML(_.template(t.suggestion)({headline:this.options.suggestionsHeadline})),n=this.sandbox.dom.children(e,"ul");for(;++r<i;)this.sandbox.dom.append(n,this.suggestions[r].$el),this.bindSuggestionEvents(this.suggestions[r]);this.$suggestions=e,this.sandbox.dom.append(this.$el,this.$suggestions)}},initToggler:function(){!this.options.suggestions.length||(this.toggler={$el:this.sandbox.dom.find(this.options.togglerSelector,this.$el),pos:n},this.sandbox.dom.prependClass(this.toggler.$el,this.options.arrowUpClass))},changeToggler:function(){this.toggler.pos===r?this.togglerUp():this.togglerDown()},toggleSuggestions:function(){this.toggler.pos===r?this.hideSuggestions():this.showSuggestions()},hideSuggestions:function(){this.sandbox.dom.slideUp(this.$suggestions,this.options.slideDuration),this.sandbox.emit(v.call(this))},showSuggestions:function(){this.sandbox.dom.slideDown(this.$suggestions,this.options.slideDuration),this.sandbox.emit(m.call(this))},togglerDown:function(){this.sandbox.dom.removeClass(this.toggler.$el,this.options.arrowUpClass),this.sandbox.dom.prependClass(this.toggler.$el,this.options.arrowDownClass),this.toggler.pos=r},togglerUp:function(){this.sandbox.dom.removeClass(this.toggler.$el,this.options.arrowDownClass),this.sandbox.dom.prependClass(this.toggler.$el,this.options.arrowUpClass),this.toggler.pos=n},bindSuggestionEvents:function(e){this.sandbox.dom.on(e.$el,"click",function(){this.sandbox.dom.hasClass(e,this.options.suggestionDeactivatedClass)||(this.pushTag(e[this.options.valueKey]),this.deactivateSuggestion(e),this.sandbox.emit(l.call(this),e))}.bind(this))},itemDeleteHandler:function(){this.refreshSuggestions(),this.sandbox.emit(c.call(this))},deactivateSuggestion:function(e){this.sandbox.dom.addClass(e.$el,this.options.suggestionDeactivatedClass)},activateSuggestion:function(e){this.sandbox.dom.removeClass(e.$el,this.options.suggestionDeactivatedClass)},refreshSuggestions:function(){for(var e=-1,t=this.suggestions.length;++e<t;)this.sandbox.dom.hasClass(this.suggestions[e].$el,this.options.suggestionDeactivatedClass)===!0&&this.suggestionContainedInTags(this.suggestions[e])===!1&&this.activateSuggestion(this.suggestions[e])},suggestionContainedInTags:function(e){var t=this.getTags(),n,r;for(n=-1,r=t.length;++n<r;)if(t[n]===e[this.options.valueKey])return!0;return!1},pushTag:function(e){if(this.tagApi===null)return!1;this.tagApi.tagsManager("pushTag",e),this.sandbox.emit(p.call(this),e)},pushTags:function(e){for(var t=-1,n=e.length;++t<n;)this.pushTag(e[t]);this.sandbox.emit(d.call(this))},getTags:function(){return this.tagApi!==null?this.tagApi.tagsManager("tags"):[]}}}),define("__component__$dependent-select@husky",[],function(){"use strict";var e={url:null,data:[],instanceName:"",preselect:null,defaultLabels:"Please choose",selectOptions:[],container:null,isNative:!1,deselectField:!1},t={childContainerClass:"dependent-select-container",namespace:"husky.dependent-select."},n=function(){return u.call(this,"initialized")},r=function(){return u.call(this,"item.selected")},i=function(){return u.call(this,"item.deselected")},s=function(){return u.call(this,"all.items.deselected")},o=function(){return u.call(this,"all.items.selected")},u=function(e){return t.namespace+(this.options.instanceName?this.options.instanceName+".":"")+e},a=function(e){var t,n,r;for(t=e,n=this.options.container.length;++t<n;)r=l.call(this,this.options.container[t]),this.sandbox.start([{name:"select@husky",options:{el:r,disabled:!0,singleSelect:!0,instanceName:t,data:[],isNative:this.options.isNative,deselectField:this.options.deselectField,defaultLabel:this.sandbox.dom.isArray(this.options.defaultLabels)?this.options.defaultLabels[e]:this.options.defaultLabels}}])},f=function(e,t){for(var n=-1,r=e.length;++n<r;)if(e[n].id.toString()===t.toString())return e[n];return null},l=function(e){var n=this.$find(e),r=this.sandbox.dom.find("."+t.childContainerClass,n);if(!n)throw"dependent-select: no container with id "+e+" could be found";return!r||this.sandbox.stop(r),r=this.sandbox.dom.createElement('<div class="'+t.childContainerClass+'" />'),this.sandbox.dom.append(n,r),r},c=function(){var e=this.$find(this.options.container[this.options.container.length-1]),t=this.sandbox.dom.children(e)[0],n=this.sandbox.dom.data(t,"selection");!t||typeof n=="undefined"?this.allSelected&&(this.allSelected=!1,this.sandbox.emit(s.call(this))):this.allSelected||(this.allSelected=!0,this.sandbox.emit(o.call(this)))},h=function(e,t,n,s){t=typeof t!="undefined"?t:0;if(!this.options.container||!this.options.container[t])throw"dependent-select: no container at depth "+t+" specified";var o=null,u=null,p,d=l.call(this,this.options.container[t]);o=function(n,i){if(this.options.container.length>t&&!!e[0].items){var s=f.call(this,e,n).items;h.call(this,s,t+1,null,i)}this.sandbox.emit(r.call(this),n,t),c.call(this)}.bind(this),u=function(n){this.options.container.length>t&&!!e[0].items&&n===null&&a.call(this,t),this.sandbox.emit(i.call(this),n,t),c.call(this)}.bind(this),!this.options.selectOptions[t]||(p=this.options.selectOptions[t]),p=this.sandbox.util.extend(!0,{},{el:d,singleSelect:!0,instanceName:t,data:e,selectCallback:function(e){o(e,!1)}.bind(this),preselectCallback:function(e){o(e,!0)}.bind(this),deselectCallback:u,isNative:this.options.isNative,preSelectedElements:n?[n]:[],deselectField:this.options.deselectField,defaultLabel:this.sandbox.dom.isArray(this.options.defaultLabels)?this.options.defaultLabels[t]:this.options.defaultLabels},p),s||(p.preSelectedElements=[]),this.sandbox.start([{name:"select@husky",options:p}])};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.url?this.sandbox.util.load(this.options.url).then(this.render.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.data?this.render(this.options.data):this.sandbox.logger.log("no data provided for dependent select!")},render:function(e){h.call(this,e,0,this.options.preselect,!0),a.call(this,this.options.preselect?this.options.preselect.length:0),this.sandbox.emit(n.call(this))}}}),define("__component__$select@husky",[],function(){"use strict";var e={addItem:"select.add-item",editEntries:"select.edit-entries"},t={data:[],valueName:"name",instanceName:"undefined",defaultLabel:"Please choose",checkedAllLabel:"All Languages",preSelectedElements:[],multipleSelect:!1,deselectField:!1,disabled:!1,selectCallback:null,preselectCallback:null,deselectCallback:null,style:"normal",skin:"",emitValues:!1,fixedLabel:!1,icon:null,noItemsCallback:null,repeatSelect:!1,editable:!1,direction:"auto",resultKey:"",showToolTip:!1,translations:e,isNative:!1,defaultValue:null,dropdownPadding:0},n={selectClass:"husky-select",labelClass:"husky-select-label",listClass:"husky-select-list",dropdownContainerClass:"husky-select-dropdown-container",deselectFieldKey:"deselectindex",deselectFieldDefaultValue:"",disabledClass:"disabled",dropdownTopClass:"top",templateRemoveSelector:".remove-row",templateAddSelector:"#addRow",editableFieldKey:"editableindex",typeRowSelector:".type-row",contentInnerSelector:".content-inner",toggleClass:".toggle-icon",formElementSelector:".form-element",selectContainerSelector:".husky-select-container"},r={row:function(){return['<div class="grid-row type-row" data-id="">','   <div class="grid-col-10 pull-left"><input class="form-element" type="text" value=""/></div>','   <div class="grid-col-2 pull-right"><div class="remove-row btn gray-dark fit only-icon pull-right"><div class="fa-minus-circle"></div></div></div>',"</div>"].join("")},addOverlayRow:function(e,t){return['<div class="grid-row type-row" data-id="',t.id,'">','    <div class="grid-col-10 pull-left"><input class="form-element" type="text" value="',t[e],'"/></div>','    <div class="grid-col-2 pull-right"><div class="remove-row btn gray-dark fit only-icon pull-right"><div class="fa-minus-circle"></div></div></div>',"</div>"].join("")},addOverlaySkeleton:function(){return['<div class="content-inner">',"   <% _.each(data, function(item) { %>","        <%= rowTemplate(valueName, item) %>","   <% }); %>","</div>",'<div class="grid-row">','   <div id="addRow" class="addButton">',"   <span>",this.sandbox.translate(t.translations.addItem),"</span>","   </div>","</div>"].join("")}},i=function(){return b.call(this,"initialize")},s=function(){return b.call(this,"deselected.item")},o=function(){return b.call(this,"selected.item")},u=function(){return b.call(this,"preselected.item")},a=function(){return b.call(this,"enable")},f=function(){return b.call(this,"disable")},l=function(){return b.call(this,"toggle")},c=function(){return b.call(this,"show")},h=function(){return b.call(this,"hide")},p=function(){return b.call(this,"get-checked")},d=function(){return b.call(this,"update")},v=function(){return"data-changed"},m=function(){return b.call(this,"save")},g=function(){return b.call(this,"delete")},y=function(){return b.call(this,"revert")},b=function(e){return"husky.select."+this.options.instanceName+"."+e},w=function(){this.sandbox.dom.show(S.call(this))},E=function(){this.sandbox.dom.hide(S.call(this))},S=function(){return this.$find(n.toggleClass)},x=function(e){var t=["small","big","action"];if(!!this.options.style){var n=this.options.style.split(" ");this.sandbox.util.foreach(n,function(n){t.indexOf(n)>-1&&this.sandbox.dom.addClass(e,n)}.bind(this))}};return{initialize:function(){var e;this.sandbox.logger.log("initialize",this),this.options=this.sandbox.util.extend(!0,{},t,this.options),!!this.options.deselectField&&this.options.deselectField.toString()==="true"&&(this.options.deselectField=n.deselectFieldDefaultValue),this.selection=[],this.selectedElements=[],this.selectedElementsValues=[],this.dropdownVisible=!1,this.mergedData=null;if(!this.options.preSelectedElements||this.options.preSelectedElements.length===0)e=this.sandbox.dom.data(this.$el,"selection"),typeof e=="string"?this.options.preSelectedElements=e.split(","):Array.isArray(e)?this.options.preSelectedElements=e.map(String):typeof e=="number"?this.options.preSelectedElements.push(e.toString()):!this.options.defaultValue||(this.options.preSelectedElements=this.options.defaultValue);this.options.url?this.loadEntries(this.options.url):this.options.data?(this.mergedData=this.options.data.slice(0),this.render(),this.sandbox.emit(i.call(this))):this.sandbox.logger.warn("Neither data nor url defined!")},loadEntries:function(e){this.sandbox.util.load(e).then(function(e){this.options.resultKey?this.options.data=e._embedded[this.options.resultKey]:this.options.data=e._embedded,this.mergedData=this.options.data.slice(0),this.render(),this.sandbox.emit(i.call(this))}.bind(this)).fail(function(e,t,n){this.sandbox.logger.warn(e,t,n)}.bind(this))},render:function(){this.options.preSelectedElements=_.filter(this.options.preSelectedElements,function(e){return _.contains(this.options.data,e)||_.filter(this.options.data,function(t){return t.id==e}.bind(this)).length>0}.bind(this)),this.sandbox.dom.addClass(this.$el,n.selectClass);var e=this.sandbox.dom.$(this.options.el),t=this.sandbox.dom.createElement(this.sandbox.util.template(this.template.basicStructure.call(this,this.options.defaultLabel,this.options.icon),{isNative:this.options.isNative}));this.sandbox.dom.append(e,t),x.call(this,t),this.sandbox.dom.addClass(t,this.options.skin),this.$list=this.$find("."+n.listClass),this.$dropdownContainer=this.$find("."+n.dropdownContainerClass),this.$label=this.$find("."+n.labelClass),this.prepareData(),this.bindDOMEvents(),this.bindCustomEvents(),this.options.disabled===!0&&this.disable(),this.addEditEntry()},enable:function(){this.sandbox.dom.removeClass(this.sandbox.dom.children(this.$el,".husky-select-container"),n.disabledClass),this.bindDOMEvents()},disable:function(){this.sandbox.dom.addClass(this.sandbox.dom.children(this.$el,".husky-select-container"),n.disabledClass),this.hideDropDown(),this.sandbox.dom.off(this.$el)},addEditEntry:function(){this.options.editable===!0&&(this.addDivider(),this.addDropdownElement(n.editableFieldKey,this.sandbox.translate(e.editEntries),!1,null,null,!1))},prepareData:function(){this.options.data.length>0?(this.options.preSelectedElements.length>0&&this.options.preSelectedElements.map(function(e,t,n){if(!!n[t]||n[t]===0)n[t]=e.toString()}),this.generateDropDown(this.options.data)):this.sandbox.logger.log("error: data not set")},addDropdownElement:function(e,t,n,r,i,s){s=s!==!1;var o,u=this.options.isNative?this.template.optionElement:this.template.menuElement,a=e!==null&&typeof e!="undefined"?e.toString():this.sandbox.util.uniqueId();this.options.preSelectedElements.indexOf(a)>=0||this.options.preSelectedElements.indexOf(t)>=0?(this.setToolTip(t),o=this.sandbox.dom.createElement(this.sandbox.util.template(u.call(this,a,t,"checked",i,!0),{checked:!0})),this.selectedElements.push(a),this.selectedElementsValues.push(t),this.options.emitValues===!0?this.triggerPreSelect(t):this.triggerPreSelect(a)):o=this.sandbox.dom.createElement(this.sandbox.util.template(u.call(this,a,t,"",i,s),{checked:!1})),typeof r=="function"&&this.sandbox.dom.data(o,"selectCallback",r),!!n&&n===!0&&(this.sandbox.dom.addClass(o,"disabled"),this.options.isNative&&this.sandbox.dom.attr(o,"disabled","disabled")),this.sandbox.dom.append(this.$list,o)},addDivider:function(){var e=this.sandbox.dom.$('<hr class="divider"/>');this.sandbox.dom.append(this.$list,e)},generateDropDown:function(e){typeof this.options.deselectField=="string"&&this.options.deselectField!=="false"&&this.addDropdownElement(n.deselectFieldKey,this.sandbox.translate(this.options.deselectField)),e.length>0&&(typeof e[0]=="string"?this.sandbox.util.each(e,function(e,t){this.addDropdownElement(e,this.sandbox.translate(t))}.bind(this)):typeof e[0]=="object"&&this.sandbox.util.each(e,function(e,t){t.divider===!0?this.addDivider():this.addDropdownElement(t.id,this.sandbox.translate(t[this.options.valueName]),!!t.disabled,t.callback,this.sandbox.translate(t.updateLabel))}.bind(this)),this.changeLabel(),this.updateSelectionAttribute())},bindDOMEvents:function(){this.sandbox.dom.on(this.$el,"click",this.labelClickHandler.bind(this),".dropdown-label"),this.sandbox.dom.on(this.$el,"click",function(e){return this.sandbox.dom.stopPropagation(e),this.sandbox.dom.hasClass(e.currentTarget,"disabled")===!1?(this.clickItem(e),!0):(this.sandbox.dom.preventDefault(e),!1)}.bind(this),".husky-select-dropdown-container li"),this.sandbox.dom.on(this.$el,v.call(this),this.dataChanged.bind(this)),this.options.isNative&&this.sandbox.dom.on(this.$list,"change",this.onSelectChange.bind(this))},bindCustomEvents:function(){this.sandbox.on(l.call(this),this.toggleDropDown.bind(this)),this.sandbox.on(c.call(this),this.showDropDown.bind(this)),this.sandbox.on(h.call(this),this.hideDropDown.bind(this)),this.sandbox.on(f.call(this),this.disable.bind(this)),this.sandbox.on(a.call(this),this.enable.bind(this)),this.sandbox.on(p.call(this),this.getChecked.bind(this)),this.sandbox.on(d.call(this),this.updateDropdown.bind(this)),this.sandbox.on(y.call(this),this.revert.bind(this))},onSelectChange:function(e){var t=this.sandbox.dom.val(e.currentTarget),r=this.sandbox.dom.find('option[value="'+t+'"]',this.$list),i=this.sandbox.dom.data(r,"selectCallback"),s=this.sandbox.dom.text(r);this.selectedElements=[t],this.selectedElementsValues=[s],t===n.deselectFieldKey&&(this.selectedElements=[],this.selectedElementsValues=[]),this.updateSelectionAttribute(),this.changeLabel(),this.selectedElements.length?this.triggerSelect(t,s):this.triggerDeselect(t)},dataChanged:function(){var e=this.sandbox.dom.data(this.$el,"selection"),t=this.sandbox.dom.data(this.$el,"selectionValues"),n,r;this.selectedElements=[],this.selectedElementsValues=[],typeof e=="string"?this.selectedElements=e.split(","):Array.isArray(e)?this.selectedElements=e.map(String):typeof e=="number"&&this.selectedElements.push(e.toString()),typeof t=="string"?this.selectedElementsValues=t.split(","):!Array.isArray(t)||(this.selectedElementsValues=t),this.sandbox.util.foreach(this.sandbox.dom.children(this.$list),function(e){n=this.sandbox.dom.data(e,"id")||"",r=this.sandbox.dom.find("input[type=checkbox]",e),this.selectedElements.indexOf(n)>-1?(this.sandbox.dom.addClass(r,"is-selected"),this.sandbox.dom.prop(r,"checked",!0)):(this.sandbox.dom.removeClass(r,"is-selected"),this.sandbox.dom.prop(r,"checked",!1))}.bind(this)),this.changeLabel(),this.updateSelectionAttribute()},revert:function(){this.updateDropdown(this.mergedData,this.selectedElements,!1)},updateDropdown:function(e,t,n){n?(e=this.mergeDomAndRequestData(e,this.parseDataFromDom(this.domData,!0)),this.mergedData=e.slice(0)):(this.selectedElements=[],this.selectedElementsValues=[],this.updateSelectionAttribute(),this.dataChanged()),t!==null&&(this.options.preSelectedElements=t.map(String)),this.selectedElements=[],this.selectedElementsValues=[],this.sandbox.dom.empty(this.$list),this.options.data=e,!!e&&e.length>0?(w.call(this),this.generateDropDown(e)):(E.call(this),this.sandbox.logger.warn("error invalid data for update!")),this.addEditEntry()},updateSelectionAttribute:function(){this.sandbox.dom.data(this.$el,"selection",this.selectedElements),this.sandbox.dom.data(this.$el,"selectionValues",this.selectedElementsValues)},uncheckAll:function(e){var t=this.sandbox.dom.children(this.$list),n=-1,r=t.length,i,o,u;for(;++n<r;)i=this.sandbox.dom.data(t[n],"id"),i===undefined&&(i=""),u=this.sandbox.dom.find("input[type=checkbox]",t[n])[0],o=this.selectedElements.indexOf(i.toString()),o>=0&&e!==i&&(this.sandbox.dom.removeClass(u,"is-selected"),this.sandbox.dom.prop(u,"checked",!1),this.selectedElements.splice(o,1),this.selectedElementsValues.splice(o,1),this.sandbox.emit(s.call(this),i))},openEditDialog:function(){this.elementsToRemove=[],this.$elementsToRemove=[];var e=this.sandbox.dom.createElement("<div/>"),t=this.renderOverlayContent();this.sandbox.dom.append("body",e),this.bindOverlayContentEvents(t),this.sandbox.start([{name:"overlay@husky",options:{el:e,openOnStart:!0,removeOnClose:!0,instanceName:"husky-select",title:this.sandbox.translate("public.edit-entries"),cancelCallback:function(){this.onCloseWithCancel()}.bind(this),okCallback:function(e){this.onCloseWithOk(e)}.bind(this),data:t}}])},onCloseWithOk:function(e){this.domData=e,this.removeDeletedItems(),!e||this.saveNewEditedItemsAndClose(e,"PATCH")},saveNewEditedItemsAndClose:function(e){var t=this.parseDataFromDom(e),n,r=this.getChangedData(t);r.length>0&&(n=this.mergeDomAndRequestData(r,this.parseDataFromDom(e,!0)),this.options.data=n.slice(0),this.updateDropdown(n,this.selectedElements),this.sandbox.emit(m.call(this),r))},mergeDomAndRequestData:function(e,t){return this.sandbox.util.foreach(t,function(t){this.sandbox.util.foreach(e,function(e){t.id===e.id&&t.id!==""?t[this.options.valueName]=e[this.options.valueName]:t[this.options.valueName]===e[this.options.valueName]&&(t.id=e.id)}.bind(this))}.bind(this)),t},bindOverlayContentEvents:function(e){this.sandbox.dom.on(e,"click",this.markElementForRemoval.bind(this),n.templateRemoveSelector),this.sandbox.dom.on(e,"click",this.addElement.bind(this),n.templateAddSelector)},updateRemoveList:function(e,t){this.elementsToRemove.indexOf(e)===-1?(e!==null&&this.elementsToRemove.push(e),this.$elementsToRemove.push(t)):(e!==null&&this.elementsToRemove.splice(this.elementsToRemove.indexOf(e),1),this.$elementsToRemove.splice(this.elementsToRemove.indexOf(t),1))},deleteItem:function(e){var t=this.options.data.slice(0);this.sandbox.util.each(t,function(t,n){if(e===n.id){var r=this.options.data.indexOf(n);this.options.data.splice(r,1)}}.bind(this)),this.updateDropdown(this.options.data,this.selectedElements)},removeDeletedItems:function(){!!this.$elementsToRemove&&this.$elementsToRemove.length>0&&this.sandbox.util.each(this.$elementsToRemove,function(e,t){this.sandbox.dom.remove(t)}.bind(this)),!!this.elementsToRemove&&this.elementsToRemove.length>0&&(this.sandbox.util.each(this.elementsToRemove,function(e,t){this.deleteItem(t)}.bind(this)),this.sandbox.emit(g.call(this),this.elementsToRemove),this.elementsToRemove=[],this.$elementsToRemove=[])},parseDataFromDom:function(e,t){var r=this.sandbox.dom.find(n.typeRowSelector,e),i=[],s,o,u,a;return this.sandbox.dom.each(r,function(e,n){u=this.sandbox.dom.hasClass(n,"faded"),t?u||(s=this.sandbox.dom.data(n,"id"),o=this.sandbox.dom.val(this.sandbox.dom.find("input",n)),o!==""&&(a={id:s},a[this.options.valueName]=o,i.push(a))):(s=this.sandbox.dom.data(n,"id"),o=this.sandbox.dom.val(this.sandbox.dom.find("input",n)),o!==""&&(a={id:s},a[this.options.valueName]=o,i.push(a)))}.bind(this)),i},getChangedData:function(e){var t=[];return this.sandbox.util.each(e,function(e,n){n.id===""?t.push(n):this.sandbox.util.each(this.options.data,function(e,r){n.id===r.id&&n[this.options.valueName]!==r[this.options.valueName]&&n[this.options.valueName]!==""&&t.push(n)}.bind(this))}.bind(this)),t},setToolTip:function(e){if(this.options.showToolTip===!0&&this.options.multipleSelect===!1){var t=this.$find(n.selectContainerSelector);this.sandbox.dom.attr(t,"title",e)}},onCloseWithCancel:function(){this.elementsToRemove=[],this.$elementsToRemove=[]},renderOverlayContent:function(){return this.sandbox.dom.createElement(this.sandbox.util.template(r.addOverlaySkeleton.call(this),{data:this.options.data,rowTemplate:r.addOverlayRow,valueName:this.options.valueName}))},addElement:function(){var e=this.sandbox.dom.createElement(r.addOverlayRow.call(this,this.options.valueName,{}));this.sandbox.dom.append(this.sandbox.dom.find(n.contentInnerSelector),e),this.sandbox.dom.focus(this.sandbox.dom.find(n.formElementSelector,e))},markElementForRemoval:function(e){var t=this.sandbox.dom.parent(this.sandbox.dom.parent(e.currentTarget)),n=this.sandbox.dom.data(t,"id");n!==null&&this.updateRemoveList(n,t),this.toggleStateOfRow(t)},toggleStateOfRow:function(e){this.sandbox.dom.toggleClass(e,"faded")},clickItem:function(e){var t,r,i,s,o,u;t=this.sandbox.dom.data(e.currentTarget,"id").toString(),o=this.sandbox.dom.data(e.currentTarget,"selectCallback"),s=this.selectedElements.indexOf(t),u=this.sandbox.dom.attr(e.currentTarget,"data-update-label");if(t===n.editableFieldKey){this.hideDropDown(),this.openEditDialog();return}if(u!=="false"&&this.options.multipleSelect===!1)if(t===n.deselectFieldKey)s=0,this.uncheckAll(t);else if(s===-1)this.uncheckAll(t);else if(this.options.repeatSelect!==!0){this.hideDropDown();return}r=this.sandbox.dom.text(this.sandbox.dom.find(".item-value",e.currentTarget)),i=this.sandbox.dom.find("input[type=checkbox]",e.currentTarget)[0],!!u&&u!=="false"&&(s>=0?(this.sandbox.dom.removeClass(i,"is-selected"),this.sandbox.dom.prop(i,"checked",!1),this.selectedElements.splice(s,1),this.selectedElementsValues.splice(s,1)):(this.sandbox.dom.addClass(i,"is-selected"),this.sandbox.dom.prop(i,"checked",!0),this.selectedElements.push(t.toString()),this.selectedElementsValues.push(r)),this.updateSelectionAttribute(),this.changeLabel()),this.options.multipleSelect===!1&&this.hideDropDown(),this.options.emitValues===!0&&(t=r),typeof o=="function"&&o(),s>=0?this.triggerDeselect(t):this.triggerSelect(t,r),this.sandbox.dom.trigger(this.$el,"change")},triggerSelect:function(e,t){this.setToolTip(t),this.options.selectCallback?this.options.selectCallback.call(this,e,t):this.sandbox.emit(o.call(this),e,t)},triggerPreSelect:function(e){this.options.preselectCallback?this.options.preselectCallback.call(this,e):this.options.selectCallback?this.options.selectCallback.call(this,e):this.sandbox.emit(u.call(this),e)},triggerDeselect:function(e){this.options.deselectCallback?this.options.deselectCallback.call(this,e!==n.deselectFieldKey?e:null):this.sandbox.emit(s.call(this),e)},changeLabel:function(){if(this.options.fixedLabel!==!0)if(this.selectedElements.length===this.options.data.length&&this.options.multipleSelect===!0)this.sandbox.dom.text(this.$label,this.options.checkedAllLabel);else if(this.selectedElements.length===0)this.sandbox.dom.text(this.$label,this.options.defaultLabel);else{var e="";this.sandbox.util.each(this.selectedElementsValues,function(t,n){e+=" "+n+","}),this.sandbox.dom.text(this.$label,e.substring(1,e.length-1))}},labelClickHandler:function(){this.sandbox.dom.is(this.$find("."+n.listClass),":empty")?typeof this.options.noItemsCallback=="function"&&this.options.noItemsCallback():this.toggleDropDown()},toggleDropDown:function(){this.sandbox.logger.log("toggle dropdown "+this.options.instanceName),this.dropdownVisible===!0?this.hideDropDown():this.showDropDown()},showDropDown:function(){if(this.options.isNative)return;this.sandbox.dom.removeClass(this.$dropdownContainer,"hidden"),this.sandbox.dom.on(this.sandbox.dom.window,"click.dropdown."+this.options.instanceName,this.hideDropDown.bind(this)),this.dropdownVisible=!0,this.sandbox.dom.removeClass(this.$dropdownContainer,n.dropdownTopClass);var e=this.sandbox.dom.height(this.$dropdownContainer),t=this.sandbox.dom.offset(this.$dropdownContainer).top,r=this.sandbox.dom.height(this.sandbox.dom.window),i=this.sandbox.dom.scrollTop(this.sandbox.dom.window),s=r-t;this.options.direction==="top"?this.sandbox.dom.addClass(this.$dropdownContainer,n.dropdownTopClass):this.options.direction!=="bottom"&&e+t>r+i&&r/2<t-i&&(this.sandbox.dom.addClass(this.$dropdownContainer,n.dropdownTopClass),s=e+this.$dropdownContainer.offset().top),this.$dropdownContainer.css({maxHeight:s-this.options.dropdownPadding+"px"})},hideDropDown:function(e){if(!!e){if(!!this.sandbox.dom.find(e.target,this.$el).length)return!1;this.sandbox.dom.off(this.sandbox.dom.window,"click.dropdown."+this.options.instanceName)}return this.sandbox.dom.addClass(this.$dropdownContainer,"hidden"),this.dropdownVisible=!1,!0},getChecked:function(e){if(typeof e!="function")throw"error: callback is not a function";e(this.selectedElements)},template:{basicStructure:function(e,t){var r="",i="display:none";!t||(r='<span class="fa-'+t+' icon"></span>'),e&&(e=this.sandbox.util.escapeHtml(e));if(!!this.options.data&&!!this.options.data.length||this.options.editable)i="";return['<div class="husky-select-container">','   <div class="dropdown-label pointer">',"       <% if (isNative) { %>",'           <select class="'+n.listClass+'">',this.options.preSelectedElements.length===0?'           <option selected="true" disabled="true">'+e+"</option>":"","           </select>","       <% } %>",'       <div class="checkbox">',r,'           <span class="'+n.labelClass+'">',e,"</span>","       </div>",'       <span class="fa-caret-down toggle-icon" style="'+i+'"></span>',"   </div>","   <% if (!isNative) { %>",'   <div class="grid-row dropdown-list dropdown-shadow hidden '+n.dropdownContainerClass+'">','       <ul class="'+n.listClass+'"></ul>',"   </div>","   <% } %>","</div>"].join("")},menuElement:function(e,t,n,r,i){var s="",o="true";if(this.options.multipleSelect===!1||!i)s=" hidden";return r!==undefined&&r===!1&&(o="false"),['<li data-id="',e,'" data-update-label="',o,'">',"    <div>",'        <div class="check'+s+'">','           <div class="custom-checkbox no-spacing">','               <input type="checkbox" class="form-element"',n,"/>",'               <span class="icon"></span>',"           </div>","        </div>",'        <div class="item-value">',this.sandbox.util.escapeHtml(t),"</div>","    </div>","</li>"].join("")},optionElement:function(e,t,n,r,i){return['<option <% if (checked) { print("selected "); } %>value="'+e+'">',this.sandbox.util.escapeHtml(t),"</option>"].join("")}}}}),define("__component__$password-fields@husky",[],function(){"use strict";var e={instanceName:"undefined",validation:!1,labels:{inputPassword1:"Password",inputPassword2:"Repeat Password",generateLabel:"Generate password"},values:{inputPassword1:"",inputPassword2:""}};return{initialize:function(){this.sandbox.logger.log("initialize"),this.sandbox.logger.log(arguments),this.options=this.sandbox.util.extend({},e,this.options),this.options.ids={inputPassword1:"husky-password-fields-"+this.options.instanceName+"-password1",inputPassword2:"husky-password-fields-"+this.options.instanceName+"-password2",generateLabel:"husky-password-fields-"+this.options.instanceName+"-generate"},this.render()},render:function(){this.$originalElement=this.sandbox.dom.$(this.options.el),this.$element=this.sandbox.dom.$(this.template()),this.$originalElement.append(this.$element),!this.options.validation||(this.sandbox.form.addField(this.options.validation,this.$el.find("#"+this.options.ids.inputPassword1)),this.sandbox.form.addField(this.options.validation,this.$el.find("#"+this.options.ids.inputPassword2))),this.bindDomEvents(),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("husky.password.fields."+this.options.instanceName+".get.passwords",function(e){if(typeof e=="function"){var t=this.sandbox.dom.val("#"+this.options.ids.inputPassword1),n=this.sandbox.dom.val("#"+this.options.ids.inputPassword2);e(t,n)}}.bind(this))},bindDomEvents:function(){this.$element.on("click","#"+this.options.ids.generateLabel,function(){this.generatePasswords(),this.sandbox.emit("husky.passwords.fields."+this.options.instanceName+".generated.passwords")}.bind(this))},generatePasswords:function(){var e="test";this.sandbox.dom.val("#"+this.options.ids.inputPassword1,e),this.sandbox.dom.val("#"+this.options.ids.inputPassword2,e)},template:function(){return['<div class="husky-password-fields grid">','    <div class="grid-row">','        <div class="grid-col-6 form-group">','                <label for="',this.options.ids.inputPassword1,'">',this.options.labels.inputPassword1,"</label>",'                <div class="align-right hidden" id="',this.options.ids.generateLabel,'">','                    <span class="fa-key m-right-10"></span><span class="pointer">',this.options.labels.generateLabel,"</span>","                </div>",'                <input class="form-element" value="',this.options.values.inputPassword1,'" type="text" id="',this.options.ids.inputPassword1,'"',this.options.validation?'data-validation-equal="'+this.options.instanceName+'"':"","/>","        </div>",'        <div class="grid-col-6 form-group">','                <label for="',this.options.ids.inputPassword2,'">',this.options.labels.inputPassword2,"</label>",'                <input class="form-element" value="',this.options.values.inputPassword2,'" type="text" id="',this.options.ids.inputPassword2,'"',this.options.validation?'data-validation-equal="'+this.options.instanceName+'"':"","/>","        </div>","    </div>","</div>"].join("")}}}),define("__component__$column-navigation@husky",[],function(){"use strict";var e={url:null,fallbackUrl:null,prefilledData:null,selected:null,data:null,instanceName:"",hasSubName:"hasSub",actionIcon:"fa-pencil",unmarkIcon:"fa-minus-circle",actionButtonOnGhostText:"create",showActionButtonOnGhost:!1,addButton:!0,idName:"id",pathName:"path",linkedName:"linked",publishedStateName:"publishedState",publishedName:"published",titleName:"title",typeName:"type",noPageDescription:"public.no-pages",skin:"",resultKey:"nodes",responsive:!0,showOptions:!0,showStatus:!0,actionOnGhost:!1,premarkedIds:[],disableIds:[],disabledChildren:!1,markable:!1,singleMarkable:!1,orderable:!0,showActionIcon:!0,isBrokenCallback:function(e){return!1},orderConfirmTitle:"column-navigation.order-title",orderConfirmMessage:"column-navigation.order-message",tooltipTranslations:{ghost:"column-navigation.ghost",shadow:"column-navigation.shadow",unpublished:"public.unpublished",publishedWithDraft:"public.published-with-draft",internalLink:"public.internal-link",externalLink:"public.external-link"},actionCallback:null},t={responsiveHeightRation:.7,columnWidth:250,minVisibleRatio:.5,markedClass:"marked",displayedcolumns:2,wrapperClass:"column-navigation-wrapper",disabledClass:"disabled",columnClass:"column",optionsClass:"options",componentClass:"husky-column-navigation",nodeLoaderClass:"husky-column-navigation-loader",bigLoaderClass:"column-navigation-loader",columnItemClass:"column-item",iconsLeftClass:"icons-left",iconsRightClass:"icons-right",itemTextClass:"item-text",orderInputClass:"orderer",orderErrorClass:"husky-validate-error",highlightClass:"highlight-animation",orderModeClass:"order-mode"},n={wrapper:['<div class="',t.wrapperClass,'"></div>'].join(""),container:['<div class="column-navigation"></div>'].join(""),column:['<div data-column="<%= columnNumber %>" class="',t.columnClass,'" id="<%= id %>">',"    <ul></ul>","</div>"].join(""),noPage:['<div class="no-page">','    <span class="fa-coffee icon"></span>','    <div class="text"><%= description %></div>',"</div>"].join(""),optionsContainer:['<div class="',t.optionsClass,' grid-row"></div>'].join(""),optionsAdd:['<div class="align-center add pointer">','    <span class="fa-plus-circle"></span>',"</div>"].join(""),optionsSettings:['<div class="align-center settings pointer drop-down-trigger">','    <span class="fa-gear inline-block"></span><span class="dropdown-toggle inline-block"></span>',"</div>"].join(""),optionsOk:['<div class="align-center ok pointer">','    <span class="fa-check"></span>',"</div>"].join(""),item:['<li data-id="<%= id %>" class="'+t.columnItemClass+'">','    <span class="'+t.iconsLeftClass+'"></span>','    <span title="<%= title %>" class="'+t.itemTextClass+'"><%= title %></span>','    <span class="'+t.iconsRightClass+'"></span>',"</li>"].join(""),orderInput:['<span class="'+t.orderInputClass+'">','    <input type="text" class="form-element husky-validate" value="<%= value %>" />',"</span>"].join("")},r="husky.column-navigation.",i=function(){return T.call(this,"initialized")},s=function(){return T.call(this,"loaded")},o=function(){return T.call(this,"selected")},u=function(){return T.call(this,"settings")},a=function(){return T.call(this,"add")},f=function(){return T.call(this,"action")},l=function(){return T.call(this,"ordered")},c=function(){return T.call(this,"order")},h=function(){return T.call(this,"order-start")},p=function(){return T.call(this,"order-end")},d=function(){return T.call(this,"unmark")},v=function(){return T.call(this,"get-marked")},m=function(){return T.call(this,"highlight")},g=function(){return T.call(this,"get-breadcrumb")},y=function(){return T.call(this,"resize")},b=function(){return T.call(this,"set-options")},w=function(e){if(e<=0)return this.columns[e];var t={numberItems:0,hasSelected:!1,selectedItem:null,parent:null,children:[]};return!this.columns[e]||(t.numberItems=Object.keys(this.columns[e]).length,t.hasSelected=!!this.selected[e],t.children=this.columns[e],!this.selected[e]||(t.selectedItem=this.selected[e])),e>0&&(t.parent=w.call(this,e-1)),t},E=function(t){this.options.markable&&this.options.actionIcon===e.actionIcon&&(this.options.singleMarkable?this.options.actionIcon="fa-check":this.options.actionIcon="fa-plus-circle");var n=this.options.actionIcon;return typeof this.options.actionIcon=="function"&&(n=this.options.actionIcon(t)),n},S=function(){return typeof this.options.addButton=="function"?this.options.addButton(w.call(this,this.lastHoveredColumn)):this.options.addButton},x=function(){var e=this.$find("."+t.optionsClass+" > :visible"),n=100/e.length;e.each(function(e,t){$(t).width(n+"%")}),this.$find("."+t.optionsClass+" > :visible").removeClass("first"),this.$find("."+t.optionsClass+" > :visible").removeClass("last"),this.$find("."+t.optionsClass+" > :visible:first").addClass("first"),this.$find("."+t.optionsClass+" > :visible:last").addClass("last")},T=function(e){return r+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.setProperties(),this.render(),this.startBigLoader(),this.initData(),this.bindDOMEvents(),this.bindCustomEvents(),this.sandbox.emit(i.call(this))},initData:function(){this.options.prefilledData?this.handleResponse(this.options.prefilledData,0):this.load(this.options.url,0,function(){!this.options.fallbackUrl||(this.initiallySelected=null,this.load(this.options.fallbackUrl,0))}.bind(this))},setProperties:function(){this.initiallySelected=this.options.selected,this.$selectedElement=null,this.filledColumns=0,this.columnLoadStarted=!1,this.isOrdering=!1,this.inOrderMode=!1,this.optionsLocked=!1,this.dom={$wrapper:null,$container:null,$add:null,$settings:null,$bigLoader:null,$loader:null,$ok:null,$lastClicked:null},this.columns=[],this.selected=[],this.marked={},this.options.premarkedIds&&this.options.premarkedIds.forEach(function(e){this.marked[e]={}}.bind(this))},render:function(){this.renderWrapper(),!this.options.showOptions||this.renderOptions(),!this.options.data||this.initSettingsDropdown(),this.options.responsive===!0&&this.setContainerHeight()},getColumnForItem:function(e){for(var t=-1,n=this.columns.length;++t<n;)if(!!this.columns[t]&&!!this.columns[t][e])return t;return-1},renderOptions:function(){this.$optionsContainer=this.sandbox.dom.createElement(n.optionsContainer),this.dom.$add=this.sandbox.dom.createElement(n.optionsAdd),this.dom.$settings=this.sandbox.dom.createElement(n.optionsSettings),this.dom.$ok=this.sandbox.dom.createElement(n.optionsOk),this.sandbox.dom.hide(this.dom.$ok),this.sandbox.dom.append(this.$optionsContainer,this.dom.$add),this.sandbox.dom.append(this.$optionsContainer,this.dom.$settings),this.sandbox.dom.append(this.$optionsContainer,this.dom.$ok),this.hideOptions(),this.sandbox.dom.append(this.dom.$wrapper,this.$optionsContainer)},renderWrapper:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),!this.options.skin||this.sandbox.dom.addClass(this.$el,this.options.skin),this.dom.$wrapper=this.sandbox.dom.createElement(n.wrapper),this.sandbox.dom.append(this.$el,this.dom.$wrapper),this.dom.$container=this.sandbox.dom.createElement(n.container),this.sandbox.dom.append(this.dom.$wrapper,this.dom.$container)},startBigLoader:function(){this.dom.$bigLoader===null&&(this.dom.$bigLoader=this.sandbox.dom.createElement('<div class="'+t.bigLoaderClass+'"/>'),this.sandbox.dom.hide(this.dom.$bigLoader),this.sandbox.dom.html(this.dom.$container,this.dom.$bigLoader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$bigLoader,size:"100px",color:"#e4e4e4"}}])),this.sandbox.dom.show(this.dom.$bigLoader)},removeBigLoader:function(){this.sandbox.dom.hide(this.dom.$bigLoader)},setContainerHeight:function(){var e=this.sandbox.dom.height(this.sandbox.dom.$window),n=this.sandbox.dom.offset(this.$el).top;this.sandbox.dom.height(this.dom.$container,(e-n)*t.responsiveHeightRation)},initSettingsDropdown:function(){this.sandbox.start([{name:"dropdown@husky",options:{el:this.dom.$settings,setParentDropDown:!0,instanceName:this.options.instanceName+".settings.dropdown",alignment:"left",data:this.options.data}}])},load:function(e,t,n){e?(this.columnLoadStarted=!0,$.ajax({url:e,global:!1,success:function(e){this.handleResponse(e,t)}.bind(this),error:function(e,t){this.columnLoadStarted=!1,this.sandbox.logger.error("An error occured while fetching data from: ",t),typeof n=="function"&&n()}.bind(this)})):this.sandbox.logger.log("husky.column.navigation -  url not set, aborted loading of data")},handleResponse:function(e,t){this.removeBigLoader(),this.columnLoadStarted=!1,this.parseData(e,t),this.scrollIfNeeded(this.filledColumns+1),this.setOverflowClass(),this.showOptionsAtLast(),this.sandbox.emit(s.call(this))},removeColumns:function(e){var t=this.filledColumns,n;for(n=t;n>=e;n--)delete this.columns[n],this.sandbox.dom.remove("#column"+this.options.instanceName+"-"+n),this.filledColumns--},parseData:function(e,t){t===0&&(this.columns[0]=e);var n=t+1;this.renderColumn(n,e),this.removeLoadingIconForSelected()},renderColumn:function(e,t){var r=this.sandbox.dom.createElement(this.sandbox.util.template(n.column)({columnNumber:e,id:"column"+this.options.instanceName+"-"+e}));this.sandbox.dom.append(this.dom.$container,r),this.filledColumns=e,this.renderItems(r,e,t)},renderItems:function(e,t,n){var r=this.sandbox.dom.find("ul",e),i,s;this.sandbox.util.each(n._embedded[this.options.resultKey],function(e,n){n.order=e+1,n[this.options.idName]in this.marked&&(this.marked[this.options.idName]=n);var o=this.renderItem(n);n.$el=o,this.storeDataItem(t,n),this.sandbox.dom.append(r,o),this.setItemsTextWidth(o),!!n[this.options.hasSubName]&&!!n._embedded[this.options.resultKey]&&n._embedded[this.options.resultKey].length>0&&(i=n,this.setElementSelected(o),this.selected[t]=n),!!this.initiallySelected&&(this.initiallySelected===n[this.options.idName]||this.initiallySelected===n[this.options.pathName])&&(this.setElementSelected(o),this.selected[t]=n,s=n,this.initiallySelected=null)}.bind(this)),i?this.parseData(i,t):!!s&&!s[this.options.hasSubName]&&this.insertAddColumn(s,t)},renderItem:function(e){var r=this.sandbox.dom.createElement(this.sandbox.util.template(n.item)({title:this.sandbox.translate(this.sandbox.util.escapeHtml(e[this.options.titleName])),id:e[this.options.idName]})),i=this.options.disableIds.indexOf(e[this.options.idName])!==-1;return e[this.options.idName]in this.marked&&this.sandbox.dom.addClass(r,t.markedClass),i&&this.sandbox.dom.addClass(r,t.disabledClass),this.renderLeftInfo(r,e),this.renderItemText(r,e),this.renderRightInfo(r,e,i),this.options.isBrokenCallback(e)&&r.addClass("broken"),r},renderLeftInfo:function(e,r){var i=this.sandbox.dom.find("."+t.iconsLeftClass,e),s;this.sandbox.dom.append(i,'<span class="fa-check pull-left marked-icon"></span>'),!this.options.showStatus||(!r[this.options.linkedName]||(r[this.options.linkedName]==="internal"?this.sandbox.dom.append(i,'<span class="fa-internal-link col-icon" title="'+this.sandbox.translate(this.options.tooltipTranslations.internalLink)+'"></span>'):r[this.options.linkedName]==="external"&&this.sandbox.dom.append(i,'<span class="fa-external-link col-icon"  title="'+this.sandbox.translate(this.options.tooltipTranslations.externalLink)+'"></span>')),!r[this.options.typeName]||(r[this.options.typeName].name==="ghost"?this.sandbox.dom.append(i,'<span class="ghost col-icon"  title="'+this.sandbox.translate(this.options.tooltipTranslations.ghost)+'">'+r[this.options.typeName].value+"</span>"):r[this.options.typeName].name==="shadow"&&this.sandbox.dom.append(i,'<span class="fa-shadow-node col-icon"  title="'+this.sandbox.translate(this.options.tooltipTranslations.shadow)+'"></span>')),r[this.options.publishedStateName]||(s=this.sandbox.translate(this.options.tooltipTranslations.unpublished),!r[this.options.publishedName]||(s=this.sandbox.translate(this.options.tooltipTranslations.publishedWithDraft),this.sandbox.dom.append(i,'<span class="published-icon col-icon" title="'+s+'"></span>')),this.sandbox.dom.append(i,'<span class="draft-icon col-icon" title="'+s+'"></span>'))),!this.options.orderable||this.sandbox.dom.append(i,this.sandbox.util.template(n.orderInput)({value:r.order}))},renderItemText:function(e,n){var r=this.sandbox.dom.find("."+t.itemTextClass,e);!!n[this.options.typeName]&&n[this.options.typeName].name==="ghost"&&this.sandbox.dom.addClass(r,"inactive")},renderRightInfo:function(e,n,r){var i=this.sandbox.dom.find("."+t.iconsRightClass,e),s=E.call(this,n);n[this.options.idName]in this.marked&&(s=this.options.unmarkIcon),(!n[this.options.typeName]||n[this.options.typeName].name!=="ghost"||this.options.actionOnGhost)&&this.options.showActionIcon===!0&&s&&!r&&this.sandbox.dom.append(i,'<span class="'+s+' action col-icon"></span>'),!!n[this.options.typeName]&&n[this.options.typeName].name==="ghost"&&this.options.showActionButtonOnGhost&&this.options.showActionIcon===!0&&s&&!r&&this.sandbox.dom.append(i,'<span class="action col-icon">'+this.options.actionButtonOnGhostText+"</span>"),!!n[this.options.hasSubName]&&(!r||!this.options.disabledChildren)&&this.sandbox.dom.append(i,'<span class="fa-chevron-right arrow inactive col-icon"></span>')},setItemsTextWidth:function(e){var n,r;r=this.sandbox.dom.find(".item-text",e),n=t.columnWidth-this.sandbox.dom.outerWidth(this.sandbox.dom.find(".icons-left",e)),n-=parseInt(this.sandbox.dom.css(e,"padding-right").replace("px","")),n-=parseInt(this.sandbox.dom.css(e,"padding-left").replace("px","")),n-=this.sandbox.dom.outerWidth(this.sandbox.dom.find(".icons-right",e)),n-=17,this.sandbox.dom.width(r,n),this.cropItemsText(r)},setColumnTextWidth:function(e){this.sandbox.util.each(this.columns[e],function(e,t){this.setItemsTextWidth(t.$el)}.bind(this))},cropItemsText:function(e){var t=this.sandbox.dom.attr(e,"title"),n,r=t.length,i;this.sandbox.dom.text(e,t),this.sandbox.dom.css(e,"font-weight","bold"),i=this.sandbox.dom.get(e,0).scrollWidth>this.sandbox.dom.width(e);while(i===!0)r--,n=this.sandbox.util.cropMiddle(t,r),this.sandbox.dom.text(e,n),i=this.sandbox.dom.get(e,0).scrollWidth>this.sandbox.dom.width(e);this.sandbox.dom.css(e,"font-weight","")},setElementSelected:function(e){this.sandbox.dom.addClass(e,"selected");var t=this.sandbox.dom.find(".arrow",e);this.sandbox.dom.removeClass(t,"inactive")},addLoadingIcon:function(e){this.sandbox.dom.removeClass(e,"fa-chevron-right inactive"),this.dom.$loader===null&&(this.dom.$loader=this.sandbox.dom.createElement('<div class="'+t.nodeLoaderClass+'"/>'),this.sandbox.dom.hide(this.dom.$loader)),this.sandbox.dom.is(this.dom.$loader,":empty")&&this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"16px",color:"#666666"}}]),this.sandbox.dom.detach(this.dom.$loader),this.sandbox.dom.html(e,this.dom.$loader),this.sandbox.dom.show(this.dom.$loader)},removeLoadingIconForSelected:function(){if(!!this.$selectedElement){var e=this.sandbox.dom.find(".arrow",this.$selectedElement);this.sandbox.dom.hide(this.dom.$loader),this.sandbox.dom.prependClass(e,"fa-chevron-right")}},storeDataItem:function(e,t){this.columns[e]||(this.columns[e]={}),this.columns[e][t[this.options.idName]]=t},bindDOMEvents:function(){var e="li:not(.selected"+(this.options.disabledChildren?", ."+t.disabledClass:"")+")";this.sandbox.dom.on(this.dom.$container,"click",this.itemSelected.bind(this),e),this.sandbox.dom.on(this.$el,"mouseenter",this.itemMouseEnter.bind(this),".column-navigation li"),this.sandbox.dom.on(this.$el,"mouseleave",this.itemMouseLeave.bind(this),".column-navigation li"),this.sandbox.dom.on(this.$el,"mouseenter",this.showOptions.bind(this),".column"),this.sandbox.dom.on(this.dom.$add,"click",this.addNode.bind(this)),this.sandbox.dom.on(this.$el,"click",this.actionClickHandler.bind(this),".action"),this.sandbox.dom.on(this.dom.$container,"dblclick",this.actionClickHandler.bind(this),"li"),this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this),'input[type="checkbox"]'),this.options.responsive===!0&&this.sandbox.dom.on(this.sandbox.dom.$window,"resize",function(){this.setContainerHeight(),this.setOverflowClass()}.bind(this)),this.options.orderable&&(this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this),"."+t.orderInputClass),this.sandbox.dom.on(this.$el,"focus",function(e){if(this.isOrdering===!0)return this.sandbox.dom.blur(e.currentTarget),!1;this.sandbox.dom.select(e.currentTarget)}.bind(this),"."+t.orderInputClass+" input"),this.sandbox.dom.on(this.dom.$wrapper,"mousedown",function(e){this.lastClicked=this.sandbox.dom.$(e.target)}.bind(this)),this.sandbox.dom.on(this.dom.$ok,"click",this.closeOrderMode.bind(this)),this.sandbox.dom.on(this.$el,"keydown",this.orderKeyHandler.bind(this),"."+t.orderInputClass+" input"),this.sandbox.dom.on(this.$el,"focusout",this.orderBlurHandler.bind(this),"."+t.orderInputClass))},unbindDOMEvents:function(){this.$el.off(),!this.dom.$add||this.dom.$add.off(),!this.dom.$container||this.dom.$container.off(),!this.dom.$wrapper||this.dom.$wrapper.off(),!this.dom.$ok||this.dom.$ok.off()},orderKeyHandler:function(e){e.keyCode===13&&this.sandbox.dom.blur(e.currentTarget);if(e.keyCode===27){var n=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnClass),"data-column"),r=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnItemClass),"data-id");this.resetOrderInput(n,r),this.sandbox.dom.blur(e.currentTarget)}},orderBlurHandler:function(e){if(this.isOrdering===!1){var n=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnClass),"data-column"),r=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnItemClass),"data-id"),i=this.sandbox.dom.find("input",this.columns[n][r].$el);this.sandbox.dom.isNumeric(this.sandbox.dom.val(i))&&Math.floor(this.sandbox.dom.val(i))==this.sandbox.dom.val(i)?this.orderPrepare(n,r):this.orderError(n,r)}},orderPrepare:function(e,n){var r=this.sandbox.dom.find("input",this.columns[e][n].$el),i=this.normalizeOrderPosition(e,parseInt(this.sandbox.dom.val(r),10));this.sandbox.dom.val(r,i),this.sandbox.dom.removeClass(this.columns[e][n].$el,t.orderErrorClass),i!==this.columns[e][n].order&&(this.isOrdering=!0,this.confirmOrder(function(){this.order(e,n,i),this.isOrdering=!1,this.sandbox.dom.click(this.lastClicked)}.bind(this),function(){this.resetOrderInput(e,n),this.isOrdering=!1,this.sandbox.dom.click(this.lastClicked)}.bind(this)))},order:function(e,t,n){var r=this.columns[e][t].order;this.sandbox.util.each(this.columns[e],function(t){this.repositionItem(e,t,r,n),this.resetOrderInput(e,t)}.bind(this)),this.updateItemDomPosition(e,t),this.sandbox.util.delay(this.highlight.bind(this,t),550),this.sandbox.emit(l.call(this),t,n),this.isOrdering=!1},repositionItem:function(e,t,n,r){this.columns[e][t].order===n?this.columns[e][t].order=r:this.columns[e][t].order>n&&this.columns[e][t].order<=r?this.columns[e][t].order--:this.columns[e][t].order<n&&this.columns[e][t].order>=r&&this.columns[e][t].order++},updateItemDomPosition:function(e,n){var r=this.sandbox.dom.parent(this.columns[e][n].$el);this.sandbox.dom.detach(this.columns[e][n].$el),this.sandbox.dom.insertAt(this.columns[e][n].order-1,"."+t.columnItemClass,r,this.columns[e][n].$el),this.sandbox.dom.scrollAnimate(this.sandbox.dom.position(this.columns[e][n].$el).top,this.sandbox.dom.parents(this.columns[e][n].$el,"."+t.columnClass))},resetOrderInput:function(e,t){var n=this.sandbox.dom.find("input",this.columns[e][t].$el);this.sandbox.dom.val(n,this.columns[e][t].order)},normalizeOrderPosition:function(e,t){return t=t<1?1:t,t>Object.keys(this.columns[e]).length?Object.keys(this.columns[e]).length:t},orderError:function(e,n){this.sandbox.dom.addClass(this.columns[e][n].$el,t.orderErrorClass)},confirmOrder:function(e,t){this.sandbox.confirm.alert(this,this.options.orderConfirmTitle,this.options.orderConfirmMessage,e,t)},setOverflowClass:function(){var e=this.sandbox.dom.find(".column-navigation",this.$el);this.sandbox.dom.width(e)<this.sandbox.dom.get(e,0).scrollWidth?this.sandbox.dom.addClass(e,"overflow"):this.sandbox.dom.removeClass(e,"overflow")},bindCustomEvents:function(){if(!!this.customEvents)return;this.sandbox.on(g.call(this),this.getBreadCrumb.bind(this)),this.sandbox.on(d.call(this),this.unmark.bind(this)),this.sandbox.on(m.call(this),this.highlight.bind(this)),this.sandbox.on(c.call(this),this.startOrderModeItem.bind(this)),this.sandbox.on(b.call(this),function(e){this.unbindDOMEvents(),this.$el.children().remove(),this.options=this.sandbox.util.extend(!0,{},this.options,e),this.initialize()}.bind(this)),this.sandbox.on(v.call(this),function(e){typeof e=="function"&&e(this.marked)}.bind(this)),this.sandbox.on("husky.dropdown."+this.options.instanceName+".settings.dropdown.item.click",this.dropdownItemClicked.bind(this)),this.options.responsive===!0&&this.sandbox.on(y.call(this),function(){this.setContainerHeight(),this.setOverflowClass()}.bind(this)),this.customEvents=!0},startOrderModeItem:function(e){var t=this.getColumnForItem(e);t>0&&this.startOrderModeColumn(t)},startOrderModeColumn:function(e){if(this.inOrderMode===!1&&!!this.columns[e]&&Object.keys(this.columns[e]).length>1){this.inOrderMode=!0;var n=this.$find("."+t.columnClass+'[data-column="'+e+'"]');this.lockOptions(e),this.sandbox.dom.addClass(n,t.orderModeClass),this.sandbox.dom.hide(this.dom.$settings),this.sandbox.dom.hide(this.dom.$add),this.sandbox.dom.show(this.dom.$ok),x.call(this),this.setColumnTextWidth(e),this.sandbox.emit(h.call(this))}},closeOrderMode:function(){if(this.inOrderMode===!0){var e=this.$find("."+t.columnClass+"."+t.orderModeClass),n=this.sandbox.dom.data(e,"column");this.unlockOptions(),this.sandbox.dom.removeClass(e,t.orderModeClass),this.sandbox.dom.hide(this.dom.$ok),this.sandbox.dom.show(this.dom.$settings),this.sandbox.dom.show(this.dom.$add),this.setColumnTextWidth(n),this.inOrderMode=!1,this.sandbox.emit(p.call(this))}},highlight:function(e){var n=this.getColumnForItem(e);n>0&&(this.sandbox.dom.addClass(this.columns[n][e].$el,t.highlightClass),this.sandbox.dom.on(this.columns[n][e].$el,"animationend webkitAnimationEnd oanimationend MSAnimationEnd",function(){this.sandbox.dom.removeClass(this.columns[n][e].$el,t.highlightClass)}.bind(this)))},dropdownItemClicked:function(e){!!this.lastHoveredColumn&&!!e.mode&&e.mode==="order"&&this.startOrderModeColumn(this.lastHoveredColumn),!this.selected[this.lastHoveredColumn]||(e.callback?e.callback(e,this.selected[this.lastHoveredColumn],this.columns[this.lastHoveredColumn]):this.sandbox.emit(u.call(this),e,this.selected[this.lastHoveredColumn],this.columns[this.lastHoveredColumn]))},mark:function(e,n){var r=this.$find('li[data-id="'+e+'"]');if(!!r.length&&(!n.type||n.type.name!=="ghost"||this.options.showActionButtonOnGhost)){this.options.singleMarkable===!0&&$.each(this.marked,function(e,t){this.unmark(e)}.bind(this)),this.sandbox.dom.addClass(r,t.markedClass),e in this.marked||(this.marked[e]=n),this.setItemsTextWidth(r);var i=r.find("span:last-child > ."+this.options.actionIcon);i.removeClass(this.options.actionIcon),this.sandbox.dom.prependClass(i,this.options.unmarkIcon)}},unmark:function(e){var n=this.$find('li[data-id="'+e+'"]');if(!!n.length){n.removeClass(t.markedClass),e in this.marked&&delete this.marked[e];var r=n.find("span:last-child > ."+this.options.unmarkIcon);r.removeClass(this.options.unmarkIcon),this.sandbox.dom.prependClass(r,this.options.actionIcon)}},itemMouseEnter:function(e){this.setItemsTextWidth(e.currentTarget)},itemMouseLeave:function(e){this.setItemsTextWidth(e.currentTarget)},getBreadCrumb:function(e){typeof e=="function"?e(this.selected):this.sandbox.logger.log("callback is not a function")},showOptionsAtLast:function(){var e=this.sandbox.dom.last(this.sandbox.dom.find(".column",this.dom.$container));this.showOptions({currentTarget:e})},showOptions:function(e){if(this.optionsLocked===!1){var t=this.sandbox.dom.$(e.currentTarget);this.displayOptions(t),this.sandbox.dom.off(this.dom.$container,"scroll.column-navigation."+this.options.instanceName),this.sandbox.dom.on(this.dom.$container,"scroll.column-navigation."+this.options.instanceName,this.displayOptions.bind(this,t))}},lockOptions:function(e){var n=this.$find("."+t.columnClass+'[data-column="'+e+'"]');!n.length||(this.showOptions({currentTarget:n}),this.optionsLocked=!0)},unlockOptions:function(){this.optionsLocked=!1},displayOptions:function(e){if(!!this.inOrderMode)return;var n;this.lastHoveredColumn=this.sandbox.dom.data(e,"column"),this.sandbox.dom.position(e).left+this.sandbox.dom.width(e)>this.sandbox.dom.width(this.dom.$container)?n=(this.sandbox.dom.width(this.dom.$container)-this.sandbox.dom.position(e).left)/this.sandbox.dom.width(e):n=(this.sandbox.dom.width(e)+this.sandbox.dom.position(e).left)/this.sandbox.dom.width(e),n>=t.minVisibleRatio?(this.sandbox.dom.css(this.$optionsContainer,{visibility:"visible"}),this.moveOptions(e),this.toggleSettingDropdownItems(this.lastHoveredColumn)):this.hideOptions()},toggleSettingDropdownItems:function(e){if(!!this.options.data&&this.options.data.length>0){var t=w.call(this,e);this.sandbox.util.each(this.options.data,function(e,n){!!n.enabler&&typeof n.enabler=="function"&&this.sandbox.emit("husky.dropdown."+this.options.instanceName+".settings.dropdown.item.toggle",n.id,n.enabler(t))}.bind(this))}},moveOptions:function(e){var t=this.sandbox.dom.position(e).left-1;$(this.$optionsContainer).css("margin-left",t+"px"),S.call(this)?$(this.dom.$add).show():$(this.dom.$add).hide(),x.call(this)},hideOptions:function(){this.sandbox.dom.css(this.$optionsContainer,{visibility:"hidden"})},itemSelected:function(e){if(this.columnLoadStarted===!1){this.$selectedElement=this.sandbox.dom.$(e.currentTarget);var n=this.sandbox.dom.data(this.$selectedElement,"id"),r=this.sandbox.dom.parent(this.sandbox.dom.parent(this.$selectedElement)),i=r.data("column"),s=this.columns[i][n],u=this.selected.length-1,a,f;if(r.hasClass(t.orderModeClass))return this.$selectedElement.find("input").focus(),!1;this.closeOrderMode();if(this.sandbox.dom.hasClass(this.$selectedElement,"selected"))this.sandbox.emit(o.call(this),s);else{this.removeCurrentSelected(i),this.sandbox.dom.addClass(this.$selectedElement,"selected"),f=this.sandbox.dom.find(".arrow",this.$selectedElement),this.addLoadingIcon(f);if(!!s){for(a=u;a>=i;a--)delete this.selected[a];this.selected[i]=s,this.sandbox.emit(o.call(this),s),!s[this.options.hasSubName]||this.load(s._links.children.href,i),this.removeColumns(i+1),this.setOverflowClass()}}s[this.options.hasSubName]||(this.insertAddColumn(s,i),this.scrollIfNeeded(i),this.setOverflowClass(),this.toggleSettingDropdownItems(i))}},insertAddColumn:function(e,t){var r=this.sandbox.dom.createElement(this.sandbox.util.template(n.column)({columnNumber:t+1,id:"column"+this.options.instanceName+"-"+(t+1)}));this.sandbox.dom.append(r,this.sandbox.dom.createElement(this.sandbox.util.template(n.noPage)({description:this.sandbox.translate(this.options.noPageDescription)}))),this.sandbox.dom.append(this.dom.$container,r),this.filledColumns++},scrollIfNeeded:function(e){e>t.displayedcolumns&&this.sandbox.dom.scrollLeft(this.dom.$container,(e-t.displayedcolumns)*t.columnWidth)},removeCurrentSelected:function(e){var t=this.sandbox.dom.find("li","#column"+this.options.instanceName+"-"+e);this.sandbox.util.each(t,function(e,t){this.sandbox.dom.removeClass(t,"selected");var n=this.sandbox.dom.find(".arrow",t);this.sandbox.dom.addClass(n,"inactive")}.bind(this))},addNode:function(){var e=this.selected[this.lastHoveredColumn-1]||null;this.sandbox.emit(a.call(this),e)},actionClickHandler:function(e){var n,r,i,s;if(this.inOrderMode===!0)return!1;this.sandbox.dom.hasClass(e.currentTarget,"action")===!0?n=this.sandbox.dom.parent(this.sandbox.dom.parent(e.currentTarget)):n=this.sandbox.dom.$(e.currentTarget);if(n.hasClass(t.disabledClass))return;s=this.sandbox.dom.index(this.sandbox.dom.parents(e.currentTarget,".column")),r=this.sandbox.dom.attr(n,"data-id"),i=this.columns[s][r],this.options.markable===!0&&(r in this.marked?this.unmark(r):this.mark(r,i)),this.sandbox.dom.stopPropagation(e),this.options.actionCallback?this.options.actionCallback(i):this.sandbox.emit(f.call(this),i)}}}),define("__component__$loader@husky",[],function(){"use strict";var e={size:"40px",color:"#666",hidden:!1},t="husky.loader.",n=t+"show",r=t+"hide",i=t+"initialized",s={doubleBounce:['<div class="spinner">','<div class="double-bounce1"></div>','<div class="double-bounce2"></div>',"</div>"].join("")},o=function(){this.sandbox.on(n,a.bind(this)),this.sandbox.on(r,u.bind(this))},u=function(){this.sandbox.dom.hide(this.$spinner)},a=function(){this.sandbox.dom.show(this.$spinner)};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.render(),o.call(this),this.sandbox.emit(i)},render:function(){this.$spinner=this.sandbox.dom.createElement(s.doubleBounce);var e,t;this.sandbox.dom.html(this.$el,this.$spinner),t={width:this.options.size,height:this.options.size},this.sandbox.dom.css(this.$spinner,t),e=this.sandbox.dom.find("div",this.$spinner),this.sandbox.dom.css(e,"background-color",this.options.color),this.options.hidden&&this.sandbox.dom.hide(this.$spinner)}}}),define("__component__$ckeditor@husky",[],function(){"use strict";var e={initializedCallback:null,instanceName:null,table:!0,link:!0,pasteFromWord:!0,autoStart:!0,placeholder:"",entities:!1},t="husky.ckeditor.",n=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"initialized"},r=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"changed"},i=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"focusout"},s=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"start"},o=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"destroy"},u=function(){var e=this.sandbox.util.extend(!1,{},this.options),t=this.sandbox.ckeditor.getToolbarBuilder();return!e.toolbar||(t=this.sandbox.ckeditor.createToolbarBuilder(e.toolbar)),!this.options.pasteFromWord==1&&t.remove("paste",["PasteFromWord"]),e.linkShowTargetTab=!1,this.options.link||(t.remove("links",["Link","Unlink"]),e.linkShowTargetTab=!0),this.options.table||t.remove("insert",["Table"]),!this.options.height||(e.autoGrow_minHeight=this.options.height,e.height=this.options.height),!this.options.maxHeight||(e.autoGrow_maxHeight=this.options.maxHeight,e.height>e.autoGrow_maxHeight&&(e.height=e.autoGrow_maxHeight)),!this.options.enterMode||(e.enterMode=CKEDITOR["ENTER_"+this.options.enterMode.toUpperCase()]),(!e.stylesSet||0===e.stylesSet.length)&&t.remove("styles",["Styles"]),e.toolbar=t.get(),delete e.initializedCallback,delete e.baseUrl,delete e.el,delete e.property,delete e.name,delete e.ref,delete e._ref,delete e.require,delete e.element,delete e.link,delete e.table,delete e.maxHeight,delete e.autoStart,delete e.placeholder,e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.editorContent=null,this.options.autoStart?this.startEditor():this.renderStartTemplate(),this.sandbox.on(s.call(this),this.startEditor.bind(this)),this.sandbox.on(o.call(this),this.destroyEditor.bind(this))},renderStartTemplate:function(){var e=$("<body>"+this.$el.val()+"</body>"),t=e.text(),n=$(['<textarea class="form-element ckeditor-preview" placeholder="',this.options.placeholder,'">',t,"</textarea>"].join(""));this.$el.hide(),this.$el.parent().append(n),n.one("focus",function(e){$(e.currentTarget).remove(),this.startEditor(),this.editor.once("instanceReady",function(){this.editor.focus()}.bind(this))}.bind(this))},bindEditorEvents:function(){this.editor.on("dialogShow",function(){this.sandbox.dom.addClass(this.sandbox.dom.parent(".cke_dialog_ui_button_ok"),"sulu_ok_button"),this.sandbox.dom.addClass(this.sandbox.dom.parent(".cke_dialog_ui_button_cancel"),"sulu_cancel_button")}.bind(this)),this.editor.on("change",function(){this.emitChangedEvent()}.bind(this)),this.editor.on("mode",function(){this.data!==this.editor.getData()&&this.emitChangedEvent()}.bind(this)),this.editor.on("instanceReady",function(){this.sandbox.dom.addClass(this.sandbox.dom.find(".cke",this.sandbox.dom.parent(this.$el)),"form-element"),this.sandbox.emit(n.call(this))}.bind(this)),this.editor.on("blur",function(){this.sandbox.emit(i.call(this),this.editor.getData(),this.$el)}.bind(this))},emitChangedEvent:function(){this.data=this.editor.getData(),this.sandbox.emit(r.call(this),this.data,this.$el)},startEditor:function(){var e=u.call(this);this.options.autoStart||this.$el.show(),this.editor=this.sandbox.ckeditor.init(this.$el,this.options.initializedCallback,e),!this.editorContent||this.editor.setData(this.editorContent),this.data=this.editor.getData(),this.bindEditorEvents()},destroyEditor:function(){!this.editor||(this.editorContent=this.editor.getData(),!this.editor.window||!this.editor.window.getFrame()?delete CKEDITOR.instances[this.editor.name]:this.editor.destroy())},destroy:function(){this.destroyEditor()}}}),define("__component__$ckeditor/plugins/paste-from-word@husky",["underscore"],function(e){"use strict";var t={title:"Paste from Word",info:"",enterMode:"P",saveCallback:function(e){}};return{templates:{form:e.template('<p class="input-description"><%= info %></p><p class="input-description"><%= message %></p><textarea class="form-element"></textarea>')},initialize:function(){this.options=this.sandbox.util.extend(!0,{},t.options,this.options),this.initializeDialog()},initializeDialog:function(){var e=this.sandbox.dom.createElement('<div class="overlay-container"/>');this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"overlay@husky",options:{openOnStart:!0,removeOnClose:!0,el:e,container:this.$el,instanceName:"paste-from-word",slides:[{title:this.options.title,data:this.templates.form({info:this.options.info,message:this.options.message}),buttons:[{type:"cancel",align:"left"},{type:"ok",text:"OK",align:"right"}],okCallback:function(){var e=this.$el.find("textarea").val();e=e.replace(/^ +| +$/gm,""),e=e.replace(/(?:\r\n|\r|\n)/g,"<br/>"),"P"===this.options.enterMode?(e=e.replace(/<br\/><br\/>/g,"</p><p>"),e="<p>"+e+"</p>"):"DIV"===this.options.enterMode&&(e=e.replace(/<br\/><br\/>/g,"</div><div>"),e="<div>"+e+"</div>"),this.options.saveCallback(e)}.bind(this)}]}}]),this.sandbox.once("husky.overlay.paste-from-word.opened",function(){this.$el.find("textarea").focus()}.bind(this))}}}),define("__component__$overlay@husky",[],function(){"use strict";var e={trigger:"click",triggerEl:null,instanceName:"undefined",openOnStart:!1,removeOnClose:!0,backdropClose:!0,skin:"",supportKeyInput:!0,contentSpacing:!0,propagateEvents:!0,type:"normal",cssClass:"",slides:[],startingSlide:null,top:null,left:null},t={index:-1,title:"",subTitle:null,displayHeader:!0,message:"",closeCallback:null,cancelCallback:null,okCallback:null,type:"normal",data:"",panelContent:"",tabs:null,okInactive:!1,buttonsDefaultAlign:"center",cancelDefaultText:"public.cancel",okDefaultText:"public.ok",languageChanger:null,contentSpacing:!0,cssClass:""},n={$el:null,$footer:null,$header:null,$content:null,$languageChanger:null,$subheader:null,tabs:null},r={closeSelector:".close-button",footerSelector:".overlay-footer",contentSelector:".overlay-content",headerSelector:".overlay-header",slidesSelector:".slides",overlayOkSelector:".overlay-ok",overlayCancelSelector:".overlay-cancel",overlayOtherButtonsSelector:".overlay-button",panelClass:"panel"},i={normal:{buttons:[{type:"ok",inactive:!1,align:"right"},{type:"cancel",inactive:!1,align:"left"}]},alert:{cssClass:"alert",removeOnClose:!0,openOnStart:!0,contentSpacing:!1,instanceName:"alert",buttons:[{type:"ok",inactive:!1,align:"right"},{type:"cancel",inactive:!1,align:"left"}]}},s={OK:"ok",CANCEL:"cancel"},o={overlaySkeleton:['<div class="husky-overlay-container <%= overflowClass %> <%= skin %> <%= cssClass %>">','   <div class="slides"></div>',"</div>"].join(""),slideSkeleton:['<div class="slide slide-<%= index %> <%= cssClass %>">',"   <% if(displayHeader) { %>",'      <div class="overlay-header<% if(subTitle) { %> with-sub-title<% } %>">','           <span class="title"><%= title %></span>','           <% if(subTitle) { %><div class="sub-title"><%= subTitle %></div><% } %>',"       </div>","   <% } %>",'   <div class="overlay-content <%= spacingClass %>"></div>','   <div class="overlay-footer">',"   </div>","</div>"].join(""),okButton:['<div class="btn action overlay-ok<%= classes %>">',"   <% if (!!icon) { %>",'   <span class="fa-<%= icon %>"></span>',"   <% } %>",'   <span class="text"><%= text %></span>',"</div>",'<div class="loader" style="display: none;"></div>'].join(""),cancelButton:['<div class="btn gray black-text overlay-cancel<%= classes %>">',"   <% if (!!icon) { %>",'   <span class="fa-<%= icon %>"></span>',"   <% } %>",'   <span class="text"><%= text %></span>',"</div>"].join(""),button:['<div class="btn overlay-button <%= classes %>" data-button-number="<%=buttonNumber%>">',"   <% if (!!icon) { %>",'   <span class="fa-<%= icon %>"></span>',"   <% } %>",'   <span class="text"><%= text %></span>',"</div>"].join(""),wrapper:['<div class="husky-overlay-wrapper">','   <div class="husky-overlay-scroll-wrapper"></div>','   <div class="husky-overlay-backdrop"></div>',"</div>"].join(""),subheader:['<div class="overlay-subheader">','   <div class="overlay-tabs"></div>',"</div>"].join(""),message:['<div class="message"><%= message %></div>'].join("")},u="husky.overlay.",a=function(){return x.call(this,"initialized")},f=function(){return x.call(this,"opened")},l=function(){return x.call(this,"closed")},c=function(){return x.call(this,"closing")},h=function(){return x.call(this,"okbutton.activate")},p=function(){return x.call(this,"okbutton.deactivate")},d=function(){return x.call(this,"remove")},v=function(){return x.call(this,"open")},m=function(){return x.call(this,"close")},g=function(){return x.call(this,"show-loader")},y=function(){return x.call(this,"hide-loader")},b=function(){return x.call(this,"language-changed")},w=function(){return x.call(this,"slide-left")},E=function(){return x.call(this,"slide-right")},S=function(){return x.call(this,"slide-to")},x=function(e){return u+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.sandbox.logger.log("initialize",this);var t=this.options.type||e.type;this.options=this.sandbox.util.extend(!0,{},e,i[t],this.options),this.setVariables(),this.initSlideOptions(),this.bindEvents(),this.options.openOnStart&&this.openOverlay()},initSlideOptions:function(){var e,n;if(this.options.slides.length===0){this.slides[0]=this.sandbox.util.extend({},t),this.slides[0].index=0;for(e in t)this.options.hasOwnProperty(e)&&(this.slides[0][e]=this.options[e]);n=i[this.slides[0].type],this.slides[0]=this.sandbox.util.extend({},n,this.slides[0])}else this.sandbox.util.foreach(this.options.slides,function(e,r){this.slides[r]=this.sandbox.util.extend({},t,e),n=i[this.slides[r].type],this.slides[r]=this.sandbox.util.extend({},n,this.slides[r]),this.slides[r].index===-1&&(this.slides[r].index=r)}.bind(this))},bindEvents:function(){!this.$trigger||this.sandbox.dom.on(this.$trigger,this.options.trigger+".overlay."+this.options.instanceName,function(e){this.sandbox.dom.preventDefault(e),this.triggerHandler()}.bind(this)),this.sandbox.on(d.call(this),this.removeComponent.bind(this)),this.sandbox.on(h.call(this),this.activateOkButtons.bind(this)),this.sandbox.on(p.call(this),this.deactivateOkButtons.bind(this)),this.sandbox.on(v.call(this),this.triggerHandler.bind(this)),this.sandbox.on(m.call(this),this.closeHandler.bind(this)),this.sandbox.on("husky.select."+this.options.instanceName+".selected.item",function(e){this.sandbox.emit(b.call(this),this.slides[this.activeSlide].languageChanger.locales[e],this.activeTab)}.bind(this))},activateOkButtons:function(){var e=this.sandbox.dom.find(r.overlayOkSelector,this.overlay.$footer),t,n;for(t=-1,n=e.length;++t<n;)this.sandbox.dom.removeClass(e[t],"inactive gray")},deactivateOkButtons:function(){var e=this.sandbox.dom.find(r.overlayOkSelector,this.overlay.$footer),t,n;for(t=-1,n=e.length;++t<n;)this.sandbox.dom.addClass(e[t],"inactive gray")},removeComponent:function(){this.sandbox.stop()},setVariables:function(){this.$trigger=null,!this.options.triggerEl||(this.$trigger=this.sandbox.dom.$(this.options.triggerEl)),this.overlay={opened:!1,collapsed:!1,normalHeight:null,$el:null,$slides:null,slides:[]},this.$wrapper=null,this.$backdrop=null,this.activeTab=null,this.slides=[],this.activeSlide=0},triggerHandler:function(){this.openOverlay()},openOverlay:function(){this.overlay.opened===!1&&(this.overlay.opened=!0,this.$wrapper==null&&this.initWrapper(),this.overlay.$el===null?(this.initSkeleton(),this.bindOverlayEvents(),this.bindCustomEvents(),this.options.okInactive===!0&&this.deactivateOkButtons(),this.sandbox.emit(a.call(this)),this.overlay.$content=this.sandbox.dom.find(r.contentSelector,this.overlay.$el),this.insertOverlay(!0),!this.options.startingSlide||this.slideTo(this.options.startingSlide,!1),this.sandbox.start([{name:"loader@husky",options:{el:this.$el.find(".loader"),size:"30px"}}])):this.insertOverlay(!0))},bindCustomEvents:function(){this.sandbox.on(w.call(this),this.slideLeft.bind(this)),this.sandbox.on(E.call(this),this.slideRight.bind(this)),this.sandbox.on(S.call(this),this.slideEvent.bind(this)),this.sandbox.on(g.call(this),this.showLoader.bind(this)),this.sandbox.on(y.call(this),this.hideLoader.bind(this))},showLoader:function(){this.$el.find(".btn").hide(),this.$el.find(".loader").show()},hideLoader:function(){this.$el.find(".btn").show(),this.$el.find(".loader").hide()},slideLeft:function(){var e=this.activeSlide-1;e<0&&(e=this.slides.length-1),this.slideTo(e,!0)},slideRight:function(){var e=this.activeSlide+1;e>=this.slides.length&&(e=0),this.slideTo(e,!0)},slideEvent:function(e){if(e<0||e>=this.slides.length){this.sandbox.logger.error("Slide index out bounds");return}this.slideTo(e,!0)},slideTo:function(e,t){this.activeSlide=e;var n=this.sandbox.dom.outerWidth(this.sandbox.dom.find(".slide",this.overlay.$slides));t=typeof t=="undefined"?!0:t,t||this.overlay.$slides.addClass("no-animation"),this.overlay.$slides.css("left","-"+e*n+"px"),t||(this.overlay.$slides[0].offsetHeight,this.overlay.$slides.removeClass("no-animation"))},initWrapper:function(){this.$wrapper=this.sandbox.dom.createElement(o.wrapper),this.$backdrop=this.$wrapper.find(".husky-overlay-backdrop"),this.$wrapper.hide()},closeOverlay:function(){this.sandbox.emit(c.call(this)),this.overlay.opened=!1,this.sandbox.emit(l.call(this)),this.sandbox.dom.off("body","keydown."+this.options.instanceName),this.$wrapper.hide(),this.options.removeOnClose?this.removeComponent():this.sandbox.dom.detach(this.overlay.$el)},insertOverlay:function(e){this.$wrapper.find(".husky-overlay-scroll-wrapper").append(this.overlay.$el),this.sandbox.dom.append(this.$el,this.$wrapper),this.$wrapper.show(),!e||this.sandbox.emit(f.call(this)),this.options.supportKeyInput===!0&&(this.sandbox.dom.off("body","keydown."+this.options.instanceName),this.sandbox.dom.on("body","keydown."+this.options.instanceName,this.keyHandler.bind(this)))},initSkeleton:function(){this.overlay.$el=this.sandbox.dom.createElement(this.sandbox.util.template(o.overlaySkeleton,{skin:this.options.skin?this.options.skin:"",cssClass:this.options.cssClass?this.options.cssClass:"",overflowClass:this.slides.length>1?"overflow-hidden":""})),this.overlay.$slides=this.sandbox.dom.find(r.slidesSelector,this.overlay.$el);var e,t;for(e in this.slides)this.slides.hasOwnProperty(e)&&(t=this.initSlideSkeleton(e),this.initButtons(e),this.setContent(e),!this.slides[e].languageChanger||this.renderLanguageChanger(e),this.sandbox.dom.append(this.overlay.$slides,t))},initSlideSkeleton:function(e){this.overlay.slides[e]=this.sandbox.util.extend({},n),this.overlay.slides[e].$el=this.sandbox.dom.createElement(this.sandbox.util.template(o.slideSkeleton,{title:this.sandbox.util.cropMiddle(this.slides[e].title,58),subTitle:this.slides[e].subTitle?this.slides[e].subTitle:null,index:this.slides[e].index,cssClass:this.slides[e].cssClass,displayHeader:this.slides[e].displayHeader,spacingClass:this.slides[e].contentSpacing?"content-spacing":""})),this.overlay.slides[e].$footer=this.sandbox.dom.find(r.footerSelector,this.overlay.slides[e].$el),this.overlay.slides[e].$content=this.sandbox.dom.find(r.contentSelector,this.overlay.slides[e].$el),this.overlay.slides[e].$header=this.sandbox.dom.find(r.headerSelector,this.overlay.slides[e].$el);if(!!this.slides[e].languageChanger||!!this.slides[e].tabs||!!this.slides[e].panelContent)this.overlay.slides[e].$subheader=$(o.subheader),this.overlay.slides[e].$header.after(this.overlay.slides[e].$subheader);if(!!this.slides[e].languageChanger||!!this.slides[e].panelContent)this.overlay.slides[e].$panel=$('<div class="'+r.panelClass+'"/>'),this.overlay.slides[e].$subheader.append(this.overlay.slides[e].$panel);return!this.slides[e].panelContent||(this.overlay.slides[e].$panel.append('<div class="panel-content"/>'),this.overlay.slides[e].$panel.find(".panel-content").append(this.slides[e].panelContent)),this.sandbox.dom.addClass(this.overlay.slides[e].$footer,this.options.buttonsDefaultAlign),this.sandbox.dom.addClass(this.overlay.slides[e].$el,this.options.cssClass),this.overlay.slides[e].$el},renderLanguageChanger:function(e){var t=this.sandbox.dom.createElement('<div class="language-changer"/>');this.overlay.slides[e].$panel.append(t),this.sandbox.start([{name:"select@husky",options:{el:t,data:this.slides[e].languageChanger.locales,preSelectedElements:[this.slides[e].languageChanger.preSelected],instanceName:this.options.instanceName}}])},initButtons:function(e){var t,n,r,i,u,a,f,l;for(t=-1,n=this.slides[e].buttons.length;++t<n;)i=this.slides[e].buttons[t],i.type===s.OK?(u=o.okButton,f=this.slides[e].okDefaultText,l=this.slides[e].okInactive):i.type===s.CANCEL?(u=o.cancelButton,f=this.slides[e].cancelDefaultText):u=o.button,a=i.classes?" "+i.classes:"",i.text?f=i.text:!i.icon||(f=""),l!==!0&&(l=i.inactive),r=this.sandbox.dom.createElement(this.sandbox.util.template(u,{icon:i.icon,text:this.sandbox.translate(f),buttonNumber:t,classes:l===!0?a+" inactive gray":a})),!i.align||this.sandbox.dom.addClass(r,i.align),this.sandbox.dom.append(this.overlay.slides[e].$footer,r)},setContent:function(e){this.slides[e].data?this.sandbox.dom.append(this.overlay.slides[e].$content,this.slides[e].data):this.slides[e].message?this.sandbox.dom.append(this.overlay.slides[e].$content,this.sandbox.util.template(o.message,{message:this.slides[e].message})):this.slides[e].tabs!==null?this.renderTabs(e):this.sandbox.logger.log("Error: either options.data, options.message or options.tabs has to be set",this)},renderTabs:function(e){this.overlay.slides[e].tabs=[];for(var t=-1,n=this.slides[e].tabs.length;++t<n;)this.overlay.slides[e].tabs.push({id:t,name:this.slides[e].tabs[t].title,$el:this.sandbox.dom.createElement(this.slides[e].tabs[t].data)}),this.sandbox.dom.hide(this.overlay.slides[e].tabs[t].$el),this.sandbox.dom.append(this.overlay.slides[e].$content,this.overlay.slides[e].tabs[t].$el);this.showTab(this.overlay.slides[e].tabs[0],e),this.startTabsComponent(e)},startTabsComponent:function(e){this.sandbox.start([{name:"tabs@husky",options:{el:this.overlay.slides[e].$subheader.find(".overlay-tabs"),data:this.overlay.slides[e].tabs,instanceName:"overlay"+this.options.instanceName,skin:"overlay"}}])},keyHandler:function(e){if(e.keyCode===27)this.closeHandler();else if(e.keyCode===13){if(e.target.tagName==="TEXTAREA")return;this.okHandler()}},bindOverlayEvents:function(){this.options.propagateEvents===!1&&(this.sandbox.dom.on(this.overlay.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this)),this.sandbox.dom.on(this.$wrapper,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this))),this.sandbox.dom.on(this.overlay.$el,"click",this.closeHandler.bind(this),r.overlayCancelSelector),this.sandbox.dom.on(this.overlay.$el,"click",this.okHandler.bind(this),r.overlayOkSelector),this.sandbox.dom.on(this.overlay.$el,"click",this.buttonHandler.bind(this),r.overlayOtherButtonsSelector),this.options.backdropClose===!0&&this.$backdrop.on("click",this.closeHandler.bind(this)),this.bindOverlayCustomEvents()},bindOverlayCustomEvents:function(){this.overlay.tabs!==null&&this.sandbox.on("husky.tabs.overlay"+this.options.instanceName+".item.select",this.showTab.bind(this))},showTab:function(e,t){t=t||this.activeSlide,this.activeTab=e,this.hideAllTabsElements(t),this.sandbox.dom.show(e.$el)},hideAllTabsElements:function(e){for(var t=-1,n=this.overlay.slides[e].tabs.length;++t<n;)this.sandbox.dom.hide(this.overlay.slides[e].tabs[t].$el)},okHandler:function(e){if(!!e&&this.sandbox.dom.hasClass(e.currentTarget,"inactive"))return;!e||(this.sandbox.dom.preventDefault(e),this.sandbox.dom.stopPropagation(e)),this.executeCallback(this.slides[this.activeSlide].okCallback,this.sandbox.dom.find(r.contentSelector,this.overlay.$el))!==!1&&this.closeOverlay()},closeHandler:function(e){var t=this.slides[this.activeSlide].closeCallback||this.slides[this.activeSlide].cancelCallback;!e||(this.sandbox.dom.preventDefault(e),this.sandbox.dom.stopPropagation(e)),this.executeCallback(t,this.sandbox.dom.find(r.contentSelector,this.overlay.$el))!==!1&&this.closeOverlay()},buttonHandler:function(e){if(!e||this.sandbox.dom.hasClass(e.currentTarget,"inactive"))return;var t=this.sandbox.dom.data(e.currentTarget,"buttonNumber"),n=this.slides[this.activeSlide].buttons[t];this.sandbox.dom.preventDefault(e),this.sandbox.dom.stopPropagation(e),this.executeCallback(n.callback,this.sandbox.dom.find(r.contentSelector,this.overlay.$el))},executeCallback:function(e,t){if(typeof e=="function")return e(t)}}}),define("__component__$label@husky",[],function(){"use strict";var e={instanceName:"undefined",type:"WARNING",html:null,title:null,counter:1,description:null,hasClose:!0,effectType:"slide",autoVanish:!0,vanishDelay:0,vanishDuration:250,showDuration:250,closeCallback:null,insertMethod:"append",additionalLabelClasses:"big",buttons:[]},t={APPEND:"append",PREPEND:"prepend"},n={textClass:"text",closeClass:"close",counterClass:"counter",closeIconClass:"fa-times-circle",buttonsClass:"buttons",buttonClass:"button",loaderColor:"#666",isLoading:"is-loading",loaderClass:"loader"},r={ERROR:{title:"Error",labelClass:"husky-label-error",vanishDelay:1e4},WARNING:{vanishDelay:5e3,title:"Warning",labelClass:"husky-label-warning"},SUCCESS:{vanishDelay:5e3,title:"Success",labelClass:"husky-label-success"},SUCCESS_ICON:{labelClass:"husky-label-success-icon",effectType:"fade",hasClose:!1,vanishDelay:2e3,showDuration:100}},i={basic:['<div class="'+n.closeClass+'">','   <% if (!!hasClose) { %><span class="'+n.closeIconClass+'"></span><% } %>',"</div>",'<div class="'+n.textClass+'">',"   <% if (!!title) { %><strong><%= title %></strong><% } %>","   <span><%= description %></span>",'   <div class="'+n.counterClass+'"><span><%= counter %></span></div>',"</div>"].join(""),buttons:'<div class="'+n.buttonsClass+'"></div>',button:'<div class="'+n.buttonClass+'"><%= title %></div>'},s="husky.label.",o=function(){return h.call(this,"initialized")},u=function(){return h.call(this,"destroyed")},a=function(){return h.call(this,"refresh")},f=function(){return h.call(this,"vanish")},l=function(){return h.call(this,"loading")},c=function(){return h.call(this,"reset")},h=function(e){return s+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,r[this.options.type],this.options),this.vanishTimer=null,this.label={$el:null,$content:null,$close:null,$buttons:null},this.buttons={},this.bindCustomEvents(),this.render(),this.bindDomEvents(),this.startEffects(),this.sandbox.emit(o.call(this))},destroy:function(){this.sandbox.emit(u.call(this))},bindDomEvents:function(){this.sandbox.dom.on(this.label.$close,"click",function(){this.vanish(),typeof this.options.closeCallback=="function"&&this.options.closeCallback()}.bind(this))},bindCustomEvents:function(){this.sandbox.on(a.call(this),this.refresh.bind(this)),this.sandbox.on(l.call(this),this.setLoadingState.bind(this)),this.sandbox.on(c.call(this),this.resetState.bind(this)),this.sandbox.on(f.call(this),this.vanish.bind(this))},refresh:function(){this.options.counter+=1,this.abortEffects(),this.label.$el.find("."+n.counterClass+" span").html(this.options.counter),this.updateCounterVisibility(),this.startEffects()},setLoadingState:function(){var e=$("<div/>");e.addClass(n.loaderClass),this.label.$el.append(e),this.label.$el.addClass(n.isLoading),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"20px",color:n.loaderColor}}])},resetState:function(){this.sandbox.stop(this.label.$el.find("*")),this.label.$el.removeClass(n.isLoading)},startEffects:function(){this.options.autoVanish===!0&&(this.vanishTimer=_.delay(function(){this.vanish()}.bind(this),this.options.vanishDelay))},abortEffects:function(){this.label.$el.stop(),this.label.$el.removeAttr("style"),clearTimeout(this.vanishTimer)},vanish:function(){this.options.effectType==="slide"?this.label.$el.slideUp({duration:this.options.vanishDuration,done:this.close.bind(this)}):this.options.effectType==="fade"&&this.label.$el.fadeOut({duration:this.options.vanishDuration,done:this.close.bind(this)})},show:function(){this.options.effectType==="slide"?this.label.$el.slideDown({duration:this.options.showDuration}):this.options.effectType==="fade"&&this.label.$el.fadeIn({duration:this.options.showDuration})},render:function(){this.renderElement(),this.renderContent(),this.renderButtons(),this.updateCounterVisibility(),this.insertLabel(),this.show()},renderElement:function(){this.label.$el=this.sandbox.dom.createElement('<div class="'+this.options.labelClass+(this.options.additionalLabelClasses?" "+this.options.additionalLabelClasses:"")+'"/>'),this.label.$el.hide()},renderContent:function(){this.options.html!==null?this.label.$content=this.sandbox.dom.createElement(this.options.html):this.label.$content=this.sandbox.dom.createElement(this.sandbox.util.template(i.basic,{title:this.sandbox.translate(this.options.title),description:this.sandbox.translate(this.options.description),counter:this.options.counter,hasClose:this.options.hasClose})),this.label.$close=this.label.$content.find("."+n.closeIconClass),this.sandbox.dom.append(this.label.$el,this.label.$content)},renderButtons:function(){this.options.buttons.length>0&&(this.label.$buttons=$(i.buttons),this.label.$el.append(this.label.$buttons),this.sandbox.util.foreach(this.options.buttons,this.renderButton.bind(this)))},renderButton:function(e){this.buttons[e.id]=e,this.buttons[e.id].$el=$(_.template(i.button,{title:e.title})),!e.skin||this.buttons[e.id].$el.addClass(e.skin),this.label.$buttons.append(this.buttons[e.id].$el),!e.onClick||this.buttons[e.id].$el.on("click",function(){this.buttons[e.id].onClick()}.bind(this))},updateCounterVisibility:function(){this.options.counter>1?this.sandbox.dom.show(this.label.$el.find("."+n.counterClass)):this.sandbox.dom.hide(this.label.$el.find("."+n.counterClass))},insertLabel:function(){this.options.insertMethod===t.APPEND?this.sandbox.dom.append(this.$el,this.label.$el):this.options.insertMethod===t.PREPEND?this.sandbox.dom.prepend(this.$el,this.label.$el):this.sandbox.logger.log("No insert method found for",this.options.insertMethod)},close:function(){this.sandbox.stop()}}}),define("__component__$toggler@husky",[],function(){"use strict";var e={instanceName:"undefined",hiddenCheckbox:!0,outline:!1},t={componentClass:"husky-toggler",switchClass:"switch",checkedClass:"checked",wrapperClass:"toggler-wrapper",outlineClass:"outline"},n="husky.toggler.",r=function(){return o.call(this,"initialized")},i=function(){return o.call(this,"changed")},s=function(){return o.call(this,"change")},o=function(e){return n+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.hasId=!1,this.$checkbox=null,this.$wrapper=null,this.render(),this.bindDomEvents(),this.bindCustomEvents(),this.$el.data("checked")===undefined&&this.setData(!1),this.sandbox.emit(r.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.attr(this.$el,"id")&&(this.options.instanceName=this.sandbox.dom.attr(this.$el,"id"),this.hasId=!0),this.options.outline===!0&&this.sandbox.dom.addClass(this.$el,t.outlineClass),this.$wrapper=this.sandbox.dom.createElement('<div class="'+t.wrapperClass+'"/>'),this.sandbox.dom.html(this.$el,this.$wrapper),this.generateHiddenCheckbox(),this.getData()===!0&&this.setChecked(!1),this.sandbox.dom.append(this.$wrapper,this.sandbox.dom.createElement('<div class="'+t.switchClass+'"/>'))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.toggleButton()}.bind(this)),this.hasId===!0&&this.sandbox.dom.on('label[for="'+this.options.instanceName+'"]',"click",function(){this.toggleButton()}.bind(this))},bindCustomEvents:function(){this.sandbox.on(s.call(this),function(e){this.getData()!==e&&(e===!0?this.setChecked(!0):this.unsetChecked(!0))}.bind(this))},toggleButton:function(){this.getData()===!0?this.unsetChecked(!0):this.setChecked(!0)},setChecked:function(e){this.sandbox.dom.addClass(this.$el,t.checkedClass),this.setData(!0),this.updateCheckbox(this.getData()),e!==!1&&this.sandbox.emit(i.call(this),!0)},unsetChecked:function(e){this.sandbox.dom.removeClass(this.$el,t.checkedClass),this.setData(!1),this.updateCheckbox(this.getData()),e!==!1&&this.sandbox.emit(i.call(this),!1)},generateHiddenCheckbox:function(){this.options.hiddenCheckbox===!0&&(this.$checkbox=this.sandbox.dom.createElement('<input type="checkbox" name="'+this.options.instanceName+'"/>'),this.sandbox.dom.append(this.$wrapper,this.$checkbox))},updateCheckbox:function(e){this.$checkbox!==null&&this.sandbox.dom.prop(this.$checkbox,"checked",e)},setData:function(e){this.$el.data("checked",!!e)},getData:function(){return this.$el.data("checked")}}}),define("__component__$dropzone@husky",[],function(){"use strict";var e={instanceName:"undefined",titleKey:"sulu.upload.dropzone-title",descriptionKey:"sulu.upload.dropzone-desc",descriptionIcon:"cloud-upload",cancelLoadingIcon:"coffee",method:"POST",url:"/",paramName:"file",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"},uploadMultiple:!1,successCallback:null,beforeSendingCallback:null,removeFileCallback:null,afterDropCallback:null,pluginOptions:{},maxFiles:null,fadeOutDuration:200,fadeOutDelay:1500,showOverlay:!0,overlayContainer:"body",keepFilesAfterSuccess:!1,skin:"",dropzoneEnabled:!0,cancelUploadOnOverlayClose:!1,maxFilesize:256,fileTooBigKey:"husky.upload.error.file-to-big"},t={overlayClass:"dropzone-overlay",contianerClass:"husky-dropzone",descriptionClass:"description",loaderClass:"dropzone-loader",uploadedItemContainerClass:"upload-items",uploadItemClass:"item",droppedClass:"dropped"},n={basic:['<div class="dropzone-container">','   <div class="'+t.descriptionClass+'">','<div class="fa-<%= icon %> icon"></div>','<span class="title"><%= title %></span>','<span class="addition"><%= description %></span>',"   </div>",'   <div class="'+t.uploadedItemContainerClass+'"></div>',"</div>"].join(""),uploadItem:['<div class="'+t.uploadItemClass+'">'+'<div class="loading-content">','<div class="fa-<%= cancelIcon %> icon" data-dz-remove></div>','<div class="file-size" data-dz-size></div>','<div class="progress">','<div class="bar" data-dz-uploadprogress></div>',"</div>","</div>",'<div class="success-content">','<div class="image">',"<img data-dz-thumbnail />","</div>",'<div class="fa-check tick"></div>',"</div>","</div>"].join("")},r="husky.dropzone.",i=function(){return m.call(this,"initialized")},s=function(){return m.call(this,"uploading")},o=function(){return m.call(this,"success")},u=function(){return m.call(this,"error.file-to-big",!0)},a=function(){return m.call(this,"error",!0)},f=function(){return m.call(this,"open-data-source")},l=function(){return m.call(this,"show-popup")},c=function(){return m.call(this,"files-added")},h=function(){return m.call(this,"change-url")},p=function(){return m.call(this,"enable")},d=function(){return m.call(this,"disable")},v=function(){return m.call(this,"add-image")},m=function(e,t){return[r,!t&&this.options.instanceName?this.options.instanceName+".":"",e].join("")},g=function(e){return e+".dropzone."+(this.options.instanceName?this.options.instanceName:"")};return{initialize:function(){this.sandbox.logger.log("initialize",this),this.options=this.sandbox.util.extend(!0,{},e,this.options),this.dropzone=null,this.dropzoneEnabled=this.options.dropzoneEnabled,this.$dropzone=null,this.$loader=null,this.lastUploadedFile=null,this.overlayOpened=!1,this.url=this.options.url,this.filesDropped=0,this.bindCustomEvents(),this.render(),this.bindDomEvents(),this.sandbox.emit(i.call(this))},destroy:function(){this.sandbox.stop(this.$loader),$("body").off(".dropzone"+this.options.instanceName),this.dropzone.destroy(),this.$dropzone.remove()},bindDomEvents:function(){this.$dropzone.find("."+t.descriptionClass).on("click",function(e){e.stopPropagation()}.bind(this)),this.options.showOverlay&&(this.sandbox.dom.on(this.sandbox.dom.$document,g.call(this,"dragenter"),function(){this.openOverlay()}.bind(this)),this.sandbox.dom.on(this.sandbox.dom.$document,g.call(this,"drop"),function(e){this.dropzoneEnabled&&this.addFiles(e.originalEvent.dataTransfer.files)}.bind(this)),this.$dropzone.on("click",function(){!this.options.cancelUploadOnOverlayClose||(this.sandbox.dom.removeClass(this.$dropzone,t.droppedClass),this.dropzone.removeAllFiles()),this.closeOverlay()}.bind(this))),this.sandbox.dom.on(this.sandbox.dom.$document,g.call(this,"dragover")+" "+g.call(this,"drop"),function(e){this.sandbox.dom.preventDefault(e)}.bind(this)),$("body").on("keydown.dropzone"+this.options.instanceName,function(e){e.keyCode===27&&this.closeOverlay()}.bind(this))},bindCustomEvents:function(){this.sandbox.on(f.call(this),function(){this.$dropzone.find("."+t.descriptionClass).trigger("click")}.bind(this)),this.sandbox.on(h.call(this),function(e){this.url=e}.bind(this)),this.sandbox.on(d.call(this),function(){this.dropzoneEnabled=!1,this.dropzone.disable()}.bind(this)),this.sandbox.on(p.call(this),function(){this.dropzoneEnabled=!0,this.dropzone.enable()}.bind(this)),this.options.showOverlay&&this.sandbox.on(l.call(this),function(){this.openOverlay()}.bind(this)),this.sandbox.on(v.call(this),this.addImage.bind(this))},addImage:function(e,t,n){this.sandbox.util.loadImageAsBlob(e,t).then(function(e){!n||(e.name=n),this.dropzone.addFile(e,t)}.bind(this))},openOverlay:function(){this.overlayOpened===!1&&!!this.dropzoneEnabled&&(this.$dropzone.show(),this.overlayOpened=!0)},closeOverlay:function(){this.overlayOpened===!0&&(this.$dropzone.hide(),this.overlayOpened=!1)},render:function(){this.$dropzone=this.sandbox.dom.createElement('<div class="'+t.contianerClass+'"/>'),this.sandbox.dom.html(this.$dropzone,this.sandbox.util.template(n.basic)({description:this.sandbox.translate(this.options.descriptionKey),title:this.sandbox.translate(this.options.titleKey),icon:this.options.descriptionIcon,instanceName:this.options.instanceName})),this.$dropzone.addClass(this.options.skin),!this.options.showOverlay||(this.$dropzone.addClass(t.overlayClass),this.$dropzone.hide()),!this.options.showOverlay||!this.options.overlayContainer?this.$el.append(this.$dropzone):$(this.options.overlayContainer).append(this.$dropzone),this.renderLoader(),this.startDropzone()},renderLoader:function(){this.$loader=$('<div class="'+t.loaderClass+'"/>'),this.$dropzone.prepend(this.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.$loader,size:"40px",color:"#ffffff"}}])},startDropzone:function(){var e=this,r={url:this.options.url,method:this.options.method,paramName:this.options.paramName,uploadMultiple:this.options.uploadMultiple,maxFiles:this.options.maxFiles,maxFilesize:this.options.maxFilesize,dictFileTooBig:this.sandbox.translate(this.options.fileTooBigKey),headers:this.options.headers,autoProcessQueue:!this.options.afterDropCallback,previewTemplate:this.sandbox.util.template(n.uploadItem)({cancelIcon:this.options.cancelLoadingIcon}),clickable:this.$dropzone.find("."+t.descriptionClass).get(0),previewsContainer:this.sandbox.dom.find("."+t.uploadedItemContainerClass,this.$dropzone)[0],init:function(){e.dropzone=this,this.on("drop",function(e){this.sandbox.dom.stopPropagation(e),this.filesDropped=e.dataTransfer.files.length}.bind(e)),this.on("addedfile",function(n){e.sandbox.dom.addClass(e.$dropzone,t.droppedClass),typeof e.options.afterDropCallback=="function"&&(this.files.length===e.filesDropped||e.filesDropped===0)&&e.options.afterDropCallback(n).then(function(){e.sandbox.util.foreach(this.files,function(t){e.sandbox.util.delay(this.processFile.bind(this,t),0)}.bind(this))}.bind(this)),e.sandbox.dom.on(n.previewElement,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(e))}),this.on("sending",function(e){typeof this.options.beforeSendingCallback=="function"?this.options.beforeSendingCallback(e):this.sandbox.emit(s.call(this),e)}.bind(e)),this.on("success",function(e,t){this.lastUploadedFile!==e&&(e.response=t,this.lastUploadedFile=e,typeof this.options.successCallback=="function"?this.options.successCallback(e,t):this.sandbox.emit(o.call(this),e,t),this.removeAllFiles(this.options.keepFilesAfterSuccess))}.bind(e)),this.on("removedfile",function(e){typeof this.options.removeFileCallback=="function"&&this.options.removeFileCallback(e)}.bind(e)),this.on("reset",function(){this.options.keepFilesAfterSuccess===!1&&this.sandbox.dom.removeClass(this.$dropzone,t.droppedClass)}.bind(e)),this.on("processing",function(){this.options.url=e.url}),this.on("error",function(t,n){this.removeFile(t),t.size/1024>e.options.maxFilesize||t.xhr&&t.xhr.status===413?e.sandbox.emit(u.call(this),e.getMessage.call(e,e.options.fileTooBigKey,t),t):e.sandbox.emit(a.call(this),n,t)})}};r=this.sandbox.util.extend(!0,{},r,this.options.pluginOptions),this.sandbox.dropzone.initialize(this.$dropzone,r)},getMessage:function(e,t){return this.sandbox.translate(e).replace("{{filesize}}",Math.round(t.size/1048576*100)/100).replace("{{maxFilesize}}",this.options.maxFilesize).replace("{{filename}}",this.sandbox.util.cropMiddle(t.name,20))},addFiles:function(e){this.sandbox.util.each(e,function(e,t){this.dropzone.addFile(t)}.bind(this))},removeAllFiles:function(e){this.dropzone.getUploadingFiles.call(this.dropzone).length===0&&(e===!0?this.afterFadeOut(!0):this.sandbox.util.delay(function(){this.sandbox.dom.fadeOut(this.sandbox.dom.find("."+t.uploadItemClass,this.$dropzone),this.options.fadeOutDuration,function(){this.sandbox.dom.find("."+t.uploadItemClass+":animated",this.$dropzone).length===0&&this.afterFadeOut()}.bind(this))}.bind(this),this.options.fadeOutDelay))},afterFadeOut:function(e){this.closeOverlay(),this.sandbox.emit(c.call(this),this.getResponseArray(this.dropzone.files)),this.filesDropped=0,e===!0?this.dropzone.files=[]:(this.sandbox.dom.removeClass(this.$dropzone,t.droppedClass),this.dropzone.removeAllFiles())},getResponseArray:function(e){var t=[],n,r;for(n=-1,r=e.length;++n<r;)t.push(e[n].response);return t},remove:function(){this.dropzone.disable(),this.dropzone.destroy(),this.sandbox.dom.off(this.sandbox.dom.$document,g.call(this,"dragenter")),this.sandbox.dom.off(this.sandbox.dom.$document,g.call(this,"drop")),this.sandbox.dom.off(this.sandbox.dom.$document,g.call(this,"dragover"))}}}),define("__component__$input@husky",[],function(){"use strict";var e={instanceName:"undefined",inputId:"",inputName:"",value:"",placeholder:"",disabled:!1,skin:null,datepickerOptions:{orientation:"auto",startDate:-Infinity,endDate:Infinity,todayHighlight:!0},colorPickerOptions:{},lockOptions:{locked:!1},frontIcon:null,frontText:null,frontHtml:null,backIcon:null,backText:null,backHtml:null,renderMethod:null,inputType:"text"},t={componentClass:"husky-input",frontClass:"front",backClass:"back",textClass:"text",inputClass:"input",actionClass:"action",colorFieldClass:"color-field",colorpickerClass:"colorpicker",datepickerClass:"pickdate",linkClickableClass:"clickable",lockIconClass:"fa-lock",unlockIconClass:"fa-unlock"},n={input:'<input type="<%= type %>" value="<%= value %>" placeholder="<%= placeholder %>" id="<%= id %>" name="<%= name %>" data-from="false" <%= disabled %>/>',colorPickerFront:'<div class="'+t.colorFieldClass+'"/>'},r={colorpicker:function(){this.renderColorPicker()},datepicker:function(){this.renderDatePicker()},time:function(){this.renderTime()},url:function(){this.renderLink("http://")},email:function(){this.renderLink("mailto:")},lock:function(){this.renderLock()}},i={lock:function(e){this.lockClickedCallback(e)}},s={color:{frontHtml:n.colorPickerFront,renderMethod:"colorpicker"},phone:{frontIcon:"phone"},password:{frontIcon:"key",inputType:"password"},url:{frontText:"http://",renderMethod:"url"},email:{frontIcon:"envelope",renderMethod:"email"},date:{frontIcon:"calendar",renderMethod:"datepicker"},time:{frontIcon:"clock-o",placeholder:"HH - MM",renderMethod:"time"},lock:{frontIcon:"lock",renderMethod:"lock"}},o="husky.input.",u=function(){return l.call(this,"initialized")},a=function(){return l.call(this,"locked")},f=function(){return l.call(this,"unlocked")},l=function(e){return o+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.sandbox.logger.log("initialize",this);var t=this.sandbox.util.extend(!0,{},e);!!this.options.skin&&!!s[this.options.skin]&&(t=this.sandbox.util.extend(!0,{},e,s[this.options.skin])),this.options=this.sandbox.util.extend(!0,{},t,this.options),this.input={$front:null,$input:null,$back:null},this.linkProtocol=null,this.render(),this.bindDomEvents(),this.sandbox.emit(u.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),!this.options.action||this.sandbox.dom.addClass(this.$el,t.actionClass),this.renderFront(),this.renderInput(),this.renderBack(),!!this.options.renderMethod&&!!r[this.options.renderMethod]&&r[this.options.renderMethod].call(this)},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"change",function(e){e.stopPropagation(),e.preventDefault(),this.$el.trigger("change")}.bind(this),"input"),this.sandbox.dom.on(this.$el.find("."+t.frontClass),"click",function(e){i.hasOwnProperty(this.options.skin)&&i[this.options.skin].call(this,e)}.bind(this)),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.dom.focus(this.input.$input)}.bind(this)),this.sandbox.dom.on(this.input.$input,"click",function(){this.sandbox.dom.focus(this.input.$input)}.bind(this)),!this.sandbox.dom.attr(this.$el,"id")||this.sandbox.dom.on('label[for="'+this.sandbox.dom.attr(this.$el,"id")+'"]',"click",function(){this.sandbox.dom.focus(this.input.$input)}.bind(this)),this.sandbox.dom.on(this.$el,"data-changed",function(){this.updateValue()}.bind(this))},renderFront:function(){if(!!this.options.frontIcon||!!this.options.frontText||!!this.options.frontHtml)this.input.$front=this.sandbox.dom.createElement('<div class="'+t.frontClass+'"/>'),this.options.frontIcon?this.sandbox.dom.html(this.input.$front,'<a class="fa-'+this.options.frontIcon+'"></a>'):this.options.frontText?this.sandbox.dom.html(this.input.$front,'<a class="'+t.textClass+'">'+this.options.frontText+"</a>"):this.sandbox.dom.html(this.input.$front,this.options.frontHtml),this.sandbox.dom.append(this.$el,this.input.$front)},renderInput:function(){var e=this.sandbox.dom.createElement('<div class="'+t.inputClass+'"/>');this.input.$input=this.sandbox.dom.createElement(this.sandbox.util.template(n.input)({type:this.options.inputType,name:this.options.inputName?this.options.inputName:"husky-input-"+this.options.instanceName,id:this.options.inputId?this.options.inputId:"husky-input-"+this.options.instanceName,value:this.options.value,placeholder:this.options.placeholder,disabled:this.options.disabled===!0?"disabled":""})),this.sandbox.dom.append(e,this.input.$input),this.sandbox.dom.append(this.$el,e)},renderBack:function(){if(!!this.options.backIcon||!!this.options.backText||!!this.options.backHtml)this.input.$back=this.sandbox.dom.createElement('<div class="'+t.backClass+'"/>'),this.options.backIcon?this.sandbox.dom.html(this.input.$back,'<span class="fa-'+this.options.backIcon+'"></span>'):this.options.backText?this.sandbox.dom.html(this.input.$back,'<span class="'+t.textClass+'">'+this.options.backText+"</span>"):this.sandbox.dom.html(this.input.$back,this.options.backHtml),this.sandbox.dom.append(this.$el,this.input.$back)},renderColorPicker:function(){this.sandbox.dom.addClass(this.$el,t.colorpickerClass),this.changeColorPreview(this.sandbox.dom.val(this.input.$input)),this.sandbox.colorpicker.init(this.input.$input,this.sandbox.util.extend(!0,{},{change:this.changeColorPreview.bind(this)},this.options.colorPickerOptions))},renderDatePicker:function(){this.sandbox.dom.addClass(this.$el,t.datepickerClass),this.options.placeholder||this.sandbox.dom.attr(this.input.$input,"placeholder",this.sandbox.globalize.getDatePattern()),!!this.options.datepickerOptions.startDate&&typeof this.options.datepickerOptions.startDate=="string"&&(this.options.datepickerOptions.startDate=new Date(this.options.datepickerOptions.startDate)),!!this.options.datepickerOptions.endDate&&typeof this.options.datepickerOptions.endDate=="string"&&(this.options.datepickerOptions.endDate=new Date(this.options.datepickerOptions.endDate)),this.sandbox.datepicker.init(this.input.$input,this.options.datepickerOptions).on("changeDate",function(e){this.setDatepickerValueAttr(e.date)}.bind(this)),this.updateValue(),this.bindDatepickerDomEvents()},renderLink:function(e){this.linkProtocol=e,this.sandbox.dom.on(this.input.$input,"keyup",this.changeFrontLink.bind(this)),this.changeFrontLink()},renderLock:function(){var e=this.options.lockOptions.locked;this.sandbox.dom.addClass(this.sandbox.dom.find("a",this.input.$front),t.linkClickableClass),this.renderLockIcon(),this.$el.data("locked",e)},lockClickedCallback:function(e){if(this.options.disabled===!0)return;var t=!this.options.lockOptions.locked;this.options.lockOptions.locked=t,this.sandbox.dom.prop(this.input.$input,"disabled",t),this.renderLockIcon(),this.$el.data("locked",t),t?(this.sandbox.emit(a.call(this)),e.stopPropagation()):this.sandbox.emit(f.call(this))},renderLockIcon:function(){var e=t.lockIconClass,n=t.unlockIconClass;this.options.lockOptions.locked&&(e=t.unlockIconClass,n=t.lockIconClass),this.exchangeFrontIconClass(n,e)},exchangeFrontIconClass:function(e,n){var r=this.sandbox.dom.find("a",this.input.$front);this.sandbox.dom.removeClass(r,n),this.sandbox.dom.addClass(r,e),this.sandbox.dom.hasClass(r,t.linkClickableClass)&&(this.sandbox.dom.removeClass(r,t.linkClickableClass),this.sandbox.dom.addClass(r,t.linkClickableClass))},changeFrontLink:function(){var e=this.sandbox.dom.val(this.input.$input);e?(this.sandbox.dom.addClass(this.sandbox.dom.find("a",this.input.$front),t.linkClickableClass),this.sandbox.dom.attr(this.sandbox.dom.find("a",this.input.$front),"href",this.linkProtocol+e),this.linkProtocol.indexOf("mailto")<0&&this.sandbox.dom.attr(this.sandbox.dom.find("a",this.input.$front),"target","_blank")):(this.sandbox.dom.removeClass(this.sandbox.dom.find("a",this.input.$front),t.linkClickableClass),this.sandbox.dom.removeAttr(this.sandbox.dom.find("a",this.input.$front),"href"))},bindDatepickerDomEvents:function(){this.sandbox.dom.on(this.input.$input,"focusout",function(){return this.setDatepickerValueAttr(this.sandbox.datepicker.getDate(this.input.$input)),!1}.bind(this))},renderTime:function(){this.sandbox.dom.attr(this.input.$input,"placeholder",this.sandbox.globalize.getTimePatter())},changeColorPreview:function(e){this.sandbox.dom.css(this.$find("."+t.colorFieldClass),{"background-color":e})},setValue:function(e){this.options.renderMethod==="colorpicker"?e?this.sandbox.colorpicker.value(this.input.$input,e):this.sandbox.dom.val(this.input.$input,e):this.options.renderMethod==="datepicker"?(!e||(e=this.isoToDate(e),e=new Date(e)),this.sandbox.datepicker.setDate(this.input.$input,e),this.setDatepickerValueAttr(this.sandbox.datepicker.getDate(this.input.$input))):(this.sandbox.dom.val(this.input.$input,e),(this.options.renderMethod==="email"||this.options.renderMethod==="url")&&this.changeFrontLink())},isoToDate:function(e){return e.indexOf("T")>0?e.substr(0,e.indexOf("T")):e},setDatepickerValueAttr:function(e){!e||(this.sandbox.dom.isNumeric(e.valueOf())?e=e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2):(e="",this.sandbox.dom.val(this.input.$input,""))),this.sandbox.dom.data(this.$el,"value",e)},updateValue:function(){this.setValue(this.sandbox.dom.data(this.$el,"value"))}}}),define("husky_components/data-navigation/list-view",[],function(){var e={list:function(){return['<ul class="data-navigation-items">',"   <% if (!!data.children && !!data.children.length) { %>",e.children(),"   <% } else if (!!data.children && data.children.length === 0) { %>",'       <li class="not-selectable">','           <div class="data-navigation-info data-navigation-info-empty">','               <div class="fa-coffee icon"></div>',"               <span><%=options.translates.noData%></span>","           </div>","       </li>","   <% } else { %>",'       <li class="not-selectable">','           <div class="data-navigation-loader-container">','               <div class="spinner">','                   <div class="double-bounce1" style="background-color: rgb(204, 204, 204);"></div>','                   <div class="double-bounce2" style="background-color: rgb(204, 204, 204);"></div>',"               </div>","           </div>","       </li>","   <% } %>","</ul>"].join("")},children:function(){return["       <% _.each(data.children, function(child) { %>",'           <li data-id="<%= child.id %>" class="data-navigation-item">',"               <% if (!!child.preview && !child.locked) { %>",'                   <div class="data-navigation-item-thumb" style="background-image: url(\'<%=child.preview.url%>\')"></div>',"               <% } else { %>",'                   <div class="<% if(!child.locked) { %>fa-coffee<% } else { %>fa-lock<% } %> data-navigation-item-thumb" style="margin-top: 10px;padding-left: 10px;"></div>',"               <% } %>",'               <div class="data-navigation-item-name">',"                   <%= child[options.nameKey] %>","                   <% if (!!child.hasSub) { %>",'                       <span class="fa-chevron-right data-navigation-item-next"></span>',"                   <% } %>","               </div>","           </li>","       <% }) %>"].join("")}};return function(){return{init:function(){return this.template=_.template(e.list()),this.children=_.template(e.children()),this.$el=$("<div/>",{"class":"data-navigation-list"}),this},destroy:function(){return this.$el.off(),this.$el.remove(),this.$el=null,this},render:function(e,t){e=e||{};var n=this.template({data:e,options:t});return this.$el.html(n),this},append:function(e,t){var n=this.children({data:{children:e},options:t});this.$el.find("ul").append(n)},placeAt:function(e){return $(e).append(this.$el),this}}}}),define("__component__$data-navigation@husky",["husky_components/data-navigation/list-view"],function(e){"use strict";var t={url:null,rootUrl:null,resultKey:"items",parentResultKey:"parent",nameKey:"name",childrenLinkKey:"children",pageKey:"page",limitKey:"limit",searchKey:"search",limit:20,showAddButton:!0,globalEvents:!0,locale:null,translates:{noData:"No Data",title:"Data",addButton:"Add Data",search:"Search ..."}},n={header:function(){return['<div class="header-item data-navigation-back" style="display: none;">','    <div class="icon-container"><span class="fa-chevron-left"/></div>',"</div>",'<div class="header-item data-navigation-search" style="display: none;">','    <div class="icon-container"><span class="fa-search fa-flip-horizontal"/></div>','    <div class="content-container">','        <div class="search-container"/>',"    </div>","</div>","<% if (!!options.showAddButton) { %>",'   <div class="header-item ',r.addButtonClass,'">','       <div class="icon-container"><span class="fa-plus-circle"/></div>','       <div class="content-container">','           <span class="add-container"><%= options.translates.addButton %></span>',"       </div>","   </div>","<% } %>",'<div class="header-item header-filler"/>'].join("")},main:function(){return['<div class="data-navigation">','   <div class="data-navigation-header"></div>','   <div class="data-navigation-list-container iscroll">','       <div class="data-navigation-list-scroll iscroll-inner"></div>','       <div class="loader"></div>',"   </div>","</div>"].join("")}},r={ROOT_ID:"root",addButtonClass:"data-navigation-add"},i="husky.data-navigation.",s=function(e){return i+(this.options.instanceName?this.options.instanceName+".":"")+e},o=function(){return s.call(this,"initialized")},u=function(){return s.call(this,"select")},a=function(){return s.call(this,"selected")},f=function(){return i+"selected"},l=function(){return s.call(this,"add")},c=function(){return s.call(this,"add-button.hide")},h=function(){return s.call(this,"add-button.show")},p=function(){return s.call(this,"navigate")},d=function(){return s.call(this,"set-url")},v=function(){return s.call(this,"set-locale")},m=function(){return s.call(this,"reload")},g=function(){return s.call(this,"clear-cache")};return{page:1,loading:!1,initialize:function(){this.currentView=null,this.locale=null,this.cache=this.sandbox.cacheFactory.create(),this.options=this.sandbox.util.extend(!0,{},t,this.options),this.mainTpl=this.sandbox.util.template(n.main()),this.headerTpl=this.sandbox.util.template(n.header()),this.whenLocaleReceived=$.Deferred(),!this.options.locale||(this.locale=this.options.locale,this.whenLocaleReceived.resolve()),this.render(),this.bindCustomEvents(),this.bindDOMEvents(),this.sandbox.once("husky.loader.initialized",function(){this.showLoader(),this.whenLocaleReceived.then(function(){this.load().then(function(e){this.hideLoader(),this.sandbox.emit(o.call(this)),this.currentView=this.createView(e),this.updateHeader(e),this.storeData(e),this.appendView()}.bind(this))}.bind(this))}.bind(this))},setLocale:function(e){this.locale=e,this.whenLocaleReceived.resolve()},remove:function(){this.cache.destroy(),this.sandbox.infiniteScroll.destroy(".iscroll")},render:function(){var e=this.mainTpl({options:this.options});this.$el.html(e);var t=this.headerTpl({options:this.options});this.$el.find(".data-navigation-header").html(t),this.sandbox.start([{name:"loader@husky",options:{el:this.sandbox.dom.find(".loader",this.$el),color:"#ccc"}}]),this.startInfiniteScroll(),this.startSearch()},startSearch:function(){this.sandbox.start([{name:"search@husky",options:{el:this.sandbox.dom.find(".search-container",this.$el),appearance:"white",instanceName:"data-navigation",placeholderText:this.options.translates.search}}])},updateHeader:function(e){if(e.current.id!=="root"){$(".data-navigation-back").show();var t=e.parent?e.parent.id:"root";this.sandbox.dom.data($(".data-navigation-back"),"parent-id",t)}else $(".data-navigation-back").hide();e.children.length===0&&!this.searchTerm?$(".data-navigation-search").hide():$(".data-navigation-search").show()},startInfiniteScroll:function(){this.sandbox.infiniteScroll.initialize(".iscroll",this.loadNextPage.bind(this))},loadNextPage:function(){var e=this.sandbox.data.deferred();return!!this.data.hasNextPage&&!this.loading?(this.showLoader(),this.page+=1,this.sandbox.util.load(this.getUrl(this.getCurrentUrl()),{locale:this.locale}).then(function(t){var n=t._embedded[this.options.resultKey]||[];this.data.children=this.data.children.concat(n),this.data.hasNextPage=this.page<t.pages,this.currentView.append(n,this.options),this.hideLoader(),e.resolve()}.bind(this))):e.resolve(),e},bindDOMEvents:function(){this.$el.on("click",".data-navigation-item",this.selectChildrenDataHandler.bind(this)),this.$el.on("click",".data-navigation-item-thumb",this.selectChildrenDataHandler.bind(this)),this.$el.on("click",".data-navigation-back",this.selectParentDataHandler.bind(this)),this.$el.on("click",".data-navigation-add",this.addHandler.bind(this)),this.$el.on("click",".data-navigation-search > .icon-container",function(){$(".data-navigation-header").hasClass("header-search")?this.clearSearch():($(".data-navigation-header").addClass("header-search"),$(".data-navigation-search .icon-container span").attr("class","fa-times"),$(".data-navigation-search input").select())}.bind(this))},bindCustomEvents:function(){this.sandbox.on(d.call(this),function(e){e!==this.getCurrentUrl?this.setUrl(e,!0):this.cache.deleteAll()}.bind(this)),this.sandbox.on(v.call(this),this.setLocale.bind(this)),this.sandbox.on(u.call(this),function(e){this.showChildren(e)}.bind(this)),this.sandbox.on(h.call(this),this.showAddButton.bind(this)),this.sandbox.on(c.call(this),this.hideAddButton.bind(this)),this.sandbox.on(m.call(this),function(e){this.setUrl(this.getCurrentUrl(),!0,e)}.bind(this)),this.sandbox.on(g.call(this),function(){this.cache.deleteAll()}.bind(this)),this.sandbox.on("husky.search.data-navigation",function(e){this.searchTerm=e,this.setUrl(this.getCurrentUrl(),!0)}.bind(this)),this.sandbox.on("husky.search.data-navigation.reset",function(){this.searchTerm=null,this.setUrl(this.getCurrentUrl(),!0)}.bind(this))},getCurrentUrl:function(){var e=this.options.rootUrl;return!this.data.current.item||(e=this.data.current.item._links[this.options.childrenLinkKey].href),e},setUrl:function(e,t,n){!t||this.cache.deleteAll(),this.load(e).then(this.storeData.bind(this)).then(function(e){this.updateHeader(e),this.currentView.render(e,this.options),typeof n=="function"&&n.call(this)}.bind(this))},load:function(e){return this.page=1,this.loading=!0,this.sandbox.util.load(this.getUrl(e),{locale:this.locale}).then(this.parse.bind(this)).then(function(e){return this.loading=!1,e}.bind(this))},hideLoader:function(){this.sandbox.dom.hide(this.sandbox.dom.find(".loader",this.$el))},showLoader:function(){this.sandbox.dom.show(this.sandbox.dom.find(".loader",this.$el))},clearSearch:function(){$(".data-navigation-header").removeClass("header-search"),$(".data-navigation-search .icon-container span").attr("class","fa-search fa-flip-horizontal"),this.sandbox.emit("husky.search.data-navigation.clear"),!this.searchTerm||(this.sandbox.emit("husky.search.data-navigation.reset"),this.searchTerm=null)},getUrl:function(e){e=e||this.options.url||this.options.rootUrl;var t=e.indexOf("?")===-1?"?":"&";return e=[e,t,this.options.pageKey,"=",this.page,"&",this.options.limitKey,"=",this.options.limit].join(""),!this.searchTerm||(e=[e,"&",this.options.searchKey,"=",this.searchTerm].join("")),e},parse:function(e){var t={item:e},n=e._embedded.parent;return t.id=e.id||r.ROOT_ID,t.name=e[this.options.nameKey],n?n.id=n.id||r.ROOT_ID:t.id===r.ROOT_ID&&(t.item=null),this.data={children:e._embedded[this.options.resultKey]||null,parent:n,current:t,hasNextPage:!0},this.data},storeData:function(e){var t=e.current;return this.searchTerm||this.cache.put(t.id,e),e},getItems:function(e){var t=$.Deferred(),n=this.cache.get(e),i,s;return n?(this.data=n,t.resolve(n),t.promise()):(e===r.ROOT_ID||e==null?this.data.parent?s=this.data.parent._links[this.options.childrenLinkKey].href:s=this.options.rootUrl:(i=_.where(this.data.children,{id:e})[0],!i&&!!this.data.parent&&this.data.parent.id===e&&(i=this.data.parent),s=i._links[this.options.childrenLinkKey].href),this.load(s).then(this.storeData.bind(this)))},getItem:function(e){return _.where(this.data.children,{id:e})[0]},showChildren:function(e){var t=this.currentView;return this.clearSearch(),this.currentView=this.createView(),this.appendView(t),this.getItems(e).then(function(e){this.updateHeader(e),this.currentView.render(e,this.options)}.bind(this))},openChildrenHandler:function(e){return this.showChildren($(e.currentTarget).closest("li").data("id"))},openParentHandler:function(e){var t=$(e.currentTarget).closest(".data-navigation-back"),n=this.sandbox.dom.data(t,"parent-id"),r=this.createView();return this.clearSearch(),this.prependView(r),this.getItems(n).then(function(e){this.updateHeader(e),r.render(e,this.options)}.bind(this))},selectParentDataHandler:function(e){e.stopPropagation(),this.sandbox.emit(a.call(this),this.data.parent),this.options.globalEvents&&this.sandbox.emit(f.call(this),this.data.parent),this.openParentHandler(e)},navigateParentDataHandler:function(e){e.stopPropagation(),this.openParentHandler(e)},selectChildrenDataHandler:function(e){e.stopPropagation();var t=$(e.currentTarget).closest("li"),n=t.data("id"),r=this.getItem(n);this.sandbox.emit(a.call(this),r),this.options.globalEvents&&this.sandbox.emit(f.call(this),r),this.openChildrenHandler(e)},navigateChildrenHandler:function(e){e.stopPropagation();var t=$(e.currentTarget).closest("li"),n=t.data("id"),r=this.getItem(n);this.sandbox.emit(p.call(this),r),this.openChildrenHandler(e)},addHandler:function(){this.sandbox.emit(l.call(this),this.data.current.item)},showAddButton:function(){$("."+r.addButtonClass).show()},hideAddButton:function(){$("."+r.addButtonClass).hide()},createView:function(t){var n=(new e(this.options)).init();return n.render(t,this.options)},appendView:function(e){!e||(this.currentView.$el.addClass("is-animated"),this.playAppendAnimation(e)),this.currentView.placeAt(".data-navigation-list-container .iscroll-inner")},playAppendAnimation:function(e){this.currentView.$el.css({left:"100%"}).animate({left:"0%"},{duration:250,done:function(){e.destroy(),this.currentView.$el.removeClass("is-animated")}.bind(this)})},prependView:function(e){e.placeAt(".data-navigation-list-container .iscroll-inner"),this.currentView.$el.addClass("is-animated"),this.playPrependAnimation(e)},playPrependAnimation:function(e){var t=this.currentView;this.currentView=e,t.$el.stop().css({left:"0%"}).animate({left:"100%"},{duration:250,done:function(){t.destroy()}.bind(this)})}}}),define("__component__$url-input@husky",["services/husky/url-validator"],function(e){var t={instanceName:"url-input",inputClass:"",scheme:"http://",specificPart:""},n={triggerClass:"drop-down-trigger",toggleClass:"dropdown-toggle",schemeClass:"scheme",specificPartClass:"specific-part-input",linkClass:"link",dataKey:"url-data",dataChangedEvent:"data-changed"},r={skeleton:['<div class="front">','    <a class="<%= constants.schemeClass %> <%= constants.linkClass %> text text-link"','       href="<%= url %>" target="_blank"><%= data.scheme %></a>',"<% if (items.length > 1) { %>",'    <span class="<%= constants.triggerClass %>">','        <span class="<%= constants.toggleClass %>" style="display: inline-block;"/>',"    </span>","<% } %>","</div>",'<div class="input">','    <input type="text"','           class="<%= constants.specificPartClass %> <%= options.inputClass %>" ','           value="<%= data.specificPart %>"/>',"</div>"].join("")};return{initialize:function(){if(!this.options.schemes||this.options.schemes.length===0)this.options.schemes=e.getDefaultSchemes();this.options=this.sandbox.util.extend(!0,{},t,this.options),this.getData()===undefined&&this.setData({scheme:this.options.scheme,specificPart:this.options.specificPart}),this.prepareItems(this.options.schemes),this.render(),this.bindDomEvents()},prepareItems:function(e){this.items=this.sandbox.util.arrayMap(e,function(e){return{id:e,name:e}}.bind(this))},render:function(){this.$el.addClass("husky-input");var e=this.getData();this.html(this.sandbox.util.template(r.skeleton,{constants:n,options:this.options,url:this.getUrl(e),data:e,items:this.items})),this.sandbox.start([{name:"dropdown@husky",options:{el:this.$find(".front"),trigger:this.$find("."+n.triggerClass),instanceName:n.instanceName,data:this.items,clickCallback:this.selectSchemeHandler.bind(this)}}])},bindDomEvents:function(){this.sandbox.dom.on(this.$find("."+n.linkClass),"click",this.linkHandler.bind(this)),this.sandbox.dom.on(this.$find("."+n.specificPartClass),"focusout",this.specificPartChangedHandler.bind(this)),this.sandbox.dom.on(this.$el,n.dataChangedEvent,this.dataChangedHandler.bind(this))},linkHandler:function(){var e=this.getData(),t=this.getUrl(e);if(!t)return!1},specificPartChangedHandler:function(t){this.sandbox.dom.stopPropagation(t);var r=this.$find("."+n.specificPartClass),i=r.val(),s=e.match(i,this.options.schemes),o={specificPart:i};!s||(o.scheme=s.scheme,o.specificPart=s.specificPart),this.setData(o),this.dataChangedHandler()},dataChangedHandler:function(){var e=this.getData();this.$find("."+n.specificPartClass).val(e.specificPart),this.$find("."+n.schemeClass).html(e.scheme),this.$find("."+n.schemeClass).attr("href",this.getUrl(e))},selectSchemeHandler:function(e){this.setData({scheme:e.id}),this.dataChangedHandler()},setData:function(e){var t=this.sandbox.util.extend(!0,{},this.$el.data(n.dataKey),e);return this.$el.data(n.dataKey,t),this.$el.trigger("change"),t},getUrl:function(e){return!e||!e.scheme||!e.specificPart?null:e.scheme+e.specificPart},getData:function(){return this.$el.data(n.dataKey)}}}),function(){"use strict";window.Backbone?define("backbone",[],function(){return window.Backbone}):require.config({paths:{backbone:"bower_components/backbone/backbone"},shim:{backbone:{exports:"Backbone",deps:["underscore","jquery"]}}}),define("husky_extensions/backbone",["backbone"],{name:"Backbone",initialize:function(e){var t=e.core,n=e.sandbox,r=e.sandbox.util._,i={};t.mvc=require("backbone"),n.mvc={},n.mvc.routes=[],n.mvc.Router=function(e){return t.mvc.Router.extend(e)},n.mvc.View=function(e){return t.mvc.View.extend(e)},n.mvc.Model=function(e){return t.mvc.Model.extend(e)},n.mvc.Collection=function(e){return t.mvc.Collection.extend(e)},n.mvc.history=t.mvc.history,define("mvc/view",function(){return n.mvc.View}),define("mvc/model",function(){return n.mvc.Model}),define("mvc/collection",function(){return n.mvc.Collection}),e.components.before("initialize",function(e){if(!this)throw new Error("Missing context!");if(!!this.view){var t=i[e.ref],s;t||(s=r.pick(this,"model","collection","id","attributes","className","tagName","events"),i[e.ref]=t=n.mvc.View(s)),this.view=new t({el:this.$el}),this.view.sandbox=this.sandbox,this.view.parent=this}}),e.components.before("remove",function(){if(!this)throw new Error("Missing context!");this.view&&this.view.stopListening()})},afterAppStart:function(e){e.sandbox.util._.delay(function(){e.core.mvc.History.started||e.core.mvc.history.start()},250)}})}(),function(){"use strict";define("husky_extensions/cache-factory",[],{name:"cacheFactory",initialize:function(e){function n(e){var n={};return{get:function(e){return n[e]||null},put:function(e,t){return n[e]=t,t},"delete":function(e){delete n[e]},deleteAll:function(){n={}},destroy:function(){delete t[e]}}}var t={};e.sandbox.cacheFactory={create:function(r){r=r||e.core.util.uniqueId("cache");if(r in t)throw new Error("cacheId already exists.");return t[r]=new n(r)},get:function(e){return t[e]}}}})}(),function(){"use strict";require.config({paths:{ckeditor:"bower_components/ckeditor/ckeditor",jqueryAdapter:"bower_components/ckeditor/adapters/jquery",pasteFromWordPlugin:"husky_components/ckeditor/plugins/paste-from-word/plugin"},shim:{jqueryAdapter:{deps:["jquery","ckeditor"]}}}),define("husky_extensions/ckeditor-extension",["underscore","services/husky/util","pasteFromWordPlugin","ckeditor","jqueryAdapter"],function(e,t,n){function i(e){this.toolbar=e}var r=function(){return{format_tags:"p;h1;h2;h3;h4;h5;h6",width:"100%",defaultLanguage:"en",removeButtons:"",removePlugins:"elementspath,magicline",removeDialogTabs:"image:advanced;link:advanced",allowedContent:!0,resize_enabled:!1,enterMode:"P",uiColor:"#ffffff",skin:"husky"}};return i.prototype.add=function(e,t){this.toolbar[e]||(this.toolbar[e]=[]),this.toolbar[e]=this.toolbar[e].concat(t)},i.prototype.remove=function(t,n){this.toolbar[t]||(this.toolbar[t]=[]),this.toolbar[t]=e.difference(this.toolbar[t],n)},i.prototype.get=function(){return e.map(this.toolbar,function(e,t){return{name:t,items:e}})},i.getRaw=function(){return this.toolbar},{name:"ckeditor",initialize:function(e){var s={semantics:["Format"],basicstyles:["Superscript","Subscript","Italic","Bold","Underline","Strike"],blockstyles:["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],list:["NumberedList","BulletedList"],links:["Link"],insert:["Table"],styles:["Styles"],code:["Source"]},o,u=["justify","format","sourcearea","link","table","autogrow"],a={Format:"font",Strike:"strikethrough",JustifyLeft:"align-left",JustifyCenter:"align-center",JustifyRight:"align-right",JustifyBlock:"align-justify",NumberedList:"list-ol",BulletedList:"list",PasteFromWord:"clipboard",Styles:"header",Source:"code"},f={Link:["Unlink"]},l=function(e){var n={},r;return t.each(e,function(e,i){r=[],t.foreach(i,function(e){r.push(e),!f[e]||(r=r.concat(f[e]))}.bind(this)),n[e]=r}.bind(this)),n};e.sandbox.ckeditor={addPlugin:function(e,t){u.push(e),!t||CKEDITOR.plugins.add(e,t)},addToolbarButton:function(e,t,n,r){s[e]||(s[e]=[]),s[e].push(t),!n||(a[t]=n),f[t]=r},setToolbar:function(e){o=t.deepCopy(e)},getAvailableToolbarSections:function(){return t.deepCopy(s)},getToolbar:function(){return o?l(o):l(this.getAvailableToolbarSections())},getIcon:function(e){return a.hasOwnProperty(e)?a[e]:e.toLowerCase()},getToolbarBuilder:function(){return new i(this.getToolbar())},createToolbarBuilder:function(e){var t={};for(var n=0,r=e.length;n<r;++n)t[e[n].name]=e[n].items;return new i(t)},init:function(t,n,i){var s=e.sandbox.util.extend(!0,{},r.call(),i),o;return s.extraPlugins=u.join(","),!n||typeof n!="function"?o=$(t).ckeditor(s):o=$(t).ckeditor(n,s),CKEDITOR.on("dialogDefinition",function(e){var t=e.data.name,n=e.data.definition;if(t=="link"){var r=n.getContents("info"),i=n.getContents("target"),s=r.get("linkType"),o=i.get("linkTargetType"),u=["url","email"],a=[],f=["notSet","_blank","_self"],l=[];for(var c=0;c<s.items.length;c++)u.indexOf(s.items[c][1])!==-1&&a.push(s.items[c]);for(var c=0;c<o.items.length;c++)f.indexOf(o.items[c][1])!==-1&&l.push(o.items[c]);s.items=a,o.items=l}}),o.editor},getInstance:function(e){var t=CKEDITOR.instances[e];if(!!t)return t}},e.sandbox.ckeditor.addPlugin("huskyPasteFromWord",new n(e.sandboxes.create("plugin-paste-from-word"))),e.sandbox.ckeditor.addToolbarButton("paste","PasteFromWord")}}})}(),define("husky_extensions/collection",[],function(){"use strict";var e={byId:{},objs:[],add:function(e){this.byId[e.id]=e,this.objs.push(e)},get:function(e){return this.byId[e.id||e]}};return{name:"Collection",initialize:function(t){t.sandbox.data.Collection=e}}}),function(e){typeof define=="function"&&define.amd?define("jquery-minicolors",["jquery"],e):typeof exports=="object"?module.exports=e(require("jquery")):e(jQuery)}(function(e){function t(t,n){var r=e('<div class="minicolors" />'),i=e.minicolors.defaults;if(t.data("minicolors-initialized"))return;n=e.extend(!0,{},i,n),r.addClass("minicolors-theme-"+n.theme).toggleClass("minicolors-with-opacity",n.opacity).toggleClass("minicolors-no-data-uris",n.dataUris!==!0),n.position!==undefined&&e.each(n.position.split(" "),function(){r.addClass("minicolors-position-"+this)}),t.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",n).prop("size",7).wrap(r).after('<div class="minicolors-panel minicolors-slider-'+n.control+'">'+'<div class="minicolors-slider minicolors-sprite">'+'<div class="minicolors-picker"></div>'+"</div>"+'<div class="minicolors-opacity-slider minicolors-sprite">'+'<div class="minicolors-picker"></div>'+"</div>"+'<div class="minicolors-grid minicolors-sprite">'+'<div class="minicolors-grid-inner"></div>'+'<div class="minicolors-picker"><div></div></div>'+"</div>"+"</div>"),n.inline||(t.after('<span class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color"></span></span>'),t.next(".minicolors-swatch").on("click",function(e){e.preventDefault(),t.focus()})),t.parent().find(".minicolors-panel").on("selectstart",function(){return!1}).end(),n.inline&&t.parent().addClass("minicolors-inline"),u(t,!1),t.data("minicolors-initialized",!0)}function n(e){var t=e.parent();e.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),t.before(e).remove()}function r(e){var t=e.parent(),n=t.find(".minicolors-panel"),r=e.data("minicolors-settings");if(!e.data("minicolors-initialized")||e.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus"))return;i(),t.addClass("minicolors-focus"),n.stop(!0,!0).fadeIn(r.showSpeed,function(){r.show&&r.show.call(e.get(0))})}function i(){e(".minicolors-focus").each(function(){var t=e(this),n=t.find(".minicolors-input"),r=t.find(".minicolors-panel"),i=n.data("minicolors-settings");r.fadeOut(i.hideSpeed,function(){i.hide&&i.hide.call(n.get(0)),t.removeClass("minicolors-focus")})})}function s(e,t,n){var r=e.parents(".minicolors").find(".minicolors-input"),i=r.data("minicolors-settings"),s=e.find("[class$=-picker]"),u=e.offset().left,a=e.offset().top,f=Math.round(t.pageX-u),l=Math.round(t.pageY-a),c=n?i.animationSpeed:0,h,p,d,v;t.originalEvent.changedTouches&&(f=t.originalEvent.changedTouches[0].pageX-u,l=t.originalEvent.changedTouches[0].pageY-a),f<0&&(f=0),l<0&&(l=0),f>e.width()&&(f=e.width()),l>e.height()&&(l=e.height()),e.parent().is(".minicolors-slider-wheel")&&s.parent().is(".minicolors-grid")&&(h=75-f,p=75-l,d=Math.sqrt(h*h+p*p),v=Math.atan2(p,h),v<0&&(v+=Math.PI*2),d>75&&(d=75,f=75-75*Math.cos(v),l=75-75*Math.sin(v)),f=Math.round(f),l=Math.round(l)),e.is(".minicolors-grid")?s.stop(!0).animate({top:l+"px",left:f+"px"},c,i.animationEasing,function(){o(r,e)}):s.stop(!0).animate({top:l+"px"},c,i.animationEasing,function(){o(r,e)})}function o(e,t){function n(e,t){var n,r;return!e.length||!t?null:(n=e.offset().left,r=e.offset().top,{x:n-t.offset().left+e.outerWidth()/2,y:r-t.offset().top+e.outerHeight()/2})}var r,i,s,o,u,f,l,h=e.val(),d=e.attr("data-opacity"),v=e.parent(),g=e.data("minicolors-settings"),y=v.find(".minicolors-swatch"),b=v.find(".minicolors-grid"),w=v.find(".minicolors-slider"),E=v.find(".minicolors-opacity-slider"),S=b.find("[class$=-picker]"),x=w.find("[class$=-picker]"),T=E.find("[class$=-picker]"),N=n(S,b),C=n(x,w),k=n(T,E);if(t.is(".minicolors-grid, .minicolors-slider")){switch(g.control){case"wheel":o=b.width()/2-N.x,u=b.height()/2-N.y,f=Math.sqrt(o*o+u*u),l=Math.atan2(u,o),l<0&&(l+=Math.PI*2),f>75&&(f=75,N.x=69-75*Math.cos(l),N.y=69-75*Math.sin(l)),i=p(f/.75,0,100),r=p(l*180/Math.PI,0,360),s=p(100-Math.floor(C.y*(100/w.height())),0,100),h=m({h:r,s:i,b:s}),w.css("backgroundColor",m({h:r,s:i,b:100}));break;case"saturation":r=p(parseInt(N.x*(360/b.width()),10),0,360),i=p(100-Math.floor(C.y*(100/w.height())),0,100),s=p(100-Math.floor(N.y*(100/b.height())),0,100),h=m({h:r,s:i,b:s}),w.css("backgroundColor",m({h:r,s:100,b:s})),v.find(".minicolors-grid-inner").css("opacity",i/100);break;case"brightness":r=p(parseInt(N.x*(360/b.width()),10),0,360),i=p(100-Math.floor(N.y*(100/b.height())),0,100),s=p(100-Math.floor(C.y*(100/w.height())),0,100),h=m({h:r,s:i,b:s}),w.css("backgroundColor",m({h:r,s:i,b:100})),v.find(".minicolors-grid-inner").css("opacity",1-s/100);break;default:r=p(360-parseInt(C.y*(360/w.height()),10),0,360),i=p(Math.floor(N.x*(100/b.width())),0,100),s=p(100-Math.floor(N.y*(100/b.height())),0,100),h=m({h:r,s:i,b:s}),b.css("backgroundColor",m({h:r,s:100,b:100}))}e.val(c(h,g.letterCase))}t.is(".minicolors-opacity-slider")&&(g.opacity?d=parseFloat(1-k.y/E.height()).toFixed(2):d=1,g.opacity&&e.attr("data-opacity",d)),y.find("SPAN").css({backgroundColor:h,opacity:d}),a(e,h,d)}function u(e,t){var n,r,i,s,o,u,f,l=e.parent(),d=e.data("minicolors-settings"),v=l.find(".minicolors-swatch"),y=l.find(".minicolors-grid"),b=l.find(".minicolors-slider"),w=l.find(".minicolors-opacity-slider"),E=y.find("[class$=-picker]"),S=b.find("[class$=-picker]"),x=w.find("[class$=-picker]");n=c(h(e.val(),!0),d.letterCase),n||(n=c(h(d.defaultValue,!0),d.letterCase)),r=g(n),t||e.val(n),d.opacity&&(i=e.attr("data-opacity")===""?1:p(parseFloat(e.attr("data-opacity")).toFixed(2),0,1),isNaN(i)&&(i=1),e.attr("data-opacity",i),v.find("SPAN").css("opacity",i),o=p(w.height()-w.height()*i,0,w.height()),x.css("top",o+"px")),v.find("SPAN").css("backgroundColor",n);switch(d.control){case"wheel":u=p(Math.ceil(r.s*.75),0,y.height()/2),f=r.h*Math.PI/180,s=p(75-Math.cos(f)*u,0,y.width()),o=p(75-Math.sin(f)*u,0,y.height()),E.css({top:o+"px",left:s+"px"}),o=150-r.b/(100/y.height()),n===""&&(o=0),S.css("top",o+"px"),b.css("backgroundColor",m({h:r.h,s:r.s,b:100}));break;case"saturation":s=p(5*r.h/12,0,150),o=p(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height()),E.css({top:o+"px",left:s+"px"}),o=p(b.height()-r.s*(b.height()/100),0,b.height()),S.css("top",o+"px"),b.css("backgroundColor",m({h:r.h,s:100,b:r.b})),l.find(".minicolors-grid-inner").css("opacity",r.s/100);break;case"brightness":s=p(5*r.h/12,0,150),o=p(y.height()-Math.ceil(r.s/(100/y.height())),0,y.height()),E.css({top:o+"px",left:s+"px"}),o=p(b.height()-r.b*(b.height()/100),0,b.height()),S.css("top",o+"px"),b.css("backgroundColor",m({h:r.h,s:r.s,b:100})),l.find(".minicolors-grid-inner").css("opacity",1-r.b/100);break;default:s=p(Math.ceil(r.s/(100/y.width())),0,y.width()),o=p(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height()),E.css({top:o+"px",left:s+"px"}),o=p(b.height()-r.h/(360/b.height()),0,b.height()),S.css("top",o+"px"),y.css("backgroundColor",m({h:r.h,s:100,b:100}))}e.data("minicolors-initialized")&&a(e,n,i)}function a(e,t,n){var r=e.data("minicolors-settings"),i=e.data("minicolors-lastChange");if(!i||i.hex!==t||i.opacity!==n)e.data("minicolors-lastChange",{hex:t,opacity:n}),r.change&&(r.changeDelay?(clearTimeout(e.data("minicolors-changeTimeout")),e.data("minicolors-changeTimeout",setTimeout(function(){r.change.call(e.get(0),t,n)},r.changeDelay))):r.change.call(e.get(0),t,n)),e.trigger("change").trigger("input")}function f(t){var n=h(e(t).val(),!0),r=b(n),i=e(t).attr("data-opacity");return r?(i!==undefined&&e.extend(r,{a:parseFloat(i)}),r):null}function l(t,n){var r=h(e(t).val(),!0),i=b(r),s=e(t).attr("data-opacity");return i?(s===undefined&&(s=1),n?"rgba("+i.r+", "+i.g+", "+i.b+", "+parseFloat(s)+")":"rgb("+i.r+", "+i.g+", "+i.b+")"):null}function c(e,t){return t==="uppercase"?e.toUpperCase():e.toLowerCase()}function h(e,t){return e=e.replace(/[^A-F0-9]/ig,""),e.length!==3&&e.length!==6?"":(e.length===3&&t&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),"#"+e)}function p(e,t,n){return e<t&&(e=t),e>n&&(e=n),e}function d(e){var t={},n=Math.round(e.h),r=Math.round(e.s*255/100),i=Math.round(e.b*255/100);if(r===0)t.r=t.g=t.b=i;else{var s=i,o=(255-r)*i/255,u=(s-o)*(n%60)/60;n===360&&(n=0),n<60?(t.r=s,t.b=o,t.g=o+u):n<120?(t.g=s,t.b=o,t.r=s-u):n<180?(t.g=s,t.r=o,t.b=o+u):n<240?(t.b=s,t.r=o,t.g=s-u):n<300?(t.b=s,t.g=o,t.r=o+u):n<360?(t.r=s,t.g=o,t.b=s-u):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function v(t){var n=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];return e.each(n,function(e,t){t.length===1&&(n[e]="0"+t)}),"#"+n.join("")}function m(e){return v(d(e))}function g(e){var t=y(b(e));return t.s===0&&(t.h=360),t}function y(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),i=r-n;return t.b=r,t.s=r!==0?255*i/r:0,t.s!==0?e.r===r?t.h=(e.g-e.b)/i:e.g===r?t.h=2+(e.b-e.r)/i:t.h=4+(e.r-e.g)/i:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t}function b(e){return e=parseInt(e.indexOf("#")>-1?e.substring(1):e,16),{r:e>>16,g:(e&65280)>>8,b:e&255}}e.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",dataUris:!0,defaultValue:"",hide:null,hideSpeed:100,inline:!1,letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default"}},e.extend(e.fn,{minicolors:function(s,o){switch(s){case"destroy":return e(this).each(function(){n(e(this))}),e(this);case"hide":return i(),e(this);case"opacity":if(o===undefined)return e(this).attr("data-opacity");return e(this).each(function(){u(e(this).attr("data-opacity",o))}),e(this);case"rgbObject":return f(e(this),s==="rgbaObject");case"rgbString":case"rgbaString":return l(e(this),s==="rgbaString");case"settings":if(o===undefined)return e(this).data("minicolors-settings");return e(this).each(function(){var t=e(this).data("minicolors-settings")||{};n(e(this)),e(this).minicolors(e.extend(!0,t,o))}),e(this);case"show":return r(e(this).eq(0)),e(this);case"value":if(o===undefined)return e(this).val();return e(this).each(function(){u(e(this).val(o))}),e(this);default:return s!=="create"&&(o=s),e(this).each(function(){t(e(this),o)}),e(this)}}}),e(document).on("mousedown.minicolors touchstart.minicolors",function(t){e(t.target).parents().add(t.target).hasClass("minicolors")||i()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(t){var n=e(this);t.preventDefault(),e(document).data("minicolors-target",n),s(n,t,!0)}).on("mousemove.minicolors touchmove.minicolors",function(t){var n=e(document).data("minicolors-target");n&&s(n,t)}).on("mouseup.minicolors touchend.minicolors",function(){e(this).removeData("minicolors-target")}).on("mousedown.minicolors touchstart.minicolors",".minicolors-swatch",function(t){var n=e(this).parent().find(".minicolors-input");t.preventDefault(),r(n)}).on("focus.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;r(t)}).on("blur.minicolors",".minicolors-input",function(){var t=e(this),n=t.data("minicolors-settings");if(!t.data("minicolors-initialized"))return;t.val(h(t.val(),!0)),t.val()===""&&t.val(h(n.defaultValue,!0)),t.val(c(t.val(),n.letterCase))}).on("keydown.minicolors",".minicolors-input",function(t){var n=e(this);if(!n.data("minicolors-initialized"))return;switch(t.keyCode){case 9:i();break;case 13:case 27:i(),n.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;u(t,!0)}).on("paste.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;setTimeout(function(){u(t,!0)},1)})}),function(){"use strict";require.config({paths:{"jquery-minicolors":"bower_components/jquery-minicolors/jquery.minicolors"},shim:{backbone:{deps:["jquery"]}}}),define("husky_extensions/colorpicker",["jquery-minicolors"],{name:"minicolor",initialize:function(e){e.sandbox.colorpicker={init:function(t,n){return e.core.dom.$(t).minicolors(n)},value:function(t,n){return e.core.dom.$(t).minicolors("value",n)}}}})}(),function(){"use strict";define("husky_extensions/confirm",{name:"Confirm",initialize:function(e){e.sandbox.confirm={alert:function(t,n,r,i,s,o){var u=e.core.dom.createElement("<div/>"),o=o||"alert";e.core.dom.append(t.$el,u),t.sandbox.start([{name:"overlay@husky",options:{el:u,title:e.sandbox.translate(n),message:e.sandbox.translate(r),closeCallback:s,okCallback:i,type:o}}])}}}})}(),function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){function u(e,t){return t.toLowerCase()}var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])");n=new RegExp("^"+n.toLowerCase());for(var a in r)n.test(a)&&(s=a.replace(o,u),i[s]=r[a]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.length=0},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .input-group-addon, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today, tfoot th.clear").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(t){this._o=e.extend({},this._o,t);var n=this.o=e.extend({},this._o),r=n.language;d[r]||(r=r.split("-")[0],d[r]||(r=h.language)),n.language=r;switch(n.startView){case 2:case"decade":n.startView=2;break;case 1:case"year":n.startView=1;break;default:n.startView=0}switch(n.minViewMode){case 1:case"months":n.minViewMode=1;break;case 2:case"years":n.minViewMode=2;break;default:n.minViewMode=0}n.startView=Math.max(n.startView,n.minViewMode),n.multidate!==!0&&(n.multidate=Number(n.multidate)||!1,n.multidate!==!1?n.multidate=Math.max(0,n.multidate):n.multidate=1),n.multidateSeparator=String(n.multidateSeparator),n.weekStart%=7,n.weekEnd=(n.weekStart+6)%7;var i=v.parseFormat(n.format);n.startDate!==-Infinity&&(n.startDate?n.startDate instanceof Date?n.startDate=this._local_to_utc(this._zero_time(n.startDate)):n.startDate=v.parseDate(n.startDate,i,n.language):n.startDate=-Infinity),n.endDate!==Infinity&&(n.endDate?n.endDate instanceof Date?n.endDate=this._local_to_utc(this._zero_time(n.endDate)):n.endDate=v.parseDate(n.endDate,i,n.language):n.endDate=Infinity),n.daysOfWeekDisabled=n.daysOfWeekDisabled||[],e.isArray(n.daysOfWeekDisabled)||(n.daysOfWeekDisabled=n.daysOfWeekDisabled.split(/[,\s]*/)),n.daysOfWeekDisabled=e.map(n.daysOfWeekDisabled,function(e){return parseInt(e,10)});var s=String(n.orientation).toLowerCase().split(/\s+/g),o=n.orientation.toLowerCase();s=e.grep(s,function(e){return/^auto|left|right|top|bottom$/.test(e)}),n.orientation={x:"auto",y:"auto"};if(!!o&&o!=="auto")if(s.length===1)switch(s[0]){case"top":case"bottom":n.orientation.y=s[0];break;case"left":case"right":n.orientation.x=s[0]}else o=e.grep(s,function(e){return/^left|right$/.test(e)}),n.orientation.x=o[0]||"auto",o=e.grep(s,function(e){return/^top|bottom$/.test(e)}),n.orientation.y=o[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var n=0,r,i,s;n<e.length;n++)r=e[n][0],e[n].length===2?(i=t,s=e[n][1]):e[n].length===3&&(i=e[n][1],s=e[n][2]),r.on(s,i)},_unapplyEvents:function(e){for(var n=0,r,i,s;n<e.length;n++)r=e[n][0],e[n].length===2?(s=t,i=e[n][1]):e[n].length===3&&(s=e[n][1],i=e[n][2]),r.off(i,s)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){var t=e.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,t),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){var t=e.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,e.map(t,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(n){n===t&&(n=this.o.format);var r=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,n,r)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=[];this.element.parents().each(function(){var t=e(this).css("z-index");t!=="auto"&&t!==0&&a.push(parseInt(t))});var f=Math.max.apply(Math,a)+10,l=this.component?this.component.parent().offset():this.element.offset(),c=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),h=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),p=l.left,d=l.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(p-=t-h)):(this.picker.addClass("datepicker-orient-left"),l.left<0?p-=l.left-i:l.left+t>s&&(p=s-t-i));var v=this.o.orientation.y,m,g;v==="auto"&&(m=-u+l.top-r,g=u+o-(l.top+c+r),Math.max(m,g)===g?v="top":v="bottom"),this.picker.addClass("datepicker-orient-"+v),v==="top"?d+=c:d-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:d,left:p,zIndex:f})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="cw">&nbsp;</th>';t+=n,this.picker.find(".datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()===r&&t.getUTCMonth()<i?n.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()===r&&t.getUTCMonth()>i)&&n.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===s.getFullYear()&&t.getUTCMonth()===s.getMonth()&&t.getUTCDate()===s.getDate()&&n.push("today"),this.dates.contains(t)!==-1&&n.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("range"),e.inArray(t.valueOf(),this.range)!==-1&&n.push("selected")),n},fill:function(){var n=new Date(this.viewDate),i=n.getUTCFullYear(),s=n.getUTCMonth(),o=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,u=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,f=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,l=d[this.o.language].today||d.en.today||"",c=d[this.o.language].clear||d.en.clear||"",h;if(isNaN(i)||isNaN(s))return;this.picker.find(".datepicker-days thead th.datepicker-switch").text(d[this.o.language].months[s]+" "+i),this.picker.find("tfoot th.today").text(l).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(c).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var p=r(i,s-1,28),m=v.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(m),p.setUTCDate(m-(p.getUTCDay()-this.o.weekStart+7)%7);var g=new Date(p);g.setUTCDate(g.getUTCDate()+42),g=g.valueOf();var y=[],b;while(p.valueOf()<g){if(p.getUTCDay()===this.o.weekStart){y.push("<tr>");if(this.o.calendarWeeks){var w=new Date(+p+(this.o.weekStart-p.getUTCDay()-7)%7*864e5),E=new Date(Number(w)+(11-w.getUTCDay())%7*864e5),S=new Date(Number(S=r(E.getUTCFullYear(),0,1))+(11-S.getUTCDay())%7*864e5),x=(E-S)/864e5/7+1;y.push('<td class="cw">'+x+"</td>")}}b=this.getClassNames(p),b.push("day");if(this.o.beforeShowDay!==e.noop){var T=this.o.beforeShowDay(this._utc_to_local(p));T===t?T={}:typeof T=="boolean"?T={enabled:T}:typeof T=="string"&&(T={classes:T}),T.enabled===!1&&b.push("disabled"),T.classes&&(b=b.concat(T.classes.split(/\s+/))),T.tooltip&&(h=T.tooltip)}b=e.unique(b),y.push('<td class="'+b.join(" ")+'"'+(h?' title="'+h+'"':"")+">"+p.getUTCDate()+"</td>"),h=null,p.getUTCDay()===this.o.weekEnd&&y.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(y.join(""));var N=this.picker.find(".datepicker-months").find("th:eq(1)").text(i).end().find("span").removeClass("active");e.each(this.dates,function(e,t){t.getUTCFullYear()===i&&N.eq(t.getUTCMonth()).addClass("active")}),(i<o||i>a)&&N.addClass("disabled"),i===o&&N.slice(0,u).addClass("disabled"),i===a&&N.slice(f+1).addClass("disabled"),y="",i=parseInt(i/10,10)*10;var C=this.picker.find(".datepicker-years").find("th:eq(1)").text(i+"-"+(i+9)).end().find("td");i-=1;var k=e.map(this.dates,function(e){return e.getUTCFullYear()}),L;for(var A=-1;A<11;A++)L=["year"],A===-1?L.push("old"):A===10&&L.push("new"),e.inArray(i,k)!==-1&&L.push("active"),(i<o||i>a)&&L.push("disabled"),y+='<span class="'+L.join(" ")+'">'+i+"</span>",i+=1;C.html(y)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length===1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var u=v.modes[this.viewMode].navStep*(n[0].className==="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn==="linked"?null:"view";this._setDate(a,f);break;case"clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".disabled")||(this.viewDate.setUTCDate(1),n.is(".month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".day")&&!n.is(".disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".old")?s===0?(s=11,i-=1):s-=1:n.is(".new")&&(s===11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e||this.dates.clear();if(this.o.multidate!==1||t!==0)t!==-1?this.dates.remove(t):this.dates.push(e);if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t==="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t==="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t==="date")&&this.hide()},moveMonth:function(e,n){if(!e)return t;if(!n)return e;var r=new Date(e.valueOf()),i=r.getUTCDate(),s=r.getUTCMonth(),o=Math.abs(n),u,a;n=n>0?1:-1;if(o===1){a=n===-1?function(){return r.getUTCMonth()===s}:function(){return r.getUTCMonth()!==u},u=s+n,r.setUTCMonth(u);if(u<0||u>11)u=(u+12)%12}else{for(var f=0;f<o;f++)r=this.moveMonth(r,n);u=r.getUTCMonth(),r.setUTCDate(i),a=function(){return u!==r.getUTCMonth()}}while(a())r.setUTCDate(--i),r.setUTCMonth(u);return r},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode===27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode===37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode===38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(o),t=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i===-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(n){var r=Array.apply(null,arguments);r.shift();var i;return this.each(function(){var s=e(this),o=s.data("datepicker"),c=typeof n=="object"&&n;if(!o){var p=f(this,"date"),d=e.extend({},h,p,c),v=l(d.language),m=e.extend({},h,v,p,c);if(s.is(".input-daterange")||m.inputs){var g={inputs:m.inputs||s.find("input").toArray()};s.data("datepicker",o=new a(this,e.extend(m,g)))}else s.data("datepicker",o=new u(this,m))}if(typeof n=="string"&&typeof o[n]=="function"){i=o[n].apply(o,r);if(i!==t)return!1}}),i!==t?i:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(n,i,s){function w(){var e=this.slice(0,a[c].length),t=a[c].slice(0,e.length);return e===t}if(!n)return t;if(n instanceof Date)return n;typeof i=="string"&&(i=v.parseFormat(i));var o=/([\-+]\d+)([dmwy])/,a=n.match(/([\-+]\d+)([dmwy])/g),f,l,c;if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(n)){n=new Date;for(c=0;c<a.length;c++){f=o.exec(a[c]),l=parseInt(f[1]);switch(f[2]){case"d":n.setUTCDate(n.getUTCDate()+l);break;case"m":n=u.prototype.moveMonth.call(u.prototype,n,l);break;case"w":n.setUTCDate(n.getUTCDate()+l*7);break;case"y":n=u.prototype.moveYear.call(u.prototype,n,l)}}return r(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),0,0,0)}a=n&&n.match(this.nonpunctuation)||[],n=new Date;var h={},p=["yyyy","yy","M","MM","m","mm","d","dd"],m={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!==t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},g,y;m.M=m.MM=m.mm=m.m,m.dd=m.d,n=r(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0);var b=i.parts.slice();a.length!==b.length&&(b=e(b).filter(function(t,n){return e.inArray(n,p)!==-1}).toArray());if(a.length===b.length){var E;for(c=0,E=b.length;c<E;c++){g=parseInt(a[c],10),f=b[c];if(isNaN(g))switch(f){case"MM":y=e(d[s].months).filter(w),g=e.inArray(y[0],d[s].months)+1;break;case"M":y=e(d[s].monthsShort).filter(w),g=e.inArray(y[0],d[s].monthsShort)+1}h[f]=g}var S,x;for(c=0;c<p.length;c++)x=p[c],x in h&&!isNaN(h[x])&&(S=new Date(n),m[x](S,h[x]),isNaN(S)||(n=S))}return n},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,t=[];var s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};v.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery),define("bootstrap-datepicker",function(){}),function(e){e.fn.datepicker.dates.az={days:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə","Bazar"],daysShort:["B.","B.e","Ç.a","Ç.","C.a","C.","Ş.","B."],daysMin:["B.","B.e","Ç.a","Ç.","C.a","C.","Ş.","B."],months:["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],monthsShort:["Yan","Fev","Mar","Apr","May","İyun","İyul","Avq","Sen","Okt","Noy","Dek"],today:"Bu gün",weekStart:1}}(jQuery),define("datepicker-ar",function(){}),function(e){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}(jQuery),define("datepicker-az",function(){}),function(e){e.fn.datepicker.dates.ar={days:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"],daysShort:["أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة","سبت","أحد"],daysMin:["ح","ن","ث","ع","خ","ج","س","ح"],months:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],monthsShort:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],today:"هذا اليوم",rtl:!0}}(jQuery),define("datepicker-bg",function(){}),function(e){e.fn.datepicker.dates.ca={days:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte","Diumenge"],daysShort:["Diu","Dil","Dmt","Dmc","Dij","Div","Dis","Diu"],daysMin:["dg","dl","dt","dc","dj","dv","ds","dg"],months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],monthsShort:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],today:"Avui",clear:"Esborrar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-ca",function(){}),function(e){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes",clear:"Vymazat",weekStart:1,format:"d.m.yyyy"}}(jQuery),define("datepicker-cs",function(){}),function(e){e.fn.datepicker.dates.cy={days:["Sul","Llun","Mawrth","Mercher","Iau","Gwener","Sadwrn","Sul"],daysShort:["Sul","Llu","Maw","Mer","Iau","Gwe","Sad","Sul"],daysMin:["Su","Ll","Ma","Me","Ia","Gwe","Sa","Su"],months:["Ionawr","Chewfror","Mawrth","Ebrill","Mai","Mehefin","Gorfennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"],monthsShort:["Ion","Chw","Maw","Ebr","Mai","Meh","Gor","Aws","Med","Hyd","Tach","Rha"],today:"Heddiw"}}(jQuery),define("datepicker-cy",function(){}),function(e){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}(jQuery),define("datepicker-da",function(){}),function(e){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-de",function(){}),function(e){e.fn.datepicker.dates.el={days:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο","Κυριακή"],daysShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ","Κυρ"],daysMin:["Κυ","Δε","Τρ","Τε","Πε","Πα","Σα","Κυ"],months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],monthsShort:["Ιαν","Φεβ","Μαρ","Απρ","Μάι","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],today:"Σήμερα",clear:"Καθαρισμός",weekStart:1,format:"d/m/yyyy"}}(jQuery),define("datepicker-el",function(){}),function(e){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy",clear:"Borrar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-es",function(){}),function(e){e.fn.datepicker.dates.et={days:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev","Pühapäev"],daysShort:["Pühap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup","Pühap"],daysMin:["P","E","T","K","N","R","L","P"],months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],monthsShort:["Jaan","Veebr","Märts","Apr","Mai","Juuni","Juuli","Aug","Sept","Okt","Nov","Dets"],today:"Täna",clear:"Tühjenda",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-et",function(){}),function(e){e.fn.datepicker.dates.fa={days:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه","یک‌شنبه"],daysShort:["یک","دو","سه","چهار","پنج","جمعه","شنبه","یک"],daysMin:["ی","د","س","چ","پ","ج","ش","ی"],months:["ژانویه","فوریه","مارس","آوریل","مه","ژوئن","ژوئیه","اوت","سپتامبر","اکتبر","نوامبر","دسامبر"],monthsShort:["ژان","فور","مار","آور","مه","ژون","ژوی","اوت","سپت","اکت","نوا","دسا"],today:"امروز",clear:"پاک کن",weekStart:1,format:"yyyy/mm/dd"}}(jQuery),define("datepicker-fa",function(){}),function(e){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}(jQuery),define("datepicker-fi",function(){}),function(e){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-fr",function(){}),function(e){e.fn.datepicker.dates.gl={days:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mér","Xov","Ven","Sáb","Dom"],daysMin:["Do","Lu","Ma","Me","Xo","Ve","Sa","Do"],months:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xuño","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],monthsShort:["Xan","Feb","Mar","Abr","Mai","Xun","Xul","Ago","Sep","Out","Nov","Dec"],today:"Hoxe",clear:"Limpar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-gl",function(){}),function(e){e.fn.datepicker.dates.he={days:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת","ראשון"],daysShort:["א","ב","ג","ד","ה","ו","ש","א"],daysMin:["א","ב","ג","ד","ה","ו","ש","א"],months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],monthsShort:["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ"],today:"היום",rtl:!0}}(jQuery),define("datepicker-he",function(){}),function(e){e.fn.datepicker.dates.hr={days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota","Nedjelja"],daysShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub","Ned"],daysMin:["Ne","Po","Ut","Sr","Če","Pe","Su","Ne"],months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],monthsShort:["Sij","Velj","Ožu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],today:"Danas"}}(jQuery),define("datepicker-hr",function(){}),function(e){e.fn.datepicker.dates.hu={days:["Vasárnap","Hétfő","Kedd","Szerda","Csütörtök","Péntek","Szombat","Vasárnap"],daysShort:["Vas","Hét","Ked","Sze","Csü","Pén","Szo","Vas"],daysMin:["Va","Hé","Ke","Sz","Cs","Pé","Sz","Va"],months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],monthsShort:["Jan","Feb","Már","Ápr","Máj","Jún","Júl","Aug","Sze","Okt","Nov","Dec"],today:"Ma",weekStart:1,format:"yyyy.mm.dd"}}(jQuery),define("datepicker-hu",function(){}),function(e){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}(jQuery),define("datepicker-id",function(){}),function(e){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}(jQuery),define("datepicker-is",function(){}),function(e){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-it",function(){}),function(e){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd",clear:"クリア"}}(jQuery),define("datepicker-ja",function(){}),function(e){e.fn.datepicker.dates.ka={days:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი","კვირა"],daysShort:["კვი","ორშ","სამ","ოთხ","ხუთ","პარ","შაბ","კვი"],daysMin:["კვ","ორ","სა","ოთ","ხუ","პა","შა","კვ"],months:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომები","ნოემბერი","დეკემბერი"],monthsShort:["იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექ","ოქტ","ნოე","დეკ"],today:"დღეს",clear:"გასუფთავება",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-ka",function(){}),function(e){e.fn.datepicker.dates.kk={days:["Жексенбі","Дүйсенбі","Сейсенбі","Сәрсенбі","Бейсенбі","Жұма","Сенбі","Жексенбі"],daysShort:["Жек","Дүй","Сей","Сәр","Бей","Жұм","Сен","Жек"],daysMin:["Жк","Дс","Сс","Ср","Бс","Жм","Сн","Жк"],months:["Қаңтар","Ақпан","Наурыз","Сәуір","Мамыр","Маусым","Шілде","Тамыз","Қыркүйек","Қазан","Қараша","Желтоқсан"],monthsShort:["Қаң","Ақп","Нау","Сәу","Мамыр","Мау","Шлд","Тмз","Қыр","Қзн","Қар","Жел"],today:"Бүгін",weekStart:1}}(jQuery),define("datepicker-kk",function(){}),function(e){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}(jQuery),define("datepicker-kr",function(){}),function(e){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}(jQuery),define("datepicker-lt",function(){}),function(e){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}(jQuery),define("datepicker-lv",function(){}),function(e){e.fn.datepicker.dates.mk={days:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота","Недела"],daysShort:["Нед","Пон","Вто","Сре","Чет","Пет","Саб","Нед"],daysMin:["Не","По","Вт","Ср","Че","Пе","Са","Не"],months:["Јануари","Февруари","Март","Април","Мај","Јуни","Јули","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Јан","Фев","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Ное","Дек"],today:"Денес",format:"dd.mm.yyyy"}}(jQuery),define("datepicker-mk",function(){}),function(e){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}(jQuery),define("datepicker-ms",function(){}),function(e){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}(jQuery),define("datepicker-nb",function(){}),function(e){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag",clear:"Wissen",weekStart:1,format:"dd-mm-yyyy"}}(jQuery),define("datepicker-nl",function(){}),function(e){e.fn.datepicker.dates["nl-BE"]={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag",clear:"Leegmaken",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-nl-BE",function(){}),function(e){e.fn.datepicker.dates.no={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I dag",clear:"Nullstill",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-no",function(){}),function(e){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1,clear:"Wyczyść"}}(jQuery),define("datepicker-pl",function(){}),function(e){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}(jQuery),define("datepicker-pt",function(){}),function(e){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}(jQuery),define("datepicker-pt-BR",function(){}),function(e){e.fn.datepicker.dates.ro={days:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă","Duminică"],daysShort:["Dum","Lun","Mar","Mie","Joi","Vin","Sâm","Dum"],daysMin:["Du","Lu","Ma","Mi","Jo","Vi","Sâ","Du"],months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],monthsShort:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov","Dec"],today:"Astăzi",clear:"Șterge",weekStart:1}}(jQuery),define("datepicker-ro",function(){}),function(e){e.fn.datepicker.dates.rs={days:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота","Недеља"],daysShort:["Нед","Пон","Уто","Сре","Чет","Пет","Суб","Нед"],daysMin:["Н","По","У","Ср","Ч","Пе","Су","Н"],months:["Јануар","Фебруар","Март","Април","Мај","Јун","Јул","Август","Септембар","Октобар","Новембар","Децембар"],monthsShort:["Јан","Феб","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Нов","Дец"],today:"Данас",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-rs",function(){}),function(e){e.fn.datepicker.dates["rs-latin"]={days:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota","Nedelja"],daysShort:["Ned","Pon","Uto","Sre","Čet","Pet","Sub","Ned"],daysMin:["N","Po","U","Sr","Č","Pe","Su","N"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-rs-latin",function(){}),function(e){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",format:"dd.mm.yyyy",weekStart:1}}(jQuery),define("datepicker-ru",function(){}),function(e){e.fn.datepicker.dates.sk={days:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota","Nedeľa"],daysShort:["Ned","Pon","Uto","Str","Štv","Pia","Sob","Ned"],daysMin:["Ne","Po","Ut","St","Št","Pia","So","Ne"],months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],today:"Dnes"}}(jQuery),define("datepicker-sk",function(){}),function(e){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}(jQuery),define("datepicker-sl",function(){}),function(e){e.fn.datepicker.dates.sq={days:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë","E Diel"],daysShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu","Die"],daysMin:["Di","Hë","Ma","Më","En","Pr","Sht","Di"],months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],monthsShort:["Jan","Shk","Mar","Pri","Maj","Qer","Korr","Gu","Sht","Tet","Nën","Dhjet"],today:"Sot"}}(jQuery),define("datepicker-sq",function(){}),function(e){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Idag",format:"yyyy-mm-dd",weekStart:1,clear:"Rensa"}}(jQuery),define("datepicker-sv",function(){}),function(e){e.fn.datepicker.dates.sw={days:["Jumapili","Jumatatu","Jumanne","Jumatano","Alhamisi","Ijumaa","Jumamosi","Jumapili"],daysShort:["J2","J3","J4","J5","Alh","Ij","J1","J2"],daysMin:["2","3","4","5","A","I","1","2"],months:["Januari","Februari","Machi","Aprili","Mei","Juni","Julai","Agosti","Septemba","Oktoba","Novemba","Desemba"],monthsShort:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ago","Sep","Okt","Nov","Des"],today:"Leo"}}(jQuery),define("datepicker-sw",function(){}),function(e){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}(jQuery),define("datepicker-th",function(){}),function(e){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}(jQuery),define("datepicker-tr",function(){}),function(e){e.fn.datepicker.dates.vi={days:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy","Chủ nhật"],daysShort:["CN","Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7","CN"],daysMin:["CN","T2","T3","T4","T5","T6","T7","CN"],months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],monthsShort:["Th1","Th2","Th3","Th4","Th5","Th6","Th7","Th8","Th9","Th10","Th11","Th12"],today:"Hôm nay",clear:"Xóa",format:"dd/mm/yyyy"}}(jQuery),define("datepicker-vi",function(){}),function(e){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1,clear:"清空"}}(jQuery),define("datepicker-zh-CN",function(){}),function(e){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}(jQuery),define("datepicker-zh-TW",function(){}),function(){"use strict";require.config({paths:{"bootstrap-datepicker":"bower_components/bootstrap-datepicker/bootstrap-datepicker","datepicker-az":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.az","datepicker-bg":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.bg","datepicker-ar":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ar","datepicker-ca":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ca","datepicker-cs":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.cs","datepicker-cy":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.cy","datepicker-da":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.da","datepicker-de":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.de","datepicker-el":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.el","datepicker-es":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.es","datepicker-et":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.et","datepicker-sq":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sq","datepicker-fa":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.fa","datepicker-fi":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.fi","datepicker-fr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.fr","datepicker-gl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.gl","datepicker-he":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.he","datepicker-hr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.hr","datepicker-hu":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.hu","datepicker-id":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.id","datepicker-is":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.is","datepicker-it":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.it","datepicker-ja":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ja","datepicker-ka":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ka","datepicker-kk":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.kk","datepicker-kr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.kr","datepicker-lt":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.lt","datepicker-lv":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.lv","datepicker-mk":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.mk","datepicker-ms":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ms","datepicker-nb":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.nb","datepicker-nl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.nl","datepicker-nl-BE":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE","datepicker-no":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.no","datepicker-pl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.pl","datepicker-pt":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.pt","datepicker-pt-BR":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR","datepicker-ro":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ro","datepicker-rs":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.rs","datepicker-rs-latin":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin","datepicker-ru":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ru","datepicker-sk":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sk","datepicker-sl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sl","datepicker-sv":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sv","datepicker-sw":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sw","datepicker-th":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.th","datepicker-tr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.tr","datepicker-vi":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.vi","datepicker-zh-CN":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN","datepicker-zh-TW":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW"},shim:{"datepicker-az":{deps:["bootstrap-datepicker"]},"datepicker-bg":{deps:["bootstrap-datepicker"]},"datepicker-ar":{deps:["bootstrap-datepicker"]},"datepicker-ca":{deps:["bootstrap-datepicker"]},"datepicker-cs":{deps:["bootstrap-datepicker"]},"datepicker-cy":{deps:["bootstrap-datepicker"]},"datepicker-da":{deps:["bootstrap-datepicker"]},"datepicker-de":{deps:["bootstrap-datepicker"]},"datepicker-el":{deps:["bootstrap-datepicker"]},"datepicker-es":{deps:["bootstrap-datepicker"]},"datepicker-et":{deps:["bootstrap-datepicker"]},"datepicker-sq":{deps:["bootstrap-datepicker"]},"datepicker-fa":{deps:["bootstrap-datepicker"]},"datepicker-fi":{deps:["bootstrap-datepicker"]},"datepicker-fr":{deps:["bootstrap-datepicker"]},"datepicker-gl":{deps:["bootstrap-datepicker"]},"datepicker-he":{deps:["bootstrap-datepicker"]},"datepicker-hr":{deps:["bootstrap-datepicker"]},"datepicker-hu":{deps:["bootstrap-datepicker"]},"datepicker-id":{deps:["bootstrap-datepicker"]},"datepicker-is":{deps:["bootstrap-datepicker"]},"datepicker-it":{deps:["bootstrap-datepicker"]},"datepicker-ja":{deps:["bootstrap-datepicker"]},"datepicker-ka":{deps:["bootstrap-datepicker"]},"datepicker-kk":{deps:["bootstrap-datepicker"]},"datepicker-kr":{deps:["bootstrap-datepicker"]},"datepicker-lt":{deps:["bootstrap-datepicker"]},"datepicker-lv":{deps:["bootstrap-datepicker"]},"datepicker-mk":{deps:["bootstrap-datepicker"]},"datepicker-ms":{deps:["bootstrap-datepicker"]},"datepicker-nb":{deps:["bootstrap-datepicker"]},"datepicker-nl":{deps:["bootstrap-datepicker"]},"datepicker-nl-BE":{deps:["bootstrap-datepicker"]},"datepicker-no":{deps:["bootstrap-datepicker"]},"datepicker-pl":{deps:["bootstrap-datepicker"]},"datepicker-pt":{deps:["bootstrap-datepicker"]},"datepicker-pt-BR":{deps:["bootstrap-datepicker"]},"datepicker-ro":{deps:["bootstrap-datepicker"]},"datepicker-rs":{deps:["bootstrap-datepicker"]},"datepicker-rs-latin":{deps:["bootstrap-datepicker"]},"datepicker-ru":{deps:["bootstrap-datepicker"]},"datepicker-sk":{deps:["bootstrap-datepicker"]},"datepicker-sl":{deps:["bootstrap-datepicker"]},"datepicker-sv":{deps:["bootstrap-datepicker"]},"datepicker-sw":{deps:["bootstrap-datepicker"]},"datepicker-th":{deps:["bootstrap-datepicker"]},"datepicker-tr":{deps:["bootstrap-datepicker"]},"datepicker-vi":{deps:["bootstrap-datepicker"]},"datepicker-zh-CN":{deps:["bootstrap-datepicker"]},"datepicker-zh-TW":{deps:["bootstrap-datepicker"]}}}),define("husky_extensions/datepicker",["bootstrap-datepicker","datepicker-ar","datepicker-az","datepicker-bg","datepicker-ca","datepicker-cs","datepicker-cy","datepicker-da","datepicker-de","datepicker-el","datepicker-es","datepicker-et","datepicker-fa","datepicker-fi","datepicker-fr","datepicker-gl","datepicker-he","datepicker-hr","datepicker-hu","datepicker-id","datepicker-is","datepicker-it","datepicker-ja","datepicker-ka","datepicker-kk","datepicker-kr","datepicker-lt","datepicker-lv","datepicker-mk","datepicker-ms","datepicker-nb","datepicker-nl","datepicker-nl-BE","datepicker-no","datepicker-pl","datepicker-pt","datepicker-pt-BR","datepicker-ro","datepicker-rs","datepicker-rs-latin","datepicker-ru","datepicker-sk","datepicker-sl","datepicker-sq","datepicker-sv","datepicker-sw","datepicker-th","datepicker-tr","datepicker-vi","datepicker-zh-CN","datepicker-zh-TW"],{name:"bootstrap-datepicker",initialize:function(e){e.sandbox.datepicker={init:function(t,n){var r={format:e.sandbox.globalize.getDatePattern().toLowerCase(),language:e.sandbox.globalize.getLocale(),autoclose:!0};return r=e.sandbox.util.extend(!0,{},r,n),e.core.dom.$(t).datepicker(r)},setValue:function(t,n){return e.core.dom.$(t).datepicker("update",n)},getUTCDate:function(t){return e.core.dom.$(t).datepicker("getUTCDate")},getDate:function(t){return e.core.dom.$(t).datepicker("getDate")},setUTCDate:function(t,n){return e.core.dom.$(t).datepicker("setUTCDate",n)},setDate:function(t,n){return e.core.dom.$(t).datepicker("setDate",n)}}}})}(),function(){"use strict";require.config({paths:{dropzone:"bower_components/dropzone/dropzone"},shim:{dropzone:{exports:"Dropzone",deps:["jquery"]}}}),define("husky_extensions/dropzone",["dropzone"],function(e){return{name:"dropzone",initialize:function(t){e.confirm=function(e,t){t()},t.sandbox.dropzone={initialize:function(e,n){return t.core.dom.$(e).dropzone(n)}}}}})}(),function(){"use strict";require.config({paths:{globalize_lib:"bower_components/globalize/lib/globalize",cultures:"bower_components/globalize/lib/cultures"}}),define("husky_extensions/globalize",["globalize_lib"],function(){var e=function(e){return e=e.replace("_","-"),e.indexOf("-")>-1&&(e=e.substring(0,e.indexOf("-"))+e.substring(e.indexOf("-"),e.length).toUpperCase()),e},t=function(e){!e.config.culture||(e.config.culture.messages||(e.config.culture.messages={}),e.loadLanguage(e.config.culture.name).then(function(){e.setLanguage(e.config.culture.name,e.config.culture.messages,e.config.culture.defaultMessages)})),e.sandbox.globalize.setCurrency("")};return{name:"husky-validation",initialize:function(n){n.sandbox.globalize={addCultureInfo:function(t,n){t=e(t),Globalize.addCultureInfo(t,{messages:n})},getLocale:function(){return Globalize.culture().name},getDatePattern:function(){return Globalize.culture().calendar.patterns.d},getTimePatter:function(){return Globalize.culture().calendar.patterns.t},setCurrency:function(e){Globalize.culture().numberFormat.currency.symbol=e}},n.sandbox.translate=function(e){var t;if(!n.config.culture||!Globalize.culture().name)return e;try{t=Globalize.localize(e,Globalize.culture().name)}catch(r){return n.logger.warn('Globalize threw an error when translating key "'+e+'", failling back to key. Error: '+r),e}return!t&&t!==""?e:t},n.sandbox.date={format:function(e,t){var n,r;return typeof e=="string"&&(e=this.parse(e)),n=Globalize.format(e,Globalize.culture().calendar.patterns.d),t===!0&&(r=Globalize.format(e,Globalize.culture().calendar.patterns.t)),(n?n:"")+(!n||!r?"":" ")+(r?r:"")},parse:function(e){var t=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})([0-9]{2}))?/,n=t.exec(e),r,i,s;return n?(i=Date.UTC(parseInt(n[1]),parseInt(n[2])-1,parseInt(n[3]),parseInt(n[4]),parseInt(n[5]),n[6]&&parseInt(n[6])||0,n[7]&&parseFloat(n[7])*1e3||0),n[9]&&n[10]&&(s=parseInt(n[9])*60+parseInt(n[10]),i+=(n[8]==="+"?-1:1)*s*6e4),r=new Date(i)):r=null,r}},n.sandbox.translateArray=function(e){var t=[];return n.sandbox.util.foreach(e,function(e){t.push(n.sandbox.translate(e))}.bind(this)),t},n.sandbox.numberFormat=function(e,t){return Globalize.format(e,t)},n.sandbox.parseFloat=function(e,t,n){return Globalize.parseFloat(e,t,n)},n.setLanguage=function(t,r,i){t=e(t),Globalize.culture(t),n.sandbox.globalize.addCultureInfo(t,r),n.sandbox.globalize.addCultureInfo("default",i)},n.loadLanguage=function(t){var n=$.Deferred();return t=e(t),t!=="en"?require(["cultures/globalize.culture."+t],function(){n.resolve()}):n.resolve(),n.promise()},t(n)}}})}(),function(){"use strict";require.config({paths:{jquery:"bower_components/jquery/jquery","html.sortable":"bower_components/html.sortable/html.sortable"},shim:{jquery:{exports:"$"},html5sortable:{deps:["jquery"],exports:"jQuery.fn.sortable"}}}),define("husky_extensions/html.sortable",["html.sortable"],function(){return{name:"html.sortable",initialize:function(e){e.core.dom.sortable=function(e,t){return $(e).sortable(t)}}}})}(),function(){"use strict";require.config({paths:{form:"bower_components/husky-validation/dist/validation"}}),define("husky_extensions/husky-validation",["form"],function(e){return{name:"husky-validation",initialize:function(t){t.sandbox.form={create:function(t,n){return new e($(t),n)},getObject:function(e){return $(e).data("form-object")},validate:function(e,n){return $(e).length===0?!1:(n||(n=!1),t.sandbox.form.getObject(e).validation.validate(n))},isValid:function(e){return t.sandbox.form.getObject(e).validation.isValid()},addField:function(e,n){return t.sandbox.form.getObject(e).addField(n)},removeField:function(e,n){return t.sandbox.form.getObject(e).removeField(n)},addConstraint:function(e,n,r,i){t.sandbox.form.getObject(e).validation.addConstraint(n,r,i)},updateConstraint:function(e,n,r,i){t.sandbox.form.getObject(e).validation.updateConstraint(n,r,i)},deleteConstraint:function(e,n,r){t.sandbox.form.getObject(e).validation.deleteConstraint(n,r)},setData:function(e,n){return t.sandbox.form.getObject(e).mapper.setData(n)},getData:function(e,n,r){return t.sandbox.form.getObject(e).mapper.getData(r,n)},addToCollection:function(e,n,r,i){return t.sandbox.form.getObject(e).mapper.addToCollection(n,r,i)},editInCollection:function(e,n,r){return t.sandbox.form.getObject(e).mapper.editInCollection(n,r)},removeFromCollection:function(e,n){return t.sandbox.form.getObject(e).mapper.removeFromCollection(n)},addCollectionFilter:function(e,n,r){t.sandbox.form.getObject(e).mapper.addCollectionFilter(n,r)},removeCollectionFilter:function(e,n){t.sandbox.form.getObject(e).mapper.removeCollectionFilter(n)},element:{getObject:function(e){return $(e).data("element")},validate:function(e,n){return t.sandbox.form.element.getObject(e).validate(n)},addConstraint:function(e,n,r){t.sandbox.form.element.getObject(e).addConstraint(n,r)},updateConstraint:function(e,n,r){t.sandbox.form.element.getObject(e).updateConstraint(n,r)},deleteConstraint:function(e,n){t.sandbox.form.element.getObject(e).deleteConstraint(n)},hasConstraint:function(e,n){return t.sandbox.form.element.getObject(e).hasConstraint(n)},getConstraint:function(e,n){return t.sandbox.form.element.getObject(e).getConstraint(n)},setValue:function(e,n){t.sandbox.form.element.getObject(e).setValue(n)},getValue:function(e){return t.sandbox.form.element.getObject(e).getValue()}}}}}})}(),function(){"use strict";define("husky_extensions/infinite-scroll",[],function(){var e=null,t=function(t,r,i){$(t).data("blocked")||(!e||clearTimeout(e),e=setTimeout(n.bind(this,t,r,i),50))},n=function(e,t,n){var r=$(e),i=r[0].clientHeight,s=r[0].scrollHeight,o=r.scrollTop(),u=isNaN(t)?0:t;if(i+o+u-s>=0){r.data("blocked",!0);var a=n();!a||!a.then?$(e).removeData("blocked"):a.then(function(){$(e).removeData("blocked")})}};return{name:"infinite-scroll",initialize:function(e){e.sandbox.infiniteScroll={initialize:function(n,r,i){e.sandbox.dom.on(n,"scroll.infinite",function(){t(n,i,r)})},destroy:function(t){e.sandbox.dom.off(t,"scroll.infinite")}}}}})}(),define("husky_extensions/itembox",[],function(){"use strict";var e={instanceName:null,url:null,eventNamespace:"husky.itembox",idsParameter:"ids",resultKey:null,idKey:"id",dataAttribute:"",dataDefault:{},sortable:!0,removable:!0,hideAddButton:!1,hidePositionElement:!1,hideConfigButton:!1,hideSelectedCounter:!1,defaultDisplayOption:"top",actionIcon:"fa-plus-circle",displayOptions:{leftTop:!0,top:!0,rightTop:!0,left:!0,middle:!0,right:!0,leftBottom:!0,bottom:!0,rightBottom:!0},translations:{noContentSelected:"listbox.nocontent-selected",viewLess:"public.view-less",of:"public.of",visible:"public.visible",elementsSelected:"public.elements-selected"}},t={displayOptionSelectedClass:"selected",itemInvisibleClass:"invisible-item",noContentClass:"no-content",isLoadingClass:"is-loading"},n=function(e){return[this.options.eventNamespace,".",this.options.instanceName?this.options.instanceName+".":"",e].join("")},r={skeleton:function(){return['<div class="white-box form-element" id="',this.ids.container,'">','    <div class="header">','        <span class="',this.options.actionIcon," icon left action",this.options.hideAddButton?" hidden":"",'" id="',this.ids.addButton,'"></span>','        <span class="selected-counter',this.options.hideSelectedCounter?" hidden":"",'">','            <span class="num">0</span><span> ',this.sandbox.translate(this.options.translations.elementsSelected),"</span>","        </span>",'        <span class="fa-cog icon right border',this.options.hideConfigButton?" hidden":"",'" id="',this.ids.configButton,'"></span>','        <span class="no-content-message">',this.sandbox.translate(this.options.translations.noContentSelected),"</span>",'        <div class="position',this.options.hidePositionElement?" hidden":"",'">','            <div class="husky-position" id="',this.ids.displayOption,'">','                <div class="top left ',this.options.displayOptions.leftTop?"":"inactive",'" data-position="leftTop"></div>','                <div class="top middle ',this.options.displayOptions.top?"":"inactive",'" data-position="top"></div>','                <div class="top right ',this.options.displayOptions.rightTop?"":"inactive",'" data-position="rightTop"></div>','                <div class="middle left ',this.options.displayOptions.left?"":"inactive",'" data-position="left"></div>','                <div class="middle middle ',this.options.displayOptions.middle?"":"inactive",'" data-position="middle"></div>','                <div class="middle right ',this.options.displayOptions.right?"":"inactive",'" data-position="right"></div>','                <div class="bottom left ',this.options.displayOptions.leftBottom?"":"inactive",'" data-position="leftBottom"></div>','                <div class="bottom middle ',this.options.displayOptions.bottom?"":"inactive",'" data-position="bottom"></div>','                <div class="bottom right ',this.options.displayOptions.rightBottom?"":"inactive",'" data-position="rightBottom"></div>',"            </div>","        </div>","    </div>",'    <div class="content" id="',this.ids.content,'"></div>',"</div>"].join("")},item:function(e,t){return['<li data-id="',e,'">',this.options.sortable?'    <span class="fa-ellipsis-v icon move"></span>':"",'    <span class="num"></span>','    <div class="item-content">'+t+"</div>",this.options.removable?'    <span class="fa-times remove"></span>':"","</li>"].join("")}},i=function(){this.sandbox.on(this.DATA_CHANGED(),this.changeData.bind(this)),this.sandbox.on(this.DATA_RETRIEVED(),this.renderContent.bind(this))},s=function(){this.sandbox.dom.on(this.getId("displayOption")+" > div:not(.inactive)","click",this.changeDisplayOption.bind(this)),this.sandbox.dom.on(this.$addButton,"click",function(){this.sandbox.emit(this.ADD_BUTTON_CLICKED())}.bind(this)),this.sandbox.dom.on(this.$configButton,"click",function(){this.sandbox.emit(this.CONFIG_BUTTON_CLICKED())}.bind(this)),this.sandbox.dom.on(this.getId("content"),"click",this.removeItem.bind(this),"li .remove")},o=function(){var e=this.sandbox.dom.find(".sortable",this.$el),t;this.sandbox.dom.sortable(e,"destroy"),t=this.sandbox.dom.sortable(".sortable",{handle:".move",forcePlaceholderSize:!0}),this.sandbox.dom.unbind(t,"unbind"),t.bind("sortupdate",function(){var e=this.updateOrder();this.sortHandler(e)}.bind(this))},u=function(){return this.sandbox.dom.createElement('<ul class="items-list sortable"/>')},a={DATA_CHANGED:function(){return n.call(this,"data-changed")},DATA_RETRIEVED:function(){return n.call(this,"data-retrieved")},DISPLAY_OPTION_CHANGED:function(){return n.call(this,"display-position-changed")},ADD_BUTTON_CLICKED:function(){return n.call(this,"add-button-clicked")},CONFIG_BUTTON_CLICKED:function(){return n.call(this,"config-button-clicked")},render:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),!this.options.defaultDisplayOption||(this.options.dataDefault.displayOption=this.options.defaultDisplayOption);var t=this.getData();this.ids={container:"listbox-"+this.options.instanceName+"-container",addButton:"listbox-"+this.options.instanceName+"-add",configButton:"listbox-"+this.options.instanceName+"-config",displayOption:"listbox-"+this.options.instanceName+"-display-option",content:"listbox-"+this.options.instanceName+"-content"},this.sandbox.dom.html(this.$el,r.skeleton.call(this)),this.$container=this.sandbox.dom.find(this.getId("container"),this.$el),this.$addButton=this.sandbox.dom.find(this.getId("addButton"),this.$el),this.$configButton=this.sandbox.dom.find(this.getId("configButton"),this.$el),this.$content=this.sandbox.dom.find(this.getId("content"),this.$el),this.$list=null,this.addNoContentClass(),this.isDataEmpty(t)?this.sandbox.dom.data(this.$el,this.options.dataAttribute,this.options.dataDefault):this.loadContent(t),this.setDisplayOption(this.options.defaultDisplayOption),this.startLoader(),i.call(this),s.call(this)},addNoContentClass:function(){this.$list=null,this.sandbox.dom.addClass(this.$container,t.noContentClass)},removeNoContentClass:function(){this.sandbox.dom.removeClass(this.$container,t.noContentClass)},getData:function(){return this.sandbox.util.deepCopy(this.sandbox.dom.data(this.$el,this.options.dataAttribute))},setData:function(e,t){var n=this.sandbox.dom.data(this.$el,this.options.dataAttribute);t=typeof t=="undefined"?!0:t,this.sandbox.util.isEqual(n,e)||this.sandbox.emit(this.DATA_CHANGED(),e,this.$el,t)},changeData:function(e,t,n){this.sandbox.dom.data(this.$el,this.options.dataAttribute,e),!n||this.loadContent(e)},updateVisibility:function(){!this.$list||!this.$list.find("li").length?this.addNoContentClass():this.removeNoContentClass()},loadContent:function(e){this.$container.addClass(t.isLoadingClass),!!e&&(!e.length||e.length>0)?this.sandbox.util.load(this.getUrl(e)).then(function(e){this.$container.removeClass(t.isLoadingClass),this.sandbox.emit(this.DATA_RETRIEVED(),e._embedded[this.options.resultKey])}.bind(this)).fail(function(e){this.sandbox.logger.error(e)}.bind(this)):(this.$container.removeClass(t.isLoadingClass),this.sandbox.emit(this.DATA_RETRIEVED(),[]))},renderContent:function(e){if(e.length>0){var t=e.length;this.$list=u.call(this);for(var n=-1;++n<t;)this.addItem(e[n],!1,!1);this.sandbox.dom.html(this.$content,this.$list),o.call(this),this.updateOrder(),this.updateSelectedCounter(),this.updateVisibility()}else this.$list&&this.$list.children().remove(),this.addNoContentClass()},startLoader:function(){var e=this.sandbox.dom.createElement('<div class="loader"/>');this.sandbox.dom.append(this.$container.find(".header"),e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"20px",color:"#999999"}}])},setDisplayOption:function(e){var n=this.sandbox.dom.find('[data-position="'+e+'"]',this.$container);this.sandbox.dom.removeClass(this.sandbox.dom.find("."+t.displayOptionSelectedClass,this.getId("displayOption")),t.displayOptionSelectedClass),this.sandbox.dom.addClass(n,t.displayOptionSelectedClass)},changeDisplayOption:function(e){var t=this.sandbox.dom.data(e.currentTarget,"position");this.setDisplayOption(t),this.sandbox.emit(this.DISPLAY_OPTION_CHANGED(),t)},updateOrder:function(){var e=this.sandbox.dom.find("li",this.$content),t=[];return this.sandbox.util.foreach(e,function(e,n){var r=this.sandbox.dom.find(".num",e);r.html(n+1),t.push(this.sandbox.dom.data(e,"id"))}.bind(this)),t},updateSelectedCounter:function(){var e=this.$content.find("li").length;this.$find(".selected-counter .num").html(e)},addItem:function(e,t,n){typeof t=="undefined"&&(t=!0),typeof n=="undefined"&&(n=!0),this.$list||(this.$list=u.call(this),this.sandbox.dom.html(this.$content,this.$list));var i=this.sandbox.dom.createElement(r.item.call(this,e[this.options.idKey],this.getItemContent(e)));this.sandbox.dom.append(this.$list,i),!t||(this.options.sortable&&o.call(this),this.updateOrder(),this.updateVisibility(),this.updateSelectedCounter()),!n||this.sandbox.dom.scrollAnimate(this.$content.get(0).scrollHeight,this.$content)},removeItemById:function(e){var t=this.sandbox.dom.find("li[data-id="+e+"]",this.$el);this.sandbox.dom.remove(t),this.removeHandler(e),this.updateOrder(),this.updateVisibility(),this.updateSelectedCounter()},removeItem:function(e){var t=this.sandbox.dom.parents(e.currentTarget,"li"),n=this.sandbox.dom.data(t,"id");this.sandbox.dom.remove(t),this.removeHandler(n),this.updateOrder(),this.updateVisibility(),this.updateSelectedCounter()},isDataEmpty:function(e){return this.sandbox.util.isEmpty(e)},getId:function(e){return["#",this.ids[e]].join("")},getUrl:function(e){throw new Error('"getUrl" not implemented')},getItemContent:function(e){throw new Error('"getItemContent" not implemented')},sortHandler:function(e){throw new Error('"sortHandler" not implemented')},removeHandler:function(e){throw new Error('"removeHandler" not implemented')}};return{name:"itembox",initialize:function(e){e.components.addType("itembox",a)}}}),define("husky_extensions/itemgrid",[],function(){"use strict";var e={instanceName:null,url:null,eventNamespace:"husky.itemgrid",idsParameter:"ids",resultKey:null,idKey:"id",dataAttribute:"",dataDefault:{},sortable:!1,removable:!0,translations:{noContentSelected:"listbox.nocontent-selected",viewAll:"public.view-all",viewLess:"public.view-less",of:"public.of",visible:"public.visible",elementsSelected:"public.elements-selected"}},t={noContentClass:"no-content",addIcon:"fa-plus-circle",deleteIcon:"fa-trash-o"},n=function(e){return[this.options.eventNamespace,".",this.options.instanceName?this.options.instanceName+".":"",e].join("")},r={skeleton:function(){return['<div class="listgrid" id="',this.ids.container,'">','    <div class="header">','        <span class="',t.addIcon,' icon left action add-button" id="',this.ids.addButton,'"></span>','        <span class="',t.deleteIcon,' icon left action delete-button" id="',this.ids.deleteButton,'"></span>',"    </div>",'    <div class="content" id="',this.ids.content,'"></div>',"</div>"].join("")}},i=function(){this.sandbox.on(this.DATA_CHANGED(),this.changeData.bind(this)),this.sandbox.on(this.DELETE_BUTTON_CLICKED(),function(){this.sandbox.emit("husky.datagrid."+this.options.instanceName+".items.get-selected",function(e){a.call(this,e)}.bind(this))}.bind(this)),this.sandbox.on(this.ITEM_ADD(),function(e){o.call(this,e)}.bind(this)),this.sandbox.on(this.ITEM_SAVE(),function(e){u.call(this,e)}.bind(this))},s=function(){this.sandbox.dom.on(this.$addButton,"click",function(){this.sandbox.emit(this.ADD_BUTTON_CLICKED())}.bind(this)),this.sandbox.dom.on(this.$deleteButton,"click",function(){this.sandbox.emit(this.DELETE_BUTTON_CLICKED())}.bind(this))},o=function(e){var t=this.getData();if(this.sandbox.util.typeOf(t)!=="array"||this.sandbox.util.typeOf(t[0])!=="object")t=[];t.push(e),this.setData(t)},u=function(e){var t=[],n=this.getData();n.forEach(function(n){n.id===e.id?t.push(e):t.push(n)}.bind(this)),this.setData(t)},a=function(e){this.sandbox.sulu.showDeleteDialog(function(t){if(t){var n=[],r=this.getData();r.forEach(function(t){e.indexOf(t.id)>-1?(this.sandbox.emit("husky.datagrid."+this.options.instanceName+".record.remove",t.id),this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1)):n.push(t)}.bind(this)),this.setData(n)}}.bind(this))},f={DATA_CHANGED:function(){return n.call(this,"data-changed")},ADD_BUTTON_CLICKED:function(){return n.call(this,"add-button-clicked")},DELETE_BUTTON_CLICKED:function(){return n.call(this,"delete-button-clicked")},ITEM_ADD:function(){return n.call(this,"add-item")},ITEM_SAVE:function(){return n.call(this,"save-item")},render:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options);var t=this.getData();this.viewAll=!0,this.ids={container:"listbox-"+this.options.instanceName+"-container",addButton:"listbox-"+this.options.instanceName+"-add",deleteButton:"listbox-"+this.options.instanceName+"-delete",content:"listbox-"+this.options.instanceName+"-content"},this.sandbox.dom.html(this.$el,r.skeleton.call(this)),this.$container=this.sandbox.dom.find(this.getId("container"),this.$el),this.$addButton=this.sandbox.dom.find(this.getId("addButton"),this.$el),this.$deleteButton=this.sandbox.dom.find(this.getId("deleteButton"),this.$el),this.$content=this.sandbox.dom.find(this.getId("content"),this.$el),i.call(this),s.call(this),this.renderContent(t)},getData:function(){return this.sandbox.util.deepCopy(this.sandbox.dom.data(this.$el,this.options.dataAttribute))},setData:function(e,t){this.sandbox.emit(this.DATA_CHANGED(),e,this.$el,t)},changeData:function(e){this.updateOrder(e),this.sandbox.emit("husky.datagrid."+this.options.instanceName+".data.set",e),this.sandbox.dom.data(this.$el,this.options.dataAttribute,e),this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1)},updateOrder:function(e){throw new Error('"updateOrder" not implemented')},editItem:function(e,t){throw new Error('"editItem" not implemented')},getId:function(e){return["#",this.ids[e]].join("")},renderContent:function(e){var t=['<div id="',this.options.instanceName,'-list-toolbar-container"></div>','<div id="itemgrid-list-',this.options.instanceName,'"></div>'].join("");this.sandbox.dom.html(this.$content,t),this.sandbox.start([{name:"datagrid@husky",options:{el:"#itemgrid-list-"+this.options.instanceName,instanceName:this.options.instanceName,view:"table",data:e,matchings:this.options.fieldList,viewOptions:{table:{noItemsText:"public.empty-list"}},actionCallback:function(e,t){this.editItem.call(this,e,t)}.bind(this)}}])}};return{name:"itemgrid",initialize:function(e){e.components.addType("itemgrid",f)}}}),function(){"use strict";window.jQuery?define("jquery",[],function(){return window.jQuery}):require.config({paths:{backbone:"bower_components/jquery/jquery"},shim:{backbone:{exports:"$"}}});var e=function(){var e=new $.Event("remove"),t=$.fn.remove;$.fn.remove=function(){return $(this).trigger(e),t.apply(this,arguments)}};define("husky_extensions/jquery",["jquery"],{name:"jQuery",initialize:function(t){e(),t.core.dom.window=window,t.core.dom.$window=$(window),t.core.dom.document=document,t.core.dom.$document=$(document),t.core.dom.$=$,t.core.dom.createElement=function(e,t){return t=t||{},$(e,t)},t.core.dom.html=function(e,t){return typeof t!="undefined"?$(e).html(t):$(e).html()},t.core.dom.outerHTML=function(e){return $(e).wrapAll("<div></div>").parent().html()},t.core.dom.parseHTML=function(e){return $.parseHTML(e)},t.core.dom.each=function(e,t){$(e).each(t)},t.core.dom.append=function(e,t){return $(e).append(t)},t.core.dom.prepend=function(e,t){return $(e).prepend(t)},t.core.dom.before=function(e,t){return $(e).before(t)},t.core.dom.after=function(e,t){return $(e).after(t)},t.core.dom.css=function(e,t,n){return typeof n!="undefined"?$(e).css(t,n):$(e).css(t)},t.core.dom.addClass=function(e,t){return $(e).addClass(t)},t.core.dom.removeClass=function(e,t){return t?$(e).removeClass(t):$(e).removeClass()},t.core.dom.toggleClass=function(e,t){return $(e).toggleClass(t)},t.core.dom.hasClass=function(e,t){return $(e).hasClass(t)},t.core.dom.prependClass=function(e,t){var n=$(e),r=n.attr("class");t=t+" "+r,n.attr("class",t)},t.core.dom.parent=function(e,t){return $(e).parent(t)},t.core.dom.width=function(e,t){return typeof t!="undefined"?$(e).width(t):$(e).width()},t.core.dom.outerWidth=function(e){return $(e).outerWidth()},t.core.dom.height=function(e,t){return typeof t=="undefined"?$(e).height():$(e).height(t)},t.core.dom.outerHeight=function(e,t){return typeof t=="undefined"?$(e).outerHeight():$(e).outerHeight(t)},t.core.dom.outerWidth=function(e,t){return typeof t=="undefined"?$(e).outerWidth():$(e).outerWidth(t)},t.core.dom.offset=function(e,t){return t?$(e).offset(t):$(e).offset()},t.core.dom.position=function(e){return $(e).position()},t.core.dom.remove=function(e,t){return $(e).remove(t)},t.core.dom.detach=function(e,t){return $(e).detach(t)},t.core.dom.attr=function(e,t,n){return typeof n=="undefined"?(t=t||{},$(e).attr(t)):$(e).attr(t,n)},t.core.dom.removeAttr=function(e,t){return $(e).removeAttr(t)},t.core.dom.is=function(e,t){return $(e).is(t)},t.core.dom.filter=function(e,t){return $(e).filter(t)},t.core.dom.isArray=function(e){return $.isArray(e)},t.core.dom.isNumeric=function(e){return $.isNumeric(e)},t.core.dom.data=function(e,t,n){return!n&&n!==""?$(e).data(t):$(e).data(t,n)},t.core.dom.onReady=function(e){$(window).on("load",e)},t.core.dom.val=function(e,t){return!t&&t!==""?$(e).val():$(e).val(t)},t.core.dom.clearVal=function(e){return $(e).val("")},t.core.dom.blur=function(e){return $(e).blur()},t.core.dom.on=function(e,t,n,r){r?$(e).on(t,r,n):$(e).on(t,n)},t.core.dom.one=function(e,t,n,r){r?$(e).one(t,r,n):$(e).one(t,n)},t.core.dom.off=function(e,t,n,r){r?$(e).off(t,r,n):$(e).off(t,n)},t.core.dom.trigger=function(e,t,n){$(e).trigger(t,n)},t.core.dom.select=function(e,t){return t?$(e).select(t):$(e).select()},t.core.dom.toggleClass=function(e,t){$(e).toggleClass(t)},t.core.dom.parent=function(e,t){return $(e).parent(t)},t.core.dom.parents=function(e,t){return $(e).parents(t)},t.core.dom.children=function(e,t){return $(e).children(t)},t.core.dom.next=function(e,t){return $(e).next(t)},t.core.dom.prev=function(e,t){return $(e).prev(t)},t.core.dom.closest=function(e,t){return $(e).closest(t)},t.core.dom.clone=function(e){return $(e).clone()},t.core.dom.text=function(e,t){return!t&&t!==""?$(e).text():$(e).text(t)},t.core.dom.prop=function(e,t,n){return n!==undefined?$(e).prop(t,n):$(e).prop(t)},t.core.dom.mouseleave=function(e,t){$(e).mouseleave(t)},t.core.dom.stopPropagation=function(e){e.stopPropagation()},t.core.dom.stop=function(e){$(e).stop()},t.core.dom.preventDefault=function(e){e.preventDefault()},t.core.dom.hide=function(e){return $(e).hide()},t.core.dom.show=function(e){return $(e).show()},t.core.dom.trim=function(e){return $.trim(e)},t.core.dom.map=function(e,t){return $(e).map(t)},t.core.dom.get=function(e,t){return $(e).get(t)},t.core.dom.toggle=function(e){return $(e).toggle()},t.core.dom.index=function(e,t){return t?$(e).index(t):$(e).index()},t.core.dom.keypress=function(e,t){$(e).keypress(t)},t.core.dom.insertAt=function(e,n,r,i){if(e===0)t.core.dom.prepend(r,i);else{var s=t.core.dom.find(n+":nth-child("+e+")",r);t.core.dom.after(s,i)}},t.core.dom.scrollToTop=function(e){$(window).scrollTop($(e).offset().top)},t.core.dom.scrollTop=function(e,t){return typeof t!="undefined"?$(e).scrollTop(t):$(e).scrollTop()},t.core.dom.scrollLeft=function(e,t){return typeof t!="undefined"?$(e).scrollLeft(t):$(e).scrollLeft()},t.core.dom.scrollAnimate=function(e,t){t?$(t).animate({scrollTop:e},500):$("html, body").animate({scrollTop:e},500)},t.core.dom.slideUp=function(e,t,n){$(e).slideUp(t,n)},t.core.dom.slideDown=function(e,t,n){$(e).slideDown(t,n)},t.core.dom.last=function(e){return $(e).last()},t.core.dom.fadeIn=function(e,t,n){$(e).fadeIn(t,n)},t.core.dom.fadeTo=function(e,t,n,r){$(e).fadeTo(t,n,r)},t.core.dom.fadeOut=function(e,t,n){$(e).fadeOut(t,n)},t.core.dom.when=function(e){return $.when(e)},t.core.dom.unbind=function(e,t){$(e).unbind(t)},t.core.dom.focus=function(e){$(e).focus()},t.core.dom.click=function(e){$(e).click()},t.core.dom.submit=function(e){$(e).submit()},t.core.dom.animate=function(e,t,n){$(e).animate(t,n)},t.core.dom.empty=function(e){$(e).empty()},t.core.dom.replaceWith=function(e,t){$(e).replaceWith(t)},t.core.dom.inArray=function(e,t){return $.inArray(e,t)},t.core.dom.wrapAll=function(e,t){return $(e).wrapAll(t)},t.core.dom.first=function(e){return $(e).first()},t.core.dom.visible=function(e,n,r,i){if(this.length<1)return;i=i?i:"both",r=typeof r=="undefined"?!0:r;var s=$(e),o=s.length>1?s.eq(0):s,u=o.get(0),a=t.sandbox.dom.$window.width(),f=t.sandbox.dom.$window.height(),l=r===!0?u.offsetWidth*u.offsetHeight:!0,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O;if(typeof u.getBoundingClientRect=="function"){c=u.getBoundingClientRect(),h=c.top>=0&&c.top<f,p=c.bottom>0&&c.bottom<=f,d=c.left>=0&&c.left<a,v=c.right>0&&c.right<=a,m=n?h||p:h&&p,g=n?d||d:d&&v;if(i==="both")return l&&m&&g;if(i==="vertical")return l&&m;if(i==="horizontal")return l&&g}else{y=t.sandbox.dom.$window.scrollTop(),b=y+f,w=t.sandbox.dom.$window.scrollLeft(),E=w+a,S=o.offset(),x=S.top,T=x+o.height(),N=S.left,C=N+o.width(),k=n===!0?T:x,L=n===!0?x:T,A=n===!0?C:N,O=n===!0?N:C;if(i==="both")return!!l&&L<=b&&k>=y&&O<=E&&A>=w;if(i==="vertical")return!!l&&L<=b&&k>=y;if(i==="horizontal")return!!l&&O<=E&&A>=w}},t.core.util.ajax=$.ajax,t.core.util.ajaxError=function(e){$(document).ajaxError(e)},t.core.util.when=function(e){return $.when(e)}}})}(),define("husky_extensions/model",[],function(){"use strict";var e={get:function(e){return this[e]},set:function(e,t){return!!t&&(this[e]=t),this}};return{name:"Model",initialize:function(t){t.sandbox.data.Model=e}}}),function(){"use strict";window.TagsManager?define("tagsManager",[],function(){return window.TagsManager}):require.config({paths:{tagsManager:"bower_components/tagmanager/tagmanager"},shim:{backbone:{deps:["jquery"]}}}),define("husky_extensions/tagmanager",["tagsManager"],{name:"tagsManager",initialize:function(e){e.sandbox.autocompleteList={init:function(t,n){return e.core.dom.$(t).tagsManager(n)}}}})}(),define("husky_extensions/template",["underscore","jquery"],function(e,t){"use strict";function n(t){this.options=e.defaults(t||{},{type:"html",compiler:e.template,lookup:[],components:"aura_components"}),this.cache={},this.options.lookup.push(this.cache)}return n.prototype={load:function(n,r){n=e.isString(n)?[n]:n;var i={},s=[],o,u;return e.each(n,function(e){var t=this.find(r+"/"+e);t?i[e]=t:s.push(e)},this),o=new t.Deferred,s.length?(u=e.map(s,function(e){var t=e+"."+this.options.type;return e.indexOf("/")!==0,"text!"+t},this),require(u,e.bind(function(){e.each(Array.prototype.slice.call(arguments),function(e,t){i[s[t]]=this.options.compiler(e),this.cache[r+"/"+name]=this.options.compiler(e)},this),o.resolve(i)},this),function(e){o.reject(e)})):o.resolve(i),o.promise()},find:function(n,r){r=r||"aura";var i=t("script[data-"+r+'-template="'+n+'"]').html(),s;return i?this.options.compiler(i):(s=e.find(this.options.lookup,function(e){return!!e[n]})||{},s[n])}},function(t){var r=new n(t.config.template);t.core.Components.Base.prototype.renderTemplate=function(e,t){if(typeof this.loadedTemplates[e]=="function"){var n=this.loadedTemplates[e],r={translate:this.sandbox.translate};return t=this.sandbox.util.extend({},r,t),n(t)}return"Template "+e+" not found."},t.components.before("initialize",function(){this.loadedTemplates={};if(!this.templates||!this.templates.length)return;var t=r.load(this.templates,this.options.name);return t.done(e.bind(function(e){this.loadedTemplates=e},this)),t.promise()})}}),function(){"use strict";window.Typeahead?define("typeahead",[],function(){return window.Typeahead}):require.config({paths:{typeahead:"bower_components/typeahead.js/typeahead.bundle"},shim:{backbone:{deps:["jquery"]}}}),define("husky_extensions/typeahead",["typeahead"],{name:"typeahead",initialize:function(e){e.sandbox.autocomplete={init:function(t,n){var r=this.createEngine(n);return r.initialize(),e.core.dom.$(t).typeahead({highlight:!0},{templates:n.templates,displayKey:n.displayKey,source:r.ttAdapter()})},createEngine:function(t){return t=e.sandbox.util.extend(!0,{datumTokenizer:function(e){return Bloodhound.tokenizers.whitespace(e[t.displayKey])},queryTokenizer:Bloodhound.tokenizers.whitespace},t),new Bloodhound(t)},setValue:function(t,n){return e.core.dom.$(t).typeahead("val",n)}}}})}(),function(){"use strict";require.config({paths:{"uri-template":"bower_components/massiveart-uritemplate/uritemplate"}}),define("husky_extensions/uri-template",["uri-template"],function(e){return{name:"uri-template",initialize:function(t){t.sandbox.uritemplate={parse:function(t){return e.parse(t)},expand:function(e,t){return e.expand(t)}}}}})}(),define("husky_extensions/util",["services/husky/util"],function(e){"use strict";return{name:"Util",initialize:function(t){for(var n in e)t.core.util[n]=e[n]}}});
        <link rel="stylesheet" href="/bundles/suluadmin/dist/app.min.1614246819288.css">
        <script data-main="/bundles/suluadmin/dist/app.min.1614246819288" src="/bundles/suluadmin/js/vendor/husky/husky.min.js?v=1614246819288"></script>
    <link rel="stylesheet" href="/bundles/suluadmin/dist/login.min.1614246819288.css">
    <script data-main="/bundles/suluadmin/dist/login.min.1614246819288" src="/bundles/suluadmin/js/vendor/husky/husky.min.js?v=1614246819288"></script>

Fixed code:
define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1634826923308"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==i.href)return clearInterval(s),n()}},10);i.href=t,e.appendChild(i)};return i.normalize=function(e,t){return e.substr(e.length-4,4)==".css"&&(e=e.substr(0,e.length-4)),t(e)},i.load=function(e,t,r,i){(n?p:d)(t.toUrl(e+".css"),r)},i}),define("config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU)),t=e.sections?e.sections:{};return{set:function(e,n){!!e&&typeof e=="string"&&(t[e]=n)},has:function(e){return!!e&&typeof e=="string"&&t.hasOwnProperty(e)},get:function(e){var n,r=null;return this.has(e)&&(r=t[e],typeof r=="object"&&(n=r instanceof Array?[]:{},r=jQuery.extend(!0,n,r))),r}}}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("<div/>"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('<div class="sulu-header"/>'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r<e.length;r++)t?n[e[r].name]=r:n.push(e[r].name);return n},n="sulu.fields.loaded";e.sandbox.sulu.viewStates={},e.sandbox.sulu.unlockDeleteSuccessLabel=function(){e.sandbox.sulu.viewStates.nodeDeleted=!0},e.sandbox.sulu.triggerDeleteSuccessLabel=function(t){e.sandbox.sulu.viewStates.nodeDeleted===!0&&(t=t||"labels.success.content-deleted-desc",e.sandbox.emit("sulu.labels.success.show",t,"labels.success"),delete e.sandbox.sulu.viewStates.nodeDeleted)},e.sandbox.sulu.loadUrlAndMergeWithSetting=function(r,i,s,o,u){this.sandbox.util.load(s).then(function(s){!!u&&typeof u=="function"&&(s=_.filter(s,u));var a=e.sandbox.sulu.getUserSetting(r),f=s,l=[],c,h,p,d,v,m,g;a?(v=t.call(this,f),m=t.call(this,f),g=t.call(this,f,!0),d=t.call(this,a),this.sandbox.util.foreach(d,function(e,t){h=m.indexOf(e);if(h>=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s<u;)o(r,i[s])},e.sandbox.sulu.createAddressString=function(e){var t="";if(!e&&typeof e!="object")throw new Error("no valid address object");return r=!0,!e.street||(t=i(t,""),t+=e.street),!e.number||(t=i(t," "),t+=e.number),!e.addition||(t=i(t," - "),t+=e.addition),!e.zip||(t=i(t,", "),t+=e.zip),!e.city||(e.city?t=i(t," "):t=i(t,", "),t+=e.city),!e.state||(t=i(t,", "),t+=e.state),!e.country||(t=i(t,", "),typeof e.country=="string"?t+=e.country:t+=e.country.name),t},e.sandbox.sulu.initListToolbarAndList=function(e,t,n,r,i,o){var u=e+"Order",a=e+"Fields",f=e+"DropdownPageSize",l=e+"InfinitePageSize",c=this.sandbox.sulu.getUserSetting(f),h=this.sandbox.sulu.getUserSetting(l),p=this.sandbox.sulu.getUserSetting(u),d=typeof t=="string"?t:null,v=function(e){var t={columnOptions:{data:e,key:a,url:d},instanceName:"content",context:i},v=this.sandbox.util.extend(!0,{},t,n),m={view:"table",pagination:"dropdown",paginationOptions:{},matchings:e,selectedCounter:!0,viewOptions:{table:{noItemsText:"public.empty-list"}}},g={dropdown:{limit:c},"infinite-scroll":{limit:h}},y,b="husky.datagrid.";!c||(m.paginationOptions.dropdown=g.dropdown),!h||(m.paginationOptions.dropdown=g["infinite-scroll"]),y=this.sandbox.util.extend(!0,{},m,r),y.url=s(y.url,p),this.sandbox.emit("sulu.list.preload",y),y.searchInstanceName=y.searchInstanceName||v.instanceName,y.columnOptionsInstanceName=y.columnOptionsInstanceName||v.instanceName,v.datagridInstanceName=y.instanceName,v.listInfoContainerSelector=o,v.searchOptions={storageName:y.storageName||null},this.sandbox.start([{name:"list-toolbar@suluadmin",options:v},{name:"datagrid@husky",options:y}]),!y.instanceName||(b+=y.instanceName+"."),this.sandbox.on(b+"page-size.changed",function(e,t){var n=f;t==="infinite-scroll"&&(n=l),this.sandbox.sulu.saveUserSetting(n,e)}.bind(this)),this.sandbox.on(b+"data.sort",function(e){this.sandbox.sulu.saveUserSetting(u,e)}.bind(this))};d?this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,a,["translation","default","editable","validation","width","type"],d,v.bind(this),function(e){return!e.display||e.display!=="never"}):v.call(this,t)},e.sandbox.sulu.initList=function(e,t,n){this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,e,["translation","default","editable","validation","width","type"],t,function(e){var t={view:"table",pagination:"dropdown",selectedCounter:!0,matchings:e};t=this.sandbox.util.extend(!0,{},t,n),this.sandbox.start([{name:"datagrid@husky",options:t}])}.bind(this))},e.sandbox.sulu.showLoader=function(e){this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#ccc"}}])}}})}(),function(){"use strict";var e=function(e,t,n){var r=t.parent||e,i=t.options||{},s=this.sandbox.util.extend(!0,{},n[r],i);return s.id=e,s};define("aura_extensions/sulu-buttons",[],{initialize:function(t){var n={},r={},i,s;t.sandbox.sulu.buttons={},t.sandbox.sulu.buttons.dropdownItems={},t.sandbox.sulu.buttons.add=function(e,t){if(!!n[e])throw new Error('Sulu.buttons: Button with name "'+e+'" already exists!');n[e]=t},t.sandbox.sulu.buttons.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.dropdownItems.add=function(e,t){if(!!r[e])throw new Error('Sulu.buttons: Dropdown-item with name "'+e+'" already exists!');r[e]=t},t.sandbox.sulu.buttons.dropdownItems.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.dropdownItems.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.get=function(i){var s=[],o;return t.sandbox.util.foreach(Object.keys(i),function(u){o=e.call(t,u,i[u],n);if(!!o.dropdownItems){var a=o.dropdownItems;t.sandbox.dom.isArray(a)||(a=[],t.sandbox.util.foreach(Object.keys(o.dropdownItems),function(n){a.push(e.call(t,n,o.dropdownItems[n],r))}.bind(this))),o.dropdownItems=a}!o||s.push(o)}),s},t.sandbox.sulu.buttons.getApiButton=function(e){return t.sandbox.util.extend(!0,{},n[e])},i=[{name:"add",template:{icon:"plus-circle",title:"public.add-new","class":"highlight",callback:function(){t.sandbox.emit("sulu.toolbar.add")}}},{name:"deleteSelected",template:{icon:"trash-o",title:"public.delete-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"delete",template:{icon:"trash-o",title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"settings",template:{title:"public.settings",icon:"gear",callback:function(){t.sandbox.emit("sulu.toolbar.settings")}}},{name:"export",template:{title:"public.export",icon:"download",callback:function(){var e=$("<div/>");$("body").append(e),App.start([{name:"csv-export@suluadmin",options:{el:e,urlParameter:this.urlParameter,url:this.url}}])}}},{name:"edit",template:{title:"public.edit",icon:"pencil",callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"editSelected",template:{icon:"pencil",title:"public.edit-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"refresh",template:{icon:"refresh",title:"public.refresh",callback:function(){t.sandbox.emit("sulu.toolbar.refresh")}}},{name:"layout",template:{icon:"th-large",title:"public.layout",dropdownOptions:{markSelected:!0},dropdownItems:{smallThumbnails:{},bigThumbnails:{},table:{}}}},{name:"save",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")}}},{name:"toggler",template:{title:"",content:'<div data-aura-component="toggler@husky" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"toggler-on",template:{title:"",content:'<div data-aura-component="toggler@husky" data-checked="true" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"saveWithOptions",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")},dropdownItems:{saveBack:{},saveNew:{}},dropdownOptions:{onlyOnClickOnArrow:!0}}}],s=[{name:"smallThumbnails",template:{title:"sulu.toolbar.small-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-small")}}},{name:"bigThumbnails",template:{title:"sulu.toolbar.big-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-large")}}},{name:"table",template:{title:"sulu.toolbar.table",callback:function(){t.sandbox.emit("sulu.toolbar.change.table")}}},{name:"saveBack",template:{title:"public.save-and-back",callback:function(){t.sandbox.emit("sulu.toolbar.save","back")}}},{name:"saveNew",template:{title:"public.save-and-new",callback:function(){t.sandbox.emit("sulu.toolbar.save","new")}}},{name:"delete",template:{title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}}],t.sandbox.sulu.buttons.push(i),t.sandbox.sulu.buttons.dropdownItems.push(s)}})}(),function(){"use strict";define("aura_extensions/url-manager",["app-config"],function(e){return{name:"url-manager",initialize:function(t){var n=t.sandbox,r={},i=[];n.urlManager={},n.urlManager.setUrl=function(e,t,n,s){r[e]={template:t,handler:n},!s||i.push(s)},n.urlManager.getUrl=function(t,s){var o,u;if(t in r)o=r[t];else for(var a=-1,f=i.length,l;++a<f;){l=i[a](t);if(l in r){o=r[l];break}}return o?(o.handler&&(s=o.handler.call(this,s)),_.extend(s,{languageCode:e.getUser().locale},{}),u=o.template,typeof u=="function"&&(u=o.template.call(this,s)),n.template.parse(u,s)):null}}}})}(),define("aura_extensions/default-extension",[],function(){"use strict";return function(e){e.components.before("initialize",function(){if(!this.defaults)return;!this.defaults.options||(this.options=this.sandbox.util.extend(!0,{},this.defaults.options,this.options));if(!!this.defaults.translations){var e=this.sandbox.util.extend(!0,{},this.defaults.translations,this.options.translations||{});this.translations=this.sandbox.util.object(this.sandbox.util.arrayMap(e,function(e,t){return[t,this.sandbox.translate(e)]}.bind(this)))}if(!!this.defaults.templates){var t=this.sandbox.util.extend(!0,{},this.defaults.templates,this.options.templates||{});this.templates=this.sandbox.util.object(this.sandbox.util.arrayMap(t,function(e,t){return[t,this.sandbox.util.template(e)]}.bind(this)))}})}}),define("aura_extensions/event-extension",[],function(){"use strict";var e=function(e,t,n){return e+(n?n+".":"")+t},t=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(){var e=[].splice.call(arguments,0);e.splice(0,0,r),this.sandbox.emit.apply(this,e)}.bind(this)},n=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.on(r,e)}.bind(this)},r=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.once(r,e)}.bind(this)};return function(i){i.sandbox.events.createEventName=e,i.components.before("initialize",function(){if(!this.events)return;this.events=this.sandbox.util.object(this.sandbox.util.arrayMap(this.events.names,function(e,i){return e.type==="on"?[i,n.call(this,this.events.namespace,e.postFix,e.callback)]:e.type==="once"?[i,r.call(this,this.events.namespace,e.postFix,e.callback)]:[i,t.call(this,this.events.namespace,e.postFix)]}.bind(this)))})}}),define("aura_extensions/sticky-toolbar",[],function(){"use strict";var e={scrollContainerSelector:".content-column > .wrapper .page",fixedClass:"fixed",scrollMarginTop:90,stickyToolbarClass:"sticky-toolbar"},t=function(t,n,r){n>(r||e.scrollMarginTop)?t.addClass(e.fixedClass):t.removeClass(e.fixedClass)};return function(n){n.sandbox.stickyToolbar={enable:function(r,i){r.addClass(e.stickyToolbarClass),n.sandbox.dom.on(e.scrollContainerSelector,"scroll.sticky-toolbar",function(){t(r,n.sandbox.dom.scrollTop(e.scrollContainerSelector),i)})},disable:function(t){t.removeClass(e.stickyToolbarClass),n.sandbox.dom.off(e.scrollContainerSelector,"scroll.sticky-toolbar")},reset:function(t){t.removeClass(e.fixedClass)}},n.components.after("initialize",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.enable(this.$el,typeof this.stickyToolbar=="number"?this.stickyToolbar:null)}),n.components.before("destroy",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.disable(this.$el)})}}),function(e){if(typeof exports=="object"&&typeof module!="undefined")module.exports=e();else if(typeof define=="function"&&define.amd)define("vendor/clipboard/clipboard",[],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.Clipboard=e()}}(function(){var e,t,n;return function r(e,t,n){function i(o,u){if(!t[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,r,e,t,n)}return t[o].exports}var s=typeof require=="function"&&require;for(var o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,n){function s(e,t){while(e&&e.nodeType!==r){if(typeof e.matches=="function"&&e.matches(t))return e;e=e.parentNode}}var r=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}t.exports=s},{}],2:[function(e,t,n){function i(e,t,n,r,i){var o=s.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}function s(e,t,n,i){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&i.call(e,n)}}var r=e("./closest");t.exports=i},{"./closest":1}],3:[function(e,t,n){n.node=function(e){return e!==undefined&&e instanceof HTMLElement&&e.nodeType===1},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return e!==undefined&&(t==="[object NodeList]"||t==="[object HTMLCollection]")&&"length"in e&&(e.length===0||n.node(e[0]))},n.string=function(e){return typeof e=="string"||e instanceof String},n.fn=function(e){var t=Object.prototype.toString.call(e);return t==="[object Function]"}},{}],4:[function(e,t,n){function s(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return o(e,t,n);if(r.nodeList(e))return u(e,t,n);if(r.string(e))return a(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function o(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function u(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function a(e,t,n){return i(document.body,e,t,n)}var r=e("./is"),i=e("delegate");t.exports=s},{"./is":3,delegate:2}],5:[function(e,t,n){function r(e){var t;if(e.nodeName==="SELECT")e.focus(),t=e.value;else if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(e),r.removeAllRanges(),r.addRange(i),t=r.toString()}return t}t.exports=r},{}],6:[function(e,t,n){function r(){}r.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var s=0,o=r.length;s<o;s++)r[s].fn!==t&&r[s].fn._!==t&&i.push(r[s]);return i.length?n[e]=i:delete n[e],this}},t.exports=r},{}],7:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","select"],s);else if(typeof r!="undefined")s(n,t("select"));else{var o={exports:{}};s(o,i.select),i.clipboardAction=o.exports}})(this,function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=r(t),i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(){function e(t){s(this,e),this.resolveOptions(t),this.initSelection()}return o(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=function(e){function t(e,n){f(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.resolveOptions(n),r.listenClick(e),r}return h(t,e),l(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'<div class="sulu-dashboard" data-aura-component="dashboard@suluadmin"/>'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("<div/>"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['<div class="blue-row"></div>','<div class="toolbar-row">','   <div class="left-container '+t.backClass+'">','       <span class="fa-'+t.backIcon+'"></span>',"   </div>",'   <div class="toolbar-container">','       <div class="'+t.toolbarClass+'"></div>',"   </div>",'   <div class="right-container">',"   </div>","</div>"].join(""),tabsRow:['<div class="',t.tabsRowClass,'">','    <div class="',t.tabsClass,'"></div>',"</div>"].join(""),languageChanger:['<div class="language-changer">','   <span class="title"><%= title %></span>','   <span class="dropdown-toggle"></span>',"</div>"].join(""),titleElement:['<div class="'+t.contentTitleClass+'">','   <div class="content-title <% if(!!underline){ %>underlined<% } %>">',"       <h2><%= title %></h2>","   </div>","</div>"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('<div class="'+t.breadcrumbContainerClass+'"/>'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("<div/>"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t<n;)e.push({id:this.sandbox.sulu.locales[t],title:this.sandbox.sulu.locales[t]});return e},startToolbarComponent:function(e,n){var r=this.sandbox.dom.createElement("<div />"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('<div class="'+t.tabsContentClass+'"/>');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e<this.options.scrollDelta?(this.showTabs(),this.oldScrollPosition=e):e>=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('<div class="'+t.tabsLabelContainer+'"/>');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['<span class="breadcrumb">','<% if (!!icon) { %><span class="<%= icon %> icon"></span><% } %><%= title %><span class="fa-chevron-right separator"></span>',"</span>"].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'<div id="column-options-overlay" />'),this.sandbox.start([{name:"column-options@husky",options:{el:"#column-options-overlay",data:this.sandbox.sulu.getUserSetting(this.options.columnOptions.key),hidden:!1,instanceName:this.options.instanceName,trigger:".toggle",header:{title:this.sandbox.translate("list-toolbar.column-options.title")}}}]),e=this.options.instanceName?this.options.instanceName+".":"",this.sandbox.once("husky.column-options."+e+"saved",function(e){this.sandbox.sulu.saveUserSetting(this.options.columnOptions.key,e)}.bind(this))}.bind(this)}},i=function(e,t){var n=e.slice(0),r=[];return this.sandbox.util.foreach(e,function(e){r.push(e.id)}.bind(this)),this.sandbox.util.foreach(t,function(e){var t=r.indexOf(e.id);t<0?n.push(e):n[t]=e}.bind(this)),n},s=function(e,t){if(typeof e=="string")try{e=JSON.parse(e)}catch(n){t[e]?e=t[e].call(this):this.sandbox.logger.log("no template found!")}else typeof e=="function"&&(e=e.call(this));return e},o=function(e){var t,n,i;for(t=-1,n=e.length;++t<n;)i=e[t],i.hasOwnProperty("dropdownItems")&&(i.dropdownItems=o.call(this,i.dropdownItems)),i.hasOwnProperty("type")&&i.type==="columnOptions"&&(e[t]=this.sandbox.util.extend({},r.call(this),i));return e},u=function(e){this.sandbox.dom.addClass(e.el,"list-toolbar"),this.sandbox.start([{name:"toolbar@husky",options:e}])};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.template=s.call(this,this.options.template,t),this.options.listener=s.call(this,this.options.listener,n),!this.options.parentTemplate||(this.options.parentTemplate=s.call(this,this.options.parentTemplate,t),this.options.parentListener=s.call(this,this.options.parentListener,n),this.options.template=i.call(this,this.options.parentTemplate,this.options.template)),this.sandbox.emit("sulu.list-toolbar.extend",this.options.context,this.options.template,this.options.instanceName,this.options.datagridInstanceName,this.options.listInfoContainerSelector),this.options.template=o.call(this,this.options.template);var r,a={groups:this.options.groups,hasSearch:!0,buttons:this.options.template,instanceName:this.options.instanceName,showTitleAsTooltip:this.options.showTitleAsTooltip,showTitle:!1,searchOptions:this.options.searchOptions||{}};this.options.hasOwnProperty("hasSearch")&&(a.hasSearch=this.options.hasSearch),this.options.listener&&this.options.listener.call(this),this.options.parentListener&&this.options.parentListener.call(this),r=this.sandbox.dom.createElement("<div />"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("<div/>"),r;return typeof e!="undefined"?(r=e,this.removeLabelWithId(e)):(this.labelId=this.labelId+1,r=this.labelId),this.sandbox.dom.attr(n,"id","sulu-labels-"+r),this.sandbox.dom.attr(n,"data-id",r),t?this.$navigationLabels.prepend(n):this.sandbox.dom.prepend(this.$el,n),n},removeLabelWithId:function(e){var t=this.labelsById[e];!t||(delete this.labels[t.type][t.description],delete this.labelsById[e],this.sandbox.dom.remove(this.sandbox.dom.find("[data-id='"+e+"']",this.$el)))},showLabel:function(e,t,n,r,i,s){r=r||++this.labelId,this.labels[e][t]?this.sandbox.emit("husky.label."+this.labels[e][t]+".refresh"):(this.startLabelComponent({type:e,description:this.sandbox.translate(t),title:this.sandbox.translate(n),el:this.createLabelContainer(r,i),instanceName:r,autoVanish:s}),this.labels[e][t]=r,this.labelsById[r]={type:e,description:t},this.sandbox.once("husky.label."+r+".destroyed",function(){this.removeLabelWithId(r)}.bind(this)))},startLabelComponent:function(e){this.sandbox.start([{name:"label@husky",options:e}])}}}),define("__component__$sidebar@suluadmin",[],function(){"use strict";var e={instanceName:"",url:"",expandable:!0},t={widgetContainerSelector:"#sulu-widgets",componentClass:"sulu-sidebar",columnSelector:".sidebar-column",fixedWidthClass:"fixed",maxWidthClass:"max",loaderClass:"sidebar-loader",visibleSidebarClass:"has-visible-sidebar",maxSidebarClass:"has-max-sidebar",noVisibleSidebarClass:"has-no-visible-sidebar",hiddenClass:"hidden"},n=function(){return h.call(this,"initialized")},r=function(){return h.call(this,"hide")},i=function(){return h.call(this,"show")},s=function(){return h.call(this,"append-widget")},o=function(){return h.call(this,"prepend-widget")},u=function(){return h.call(this,"set-widget")},a=function(){return h.call(this,"empty")},f=function(){return h.call(this,"change-width")},l=function(){return h.call(this,"add-classes")},c=function(){return h.call(this,"reset-classes")},h=function(e){return"sulu.sidebar."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.widgets=[],this.bindCustomEvents(),this.render(),this.sandbox.emit(n.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.hideColumn()},bindCustomEvents:function(){this.sandbox.on(f.call(this),this.changeWidth.bind(this)),this.sandbox.on(r.call(this),this.hideColumn.bind(this)),this.sandbox.on(i.call(this),this.showColumn.bind(this)),this.sandbox.on(u.call(this),this.setWidget.bind(this)),this.sandbox.on(s.call(this),this.appendWidget.bind(this)),this.sandbox.on(o.call(this),this.prependWidget.bind(this)),this.sandbox.on(a.call(this),this.emptySidebar.bind(this)),this.sandbox.on(c.call(this),this.resetClasses.bind(this)),this.sandbox.on(l.call(this),this.addClasses.bind(this))},resetClasses:function(){this.sandbox.dom.removeClass(this.$el),this.sandbox.dom.addClass(this.$el,t.componentClass)},addClasses:function(e){this.sandbox.dom.addClass(this.$el,e)},changeWidth:function(e){this.width=e,e==="fixed"?this.changeToFixedWidth():e==="max"&&this.changeToMaxWidth(),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.fixedWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.maxWidthClass),this.sandbox.dom.addClass(e,t.fixedWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.prepend(n,e),this.sandbox.dom.removeClass(n,t.maxSidebarClass))},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.maxWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.append(n,e),this.sandbox.dom.addClass(n,t.maxSidebarClass))},hideColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeToFixedWidth(),this.sandbox.dom.removeClass(n,t.visibleSidebarClass),this.sandbox.dom.addClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},showColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeWidth(this.width),this.sandbox.dom.removeClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(n,t.visibleSidebarClass),this.sandbox.dom.removeClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},appendWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t)},prependWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.unshift({url:e,$el:n}),this.sandbox.dom.prepend(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.prepend(this.$el,t)},setWidget:function(e,t){if(!t){if(this.widgets.length!==1||this.widgets[0].url!==e){var n;this.emptySidebar(!1),this.loadWidget(e).then(function(t){if(t===undefined||t===""){this.sandbox.dom.css(this.$el,"display","none");return}n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(this.$el,n),this.sandbox.dom.css(this.$el,"display","block")}.bind(this))}}else t=$(t),this.emptySidebar(!0),this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t),this.sandbox.start(this.$el),this.sandbox.dom.css(this.$el,"display","block")},loadWidget:function(e){var t=this.sandbox.data.deferred();return this.showColumn(),this.startLoader(),this.sandbox.util.load(e,null,"html").then(function(e){this.stopLoader(),t.resolve(e)}.bind(this)),t.promise()},emptySidebar:function(e){while(this.widgets.length>0)this.sandbox.stop(this.widgets[0].$el),this.sandbox.dom.remove(this.widgets[0].$el),this.widgets.splice(0,1);e!==!0&&this.hideColumn()},startLoader:function(){var e=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>');this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#e4e4e4"}}])},stopLoader:function(){this.sandbox.stop(this.$find("."+t.loaderClass))}}}),define("__component__$data-overlay@suluadmin",[],function(){"use strict";var e={instanceName:"",component:""},t={main:['<div class="data-overlay">','<button class="fa-times data-overlay-close btn btn-link"></button>','<div class="data-overlay-content"></div>',"</div>"].join("")},n=function(e){return"sulu.data-overlay."+(this.options.instanceName?this.options.instanceName+".":"")+e},r=function(){return n.call(this,"initialized")},i=function(){return n.call(this,"show")},s=function(){return n.call(this,"hide")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.mainTemplate=this.sandbox.util.template(t.main),this.render(),this.startComponent(),this.bindEvents(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},bindEvents:function(){this.sandbox.on(i.call(this),this.show.bind(this)),this.sandbox.on(s.call(this),this.hide.bind(this))},bindDomEvents:function(){this.$el.on("click",".data-overlay-close",this.hide.bind(this))},render:function(){var e=this.mainTemplate();this.$el.html(e)},startComponent:function(){var e=this.options.component;if(!e)throw new Error("No component defined!");this.sandbox.start([{name:e,options:{el:".data-overlay-content"}}])},show:function(){this.$el.fadeIn(150)},hide:function(){this.$el.fadeOut(150)}}});
define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1634826923308"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==i.href)return clearInterval(s),n()}},10);i.href=t,e.appendChild(i)};return i.normalize=function(e,t){return e.substr(e.length-4,4)==".css"&&(e=e.substr(0,e.length-4)),t(e)},i.load=function(e,t,r,i){(n?p:d)(t.toUrl(e+".css"),r)},i}),define("config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU)),t=e.sections?e.sections:{};return{set:function(e,n){!!e&&typeof e=="string"&&(t[e]=n)},has:function(e){return!!e&&typeof e=="string"&&t.hasOwnProperty(e)},get:function(e){var n,r=null;return this.has(e)&&(r=t[e],typeof r=="object"&&(n=r instanceof Array?[]:{},r=jQuery.extend(!0,n,r))),r}}}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("<div/>"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('<div class="sulu-header"/>'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r<e.length;r++)t?n[e[r].name]=r:n.push(e[r].name);return n},n="sulu.fields.loaded";e.sandbox.sulu.viewStates={},e.sandbox.sulu.unlockDeleteSuccessLabel=function(){e.sandbox.sulu.viewStates.nodeDeleted=!0},e.sandbox.sulu.triggerDeleteSuccessLabel=function(t){e.sandbox.sulu.viewStates.nodeDeleted===!0&&(t=t||"labels.success.content-deleted-desc",e.sandbox.emit("sulu.labels.success.show",t,"labels.success"),delete e.sandbox.sulu.viewStates.nodeDeleted)},e.sandbox.sulu.loadUrlAndMergeWithSetting=function(r,i,s,o,u){this.sandbox.util.load(s).then(function(s){!!u&&typeof u=="function"&&(s=_.filter(s,u));var a=e.sandbox.sulu.getUserSetting(r),f=s,l=[],c,h,p,d,v,m,g;a?(v=t.call(this,f),m=t.call(this,f),g=t.call(this,f,!0),d=t.call(this,a),this.sandbox.util.foreach(d,function(e,t){h=m.indexOf(e);if(h>=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s<u;)o(r,i[s])},e.sandbox.sulu.createAddressString=function(e){var t="";if(!e&&typeof e!="object")throw new Error("no valid address object");return r=!0,!e.street||(t=i(t,""),t+=e.street),!e.number||(t=i(t," "),t+=e.number),!e.addition||(t=i(t," - "),t+=e.addition),!e.zip||(t=i(t,", "),t+=e.zip),!e.city||(e.city?t=i(t," "):t=i(t,", "),t+=e.city),!e.state||(t=i(t,", "),t+=e.state),!e.country||(t=i(t,", "),typeof e.country=="string"?t+=e.country:t+=e.country.name),t},e.sandbox.sulu.initListToolbarAndList=function(e,t,n,r,i,o){var u=e+"Order",a=e+"Fields",f=e+"DropdownPageSize",l=e+"InfinitePageSize",c=this.sandbox.sulu.getUserSetting(f),h=this.sandbox.sulu.getUserSetting(l),p=this.sandbox.sulu.getUserSetting(u),d=typeof t=="string"?t:null,v=function(e){var t={columnOptions:{data:e,key:a,url:d},instanceName:"content",context:i},v=this.sandbox.util.extend(!0,{},t,n),m={view:"table",pagination:"dropdown",paginationOptions:{},matchings:e,selectedCounter:!0,viewOptions:{table:{noItemsText:"public.empty-list"}}},g={dropdown:{limit:c},"infinite-scroll":{limit:h}},y,b="husky.datagrid.";!c||(m.paginationOptions.dropdown=g.dropdown),!h||(m.paginationOptions.dropdown=g["infinite-scroll"]),y=this.sandbox.util.extend(!0,{},m,r),y.url=s(y.url,p),this.sandbox.emit("sulu.list.preload",y),y.searchInstanceName=y.searchInstanceName||v.instanceName,y.columnOptionsInstanceName=y.columnOptionsInstanceName||v.instanceName,v.datagridInstanceName=y.instanceName,v.listInfoContainerSelector=o,v.searchOptions={storageName:y.storageName||null},this.sandbox.start([{name:"list-toolbar@suluadmin",options:v},{name:"datagrid@husky",options:y}]),!y.instanceName||(b+=y.instanceName+"."),this.sandbox.on(b+"page-size.changed",function(e,t){var n=f;t==="infinite-scroll"&&(n=l),this.sandbox.sulu.saveUserSetting(n,e)}.bind(this)),this.sandbox.on(b+"data.sort",function(e){this.sandbox.sulu.saveUserSetting(u,e)}.bind(this))};d?this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,a,["translation","default","editable","validation","width","type"],d,v.bind(this),function(e){return!e.display||e.display!=="never"}):v.call(this,t)},e.sandbox.sulu.initList=function(e,t,n){this.sandbox.sulu.loadUrlAndMergeWithSetting.call(this,e,["translation","default","editable","validation","width","type"],t,function(e){var t={view:"table",pagination:"dropdown",selectedCounter:!0,matchings:e};t=this.sandbox.util.extend(!0,{},t,n),this.sandbox.start([{name:"datagrid@husky",options:t}])}.bind(this))},e.sandbox.sulu.showLoader=function(e){this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#ccc"}}])}}})}(),function(){"use strict";var e=function(e,t,n){var r=t.parent||e,i=t.options||{},s=this.sandbox.util.extend(!0,{},n[r],i);return s.id=e,s};define("aura_extensions/sulu-buttons",[],{initialize:function(t){var n={},r={},i,s;t.sandbox.sulu.buttons={},t.sandbox.sulu.buttons.dropdownItems={},t.sandbox.sulu.buttons.add=function(e,t){if(!!n[e])throw new Error('Sulu.buttons: Button with name "'+e+'" already exists!');n[e]=t},t.sandbox.sulu.buttons.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.dropdownItems.add=function(e,t){if(!!r[e])throw new Error('Sulu.buttons: Dropdown-item with name "'+e+'" already exists!');r[e]=t},t.sandbox.sulu.buttons.dropdownItems.push=function(e){t.sandbox.util.foreach(e,function(e){this.sandbox.sulu.buttons.dropdownItems.add(e.name,e.template)}.bind(t))},t.sandbox.sulu.buttons.get=function(i){var s=[],o;return t.sandbox.util.foreach(Object.keys(i),function(u){o=e.call(t,u,i[u],n);if(!!o.dropdownItems){var a=o.dropdownItems;t.sandbox.dom.isArray(a)||(a=[],t.sandbox.util.foreach(Object.keys(o.dropdownItems),function(n){a.push(e.call(t,n,o.dropdownItems[n],r))}.bind(this))),o.dropdownItems=a}!o||s.push(o)}),s},t.sandbox.sulu.buttons.getApiButton=function(e){return t.sandbox.util.extend(!0,{},n[e])},i=[{name:"add",template:{icon:"plus-circle",title:"public.add-new","class":"highlight",callback:function(){t.sandbox.emit("sulu.toolbar.add")}}},{name:"deleteSelected",template:{icon:"trash-o",title:"public.delete-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"delete",template:{icon:"trash-o",title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}},{name:"settings",template:{title:"public.settings",icon:"gear",callback:function(){t.sandbox.emit("sulu.toolbar.settings")}}},{name:"export",template:{title:"public.export",icon:"download",callback:function(){var e=$("<div/>");$("body").append(e),App.start([{name:"csv-export@suluadmin",options:{el:e,urlParameter:this.urlParameter,url:this.url}}])}}},{name:"edit",template:{title:"public.edit",icon:"pencil",callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"editSelected",template:{icon:"pencil",title:"public.edit-selected",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.edit")}}},{name:"refresh",template:{icon:"refresh",title:"public.refresh",callback:function(){t.sandbox.emit("sulu.toolbar.refresh")}}},{name:"layout",template:{icon:"th-large",title:"public.layout",dropdownOptions:{markSelected:!0},dropdownItems:{smallThumbnails:{},bigThumbnails:{},table:{}}}},{name:"save",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")}}},{name:"toggler",template:{title:"",content:'<div data-aura-component="toggler@husky" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"toggler-on",template:{title:"",content:'<div data-aura-component="toggler@husky" data-checked="true" data-aura-instance-name="sulu-toolbar"></div>'}},{name:"saveWithOptions",template:{icon:"floppy-o",title:"public.save",disabled:!0,callback:function(){t.sandbox.emit("sulu.toolbar.save","edit")},dropdownItems:{saveBack:{},saveNew:{}},dropdownOptions:{onlyOnClickOnArrow:!0}}}],s=[{name:"smallThumbnails",template:{title:"sulu.toolbar.small-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-small")}}},{name:"bigThumbnails",template:{title:"sulu.toolbar.big-thumbnails",callback:function(){t.sandbox.emit("sulu.toolbar.change.thumbnail-large")}}},{name:"table",template:{title:"sulu.toolbar.table",callback:function(){t.sandbox.emit("sulu.toolbar.change.table")}}},{name:"saveBack",template:{title:"public.save-and-back",callback:function(){t.sandbox.emit("sulu.toolbar.save","back")}}},{name:"saveNew",template:{title:"public.save-and-new",callback:function(){t.sandbox.emit("sulu.toolbar.save","new")}}},{name:"delete",template:{title:"public.delete",callback:function(){t.sandbox.emit("sulu.toolbar.delete")}}}],t.sandbox.sulu.buttons.push(i),t.sandbox.sulu.buttons.dropdownItems.push(s)}})}(),function(){"use strict";define("aura_extensions/url-manager",["app-config"],function(e){return{name:"url-manager",initialize:function(t){var n=t.sandbox,r={},i=[];n.urlManager={},n.urlManager.setUrl=function(e,t,n,s){r[e]={template:t,handler:n},!s||i.push(s)},n.urlManager.getUrl=function(t,s){var o,u;if(t in r)o=r[t];else for(var a=-1,f=i.length,l;++a<f;){l=i[a](t);if(l in r){o=r[l];break}}return o?(o.handler&&(s=o.handler.call(this,s)),_.extend(s,{languageCode:e.getUser().locale},{}),u=o.template,typeof u=="function"&&(u=o.template.call(this,s)),n.template.parse(u,s)):null}}}})}(),define("aura_extensions/default-extension",[],function(){"use strict";return function(e){e.components.before("initialize",function(){if(!this.defaults)return;!this.defaults.options||(this.options=this.sandbox.util.extend(!0,{},this.defaults.options,this.options));if(!!this.defaults.translations){var e=this.sandbox.util.extend(!0,{},this.defaults.translations,this.options.translations||{});this.translations=this.sandbox.util.object(this.sandbox.util.arrayMap(e,function(e,t){return[t,this.sandbox.translate(e)]}.bind(this)))}if(!!this.defaults.templates){var t=this.sandbox.util.extend(!0,{},this.defaults.templates,this.options.templates||{});this.templates=this.sandbox.util.object(this.sandbox.util.arrayMap(t,function(e,t){return[t,this.sandbox.util.template(e)]}.bind(this)))}})}}),define("aura_extensions/event-extension",[],function(){"use strict";var e=function(e,t,n){return e+(n?n+".":"")+t},t=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(){var e=[].splice.call(arguments,0);e.splice(0,0,r),this.sandbox.emit.apply(this,e)}.bind(this)},n=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.on(r,e)}.bind(this)},r=function(t,n){var r=e.call(this,t,n,this.options.instanceName);return function(e){this.sandbox.once(r,e)}.bind(this)};return function(i){i.sandbox.events.createEventName=e,i.components.before("initialize",function(){if(!this.events)return;this.events=this.sandbox.util.object(this.sandbox.util.arrayMap(this.events.names,function(e,i){return e.type==="on"?[i,n.call(this,this.events.namespace,e.postFix,e.callback)]:e.type==="once"?[i,r.call(this,this.events.namespace,e.postFix,e.callback)]:[i,t.call(this,this.events.namespace,e.postFix)]}.bind(this)))})}}),define("aura_extensions/sticky-toolbar",[],function(){"use strict";var e={scrollContainerSelector:".content-column > .wrapper .page",fixedClass:"fixed",scrollMarginTop:90,stickyToolbarClass:"sticky-toolbar"},t=function(t,n,r){n>(r||e.scrollMarginTop)?t.addClass(e.fixedClass):t.removeClass(e.fixedClass)};return function(n){n.sandbox.stickyToolbar={enable:function(r,i){r.addClass(e.stickyToolbarClass),n.sandbox.dom.on(e.scrollContainerSelector,"scroll.sticky-toolbar",function(){t(r,n.sandbox.dom.scrollTop(e.scrollContainerSelector),i)})},disable:function(t){t.removeClass(e.stickyToolbarClass),n.sandbox.dom.off(e.scrollContainerSelector,"scroll.sticky-toolbar")},reset:function(t){t.removeClass(e.fixedClass)}},n.components.after("initialize",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.enable(this.$el,typeof this.stickyToolbar=="number"?this.stickyToolbar:null)}),n.components.before("destroy",function(){if(!this.stickyToolbar)return;this.sandbox.stickyToolbar.disable(this.$el)})}}),function(e){if(typeof exports=="object"&&typeof module!="undefined")module.exports=e();else if(typeof define=="function"&&define.amd)define("vendor/clipboard/clipboard",[],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.Clipboard=e()}}(function(){var e,t,n;return function r(e,t,n){function i(o,u){if(!t[o]){if(!e[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,r,e,t,n)}return t[o].exports}var s=typeof require=="function"&&require;for(var o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,n){function s(e,t){while(e&&e.nodeType!==r){if(typeof e.matches=="function"&&e.matches(t))return e;e=e.parentNode}}var r=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}t.exports=s},{}],2:[function(e,t,n){function i(e,t,n,r,i){var o=s.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}function s(e,t,n,i){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&i.call(e,n)}}var r=e("./closest");t.exports=i},{"./closest":1}],3:[function(e,t,n){n.node=function(e){return e!==undefined&&e instanceof HTMLElement&&e.nodeType===1},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return e!==undefined&&(t==="[object NodeList]"||t==="[object HTMLCollection]")&&"length"in e&&(e.length===0||n.node(e[0]))},n.string=function(e){return typeof e=="string"||e instanceof String},n.fn=function(e){var t=Object.prototype.toString.call(e);return t==="[object Function]"}},{}],4:[function(e,t,n){function s(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return o(e,t,n);if(r.nodeList(e))return u(e,t,n);if(r.string(e))return a(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function o(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function u(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function a(e,t,n){return i(document.body,e,t,n)}var r=e("./is"),i=e("delegate");t.exports=s},{"./is":3,delegate:2}],5:[function(e,t,n){function r(e){var t;if(e.nodeName==="SELECT")e.focus(),t=e.value;else if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(e),r.removeAllRanges(),r.addRange(i),t=r.toString()}return t}t.exports=r},{}],6:[function(e,t,n){function r(){}r.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var s=0,o=r.length;s<o;s++)r[s].fn!==t&&r[s].fn._!==t&&i.push(r[s]);return i.length?n[e]=i:delete n[e],this}},t.exports=r},{}],7:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","select"],s);else if(typeof r!="undefined")s(n,t("select"));else{var o={exports:{}};s(o,i.select),i.clipboardAction=o.exports}})(this,function(e,t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=r(t),i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(){function e(t){s(this,e),this.resolveOptions(t),this.initSelection()}return o(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=function(e){function t(e,n){f(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.resolveOptions(n),r.listenClick(e),r}return h(t,e),l(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'<div class="sulu-dashboard" data-aura-component="dashboard@suluadmin"/>'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("<div/>"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['<div class="blue-row"></div>','<div class="toolbar-row">','   <div class="left-container '+t.backClass+'">','       <span class="fa-'+t.backIcon+'"></span>',"   </div>",'   <div class="toolbar-container">','       <div class="'+t.toolbarClass+'"></div>',"   </div>",'   <div class="right-container">',"   </div>","</div>"].join(""),tabsRow:['<div class="',t.tabsRowClass,'">','    <div class="',t.tabsClass,'"></div>',"</div>"].join(""),languageChanger:['<div class="language-changer">','   <span class="title"><%= title %></span>','   <span class="dropdown-toggle"></span>',"</div>"].join(""),titleElement:['<div class="'+t.contentTitleClass+'">','   <div class="content-title <% if(!!underline){ %>underlined<% } %>">',"       <h2><%= title %></h2>","   </div>","</div>"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('<div class="'+t.breadcrumbContainerClass+'"/>'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("<div/>"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t<n;)e.push({id:this.sandbox.sulu.locales[t],title:this.sandbox.sulu.locales[t]});return e},startToolbarComponent:function(e,n){var r=this.sandbox.dom.createElement("<div />"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('<div class="'+t.tabsContentClass+'"/>');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e<this.options.scrollDelta?(this.showTabs(),this.oldScrollPosition=e):e>=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('<div class="'+t.tabsLabelContainer+'"/>');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['<span class="breadcrumb">','<% if (!!icon) { %><span class="<%= icon %> icon"></span><% } %><%= title %><span class="fa-chevron-right separator"></span>',"</span>"].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'<div id="column-options-overlay" />'),this.sandbox.start([{name:"column-options@husky",options:{el:"#column-options-overlay",data:this.sandbox.sulu.getUserSetting(this.options.columnOptions.key),hidden:!1,instanceName:this.options.instanceName,trigger:".toggle",header:{title:this.sandbox.translate("list-toolbar.column-options.title")}}}]),e=this.options.instanceName?this.options.instanceName+".":"",this.sandbox.once("husky.column-options."+e+"saved",function(e){this.sandbox.sulu.saveUserSetting(this.options.columnOptions.key,e)}.bind(this))}.bind(this)}},i=function(e,t){var n=e.slice(0),r=[];return this.sandbox.util.foreach(e,function(e){r.push(e.id)}.bind(this)),this.sandbox.util.foreach(t,function(e){var t=r.indexOf(e.id);t<0?n.push(e):n[t]=e}.bind(this)),n},s=function(e,t){if(typeof e=="string")try{e=JSON.parse(e)}catch(n){t[e]?e=t[e].call(this):this.sandbox.logger.log("no template found!")}else typeof e=="function"&&(e=e.call(this));return e},o=function(e){var t,n,i;for(t=-1,n=e.length;++t<n;)i=e[t],i.hasOwnProperty("dropdownItems")&&(i.dropdownItems=o.call(this,i.dropdownItems)),i.hasOwnProperty("type")&&i.type==="columnOptions"&&(e[t]=this.sandbox.util.extend({},r.call(this),i));return e},u=function(e){this.sandbox.dom.addClass(e.el,"list-toolbar"),this.sandbox.start([{name:"toolbar@husky",options:e}])};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.template=s.call(this,this.options.template,t),this.options.listener=s.call(this,this.options.listener,n),!this.options.parentTemplate||(this.options.parentTemplate=s.call(this,this.options.parentTemplate,t),this.options.parentListener=s.call(this,this.options.parentListener,n),this.options.template=i.call(this,this.options.parentTemplate,this.options.template)),this.sandbox.emit("sulu.list-toolbar.extend",this.options.context,this.options.template,this.options.instanceName,this.options.datagridInstanceName,this.options.listInfoContainerSelector),this.options.template=o.call(this,this.options.template);var r,a={groups:this.options.groups,hasSearch:!0,buttons:this.options.template,instanceName:this.options.instanceName,showTitleAsTooltip:this.options.showTitleAsTooltip,showTitle:!1,searchOptions:this.options.searchOptions||{}};this.options.hasOwnProperty("hasSearch")&&(a.hasSearch=this.options.hasSearch),this.options.listener&&this.options.listener.call(this),this.options.parentListener&&this.options.parentListener.call(this),r=this.sandbox.dom.createElement("<div />"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("<div/>"),r;return typeof e!="undefined"?(r=e,this.removeLabelWithId(e)):(this.labelId=this.labelId+1,r=this.labelId),this.sandbox.dom.attr(n,"id","sulu-labels-"+r),this.sandbox.dom.attr(n,"data-id",r),t?this.$navigationLabels.prepend(n):this.sandbox.dom.prepend(this.$el,n),n},removeLabelWithId:function(e){var t=this.labelsById[e];!t||(delete this.labels[t.type][t.description],delete this.labelsById[e],this.sandbox.dom.remove(this.sandbox.dom.find("[data-id='"+e+"']",this.$el)))},showLabel:function(e,t,n,r,i,s){r=r||++this.labelId,this.labels[e][t]?this.sandbox.emit("husky.label."+this.labels[e][t]+".refresh"):(this.startLabelComponent({type:e,description:this.sandbox.translate(t),title:this.sandbox.translate(n),el:this.createLabelContainer(r,i),instanceName:r,autoVanish:s}),this.labels[e][t]=r,this.labelsById[r]={type:e,description:t},this.sandbox.once("husky.label."+r+".destroyed",function(){this.removeLabelWithId(r)}.bind(this)))},startLabelComponent:function(e){this.sandbox.start([{name:"label@husky",options:e}])}}}),define("__component__$sidebar@suluadmin",[],function(){"use strict";var e={instanceName:"",url:"",expandable:!0},t={widgetContainerSelector:"#sulu-widgets",componentClass:"sulu-sidebar",columnSelector:".sidebar-column",fixedWidthClass:"fixed",maxWidthClass:"max",loaderClass:"sidebar-loader",visibleSidebarClass:"has-visible-sidebar",maxSidebarClass:"has-max-sidebar",noVisibleSidebarClass:"has-no-visible-sidebar",hiddenClass:"hidden"},n=function(){return h.call(this,"initialized")},r=function(){return h.call(this,"hide")},i=function(){return h.call(this,"show")},s=function(){return h.call(this,"append-widget")},o=function(){return h.call(this,"prepend-widget")},u=function(){return h.call(this,"set-widget")},a=function(){return h.call(this,"empty")},f=function(){return h.call(this,"change-width")},l=function(){return h.call(this,"add-classes")},c=function(){return h.call(this,"reset-classes")},h=function(e){return"sulu.sidebar."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.widgets=[],this.bindCustomEvents(),this.render(),this.sandbox.emit(n.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.hideColumn()},bindCustomEvents:function(){this.sandbox.on(f.call(this),this.changeWidth.bind(this)),this.sandbox.on(r.call(this),this.hideColumn.bind(this)),this.sandbox.on(i.call(this),this.showColumn.bind(this)),this.sandbox.on(u.call(this),this.setWidget.bind(this)),this.sandbox.on(s.call(this),this.appendWidget.bind(this)),this.sandbox.on(o.call(this),this.prependWidget.bind(this)),this.sandbox.on(a.call(this),this.emptySidebar.bind(this)),this.sandbox.on(c.call(this),this.resetClasses.bind(this)),this.sandbox.on(l.call(this),this.addClasses.bind(this))},resetClasses:function(){this.sandbox.dom.removeClass(this.$el),this.sandbox.dom.addClass(this.$el,t.componentClass)},addClasses:function(e){this.sandbox.dom.addClass(this.$el,e)},changeWidth:function(e){this.width=e,e==="fixed"?this.changeToFixedWidth():e==="max"&&this.changeToMaxWidth(),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.fixedWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.maxWidthClass),this.sandbox.dom.addClass(e,t.fixedWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.prepend(n,e),this.sandbox.dom.removeClass(n,t.maxSidebarClass))},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector),n;this.sandbox.dom.hasClass(e,t.maxWidthClass)||(n=this.sandbox.dom.parent(e),this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass),this.sandbox.dom.detach(e),this.sandbox.dom.append(n,e),this.sandbox.dom.addClass(n,t.maxSidebarClass))},hideColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeToFixedWidth(),this.sandbox.dom.removeClass(n,t.visibleSidebarClass),this.sandbox.dom.addClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},showColumn:function(){var e=this.sandbox.dom.find(t.columnSelector),n=this.sandbox.dom.parent(e);this.changeWidth(this.width),this.sandbox.dom.removeClass(n,t.noVisibleSidebarClass),this.sandbox.dom.addClass(n,t.visibleSidebarClass),this.sandbox.dom.removeClass(e,t.hiddenClass),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},appendWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t)},prependWidget:function(e,t){if(!t){var n;this.loadWidget(e).then(function(t){n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.unshift({url:e,$el:n}),this.sandbox.dom.prepend(this.$el,n),this.sandbox.start(n)}.bind(this))}else this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.prepend(this.$el,t)},setWidget:function(e,t){if(!t){if(this.widgets.length!==1||this.widgets[0].url!==e){var n;this.emptySidebar(!1),this.loadWidget(e).then(function(t){if(t===undefined||t===""){this.sandbox.dom.css(this.$el,"display","none");return}n=this.sandbox.dom.createElement(this.sandbox.util.template(t,{translate:this.sandbox.translate})),this.widgets.push({url:e,$el:n}),this.sandbox.dom.append(this.$el,n),this.sandbox.start(this.$el,n),this.sandbox.dom.css(this.$el,"display","block")}.bind(this))}}else t=$(t),this.emptySidebar(!0),this.showColumn(),this.widgets.push({url:null,$el:t}),this.sandbox.dom.append(this.$el,t),this.sandbox.start(this.$el),this.sandbox.dom.css(this.$el,"display","block")},loadWidget:function(e){var t=this.sandbox.data.deferred();return this.showColumn(),this.startLoader(),this.sandbox.util.load(e,null,"html").then(function(e){this.stopLoader(),t.resolve(e)}.bind(this)),t.promise()},emptySidebar:function(e){while(this.widgets.length>0)this.sandbox.stop(this.widgets[0].$el),this.sandbox.dom.remove(this.widgets[0].$el),this.widgets.splice(0,1);e!==!0&&this.hideColumn()},startLoader:function(){var e=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>');this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"100px",color:"#e4e4e4"}}])},stopLoader:function(){this.sandbox.stop(this.$find("."+t.loaderClass))}}}),define("__component__$data-overlay@suluadmin",[],function(){"use strict";var e={instanceName:"",component:""},t={main:['<div class="data-overlay">','<button class="fa-times data-overlay-close btn btn-link"></button>','<div class="data-overlay-content"></div>',"</div>"].join("")},n=function(e){return"sulu.data-overlay."+(this.options.instanceName?this.options.instanceName+".":"")+e},r=function(){return n.call(this,"initialized")},i=function(){return n.call(this,"show")},s=function(){return n.call(this,"hide")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.mainTemplate=this.sandbox.util.template(t.main),this.render(),this.startComponent(),this.bindEvents(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},bindEvents:function(){this.sandbox.on(i.call(this),this.show.bind(this)),this.sandbox.on(s.call(this),this.hide.bind(this))},bindDomEvents:function(){this.$el.on("click",".data-overlay-close",this.hide.bind(this))},render:function(){var e=this.mainTemplate();this.$el.html(e)},startComponent:function(){var e=this.options.component;if(!e)throw new Error("No component defined!");this.sandbox.start([{name:e,options:{el:".data-overlay-content"}}])},show:function(){this.$el.fadeIn(150)},hide:function(){this.$el.fadeOut(150)}}});
require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1634826923308"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['<div class="media-container '+t.mediaLoadingClass+'">','   <div class="media-logo"></div>','   <div class="'+t.mediaBackgroundClass+'">','       <div class="darkener"></div>',"   </div>","</div>"].join(""),contentContainer:['<div class="content-container">','   <div class="'+t.contentBoxClass+'">','       <div class="content-logo navigator'+t.websiteSwitchClass+'"></div>','       <div class="'+t.frameSliderClass+'"></div>',"   </div>",'   <div class="grid-row login-content-footer">','       <span class="navigator '+t.websiteSwitchClass+'"><%= backWebsiteMessage %></span>',"   </div>",'   <div class="'+t.successOverlayClass+'">','       <div class="success-icon"></div>',"   </div>","</div>"].join(""),loginFrame:function(){return['<div class="'+t.frameClass+' login">','   <form class="grid inputs">','       <span class="'+t.errorMessageClass+'"><%= errorMessage %></span>','       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="text" name="username" id="username" placeholder="<%= emailUser %>"/>',"       </div>",'       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="password" name="password" id="password" placeholder="<%= password %>"/>',"       </div>",'       <input type="hidden" name="_csrf_token" id="_csrf_token" value="',this.options.csrfToken,'"/>','       <div class="grid-row small box-frame-footer">','           <span class="navigator '+t.forgotPasswordSwitchClass+'"><%= forgotPasswordMessage %></span>','           <div id="'+t.loginButtonId+'" class="btn action large fit"><%= login %></div>',"       </div>","   </form>","</div>"].join("")},forgotPasswordFrame:['<div class="'+t.frameClass+' forgot-password">','   <div class="grid inputs">','       <span class="'+t.errorMessageClass+'"></span>','       <div class="grid-row">','           <input id="user" class="form-element input-large husky-validate" type="text" placeholder="<%= emailUser %>" tabindex="-1"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.requestResetMailButtonId+'" class="btn action large fit"><%= reset %></div>',"   </div>","</div>"].join(""),resendMailFrame:['<div class="'+t.frameClass+' resend-mail">','   <div class="grid-row">','       <span class="message"><%= sentMessage %></span>','       <span class="message to-mail"></span>',"   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.resendResetMailButtonId+'" class="btn action large fit"><%= resend %></div>',"   </div>","</div>"].join(""),resetPasswordFrame:['<div class="'+t.frameClass+' reset-password">','   <div class="grid inputs">','       <div class="grid-row">','           <input id="password1" class="form-element input-large husky-validate" type="password" placeholder="<%= password1Label %>"/>',"       </div>",'       <div class="grid-row">','           <input id="password2" class="form-element input-large husky-validate" type="password" placeholder="<%= password2Label %>"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginRouteClass+'"><%= loginRouteMessage %></span>','       <div id="'+t.resetPasswordButtonId+'" class="btn action large fit"><%= login %></div>',"   </div>","</div>"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("<img/>");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}});
require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1634826923308"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['<div class="media-container '+t.mediaLoadingClass+'">','   <div class="media-logo"></div>','   <div class="'+t.mediaBackgroundClass+'">','       <div class="darkener"></div>',"   </div>","</div>"].join(""),contentContainer:['<div class="content-container">','   <div class="'+t.contentBoxClass+'">','       <div class="content-logo navigator'+t.websiteSwitchClass+'"></div>','       <div class="'+t.frameSliderClass+'"></div>',"   </div>",'   <div class="grid-row login-content-footer">','       <span class="navigator '+t.websiteSwitchClass+'"><%= backWebsiteMessage %></span>',"   </div>",'   <div class="'+t.successOverlayClass+'">','       <div class="success-icon"></div>',"   </div>","</div>"].join(""),loginFrame:function(){return['<div class="'+t.frameClass+' login">','   <form class="grid inputs">','       <span class="'+t.errorMessageClass+'"><%= errorMessage %></span>','       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="text" name="username" id="username" placeholder="<%= emailUser %>"/>',"       </div>",'       <div class="grid-row">','           <input class="form-element input-large husky-validate" type="password" name="password" id="password" placeholder="<%= password %>"/>',"       </div>",'       <input type="hidden" name="_csrf_token" id="_csrf_token" value="',this.options.csrfToken,'"/>','       <div class="grid-row small box-frame-footer">','           <span class="navigator '+t.forgotPasswordSwitchClass+'"><%= forgotPasswordMessage %></span>','           <div id="'+t.loginButtonId+'" class="btn action large fit"><%= login %></div>',"       </div>","   </form>","</div>"].join("")},forgotPasswordFrame:['<div class="'+t.frameClass+' forgot-password">','   <div class="grid inputs">','       <span class="'+t.errorMessageClass+'"></span>','       <div class="grid-row">','           <input id="user" class="form-element input-large husky-validate" type="text" placeholder="<%= emailUser %>" tabindex="-1"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.requestResetMailButtonId+'" class="btn action large fit"><%= reset %></div>',"   </div>","</div>"].join(""),resendMailFrame:['<div class="'+t.frameClass+' resend-mail">','   <div class="grid-row">','       <span class="message"><%= sentMessage %></span>','       <span class="message to-mail"></span>',"   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginSwitchClass+'"><%= backLoginMessage %></span>','       <div id="'+t.resendResetMailButtonId+'" class="btn action large fit"><%= resend %></div>',"   </div>","</div>"].join(""),resetPasswordFrame:['<div class="'+t.frameClass+' reset-password">','   <div class="grid inputs">','       <div class="grid-row">','           <input id="password1" class="form-element input-large husky-validate" type="password" placeholder="<%= password1Label %>"/>',"       </div>",'       <div class="grid-row">','           <input id="password2" class="form-element input-large husky-validate" type="password" placeholder="<%= password2Label %>"/>',"       </div>","   </div>",'   <div class="grid-row small box-frame-footer">','       <span class="navigator '+t.loginRouteClass+'"><%= loginRouteMessage %></span>','       <div id="'+t.resetPasswordButtonId+'" class="btn action large fit"><%= login %></div>',"   </div>","</div>"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("<img/>");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('<div class="'+t.loaderClass+'"/>'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}});
                    '           <div class="suggestion-column" style="width: <%= field.width %>;"><%- context[field.id] %></div>' +
                    '       <div class="text"><%- context[this.options.valueKey] %></div>' +
var requirejs,require,define;(function(global){function isFunction(e){return ostring.call(e)==="[object Function]"}function isArray(e){return ostring.call(e)==="[object Array]"}function each(e,t){if(e){var n;for(n=0;n<e.length;n+=1)if(e[n]&&t(e[n],n,e))break}}function eachReverse(e,t){if(e){var n;for(n=e.length-1;n>-1;n-=1)if(e[n]&&t(e[n],n,e))break}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){if(n||!hasProp(e,i))r&&typeof t!="string"?(e[i]||(e[i]={}),mixin(e[i],t,n,r)):e[i]=t}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function v(e){var t,n;for(t=0;e[t];t+=1){n=e[t];if(n===".")e.splice(t,1),t-=1;else if(n===".."){if(t===1&&(e[2]===".."||e[0]===".."))break;t>0&&(e.splice(t-1,2),t-=2)}}}function m(e,t,n){var r,i,s,u,a,f,l,c,h,p,d,m=t&&t.split("/"),g=m,y=o.map,b=y&&y["*"];e&&e.charAt(0)==="."&&(t?(getOwn(o.pkgs,t)?g=m=[t]:g=m.slice(0,m.length-1),e=g.concat(e.split("/")),v(e),i=getOwn(o.pkgs,r=e[0]),e=e.join("/"),i&&e===r+"/"+i.main&&(e=r)):e.indexOf("./")===0&&(e=e.substring(2)));if(n&&y&&(m||b)){u=e.split("/");for(a=u.length;a>0;a-=1){l=u.slice(0,a).join("/");if(m)for(f=m.length;f>0;f-=1){s=getOwn(y,m.slice(0,f).join("/"));if(s){s=getOwn(s,l);if(s){c=s,h=a;break}}}if(c)break;!p&&b&&getOwn(b,l)&&(p=getOwn(b,l),d=a)}!c&&p&&(c=p,h=d),c&&(u.splice(0,h,c),e=u.join("/"))}return e}function g(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===r.contextName)return t.parentNode.removeChild(t),!0})}function y(e){var t=getOwn(o.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),r.require.undef(e),r.require([e]),!0}function b(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function w(e,t,n,i){var s,o,u,a,f=null,l=t?t.name:null,h=e,v=!0,g="";return e||(v=!1,e="_@r"+(p+=1)),a=b(e),f=a[0],e=a[1],f&&(f=m(f,l,i),o=getOwn(c,f)),e&&(f?o&&o.normalize?g=o.normalize(e,function(e){return m(e,l,i)}):g=m(e,l,i):(g=m(e,l,i),a=b(g),f=a[0],g=a[1],n=!0,s=r.nameToUrl(g))),u=f&&!o&&!n?"_unnormalized"+(d+=1):"",{prefix:f,name:g,parentMap:t,unnormalized:!!u,url:s,originalName:h,isDefine:v,id:(f?f+"!"+g:g)+u}}function E(e){var t=e.id,n=getOwn(u,t);return n||(n=u[t]=new r.Module(e)),n}function S(e,t,n){var r=e.id,i=getOwn(u,r);hasProp(c,r)&&(!i||i.defineEmitComplete)?t==="defined"&&n(c[r]):(i=E(e),i.error&&t==="error"?n(i.error):i.on(t,n))}function x(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(u,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function T(){globalDefQueue.length&&(apsp.apply(l,[l.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function N(e){delete u[e],delete a[e]}function C(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var s=r.id,o=getOwn(u,s);o&&!e.depMatched[i]&&!n[s]&&(getOwn(t,s)?(e.defineDep(i,c[s]),e.check()):C(o,t,n))}),n[r]=!0)}function k(){var e,n,i,u,f=o.waitSeconds*1e3,l=f&&r.startTime+f<(new Date).getTime(),c=[],h=[],p=!1,d=!0;if(t)return;t=!0,eachProp(a,function(t){e=t.map,n=e.id;if(!t.enabled)return;e.isDefine||h.push(t);if(!t.error)if(!t.inited&&l)y(n)?(u=!0,p=!0):(c.push(n),g(n));else if(!t.inited&&t.fetched&&e.isDefine){p=!0;if(!e.prefix)return d=!1}});if(l&&c.length)return i=makeError("timeout","Load timeout for modules: "+c,null,c),i.contextName=r.contextName,x(i);d&&each(h,function(e){C(e,{},{})}),(!l||u)&&p&&(isBrowser||isWebWorker)&&!s&&(s=setTimeout(function(){s=0,k()},50)),t=!1}function L(e){hasProp(c,e[0])||E(w(e[0],null,!0)).init(e[1],e[2])}function A(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function O(e){var t=e.currentTarget||e.srcElement;return A(t,r.onScriptLoad,"load","onreadystatechange"),A(t,r.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function M(){var e;T();while(l.length){e=l.shift();if(e[0]===null)return x(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));L(e)}}var t,n,r,i,s,o={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},u={},a={},f={},l=[],c={},h={},p=1,d=1;return i={require:function(e){return e.require?e.require:e.require=r.makeRequire(e.map)},exports:function(e){e.usingExports=!0;if(e.map.isDefine)return e.exports?e.exports:e.exports=c[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){var t,n=getOwn(o.pkgs,e.map.id);return t=n?getOwn(o.config,e.map.id+"/"+n.main):getOwn(o.config,e.map.id),t||{}},exports:c[e.map.id]}}},n=function(e){this.events=getOwn(f,e.id)||{},this.map=e,this.shim=getOwn(o.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},n.prototype={init:function(e,t,n,r){r=r||{};if(this.inited)return;this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check()},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(this.fetched)return;this.fetched=!0,r.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();r.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))},load:function(){var e=this.map.url;h[e]||(h[e]=!0,r.load(this.map.id,e))},check:function(){if(!this.enabled||this.enabling)return;var e,t,n=this.map.id,i=this.depExports,s=this.exports,o=this.factory;if(!this.inited)this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{s=r.execCb(n,o,i,s)}catch(u){e=u}else s=r.execCb(n,o,i,s);this.map.isDefine&&(t=this.module,t&&t.exports!==undefined&&t.exports!==this.exports?s=t.exports:s===undefined&&this.usingExports&&(s=this.exports));if(e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",x(this.error=e)}else s=o;this.exports=s,this.map.isDefine&&!this.ignore&&(c[n]=s,req.onResourceLoad&&req.onResourceLoad(r,this.map,this.depMaps)),N(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}},callPlugin:function(){var e=this.map,t=e.id,n=w(e.prefix);this.depMaps.push(n),S(n,"defined",bind(this,function(n){var i,s,a,f=this.map.name,l=this.map.parentMap?this.map.parentMap.name:null,c=r.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){n.normalize&&(f=n.normalize(f,function(e){return m(e,l,!0)})||""),s=w(e.prefix+"!"+f,this.map.parentMap),S(s,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),a=getOwn(u,s.id),a&&(this.depMaps.push(s),this.events.error&&a.on("error",bind(this,function(e){this.emit("error",e)})),a.enable());return}i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(u,function(e){e.map.id.indexOf(t+"_unnormalized")===0&&N(e.map.id)}),x(e)}),i.fromText=bind(this,function(n,s){var u=e.name,a=w(u),f=useInteractive;s&&(n=s),f&&(useInteractive=!1),E(a),hasProp(o.config,t)&&(o.config[u]=o.config[t]);try{req.exec(n)}catch(l){return x(makeError("fromtexteval","fromText eval for "+t+" failed: "+l,l,[t]))}f&&(useInteractive=!0),this.depMaps.push(a),r.completeLoad(u),c([u],i)}),n.load(e.name,c,i,o)})),r.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){a[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,s,o;if(typeof e=="string"){e=w(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,o=getOwn(i,e.id);if(o){this.depExports[t]=o(this);return}this.depCount+=1,S(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&S(e,"error",bind(this,this.errback))}n=e.id,s=u[n],!hasProp(i,n)&&s&&!s.enabled&&r.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(u,e.id);t&&!t.enabled&&r.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),e==="error"&&delete this.events[e]}},r={config:o,contextName:e,registry:u,defined:c,urlFetched:h,defQueue:l,Module:n,makeModuleMap:w,nextTick:req.nextTick,onError:x,configure:function(e){e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/");var t=o.pkgs,n=o.shim,i={paths:!0,config:!0,map:!0};eachProp(e,function(e,t){i[t]?t==="map"?(o.map||(o.map={}),mixin(o[t],e,!0,!0)):mixin(o[t],e,!0):o[t]=e}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),(e.exports||e.init)&&!e.exportsFn&&(e.exportsFn=r.makeShimExports(e)),n[t]=e}),o.shim=n),e.packages&&(each(e.packages,function(e){var n;e=typeof e=="string"?{name:e}:e,n=e.location,t[e.name]={name:e.name,location:n||e.name,main:(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),o.pkgs=t),eachProp(u,function(e,t){!e.inited&&!e.map.unnormalized&&(e.map=w(t))}),(e.deps||e.callback)&&r.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function s(o,a,f){var l,h,p;return n.enableBuildCallback&&a&&isFunction(a)&&(a.__requireJsBuild=!0),typeof o=="string"?isFunction(a)?x(makeError("requireargs","Invalid require call"),f):t&&hasProp(i,o)?i[o](u[t.id]):req.get?req.get(r,o,t,s):(h=w(o,t,!1,!0),l=h.id,hasProp(c,l)?c[l]:x(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(M(),r.nextTick(function(){M(),p=E(w(null,t)),p.skipMap=n.skipMap,p.init(o,a,f,{enabled:!0}),k()}),s)}return n=n||{},mixin(s,{isBrowser:isBrowser,toUrl:function(e){var n,i=e.lastIndexOf("."),s=e.split("/")[0],o=s==="."||s==="..";return i!==-1&&(!o||i>1)&&(n=e.substring(i,e.length),e=e.substring(0,i)),r.nameToUrl(m(e,t&&t.id,!0),n,!0)},defined:function(e){return hasProp(c,w(e,t,!1,!0).id)},specified:function(e){return e=w(e,t,!1,!0).id,hasProp(c,e)||hasProp(u,e)}}),t||(s.undef=function(e){T();var n=w(e,t,!0),r=getOwn(u,e);g(e),delete c[e],delete h[n.url],delete f[e],r&&(r.events.defined&&(f[e]=r.events),N(e))}),s},enable:function(e){var t=getOwn(u,e.id);t&&E(e).enable()},completeLoad:function(e){var t,n,r,i=getOwn(o.shim,e)||{},s=i.exports;T();while(l.length){n=l.shift();if(n[0]===null){n[0]=e;if(t)break;t=!0}else n[0]===e&&(t=!0);L(n)}r=getOwn(u,e);if(!t&&!hasProp(c,e)&&r&&!r.inited){if(o.enforceDefine&&(!s||!getGlobal(s))){if(y(e))return;return x(makeError("nodefine","No define call for "+e,null,[e]))}L([e,i.deps||[],i.exportsFn])}k()},nameToUrl:function(e,t,n){var r,i,s,u,a,f,l,c,h;if(req.jsExtRegExp.test(e))c=e+(t||"");else{r=o.paths,i=o.pkgs,a=e.split("/");for(f=a.length;f>0;f-=1){l=a.slice(0,f).join("/"),s=getOwn(i,l),h=getOwn(r,l);if(h){isArray(h)&&(h=h[0]),a.splice(0,f,h);break}if(s){e===s.name?u=s.location+"/"+s.main:u=s.location,a.splice(0,f,u);break}}c=a.join("/"),c+=t||(/^data\:|\?/.test(c)||n?"":".js"),c=(c.charAt(0)==="/"||c.match(/^[\w\+\.\-]+:/)?"":o.baseUrl)+c}return o.urlArgs?c+((c.indexOf("?")===-1?"?":"&")+o.urlArgs):c},load:function(e,t){req.load(r,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=O(e);r.completeLoad(t.id)}},onScriptError:function(e){var t=O(e);if(!y(t.id))return x(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}},r.require=r.makeRequire(),r}function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"?interactiveScript:(eachReverse(scripts(),function(e){if(e.readyState==="interactive")return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.9",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=typeof window!="undefined"&&typeof navigator!="undefined"&&!!window.document,isWebWorker=!isBrowser&&typeof importScripts!="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(typeof define!="undefined")return;if(typeof requirejs!="undefined"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=undefined}typeof require!="undefined"&&!isFunction(require)&&(cfg=require,require=undefined),req=requirejs=function(e,t,n,r){var i,s,o=defContextName;return!isArray(e)&&typeof e!="string"&&(s=e,isArray(t)?(e=t,t=n,n=r):e=[]),s&&s.context&&(o=s.context),i=getOwn(contexts,o),i||(i=contexts[o]=req.s.newContext(o)),s&&i.configure(s),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick=typeof setTimeout!="undefined"?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,n){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,n){var r=e&&e.config||{},i;if(isBrowser)return i=req.createNode(r,t,n),i.setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),i.attachEvent&&!(i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)):(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)),i.src=n,currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):head.appendChild(i),currentlyAddingScript=null,i;if(isWebWorker)try{importScripts(n),e.completeLoad(t)}catch(s){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+n,s,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){head||(head=e.parentNode),dataMain=e.getAttribute("data-main");if(dataMain)return mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,n){var r,i;typeof e!="string"&&(n=t,t=e,e=null),isArray(t)||(n=t,t=null),!t&&isFunction(n)&&(t=[],n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(n.length===1?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this),define("requirejs",function(){}),function(e,t){function H(e){var t=e.length,n=w.type(e);return w.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||n!=="function"&&(t===0||typeof t=="number"&&t>0&&t-1 in e)}function j(e){var t=B[e]={};return w.each(e.match(S)||[],function(e,n){t[n]=!0}),t}function q(e,n,r,i){if(!w.acceptData(e))return;var s,o,u=w.expando,a=e.nodeType,f=a?w.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===t&&typeof n=="string")return;l||(a?l=e[u]=c.pop()||w.guid++:l=u),f[l]||(f[l]=a?{}:{toJSON:w.noop});if(typeof n=="object"||typeof n=="function")i?f[l]=w.extend(f[l],n):f[l].data=w.extend(f[l].data,n);return o=f[l],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[w.camelCase(n)]=r),typeof n=="string"?(s=o[n],s==null&&(s=o[w.camelCase(n)])):s=o,s}function R(e,t,n){if(!w.acceptData(e))return;var r,i,s=e.nodeType,o=s?w.cache:e,u=s?e[w.expando]:w.expando;if(!o[u])return;if(t){r=n?o[u]:o[u].data;if(r){w.isArray(t)?t=t.concat(w.map(t,w.camelCase)):t in r?t=[t]:(t=w.camelCase(t),t in r?t=[t]:t=t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!z(r):!w.isEmptyObject(r))return}}if(!n){delete o[u].data;if(!z(o[u]))return}s?w.cleanData([e],!0):w.support.deleteExpando||o!=o.window?delete o[u]:o[u]=null}function U(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(I,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:F.test(r)?w.parseJSON(r):r}catch(s){}w.data(e,n,r)}else r=t}return r}function z(e){var t;for(t in e){if(t==="data"&&w.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function it(){return!0}function st(){return!1}function ot(){try{return o.activeElement}catch(e){}}function ct(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ht(e,t,n){if(w.isFunction(t))return w.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return w.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(ut.test(t))return w.filter(t,e,n);t=w.filter(t,e)}return w.grep(e,function(e){return w.inArray(e,t)>=0!==n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Mt(e,t){return w.nodeName(e,"table")&&w.nodeName(t.nodeType===1?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function _t(e){return e.type=(w.find.attr(e,"type")!==null)+"/"+e.type,e}function Dt(e){var t=Ct.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)w._data(n,"globalEval",!t||w._data(t[r],"globalEval"))}function Ht(e,t){if(t.nodeType!==1||!w.hasData(e))return;var n,r,i,s=w._data(e),o=w._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)w.event.add(t,n,u[n][r])}o.data&&(o.data=w.extend({},o.data))}function Bt(e,t){var n,r,i;if(t.nodeType!==1)return;n=t.nodeName.toLowerCase();if(!w.support.noCloneEvent&&t[w.expando]){i=w._data(t);for(r in i.events)w.removeEvent(t,r,i.handle);t.removeAttribute(w.expando)}if(n==="script"&&t.text!==e.text)_t(t).text=e.text,Dt(t);else if(n==="object")t.parentNode&&(t.outerHTML=e.outerHTML),w.support.html5Clone&&e.innerHTML&&!w.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML);else if(n==="input"&&xt.test(e.type))t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value);else if(n==="option")t.defaultSelected=t.selected=e.defaultSelected;else if(n==="input"||n==="textarea")t.defaultValue=e.defaultValue}function jt(e,n){var r,s,o=0,u=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!u)for(u=[],r=e.childNodes||e;(s=r[o])!=null;o++)!n||w.nodeName(s,n)?u.push(s):w.merge(u,jt(s,n));return n===t||n&&w.nodeName(e,n)?w.merge([e],u):u}function Ft(e){xt.test(e.type)&&(e.defaultChecked=e.checked)}function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--){t=en[i]+n;if(t in e)return t}return r}function nn(e,t){return e=t||e,w.css(e,"display")==="none"||!w.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o<u;o++){r=e[o];if(!r.style)continue;s[o]=w._data(r,"olddisplay"),n=r.style.display,t?(!s[o]&&n==="none"&&(r.style.display=""),r.style.display===""&&nn(r)&&(s[o]=w._data(r,"olddisplay",an(r.nodeName)))):s[o]||(i=nn(r),(n&&n!=="none"||!i)&&w._data(r,"olddisplay",i?n:w.css(r,"display")))}for(o=0;o<u;o++){r=e[o];if(!r.style)continue;if(!t||r.style.display==="none"||r.style.display==="")r.style.display=t?s[o]||"":"none"}return e}function sn(e,t,n){var r=$t.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function on(e,t,n,r,i){var s=n===(r?"border":"content")?4:t==="width"?1:0,o=0;for(;s<4;s+=2)n==="margin"&&(o+=w.css(e,n+Zt[s],!0,i)),r?(n==="content"&&(o-=w.css(e,"padding"+Zt[s],!0,i)),n!=="margin"&&(o-=w.css(e,"border"+Zt[s]+"Width",!0,i))):(o+=w.css(e,"padding"+Zt[s],!0,i),n!=="padding"&&(o+=w.css(e,"border"+Zt[s]+"Width",!0,i)));return o}function un(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=qt(e),o=w.support.boxSizing&&w.css(e,"boxSizing",!1,s)==="border-box";if(i<=0||i==null){i=Rt(e,t,s);if(i<0||i==null)i=e.style[t];if(Jt.test(i))return i;r=o&&(w.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+on(e,t,n||(o?"border":"content"),r,s)+"px"}function an(e){var t=o,n=Qt[e];if(!n){n=fn(e,t);if(n==="none"||!n)It=(It||w("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(It[0].contentWindow||It[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=fn(e,t),It.detach();Qt[e]=n}return n}function fn(e,t){var n=w(t.createElement(e)).appendTo(t.body),r=w.css(n[0],"display");return n.remove(),r}function vn(e,t,n,r){var i;if(w.isArray(t))w.each(t,function(t,i){n||cn.test(e)?r(e,i):vn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&w.type(t)==="object")for(i in t)vn(e+"["+i+"]",t[i],n,r);else r(e,t)}function _n(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(S)||[];if(w.isFunction(n))while(r=s[i++])r[0]==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Dn(e,t,n,r){function o(u){var a;return i[u]=!0,w.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=w.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((s[i]?e:r||(r={}))[i]=n[i]);return r&&w.extend(!0,e,r),e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes;while(f[0]==="*")f.shift(),s===t&&(s=e.mimeType||n.getResponseHeader("Content-Type"));if(s)for(u in a)if(a[u]&&a[u].test(s)){f.unshift(u);break}if(f[0]in r)o=f[0];else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}i||(i=u)}o=o||i}if(o)return o!==f[0]&&f.unshift(o),r[o]}function Bn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s){e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift();if(s)if(s==="*")s=a;else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o)for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}}}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){return setTimeout(function(){Xn=t}),Xn=w.now()}function Zn(e,t,n){var r,i=(Gn[t]||[]).concat(Gn["*"]),s=0,o=i.length;for(;s<o;s++)if(r=i[s].call(n,t,e))return r}function er(e,t,n){var r,i,s=0,o=Qn.length,u=w.Deferred().always(function(){delete a.elem}),a=function(){if(i)return!1;var t=Xn||Yn(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,s=1-r,o=0,a=f.tweens.length;for(;o<a;o++)f.tweens[o].run(s);return u.notifyWith(e,[f,s,n]),s<1&&a?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Yn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(r),r},stop:function(t){var n=0,r=t?f.tweens.length:0;if(i)return this;i=!0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;tr(l,f.opts.specialEasing);for(;s<o;s++){r=Qn[s].call(f,e,l,f.opts);if(r)return r}return w.map(l,Zn,f),w.isFunction(f.opts.start)&&f.opts.start.call(e,f),w.fx.timer(w.extend(a,{elem:e,anim:f,queue:f.opts.queue})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function tr(e,t){var n,r,i,s,o;for(n in e){r=w.camelCase(n),i=t[r],s=e[n],w.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=w.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function nr(e,t,n){var r,i,s,o,u,a,f=this,l={},c=e.style,h=e.nodeType&&nn(e),p=w._data(e,"fxshow");n.queue||(u=w._queueHooks(e,"fx"),u.unqueued==null&&(u.unqueued=0,a=u.empty.fire,u.empty.fire=function(){u.unqueued||a()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,w.queue(e,"fx").length||u.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[c.overflow,c.overflowX,c.overflowY],w.css(e,"display")==="inline"&&w.css(e,"float")==="none"&&(!w.support.inlineBlockNeedsLayout||an(e.nodeName)==="inline"?c.display="inline-block":c.zoom=1)),n.overflow&&(c.overflow="hidden",w.support.shrinkWrapBlocks||f.always(function(){c.overflow=n.overflow[0],c.overflowX=n.overflow[1],c.overflowY=n.overflow[2]}));for(r in t){i=t[r];if($n.exec(i)){delete t[r],s=s||i==="toggle";if(i===(h?"hide":"show"))continue;l[r]=p&&p[r]||w.style(e,r)}}if(!w.isEmptyObject(l)){p?"hidden"in p&&(h=p.hidden):p=w._data(e,"fxshow",{}),s&&(p.hidden=!h),h?w(e).show():f.done(function(){w(e).hide()}),f.done(function(){var t;w._removeData(e,"fxshow");for(t in l)w.style(e,t,l[t])});for(r in l)o=Zn(h?p[r]:0,r,f),r in p||(p[r]=o.start,h&&(o.end=o.start,o.start=r==="width"||r==="height"?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}function ir(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function sr(e){return w.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=typeof t,s=e.location,o=e.document,u=o.documentElement,a=e.jQuery,f=e.$,l={},c=[],h="1.10.2",p=c.concat,d=c.push,v=c.slice,m=c.indexOf,g=l.toString,y=l.hasOwnProperty,b=h.trim,w=function(e,t){return new w.fn.init(e,t,r)},E=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,S=/\S+/g,x=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,N=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,C=/^[\],:{}\s]*$/,k=/(?:^|:|,)(?:\s*\[)+/g,L=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,O=/^-ms-/,M=/-([\da-z])/gi,_=function(e,t){return t.toUpperCase()},D=function(e){if(o.addEventListener||e.type==="load"||o.readyState==="complete")P(),w.ready()},P=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",D,!1),e.removeEventListener("load",D,!1)):(o.detachEvent("onreadystatechange",D),e.detachEvent("onload",D))};w.fn=w.prototype={jquery:h,constructor:w,init:function(e,n,r){var i,s;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=T.exec(e);if(i&&(i[1]||!n)){if(i[1]){n=n instanceof w?n[0]:n,w.merge(this,w.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0));if(N.test(i[1])&&w.isPlainObject(n))for(i in n)w.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}s=o.getElementById(i[2]);if(s&&s.parentNode){if(s.id!==i[2])return r.find(e);this.length=1,this[0]=s}return this.context=o,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):w.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),w.makeArray(e,this))},selector:"",length:0,toArray:function(){return v.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return w.each(this,e,t)},ready:function(e){return w.ready.promise().done(e),this},slice:function(){return this.pushStack(v.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},w.fn.init.prototype=w.fn,w.extend=w.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!w.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((s=arguments[a])!=null)for(i in s){e=u[i],r=s[i];if(u===r)continue;l&&r&&(w.isPlainObject(r)||(n=w.isArray(r)))?(n?(n=!1,o=e&&w.isArray(e)?e:[]):o=e&&w.isPlainObject(e)?e:{},u[i]=w.extend(l,o,r)):r!==t&&(u[i]=r)}return u},w.extend({expando:"jQuery"+(h+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===w&&(e.$=f),t&&e.jQuery===w&&(e.jQuery=a),w},isReady:!1,readyWait:1,holdReady:function(e){e?w.readyWait++:w.ready(!0)},ready:function(e){if(e===!0?--w.readyWait:w.isReady)return;if(!o.body)return setTimeout(w.ready);w.isReady=!0;if(e!==!0&&--w.readyWait>0)return;n.resolveWith(o,[w]),w.fn.trigger&&w(o).trigger("ready").off("ready")},isFunction:function(e){return w.type(e)==="function"},isArray:Array.isArray||function(e){return w.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):typeof e=="object"||typeof e=="function"?l[g.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||w.type(e)!=="object"||e.nodeType||w.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(w.support.ownLast)for(n in e)return y.call(e,n);for(n in e);return n===t||y.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||o;var r=N.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=w.buildFragment([e],t,i),i&&w(i).remove(),w.merge([],r.childNodes))},parseJSON:function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(t===null)return t;if(typeof t=="string"){t=w.trim(t);if(t&&C.test(t.replace(L,"@").replace(A,"]").replace(k,"")))return(new Function("return "+t))()}w.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&w.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&w.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(O,"ms-").replace(M,_)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=H(e);if(n)if(o)for(;i<s;i++){r=t.apply(e[i],n);if(r===!1)break}else for(i in e){r=t.apply(e[i],n);if(r===!1)break}else if(o)for(;i<s;i++){r=t.call(e[i],i,e[i]);if(r===!1)break}else for(i in e){r=t.call(e[i],i,e[i]);if(r===!1)break}return e},trim:b&&!b.call("﻿ ")?function(e){return e==null?"":b.call(e)}:function(e){return e==null?"":(e+"").replace(x,"")},makeArray:function(e,t){var n=t||[];return e!=null&&(H(Object(e))?w.merge(n,typeof e=="string"?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,t,n){var r,i=0,s=e.length,o=H(e),u=[];if(o)for(;i<s;i++)r=t(e[i],i,n),r!=null&&(u[u.length]=r);else for(i in e)r=t(e[i],i,n),r!=null&&(u[u.length]=r);return p.apply([],u)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(s=e[n],n=e,e=s),w.isFunction(e)?(r=v.call(arguments,2),i=function(){return e.apply(n||this,r.concat(v.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i):t},access:function(e,n,r,i,s,o,u){var a=0,f=e.length,l=r==null;if(w.type(r)==="object"){s=!0;for(a in r)w.access(e,n,a,r[a],!0,o,u)}else if(i!==t){s=!0,w.isFunction(i)||(u=!0),l&&(u?(n.call(e,i),n=null):(l=n,n=function(e,t,n){return l.call(w(e),n)}));if(n)for(;a<f;a++)n(e[a],r,u?i:i.call(e[a],a,n(e[a],r)))}return s?e:l?n.call(e):f?n(e[0],r):o},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i}}),w.ready.promise=function(t){if(!n){n=w.Deferred();if(o.readyState==="complete")setTimeout(w.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",D,!1),e.addEventListener("load",D,!1);else{o.attachEvent("onreadystatechange",D),e.attachEvent("onload",D);var r=!1;try{r=e.frameElement==null&&o.documentElement}catch(i){}r&&r.doScroll&&function s(){if(!w.isReady){try{r.doScroll("left")}catch(e){return setTimeout(s,50)}P(),w.ready()}}()}}return n.promise(t)},w.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()}),r=w(o),function(e,t){function ot(e,t,n,i){var s,o,u,a,f,l,p,m,g,w;(t?t.ownerDocument||t:E)!==h&&c(t),t=t||h,n=n||[];if(!e||typeof e!="string")return n;if((a=t.nodeType)!==1&&a!==9)return[];if(d&&!i){if(s=Z.exec(e))if(u=s[1]){if(a===9){o=t.getElementById(u);if(!o||!o.parentNode)return n;if(o.id===u)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(u))&&y(t,o)&&o.id===u)return n.push(o),n}else{if(s[2])return H.apply(n,t.getElementsByTagName(e)),n;if((u=s[3])&&r.getElementsByClassName&&t.getElementsByClassName)return H.apply(n,t.getElementsByClassName(u)),n}if(r.qsa&&(!v||!v.test(e))){m=p=b,g=t,w=a===9&&e;if(a===1&&t.nodeName.toLowerCase()!=="object"){l=mt(e),(p=t.getAttribute("id"))?m=p.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",f=l.length;while(f--)l[f]=m+gt(l[f]);g=$.test(e)&&t.parentNode||t,w=l.join(",")}if(w)try{return H.apply(n,g.querySelectorAll(w)),n}catch(S){}finally{p||t.removeAttribute("id")}}}return Nt(e.replace(W,"$1"),t,n,i)}function ut(){function t(n,r){return e.push(n+=" ")>s.cacheLength&&delete t[e.shift()],t[n]=r}var e=[];return t}function at(e){return e[b]=!0,e}function ft(e){var t=h.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)s.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||O)-(~e.sourceIndex||O);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function dt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function vt(){}function mt(e,t){var n,r,i,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=s.preFilter;while(u){if(!n||(r=X.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(i=[]);n=!1;if(r=V.exec(u))n=r.shift(),i.push({value:n,type:r[0].replace(W," ")}),u=u.slice(n.length);for(o in s.filter)(r=G[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(n=r.shift(),i.push({value:n,type:o,matches:r}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)}function gt(e){var t=0,n=e.length,r="";for(;t<n;t++)r+=e[t].value;return r}function yt(e,t,n){var r=t.dir,s=n&&r==="parentNode",o=x++;return t.first?function(t,n,i){while(t=t[r])if(t.nodeType===1||s)return e(t,n,i)}:function(t,n,u){var a,f,l,c=S+" "+o;if(u){while(t=t[r])if(t.nodeType===1||s)if(e(t,n,u))return!0}else while(t=t[r])if(t.nodeType===1||s){l=t[b]||(t[b]={});if((f=l[r])&&f[0]===c){if((a=f[1])===!0||a===i)return a===!0}else{f=l[r]=[c],f[1]=e(t,n,u)||i;if(f[1]===!0)return!0}}}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function wt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function Et(e,t,n,r,i,s){return r&&!r[b]&&(r=Et(r)),i&&!i[b]&&(i=Et(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||Tt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?wt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=wt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?j.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=wt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):H.apply(o,g)})}function St(e){var t,n,r,i=e.length,o=s.relative[e[0].type],u=o||s.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,!0),c=yt(function(e){return j.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a<i;a++)if(n=s.relative[e[a].type])h=[yt(bt(h),n)];else{n=s.filter[e[a].type].apply(null,e[a].matches);if(n[b]){r=++a;for(;r<i;r++)if(s.relative[e[r].type])break;return Et(a>1&&bt(h),a>1&&gt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(W,"$1"),n,a<r&&St(e.slice(a,r)),r<i&&St(e=e.slice(r)),r<i&&gt(e))}h.push(n)}return bt(h)}function xt(e,t){var n=0,r=t.length>0,o=e.length>0,u=function(u,a,l,c,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,x=f,T=u||o&&s.find.TAG("*",p&&a.parentNode||a),N=S+=x==null?1:Math.random()||.1;E&&(f=a!==h&&a,i=n);for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++])if(m(d,a,l)){c.push(d);break}E&&(S=N,i=++n)}r&&((d=!m&&d)&&y--,u&&w.push(d))}y+=b;if(r&&b!==y){v=0;while(m=t[v++])m(w,g,a,l);if(u){if(y>0)while(b--)!w[b]&&!g[b]&&(g[b]=D.call(c));g=wt(g)}H.apply(c,g),E&&!u&&g.length>0&&y+t.length>1&&ot.uniqueSort(c)}return E&&(S=N,f=x),w};return r?at(u):u}function Tt(e,t,n){var r=0,i=t.length;for(;r<i;r++)ot(e,t[r],n);return n}function Nt(e,t,n,i){var o,u,f,l,c,h=mt(e);if(!i&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&r.getById&&t.nodeType===9&&d&&s.relative[u[1].type]){t=(s.find.ID(f.matches[0].replace(rt,it),t)||[])[0];if(!t)return n;e=e.slice(u.shift().value.length)}o=G.needsContext.test(e)?0:u.length;while(o--){f=u[o];if(s.relative[l=f.type])break;if(c=s.find[l])if(i=c(f.matches[0].replace(rt,it),$.test(u[0].type)&&t.parentNode||t)){u.splice(o,1),e=i.length&&gt(u);if(!e)return H.apply(n,i),n;break}}}return a(e,h)(i,t,!d,n,$.test(e)),n}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b="sizzle"+ -(new Date),E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=!1,L=function(e,t){return e===t?(k=!0,0):0},A=typeof t,O=1<<31,M={}.hasOwnProperty,_=[],D=_.pop,P=_.push,H=_.push,B=_.slice,j=_.indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",I="[\\x20\\t\\r\\n\\f]",q="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",R=q.replace("w","w#"),U="\\["+I+"*("+q+")"+I+"*(?:([*^$|!~]?=)"+I+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+R+")|)|)"+I+"*\\]",z=":("+q+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+U.replace(3,8)+")*)|.*)\\)|)",W=new RegExp("^"+I+"+|((?:^|[^\\\\])(?:\\\\.)*)"+I+"+$","g"),X=new RegExp("^"+I+"*,"+I+"*"),V=new RegExp("^"+I+"*([>+~]|"+I+")"+I+"*"),$=new RegExp(I+"*[+~]"),J=new RegExp("="+I+"*([^\\]'\"]*)"+I+"*\\]","g"),K=new RegExp(z),Q=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q.replace("w","w*")+")"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=new RegExp("\\\\([\\da-f]{1,6}"+I+"?|("+I+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{H.apply(_=B.call(E.childNodes),E.childNodes),_[E.childNodes.length].nodeType}catch(st){H={apply:_.length?function(e,t){P.apply(e,B.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}u=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},r=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:E,n=t.defaultView;if(t===h||t.nodeType!==9||!t.documentElement)return h;h=t,p=t.documentElement,d=!u(t),n&&n.attachEvent&&n!==n.top&&n.attachEvent("onbeforeunload",function(){c()}),r.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ft(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ft(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",e.getElementsByClassName("i").length===2}),r.getById=ft(function(e){return p.appendChild(e).id=b,!t.getElementsByName||!t.getElementsByName(b).length}),r.getById?(s.find.ID=function(e,t){if(typeof t.getElementById!==A&&d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},s.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete s.find.ID,s.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),s.find.TAG=r.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==A)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},s.find.CLASS=r.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==A&&d)return t.getElementsByClassName(e)},m=[],v=[];if(r.qsa=Y.test(t.querySelectorAll))ft(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||v.push("\\["+I+"*(?:value|"+F+")"),e.querySelectorAll(":checked").length||v.push(":checked")}),ft(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&v.push("[*^$]="+I+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")});return(r.matchesSelector=Y.test(g=p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ft(function(e){r.disconnectedMatch=g.call(e,"div"),g.call(e,"[s!='']:x"),m.push("!=",z)}),v=v.length&&new RegExp(v.join("|")),m=m.length&&new RegExp(m.join("|")),y=Y.test(p.contains)||p.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},L=p.compareDocumentPosition?function(e,n){if(e===n)return k=!0,0;var i=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);if(i)return i&1||!r.sortDetached&&n.compareDocumentPosition(e)===i?e===t||y(E,e)?-1:n===t||y(E,n)?1:l?j.call(l,e)-j.call(l,n):0:i&4?-1:1;return e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,s=e.parentNode,o=n.parentNode,u=[e],a=[n];if(e===n)return k=!0,0;if(!s||!o)return e===t?-1:n===t?1:s?-1:o?1:l?j.call(l,e)-j.call(l,n):0;if(s===o)return ct(e,n);r=e;while(r=r.parentNode)u.unshift(r);r=n;while(r=r.parentNode)a.unshift(r);while(u[i]===a[i])i++;return i?ct(u[i],a[i]):u[i]===E?-1:a[i]===E?1:0},t},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){(e.ownerDocument||e)!==h&&c(e),t=t.replace(J,"='$1']");if(r.matchesSelector&&d&&(!m||!m.test(t))&&(!v||!v.test(t)))try{var n=g.call(e,t);if(n||r.disconnectedMatch||e.document&&e.document.nodeType!==11)return n}catch(i){}return ot(t,h,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==h&&c(e),y(e,t)},ot.attr=function(e,n){(e.ownerDocument||e)!==h&&c(e);var i=s.attrHandle[n.toLowerCase()],o=i&&M.call(s.attrHandle,n.toLowerCase())?i(e,n,!d):t;return o===t?r.attributes||!d?e.getAttribute(n):(o=e.getAttributeNode(n))&&o.specified?o.value:null:o},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,n=[],i=0,s=0;k=!r.detectDuplicates,l=!r.sortStable&&e.slice(0),e.sort(L);if(k){while(t=e[s++])t===e[s]&&(i=n.push(s));while(i--)e.splice(n[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r];r++)n+=o(t);else if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(i===3||i===4)return e.nodeValue;return n},s=ot.selectors={cacheLength:50,createPseudo:at,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return G.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&K.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return e==="*"?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&T(e,function(e){return t.test(typeof e.className=="string"&&e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[b]||(m[b]={}),f=l[e]||[],p=f[0]===S&&f[1],h=f[0]===S&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}else if(y&&(f=(t[b]||(t[b]={}))[e])&&f[0]===S)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[b]||(c[b]={}))[e]=[S,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=s.pseudos[e]||s.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],s.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=j.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(W,"$1"));return r[b]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return Q.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4)return!1;return!0},parent:function(e){return!s.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[n<0?n+t:n]}),even:dt(function(e,t){var n=0;for(;n<t;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;n<t;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=n<0?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=n<0?n+t:n;for(;++r<t;)e.push(r);return e})}},s.pseudos.nth=s.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})s.pseudos[n]=ht(n);for(n in{submit:!0,reset:!0})s.pseudos[n]=pt(n);vt.prototype=s.filters=s.pseudos,s.setFilters=new vt,a=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=mt(e)),n=t.length;while(n--)s=St(t[n]),s[b]?r.push(s):i.push(s);s=C(e,xt(i,r))}return s},r.sortStable=b.split("").sort(L).join("")===b,r.detectDuplicates=k,c(),r.sortDetached=ft(function(e){return e.compareDocumentPosition(h.createElement("div"))&1}),ft(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild.getAttribute("href")==="#"})||lt("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!r.attributes||!ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&lt("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),ft(function(e){return e.getAttribute("disabled")==null})||lt(F,function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),w.find=ot,w.expr=ot.selectors,w.expr[":"]=w.expr.pseudos,w.unique=ot.uniqueSort,w.text=ot.getText,w.isXMLDoc=ot.isXML,w.contains=ot.contains}(e);var B={};w.Callbacks=function(e){e=typeof e=="string"?B[e]||j(e):w.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){r=e.memory&&t,i=!0,o=u||0,u=0,s=a.length,n=!0;for(;a&&o<s;o++)if(a[o].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,a&&(f?f.length&&l(f.shift()):r?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function i(t){w.each(t,function(t,n){var r=w.type(n);r==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&r!=="string"&&i(n)})})(arguments),n?s=a.length:r&&(u=t,l(r))}return this},remove:function(){return a&&w.each(arguments,function(e,t){var r;while((r=w.inArray(t,a,r))>-1)a.splice(r,1),n&&(r<=s&&s--,r<=o&&o--)}),this},has:function(e){return e?w.inArray(e,a)>-1:!!a&&!!a.length},empty:function(){return a=[],s=0,this},disable:function(){return a=f=r=t,this},disabled:function(){return!a},lock:function(){return f=t,r||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return a&&(!i||f)&&(t=t||[],t=[e,t.slice?t.slice():t],n?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},w.extend({Deferred:function(e){var t=[["resolve","done",w.Callbacks("once memory"),"resolved"],["reject","fail",w.Callbacks("once memory"),"rejected"],["notify","progress",w.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return w.Deferred(function(n){w.each(t,function(t,s){var o=s[0],u=w.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);e&&w.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n.promise():this,u?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?w.extend(e,r):r}},i={};return r.pipe=r.then,w.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=v.call(arguments),r=n.length,i=r!==1||e&&w.isFunction(e.promise)?r:0,s=i===1?e:w.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?v.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&w.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),w.support=function(t){var n,r,s,u,a,f,l,c,h,p=o.createElement("div");p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*")||[],r=p.getElementsByTagName("a")[0];if(!r||!r.style||!n.length)return t;u=o.createElement("select"),f=u.appendChild(o.createElement("option")),s=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute=p.className!=="t",t.leadingWhitespace=p.firstChild.nodeType===3,t.tbody=!p.getElementsByTagName("tbody").length,t.htmlSerialize=!!p.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized=r.getAttribute("href")==="/a",t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!s.value,t.optSelected=f.selected,t.enctype=!!o.createElement("form").enctype,t.html5Clone=o.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,s.checked=!0,t.noCloneChecked=s.cloneNode(!0).checked,u.disabled=!0,t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}s=o.createElement("input"),s.setAttribute("value",""),t.input=s.getAttribute("value")==="",s.value="t",s.setAttribute("type","radio"),t.radioValue=s.value==="t",s.setAttribute("checked","t"),s.setAttribute("name","t"),a=o.createDocumentFragment(),a.appendChild(s),t.appendChecked=s.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){t.noCloneEvent=!1}),p.cloneNode(!0).click());for(h in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+h,"t"),t[h+"Bubbles"]=l in e||p.attributes[l].expando===!1;p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle=p.style.backgroundClip==="content-box";for(h in w(t))break;return t.ownLast=h!=="0",w(function(){var n,r,s,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=o.getElementsByTagName("body")[0];if(!a)return;n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=p.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",w.swap(a,a.style.zoom!=null?{zoom:1}:{},function(){t.boxSizing=p.offsetWidth===4}),e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px",r=p.appendChild(o.createElement("div")),r.style.cssText=p.style.cssText=u,r.style.marginRight=r.style.width="0",p.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof p.style.zoom!==i&&(p.innerHTML="",p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",t.shrinkWrapBlocks=p.offsetWidth!==3,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(n),n=p=s=r=null}),n=u=a=f=r=s=null,t}({});var F=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;w.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?w.cache[e[w.expando]]:e[w.expando],!!e&&!z(e)},data:function(e,t,n){return q(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return q(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9)return!1;var t=e.nodeName&&w.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),w.fn.extend({data:function(e,n){var r,i,s=null,o=0,u=this[0];if(e===t){if(this.length){s=w.data(u);if(u.nodeType===1&&!w._data(u,"parsedAttrs")){r=u.attributes;for(;o<r.length;o++)i=r[o].name,i.indexOf("data-")===0&&(i=w.camelCase(i.slice(5)),U(u,i,s[i]));w._data(u,"parsedAttrs",!0)}}return s}return typeof e=="object"?this.each(function(){w.data(this,e)}):arguments.length>1?this.each(function(){w.data(this,e,n)}):u?U(u,e,w.data(u,e)):null},removeData:function(e){return this.each(function(){w.removeData(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=w._data(e,t),n&&(!r||w.isArray(n)?r=w._data(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),s=w._queueHooks(e,t),o=function(){w.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return w._data(e,n)||w._data(e,n,{empty:w.Callbacks("once memory").add(function(){w._removeData(e,t+"queue"),w._removeData(e,n)})})}}),w.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?w.queue(this[0],e):n===t?this:this.each(function(){var t=w.queue(this,e,n);w._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},delay:function(e,t){return e=w.fx?w.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=w.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=w._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var W,X,V=/[\t\r\n\f]/g,$=/\r/g,J=/^(?:input|select|textarea|button|object)$/i,K=/^(?:a|area)$/i,Q=/^(?:checked|selected)$/i,G=w.support.getSetAttribute,Y=w.support.input;w.fn.extend({attr:function(e,t){return w.access(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})},prop:function(e,t){return w.access(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return e=w.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e=="string"&&e;if(w.isFunction(e))return this.each(function(t){w(this).addClass(e.call(this,t,this.className))});if(a){t=(e||"").match(S)||[];for(;o<u;o++){n=this[o],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(V," "):" ");if(r){s=0;while(i=t[s++])r.indexOf(" "+i+" ")<0&&(r+=i+" ");n.className=w.trim(r)}}}return this},removeClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=arguments.length===0||typeof e=="string"&&e;if(w.isFunction(e))return this.each(function(t){w(this).removeClass(e.call(this,t,this.className))});if(a){t=(e||"").match(S)||[];for(;o<u;o++){n=this[o],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(V," "):"");if(r){s=0;while(i=t[s++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?w.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):w.isFunction(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var t,r=0,s=w(this),o=e.match(S)||[];while(t=o[r++])s.hasClass(t)?s.removeClass(t):s.addClass(t)}else if(n===i||n==="boolean")this.className&&w._data(this,"__className__",this.className),this.className=this.className||e===!1?"":w._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(V," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return r=w.valHooks[s.type]||w.valHooks[s.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(s,"value"))!==t?n:(n=s.value,typeof n=="string"?n.replace($,""):n==null?"":n);return}return i=w.isFunction(e),this.each(function(n){var s;if(this.nodeType!==1)return;i?s=e.call(this,n,w(this).val()):s=e,s==null?s="":typeof s=="number"?s+="":w.isArray(s)&&(s=w.map(s,function(e){return e==null?"":e+""})),r=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t)this.value=s})}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return t!=null?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(w.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!w.nodeName(n.parentNode,"optgroup"))){t=w(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n,r,i=e.options,s=w.makeArray(t),o=i.length;while(o--){r=i[o];if(r.selected=w.inArray(w(r).val(),s)>=0)n=!0}return n||(e.selectedIndex=-1),s}}},attr:function(e,n,r){var s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;if(typeof e.getAttribute===i)return w.prop(e,n,r);if(u!==1||!w.isXMLDoc(e))n=n.toLowerCase(),s=w.attrHooks[n]||(w.expr.match.bool.test(n)?X:W);if(r===t)return s&&"get"in s&&(o=s.get(e,n))!==null?o:(o=w.find.attr(e,n),o==null?t:o);if(r!==null)return s&&"set"in s&&(o=s.set(e,r,n))!==t?o:(e.setAttribute(n,r+""),r);w.removeAttr(e,n)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(S);if(s&&e.nodeType===1)while(n=s[i++])r=w.propFix[n]||n,w.expr.match.bool.test(n)?Y&&G||!Q.test(n)?e[r]=!1:e[w.camelCase("default-"+n)]=e[r]=!1:w.attr(e,n,""),e.removeAttribute(G?n:r)},attrHooks:{type:{set:function(e,t){if(!w.support.radioValue&&t==="radio"&&w.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!w.isXMLDoc(e),o&&(n=w.propFix[n]||n,s=w.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):J.test(e.nodeName)||K.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?w.removeAttr(e,n):Y&&G||!Q.test(n)?e.setAttribute(!G&&w.propFix[n]||n,n):e[w.camelCase("default-"+n)]=e[n]=!0,n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,n){var r=w.expr.attrHandle[n]||w.find.attr;w.expr.attrHandle[n]=Y&&G||!Q.test(n)?function(e,n,i){var s=w.expr.attrHandle[n],o=i?t:(w.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return w.expr.attrHandle[n]=s,o}:function(e,n,r){return r?t:e[w.camelCase("default-"+n)]?n.toLowerCase():null}});if(!Y||!G)w.attrHooks.value={set:function(e,t,n){if(!w.nodeName(e,"input"))return W&&W.set(e,t,n);e.defaultValue=t}};G||(W={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="",r==="value"||n===e.getAttribute(r)?n:t}},w.expr.attrHandle.id=w.expr.attrHandle.name=w.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.value!==""?i.value:null},w.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:W.set},w.attrHooks.contenteditable={set:function(e,t,n){W.set(e,t===""?!1:t,n)}},w.each(["width","height"],function(e,t){w.attrHooks[t]={set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}}})),w.support.hrefNormalized||w.each(["href","src"],function(e,t){w.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),w.support.style||(w.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),w.support.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.support.enctype||(w.propFix.enctype="encoding"),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(w.isArray(t))return e.checked=w.inArray(w(e).val(),t)>=0}},w.support.checkOn||(w.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;w.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=w._data(e);if(!y)return;r.handler&&(l=r,r=l.handler,o=l.selector),r.guid||(r.guid=w.guid++),(a=y.events)||(a=y.events={}),(h=y.handle)||(h=y.handle=function(e){return typeof w===i||!!e&&w.event.triggered===e.type?t:w.event.dispatch.apply(h.elem,arguments)},h.elem=e),n=(n||"").match(S)||[""],f=n.length;while(f--){u=rt.exec(n[f])||[],v=g=u[1],m=(u[2]||"").split(".").sort();if(!v)continue;c=w.event.special[v]||{},v=(o?c.delegateType:c.bindType)||v,c=w.event.special[v]||{},p=w.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&w.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[],d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===!1)e.addEventListener?e.addEventListener(v,h,!1):e.attachEvent&&e.attachEvent("on"+v,h)}c.add&&(c.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,p):d.push(p),w.event.global[v]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=w.hasData(e)&&w._data(e);if(!m||!(l=m.events))return;t=(t||"").match(S)||[""],f=t.length;while(f--){u=rt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in l)w.event.remove(e,p+t[f],n,r,!0);continue}c=w.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=l[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;while(s--)o=h[s],(i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(h.splice(s,1),o.selector&&h.delegateCount--,c.remove&&c.remove.call(e,o));a&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&w.removeEvent(e,p,m.handle),delete l[p])}w.isEmptyObject(l)&&(delete m.handle,w._removeData(e,"events"))},trigger:function(n,r,i,s){var u,a,f,l,c,h,p,d=[i||o],v=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||o;if(i.nodeType===3||i.nodeType===8)return;if(nt.test(v+w.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),a=v.indexOf(":")<0&&"on"+v,n=n[w.expando]?n:new w.Event(v,typeof n=="object"&&n),n.isTrigger=s?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=r==null?[n]:w.makeArray(r,[n]),c=w.event.special[v]||{};if(!s&&c.trigger&&c.trigger.apply(i,r)===!1)return;if(!s&&!c.noBubble&&!w.isWindow(i)){l=c.delegateType||v,nt.test(l+v)||(f=f.parentNode);for(;f;f=f.parentNode)d.push(f),h=f;h===(i.ownerDocument||o)&&d.push(h.defaultView||h.parentWindow||e)}p=0;while((f=d[p++])&&!n.isPropagationStopped())n.type=p>1?l:c.bindType||v,u=(w._data(f,"events")||{})[n.type]&&w._data(f,"handle"),u&&u.apply(f,r),u=a&&f[a],u&&w.acceptData(f)&&u.apply&&u.apply(f,r)===!1&&n.preventDefault();n.type=v;if(!s&&!n.isDefaultPrevented()&&(!c._default||c._default.apply(d.pop(),r)===!1)&&w.acceptData(i)&&a&&i[v]&&!w.isWindow(i)){h=i[a],h&&(i[a]=null),w.event.triggered=v;try{i[v]()}catch(g){}w.event.triggered=t,h&&(i[a]=h)}return n.result},dispatch:function(e){e=w.event.fix(e);var n,r,i,s,o,u=[],a=v.call(arguments),f=(w._data(this,"events")||{})[e.type]||[],l=w.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=w.event.handlers.call(this,e,f),n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,r=((w.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click"))for(;f!=this;f=f.parentNode||this)if(f.nodeType===1&&(f.disabled!==!0||e.type!=="click")){s=[];for(o=0;o<a;o++)i=n[o],r=i.selector+" ",s[r]===t&&(s[r]=i.needsContext?w(r,this).index(f)>=0:w.find(r,this,null,[f]).length),s[r]&&s.push(i);s.length&&u.push({elem:f,handlers:s})}return a<n.length&&u.push({elem:this,handlers:n.slice(a)}),u},fix:function(e){if(e[w.expando])return e;var t,n,r,i=e.type,s=e,u=this.fixHooks[i];u||(this.fixHooks[i]=u=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=u.props?this.props.concat(u.props):this.props,e=new w.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=s.srcElement||o),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,u.filter?u.filter(e,s):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,s,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(i=e.target.ownerDocument||o,s=i.documentElement,r=i.body,e.pageX=n.clientX+(s&&s.scrollLeft||r&&r.scrollLeft||0)-(s&&s.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||r&&r.scrollTop||0)-(s&&s.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ot()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===ot()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(w.nodeName(this,"input")&&this.type==="checkbox"&&this.click)return this.click(),!1},_default:function(e){return w.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=w.extend(new w.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?w.event.trigger(i,null,t):w.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},w.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:st):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||w.now(),this[w.expando]=!0},w.Event.prototype={isDefaultPrevented:st,isPropagationStopped:st,isImmediatePropagationStopped:st,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},w.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj;if(!i||i!==r&&!w.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),w.support.submitBubbles||(w.event.special.submit={setup:function(){if(w.nodeName(this,"form"))return!1;w.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=w.nodeName(n,"input")||w.nodeName(n,"button")?n.form:t;r&&!w._data(r,"submitBubbles")&&(w.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),w._data(r,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&w.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(w.nodeName(this,"form"))return!1;w.event.remove(this,"._submit")}}),w.support.changeBubbles||(w.event.special.change={setup:function(){if(Z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")w.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),w.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),w.event.simulate("change",this,e,!0)});return!1}w.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!w._data(t,"changeBubbles")&&(w.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&w.event.simulate("change",this.parentNode,e,!0)}),w._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return w.event.remove(this,"._change"),!Z.test(this.nodeName)}}),w.support.focusinBubbles||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){w.event.simulate(t,e.target,w.event.fix(e),!0)};w.event.special[t]={setup:function(){n++===0&&o.addEventListener(e,r,!0)},teardown:function(){--n===0&&o.removeEventListener(e,r,!0)}}}),w.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(o in e)this.on(o,n,r,e[o],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=st;else if(!i)return this;return s===1&&(u=i,i=function(e){return w().off(e),u.apply(this,arguments)},i.guid=u.guid||(u.guid=w.guid++)),this.each(function(){w.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,w(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=st),this.each(function(){w.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}});var ut=/^.[^:#\[\.,]*$/,at=/^(?:parents|prev(?:Until|All))/,ft=w.expr.match.needsContext,lt={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if(typeof e!="string")return this.pushStack(w(e).filter(function(){for(t=0;t<i;t++)if(w.contains(r[t],this))return!0}));for(t=0;t<i;t++)w.find(e,r[t],n);return n=this.pushStack(i>1?w.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=w(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(w.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ht(this,e||[],!0))},filter:function(e){return this.pushStack(ht(this,e||[],!1))},is:function(e){return!!ht(this,typeof e=="string"&&ft.test(e)?w(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,s=[],o=ft.test(e)||typeof e!="string"?w(e,t||this.context):0;for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&w.find.matchesSelector(n,e))){n=s.push(n);break}return this.pushStack(s.length>1?w.unique(s):s)},index:function(e){return e?typeof e=="string"?w.inArray(this[0],w(e)):w.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?w(e,t):w.makeArray(e&&e.nodeType?[e]:e),r=w.merge(this.get(),n);return this.pushStack(w.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return w.dir(e,"parentNode")},parentsUntil:function(e,t,n){return w.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return w.dir(e,"nextSibling")},prevAll:function(e){return w.dir(e,"previousSibling")},nextUntil:function(e,t,n){return w.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return w.dir(e,"previousSibling",n)},siblings:function(e){return w.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return w.sibling(e.firstChild)},contents:function(e){return w.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:w.merge([],e.childNodes)}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=w.filter(r,i)),this.length>1&&(lt[e]||(i=w.unique(i)),at.test(e)&&(i=i.reverse())),this.pushStack(i)}}),w.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return e.nodeType===1}))},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!w(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/<tbody/i,Et=/<|&#?\w+;/,St=/<(?:script|style|link)/i,xt=/^(?:checkbox|radio)$/i,Tt=/checked\s*(?:[^=]|=\s*.checked.)/i,Nt=/^$|\/(?:java|ecma)script/i,Ct=/^true\/(.*)/,kt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Lt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:w.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},At=pt(o),Ot=At.appendChild(o.createElement("div"));Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td,w.fn.extend({text:function(e){return w.access(this,function(e){return e===t?w.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Mt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?w.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++)!t&&n.nodeType===1&&w.cleanData(jt(n)),n.parentNode&&(t&&w.contains(n.ownerDocument,n)&&Pt(jt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&w.cleanData(jt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&w.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return w.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(vt,""):t;if(typeof e=="string"&&!St.test(e)&&(w.support.htmlSerialize||!mt.test(e))&&(w.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(w.cleanData(jt(n,!1)),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=w.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),w(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=p.apply([],e);var r,i,s,o,u,a,f=0,l=this.length,c=this,h=l-1,d=e[0],v=w.isFunction(d);if(v||!(l<=1||typeof d!="string"||w.support.checkClone||!Tt.test(d)))return this.each(function(r){var i=c.eq(r);v&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(l){a=w.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=a.firstChild,a.childNodes.length===1&&(a=r);if(r){o=w.map(jt(a,"script"),_t),s=o.length;for(;f<l;f++)i=a,f!==h&&(i=w.clone(i,!0,!0),s&&w.merge(o,jt(i,"script"))),t.call(this[f],i,f);if(s){u=o[o.length-1].ownerDocument,w.map(o,Dt);for(f=0;f<s;f++)i=o[f],Nt.test(i.type||"")&&!w._data(i,"globalEval")&&w.contains(u,i)&&(i.src?w._evalUrl(i.src):w.globalEval((i.text||i.textContent||i.innerHTML||"").replace(kt,"")))}a=r=null}}return this}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){var n,r=0,i=[],s=w(e),o=s.length-1;for(;r<=o;r++)n=r===o?this:this.clone(!0),w(s[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}}),w.extend({clone:function(e,t,n){var r,i,s,o,u,a=w.contains(e.ownerDocument,e);w.support.html5Clone||w.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(Ot.innerHTML=e.outerHTML,Ot.removeChild(s=Ot.firstChild));if((!w.support.noCloneEvent||!w.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!w.isXMLDoc(e)){r=jt(s),u=jt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&Bt(i,r[o])}if(t)if(n){u=u||jt(e),r=r||jt(s);for(o=0;(i=u[o])!=null;o++)Ht(i,r[o])}else Ht(e,s);return r=jt(s,"script"),r.length>0&&Pt(r,!a&&jt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d<c;d++){s=e[d];if(s||s===0)if(w.type(s)==="object")w.merge(p,s.nodeType?[s]:s);else if(!Et.test(s))p.push(t.createTextNode(s));else{u=u||h.appendChild(t.createElement("div")),a=(bt.exec(s)||["",""])[1].toLowerCase(),l=Lt[a]||Lt._default,u.innerHTML=l[1]+s.replace(yt,"<$1></$2>")+l[2],i=l[0];while(i--)u=u.lastChild;!w.support.leadingWhitespace&&gt.test(s)&&p.push(t.createTextNode(gt.exec(s)[0]));if(!w.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]==="<table>"&&!wt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)w.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}w.merge(p,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=h.lastChild}}u&&h.removeChild(u),w.support.appendChecked||w.grep(jt(p,"input"),Ft),d=0;while(s=p[d++]){if(r&&w.inArray(s,r)!==-1)continue;o=w.contains(s.ownerDocument,s),u=jt(h.appendChild(s),"script"),o&&Pt(u);if(n){i=0;while(s=u[i++])Nt.test(s.type||"")&&n.push(s)}}return u=null,h},cleanData:function(e,t){var n,r,s,o,u=0,a=w.expando,f=w.cache,l=w.support.deleteExpando,h=w.event.special;for(;(n=e[u])!=null;u++)if(t||w.acceptData(n)){s=n[a],o=s&&f[s];if(o){if(o.events)for(r in o.events)h[r]?w.event.remove(n,r):w.removeEvent(n,r,o.handle);f[s]&&(delete f[s],l?delete n[a]:typeof n.removeAttribute!==i?n.removeAttribute(a):n[a]=null,c.push(s))}}},_evalUrl:function(e){return w.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),w.fn.extend({wrapAll:function(e){if(w.isFunction(e))return this.each(function(t){w(this).wrapAll(e.call(this,t))});if(this[0]){var t=w(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return w.isFunction(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=w.isFunction(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){w.nodeName(this,"body")||w(this).replaceWith(this.childNodes)}).end()}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+E+")(.*)$","i"),Jt=new RegExp("^("+E+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+E+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];w.fn.extend({css:function(e,n){return w.access(this,function(e,n,r){var i,s,o={},u=0;if(w.isArray(n)){s=qt(e),i=n.length;for(;u<i;u++)o[n[u]]=w.css(e,n[u],!1,s);return o}return r!==t?w.style(e,n,r):w.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){nn(this)?w(this).show():w(this).hide()})}}),w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":w.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=w.camelCase(n),f=e.style;n=w.cssProps[a]||(w.cssProps[a]=tn(f,a)),u=w.cssHooks[n]||w.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=Kt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(w.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!w.cssNumber[a]&&(r+="px"),!w.support.clearCloneStyle&&r===""&&n.indexOf("background")===0&&(f[n]="inherit");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=w.camelCase(n);return n=w.cssProps[a]||(w.cssProps[a]=tn(e.style,a)),u=w.cssHooks[n]||w.cssHooks[a],u&&"get"in u&&(o=u.get(e,!0,r)),o===t&&(o=Rt(e,n,i)),o==="normal"&&n in Yt&&(o=Yt[n]),r===""||r?(s=parseFloat(o),r===!0||w.isNumeric(s)?s||0:o):o}}),e.getComputedStyle?(qt=function(t){return e.getComputedStyle(t,null)},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;return u&&(a===""&&!w.contains(e.ownerDocument,e)&&(a=w.style(e,n)),Jt.test(a)&&Vt.test(n)&&(i=f.width,s=f.minWidth,o=f.maxWidth,f.minWidth=f.maxWidth=f.width=a,a=u.width,f.width=i,f.minWidth=s,f.maxWidth=o)),a}):o.documentElement.currentStyle&&(qt=function(e){return e.currentStyle},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;return a==null&&f&&f[n]&&(a=f[n]),Jt.test(a)&&!Wt.test(n)&&(i=f.left,s=e.runtimeStyle,o=s&&s.left,o&&(s.left=e.currentStyle.left),f.left=n==="fontSize"?"1em":a,a=f.pixelLeft+"px",f.left=i,o&&(s.left=o)),a===""?"auto":a}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&Xt.test(w.css(e,"display"))?w.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,w.support.boxSizing&&w.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),w.support.opacity||(w.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=w.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&w.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}),w(function(){w.support.reliableMarginRight||(w.cssHooks.marginRight={get:function(e,t){if(t)return w.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}),!w.support.pixelPosition&&w.fn.position&&w.each(["top","left"],function(e,t){w.cssHooks[t]={get:function(e,n){if(n)return n=Rt(e,t),Jt.test(n)?w(e).position()[t]+"px":n}}})}),w.expr&&w.expr.filters&&(w.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!w.support.reliableHiddenOffsets&&(e.style&&e.style.display||w.css(e,"display"))==="none"},w.expr.filters.visible=function(e){return!w.expr.filters.hidden(e)}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+Zt[r]+t]=s[r]||s[r-2]||s[0];return i}},Vt.test(e)||(w.cssHooks[e+t].set=sn)});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=w(this).val();return n==null?null:w.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}}),w.param=function(e,n){var r,i=[],s=function(e,t){t=w.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=w.ajaxSettings&&w.ajaxSettings.traditional);if(w.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){s(this.name,this.value)});else for(r in e)vn(r,e[r],n,s);return i.join("&").replace(ln,"+")},w.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,gn,yn=w.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=w.fn.load,Ln={},An={},On="*/".concat("*");try{gn=s.href}catch(Mn){gn=o.createElement("a"),gn.href="",gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[],w.fn.load=function(e,n,r){if(typeof e!="string"&&kn)return kn.apply(this,arguments);var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),w.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(o="POST"),u.length>0&&w.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments,u.html(i?w("<div>").append(w.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":w.parseJSON,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Pn(Pn(e,w.ajaxSettings),t):Pn(w.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(b===2)return;b=2,u&&clearTimeout(u),f=t,o=i||"",x.readyState=e>0?4:0,l=e>=200&&e<300||e===304,r&&(E=Hn(c,x,r)),E=Bn(c,E,x,l);if(l)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(w.lastModified[s]=S),S=x.getResponseHeader("etag"),S&&(w.etag[s]=S)),e===204||c.type==="HEAD"?T="nocontent":e===304?T="notmodified":(T=E.state,g=E.data,y=E.error,l=!y);else{y=T;if(e||!T)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[g,T,x]):d.rejectWith(h,[x,T,y]),x.statusCode(m),m=t,a&&p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y]),v.fireWith(h,[x,T]),a&&(p.trigger("ajaxComplete",[x,c]),--w.active||w.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=w.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?w(h):w.event,d=w.Deferred(),v=w.Callbacks("once memory"),m=c.statusCode||{},g={},y={},b=0,E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!l){l={};while(t=Sn.exec(o))l[t[1].toLowerCase()]=t[2]}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return b||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||E;return f&&f.abort(t),N(0,t),this}};d.promise(x).complete=v.add,x.success=x.done,x.error=x.fail,c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//"),c.type=n.method||n.type||c.method||c.type,c.dataTypes=w.trim(c.dataType||"*").toLowerCase().match(S)||[""],c.crossDomain==null&&(r=Cn.exec(c.url.toLowerCase()),c.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||(r[1]==="http:"?"80":"443"))===(mn[3]||(mn[1]==="http:"?"80":"443")))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=w.param(c.data,c.traditional)),Dn(Ln,c,n,x);if(b===2)return x;a=c.global,a&&w.active++===0&&w.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Tn.test(c.type),s=c.url,c.hasContent||(c.data&&(s=c.url+=(bn.test(s)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++)),c.ifModified&&(w.lastModified[s]&&x.setRequestHeader("If-Modified-Since",w.lastModified[s]),w.etag[s]&&x.setRequestHeader("If-None-Match",w.etag[s])),(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers)x.setRequestHeader(i,c.headers[i]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&b!==2){E="abort";for(i in{success:1,error:1,complete:1})x[i](c[i]);f=Dn(An,c,n,x);if(!f)N(-1,"No Transport");else{x.readyState=1,a&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{b=1,f.send(g,N)}catch(T){if(!(b<2))throw T;N(-1,T)}}return x}return x.abort()},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,n){return w.get(e,t,n,"script")}}),w.each(["get","post"],function(e,n){w[n]=function(e,r,i,s){return w.isFunction(r)&&(s=s||i,i=r,r=t),w.ajax({url:e,type:n,dataType:s,data:r,success:i})}}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),w.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||w("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||w.expando+"_"+yn++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==!1&&(Fn.test(n.url)?"url":typeof n.data=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp")return s=n.jsonpCallback=w.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a?n[a]=n[a].replace(Fn,"$1"+s):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||w.error(s+" was not called"),u[0]},n.dataTypes[0]="json",o=e[s],e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,jn.push(s)),u&&w.isFunction(o)&&o(u[0]),u=o=t}),"script"});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In)In[e](t,!0)};w.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn,qn=w.ajaxSettings.xhr(),w.support.cors=!!qn&&"withCredentials"in qn,qn=w.support.ajax=!!qn,qn&&w.ajaxTransport(function(n){if(!n.crossDomain||w.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=w.noop,Un&&delete In[o]);if(i)a.readyState!==4&&a.abort();else{c={},u=a.status,f=a.getAllResponseHeaders(),typeof a.responseText=="string"&&(c.text=a.responseText);try{l=a.statusText}catch(h){l=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(p){i||s(-1,p)}c&&s(u,l,c,f)},n.async?a.readyState===4?setTimeout(r):(o=++Rn,Un&&(In||(In={},w(e).unload(Un)),In[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+E+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Jn.exec(t),s=i&&i[3]||(w.cssNumber[e]?"":"px"),o=(w.cssNumber[e]||s!=="px"&&+r)&&Jn.exec(w.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3],i=i||[],o=+r||1;do u=u||".5",o/=u,w.style(n.elem,e,o+s);while(u!==(u=n.cur()/r)&&u!==1&&--a)}return i&&(o=n.start=+o||+r||0,n.unit=s,n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]),n}]};w.Animation=w.extend(er,{tweener:function(e,t){w.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Gn[n]=Gn[n]||[],Gn[n].unshift(t)},prefilter:function(e,t){t?Qn.unshift(e):Qn.push(e)}}),w.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(w.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=w.css(e.elem,e.prop,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):e.elem.style&&(e.elem.style[w.cssProps[e.prop]]!=null||w.cssHooks[e.prop])?w.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return e==null||typeof e=="boolean"?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),s=w.speed(t,n,r),o=function(){var t=er(this,w.extend({},e),s);(i||w._data(this,"finish"))&&t.stop(!0)};return o.finish=o,i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=w.timers,o=w._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Kn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&w.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=w._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],s=w.timers,o=r?r.length:0;n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0);for(t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.speed=function(e,t,n){var r=e&&typeof e=="object"?w.extend({},e):{complete:n||!n&&t||w.isFunction(e)&&e,duration:e,easing:n&&t||t&&!w.isFunction(t)&&t};r.duration=w.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in w.fx.speeds?w.fx.speeds[r.duration]:w.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){w.isFunction(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},w.timers=[],w.fx=rr.prototype.init,w.fx.tick=function(){var e,n=w.timers,r=0;Xn=w.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||w.fx.stop(),Xn=t},w.fx.timer=function(e){e()&&w.timers.push(e)&&w.fx.start()},w.fx.interval=13,w.fx.start=function(){Vn||(Vn=setInterval(w.fx.tick,w.fx.interval))},w.fx.stop=function(){clearInterval(Vn),Vn=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fx.step={},w.expr&&w.expr.filters&&(w.expr.filters.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length}),w.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){w.offset.setOffset(this,e,t)});var n,r,s={top:0,left:0},o=this[0],u=o&&o.ownerDocument;if(!u)return;return n=u.documentElement,w.contains(n,o)?(typeof o.getBoundingClientRect!==i&&(s=o.getBoundingClientRect()),r=sr(u),{top:s.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:s.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):s},w.offset={setOffset:function(e,t,n){var r=w.css(e,"position");r==="static"&&(e.style.position="relative");var i=w(e),s=i.offset(),o=w.css(e,"top"),u=w.css(e,"left"),a=(r==="absolute"||r==="fixed")&&w.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),w.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},w.fn.extend({position:function(){if(!this[0])return;var e,t,n={top:0,left:0},r=this[0];return w.css(r,"position")==="fixed"?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),w.nodeName(e[0],"html")||(n=e.offset()),n.top+=w.css(e[0],"borderTopWidth",!0),n.left+=w.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-w.css(r,"marginTop",!0),left:t.left-n.left-w.css(r,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u;while(e&&!w.nodeName(e,"html")&&w.css(e,"position")==="static")e=e.offsetParent;return e||u})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);w.fn[e]=function(i){return w.access(this,function(e,i,s){var o=sr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?w(o).scrollLeft():s,r?s:w(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),w.each({Height:"height",Width:"width"},function(e,n){w.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){w.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return w.access(this,function(n,r,i){var s;return w.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?w.css(n,r,u):w.style(n,r,i,u)},n,o?i:t,o,null)}})}),w.fn.size=function(){return this.length},w.fn.andSelf=w.fn.addBack,typeof module=="object"&&module&&typeof module.exports=="object"?module.exports=w:(e.jQuery=e.$=w,typeof define=="function"&&define.amd&&define("jquery",[],function(){return w}))}(window),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else{var o=x.keys(e);for(var i=0,s=o.length;i<s;i++)if(t.call(r,e[o[i]],o[i],e)===n)return}};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r},x.sample=function(e,t,n){return arguments.length<2||n?e[x.random(e.length-1)]:x.shuffle(e).slice(0,Math.max(0,t))};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index-t.index}),"value")};var L=function(e){return function(t,n,r){var i={},s=n==null?x.identity:k(n);return T(t,function(n,o){var u=s.call(r,n,o,t);e(i,u,n)}),i}};x.groupBy=L(function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)}),x.indexBy=L(function(e,t,n){e[t]=n}),x.countBy=L(function(e,t){x.has(e,t)?e[t]++:e[t]=1}),x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t==null||n?e[0]:u.call(e,0,t)},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t==null||n?e[e.length-1]:u.call(e,Math.max(e.length-t,0))},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return t&&x.every(e,x.isArray)?a.apply(n,e):(T(e,function(e){x.isArray(e)||x.isArguments(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n)};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n<e;n++)t[n]=x.pluck(arguments,""+n);return t},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};x.bind=function(e,t){var n,r;if(S&&e.bind===S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;return n=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:new Date,o=null,s=e.apply(r,i)};return function(){var f=new Date;!u&&n.leading===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(o),o=null,u=f,s=e.apply(r,i)):!o&&n.trailing!==!1&&(o=setTimeout(a,l)),s}},x.debounce=function(e,t,n){var r,i,s,o,u;return function(){s=this,i=arguments,o=new Date;var a=function(){var f=new Date-o;f<t?r=setTimeout(a,t-f):(r=null,n||(u=e.apply(s,i)))},f=n&&!r;return r||(r=setTimeout(a,t)),f&&(u=e.apply(s,i)),u}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=e[t[i]];return r},x.pairs=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},x.invert=function(e){var t={},n=x.keys(e);for(var r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;var o=e.constructor,u=t.constructor;if(o!==u&&!(x.isFunction(o)&&o instanceof o&&x.isFunction(u)&&u instanceof u))return!1;n.push(e),r.push(t);var a=0,l=!0;if(i=="[object Array]"){a=e.length,l=a==t.length;if(l)while(a--)if(!(l=M(e[a],t[a],n,r)))break}else{for(var c in e)if(x.has(e,c)){a++;if(!(l=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(l){for(c in t)if(x.has(t,c)&&!(a--))break;l=!a}}return n.pop(),r.pop(),l};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(Math.max(0,e));for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t,n;return t||e._}}(this)),function(e,t){if(typeof define=="function"&&define.amd)define("backbone",["underscore","jquery","exports"],function(n,r,i){e.Backbone=t(e,i,n,r)});else if(typeof exports!="undefined"){var n=require("underscore");t(e,exports,n)}else e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t,n,r){var i=e.Backbone,s=[],o=s.push,u=s.slice,a=s.splice;t.VERSION="1.1.2",t.$=r,t.noConflict=function(){return e.Backbone=i,this},t.emulateHTTP=!1,t.emulateJSON=!1;var f=t.Events={on:function(e,t,n){if(!c(this,"on",e,[t,n])||!t)return this;this._events||(this._events={});var r=this._events[e]||(this._events[e]=[]);return r.push({callback:t,context:n,ctx:n||this}),this},once:function(e,t,r){if(!c(this,"once",e,[t,r])||!t)return this;var i=this,s=n.once(function(){i.off(e,s),t.apply(this,arguments)});return s._callback=t,this.on(e,s,r)},off:function(e,t,r){var i,s,o,u,a,f,l,h;if(!this._events||!c(this,"off",e,[t,r]))return this;if(!e&&!t&&!r)return this._events=void 0,this;u=e?[e]:n.keys(this._events);for(a=0,f=u.length;a<f;a++){e=u[a];if(o=this._events[e]){this._events[e]=i=[];if(t||r)for(l=0,h=o.length;l<h;l++)s=o[l],(t&&t!==s.callback&&t!==s.callback._callback||r&&r!==s.context)&&i.push(s);i.length||delete this._events[e]}}return this},trigger:function(e){if(!this._events)return this;var t=u.call(arguments,1);if(!c(this,"trigger",e,t))return this;var n=this._events[e],r=this._events.all;return n&&h(n,t),r&&h(r,arguments),this},stopListening:function(e,t,r){var i=this._listeningTo;if(!i)return this;var s=!t&&!r;!r&&typeof t=="object"&&(r=this),e&&((i={})[e._listenId]=e);for(var o in i)e=i[o],e.off(t,r,this),(s||n.isEmpty(e._events))&&delete this._listeningTo[o];return this}},l=/\s+/,c=function(e,t,n,r){if(!n)return!0;if(typeof n=="object"){for(var i in n)e[t].apply(e,[i,n[i]].concat(r));return!1}if(l.test(n)){var s=n.split(l);for(var o=0,u=s.length;o<u;o++)e[t].apply(e,[s[o]].concat(r));return!1}return!0},h=function(e,t){var n,r=-1,i=e.length,s=t[0],o=t[1],u=t[2];switch(t.length){case 0:while(++r<i)(n=e[r]).callback.call(n.ctx);return;case 1:while(++r<i)(n=e[r]).callback.call(n.ctx,s);return;case 2:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o);return;case 3:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o,u);return;default:while(++r<i)(n=e[r]).callback.apply(n.ctx,t);return}},p={listenTo:"on",listenToOnce:"once"};n.each(p,function(e,t){f[t]=function(t,r,i){var s=this._listeningTo||(this._listeningTo={}),o=t._listenId||(t._listenId=n.uniqueId("l"));return s[o]=t,!i&&typeof r=="object"&&(i=this),t[e](r,i,this),this}}),f.bind=f.on,f.unbind=f.off,n.extend(t,f);var d=t.Model=function(e,t){var r=e||{};t||(t={}),this.cid=n.uniqueId("c"),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(r=this.parse(r,t)||{}),r=n.defaults({},r,n.result(this,"defaults")),this.set(r,t),this.changed={},this.initialize.apply(this,arguments)};n.extend(d.prototype,f,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return this.get(e)!=null},set:function(e,t,r){var i,s,o,u,a,f,l,c;if(e==null)return this;typeof e=="object"?(s=e,r=t):(s={})[e]=t,r||(r={});if(!this._validate(s,r))return!1;o=r.unset,a=r.silent,u=[],f=this._changing,this._changing=!0,f||(this._previousAttributes=n.clone(this.attributes),this.changed={}),c=this.attributes,l=this._previousAttributes,this.idAttribute in s&&(this.id=s[this.idAttribute]);for(i in s)t=s[i],n.isEqual(c[i],t)||u.push(i),n.isEqual(l[i],t)?delete this.changed[i]:this.changed[i]=t,o?delete c[i]:c[i]=t;if(!a){u.length&&(this._pending=r);for(var h=0,p=u.length;h<p;h++)this.trigger("change:"+u[h],this,c[u[h]],r)}if(f)return this;if(!a)while(this._pending)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return e==null?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?n.clone(this.changed):!1;var t,r=!1,i=this._changing?this._previousAttributes:this.attributes;for(var s in e){if(n.isEqual(i[s],t=e[s]))continue;(r||(r={}))[s]=t}return r},previous:function(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=e?n.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=this,r=e.success;return e.success=function(n){if(!t.set(t.parse(n,e),e))return!1;r&&r(t,n,e),t.trigger("sync",t,n,e)},I(this,e),this.sync("read",this,e)},save:function(e,t,r){var i,s,o,u=this.attributes;e==null||typeof e=="object"?(i=e,r=t):(i={})[e]=t,r=n.extend({validate:!0},r);if(i&&!r.wait){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;i&&r.wait&&(this.attributes=n.extend({},u,i)),r.parse===void 0&&(r.parse=!0);var a=this,f=r.success;return r.success=function(e){a.attributes=u;var t=a.parse(e,r);r.wait&&(t=n.extend(i||{},t));if(n.isObject(t)&&!a.set(t,r))return!1;f&&f(a,e,r),a.trigger("sync",a,e,r)},I(this,r),s=this.isNew()?"create":r.patch?"patch":"update",s==="patch"&&(r.attrs=i),o=this.sync(s,this,r),i&&r.wait&&(this.attributes=u),o},destroy:function(e){e=e?n.clone(e):{};var t=this,r=e.success,i=function(){t.trigger("destroy",t,t.collection,e)};e.success=function(n){(e.wait||t.isNew())&&i(),r&&r(t,n,e),t.isNew()||t.trigger("sync",t,n,e)};if(this.isNew())return e.success(),!1;I(this,e);var s=this.sync("delete",this,e);return e.wait||i(),s},url:function(){var e=n.result(this,"urlRoot")||n.result(this.collection,"url")||F();return this.isNew()?e:e.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},n.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var r=this.validationError=this.validate(e,t)||null;return r?(this.trigger("invalid",this,r,n.extend(t,{validationError:r})),!1):!0}});var v=["keys","values","pairs","invert","pick","omit"];n.each(v,function(e){d.prototype[e]=function(){var t=u.call(arguments);return t.unshift(this.attributes),n[e].apply(n,t)}});var m=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),t.comparator!==void 0&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},g={add:!0,remove:!0,merge:!0},y={add:!0,remove:!1};n.extend(m.prototype,f,{model:d,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:!1},t,y))},remove:function(e,t){var r=!n.isArray(e);e=r?[e]:n.clone(e),t||(t={});var i,s,o,u;for(i=0,s=e.length;i<s;i++){u=e[i]=this.get(e[i]);if(!u)continue;delete this._byId[u.id],delete this._byId[u.cid],o=this.indexOf(u),this.models.splice(o,1),this.length--,t.silent||(t.index=o,u.trigger("remove",u,this,t)),this._removeReference(u,t)}return r?e[0]:e},set:function(e,t){t=n.defaults({},t,g),t.parse&&(e=this.parse(e,t));var r=!n.isArray(e);e=r?e?[e]:[]:n.clone(e);var i,s,o,u,a,f,l,c=t.at,h=this.model,p=this.comparator&&c==null&&t.sort!==!1,v=n.isString(this.comparator)?this.comparator:null,m=[],y=[],b={},w=t.add,E=t.merge,S=t.remove,x=!p&&w&&S?[]:!1;for(i=0,s=e.length;i<s;i++){a=e[i]||{},a instanceof d?o=u=a:o=a[h.prototype.idAttribute||"id"];if(f=this.get(o))S&&(b[f.cid]=!0),E&&(a=a===u?u.attributes:a,t.parse&&(a=f.parse(a,t)),f.set(a,t),p&&!l&&f.hasChanged(v)&&(l=!0)),e[i]=f;else if(w){u=e[i]=this._prepareModel(a,t);if(!u)continue;m.push(u),this._addReference(u,t)}u=f||u,x&&(u.isNew()||!b[u.id])&&x.push(u),b[u.id]=!0}if(S){for(i=0,s=this.length;i<s;++i)b[(u=this.models[i]).cid]||y.push(u);y.length&&this.remove(y,t)}if(m.length||x&&x.length){p&&(l=!0),this.length+=m.length;if(c!=null)for(i=0,s=m.length;i<s;i++)this.models.splice(c+i,0,m[i]);else{x&&(this.models.length=0);var T=x||m;for(i=0,s=T.length;i<s;i++)this.models.push(T[i])}}l&&this.sort({silent:!0});if(!t.silent){for(i=0,s=m.length;i<s;i++)(u=m[i]).trigger("add",u,this,t);(l||x&&x.length)&&this.trigger("sort",this,t)}return r?e[0]:e},reset:function(e,t){t||(t={});for(var r=0,i=this.models.length;r<i;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return u.apply(this.models,arguments)},get:function(e){return e==null?void 0:this._byId[e]||this._byId[e.id]||this._byId[e.cid]},at:function(e){return this.models[e]},where:function(e,t){return n.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var n in e)if(e[n]!==t.get(n))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),n.isString(this.comparator)||this.comparator.length===1?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return n.invoke(this.models,"get",e)},fetch:function(e){e=e?n.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=e.success,r=this;return e.success=function(n){var i=e.reset?"reset":"set";r[i](n,e),t&&t(r,n,e),r.trigger("sync",r,n,e)},I(this,e),this.sync("read",this,e)},create:function(e,t){t=t?n.clone(t):{};if(!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var r=this,i=t.success;return t.success=function(e,n){t.wait&&r.add(e,t),i&&i(e,n,t)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof d)return e;t=t?n.clone(t):{},t.collection=this;var r=new this.model(e,t);return r.validationError?(this.trigger("invalid",this,r.validationError,t),!1):r},_addReference:function(e,t){this._byId[e.cid]=e,e.id!=null&&(this._byId[e.id]=e),e.collection||(e.collection=this),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){if((e==="add"||e==="remove")&&n!==this)return;e==="destroy"&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],t.id!=null&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments)}});var b=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];n.each(b,function(e){m.prototype[e]=function(){var t=u.call(arguments);return t.unshift(this.models),n[e].apply(n,t)}});var w=["groupBy","countBy","sortBy","indexBy"];n.each(w,function(e){m.prototype[e]=function(t,r){var i=n.isFunction(t)?t:function(e){return e.get(t)};return n[e](this.models,i,r)}});var E=t.View=function(e){this.cid=n.uniqueId("view"),e||(e={}),n.extend(this,n.pick(e,x)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},S=/^(\S+)\s*(.*)$/,x=["model","collection","el","id","attributes","className","tagName","events"];n.extend(E.prototype,f,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(e,n){return this.$el&&this.undelegateEvents(),this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0],n!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=n.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var r=e[t];n.isFunction(r)||(r=this[e[t]]);if(!r)continue;var i=t.match(S),s=i[1],o=i[2];r=n.bind(r,this),s+=".delegateEvents"+this.cid,o===""?this.$el.on(s,r):this.$el.on(s,o,r)}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(!this.el){var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e["class"]=n.result(this,"className"));var r=t.$("<"+n.result(this,"tagName")+">").attr(e);this.setElement(r,!1)}else this.setElement(n.result(this,"el"),!1)}}),t.sync=function(e,r,i){var s=N[e];n.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var o={type:s,dataType:"json"};i.url||(o.url=n.result(r,"url")||F()),i.data==null&&r&&(e==="create"||e==="update"||e==="patch")&&(o.contentType="application/json",o.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{});if(i.emulateHTTP&&(s==="PUT"||s==="DELETE"||s==="PATCH")){o.type="POST",i.emulateJSON&&(o.data._method=s);var u=i.beforeSend;i.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",s);if(u)return u.apply(this,arguments)}}o.type!=="GET"&&!i.emulateJSON&&(o.processData=!1),o.type==="PATCH"&&T&&(o.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var a=i.xhr=t.ajax(n.extend(o,i));return r.trigger("request",r,a,i),a};var T=typeof window!="undefined"&&!!window.ActiveXObject&&(!window.XMLHttpRequest||!(new XMLHttpRequest).dispatchEvent),N={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var C=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},k=/\((.*?)\)/g,L=/(\(\?)?:\w+/g,A=/\*\w+/g,O=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(C.prototype,f,{initialize:function(){},route:function(e,r,i){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var s=this;return t.history.route(e,function(n){var o=s._extractParameters(e,n);s.execute(i,o),s.trigger.apply(s,["route:"+r].concat(o)),s.trigger("route",r,o),t.history.trigger("route",s,r,o)}),this},execute:function(e,t){e&&e.apply(this,t)},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(!this.routes)return;this.routes=n.result(this,"routes");var e,t=n.keys(this.routes);while((e=t.pop())!=null)this.route(e,this.routes[e])},_routeToRegExp:function(e){return e=e.replace(O,"\\$&").replace(k,"(?:$1)?").replace(L,function(e,t){return t?e:"([^/?]+)"}).replace(A,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var r=e.exec(t).slice(1);return n.map(r,function(e,t){return t===r.length-1?e||null:e?decodeURIComponent(e):null})}});var M=t.History=function(){this.handlers=[],n.bindAll(this,"checkUrl"),typeof window!="undefined"&&(this.location=window.location,this.history=window.history)},_=/^[#\/]|\s+$/g,D=/^\/+|\/+$/g,P=/msie [\w.]+/,H=/\/$/,B=/#.*$/;M.started=!1,n.extend(M.prototype,f,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(e==null)if(this._hasPushState||!this._wantsHashChange||t){e=decodeURI(this.location.pathname+this.location.search);var n=this.root.replace(H,"");e.indexOf(n)||(e=e.slice(n.length))}else e=this.getHash();return e.replace(_,"")},start:function(e){if(M.started)throw new Error("Backbone.history has already been started");M.started=!0,this.options=n.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment(),i=document.documentMode,s=P.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(D,"/");if(s&&this._wantsHashChange){var o=t.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=o.hide().appendTo("body")[0].contentWindow,this.navigate(r)}this._hasPushState?t.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?t.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=r;var u=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&u.hash&&(this.fragment=this.getHash().replace(_,""),this.history.replaceState({},document.title,this.root+this.fragment))}if(!this.options.silent)return this.loadUrl()},stop:function(){t.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),M.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return e=this.fragment=this.getFragment(e),n.any(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0})},navigate:function(e,t){if(!M.started)return!1;if(!t||t===!0)t={trigger:!!t};var n=this.root+(e=this.getFragment(e||""));e=e.replace(B,"");if(this.fragment===e)return;this.fragment=e,e===""&&n!=="/"&&(n=n.slice(0,-1));if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}if(t.trigger)return this.loadUrl(e)},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new M;var j=function(e,t){var r=this,i;e&&n.has(e,"constructor")?i=e.constructor:i=function(){return r.apply(this,arguments)},n.extend(i,r,t);var s=function(){this.constructor=i};return s.prototype=r.prototype,i.prototype=new s,e&&n.extend(i.prototype,e),i.__super__=r.prototype,i};d.extend=m.extend=C.extend=E.extend=M.extend=j;var F=function(){throw new Error('A "url" property or function must be specified')},I=function(e,t){var n=t.error;t.error=function(r){n&&n(e,r,t),e.trigger("error",e,r,t)}};return t}),define("text",["module"],function(e){"use strict";function v(e,t){return e===undefined||e===""?t:e}function m(e,t,n,r){if(t===r)return!0;if(e===n){if(e==="http")return v(t,"80")===v(r,"80");if(e==="https")return v(t,"443")===v(r,"443")}return!1}var t,n,r,i,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],u=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.15",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.lastIndexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||m(s,u,n,i))):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i&&i.isBuild&&!i.inlineText){r();return}d.isBuild=i&&i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i[0]==="﻿"&&(i=i.substring(1)),t(i)}catch(s){r&&r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status||0,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r&&r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return t}),define("aura/ext/debug",[],function(){"use strict";return{name:"debug",initialize:function(e){typeof window.attachDebugger=="function"&&(e.logger.log("Attaching debugger ..."),window.attachDebugger(e))}}}),!function(e){function r(){this._events={},this._conf&&i.call(this,this._conf)}function i(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners&&(this._events.maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this.newListener=e.newListener),this.wildcard&&(this.listenerTree={}))}function s(e){this._events={},this.newListener=!1,i.call(this,e)}function o(e,t,n,r){if(!n)return[];var i=[],s,u,a,f,l,c,h,p=t.length,d=t[r],v=t[r+1];if(r===p&&n._listeners){if(typeof n._listeners=="function")return e&&e.push(n._listeners),[n];for(s=0,u=n._listeners.length;s<u;s++)e&&e.push(n._listeners[s]);return[n]}if(d==="*"||d==="**"||n[d]){if(d==="*"){for(a in n)a!=="_listeners"&&n.hasOwnProperty(a)&&(i=i.concat(o(e,t,n[a],r+1)));return i}if(d==="**"){h=r+1===p||r+2===p&&v==="*",h&&n._listeners&&(i=i.concat(o(e,t,n,p)));for(a in n)a!=="_listeners"&&n.hasOwnProperty(a)&&(a==="*"||a==="**"?(n[a]._listeners&&!h&&(i=i.concat(o(e,t,n[a],p))),i=i.concat(o(e,t,n[a],r))):a===v?i=i.concat(o(e,t,n[a],r+2)):i=i.concat(o(e,t,n[a],r)));return i}i=i.concat(o(e,t,n[d],r+1))}f=n["*"],f&&o(e,t,f,r+1),l=n["**"];if(l)if(r<p){l._listeners&&o(e,t,l,p);for(a in l)a!=="_listeners"&&l.hasOwnProperty(a)&&(a===v?o(e,t,l[a],r+2):a===d?o(e,t,l[a],r+1):(c={},c[a]=l[a],o(e,t,{"**":c},r+1)))}else l._listeners?o(e,t,l,p):l["*"]&&l["*"]._listeners&&o(e,t,l["*"],p);return i}function u(e,r){e=typeof e=="string"?e.split(this.delimiter):e.slice();for(var i=0,s=e.length;i+1<s;i++)if(e[i]==="**"&&e[i+1]==="**")return;var o=this.listenerTree,u=e.shift();while(u){o[u]||(o[u]={}),o=o[u];if(e.length===0){if(!o._listeners)o._listeners=r;else if(typeof o._listeners=="function")o._listeners=[o._listeners,r];else if(t(o._listeners)){o._listeners.push(r);if(!o._listeners.warned){var a=n;typeof this._events.maxListeners!="undefined"&&(a=this._events.maxListeners),a>0&&o._listeners.length>a&&(o._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",o._listeners.length),console.trace())}}return!0}u=e.shift()}return!0}var t=Array.isArray?Array.isArray:function(t){return Object.prototype.toString.call(t)==="[object Array]"},n=10;s.prototype.delimiter=".",s.prototype.setMaxListeners=function(e){this._events||r.call(this),this._events.maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e},s.prototype.event="",s.prototype.once=function(e,t){return this.many(e,1,t),this},s.prototype.many=function(e,t,n){function i(){--t===0&&r.off(e,i),n.apply(this,arguments)}var r=this;if(typeof n!="function")throw new Error("many only accepts instances of Function");return i._origin=n,this.on(e,i),r},s.prototype.emit=function(){this._events||r.call(this);var e=arguments[0];if(e==="newListener"&&!this.newListener&&!this._events.newListener)return!1;if(this._all){var t=arguments.length,n=new Array(t-1);for(var i=1;i<t;i++)n[i-1]=arguments[i];for(i=0,t=this._all.length;i<t;i++)this.event=e,this._all[i].apply(this,n)}if(e==="error"&&!this._all&&!this._events.error&&(!this.wildcard||!this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var s;if(this.wildcard){s=[];var u=typeof e=="string"?e.split(this.delimiter):e.slice();o.call(this,s,u,this.listenerTree,0)}else s=this._events[e];if(typeof s=="function"){this.event=e;if(arguments.length===1)s.call(this);else if(arguments.length>1)switch(arguments.length){case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:var t=arguments.length,n=new Array(t-1);for(var i=1;i<t;i++)n[i-1]=arguments[i];s.apply(this,n)}return!0}if(s){var t=arguments.length,n=new Array(t-1);for(var i=1;i<t;i++)n[i-1]=arguments[i];var a=s.slice();for(var i=0,t=a.length;i<t;i++)this.event=e,a[i].apply(this,n);return a.length>0||!!this._all}return!!this._all},s.prototype.on=function(e,i){if(typeof e=="function")return this.onAny(e),this;if(typeof i!="function")throw new Error("on only accepts instances of Function");this._events||r.call(this),this.emit("newListener",e,i);if(this.wildcard)return u.call(this,e,i),this;if(!this._events[e])this._events[e]=i;else if(typeof this._events[e]=="function")this._events[e]=[this._events[e],i];else if(t(this._events[e])){this._events[e].push(i);if(!this._events[e].warned){var s=n;typeof this._events.maxListeners!="undefined"&&(s=this._events.maxListeners),s>0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}}return this},s.prototype.onAny=function(e){if(typeof e!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(e),this},s.prototype.addListener=s.prototype.on,s.prototype.off=function(e,n){if(typeof n!="function")throw new Error("removeListener only takes instances of Function");var r,i=[];if(this.wildcard){var s=typeof e=="string"?e.split(this.delimiter):e.slice();i=o.call(this,null,s,this.listenerTree,0)}else{if(!this._events[e])return this;r=this._events[e],i.push({_listeners:r})}for(var u=0;u<i.length;u++){var a=i[u];r=a._listeners;if(t(r)){var f=-1;for(var l=0,c=r.length;l<c;l++)if(r[l]===n||r[l].listener&&r[l].listener===n||r[l]._origin&&r[l]._origin===n){f=l;break}if(f<0)continue;return this.wildcard?a._listeners.splice(f,1):this._events[e].splice(f,1),r.length===0&&(this.wildcard?delete a._listeners:delete this._events[e]),this}if(r===n||r.listener&&r.listener===n||r._origin&&r._origin===n)this.wildcard?delete a._listeners:delete this._events[e]}return this},s.prototype.offAny=function(e){var t=0,n=0,r;if(e&&this._all&&this._all.length>0){r=this._all;for(t=0,n=r.length;t<n;t++)if(e===r[t])return r.splice(t,1),this}else this._all=[];return this},s.prototype.removeListener=s.prototype.off,s.prototype.removeAllListeners=function(e){if(arguments.length===0)return!this._events||r.call(this),this;if(this.wildcard){var t=typeof e=="string"?e.split(this.delimiter):e.slice(),n=o.call(this,null,t,this.listenerTree,0);for(var i=0;i<n.length;i++){var s=n[i];s._listeners=null}}else{if(!this._events[e])return this;this._events[e]=null}return this},s.prototype.listeners=function(e){if(this.wildcard){var n=[],i=typeof e=="string"?e.split(this.delimiter):e.slice();return o.call(this,n,i,this.listenerTree,0),n}return this._events||r.call(this),this._events[e]||(this._events[e]=[]),t(this._events[e])||(this._events[e]=[this._events[e]]),this._events[e]},s.prototype.listenersAny=function(){return this._all?this._all:[]},typeof define=="function"&&define.amd?define("eventemitter",[],function(){return s}):typeof exports=="object"?exports.EventEmitter2=s:window.EventEmitter2=s}(),define("aura/ext/mediator",["eventemitter","underscore"],function(){"use strict";return{name:"mediator",require:{paths:{eventemitter:"bower_components/eventemitter2/lib/eventemitter2",underscore:"bower_components/underscore/underscore"},shim:{underscore:{exports:"_"}}},initialize:function(e){var t=require("eventemitter"),n=require("underscore");e.config.mediator=n.defaults(e.config.mediator||{},{wildcard:!0,delimiter:".",newListener:!0,maxListeners:20});var r=new t(e.config.mediator);e.core.mediator=r;var i=function(t){return function(i,s,o){if(this.stopped)return;if(!n.isFunction(s)||!n.isString(i))throw new Error("Invalid arguments passed to sandbox."+t);o=o||this;var u=function(){var t=Array.prototype.slice.call(arguments);try{s.apply(o,t)}catch(n){e.logger.error("Error caught in listener '"+i+"', called with arguments: ",t,"\nError:",n.message,n,t)}};this._events=this._events||[],this._events.push({name:i,listener:s,callback:u}),r[t](i,u)}};e.sandbox.on=i("on"),e.sandbox.once=i("once"),e.sandbox.off=function(e,t){if(!this._events)return;this._events=n.reject(this._events,function(t){var n=t.name===e;return n&&r.off(e,t.callback),n})},e.sandbox.emit=function(){if(this.stopped)return;var t=e.config.debug;if(t.enable&&(t.components.length===0||t.components.indexOf("aura:mediator")!==-1)){var n=Array.prototype.slice.call(arguments);n.unshift("Event emitted"),e.logger.log.apply(e.logger,n)}r.emit.apply(r,arguments)},e.sandbox.stopListening=function(){if(!this._events)return;n.each(this._events,function(e){r.off(e.name,e.callback)})};var s=["aura","sandbox","stop"].join(e.config.mediator.delimiter);e.core.mediator.on(s,function(e){e.stopListening()})}}}),define("aura/ext/components",[],function(){"use strict";return function(e){function o(t,n,r,i){var o=s[t+":"+n]||[],u=[];e.core.util.each(o,function(e,t){typeof t=="function"&&u.push(t.apply(r,i))});var a=e.core.data.when.apply(undefined,u).promise();return a}function u(t,r){var i;if(typeof t=="string")i=t,t=r[i]||function(){};else{if(typeof t.name!="string")throw new Error("Error invoking Component with callbacks: ",r.options.name,". first argument should be either the name of a function or of the form : { name: 'fnName', fn: function() { ... } } ");i=t.name,t=t.fn||function(){}}var s=e.core.data.deferred(),u,a,f=[].slice.call(arguments,2);return u=o("before",i,r,f),u.then(function(){return t.apply(r,f)}).then(function(e){return o("after",i,r,f.concat(e)).then(function(){n.data.when(e).then(function(){s.resolve(e)})},s.reject)}).fail(function(t){e.logger.error("Error in Component "+r.options.name+" "+i+" callback",t),s.reject(t)}),s.promise()}function a(e){var t=r.clone(e),i=n.data.deferred(),s=this;return this.options=r.defaults(t||{},this.options||{}),this._ref=t._ref,this.$el=n.dom.find(t.el),this.initialized=i.promise(),this.invokeWithCallbacks("initialize",this.options).then(function(){i.resolve(s)}),this}function l(e,t,i){var s=r.clone(i||{});s.el=e,s.require={};var o,u=n.dom.data(e);return n.util.each(u,function(e,n){e=e.replace(new RegExp("^"+t),""),e=e.charAt(0).toLowerCase()+e.slice(1),e!=="component"&&e!=="widget"?s[e]=n:o=n}),c(o,s)}function c(t,r){var i=t.split("@"),s=n.util.decamelize(i[0]),o=i[1]||"default",u=require.s.contexts._,a=e.config.sources[o]||"./aura_components";return r.name=s,r.ref="__component__$"+s+"@"+o,r.baseUrl=a+"/"+s,r.require=r.require||{},r.require.packages=r.require.packages||[],r.require.packages.push({name:r.ref,location:a+"/"+s}),r}var t=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n=e.core,r=e.core.util._;n.Components=n.Components||{};var i={},s={};a.prototype.initialize=function(){},a.prototype.html=function(e){var t=this.$el;t.html(e);var n=this;return r.defer(function(){n.sandbox.start(t,{reset:!0})}),this},a.prototype.$find=function(e){return this.$el.find(e)},a.prototype.invokeWithCallbacks=function(e){return u.apply(undefined,[e,this].concat([].slice.call(arguments,1)))};var f=function(e,r){var i=this,s;e&&t(e,"constructor")?s=e.constructor:s=function(){i.apply(this,arguments)},n.util.extend(s,i,r);var o=function(){this.constructor=s};return o.prototype=i.prototype,s.prototype=new o,e&&n.util.extend(s.prototype,e),s.__super__=i.prototype,s};return a.extend=f,a.load=function(t,s){var o=n.data.deferred(),u=s.ref,f,l,c=s.el;s._ref=n.util._.uniqueId(u+"+");var h=r.clone(s);return e.logger.log("Start loading component:",t),o.fail(function(n){e.logger.error("Error loading component:",t,n)}),require.config(h.require),require([u],function(r){if(!r)return o.reject("component "+u+" Definition is empty !");try{if(i[u])l=i[u];else{r.type?l=n.Components[r.type]:l=a;if(!l)throw new Error("Can't find component of type '"+r.type+"', did you forget to include the extension that provides it ?");n.util._.isObject(r)&&(l=i[u]=l.extend(r))}var f=e.sandboxes.create(s._ref,{el:c});f.logger.setName("Component '"+t+"'("+f.logger.name+")");var p={sandbox:f};typeof r=="function"&&(p.initialize=r),l=l.extend(p);var d=new l(h);d.$el.data("__sandbox_ref__",f.ref);var v=d.initialized;return v.then(function(e){o.resolve(e)}),v.fail(function(e){o.reject(e)}),v}catch(m){e.logger.error(m.message),o.reject(m)}},function(e){o.reject(e)}),o.promise()},a.parseList=function(t){var i=[];if(Array.isArray(t))r.map(t,function(e){var t=c(e.name,e.options);i.push({name:e.name,options:t})});else if(t&&n.dom.find(t)){var s=e.config.namespace,o=["[data-aura-component]","[data-aura-widget]"];s&&(o.push("[data-"+s+"-component]"),o.push("[data-"+s+"-widget]")),o=o.join(","),n.dom.find(o,t||"body").each(function(){var e="aura";s&&(this.getAttribute("data-"+s+"-component")||this.getAttribute("data-"+s+"-widget"))&&(e=s);var t=l(this,e);i.push({name:t.name,options:t})})}return i},a.startAll=function(e){var t=a.parseList(e),r=[];n.util.each(t,function(e,t){var n=a.load(t.name,t.options);r.push(n)});var i=n.data.when.apply(undefined,r);return i.promise()},{name:"components",require:{paths:{text:"bower_components/requirejs-text/text"}},initialize:function(e){function t(e,t){s[e]=s[e]||[],s[e].push(t)}e.core.Components.Base=a,e.components.before=function(e,n){var r="before:"+e;t(r,n)},e.components.after=function(e,n){var r="after:"+e;t(r,n)},e.components.addType=function(t,n){if(e.core.Components[t])throw new Error("Component type "+t+" already defined");e.core.Components[t]=a.extend(n)},e.sandbox.start=function(t,n){if(this.stopped)return;var i=["aura","sandbox","start"].join(e.config.mediator.delimiter);e.core.mediator.emit(i,this);var s=this._children||[];n&&n.reset&&(r.invoke(this._children||[],"stop"),s=[]);var o=this;return a.startAll(t).done(function(){var e=Array.prototype.slice.call(arguments);r.each(e,function(e){e.sandbox._component=e,e.sandbox._parent=o,s.push(e.sandbox)}),o._children=s})}},afterAppStart:function(e){if(e.config.components!==!1&&e.startOptions.components!==!1){var t;Array.isArray(e.startOptions.components)?t=n.dom.find("body"):t=n.dom.find(e.startOptions.components),e.core.appSandbox=e.sandboxes.create(e.ref,{el:t}),e.core.appSandbox.start(e.startOptions.components)}}}}}),define("form/util",[],function(){"use strict";var e=["form","validation"];return{debugEnabled:!1,getFields:function(e){return $(e).find('input:not([data-form="false"], [type="submit"], [type="button"], [type="checkbox"], [type="radio"]), textarea:not([data-form="false"]), select:not([data-form="false"]), *[data-form="true"], *[data-type="collection"], *[contenteditable="true"]')},findGroupedFieldsBySelector:function(e,t){var n={},r;return $(e).find(t).each(function(e,t){r=$(t).data("mapper-property"),n[r]||(n[r]=[]),n[r].push(t)}),n},getCheckboxes:function(e){return this.findGroupedFieldsBySelector(e,'input[type="checkbox"]')},getRadios:function(e){return this.findGroupedFieldsBySelector(e,'input[type="radio"]')},parseData:function(e,t,n){var r=$(e);return this.buildOptions(r.data(),t,"",n)},buildOptions:function(t,n,r,i){r||(r=""),i||(i={});var s=$.extend({},i,{}),o=n+this.ucFirst(r);return $.each(t,function(t,r){var i=new RegExp("^"+o);i.test(t)&&$.inArray(t,e)===-1&&(t!==o?t=t.replace(i,""):t=t.replace(new RegExp("^"+n),""),t!==""&&(t=this.lcFirst(t),s[t]=r))}.bind(this)),s},isValueField:function(e){var t=$(e);return t.is("input, select, textarea, option, button")},isCheckbox:function(e){var t=$(e);return t.is(":checkbox")},getValue:function(e){var t=$(e);return this.isCheckbox(t)?t.prop("checked"):this.isValueField(t)?t.val():t.html()},setValue:function(e,t){var n=$(e);this.isCheckbox(n)?n.prop("checked",t):this.isValueField(n)?n.val(t):n.html(t)},debug:function(e,t,n){!this.debugEnabled||(e?t?n?console.log("Husky Validation:",e,t,n):console.log("Husky Validation:",e,t):console.log("Husky Validation:",e):console.log("Husky Validation"))},ucFirst:function(e){e+="";var t=e.charAt(0).toUpperCase();return t+e.substr(1)},lcFirst:function(e){return e.charAt(0).toLowerCase()+e.slice(1)},startsWith:function(e,t){return e.indexOf(t)===0},print:function(e,t){t||(t=1);var n="",r="&nbsp;&nbsp;&nbsp;&nbsp;",i,s,o="",u=0;while(u<t)o+=r,u++;for(i in e)e.hasOwnProperty(i)&&(s=e[i],typeof s=="string"?this.isNumeric(s)?n+=o+i+": "+s+"; </br>":(s.length>7&&(s=s.substring(0,6)+" ..."),n+=o+i+": '"+s+"'; </br>"):n+=o+i+": { </br>"+o+r+print(s,t++)+"}");return n},isNumeric:function(e){return e.match(/-?\d+(.\d+)?/)}}}),define("form/element",["form/util"],function(e){"use strict";return function(t,n,r){var i={type:null,validationTrigger:"focusout",validationAddClasses:!0,validationAddClassesParent:!0,validationErrorClass:"husky-validate-error",validationClass:"husky-validate",validation:!0},s=["validation","validationTrigger","validationAddClasses","validationAddClassesParent","validationClass","validationErrorClass","validationSubmitEvent"],o,u={},a,f=null,l=null,c={initialize:function(){l=$.Deferred(),this.requireCounter=0,this.initialized=l.promise(),this.$el=$(t),this.$el.data("element",this),this.options=$.extend({},i,r),!this.options.validationAddClasses||this.$el.addClass(this.options.validationClass),!this.options.validation||c.initValidation.call(this)},resolveInitialization:function(){this.requireCounter--,this.requireCounter===0&&l.resolve()},initValidation:function(){c.bindValidationDomEvents.call(this),c.initValidators.call(this),c.initType.call(this)},bindValidationDomEvents:function(){var e=this.options.validationTrigger?this.options.validationTrigger:"";if(e===""||e==="none")return;this.$el.is("select")&&(e+=(new RegExp("change","i")).test(e)?"":" change"),e=e.replace(/^\s+/g,"").replace(/\s+$/g,""),this.$el.bind(e,this.validate.bind(this))},initValidators:function(){var t=function(t,r){this.requireCounter++,require(["validator/"+t],function(i){u[t]=new i(this.$el,n,this,r),e.debug("Element Validator",t,r),c.resolveInitialization.call(this)}.bind(this))}.bind(this);$.each(this.options,function(n,r){if(!!r&&$.inArray(n,s)===-1&&e.startsWith(n,"validation")){var i=e.lcFirst(n.replace("validation","")),o=e.buildOptions(this.options,"validation",i);t(i,o)}}.bind(this)),this.$el.attr("required")==="required"&&!u.required&&t("required",{required:!0}),!!this.$el.attr("min")&&!u.min&&t("min",{min:parseInt(this.$el.attr("min"),10)}),!!this.$el.attr("max")&&!u.max&&t("max",{max:parseInt(this.$el.attr("max"),10)}),!!this.$el.attr("pattern")&&!u.pattern&&t("regex",{regex:this.$el.attr("pattern")})},initType:function(){var t=function(t,r){this.requireCounter++,require(["type/"+t],function(i){a=new i(this.$el,r,n),a.initialized.then(function(){e.debug("Element Type",t,r),c.resolveInitialization.call(this)}.bind(this))}.bind(this))}.bind(this),r=e.buildOptions(this.options,"type"),i,s;this.options.type?i=this.options.type:this.$el.attr("type")?(s=this.$el.attr("type"),s==="email"?i="email":s==="url"?i="url":s==="number"?i="decimal":s==="date"?(i="date",!r.format||(r.format="d")):s==="time"?(i="date",!r.format||(r.format="t")):s==="datetime"?i="date":i="string"):i="string",t(i,r)},hasConstraints:function(){var e=!!a&&a.needsValidation(),t=Object.keys(u).length>0;return t||e},needsValidation:function(){return f!==e.getValue(this.$el)},reset:function(){var e=this.$el;!this.options.validationAddClassesParent||(e=e.parent()),e.removeClass(this.options.validationErrorClass)},setValid:function(e){o=e;if(!!this.options.validationAddClasses){c.reset.call(this);var t=this.$el;!this.options.validationAddClassesParent||(t=t.parent()),e||t.addClass(this.options.validationErrorClass)}}},h={validate:function(t){var n=!0,r=!1;return(t||c.needsValidation.call(this))&&c.hasConstraints.call(this)&&($.each(u,function(e,t){t.validate()||(n=!1)}),r=!0),!!a&&a.needsValidation()&&(a.validate()||(n=!1),r=!0),r===!0&&(n||e.debug("Field validate",n?"true":"false",this.$el),c.setValid.call(this,n)),n},update:function(){if(!c.hasConstraints.call(this))return!0;var t=!0;return $.each(u,function(e,n){n.update()||(t=!1)}),a!==null&&!a.validate()&&(t=!1),t||e.debug("Field validate",t?"true":"false",this.$el),c.setValid.call(this,t),t},isValid:function(){return o},updateConstraint:function(e,t){if(!($.inArray(e,Object.keys(u))>-1))throw"No constraint with name: "+e;u[e].updateConstraint(t),this.validate()},deleteConstraint:function(e){if(!($.inArray(e,Object.keys(u))>-1))throw"No constraint with name: "+e;delete u[e],this.validate(!0)},addConstraint:function(e,t){if($.inArray(e,Object.keys(u))!==-1)throw"Constraint with name: "+e+" already exists";require(["validator/"+e],function(r){u[e]=new r(this.$el,n,this,t)}.bind(this))},hasConstraint:function(e){return!!u[e]},getConstraint:function(e){return this.hasConstraint(e)?u[e]:!1},fieldAdded:function(e){$.each(u,function(t,n){n.fieldAdded(e)})},fieldRemoved:function(e){$.each(u,function(t,n){n.fieldRemoved(e)})},setValue:function(e){var t=$.Deferred(),n;return this.initialized.then(function(){n=a.setValue(e),n?n.then(function(){t.resolve()}):t.resolve()}.bind(this)),t.promise()},getValue:function(e){return a.getValue(e)},getType:function(){return a}};return c.initialize.call(h),h}}),define("form/elementGroup",[],function(){"use strict";var e=function(e,t){e.forEach(function(e){t.forEach(function(t){e.$el.val()===t&&e.$el.prop("checked",!0)})})},t=function(e,t){for(var n=-1;++n<e.length;)if(e[n].$el.val()===t){e[n].$el.prop("checked",!0);return}};return function(n,r){var i={getValue:function(){var e=[];n.forEach(function(t){t.$el.is(":checked")&&e.push(t.$el.val())});if(!!r){if(e.length>1)throw new Error("Single value element group cannot return more than one value");return e[0]}return e},setValue:function(i){if(!!r&&!!$.isArray(i))throw new Error("Single value element cannot be set to an array value");if(!r&&!$.isArray(i))throw new Error("Field with multiple values cannot be set to a single value");$.isArray(i)?e.call(this,n,i):t.call(this,n,i)}};return n.forEach(function(e){e.$el.data("elementGroup",i)}),i}}),define("form/validation",["form/util"],function(e){"use strict";return function(t){var n,r={initialize:function(){r.bindValidationDomEvents.call(this),e.debug("INIT Validation")},bindValidationDomEvents:function(){!t.options.validationSubmitEvent||t.$el.on("submit",function(){return t.validation.validate()}.bind(this))},setValid:function(e){n=e}},i={validate:function(n){var i=!0;return $.each(t.elements,function(e,t){t.validate(n)||(i=!1)}),$.each(t.mapper.collections,function(e,t){$.each(t.items,function(e,t){$.each(t.data("collection").childElements,function(e,t){t.validate(n)||(i=!1)})})}),r.setValid.call(this,i),e.debug("Validation",i?"success":"error"),i},isValid:function(){return n},updateConstraint:function(e,t,n){var r=$(e);if(!r.data("element"))throw"No validation element";$(e).data("element").updateConstraint(t,n)},deleteConstraint:function(e,t){var n=$(e);if(!n.data("element"))throw"No validation element";n.data("element").deleteConstraint(t)},addConstraint:function(e,n,r){var i=$(e),s;i.data("element")?i.data("element").addConstraint(n,r):(s=t.addField(e),s.addConstraint(n,r),t.elements.push(s))}};return r.initialize.call(i),i}}),define("form/mapper",["form/util"],function(e){"use strict";return function(t){var n={},r={initialize:function(){e.debug("INIT Mapper"),this.collections=[],this.collectionsSet={},this.emptyTemplates={},this.templates={},t.initialized.then(function(){var e='*[data-type="collection"]',n=t.$el.find(e);n.each(r.initCollection.bind(this))}.bind(this))},initCollection:function(n,i){var s=$(i),o=s.data("element"),u=s.data("mapper-property"),a,f,l,c=$.Deferred(),h=0,p=function(){h--,h===0&&c.resolve()};if(!$.isArray(u)){if(typeof u!="object")throw"no valid mapper-property value";u=[u],s.data("mapper-property",u)}return o.$children=s.children().clone(!0),s.html(""),f={id:_.uniqueId("collection_"),property:u,$element:s,element:o,items:[]},this.collections.push(f),h+=o.$children.length,o.$children.each(function(e,t){var n=$(t),i,s,c,h=0,d=function(){h--,h===0&&p()};if(!n.is("script"))throw"template has to be defined as <script>";a={tpl:n.html(),id:n.attr("id"),collection:f},o.$children[e]=a;for(s=-1,c=u.length;++s<c;)u[s].tpl===a.id&&(i=u[s].data,l=u[s]["empty-tpl"]),u[s]["empty-tpl"]&&u[s]["empty-tpl"]===a.id&&(this.emptyTemplates[u[s].data]={id:u[s]["empty-tpl"],tpl:n.html()});if(!i)d();else{a.propertyName=i,h=f.element.getType().getMinOccurs(),this.templates[i]={tpl:a,collection:f,emptyTemplate:l};for(s=f.element.getType().getMinOccurs()+1;--s>0;)r.appendChildren.call(this,f,a).then(function(){$("#current-counter-"+i).text(f.element.getType().getChildren(a.id).length),d()}.bind(this))}}.bind(this)),$.each(u,function(e,n){t.$el.on("click",'*[data-mapper-add="'+n.data+'"]',r.addClick.bind(this)),t.$el.on("click",'*[data-mapper-remove="'+n.data+'"]',r.removeClick.bind(this)),c.then(function(){r.emitInitCollectionEvent(n.data)})}.bind(this)),r.checkFullAndEmpty.call(this,u[0].data),c.then(function(){e.debug("collection resolved")}),c.promise()},addClick:function(e){var t=$(e.currentTarget),n=t.data("mapper-add"),i=this.templates[n].tpl,s=this.templates[n].collection;s.element.getType().canAdd(i.id)&&r.appendChildren.call(this,s,i).then(function(){$("#current-counter-"+n).text(s.element.getType().getChildren(i.id).length),r.emitAddEvent(n,null)}.bind(this)),r.checkFullAndEmpty.call(this,n)},addEmptyTemplate:function(e,t){if(this.emptyTemplates.hasOwnProperty(t)){var n=$(this.emptyTemplates[t].tpl);n.attr("id",this.emptyTemplates[t].id),e.append(n)}},removeClick:function(e){var t=$(e.currentTarget),n=t.data("mapper-remove"),i=this.templates[n].tpl,s=this.templates[n].collection,o=t.closest("."+n+"-element");s.element.getType().canRemove(i.id)&&(r.remove.call(this,o),$("#current-counter-"+n).text(s.element.getType().getChildren(i.id).length),r.emitRemoveEvent(n,null)),r.checkFullAndEmpty.call(this,n)},checkFullAndEmpty:function(e){var t=$("[data-mapper-add='"+e+"']"),n=$("[data-mapper-remove='"+e+"']"),r=this.templates[e].tpl,i=this.templates[e].collection,s=i.element.$el.data("mapper-full-class")||"full",o=i.element.$el.data("mapper-empty-class")||"empty";t.removeClass(s),t.removeClass(o),$(i.element.$el).removeClass(s),$(i.element.$el).removeClass(o);if(!!t.length||!!n.length)i.element.getType().canAdd(r.id)?i.element.getType().canRemove(r.id)||(t.addClass(o),$(i.element.$el).addClass(o)):(t.addClass(s),$(i.element.$el).addClass(s))},emitInitCollectionEvent:function(e){$(t.$el).trigger("form-collection-init",[e])},emitAddEvent:function(e,n){$(t.$el).trigger("form-add",[e,n])},emitRemoveEvent:function(e,n){$(t.$el).trigger("form-remove",[e,n])},processData:function(e,t,i){var s=$(e),o=s.data("type"),u=s.data("mapper-property"),a=s.data("element"),f,l;return t&&!!n[t.data]?l=n[t.data]:!n[u]||(l=n[u]),o!=="collection"?a?a.getValue():null:(f=[],$.each(s.children(),function(e,n){if(!t||t.tpl===n.dataset.mapperPropertyTpl){var s=$(n).data("collection").childElements,o=$(n).data("collection").childElementGroups,u={};s.forEach(function(e){r.addDataFromElement.call(this,e,u,i)});for(e in o)o.hasOwnProperty(e)&&(u[e]=o[e].getValue());!i||(u.mapperId=n.dataset.mapperId);var a=Object.keys(u);a.length===1?u[a[0]]!==""&&f.push(u[a[0]]):(!l||l(u))&&f.push(u)}}.bind(this)),f)},setCollectionData:function(e,t){var n=t.$element,i=this.templates[t.key].tpl,s=e.length,o=$.Deferred(),u=function(){s--,s===0&&o.resolve()},a,f;if(s===0)r.addEmptyTemplate.call(this,n,i.propertyName),o.resolve();else{if(e.length<t.element.getType().getMinOccurs())for(a=t.element.getType().getMinOccurs()+1,f=e.length;--a>f;)e.push({});t.items=[],$.each(e,function(e,n){r.appendChildren.call(this,t,i,n).then(function(e){r.setData.call(this,n,e).then(function(){u()}.bind(this))}.bind(this))}.bind(this))}return $("#current-counter-"+n.attr("id")).text(e.length),r.checkFullAndEmpty.call(this,t.property[0].data),o.promise()},appendChildren:function(n,i,s,o,u){var a=$.extend(!0,{},i),f=a.collection.element.getType().getChildren(a.id).length,l=$.extend({},{index:f},s||{}),c=_.template(a.tpl,l,t.options.delimiter),h=$(c),p=e.getFields(h),d=e.getRadios(h),v=e.getCheckboxes(h),m=$.Deferred(),g=p.length,y=n.$element,b,w;return h.attr("data-mapper-property-tpl",a.id),h.attr("data-mapper-id",_.uniqueId()),u&&(b=y.find('*[data-mapper-property-tpl="'+a.id+'"]').last()).length>0?b.after(h):y.append(h),a.collection.childElements=[],a.collection.childElementGroups={},p.length>0?p.each(function(e,n){w=t.createField($(n)),a.collection.childElements.push(w),w.initialized.then(function(){g--,g===0&&m.resolve(h)})}.bind(this)):m.resolve(h),_.size(d)>0&&$.each(d,function(e,n){a.collection.childElementGroups[e]=t.createFieldGroup(n,!0)}),_.size(v)>0&&$.each(v,function(e,n){a.collection.childElementGroups[e]=t.createFieldGroup(n,!1)}),h.data("collection",a.collection),!o||m.then(function(){r.setData.call(this,o,p)}.bind(this)),n.items.push(h),m.promise()},getElementByMapperId:function(e){for(var t=-1,n=this.collections.length;++t<n;)for(var r=-1,i=this.collections[t].items.length;++r<i;)if(this.collections[t].items[r].data("mapper-id")===e)return this.collections[t].items[r];return null},deleteElementByMapperId:function(e){var t;return $.each(this.collections,function(n,r){$.each(r.items,function(n,i){return i.data("mapper-id").toString()!==e.toString()?!0:(t=i.attr("data-mapper-property-tpl"),i.remove(),r.items.splice(n,1),!1)})}.bind(this)),t},remove:function(n){$.each(e.getFields(n),function(e,n){t.removeField(n)}.bind(this)),n.remove()},setData:function(e,n){n||(n=t.$el);var i=$.Deferred(),s,o,u,a=1,f=function(){a--,a===0&&i.resolve()};return typeof e!="object"?(s="*[data-mapper-property]",o=n.find(s),u=o.data("element"),u?u.setValue(e).then(function(){f()}):(u=t.addField(o),u.initialized.then(function(){u.setValue(e).then(function(){f()})}.bind(this)))):e!==null&&!$.isEmptyObject(e)?(a=Object.keys(e).length,$.each(e,function(e,i){var o,u,a;$.isArray(i)&&this.templates.hasOwnProperty(e)?(a=this.templates[e].collection,a.key=e,this.collectionsSet.hasOwnProperty(a.id)||a.$element.children().each(function(e,t){$(t).remove()}.bind(this)),this.collectionsSet[a.id]=!0,r.setCollectionData.call(this,i,a).then(function(){f()})):t.elementGroups.hasOwnProperty(e)?(t.elementGroups[e].setValue(i),f()):(s='*[data-mapper-property="'+e+'"]',o=n.andSelf().find(s),u=o.data("element"),o.length>0?u?u.setValue(i).then(function(){f()}):(u=t.addField(o),u.initialized.then(function(){u.setValue(i).then(function(){f()})}.bind(this))):f())}.bind(this))):i.resolve(),i.promise()},addDataFromElement:function(e,t,n){var i=e.$el,s=i.data("mapper-property"),o;if(!s)return;$.isArray(s)?$.each(s,function(e,s){t[s.data]=r.processData.call(this,i,s,n)}.bind(this)):s.match(/.*\..*/)?(o=s.split("."),t[o[0]]={},t[o[0]][o[1]]=r.processData.call(this,i)):t[s]=r.processData.call(this,i)},getDataFromElements:function(e,t,n){var i={};e.forEach(function(e){r.addDataFromElement.call(this,e,i,n)}.bind(this));for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s].getValue());return i}},i={setData:function(e,t){return this.collectionsSet={},r.setData.call(this,e,t)},getData:function(e,n){if(!e||!e.data("mapper-id"))return r.getDataFromElements(t.elements,t.elementGroups,n);var i=r.getElementByMapperId.call(this,e.data("mapper-id")).data("collection");return r.getDataFromElements(i.childElements,i.childElementGroups,n)},addCollectionFilter:function(e,t){n[e]=t},removeCollectionFilter:function(e){delete n[e]},addToCollection:function(e,t,n){var i=this.templates[e],s=i.collection.$element,o=!1,u,a,f=$.Deferred();return n||(o=!0),i.emptyTemplate&&(a=$(s).find("#"+i.emptyTemplate),a&&a.remove()),r.appendChildren.call(this,i.collection,i.tpl,t,t,o).then(function(e){f.resolve(e)}.bind(this)),f},editInCollection:function(e,t){var n=r.getElementByMapperId.call(this,e);r.setData.call(this,t,n)},removeFromCollection:function(e){var n,i=r.deleteElementByMapperId.call(this,e);if(t.$el.find("*[data-mapper-property-tpl="+i+"]").length<1)for(n in this.templates)if(this.templates[n].tpl.id===i){r.addEmptyTemplate.call(this,this.templates[n].collection.$element,n);return}}};return r.initialize.call(i),i}}),require.config({paths:{form:"js/form","form/mapper":"js/mapper","form/validation":"js/validation","form/element":"js/element","form/elementGroup":"js/elementGroup","form/util":"js/util","type/default":"js/types/default","type/readonly-select":"js/types/readonlySelect","type/string":"js/types/string","type/date":"js/types/date","type/decimal":"js/types/decimal","type/hiddenData":"js/types/hiddenData","type/mappingData":"js/types/mappingData","type/email":"js/types/email","type/url":"js/types/url","type/label":"js/types/label","type/select":"js/types/select","type/collection":"js/types/collection","type/attributes":"js/types/attributes","validator/default":"js/validators/default","validator/min":"js/validators/min","validator/max":"js/validators/max","validator/minLength":"js/validators/min-length","validator/maxLength":"js/validators/max-length","validator/required":"js/validators/required","validator/unique":"js/validators/unique","validator/equal":"js/validators/equal","validator/regex":"js/validators/regex"}}),define("form",["form/element","form/elementGroup","form/validation","form/mapper","form/util"],function(e,t,n,r,i){"use strict";return function(s,o){var u={debug:!1,delimiter:{interpolate:/<~=(.+?)~>/g,escape:/<~-(.+?)~>/g,evaluate:/<~(.+?)~>/g},validation:!0,validationTrigger:"focusout",validationAddClassesParent:!0,validationAddClasses:!0,validationSubmitEvent:!0,mapper:!0},a={initialize:function(){this.$el=$(s),this.options=$.extend(u,this.$el.data(),o),i.debugEnabled=this.options.debug,this.initialized=a.initFields.call(this),!this.options.validation||(this.validation=new n(this)),!this.options.mapper||(this.mapper=new r(this)),this.$el.data("form-object",this)},initFields:function(e){var t=$.Deferred(),n=0,r=function(){n--,n===0&&t.resolve()};return $.each(i.getFields(e||this.$el),function(e,t){n++,a.addField.call(this,t).initialized.then(r.bind(this))}.bind(this)),a.addGroupedFields.call(this,e),t.promise()},bindValidationDomEvents:function(){!this.options.validationSubmitEvent||this.$el.on("submit",function(){return this.validation.validate()}.bind(this))},createField:function(t){var n=$(t),r=i.parseData(n,"",this.options);return new e(n,f,r)},createFieldGroup:function(n,r){return new t(n.map(function(t){var n=$(t),r=i.parseData(n,"",this.options);return new e(n,f,r)}.bind(this)),r)},addField:function(e){var t=this.createField(e);return this.elements.push(t),i.debug("Element created",o),t},addSingleGroupedField:function(e,t,n){this.elementGroups[e]=this.createFieldGroup(t,n)},addGroupedFields:function(e){$.each(i.getCheckboxes(e||this.$el),function(e,t){t.length>1?a.addSingleGroupedField.call(this,e,t,!1):a.addField.call(this,t)}.bind(this)),$.each(i.getRadios(e||this.$el),function(e,t){a.addSingleGroupedField.call(this,e,t,!0)}.bind(this))}},f={elements:[],elementGroups:{},options:{},validation:!1,mapper:!1,createField:function(e){var t=a.createField(e);return t.initialized.then(function(){t.fieldAdded(t)}.bind(this)),t},createFieldGroup:function(e,t){return a.createFieldGroup(e,t)},addField:function(e){var t=a.addField.call(this,e);return t.initialized.then(function(){$.each(this.elements,function(e,t){t.fieldAdded(t)})}.bind(this)),t},addGroupedFields:function(e){return a.addGroupedFields.call(this,e)},initFields:function(e){return a.initFields.call(this,e)},removeFields:function(e){i.getFields(e).each(function(e,t){this.removeField(t)}.bind(this))},removeField:function(e){var t=$(e),n=t.data("element");$.each(this.elements,function(e,t){t.fieldRemoved(n)}),this.elements.splice(this.elements.indexOf(n),1)}};return a.initialize.call(f),f}}),define("type/default",["form/util"],function(e){"use strict";return function(t,n,r,i,s,o){var u={initialize:function(){this.$el=t,this.options=$.extend({},n,r);var e=$.Deferred();this.requireCounter=0,this.initialized=e.promise(),!this.initializeSub||this.initializeSub(),e.resolve()}},a={name:i,form:o,needsValidation:function(){return!0},updateConstraint:function(e){$.extend(this.options,e)},setValue:function(t){e.setValue(this.$el,this.getViewData.call(this,t))},getValue:function(){return this.getModelData.call(this,e.getValue(this.$el))},getViewData:function(e){return e},getModelData:function(e){return e}},f=$.extend({},a,s);return u.initialize.call(f),f}}),define("type/string",["type/default"],function(e){"use strict";return function(t,n){var r={},i={needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"string",i)}}),define("type/date",["type/default","form/util"],function(e,t){"use strict";return function(n,r){var i={format:"d"},s=function(e){return t.debug(e,new Date(e)),new Date(e)},o={validate:function(){var e=t.getValue(this.$el),n;return e===""?!0:(n=Globalize.parseDate(e,this.options.format),n!==null)},needsValidation:function(){var e=t.getValue(this.$el);return e!==""},getViewData:function(e){return Globalize.format(s(e),this.options.format)},getModelData:function(e){if(e!==""){var t=Globalize.parseDate(e,this.options.format);return t.toISOString()}return e}};return new e(n,i,r,"date",o)}}),define("type/decimal",["type/default"],function(e){"use strict";return function(t,n){var r={format:"n",regExp:/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/,nullable:!1},i={initializeSub:function(){},validate:function(){var e=this.getValue();return e===""||this.options.nullable===!0&&e===null?!0:this.options.regExp.test(e)},getModelData:function(e){return e===""?this.options.nullable===!0?null:"":Globalize.parseFloat(e)},getViewData:function(e){if(typeof e=="string"){if(e==="")return"";e=parseFloat(e)}return Globalize.format(e,this.options.format)}};return new e(t,r,n,"decimal",i)}}),define("type/hiddenData",["type/default"],function(e){"use strict";return function(t,n){var r={id:"id",defaultValue:null},i={hiddenData:null,setValue:function(e){this.hiddenData=e,!!e&&typeof e=="object"&&!!e[this.options.id]&&this.$el.data("id",e[this.options.id])},getValue:function(){return this.hiddenData!==null?this.hiddenData:this.options.defaultValue},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"hiddenData",i)}}),define("type/mappingData",["type/default"],function(e){"use strict";return function(t,n){var r={defaultValue:null,mapping:null,searchProperty:"id",showProperty:"name"},i={setValue:function(e){e!==null&&typeof e!="object"&&(this.$el.data("value",e),this.$el.text(this.getMappingValue(e)||this.options.defaultValue))},getValue:function(){var e=this.$el.data("value");return e!==null?e:this.options.defaultValue},needsValidation:function(){return!1},validate:function(){return!0},getMappingValue:function(e){var t,n=this.options.mapping;if(!!n)for(t in this.options.mapping)if(!!n.hasOwnProperty(t)&&n[t].hasOwnProperty(this.options.searchProperty)&&n[t].hasOwnProperty(this.options.showProperty)&&String(n[t][this.options.searchProperty])===String(e))return n[t][this.options.showProperty]}};return new e(t,r,n,"hiddenData",i)}}),define("type/email",["type/default","form/util"],function(e,t){"use strict";return function(t,n){var r={regExp:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))){2,6}$/i},i={validate:function(){var e=this.getValue();return e===""?!0:this.options.regExp.test(e)},needsValidation:function(){var e=this.getValue();return e!==""}};return new e(t,r,n,"email",i)}}),define("type/url",["type/default","form/util"],function(e,t){"use strict";return function(t,n){var r={regExp:/^(https?|s?ftp|git):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i},i={validate:function(){var e=this.getValue();return e===""?!0:(this.options["url-strict"]!=="true"&&(e=(new RegExp("(https?|s?ftp|git)","i")).test(e)?e:"http://"+e),this.options.regExp.test(e))},needsValidation:function(){var e=this.getValue();return e!==""}};return new e(t,r,n,"email",i)}}),define("type/label",["type/default"],function(e){"use strict";return function(t,n){var r={id:"id",label:"name",translate:!0},i={setValue:function(e){if(!!e[this.options.label]){var t=e[this.options.label],n=e[this.options.label];!this.options.translate||(n=Globalize.localize(t,Globalize.culture().name),n===undefined&&(n=t)),this.$el.text(n)}!e[this.options.id]||this.$el.data(this.options.id,e[this.options.id])},getValue:function(){var e={};return e[this.options.id]=this.$el.data(this.options.id),e[this.options.label]=this.$el.text(),e},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"label",i)}}),define("type/select",["type/default","form/util"],function(e,t){"use strict";return function(n,r){var i={id:"id",label:"name",type:"object"},s={setValue:function(e){typeof e=="object"?this.$el.val(e[this.options.id]):(this.$el.find("option[id="+e+"]").attr("selected","selected"),this.options.type="string")},getValue:function(){if(this.options.type==="object"){var e={};return e[this.options.id]=t.getValue(this.$el),e[this.options.label]=this.$el.find("option:selected").text(),e}return this.$el.children(":selected").attr("id")},needsValidation:function(){return!1},validate:function(){return!0}};return new e(n,i,r,"select",s)}}),define("type/readonly-select",["type/default"],function(e){"use strict";return function(t,n){var r={id:null,data:[],idProperty:"id",outputProperty:"name"},i={setValue:function(e){var t=this.options.data,n=this.options.idProperty,r,i;if(typeof e=="object"){if(!e.hasOwnProperty(n))throw"value has no property named "+n;e=e[n]}else if(e===null)return;this.$el.data("id",e);if(t.length>0)for(r=-1,i=t.length;++r<i;)if(t[r].hasOwnProperty(n)&&t[r][n].toString()===e.toString()){this.$el.html(t[r][this.options.outputProperty]);break}},getValue:function(){var e=this.$el.data("id"),t,n;for(t=-1,n=this.options.data.length;++t<n;)if(this.options.data[t][this.options.idProperty].toString()===e.toString())return this.options.data[t];return null},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"readonly-select",i)}}),define("type/collection",["type/default"],function(e){"use strict";return function(t,n){var r={min:0,max:null},i={validate:function(){return!0},needsValidation:function(){return!1},getChildren:function(e){return this.$el.find('*[data-mapper-property-tpl="'+e+'"]')},getMinOccurs:function(){return this.options.min},getMaxOccurs:function(){return this.options.max},canAdd:function(e){var t=this.getChildren(e).length;return this.getMaxOccurs()===null||t<this.getMaxOccurs()},canRemove:function(e){var t=this.getChildren(e).length;return t>this.getMinOccurs()}};return new e(t,r,n,"collection",i)}}),define("type/attributes",["type/default"],function(e){"use strict";return function(t,n){var r={},i={setValue:function(e){this.$el.data("attributes",e)},getValue:function(){return this.$el.data("attributes")},needsValidation:function(){return!1},validate:function(){return!0}};return new e(t,r,n,"attributes",i)}}),define("validator/default",[],function(){"use strict";return function(e,t,n,r,i){return{name:i,initialize:function(){this.$el=e,this.data=$.extend(n,this.$el.data(),r),this.updateData(),!this.initializeSub||this.initializeSub()},validate:function(){},update:function(){return this.validate()},updateConstraint:function(e){$.extend(this.data,e),this.updateData()},updateData:function(){$.each(this.data,function(e,t){this.$el.data(e,t)}.bind(this))},fieldRemoved:function(){},fieldAdded:function(){}}}}),define("validator/min",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={min:0},o=$.extend(new e(t,n,s,i,"min"),{validate:function(){var e=this.data.element.getValue();return Number(e)>=this.data.min}});return o.initialize(),o}}),define("validator/max",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={max:999},o=$.extend(new e(t,n,s,i,"max"),{validate:function(){var e=this.data.element.getValue();return Number(e)<=this.data.max}});return o.initialize(),o}}),define("validator/minLength",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={minLength:0},o=$.extend(new e(t,n,s,i,"min-length"),{validate:function(){var e=this.data.element.getValue();return e.length>=this.data.minLength}});return o.initialize(),o}}),define("validator/maxLength",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={maxLength:999},o=$.extend(new e(t,n,s,i,"max-length"),{validate:function(){var e=this.data.element.getValue();return e.length<=this.data.maxLength}});return o.initialize(),o}}),define("validator/required",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={},o=$.extend(new e(t,n,s,i,"required"),{validate:function(){if(!this.data.required)return!0;var e=this.data.element.getValue();return typeof e=="number"?!0:(!_.isString(e)||(e=e.trim()),e?_.size(e)>0:!1)}});return o.initialize(),o}}),define("validator/unique",["validator/default","form/util"],function(e,t){"use strict";return function(n,r,i,s){var o={validationUnique:null},u=[],a=function(e,t){return u.indexOf(e)&&!!e.options.validationUnique&&e.options.validationUnique===t},f=function(e){var t=!0;return $.each(u,function(n,r){return l(e,r)?!0:(t=!1,!1)}),t},l=function(e,t){return e!==t.getValue()},c=function(){$.each(u,function(e,t){t.update()})},h=$.extend({},new e(n,r,o,s,"unique"),{initializeSub:function(){i.initialized.then(function(){$.each(r.elements,function(e,t){this.fieldAdded(t)}.bind(this))}.bind(this))},validate:function(){var e=this.data.element.getValue(),t;if(!this.data.unique)throw"No option group set";return t=f(e),c(),t},update:function(){var e=this.data.element.getValue(),t;if(!this.data.unique)throw"No option group set";return t=f(e),t},fieldAdded:function(e){e.$el!==this.$el&&a(e,this.data.unique)&&(t.debug("field added",this.$el),u.push(e))},fieldRemoved:function(e){t.debug("field removed",this.$el),u=u.splice(u.indexOf(e),1)}});return h.initialize(),h}}),define("validator/equal",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={equal:null},o=[],u=function(e,t){return o.indexOf(e)&&!!e.options.validationEqual&&e.options.validationEqual===t},a=function(e){var t=!0;return $.each(o,function(n,r){return f(e,r)?!0:(t=!1,!1)}),t},f=function(e,t){return e===t.getValue()},l=function(){$.each(o,function(e,t){t.update()})},c=$.extend(new e(t,n,s,i,"equal"),{initializeSub:function(){r.initialized.then(function(){$.each(n.elements,function(e,t){this.fieldAdded(t)}.bind(this))}.bind(this))},validate:function(){var e=this.$el.val(),t;if(!this.data.equal)throw"No option group set";return t=a(e),l(),t},update:function(){var e=this.data.element.getValue(),t;if(!this.data.equal)throw"No option group set";return t=a(e),t},fieldAdded:function(e){e.$el!==this.$el&&u(e,this.data.equal)&&o.push(e)},fieldRemoved:function(e){o=o.splice(o.indexOf(e),1)}});return c.initialize(),c}}),define("validator/regex",["validator/default"],function(e){"use strict";return function(t,n,r,i){var s={regex:/\w*/},o=$.extend(new e(t,n,s,i,"regex"),{validate:function(){var e=this.data.regex,t=new RegExp(e),n=this.data.element.getValue();return n===""?!0:t.test(n)}});return o.initialize(),o}}),define("husky-validation",function(){}),function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N;n=function(e){return new n.prototype.init(e)},typeof require!="undefined"&&typeof exports!="undefined"&&typeof module!="undefined"?module.exports=n:e.Globalize=n,n.cultures={},n.prototype={constructor:n,init:function(e){return this.cultures=n.cultures,this.cultureSelector=e,this}},n.prototype.init.prototype=n.prototype,n.cultures["default"]={name:"en",englishName:"English",nativeName:"English",isRTL:!1,language:"en",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSizes:[3],"+":"+","-":"-",NaN:"NaN",negativeInfinity:"-Infinity",positiveInfinity:"Infinity",percent:{pattern:["-n %","n %"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"$"}},calendars:{standard:{name:"Gregorian_USEnglish","/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss"}}},messages:{}},n.cultures["default"].calendar=n.cultures["default"].calendars.standard,n.cultures.en=n.cultures["default"],n.cultureSelector="en",r=/^0x[a-f0-9]+$/i,i=/^[+\-]?infinity$/i,s=/^[+\-]?\d*\.?\d*(e[+\-]?\d+)?$/,o=/^\s+|\s+$/g,u=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},a=function(e,t){return e.substr(e.length-t.length)===t},f=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,p=arguments.length,d=!1;typeof u=="boolean"&&(d=u,u=arguments[1]||{},a=2),typeof u!="object"&&!c(u)&&(u={});for(;a<p;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;d&&i&&(h(i)||(s=l(i)))?(s?(s=!1,o=r&&l(r)?r:[]):o=r&&h(r)?r:{},u[n]=f(d,o,i)):i!==t&&(u[n]=i)}return u},l=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},c=function(e){return Object.prototype.toString.call(e)==="[object Function]"},h=function(e){return Object.prototype.toString.call(e)==="[object Object]"},p=function(e,t){return e.indexOf(t)===0},d=function(e){return(e+"").replace(o,"")},v=function(e){return isNaN(e)?NaN:Math[e<0?"ceil":"floor"](e)},m=function(e,t,n){var r;for(r=e.length;r<t;r+=1)e=n?"0"+e:e+"0";return e},g=function(e,t){var n=0,r=!1;for(var i=0,s=e.length;i<s;i++){var o=e.charAt(i);switch(o){case"'":r?t.push("'"):n++,r=!1;break;case"\\":r&&t.push("\\"),r=!r;break;default:t.push(o),r=!1}}return n},y=function(e,t){t=t||"F";var n,r=e.patterns,i=t.length;if(i===1){n=r[t];if(!n)throw"Invalid date format string '"+t+"'.";t=n}else i===2&&t.charAt(0)==="%"&&(t=t.charAt(1));return t},b=function(e,t,n){function T(e,t){var n,r=e+"";return t>1&&r.length<t?(n=c[t-2]+r,n.substr(n.length-t,t)):(n=r,n)}function N(){return h||p?h:(h=d.test(t),p=!0,h)}function C(e,t){if(w)return w[t];switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate();default:throw"Invalid part value "+t}}var r=n.calendar,i=r.convert,s;if(!t||!t.length||t==="i"){if(n&&n.name.length)if(i)s=b(e,r.patterns.F,n);else{var o=new Date(e.getTime()),u=S(e,r.eras);o.setFullYear(x(e,r,u)),s=o.toLocaleString()}else s=e.toString();return s}var a=r.eras,f=t==="s";t=y(r,t),s=[];var l,c=["0","00","000"],h,p,d=/([^d]|^)(d|dd)([^d]|$)/g,v=0,m=E(),w;!f&&i&&(w=i.fromGregorian(e));for(;;){var k=m.lastIndex,L=m.exec(t),A=t.slice(k,L?L.index:t.length);v+=g(A,s);if(!L)break;if(v%2){s.push(L[0]);continue}var O=L[0],M=O.length;switch(O){case"ddd":case"dddd":var _=M===3?r.days.namesAbbr:r.days.names;s.push(_[e.getDay()]);break;case"d":case"dd":h=!0,s.push(T(C(e,2),M));break;case"MMM":case"MMMM":var D=C(e,1);s.push(r.monthsGenitive&&N()?r.monthsGenitive[M===3?"namesAbbr":"names"][D]:r.months[M===3?"namesAbbr":"names"][D]);break;case"M":case"MM":s.push(T(C(e,1)+1,M));break;case"y":case"yy":case"yyyy":D=w?w[0]:x(e,r,S(e,a),f),M<4&&(D%=100),s.push(T(D,M));break;case"h":case"hh":l=e.getHours()%12,l===0&&(l=12),s.push(T(l,M));break;case"H":case"HH":s.push(T(e.getHours(),M));break;case"m":case"mm":s.push(T(e.getMinutes(),M));break;case"s":case"ss":s.push(T(e.getSeconds(),M));break;case"t":case"tt":D=e.getHours()<12?r.AM?r.AM[0]:" ":r.PM?r.PM[0]:" ",s.push(M===1?D.charAt(0):D);break;case"f":case"ff":case"fff":s.push(T(e.getMilliseconds(),3).substr(0,M));break;case"z":case"zz":l=e.getTimezoneOffset()/60,s.push((l<=0?"+":"-")+T(Math.floor(Math.abs(l)),M));break;case"zzz":l=e.getTimezoneOffset()/60,s.push((l<=0?"+":"-")+T(Math.floor(Math.abs(l)),2)+":"+T(Math.abs(e.getTimezoneOffset()%60),2));break;case"g":case"gg":r.eras&&s.push(r.eras[S(e,a)].name);break;case"/":s.push(r["/"]);break;default:throw"Invalid date format pattern '"+O+"'."}}return s.join("")},function(){var e;e=function(e,t,n){var r=n.groupSizes,i=r[0],s=1,o=Math.pow(10,t),u=Math.round(e*o)/o;isFinite(u)||(u=e),e=u;var a=e+"",f="",l=a.split(/e/i),c=l.length>1?parseInt(l[1],10):0;a=l[0],l=a.split("."),a=l[0],f=l.length>1?l[1]:"";var h;c>0?(f=m(f,c,!1),a+=f.slice(0,c),f=f.substr(c)):c<0&&(c=-c,a=m(a,c+1,!0),f=a.slice(-c,a.length)+f,a=a.slice(0,-c)),t>0?f=n["."]+(f.length>t?f.slice(0,t):m(f,t)):f="";var p=a.length-1,d=n[","],v="";while(p>=0){if(i===0||i>p)return a.slice(0,p+1)+(v.length?d+v+f:f);v=a.slice(p-i+1,p+1)+(v.length?d+v:""),p-=i,s<r.length&&(i=r[s],s++)}return a.slice(0,p+1)+d+v+f},w=function(t,n,r){if(!isFinite(t))return t===Infinity?r.numberFormat.positiveInfinity:t===-Infinity?r.numberFormat.negativeInfinity:r.numberFormat.NaN;if(!n||n==="i")return r.name.length?t.toLocaleString():t.toString();n=n||"D";var i=r.numberFormat,s=Math.abs(t),o=-1,u;n.length>1&&(o=parseInt(n.slice(1),10));var a=n.charAt(0).toUpperCase(),f;switch(a){case"D":u="n",s=v(s),o!==-1&&(s=m(""+s,o,!0)),t<0&&(s="-"+s);break;case"N":f=i;case"C":f=f||i.currency;case"P":f=f||i.percent,u=t<0?f.pattern[0]:f.pattern[1]||"n",o===-1&&(o=f.decimals),s=e(s*(a==="P"?100:1),o,f);break;default:throw"Bad number format specifier: "+a}var l=/n|\$|-|%/g,c="";for(;;){var h=l.lastIndex,p=l.exec(u);c+=u.slice(h,p?p.index:u.length);if(!p)break;switch(p[0]){case"n":c+=s;break;case"$":c+=i.currency.symbol;break;case"-":/[1-9]/.test(s)&&(c+=i["-"]);break;case"%":c+=i.percent.symbol}}return c}}(),E=function(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g},S=function(e,t){if(!t)return 0;var n,r=e.getTime();for(var i=0,s=t.length;i<s;i++){n=t[i].start;if(n===null||r>=n)return i}return 0},x=function(e,t,n,r){var i=e.getFullYear();return!r&&t.eras&&(i-=t.eras[n].offset),i},function(){var e,t,n,r,i,s,o;e=function(e,t){if(t<100){var n=new Date,r=S(n),i=x(n,e,r),s=e.twoDigitYearMax;s=typeof s=="string"?(new Date).getFullYear()%100+parseInt(s,10):s,t+=i-i%100,t>s&&(t-=100)}return t},t=function(e,t,n){var r,i=e.days,a=e._upperDays;return a||(e._upperDays=a=[o(i.names),o(i.namesAbbr),o(i.namesShort)]),t=s(t),n?(r=u(a[1],t),r===-1&&(r=u(a[2],t))):r=u(a[0],t),r},n=function(e,t,n){var r=e.months,i=e.monthsGenitive||e.months,a=e._upperMonths,f=e._upperMonthsGen;a||(e._upperMonths=a=[o(r.names),o(r.namesAbbr)],e._upperMonthsGen=f=[o(i.names),o(i.namesAbbr)]),t=s(t);var l=u(n?a[1]:a[0],t);return l<0&&(l=u(n?f[1]:f[0],t)),l},r=function(e,t){var n=e._parseRegExp;if(!n)e._parseRegExp=n={};else{var r=n[t];if(r)return r}var i=y(e,t).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),s=["^"],o=[],u=0,a=0,f=E(),l;while((l=f.exec(i))!==null){var c=i.slice(u,l.index);u=f.lastIndex,a+=g(c,s);if(a%2){s.push(l[0]);continue}var h=l[0],p=h.length,d;switch(h){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":d="(\\D+)";break;case"tt":case"t":d="(\\D*)";break;case"yyyy":case"fff":case"ff":case"f":d="(\\d{"+p+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":d="(\\d\\d?)";break;case"zzz":d="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":d="([+-]?\\d\\d?)";break;case"/":d="(\\/)";break;default:throw"Invalid date format pattern '"+h+"'."}d&&s.push(d),o.push(l[0])}g(i.slice(u),s),s.push("$");var v=s.join("").replace(/\s+/g,"\\s+"),m={regExp:v,groups:o};return n[t]=m},i=function(e,t,n){return e<t||e>n},s=function(e){return e.split(" ").join(" ").toUpperCase()},o=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)t[n]=s(e[n]);return t},T=function(s,o,u){s=d(s);var a=u.calendar,f=r(a,o),l=(new RegExp(f.regExp)).exec(s);if(l===null)return null;var c=f.groups,h=null,v=null,m=null,g=null,y=null,b=0,w,E=0,S=0,x=0,T=null,N=!1;for(var C=0,k=c.length;C<k;C++){var L=l[C+1];if(L){var A=c[C],O=A.length,M=parseInt(L,10);switch(A){case"dd":case"d":g=M;if(i(g,1,31))return null;break;case"MMM":case"MMMM":m=n(a,L,O===3);if(i(m,0,11))return null;break;case"M":case"MM":m=M-1;if(i(m,0,11))return null;break;case"y":case"yy":case"yyyy":v=O<4?e(a,M):M;if(i(v,0,9999))return null;break;case"h":case"hh":b=M,b===12&&(b=0);if(i(b,0,11))return null;break;case"H":case"HH":b=M;if(i(b,0,23))return null;break;case"m":case"mm":E=M;if(i(E,0,59))return null;break;case"s":case"ss":S=M;if(i(S,0,59))return null;break;case"tt":case"t":N=a.PM&&(L===a.PM[0]||L===a.PM[1]||L===a.PM[2]);if(!N&&(!a.AM||L!==a.AM[0]&&L!==a.AM[1]&&L!==a.AM[2]))return null;break;case"f":case"ff":case"fff":x=M*Math.pow(10,3-O);if(i(x,0,999))return null;break;case"ddd":case"dddd":y=t(a,L,O===3);if(i(y,0,6))return null;break;case"zzz":var _=L.split(/:/);if(_.length!==2)return null;w=parseInt(_[0],10);if(i(w,-12,13))return null;var D=parseInt(_[1],10);if(i(D,0,59))return null;T=w*60+(p(L,"-")?-D:D);break;case"z":case"zz":w=M;if(i(w,-12,13))return null;T=w*60;break;case"g":case"gg":var P=L;if(!P||!a.eras)return null;P=d(P.toLowerCase());for(var H=0,B=a.eras.length;H<B;H++)if(P===a.eras[H].name.toLowerCase()){h=H;break}if(h===null)return null}}}var j=new Date,F,I=a.convert;F=I?I.fromGregorian(j)[0]:j.getFullYear(),v===null?v=F:a.eras&&(v+=a.eras[h||0].offset),m===null&&(m=0),g===null&&(g=1);if(I){j=I.toGregorian(v,m,g);if(j===null)return null}else{j.setFullYear(v,m,g);if(j.getDate()!==g)return null;if(y!==null&&j.getDay()!==y)return null}N&&b<12&&(b+=12),j.setHours(b,E,S,x);if(T!==null){var q=j.getMinutes()-(T+j.getTimezoneOffset());j.setHours(j.getHours()+parseInt(q/60,10),q%60)}return j}}(),N=function(e,t,n){var r=t["-"],i=t["+"],s;switch(n){case"n -":r=" "+r,i=" "+i;case"n-":a(e,r)?s=["-",e.substr(0,e.length-r.length)]:a(e,i)&&(s=["+",e.substr(0,e.length-i.length)]);break;case"- n":r+=" ",i+=" ";case"-n":p(e,r)?s=["-",e.substr(r.length)]:p(e,i)&&(s=["+",e.substr(i.length)]);break;case"(n)":p(e,"(")&&a(e,")")&&(s=["-",e.substr(1,e.length-2)])}return s||["",e]},n.prototype.findClosestCulture=function(e){return n.findClosestCulture.call(this,e)},n.prototype.format=function(e,t,r){return n.format.call(this,e,t,r)},n.prototype.localize=function(e,t){return n.localize.call(this,e,t)},n.prototype.parseInt=function(e,t,r){return n.parseInt.call(this,e,t,r)},n.prototype.parseFloat=function(e,t,r){return n.parseFloat.call(this,e,t,r)},n.prototype.culture=function(e){return n.culture.call(this,e)},n.addCultureInfo=function(e,t,n){var r={},i=!1;typeof e!="string"?(n=e,e=this.culture().name,r=this.cultures[e]):typeof t!="string"?(n=t,i=this.cultures[e]==null,r=this.cultures[e]||this.cultures["default"]):(i=!0,r=this.cultures[t]),this.cultures[e]=f(!0,{},r,n),i&&(this.cultures[e].calendar=this.cultures[e].calendars.standard)},n.findClosestCulture=function(e){var t;if(!e)return this.findClosestCulture(this.cultureSelector)||this.cultures["default"];typeof e=="string"&&(e=e.split(","));if(l(e)){var n,r=this.cultures,i=e,s,o=i.length,u=[];for(s=0;s<o;s++){e=d(i[s]);var a,f=e.split(";");n=d(f[0]),f.length===1?a=1:(e=d(f[1]),e.indexOf("q=")===0?(e=e.substr(2),a=parseFloat(e),a=isNaN(a)?0:a):a=1),u.push({lang:n,pri:a})}u.sort(function(e,t){return e.pri<t.pri?1:e.pri>t.pri?-1:0});for(s=0;s<o;s++){n=u[s].lang,t=r[n];if(t)return t}for(s=0;s<o;s++){n=u[s].lang;do{var c=n.lastIndexOf("-");if(c===-1)break;n=n.substr(0,c),t=r[n];if(t)return t}while(1)}for(s=0;s<o;s++){n=u[s].lang;for(var h in r){var p=r[h];if(p.language==n)return p}}}else if(typeof e=="object")return e;return t||null},n.format=function(e,t,n){var r=this.findClosestCulture(n);return e instanceof Date?e=b(e,t,r):typeof e=="number"&&(e=w(e,t,r)),e},n.localize=function(e,t){return this.findClosestCulture(t).messages[e]||this.cultures["default"].messages[e]},n.parseDate=function(e,t,n){n=this.findClosestCulture(n);var r,i,s;if(t){typeof t=="string"&&(t=[t]);if(t.length)for(var o=0,u=t.length;o<u;o++){var a=t[o];if(a){r=T(e,a,n);if(r)break}}}else{s=n.calendar.patterns;for(i in s){r=T(e,s[i],n);if(r)break}}return r||null},n.parseInt=function(e,t,r){return v(n.parseFloat(e,t,r))},n.parseFloat=function(e,t,n){typeof t!="number"&&(n=t,t=10);var o=this.findClosestCulture(n),u=NaN,a=o.numberFormat;e.indexOf(o.numberFormat.currency.symbol)>-1&&(e=e.replace(o.numberFormat.currency.symbol,""),e=e.replace(o.numberFormat.currency["."],o.numberFormat["."])),e.indexOf(o.numberFormat.percent.symbol)>-1&&(e=e.replace(o.numberFormat.percent.symbol,"")),e=e.replace(/ /g,"");if(i.test(e))u=parseFloat(e);else if(!t&&r.test(e))u=parseInt(e,16);else{var f=N(e,a,a.pattern[0]),l=f[0],c=f[1];l===""&&a.pattern[0]!=="(n)"&&(f=N(e,a,"(n)"),l=f[0],c=f[1]),l===""&&a.pattern[0]!=="-n"&&(f=N(e,a,"-n"),l=f[0],c=f[1]),l=l||"+";var h,p,d=c.indexOf("e");d<0&&(d=c.indexOf("E")),d<0?(p=c,h=null):(p=c.substr(0,d),h=c.substr(d+1));var v,m,g=a["."],y=p.indexOf(g);y<0?(v=p,m=null):(v=p.substr(0,y),m=p.substr(y+g.length));var b=a[","];v=v.split(b).join("");var w=b.replace(/\u00A0/g," ");b!==w&&(v=v.split(w).join(""));var E=l+v;m!==null&&(E+="."+m);if(h!==null){var S=N(h,a,"-n");E+="e"+(S[0]||"+")+S[1]}s.test(E)&&(u=parseFloat(E))}return u},n.culture=function(e){return typeof e!="undefined"&&(this.cultureSelector=e),this.findClosestCulture(e)||this.cultures["default"]}}(this),define("globalize_lib",function(){}),function(){if(!window.CKEDITOR||!window.CKEDITOR.dom)window.CKEDITOR||(window.CKEDITOR=function(){var e=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,t={timestamp:"F0RF",version:"4.4.7 (Standard)",revision:"3a35b3d",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:e},status:"unloaded",basePath:function(){var t=window.CKEDITOR_BASEPATH||"";if(!t)for(var n=document.getElementsByTagName("script"),r=0;r<n.length;r++){var i=n[r].src.match(e);if(i){t=i[1];break}}-1==t.indexOf(":/")&&"//"!=t.slice(0,2)&&(t=0===t.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+t:location.href.match(/^[^\?]*\/(?:)/)[0]+t);if(!t)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return t}(),getUrl:function(e){return-1==e.indexOf(":/")&&0!==e.indexOf("/")&&(e=this.basePath+e),this.timestamp&&"/"!=e.charAt(e.length-1)&&!/[&?]t=/.test(e)&&(e+=(0<=e.indexOf("?")?"&":"?")+"t="+this.timestamp),e},domReady:function(){function e(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",e,!1),t()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",e),t())}catch(n){}}function t(){for(var e;e=n.shift();)e()}var n=[];return function(t){function r(){try{document.documentElement.doScroll("left")}catch(t){setTimeout(r,1);return}e()}n.push(t),"complete"===document.readyState&&setTimeout(e,1);if(1==n.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",e,!1),window.addEventListener("load",e,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",e),window.attachEvent("onload",e),t=!1;try{t=!window.frameElement}catch(i){}document.documentElement.doScroll&&t&&r()}}}()},n=window.CKEDITOR_GETURL;if(n){var r=t.getUrl;t.getUrl=function(e){return n.call(t,e)||r.call(t,e)}}return t}()),CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(e){var t=CKEDITOR.event.prototype,n;for(n in t)e[n]==null&&(e[n]=t[n])},CKEDITOR.event.prototype=function(){function e(e){var r=t(this);return r[e]||(r[e]=new n(e))}var t=function(e){return e=e.getPrivate&&e.getPrivate()||e._||(e._={}),e.events||(e.events={})},n=function(e){this.name=e,this.listeners=[]};return n.prototype={getListenerIndex:function(e){for(var t=0,n=this.listeners;t<n.length;t++)if(n[t].fn==e)return t;return-1}},{define:function(t,n){var r=e.call(this,t);CKEDITOR.tools.extend(r,n,!0)},on:function(t,n,r,i,s){function o(e,s,o,a){return e={name:t,sender:this,editor:e,data:s,listenerData:i,stop:o,cancel:a,removeListener:u},n.call(r,e)===!1?!1:e.data}function u(){l.removeListener(t,n)}var f=e.call(this,t);if(f.getListenerIndex(n)<0){f=f.listeners,r||(r=this),isNaN(s)&&(s=10);var l=this;o.fn=n,o.priority=s;for(var c=f.length-1;c>=0;c--)if(f[c].priority<=s)return f.splice(c+1,0,o),{removeListener:u};f.unshift(o)}return{removeListener:u}},once:function(){var e=Array.prototype.slice.call(arguments),t=e[1];return e[1]=function(e){return e.removeListener(),t.apply(this,arguments)},this.on.apply(this,e)},capture:function(){CKEDITOR.event.useCapture=1;var e=this.on.apply(this,arguments);return CKEDITOR.event.useCapture=0,e},fire:function(){var e=0,n=function(){e=1},r=0,i=function(){r=1};return function(s,o,u){var f=t(this)[s],s=e,l=r;e=r=0;if(f){var h=f.listeners;if(h.length)for(var h=h.slice(0),p,v=0;v<h.length;v++){if(f.errorProof)try{p=h[v].call(this,u,o,n,i)}catch(m){}else p=h[v].call(this,u,o,n,i);p===!1?r=1:typeof p!="undefined"&&(o=p);if(e||r)break}}return o=r?!1:typeof o=="undefined"?!0:o,e=s,r=l,o}}(),fireOnce:function(e,n,r){return n=this.fire(e,n,r),delete t(this)[e],n},removeListener:function(e,n){var r=t(this)[e];if(r){var i=r.getListenerIndex(n);i>=0&&r.listeners.splice(i,1)}},removeAllListeners:function(){var e=t(this),n;for(n in e)delete e[n]},hasListeners:function(e){return(e=t(this)[e])&&e.listeners.length>0}}}()),CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]),CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fire.call(this,e,t,this)},CKEDITOR.editor.prototype.fireOnce=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fireOnce.call(this,e,t,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)),CKEDITOR.env||(CKEDITOR.env=function(){var e=navigator.userAgent.toLowerCase(),t={ie:e.indexOf("trident/")>-1,webkit:e.indexOf(" applewebkit/")>-1,air:e.indexOf(" adobeair/")>-1,mac:e.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:e.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(e),isCustomDomain:function(){if(!this.ie)return!1;var e=document.domain,t=window.location.hostname;return e!=t&&e!="["+t+"]"},secure:location.protocol=="https:"};t.gecko=navigator.product=="Gecko"&&!t.webkit&&!t.ie,t.webkit&&(e.indexOf("chrome")>-1?t.chrome=!0:t.safari=!0);var n=0;t.ie&&(n=t.quirks||!document.documentMode?parseFloat(e.match(/msie (\d+)/)[1]):document.documentMode,t.ie9Compat=n==9,t.ie8Compat=n==8,t.ie7Compat=n==7,t.ie6Compat=n<7||t.quirks);if(t.gecko){var r=e.match(/rv:([\d\.]+)/);r&&(r=r[1].split("."),n=r[0]*1e4+(r[1]||0)*100+(r[2]||0)*1)}return t.air&&(n=parseFloat(e.match(/ adobeair\/(\d+)/)[1])),t.webkit&&(n=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),t.version=n,t.isCompatible=t.iOS&&n>=534||!t.mobile&&(t.ie&&n>6||t.gecko&&n>=2e4||t.air&&n>=1||t.webkit&&n>=522||!1),t.hidpi=window.devicePixelRatio>=2,t.needsBrFiller=t.gecko||t.webkit||t.ie&&n>10,t.needsNbspFiller=t.ie&&n<11,t.cssClass="cke_browser_"+(t.ie?"ie":t.gecko?"gecko":t.webkit?"webkit":"unknown"),t.quirks&&(t.cssClass=t.cssClass+" cke_browser_quirks"),t.ie&&(t.cssClass=t.cssClass+(" cke_browser_ie"+(t.quirks?"6 cke_browser_iequirks":t.version))),t.air&&(t.cssClass=t.cssClass+" cke_browser_air"),t.iOS&&(t.cssClass=t.cssClass+" cke_browser_ios"),t.hidpi&&(t.cssClass=t.cssClass+" cke_hidpi"),t}()),"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 e=document.createElement("script");e.type="text/javascript",e.src=CKEDITOR.basePath+"ckeditor.js",document.getElementsByTagName("head")[0].appendChild(e)}},CKEDITOR.loadFullCoreTimeout=0,CKEDITOR.add=function(e){(this._.pending||(this._.pending=[])).push(e)},function(){CKEDITOR.domReady(function(){var e=CKEDITOR.loadFullCore,t=CKEDITOR.loadFullCoreTimeout;e&&(CKEDITOR.status="basic_ready",e&&e._load?e():t&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},t*1e3))})}(),CKEDITOR.status="basic_loaded"}(),CKEDITOR.dom={},function(){var e=[],t=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",n=/&/g,r=/>/g,i=/</g,s=/"/g,o=/&amp;/g,u=/&gt;/g,a=/&lt;/g,f=/&quot;/g;CKEDITOR.on("reset",function(){e=[]}),CKEDITOR.tools={arrayCompare:function(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0},clone:function(e){var t;if(e&&e instanceof Array){t=[];for(var n=0;n<e.length;n++)t[n]=CKEDITOR.tools.clone(e[n]);return t}if(e===null||typeof e!="object"||e instanceof String||e instanceof Number||e instanceof Boolean||e instanceof Date||e instanceof RegExp||e.nodeType||e.window===e)return e;t=new e.constructor;for(n in e)t[n]=CKEDITOR.tools.clone(e[n]);return t},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},extend:function(e){var t=arguments.length,n,r;typeof (n=arguments[t-1])=="boolean"?t--:typeof (n=arguments[t-2])=="boolean"&&(r=arguments[t-1],t-=2);for(var i=1;i<t;i++){var s=arguments[i],o;for(o in s)if(n===!0||e[o]==null)if(!r||o in r)e[o]=s[o]}return e},prototypedCopy:function(e){var t=function(){};return t.prototype=e,new t},copy:function(e){var t={},n;for(n in e)t[n]=e[n];return t},isArray:function(e){return Object.prototype.toString.call(e)=="[object Array]"},isEmpty:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},cssVendorPrefix:function(e,n,r){return r?t+e+":"+n+";"+e+":"+n:(r={},r[e]=n,r[t+e]=n,r)},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t=typeof e.cssFloat!="undefined"?"cssFloat":typeof e.styleFloat!="undefined"?"styleFloat":"float";return function(e){return e=="float"?t:e.replace(/-./g,function(e){return e.substr(1).toUpperCase()})}}(),buildStyleHtml:function(e){for(var e=[].concat(e),t,n=[],r=0;r<e.length;r++)if(t=e[r])/@import|[{}]/.test(t)?n.push("<style>"+t+"</style>"):n.push('<link type="text/css" rel=stylesheet href="'+t+'">');return n.join("")},htmlEncode:function(e){return(""+e).replace(n,"&amp;").replace(r,"&gt;").replace(i,"&lt;")},htmlDecode:function(e){return e.replace(o,"&").replace(u,">").replace(a,"<")},htmlEncodeAttr:function(e){return e.replace(s,"&quot;").replace(i,"&lt;").replace(r,"&gt;")},htmlDecodeAttr:function(e){return e.replace(f,'"').replace(a,"<").replace(u,">")},getNextNumber:function(){var e=0;return function(){return++e}}(),getNextId:function(){return"cke_"+this.getNextNumber()},override:function(e,t){var n=t(e);return n.prototype=e.prototype,n},setTimeout:function(e,t,n,r,i){return i||(i=window),n||(n=i),i.setTimeout(function(){r?e.apply(n,[].concat(r)):e.apply(n)},t||0)},trim:function(){var e=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(t){return t.replace(e,"")}}(),ltrim:function(){var e=/^[ \t\n\r]+/g;return function(t){return t.replace(e,"")}}(),rtrim:function(){var e=/[ \t\n\r]+$/g;return function(t){return t.replace(e,"")}}(),indexOf:function(e,t){if(typeof t=="function"){for(var n=0,r=e.length;n<r;n++)if(t(e[n]))return n}else{if(e.indexOf)return e.indexOf(t);n=0;for(r=e.length;n<r;n++)if(e[n]===t)return n}return-1},search:function(e,t){var n=CKEDITOR.tools.indexOf(e,t);return n>=0?e[n]:null},bind:function(e,t){return function(){return e.apply(t,arguments)}},createClass:function(e){var t=e.$,n=e.base,r=e.privates||e._,i=e.proto,e=e.statics;!t&&(t=function(){n&&this.base.apply(this,arguments)});if(r)var s=t,t=function(){var e=this._||(this._={}),t;for(t in r){var n=r[t];e[t]=typeof n=="function"?CKEDITOR.tools.bind(n,this):n}s.apply(this,arguments)};return n&&(t.prototype=this.prototypedCopy(n.prototype),t.prototype.constructor=t,t.base=n,t.baseProto=n.prototype,t.prototype.base=function(){this.base=n.prototype.base,n.apply(this,arguments),this.base=arguments.callee}),i&&this.extend(t.prototype,i,!0),e&&this.extend(t,e,!0),t},addFunction:function(t,n){return e.push(function(){return t.apply(n||this,arguments)})-1},removeFunction:function(t){e[t]=null},callFunction:function(t){var n=e[t];return n&&n.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var e=/^-?\d+\.?\d*px$/,t;return function(n){return t=CKEDITOR.tools.trim(n+"")+"px",e.test(t)?t:n||""}}(),convertToPx:function(){var e;return function(t){return e||(e=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(e)),/%$/.test(t)?t:(e.setStyle("width",t),e.$.clientWidth)}}(),repeat:function(e,t){return Array(t+1).join(e)},tryThese:function(){for(var e,t=0,n=arguments.length;t<n;t++){var r=arguments[t];try{e=r();break}catch(i){}}return e},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(e){return function(){var t=arguments,n=this;window.setTimeout(function(){e.apply(n,t)},0)}},normalizeCssText:function(e,t){var n=[],r,i=CKEDITOR.tools.parseCssText(e,!0,t);for(r in i)n.push(r+":"+i[r]);return n.sort(),n.length?n.join(";")+";":""},convertRgbToHex:function(e){return e.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(e,t,n,r){e=[t,n,r];for(t=0;t<3;t++)e[t]=("0"+parseInt(e[t],10).toString(16)).slice(-2);return"#"+e.join("")})},parseCssText:function(e,t,n){var r={};return n&&(n=new CKEDITOR.dom.element("span"),n.setAttribute("style",e),e=CKEDITOR.tools.convertRgbToHex(n.getAttribute("style")||"")),!e||e==";"?r:(e.replace(/&quot;/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,n,i){t&&(n=n.toLowerCase(),n=="font-family"&&(i=i.toLowerCase().replace(/["']/g,"").replace(/\s*,\s*/g,",")),i=CKEDITOR.tools.trim(i)),r[n]=i}),r)},writeCssText:function(e,t){var n,r=[];for(n in e)r.push(n+":"+e[n]);return t&&r.sort(),r.join("; ")},objectCompare:function(e,t,n){var r;if(!e&&!t)return!0;if(!e||!t)return!1;for(r in e)if(e[r]!=t[r])return!1;if(!n)for(r in t)if(e[r]!=t[r])return!1;return!0},objectKeys:function(e){var t=[],n;for(n in e)t.push(n);return t},convertArrayToObject:function(e,t){var n={};arguments.length==1&&(t=!0);for(var r=0,i=e.length;r<i;++r)n[e[r]]=t;return n},fixDomain:function(){for(var e;;)try{e=window.parent.document.domain;break}catch(t){e=e?e.replace(/.+?(?:\.|$)/,""):document.domain;if(!e)break;document.domain=e}return!!e},eventsBuffer:function(e,t){function n(){i=(new Date).getTime(),r=!1,t()}var r,i=0;return{input:function(){if(!r){var t=(new Date).getTime()-i;t<e?r=setTimeout(n,e-t):n()}},reset:function(){r&&clearTimeout(r),r=i=0}}},enableHtml5Elements:function(e,t){for(var n=["abbr","article","aside","audio","bdi","canvas","data","datalist","details","figcaption","figure","footer","header","hgroup","mark","meter","nav","output","progress","section","summary","time","video"],r=n.length,i;r--;)i=e.createElement(n[r]),t&&e.appendChild(i)},checkIfAnyArrayItemMatches:function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n].match(t))return!0;return!1},checkIfAnyObjectPropertyMatches:function(e,t){for(var n in e)if(n.match(t))return!0;return!1},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="}}(),CKEDITOR.dtd=function(){var e=CKEDITOR.tools.extend,t=function(e,t){for(var n=CKEDITOR.tools.clone(e),r=1;r<arguments.length;r++){var t=arguments[r],i;for(i in t)delete n[i]}return n},n={},r={},i={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,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},s={command:1,link:1,meta:1,noscript:1,script:1,style:1},o={},u={"#":1},a={center:1,dir:1,noframes:1};return e(n,{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},u,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1}),e(r,i,n,a),t={a:t(n,{a:1,button:1}),abbr:n,address:r,area:o,article:r,aside:r,audio:e({source:1,track:1},r),b:n,base:o,bdi:n,bdo:n,blockquote:r,body:r,br:o,button:t(n,{a:1,button:1}),canvas:n,caption:r,cite:n,code:n,col:o,colgroup:{col:1},command:o,datalist:e({option:1},n),dd:r,del:n,details:e({summary:1},r),dfn:n,div:r,dl:{dt:1,dd:1},dt:r,em:n,embed:o,fieldset:e({legend:1},r),figcaption:r,figure:e({figcaption:1},r),footer:r,form:r,h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:e({title:1,base:1},s),header:r,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:o,html:e({head:1,body:1},r,s),i:n,iframe:u,img:o,input:o,ins:n,kbd:n,keygen:o,label:n,legend:n,li:r,link:o,main:r,map:r,mark:n,menu:e({li:1},r),meta:o,meter:t(n,{meter:1}),nav:r,noscript:e({link:1,meta:1,style:1},n),object:e({param:1},n),ol:{li:1},optgroup:{option:1},option:u,output:n,p:n,param:o,pre:n,progress:t(n,{progress:1}),q:n,rp:n,rt:n,ruby:e({rp:1,rt:1},n),s:n,samp:n,script:u,section:r,select:{optgroup:1,option:1},small:n,source:o,span:n,strong:n,style:u,sub:n,summary:n,sup:n,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:r,textarea:u,tfoot:{tr:1},th:r,thead:{tr:1},time:t(n,{time:1}),title:u,tr:{th:1,td:1},track:o,u:n,ul:{li:1},"var":n,video:e({source:1,track:1},r),wbr:o,acronym:n,applet:e({param:1},r),basefont:o,big:n,center:r,dialog:o,dir:{li:1},font:n,isindex:o,noframes:r,strike:n,tt:n},e(t,{$block:e({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},i,a),$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,main: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,main: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:n,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:e({body:1,head:1,html:1},t.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}}),t}(),CKEDITOR.dom.event=function(e){this.$=e},CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var e=this.getKey();if(this.$.ctrlKey||this.$.metaKey)e+=CKEDITOR.CTRL;return this.$.shiftKey&&(e+=CKEDITOR.SHIFT),this.$.altKey&&(e+=CKEDITOR.ALT),e},preventDefault:function(e){var t=this.$;t.preventDefault?t.preventDefault():t.returnValue=!1,e&&this.stopPropagation()},stopPropagation:function(){var e=this.$;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},getTarget:function(){var e=this.$.target||this.$.srcElement;return e?new CKEDITOR.dom.node(e):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var e=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(e.documentElement.scrollLeft||e.body.scrollLeft),y:this.$.pageY||this.$.clientY+(e.documentElement.scrollTop||e.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(e){e&&(this.$=e)},CKEDITOR.dom.domObject.prototype=function(){var e=function(e,t){return function(n){typeof CKEDITOR!="undefined"&&e.fire(t,new CKEDITOR.dom.event(n))}};return{getPrivate:function(){var e;return(e=this.getCustomData("_"))||this.setCustomData("_",e={}),e},on:function(t){var n=this.getCustomData("_cke_nativeListeners");return n||(n={},this.setCustomData("_cke_nativeListeners",n)),n[t]||(n=n[t]=e(this,t),this.$.addEventListener?this.$.addEventListener(t,n,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+t,n)),CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(e){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(e)){var t=this.getCustomData("_cke_nativeListeners"),n=t&&t[e];n&&(this.$.removeEventListener?this.$.removeEventListener(e,n,!1):this.$.detachEvent&&this.$.detachEvent("on"+e,n),delete t[e])}},removeAllListeners:function(){var e=this.getCustomData("_cke_nativeListeners"),t;for(t in e){var n=e[t];this.$.detachEvent?this.$.detachEvent("on"+t,n):this.$.removeEventListener&&this.$.removeEventListener(t,n,!1),delete e[t]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}(),function(e){var t={};CKEDITOR.on("reset",function(){t={}}),e.equals=function(e){try{return e&&e.$===this.$}catch(t){return!1}},e.setCustomData=function(e,n){var r=this.getUniqueId();return(t[r]||(t[r]={}))[e]=n,this},e.getCustomData=function(e){var n=this.$["data-cke-expando"];return(n=n&&t[n])&&e in n?n[e]:null},e.removeCustomData=function(e){var n=this.$["data-cke-expando"],n=n&&t[n],r,i;return n&&(r=n[e],i=e in n,delete n[e]),i?r:null},e.clearCustomData=function(){this.removeAllListeners();var e=this.$["data-cke-expando"];e&&delete t[e]},e.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())},CKEDITOR.event.implementOn(e)}(CKEDITOR.dom.domObject.prototype),CKEDITOR.dom.node=function(e){return e?new CKEDITOR.dom[e.nodeType==CKEDITOR.NODE_DOCUMENT?"document":e.nodeType==CKEDITOR.NODE_ELEMENT?"element":e.nodeType==CKEDITOR.NODE_TEXT?"text":e.nodeType==CKEDITOR.NODE_COMMENT?"comment":e.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](e):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(e,t){return e.append(this,t),e},clone:function(e,t){var n=this.$.cloneNode(e),r=function(n){n["data-cke-expando"]&&(n["data-cke-expando"]=!1);if(n.nodeType==CKEDITOR.NODE_ELEMENT){t||n.removeAttribute("id",!1);if(e)for(var n=n.childNodes,i=0;i<n.length;i++)r(n[i])}};return r(n),new CKEDITOR.dom.node(n)},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(e){return e.$.parentNode.insertBefore(this.$,e.$.nextSibling),e},insertBefore:function(e){return e.$.parentNode.insertBefore(this.$,e.$),e},insertBeforeMe:function(e){return this.$.parentNode.insertBefore(e.$,this.$),e},getAddress:function(e){for(var t=[],n=this.getDocument().$.documentElement,r=this.$;r&&r!=n;){var i=r.parentNode;i&&t.unshift(this.getIndex.call({$:r},e)),r=i}return t},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(e){function t(e,n){var r=n?e.nextSibling:e.previousSibling;return!r||r.nodeType!=CKEDITOR.NODE_TEXT?null:r.nodeValue?r:t(r,n)}var n=this.$,r=-1,i;if(!this.$.parentNode||e&&n.nodeType==CKEDITOR.NODE_TEXT&&!n.nodeValue&&!t(n)&&!t(n,!0))return-1;do if(!e||n==this.$||n.nodeType!=CKEDITOR.NODE_TEXT||!i&&!!n.nodeValue)r++,i=n.nodeType==CKEDITOR.NODE_TEXT;while(n=n.previousSibling);return r},getNextSourceNode:function(e,t,n){if(n&&!n.call)var r=n,n=function(e){return!e.equals(r)};var e=!e&&this.getFirst&&this.getFirst(),i;if(!e){if(this.type==CKEDITOR.NODE_ELEMENT&&n&&n(this,!0)===!1)return null;e=this.getNext()}for(;!e&&(i=(i||this).getParent());){if(n&&n(i,!0)===!1)return null;e=i.getNext()}return!e||n&&n(e)===!1?null:t&&t!=e.type?e.getNextSourceNode(!1,t,n):e},getPreviousSourceNode:function(e,t,n){if(n&&!n.call)var r=n,n=function(e){return!e.equals(r)};var e=!e&&this.getLast&&this.getLast(),i;if(!e){if(this.type==CKEDITOR.NODE_ELEMENT&&n&&n(this,!0)===!1)return null;e=this.getPrevious()}for(;!e&&(i=(i||this).getParent());){if(n&&n(i,!0)===!1)return null;e=i.getPrevious()}return!e||n&&n(e)===!1?null:t&&e.type!=t?e.getPreviousSourceNode(!1,t,n):e},getPrevious:function(e){var t=this.$,n;do n=(t=t.previousSibling)&&t.nodeType!=10&&new CKEDITOR.dom.node(t);while(n&&e&&!e(n));return n},getNext:function(e){var t=this.$,n;do n=(t=t.nextSibling)&&new CKEDITOR.dom.node(t);while(n&&e&&!e(n));return n},getParent:function(e){var t=this.$.parentNode;return t&&(t.nodeType==CKEDITOR.NODE_ELEMENT||e&&t.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(t):null},getParents:function(e){var t=this,n=[];do n[e?"push":"unshift"](t);while(t=t.getParent());return n},getCommonAncestor:function(e){if(e.equals(this))return this;if(e.contains&&e.contains(this))return e;var t=this.contains?this:this.getParent();do if(t.contains(e))return t;while(t=t.getParent());return null},getPosition:function(e){var t=this.$,n=e.$;if(t.compareDocumentPosition)return t.compareDocumentPosition(n);if(t==n)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&e.type==CKEDITOR.NODE_ELEMENT){if(t.contains){if(t.contains(n))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(n.contains(t))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in t)return t.sourceIndex<0||n.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:t.sourceIndex<n.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}for(var t=this.getAddress(),e=e.getAddress(),n=Math.min(t.length,e.length),r=0;r<=n-1;r++)if(t[r]!=e[r]){if(r<n)return t[r]<e[r]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;break}return t.length<e.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(e,t){var n=this.$,r,i;t||(n=n.parentNode),typeof e=="function"?(i=!0,r=e):(i=!1,r=function(t){return t=typeof t.nodeName=="string"?t.nodeName.toLowerCase():"",typeof e=="string"?t==e:t in e});for(;n;){if(r(i?new CKEDITOR.dom.node(n):n))return new CKEDITOR.dom.node(n);try{n=n.parentNode}catch(s){n=null}}return null},hasAscendant:function(e,t){var n=this.$;t||(n=n.parentNode);for(;n;){if(n.nodeName&&n.nodeName.toLowerCase()==e)return!0;n=n.parentNode}return!1},move:function(e,t){e.append(this.remove(),t)},remove:function(e){var t=this.$,n=t.parentNode;if(n){if(e)for(;e=t.firstChild;)n.insertBefore(t.removeChild(e),t);n.removeChild(t)}return this},replace:function(e){this.insertBefore(e),e.remove()},trim:function(){this.ltrim(),this.rtrim()},ltrim:function(){for(var e;this.getFirst&&(e=this.getFirst());){if(e.type==CKEDITOR.NODE_TEXT){var t=CKEDITOR.tools.ltrim(e.getText()),n=e.getLength();if(!t){e.remove();continue}t.length<n&&(e.split(n-t.length),this.$.removeChild(this.$.firstChild))}break}},rtrim:function(){for(var e;this.getLast&&(e=this.getLast());){if(e.type==CKEDITOR.NODE_TEXT){var t=CKEDITOR.tools.rtrim(e.getText()),n=e.getLength();if(!t){e.remove();continue}t.length<n&&(e.split(t.length),this.$.lastChild.parentNode.removeChild(this.$.lastChild))}break}CKEDITOR.env.needsBrFiller&&(e=this.$.lastChild)&&e.type==1&&e.nodeName.toLowerCase()=="br"&&e.parentNode.removeChild(e)},isReadOnly:function(){var e=this;this.type!=CKEDITOR.NODE_ELEMENT&&(e=this.getParent());if(e&&typeof e.$.isContentEditable!="undefined")return!e.$.isContentEditable&&!e.data("cke-editable");for(;e;){if(e.data("cke-editable"))break;if(e.getAttribute("contentEditable")=="false")return!0;if(e.getAttribute("contentEditable")=="true")break;e=e.getParent()}return!e}}),CKEDITOR.dom.window=function(e){CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var e=this.$.document,t=e.compatMode=="CSS1Compat";return{width:(t?e.documentElement.clientWidth:e.body.clientWidth)||0,height:(t?e.documentElement.clientHeight:e.body.clientHeight)||0}},getScrollPosition:function(){var e=this.$;return"pageXOffset"in e?{x:e.pageXOffset||0,y:e.pageYOffset||0}:(e=e.document,{x:e.documentElement.scrollLeft||e.body.scrollLeft||0,y:e.documentElement.scrollTop||e.body.scrollTop||0})},getFrame:function(){var e=this.$.frameElement;return e?new CKEDITOR.dom.element.get(e):null}}),CKEDITOR.dom.document=function(e){CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(e){if(this.$.createStyleSheet)this.$.createStyleSheet(e);else{var t=new CKEDITOR.dom.element("link");t.setAttributes({rel:"stylesheet",type:"text/css",href:e}),this.getHead().append(t)}},appendStyleText:function(e){if(this.$.createStyleSheet){var t=this.$.createStyleSheet("");t.cssText=e}else{var n=new CKEDITOR.dom.element("style",this);n.append(new CKEDITOR.dom.text(e,this)),this.getHead().append(n)}return t||n.$.sheet},createElement:function(e,t){var n=new CKEDITOR.dom.element(e,this);return t&&(t.attributes&&n.setAttributes(t.attributes),t.styles&&n.setStyles(t.styles)),n},createText:function(e){return new CKEDITOR.dom.text(e,this)},focus:function(){this.getWindow().focus()},getActive:function(){var e;try{e=this.$.activeElement}catch(t){return null}return new CKEDITOR.dom.element(e)},getById:function(e){return(e=this.$.getElementById(e))?new CKEDITOR.dom.element(e):null},getByAddress:function(e,t){for(var n=this.$.documentElement,r=0;n&&r<e.length;r++){var i=e[r];if(t)for(var s=-1,o=0;o<n.childNodes.length;o++){var u=n.childNodes[o];if(t!==!0||u.nodeType!=3||!u.previousSibling||u.previousSibling.nodeType!=3){s++;if(s==i){n=u;break}}}else n=n.childNodes[i]}return n?new CKEDITOR.dom.node(n):null},getElementsByTag:function(e,t){return!(CKEDITOR.env.ie&&document.documentMode<=8)&&t&&(e=t+":"+e),new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(e))},getHead:function(){var e=this.$.getElementsByTagName("head")[0];return e=e?new CKEDITOR.dom.element(e):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},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(e){this.$.open("text/html","replace"),CKEDITOR.env.ie&&(e=e.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$&\n<script data-cke-temp="1">('+CKEDITOR.tools.fixDomain+")();</script>")),this.$.write(e),this.$.close()},find:function(e){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e))},findOne:function(e){return(e=this.$.querySelector(e))?new CKEDITOR.dom.element(e):null},_getHtml5ShivFrag:function(){var e=this.getCustomData("html5ShivFrag");return e||(e=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(e,!0),this.setCustomData("html5ShivFrag",e)),e}}),CKEDITOR.dom.nodeList=function(e){this.$=e},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(e){return e<0||e>=this.$.length?null:(e=this.$[e])?new CKEDITOR.dom.node(e):null}},CKEDITOR.dom.element=function(e,t){typeof e=="string"&&(e=(t?t.$:document).createElement(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.element.get=function(e){return(e=typeof e=="string"?document.getElementById(e)||document.getElementsByName(e)[0]:e)&&(e.$?e:new CKEDITOR.dom.element(e))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(e,t){var n=new CKEDITOR.dom.element("div",t);return n.setHtml(e),n.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(e,t,n,r){var i=t.getCustomData("list_marker_id")||t.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),s=t.getCustomData("list_marker_names")||t.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");return e[i]=t,s[n]=1,t.setCustomData(n,r)},CKEDITOR.dom.element.clearAllMarkers=function(e){for(var t in e)CKEDITOR.dom.element.clearMarkers(e,e[t],1)},CKEDITOR.dom.element.clearMarkers=function(e,t,n){var r=t.getCustomData("list_marker_names"),i=t.getCustomData("list_marker_id"),s;for(s in r)t.removeCustomData(s);t.removeCustomData("list_marker_names"),n&&(t.removeCustomData("list_marker_id"),delete e[i])},function(){function e(e){var t=!0;return e.$.id||(e.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),t=!1),function(){t||e.removeAttribute("id")}}function t(e,t){return"#"+e.$.id+" "+t.split(/,\s*/).join(", #"+e.$.id+" ")}function n(e){for(var t=0,n=0,i=r[e].length;n<i;n++)t+=parseInt(this.getComputedStyle(r[e][n])||0,10)||0;return t}CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:function(e){var t=this.$.className;return t&&(RegExp("(?:^|\\s)"+e+"(?:\\s|$)","").test(t)||(t+=" "+e)),this.$.className=t||e,this},removeClass:function(e){var t=this.getAttribute("class");return t&&(e=RegExp("(?:^|\\s+)"+e+"(?=\\s|$)","i"),e.test(t)&&((t=t.replace(e,"").replace(/^\s+/,""))?this.setAttribute("class",t):this.removeAttribute("class"))),this},hasClass:function(e){return RegExp("(?:^|\\s+)"+e+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(e,t){return typeof e=="string"&&(e=this.getDocument().createElement(e)),t?this.$.insertBefore(e.$,this.$.firstChild):this.$.appendChild(e.$),e},appendHtml:function(e){if(this.$.childNodes.length){var t=new CKEDITOR.dom.element("div",this.getDocument());t.setHtml(e),t.moveChildren(this)}else this.setHtml(e)},appendText:function(e){this.$.text!=null?this.$.text=this.$.text+e:this.append(new CKEDITOR.dom.text(e))},appendBogus:function(e){if(e||CKEDITOR.env.needsBrFiller){for(e=this.getLast();e&&e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(e.getText());)e=e.getPrevious();if(!e||!e.is||!e.is("br"))e=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&e.setAttribute("type","_moz"),this.append(e)}},breakParent:function(e){var t=new CKEDITOR.dom.range(this.getDocument());t.setStartAfter(this),t.setEndAfter(e),e=t.extractContents(),t.insertNode(this.remove()),e.insertAfterNode(this)},contains:CKEDITOR.env.ie||CKEDITOR.env.webkit?function(e){var t=this.$;return e.type!=CKEDITOR.NODE_ELEMENT?t.contains(e.getParent().$):t!=e.$&&t.contains(e.$)}:function(e){return!!(this.$.compareDocumentPosition(e.$)&16)},focus:function(){function e(){try{this.$.focus()}catch(e){}}return function(t){t?CKEDITOR.tools.setTimeout(e,100,this):e.call(this)}}(),getHtml:function(){var e=this.$.innerHTML;return CKEDITOR.env.ie?e.replace(/<\?[^>]*>/g,""):e},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var e=this.$.ownerDocument.createElement("div");return e.appendChild(this.$.cloneNode(!0)),e.innerHTML},getClientRect:function(){var e=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());return!e.width&&(e.width=e.right-e.left),!e.height&&(e.height=e.bottom-e.top),e},setHtml:CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(e){try{var t=this.$;if(this.getParent())return t.innerHTML=e;var n=this.getDocument()._getHtml5ShivFrag();return n.appendChild(t),t.innerHTML=e,n.removeChild(t),e}catch(r){this.$.innerHTML="",t=new CKEDITOR.dom.element("body",this.getDocument()),t.$.innerHTML=e;for(t=t.getChildren();t.count();)this.append(t.getItem(0));return e}}:function(e){return this.$.innerHTML=e},setText:function(){var e=document.createElement("p");return e.innerHTML="x",e=e.textContent,function(t){this.$[e?"textContent":"innerText"]=t}}(),getAttribute:function(){var e=function(e){return this.$.getAttribute(e,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(e){switch(e){case"class":e="className";break;case"http-equiv":e="httpEquiv";break;case"name":return this.$.name;case"tabindex":return e=this.$.getAttribute(e,2),e!==0&&this.$.tabIndex===0&&(e=null),e;case"checked":return e=this.$.attributes.getNamedItem(e),(e.specified?e.nodeValue:this.$.checked)?"checked":null;case"hspace":case"value":return this.$[e];case"style":return this.$.style.cssText;case"contenteditable":case"contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(e,2)}:e}(),getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:CKEDITOR.env.ie?function(e){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(e)]}:function(e){var t=this.getWindow().$.getComputedStyle(this.$,null);return t?t.getPropertyValue(e):""},getDtd:function(){var e=CKEDITOR.dtd[this.getName()];return this.getDtd=function(){return e},e},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:CKEDITOR.env.ie?function(){var e=this.$.tabIndex;return e===0&&!CKEDITOR.dtd.$tabIndex[this.getName()]&&parseInt(this.getAttribute("tabindex"),10)!==0&&(e=-1),e}:CKEDITOR.env.webkit?function(){var e=this.$.tabIndex;return e===void 0&&(e=parseInt(this.getAttribute("tabindex"),10),isNaN(e)&&(e=-1)),e}: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 e=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&document.documentMode<=8){var t=this.$.scopeName;t!="HTML"&&(e=t.toLowerCase()+":"+e)}return this.getName=function(){return e},this.getName()},getValue:function(){return this.$.value},getFirst:function(e){var t=this.$.firstChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getNext(e)),t},getLast:function(e){var t=this.$.lastChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getPrevious(e)),t},getStyle:function(e){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(e)]},is:function(){var e=this.getName();if(typeof arguments[0]=="object")return!!arguments[0][e];for(var t=0;t<arguments.length;t++)if(arguments[t]==e)return!0;return!1},isEditable:function(e){var t=this.getName();return this.isReadOnly()||this.getComputedStyle("display")=="none"||this.getComputedStyle("visibility")=="hidden"||CKEDITOR.dtd.$nonEditable[t]||CKEDITOR.dtd.$empty[t]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount()?!1:e!==!1?(e=CKEDITOR.dtd[t]||CKEDITOR.dtd.span,!!e&&!!e["#"]):!0},isIdentical:function(e){var t=this.clone(0,1),e=e.clone(0,1);t.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]),e.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(t.$.isEqualNode)return t.$.style.cssText=CKEDITOR.tools.normalizeCssText(t.$.style.cssText),e.$.style.cssText=CKEDITOR.tools.normalizeCssText(e.$.style.cssText),t.$.isEqualNode(e.$);t=t.getOuterHtml(),e=e.getOuterHtml();if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&this.is("a")){var n=this.getParent();n.type==CKEDITOR.NODE_ELEMENT&&(n=n.clone(),n.setHtml(t),t=n.getHtml(),n.setHtml(e),e=n.getHtml())}return t==e},isVisible:function(){var e=(this.$.offsetHeight||this.$.offsetWidth)&&this.getComputedStyle("visibility")!="hidden",t,n;return e&&CKEDITOR.env.webkit&&(t=this.getWindow(),!t.equals(CKEDITOR.document.getWindow())&&(n=t.$.frameElement)&&(e=(new CKEDITOR.dom.element(n)).isVisible())),!!e},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;for(var e=this.getChildren(),t=0,n=e.count();t<n;t++){var r=e.getItem(t);if((r.type!=CKEDITOR.NODE_ELEMENT||!r.data("cke-bookmark"))&&(r.type==CKEDITOR.NODE_ELEMENT&&!r.isEmptyInlineRemoveable()||r.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(r.getText())))return!1}return!0},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var e=this.$.attributes,t=0;t<e.length;t++){var n=e[t];switch(n.nodeName){case"class":if(this.getAttribute("class"))return!0;case"data-cke-expando":continue;default:if(n.specified)return!0}}return!1}:function(){var e=this.$.attributes,t=e.length,n={"data-cke-expando":1,_moz_dirty:1};return t>0&&(t>2||!n[e[0].nodeName]||t==2&&!n[e[1].nodeName])},hasAttribute:function(){function e(e){var t=this.$.attributes.getNamedItem(e);if(this.getName()=="input")switch(e){case"class":return this.$.className.length>0;case"checked":return!!this.$.checked;case"value":return e=this.getAttribute("type"),e=="checkbox"||e=="radio"?this.$.value!="on":!!this.$.value}return t?t.specified:!1}return CKEDITOR.env.ie?CKEDITOR.env.version<8?function(t){return t=="name"?!!this.$.name:e.call(this,t)}:e:function(e){return!!this.$.attributes.getNamedItem(e)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(e,t){var n=this.$,e=e.$;if(n!=e){var r;if(t)for(;r=n.lastChild;)e.insertBefore(n.removeChild(r),e.firstChild);else for(;r=n.firstChild;)e.appendChild(n.removeChild(r))}},mergeSiblings:function(){function e(e,t,n){if(t&&t.type==CKEDITOR.NODE_ELEMENT){for(var r=[];t.data("cke-bookmark")||t.isEmptyInlineRemoveable();){r.push(t),t=n?t.getNext():t.getPrevious();if(!t||t.type!=CKEDITOR.NODE_ELEMENT)return}if(e.isIdentical(t)){for(var i=n?e.getLast():e.getFirst();r.length;)r.shift().move(e,!n);t.moveChildren(e,!n),t.remove(),i&&i.type==CKEDITOR.NODE_ELEMENT&&i.mergeSiblings()}}}return function(t){if(t===!1||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))e(this,this.getNext(),!0),e(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var e=function(e,t){return this.$.setAttribute(e,t),this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(t,n){return t=="class"?this.$.className=n:t=="style"?this.$.style.cssText=n:t=="tabindex"?this.$.tabIndex=n:t=="checked"?this.$.checked=n:t=="contenteditable"?e.call(this,"contentEditable",n):e.apply(this,arguments),this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(t,n){if(t=="src"&&n.match(/^http:\/\//))try{e.apply(this,arguments)}catch(r){}else e.apply(this,arguments);return this}:e}(),setAttributes:function(e){for(var t in e)this.setAttribute(t,e[t]);return this},setValue:function(e){return this.$.value=e,this},removeAttribute:function(){var e=function(e){this.$.removeAttribute(e)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(e){e=="class"?e="className":e=="tabindex"?e="tabIndex":e=="contenteditable"&&(e="contentEditable"),this.$.removeAttribute(e)}:e}(),removeAttributes:function(e){if(CKEDITOR.tools.isArray(e))for(var t=0;t<e.length;t++)this.removeAttribute(e[t]);else for(t in e)e.hasOwnProperty(t)&&this.removeAttribute(t)},removeStyle:function(e){var t=this.$.style;if(!!t.removeProperty||e!="border"&&e!="margin"&&e!="padding")t.removeProperty?t.removeProperty(e):t.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(e)),this.$.style.cssText||this.removeAttribute("style");else{var n=["top","left","right","bottom"],r;e=="border"&&(r=["color","style","width"]);for(var t=[],i=0;i<n.length;i++)if(r)for(var s=0;s<r.length;s++)t.push([e,n[i],r[s]].join("-"));else t.push([e,n[i]].join("-"));for(e=0;e<t.length;e++)this.removeStyle(t[e])}},setStyle:function(e,t){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(e)]=t,this},setStyles:function(e){for(var t in e)this.setStyle(t,e[t]);return this},setOpacity:function(e){CKEDITOR.env.ie&&CKEDITOR.env.version<9?(e=Math.round(e*100),this.setStyle("filter",e>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+e+")")):this.setStyle("opacity",e)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var e,t=this.getElementsByTag("*"),n=0,r=t.count();n<r;n++)e=t.getItem(n),e.setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var e=this;e.getName()!="html";){if(e.getComputedStyle("position")!="static")return e;e=e.getParent()}return null},getDocumentPosition:function(e){var t=0,n=0,r=this.getDocument(),i=r.getBody(),s=CKEDITOR.env.quirks;if(document.documentElement.getBoundingClientRect){var o=this.$.getBoundingClientRect(),u=r.$.documentElement,a=u.clientTop||i.$.clientTop||0,f=u.clientLeft||i.$.clientLeft||0,l=!0;CKEDITOR.env.ie&&(l=r.getDocumentElement().contains(this),r=r.getBody().contains(this),l=s&&r||!s&&l),l&&(CKEDITOR.env.webkit?(t=i.$.scrollLeft||u.scrollLeft,n=i.$.scrollTop||u.scrollTop):(n=s?i.$:u,t=n.scrollLeft,n=n.scrollTop),t=o.left+t-f,n=o.top+n-a)}else{a=this;for(f=null;a&&a.getName()!="body"&&a.getName()!="html";){t+=a.$.offsetLeft-a.$.scrollLeft,n+=a.$.offsetTop-a.$.scrollTop,a.equals(this)||(t+=a.$.clientLeft||0,n+=a.$.clientTop||0);for(;f&&!f.equals(a);)t-=f.$.scrollLeft,n-=f.$.scrollTop,f=f.getParent();f=a,a=(o=a.$.offsetParent)?new CKEDITOR.dom.element(o):null}}return e&&(o=this.getWindow(),a=e.getWindow(),!o.equals(a)&&o.$.frameElement&&(e=(new CKEDITOR.dom.element(o.$.frameElement)).getDocumentPosition(e),t+=e.x,n+=e.y)),!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!s&&(t+=this.$.clientLeft?1:0,n+=this.$.clientTop?1:0),{x:t,y:n}},scrollIntoView:function(e){var t=this.getParent();if(t)do{(t.$.clientWidth&&t.$.clientWidth<t.$.scrollWidth||t.$.clientHeight&&t.$.clientHeight<t.$.scrollHeight)&&!t.is("body")&&this.scrollIntoParent(t,e,1);if(t.is("html")){var n=t.getWindow();try{var r=n.$.frameElement;r&&(t=new CKEDITOR.dom.element(r))}catch(i){}}}while(t=t.getParent())},scrollIntoParent:function(e,t,n){function u(t,n){/body|html/.test(e.getName())?e.getWindow().$.scrollBy(t,n):(e.$.scrollLeft=e.$.scrollLeft+t,e.$.scrollTop=e.$.scrollTop+n)}function a(e,t){var n={x:0,y:0};if(!e.is(l?"body":"html")){var r=e.$.getBoundingClientRect();n.x=r.left,n.y=r.top}return r=e.getWindow(),r.equals(t)||(r=a(CKEDITOR.dom.element.get(r.$.frameElement),t),n.x=n.x+r.x,n.y=n.y+r.y),n}function f(e,t){return parseInt(e.getComputedStyle("margin-"+t)||0,10)||0}var r,i,s,o;!e&&(e=this.getWindow()),s=e.getDocument();var l=s.$.compatMode=="BackCompat";e instanceof CKEDITOR.dom.window&&(e=l?s.getBody():s.getDocumentElement()),s=e.getWindow(),i=a(this,s);var c=a(e,s),h=this.$.offsetHeight;r=this.$.offsetWidth;var p=e.$.clientHeight,d=e.$.clientWidth;s=i.x-f(this,"left")-c.x||0,o=i.y-f(this,"top")-c.y||0,r=i.x+r+f(this,"right")-(c.x+d)||0,i=i.y+h+f(this,"bottom")-(c.y+p)||0,(o<0||i>0)&&u(0,t===!0?o:t===!1?i:o<0?o:i),n&&(s<0||r>0)&&u(s<0?s:r,0)},setState:function(e,t,n){t=t||"cke";switch(e){case CKEDITOR.TRISTATE_ON:this.addClass(t+"_on"),this.removeClass(t+"_off"),this.removeClass(t+"_disabled"),n&&this.setAttribute("aria-pressed",!0),n&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(t+"_disabled"),this.removeClass(t+"_off"),this.removeClass(t+"_on"),n&&this.setAttribute("aria-disabled",!0),n&&this.removeAttribute("aria-pressed");break;default:this.addClass(t+"_off"),this.removeClass(t+"_on"),this.removeClass(t+"_disabled"),n&&this.removeAttribute("aria-pressed"),n&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var e=this.$;try{e.contentWindow.document}catch(t){e.src=e.src}return e&&new CKEDITOR.dom.document(e.contentWindow.document)},copyAttributes:function(e,t){for(var n=this.$.attributes,t=t||{},r=0;r<n.length;r++){var i=n[r],s=i.nodeName.toLowerCase(),o;if(!(s in t))if(s=="checked"&&(o=this.getAttribute(s)))e.setAttribute(s,o);else if(!CKEDITOR.env.ie||this.hasAttribute(s))o=this.getAttribute(s),o===null&&(o=i.nodeValue),e.setAttribute(s,o)}this.$.style.cssText!==""&&(e.$.style.cssText=this.$.style.cssText)},renameNode:function(e){if(this.getName()!=e){var t=this.getDocument(),e=new CKEDITOR.dom.element(e,t);this.copyAttributes(e),this.moveChildren(e),this.getParent()&&this.$.parentNode.replaceChild(e.$,this.$),e.$["data-cke-expando"]=this.$["data-cke-expando"],this.$=e.$,delete this.getName}},getChild:function(){function e(e,t){var n=e.childNodes;if(t>=0&&t<n.length)return n[t]}return function(t){var n=this.$;if(t.slice)for(;t.length>0&&n;)n=e(n,t.shift());else n=e(n,t);return n?new CKEDITOR.dom.node(n):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(e){e.data.getTarget().hasClass("cke_enable_context_menu")||e.data.preventDefault()})},getDirection:function(e){return e?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(e,t){return e="data-"+e,t===void 0?this.getAttribute(e):(t===!1?this.removeAttribute(e):this.setAttribute(e,t),null)},getEditor:function(){var e=CKEDITOR.instances,t,n;for(t in e){n=e[t];if(n.element.equals(this)&&n.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return n}return null},find:function(n){var r=e(this),n=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(t(this,n)));return r(),n},findOne:function(n){var r=e(this),n=this.$.querySelector(t(this,n));return r(),n?new CKEDITOR.dom.element(n):null},forEach:function(e,t,n){if(!n&&(!t||this.type==t))var r=e(this);if(r!==!1)for(var n=this.getChildren(),i=0;i<n.count();i++)r=n.getItem(i),r.type==CKEDITOR.NODE_ELEMENT?r.forEach(e,t):(!t||r.type==t)&&e(r)}});var r={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(e,t,r){typeof t=="number"&&(r&&(!CKEDITOR.env.ie||!CKEDITOR.env.quirks)&&(t-=n.call(this,e)),this.setStyle(e,t+"px"))},CKEDITOR.dom.element.prototype.getSize=function(e,t){var r=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(e)],this.$["client"+CKEDITOR.tools.capitalize(e)])||0;return t&&(r-=n.call(this,e)),r}}(),CKEDITOR.dom.documentFragment=function(e){e=e||CKEDITOR.document,this.$=e.type==CKEDITOR.NODE_DOCUMENT?e.$.createDocumentFragment():e},CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(e){e=e.$,e.parentNode.insertBefore(this.$,e.nextSibling)}},!0,{append:1,appendBogus:1,getFirst: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}),function(){function e(e,t){var n=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(n.collapsed)return this.end(),null;n.optimize()}var r,i=n.startContainer;r=n.endContainer;var s=n.startOffset,o=n.endOffset,u,a=this.guard,f=this.type,l=e?"getPreviousSourceNode":"getNextSourceNode";if(!e&&!this._.guardLTR){var c=r.type==CKEDITOR.NODE_ELEMENT?r:r.getParent(),h=r.type==CKEDITOR.NODE_ELEMENT?r.getChild(o):r.getNext();this._.guardLTR=function(e,t){return(!t||!c.equals(e))&&(!h||!e.equals(h))&&(e.type!=CKEDITOR.NODE_ELEMENT||!t||!e.equals(n.root))}}if(e&&!this._.guardRTL){var p=i.type==CKEDITOR.NODE_ELEMENT?i:i.getParent(),d=i.type==CKEDITOR.NODE_ELEMENT?s?i.getChild(s-1):null:i.getPrevious();this._.guardRTL=function(e,t){return(!t||!p.equals(e))&&(!d||!e.equals(d))&&(e.type!=CKEDITOR.NODE_ELEMENT||!t||!e.equals(n.root))}}var v=e?this._.guardRTL:this._.guardLTR;u=a?function(e,t){return v(e,t)===!1?!1:a(e,t)}:v,this.current?r=this.current[l](!1,f,u):(e?r.type==CKEDITOR.NODE_ELEMENT&&(r=o>0?r.getChild(o-1):u(r,!0)===!1?null:r.getPreviousSourceNode(!0,f,u)):(r=i,r.type==CKEDITOR.NODE_ELEMENT&&!(r=r.getChild(s))&&(r=u(i,!0)===!1?null:i.getNextSourceNode(!0,f,u))),r&&u(r)===!1&&(r=null));for(;r&&!this._.end;){this.current=r;if(!this.evaluator||this.evaluator(r)!==!1){if(!t)return r}else if(t&&this.evaluator)return!1;r=r[l](!1,f,u)}return this.end(),this.current=null}function t(t){for(var n,r=null;n=e.call(this,t);)r=n;return r}function n(e){if(f(e))return!1;if(e.type==CKEDITOR.NODE_TEXT)return!0;if(e.type==CKEDITOR.NODE_ELEMENT){if(e.is(CKEDITOR.dtd.$inline)||e.is("hr")||e.getAttribute("contenteditable")=="false")return!0;var t;if(t=!CKEDITOR.env.needsBrFiller)if(t=e.is(l))e:{t=0;for(var n=e.getChildCount();t<n;++t)if(!f(e.getChild(t))){t=!1;break e}t=!0}if(t)return!0}return!1}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(e){this.range=e,this._={}},proto:{end:function(){this._.end=1},next:function(){return e.call(this)},previous:function(){return e.call(this,1)},checkForward:function(){return e.call(this,0,1)!==!1},checkBackward:function(){return e.call(this,1,1)!==!1},lastForward:function(){return t.call(this)},lastBackward:function(){return t.call(this,1)},reset:function(){delete this.current,this._={}}}});var r={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},i={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(e){return this.getComputedStyle("float")!="none"||this.getComputedStyle("position")in i||!r[this.getComputedStyle("display")]?!!(this.is(CKEDITOR.dtd.$block)||e&&this.is(e)):!0},CKEDITOR.dom.walker.blockBoundary=function(e){return function(t){return t.type!=CKEDITOR.NODE_ELEMENT||!t.isBlockBoundary(e)}},CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})},CKEDITOR.dom.walker.bookmark=function(e,t){function n(e){return e&&e.getName&&e.getName()=="span"&&e.data("cke-bookmark")}return function(r){var i,s;return i=r&&r.type!=CKEDITOR.NODE_ELEMENT&&(s=r.getParent())&&n(s),i=e?i:i||n(r),!!(t^i)}},CKEDITOR.dom.walker.whitespaces=function(e){return function(t){var n;return t&&t.type==CKEDITOR.NODE_TEXT&&(n=!CKEDITOR.tools.trim(t.getText())||CKEDITOR.env.webkit&&t.getText()=="​"),!!(e^n)}},CKEDITOR.dom.walker.invisible=function(e){var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.env.webkit?1:0;return function(r){return t(r)?r=1:(r.type==CKEDITOR.NODE_TEXT&&(r=r.getParent()),r=r.$.offsetWidth<=n),!!(e^r)}},CKEDITOR.dom.walker.nodeType=function(e,t){return function(n){return!!(t^n.type==e)}},CKEDITOR.dom.walker.bogus=function(e){function t(e){return!o(e)&&!u(e)}return function(n){var r=CKEDITOR.env.needsBrFiller?n.is&&n.is("br"):n.getText&&s.test(n.getText());return r&&(r=n.getParent(),n=n.getNext(t),r=r.isBlockBoundary()&&(!n||n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary())),!!(e^r)}},CKEDITOR.dom.walker.temp=function(e){return function(t){return t.type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent()),t=t&&t.hasAttribute("data-cke-temp"),!!(e^t)}};var s=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,o=CKEDITOR.dom.walker.whitespaces(),u=CKEDITOR.dom.walker.bookmark(),a=CKEDITOR.dom.walker.temp();CKEDITOR.dom.walker.ignored=function(e){return function(t){return t=o(t)||u(t)||a(t),!!(e^t)}};var f=CKEDITOR.dom.walker.ignored(),l=function(e){var t={},n;for(n in e)CKEDITOR.dtd[n]["#"]&&(t[n]=1);return t}(CKEDITOR.dtd.$block);CKEDITOR.dom.walker.editable=function(e){return function(t){return!!(e^n(t))}},CKEDITOR.dom.element.prototype.getBogus=function(){var e=this;do e=e.getPreviousSourceNode();while(u(e)||o(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$inline)&&!e.is(CKEDITOR.dtd.$empty));return e&&(CKEDITOR.env.needsBrFiller?e.is&&e.is("br"):e.getText&&s.test(e.getText()))?e:!1}}(),CKEDITOR.dom.range=function(e){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null,this.collapsed=!0;var t=e instanceof CKEDITOR.dom.document;this.document=t?e:e.getDocument(),this.root=t?e.getBody():e},function(){function e(){var e=!1,t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(!0),r=CKEDITOR.dom.walker.bogus();return function(i){return n(i)||t(i)?!0:r(i)&&!e?e=!0:i.type==CKEDITOR.NODE_TEXT&&(i.hasAscendant("pre")||CKEDITOR.tools.trim(i.getText()).length)||i.type==CKEDITOR.NODE_ELEMENT&&!i.is(s)?!1:!0}}function t(e){var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(1);return function(r){return n(r)||t(r)?!0:!e&&o(r)||r.type==CKEDITOR.NODE_ELEMENT&&r.is(CKEDITOR.dtd.$removeEmpty)}}function n(e){return function(){var t;return this[e?"getPreviousNode":"getNextNode"](function(e){return!t&&f(e)&&(t=e),a(e)&&(!o(e)||!e.equals(t))})}}var r=function(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer.equals(e.endContainer)&&e.startOffset==e.endOffset},i=function(e,t,n,r){e.optimizeBookmark();var i=e.startContainer,s=e.endContainer,o=e.startOffset,u=e.endOffset,a,f;s.type==CKEDITOR.NODE_TEXT?s=s.split(u):s.getChildCount()>0&&(u>=s.getChildCount()?(s=s.append(e.document.createText("")),f=!0):s=s.getChild(u)),i.type==CKEDITOR.NODE_TEXT?(i.split(o),i.equals(s)&&(s=i.getNext())):o?o>=i.getChildCount()?(i=i.append(e.document.createText("")),a=!0):i=i.getChild(o).getPrevious():(i=i.append(e.document.createText(""),1),a=!0);var o=i.getParents(),u=s.getParents(),l,c,h;for(l=0;l<o.length;l++){c=o[l],h=u[l];if(!c.equals(h))break}for(var p=n,d,v,m,g=l;g<o.length;g++){d=o[g],p&&!d.equals(i)&&(v=p.append(d.clone()));for(d=d.getNext();d;){if(d.equals(u[g])||d.equals(s))break;m=d.getNext(),t==2?p.append(d.clone(!0)):(d.remove(),t==1&&p.append(d)),d=m}p&&(p=v)}p=n;for(n=l;n<u.length;n++){d=u[n],t>0&&!d.equals(s)&&(v=p.append(d.clone()));if(!o[n]||d.$.parentNode!=o[n].$.parentNode)for(d=d.getPrevious();d;){if(d.equals(o[n])||d.equals(i))break;m=d.getPrevious(),t==2?p.$.insertBefore(d.$.cloneNode(!0),p.$.firstChild):(d.remove(),t==1&&p.$.insertBefore(d.$,p.$.firstChild)),d=m}p&&(p=v)}t==2?(c=e.startContainer,c.type==CKEDITOR.NODE_TEXT&&(c.$.data=c.$.data+c.$.nextSibling.data,c.$.parentNode.removeChild(c.$.nextSibling)),e=e.endContainer,e.type==CKEDITOR.NODE_TEXT&&e.$.nextSibling&&(e.$.data=e.$.data+e.$.nextSibling.data,e.$.parentNode.removeChild(e.$.nextSibling))):(c&&h&&(i.$.parentNode!=c.$.parentNode||s.$.parentNode!=h.$.parentNode)&&(t=h.getIndex(),a&&h.$.parentNode==i.$.parentNode&&t--,r&&c.type==CKEDITOR.NODE_ELEMENT?(r=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',e.document),r.insertAfter(c),c.mergeSiblings(!1),e.moveToBookmark({startNode:r})):e.setStart(h.getParent(),t)),e.collapse(!0)),a&&i.remove(),f&&s.$.parentNode&&s.remove()},s={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},o=CKEDITOR.dom.walker.bogus(),u=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,a=CKEDITOR.dom.walker.editable(),f=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var e=new CKEDITOR.dom.range(this.root);return e._setStartContainer(this.startContainer),e.startOffset=this.startOffset,e._setEndContainer(this.endContainer),e.endOffset=this.endOffset,e.collapsed=this.collapsed,e},collapse:function(e){e?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset),this.collapsed=!0},cloneContents:function(){var e=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||i(this,2,e),e},deleteContents:function(e){this.collapsed||i(this,0,null,e)},extractContents:function(e){var t=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||i(this,1,t,e),t},createBookmark:function(e){var t,n,r,i,s=this.collapsed;return t=this.document.createElement("span"),t.data("cke-bookmark",1),t.setStyle("display","none"),t.setHtml("&nbsp;"),e&&(r="cke_bm_"+CKEDITOR.tools.getNextNumber(),t.setAttribute("id",r+(s?"C":"S"))),s||(n=t.clone(),n.setHtml("&nbsp;"),e&&n.setAttribute("id",r+"E"),i=this.clone(),i.collapse(),i.insertNode(n)),i=this.clone(),i.collapse(!0),i.insertNode(t),n?(this.setStartAfter(t),this.setEndBefore(n)):this.moveToPosition(t,CKEDITOR.POSITION_AFTER_END),{startNode:e?r+(s?"C":"S"):t,endNode:e?r+"E":n,serializable:e,collapsed:s}},createBookmark2:function(){function e(e){var n=e.container,r=e.offset,i;i=n;var s=r;i=i.type!=CKEDITOR.NODE_ELEMENT||s===0||s==i.getChildCount()?0:i.getChild(s-1).type==CKEDITOR.NODE_TEXT&&i.getChild(s).type==CKEDITOR.NODE_TEXT,i&&(n=n.getChild(r-1),r=n.getLength()),n.type==CKEDITOR.NODE_ELEMENT&&r>1&&(r=n.getChild(r-1).getIndex(!0)+1);if(n.type==CKEDITOR.NODE_TEXT){i=n;for(s=0;(i=i.getPrevious())&&i.type==CKEDITOR.NODE_TEXT;)s+=i.getLength();i=s,n.getText()?r+=i:(s=n.getPrevious(t),i?(r=i,n=s?s.getNext():n.getParent().getFirst()):(n=n.getParent(),r=s?s.getIndex(!0)+1:0))}e.container=n,e.offset=r}var t=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(t){var n=this.collapsed,r={container:this.startContainer,offset:this.startOffset},i={container:this.endContainer,offset:this.endOffset};return t&&(e(r),n||e(i)),{start:r.container.getAddress(t),end:n?null:i.container.getAddress(t),startOffset:r.offset,endOffset:i.offset,normalized:t,collapsed:n,is2:!0}}}(),moveToBookmark:function(e){if(e.is2){var t=this.document.getByAddress(e.start,e.normalized),n=e.startOffset,r=e.end&&this.document.getByAddress(e.end,e.normalized),e=e.endOffset;this.setStart(t,n),r?this.setEnd(r,e):this.collapse(!0)}else t=(n=e.serializable)?this.document.getById(e.startNode):e.startNode,e=n?this.document.getById(e.endNode):e.endNode,this.setStartBefore(t),t.remove(),e?(this.setEndBefore(e),e.remove()):this.collapse(!0)},getBoundaryNodes:function(){var e=this.startContainer,t=this.endContainer,n=this.startOffset,r=this.endOffset,i;if(e.type==CKEDITOR.NODE_ELEMENT){i=e.getChildCount();if(i>n)e=e.getChild(n);else if(i<1)e=e.getPreviousSourceNode();else{for(e=e.$;e.lastChild;)e=e.lastChild;e=new CKEDITOR.dom.node(e),e=e.getNextSourceNode()||e}}if(t.type==CKEDITOR.NODE_ELEMENT){i=t.getChildCount();if(i>r)t=t.getChild(r).getPreviousSourceNode(!0);else if(i<1)t=t.getPreviousSourceNode();else{for(t=t.$;t.lastChild;)t=t.lastChild;t=new CKEDITOR.dom.node(t)}}return e.getPosition(t)&CKEDITOR.POSITION_FOLLOWING&&(e=t),{startNode:e,endNode:t}},getCommonAncestor:function(e,t){var n=this.startContainer,r=this.endContainer,n=n.equals(r)?e&&n.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?n.getChild(this.startOffset):n:n.getCommonAncestor(r);return t&&!n.is?n.getParent():n},optimize:function(){var e=this.startContainer,t=this.startOffset;e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setStartAfter(e):this.setStartBefore(e)),e=this.endContainer,t=this.endOffset,e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setEndAfter(e):this.setEndBefore(e))},optimizeBookmark:function(){var e=this.startContainer,t=this.endContainer;e.is&&e.is("span")&&e.data("cke-bookmark")&&this.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),t&&t.is&&t.is("span")&&t.data("cke-bookmark")&&this.setEndAt(t,CKEDITOR.POSITION_AFTER_END)},trim:function(e,t){var n=this.startContainer,r=this.startOffset,i=this.collapsed;if((!e||i)&&n&&n.type==CKEDITOR.NODE_TEXT){if(r)if(r>=n.getLength())r=n.getIndex()+1,n=n.getParent();else{var s=n.split(r),r=n.getIndex()+1,n=n.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(s,this.endOffset-this.startOffset):n.equals(this.endContainer)&&(this.endOffset=this.endOffset+1)}else r=n.getIndex(),n=n.getParent();this.setStart(n,r);if(i){this.collapse(!0);return}}n=this.endContainer,r=this.endOffset,!t&&!i&&n&&n.type==CKEDITOR.NODE_TEXT&&(r?(r>=n.getLength()||n.split(r),r=n.getIndex()+1):r=n.getIndex(),n=n.getParent(),this.setEnd(n,r))},enlarge:function(e,t){function n(e){return e&&e.type==CKEDITOR.NODE_ELEMENT&&e.hasAttribute("contenteditable")?null:e}var r=RegExp(/[^\s\ufeff]/);switch(e){case CKEDITOR.ENLARGE_INLINE:var i=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var s=this.getCommonAncestor(),o=this.root,u,a,f,l,c,h=!1,p,d;p=this.startContainer;var v=this.startOffset;p.type==CKEDITOR.NODE_TEXT?(v&&(p=!CKEDITOR.tools.trim(p.substring(0,v)).length&&p,h=!!p),p&&!(l=p.getPrevious())&&(f=p.getParent())):(v&&(l=p.getChild(v-1)||p.getLast()),l||(f=p));for(f=n(f);f||l;){if(f&&!l){!c&&f.equals(s)&&(c=!0);if(i?f.isBlockBoundary():!o.contains(f))break;if(!h||f.getComputedStyle("display")!="inline")h=!1,c?u=f:this.setStartBefore(f);l=f.getPrevious()}for(;l;){p=!1;if(l.type==CKEDITOR.NODE_COMMENT)l=l.getPrevious();else{if(l.type==CKEDITOR.NODE_TEXT)d=l.getText(),r.test(d)&&(l=null),p=/[\s\ufeff]$/.test(d);else if((l.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||t&&l.is("br"))&&!l.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[l.getName()]){d=l.getText();if(r.test(d))l=null;else for(var v=l.$.getElementsByTagName("*"),m=0,g;g=v[m++];)if(!CKEDITOR.dtd.$removeEmpty[g.nodeName.toLowerCase()]){l=null;break}l&&(p=!!d.length)}else l=null;p&&(h?c?u=f:f&&this.setStartBefore(f):h=!0);if(l){p=l.getPrevious();if(!f&&!p){f=l,l=null;break}l=p}else f=null}}f&&(f=n(f.getParent()))}p=this.endContainer,v=this.endOffset,f=l=null,c=h=!1;var y=function(e,t){var n=new CKEDITOR.dom.range(o);n.setStart(e,t),n.setEndAt(o,CKEDITOR.POSITION_BEFORE_END);var n=new CKEDITOR.dom.walker(n),i;for(n.guard=function(e){return e.type!=CKEDITOR.NODE_ELEMENT||!e.isBlockBoundary()};i=n.next();){if(i.type!=CKEDITOR.NODE_TEXT)return!1;d=i!=e?i.getText():i.substring(t);if(r.test(d))return!1}return!0};p.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(p.substring(v)).length?h=!0:(h=!p.getLength(),v==p.getLength()?(l=p.getNext())||(f=p.getParent()):y(p,v)&&(f=p.getParent())):(l=p.getChild(v))||(f=p);for(;f||l;){if(f&&!l){!c&&f.equals(s)&&(c=!0);if(i?f.isBlockBoundary():!o.contains(f))break;if(!h||f.getComputedStyle("display")!="inline")h=!1,c?a=f:f&&this.setEndAfter(f);l=f.getNext()}for(;l;){p=!1;if(l.type==CKEDITOR.NODE_TEXT)d=l.getText(),y(l,0)||(l=null),p=/^[\s\ufeff]/.test(d);else if(l.type==CKEDITOR.NODE_ELEMENT){if((l.$.offsetWidth>0||t&&l.is("br"))&&!l.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[l.getName()]){d=l.getText();if(r.test(d))l=null;else{v=l.$.getElementsByTagName("*");for(m=0;g=v[m++];)if(!CKEDITOR.dtd.$removeEmpty[g.nodeName.toLowerCase()]){l=null;break}}l&&(p=!!d.length)}else l=null}else p=1;p&&h&&(c?a=f:this.setEndAfter(f));if(l){p=l.getNext();if(!f&&!p){f=l,l=null;break}l=p}else f=null}f&&(f=n(f.getParent()))}u&&a&&(s=u.contains(a)?a:u,this.setStartBefore(s),this.setEndAfter(s));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:f=new CKEDITOR.dom.range(this.root),o=this.root,f.setStartAt(o,CKEDITOR.POSITION_AFTER_START),f.setEnd(this.startContainer,this.startOffset),f=new CKEDITOR.dom.walker(f);var b,w,E=CKEDITOR.dom.walker.blockBoundary(e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),S=null,x=function(e){if(e.type==CKEDITOR.NODE_ELEMENT&&e.getAttribute("contenteditable")=="false")if(S){if(S.equals(e)){S=null;return}}else S=e;else if(S)return;var t=E(e);return t||(b=e),t},i=function(e){var t=x(e);return!t&&e.is&&e.is("br")&&(w=e),t};f.guard=x,f=f.lastBackward(),b=b||o,this.setStartAt(b,!b.is("br")&&(!f&&this.checkStartOfBlock()||f&&b.contains(f))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){f=this.clone(),f=new CKEDITOR.dom.walker(f);var T=CKEDITOR.dom.walker.whitespaces(),N=CKEDITOR.dom.walker.bookmark();f.evaluator=function(e){return!T(e)&&!N(e)};if((f=f.previous())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("br"))break}f=this.clone(),f.collapse(),f.setEndAt(o,CKEDITOR.POSITION_BEFORE_END),f=new CKEDITOR.dom.walker(f),f.guard=e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?i:x,b=S=w=null,f=f.lastForward(),b=b||o,this.setEndAt(b,!f&&this.checkEndOfBlock()||f&&b.contains(f)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START),w&&this.setEndAfter(w)}},shrink:function(e,t,n){if(!this.collapsed){var e=e||CKEDITOR.SHRINK_TEXT,r=this.clone(),i=this.startContainer,s=this.endContainer,o=this.startOffset,u=this.endOffset,a=1,f=1;i&&i.type==CKEDITOR.NODE_TEXT&&(o?o>=i.getLength()?r.setStartAfter(i):(r.setStartBefore(i),a=0):r.setStartBefore(i)),s&&s.type==CKEDITOR.NODE_TEXT&&(u?u>=s.getLength()?r.setEndAfter(s):(r.setEndAfter(s),f=0):r.setEndBefore(s));var r=new CKEDITOR.dom.walker(r),l=CKEDITOR.dom.walker.bookmark();r.evaluator=function(t){return t.type==(e==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var c;return r.guard=function(t,r){return l(t)?!0:e==CKEDITOR.SHRINK_ELEMENT&&t.type==CKEDITOR.NODE_TEXT||r&&t.equals(c)||n===!1&&t.type==CKEDITOR.NODE_ELEMENT&&t.isBlockBoundary()||t.type==CKEDITOR.NODE_ELEMENT&&t.hasAttribute("contenteditable")?!1:(!r&&t.type==CKEDITOR.NODE_ELEMENT&&(c=t),!0)},a&&(i=r[e==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(i,t?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START),f&&(r.reset(),(r=r[e==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(r,t?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)),!!a||!!f}},insertNode:function(e){this.optimizeBookmark(),this.trim(!1,!0);var t=this.startContainer,n=t.getChild(this.startOffset);n?e.insertBefore(n):t.append(e),e.getParent()&&e.getParent().equals(this.endContainer)&&this.endOffset++,this.setStartBefore(e)},moveToPosition:function(e,t){this.setStartAt(e,t),this.collapse(!0)},moveToRange:function(e){this.setStart(e.startContainer,e.startOffset),this.setEnd(e.endContainer,e.endOffset)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e.type==CKEDITOR.NODE_TEXT?e.getLength():e.getChildCount())},setStart:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex(),e=e.getParent()),this._setStartContainer(e),this.startOffset=t,this.endContainer||(this._setEndContainer(e),this.endOffset=t),r(this)},setEnd:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex()+1,e=e.getParent()),this._setEndContainer(e),this.endOffset=t,this.startContainer||(this._setStartContainer(e),this.startOffset=t),r(this)},setStartAfter:function(e){this.setStart(e.getParent(),e.getIndex()+1)},setStartBefore:function(e){this.setStart(e.getParent(),e.getIndex())},setEndAfter:function(e){this.setEnd(e.getParent(),e.getIndex()+1)},setEndBefore:function(e){this.setEnd(e.getParent(),e.getIndex())},setStartAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setStart(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setStart(e,e.getLength()):this.setStart(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(e)}r(this)},setEndAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setEnd(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setEnd(e,e.getLength()):this.setEnd(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(e)}r(this)},fixBlock:function(e,t){var n=this.createBookmark(),r=this.document.createElement(t);return this.collapse(e),this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),this.extractContents().appendTo(r),r.trim(),r.appendBogus(),this.insertNode(r),this.moveToBookmark(n),r},splitBlock:function(e){var t=new CKEDITOR.dom.elementPath(this.startContainer,this.root),n=new CKEDITOR.dom.elementPath(this.endContainer,this.root),r=t.block,i=n.block,s=null;return t.blockLimit.equals(n.blockLimit)?(e!="br"&&(r||(r=this.fixBlock(!0,e),i=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),i||(i=this.fixBlock(!1,e))),e=r&&this.checkStartOfBlock(),t=i&&this.checkEndOfBlock(),this.deleteContents(),r&&r.equals(i)&&(t?(s=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(i,CKEDITOR.POSITION_AFTER_END),i=null):e?(s=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(r,CKEDITOR.POSITION_BEFORE_START),r=null):(i=this.splitElement(r),r.is("ul","ol")||r.appendBogus())),{previousBlock:r,nextBlock:i,wasStartOfBlock:e,wasEndOfBlock:t,elementPath:s}):null},splitElement:function(e){if(!this.collapsed)return null;this.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);var t=this.extractContents(),n=e.clone(!1);return t.appendTo(n),n.insertAfter(e),this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),n},removeEmptyBlocksAtEnd:function(){function e(e){return function(r){return t(r)||n(r)||r.type==CKEDITOR.NODE_ELEMENT&&r.isEmptyInlineRemoveable()||e.is("table")&&r.is("caption")?!1:!0}}var t=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(!1);return function(t){for(var n=this.createBookmark(),r=this[t?"endPath":"startPath"](),i=r.block||r.blockLimit,s;i&&!i.equals(r.root)&&!i.getFirst(e(i));)s=i.getParent(),this[t?"setEndAt":"setStartAt"](i,CKEDITOR.POSITION_AFTER_END),i.remove(1),i=s;this.moveToBookmark(n)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(e,n){var r=n==CKEDITOR.START,i=this.clone();return i.collapse(r),i[r?"setStartAt":"setEndAt"](e,r?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),i=new CKEDITOR.dom.walker(i),i.evaluator=t(r),i[r?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var t=this.startContainer,n=this.startOffset;return CKEDITOR.env.ie&&n&&t.type==CKEDITOR.NODE_TEXT&&(t=CKEDITOR.tools.ltrim(t.substring(0,n)),u.test(t)&&this.trim(0,1)),this.trim(),t=new CKEDITOR.dom.elementPath(this.startContainer,this.root),n=this.clone(),n.collapse(!0),n.setStartAt(t.block||t.blockLimit,CKEDITOR.POSITION_AFTER_START),t=new CKEDITOR.dom.walker(n),t.evaluator=e(),t.checkBackward()},checkEndOfBlock:function(){var t=this.endContainer,n=this.endOffset;return CKEDITOR.env.ie&&t.type==CKEDITOR.NODE_TEXT&&(t=CKEDITOR.tools.rtrim(t.substring(n)),u.test(t)&&this.trim(1,0)),this.trim(),t=new CKEDITOR.dom.elementPath(this.endContainer,this.root),n=this.clone(),n.collapse(!1),n.setEndAt(t.block||t.blockLimit,CKEDITOR.POSITION_BEFORE_END),t=new CKEDITOR.dom.walker(n),t.evaluator=e(),t.checkForward()},getPreviousNode:function(e,t,n){var r=this.clone();return r.collapse(1),r.setStartAt(n||this.root,CKEDITOR.POSITION_AFTER_START),n=new CKEDITOR.dom.walker(r),n.evaluator=e,n.guard=t,n.previous()},getNextNode:function(e,t,n){var r=this.clone();return r.collapse(),r.setEndAt(n||this.root,CKEDITOR.POSITION_BEFORE_END),n=new CKEDITOR.dom.walker(r),n.evaluator=e,n.guard=t,n.next()},checkReadOnly:function(){function e(e,t){for(;e;){if(e.type==CKEDITOR.NODE_ELEMENT){if(e.getAttribute("contentEditable")=="false"&&!e.data("cke-editable"))return 0;if(e.is("html")||e.getAttribute("contentEditable")=="true"&&(e.contains(t)||e.equals(t)))break}e=e.getParent()}return 1}return function(){var t=this.startContainer,n=this.endContainer;return!e(t,n)||!e(n,t)}}(),moveToElementEditablePosition:function(e,t){if(e.type==CKEDITOR.NODE_ELEMENT&&!e.isEditable(!1))return this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var n=0;e;){if(e.type==CKEDITOR.NODE_TEXT){t&&this.endContainer&&this.checkEndOfBlock()&&u.test(e.getText())?this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),n=1;break}if(e.type==CKEDITOR.NODE_ELEMENT)if(e.isEditable())this.moveToPosition(e,t?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),n=1;else if(t&&e.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);else if(e.getAttribute("contenteditable")=="false"&&e.is(CKEDITOR.dtd.$block))return this.setStartBefore(e),this.setEndAfter(e),!0;var r=e,i=n,s=void 0;r.type==CKEDITOR.NODE_ELEMENT&&r.isEditable(!1)&&(s=r[t?"getLast":"getFirst"](f)),!i&&!s&&(s=r[t?"getPrevious":"getNext"](f)),e=s}return!!n},moveToClosestEditablePosition:function(e,t){var n=new CKEDITOR.dom.range(this.root),r=0,i,s=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];n.moveToPosition(e,s[t?0:1]);if(e.is(CKEDITOR.dtd.$block)){if(i=n[t?"getNextEditableNode":"getPreviousEditableNode"]())r=1,i.type==CKEDITOR.NODE_ELEMENT&&i.is(CKEDITOR.dtd.$block)&&i.getAttribute("contenteditable")=="false"?(n.setStartAt(i,CKEDITOR.POSITION_BEFORE_START),n.setEndAt(i,CKEDITOR.POSITION_AFTER_END)):n.moveToPosition(i,s[t?1:0])}else r=1;return r&&this.moveToRange(n),!!r},moveToElementEditStart:function(e){return this.moveToElementEditablePosition(e)},moveToElementEditEnd:function(e){return this.moveToElementEditablePosition(e,!0)},getEnclosedNode:function(){var e=this.clone();e.optimize();if(e.startContainer.type!=CKEDITOR.NODE_ELEMENT||e.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var e=new CKEDITOR.dom.walker(e),t=CKEDITOR.dom.walker.bookmark(!1,!0),n=CKEDITOR.dom.walker.whitespaces(!0);e.evaluator=function(e){return n(e)&&t(e)};var r=e.next();return e.reset(),r&&r.equals(e.previous())?r:null},getTouchedStartNode:function(){var e=this.startContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.startOffset)||e},getTouchedEndNode:function(){var e=this.endContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.endOffset-1)||e},getNextEditableNode:n(),getPreviousEditableNode:n(1),scrollIntoView:function(){var e=new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",this.document),t,n,r,i=this.clone();i.optimize(),(r=i.startContainer.type==CKEDITOR.NODE_TEXT)?(n=i.startContainer.getText(),t=i.startContainer.split(i.startOffset),e.insertAfter(i.startContainer)):i.insertNode(e),e.scrollIntoView(),r&&(i.startContainer.setText(n),t.remove()),e.remove()},_setStartContainer:function(e){this.startContainer=e},_setEndContainer:function(e){this.endContainer=e}}}(),CKEDITOR.POSITION_AFTER_START=1,CKEDITOR.POSITION_BEFORE_END=2,CKEDITOR.POSITION_BEFORE_START=3,CKEDITOR.POSITION_AFTER_END=4,CKEDITOR.ENLARGE_ELEMENT=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 e(e){arguments.length<1||(this.range=e,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function t(e){var t=[];return e.forEach(function(e){if(e.getAttribute("contenteditable")=="true")return t.push(e),!1},CKEDITOR.NODE_ELEMENT,!0),t}function n(e,r,i,s){e:{s==null&&(s=t(i));for(var o;o=s.shift();)if(o.getDtd().p){s={element:o,remaining:s};break e}s=null}return s?(o=CKEDITOR.filter.instances[s.element.data("cke-filter")])&&!o.check(r)?n(e,r,i,s.remaining):(r=new CKEDITOR.dom.range(s.element),r.selectNodeContents(s.element),r=r.createIterator(),r.enlargeBr=e.enlargeBr,r.enforceRealBlocks=e.enforceRealBlocks,r.activeFilter=r.filter=o,e._.nestedEditable={element:s.element,container:i,remaining:s.remaining,iterator:r},1):0}function r(e,t,n){return t?(e=e.clone(),e.collapse(!n),e.checkBoundaryOfElement(t,n?CKEDITOR.START:CKEDITOR.END)):!1}var i=/^[\r\n\t ]+$/,s=CKEDITOR.dom.walker.bookmark(!1,!0),o=CKEDITOR.dom.walker.whitespaces(!0),u=function(e){return s(e)&&o(e)},a={dd:1,dt:1,li:1};e.prototype={getNextParagraph:function(e){var t,o,l,p,v,e=e||"p";if(this._.nestedEditable){if(t=this._.nestedEditable.iterator.getNextParagraph(e))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,t;this.activeFilter=this.filter;if(n(this,e,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(e);this._.nestedEditable=null}if(!this.range.root.getDtd()[e])return null;if(!this._.started){var m=this.range.clone();o=m.startPath();var y=m.endPath(),w=!m.collapsed&&r(m,o.block),E=!m.collapsed&&r(m,y.block,1);m.shrink(CKEDITOR.SHRINK_ELEMENT,!0),w&&m.setStartAt(o.block,CKEDITOR.POSITION_BEFORE_END),E&&m.setEndAt(y.block,CKEDITOR.POSITION_AFTER_START),o=m.endContainer.hasAscendant("pre",!0)||m.startContainer.hasAscendant("pre",!0),m.enlarge(this.forceBrBreak&&!o||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(!m.collapsed){o=new CKEDITOR.dom.walker(m.clone()),y=CKEDITOR.dom.walker.bookmark(!0,!0),o.evaluator=y,this._.nextNode=o.next(),o=new CKEDITOR.dom.walker(m.clone()),o.evaluator=y,o=o.previous(),this._.lastNode=o.getNextSourceNode(!0,null,m.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(y=this.range.clone(),y.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),y.checkEndOfBlock()&&(y=new CKEDITOR.dom.elementPath(y.endContainer,y.root),this._.lastNode=(y.block||y.blockLimit).getNextSourceNode(!0)));if(!this._.lastNode||!m.root.contains(this._.lastNode))this._.lastNode=this._.docEndMarker=m.document.createText(""),this._.lastNode.insertAfter(o);m=null}this._.started=1,o=m}y=this._.nextNode,m=this._.lastNode;for(this._.nextNode=null;y;){var w=0,E=y.hasAscendant("pre"),S=y.type!=CKEDITOR.NODE_ELEMENT,x=0;if(S)y.type==CKEDITOR.NODE_TEXT&&i.test(y.getText())&&(S=0);else{var T=y.getName();if(CKEDITOR.dtd.$block[T]&&y.getAttribute("contenteditable")=="false"){t=y,n(this,e,t);break}if(y.isBlockBoundary(this.forceBrBreak&&!E&&{br:1})){if(T=="br")S=1;else if(!o&&!y.getChildCount()&&T!="hr"){t=y,l=y.equals(m);break}o&&(o.setEndAt(y,CKEDITOR.POSITION_BEFORE_START),T!="br"&&(this._.nextNode=y)),w=1}else{if(y.getFirst()){o||(o=this.range.clone(),o.setStartAt(y,CKEDITOR.POSITION_BEFORE_START)),y=y.getFirst();continue}S=1}}S&&!o&&(o=this.range.clone(),o.setStartAt(y,CKEDITOR.POSITION_BEFORE_START)),l=(!w||S)&&y.equals(m);if(o&&!w)for(;!y.getNext(u)&&!l;){T=y.getParent();if(T.isBlockBoundary(this.forceBrBreak&&!E&&{br:1})){w=1,S=0,l||T.equals(m),o.setEndAt(T,CKEDITOR.POSITION_BEFORE_END);break}y=T,S=1,l=y.equals(m),x=1}S&&o.setEndAt(y,CKEDITOR.POSITION_AFTER_END),y=this._getNextSourceNode(y,x,m);if((l=!y)||w&&o)break}if(!t){if(!o)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;t=new CKEDITOR.dom.elementPath(o.startContainer,o.root),y=t.blockLimit,w={div:1,th:1,td:1},t=t.block;if(!t&&y&&!this.enforceRealBlocks&&w[y.getName()]&&o.checkStartOfBlock()&&o.checkEndOfBlock()&&!y.equals(o.root))t=y;else if(!t||this.enforceRealBlocks&&t.is(a))t=this.range.document.createElement(e),o.extractContents().appendTo(t),t.trim(),o.insertNode(t),p=v=!0;else if(t.getName()!="li"){if(!o.checkStartOfBlock()||!o.checkEndOfBlock())t=t.clone(!1),o.extractContents().appendTo(t),t.trim(),v=o.splitBlock(),p=!v.wasStartOfBlock,v=!v.wasEndOfBlock,o.insertNode(t)}else l||(this._.nextNode=t.equals(m)?null:this._getNextSourceNode(o.getBoundaryNodes().endNode,1,m))}return p&&(p=t.getPrevious())&&p.type==CKEDITOR.NODE_ELEMENT&&(p.getName()=="br"?p.remove():p.getLast()&&p.getLast().$.nodeName.toLowerCase()=="br"&&p.getLast().remove()),v&&(p=t.getLast())&&p.type==CKEDITOR.NODE_ELEMENT&&p.getName()=="br"&&(!CKEDITOR.env.needsBrFiller||p.getPrevious(s)||p.getNext(s))&&p.remove(),this._.nextNode||(this._.nextNode=l||t.equals(m)||!m?null:this._getNextSourceNode(t,1,m)),t},_getNextSourceNode:function(e,t,n){function r(e){return!e.equals(n)&&!e.equals(i)}for(var i=this.range.root,e=e.getNextSourceNode(t,null,r);!s(e);)e=e.getNextSourceNode(t,null,r);return e}},CKEDITOR.dom.range.prototype.createIterator=function(){return new e(this)}}(),CKEDITOR.command=function(e,t){this.uiItems=[],this.exec=function(n){return this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed()?!1:(this.editorFocus&&e.focus(),this.fire("exec")===!1?!0:t.exec.call(this,e,n)!==!1)},this.refresh=function(e,n){return!this.readOnly&&e.readOnly?!0:this.context&&!n.isContextFor(this.context)?(this.disable(),!0):this.checkAllowed(!0)?(this.startDisabled||this.enable(),this.modes&&!this.modes[e.mode]&&this.disable(),this.fire("refresh",{editor:e,path:n})===!1?!0:t.refresh&&t.refresh.apply(this,arguments)!==!1):(this.disable(),!0)};var n;this.checkAllowed=function(t){return!t&&typeof n=="boolean"?n:n=e.activeFilter.checkFeature(this)},CKEDITOR.tools.extend(this,t,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!t.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||typeof this.previousState=="undefined"?CKEDITOR.TRISTATE_OFF:this.previousState)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(e){return this.state==e||e!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed()?!1:(this.previousState=this.state,this.state=e,this.fire("state"),!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,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"<!DOCTYPE html>",bodyId:"",bodyClass:"",fullPage:!1,height:200,extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1e4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function e(e,t,n,r,i){var s,u,e=[];for(s in t){u=t[s],u=typeof u=="boolean"?{}:typeof u=="function"?{match:u}:L(u),s.charAt(0)!="$"&&(u.elements=s),n&&(u.featureName=n.toLowerCase());var a=u;a.elements=o(a.elements,/\s+/)||null,a.propertiesOnly=a.propertiesOnly||a.elements===!0;var f=/\s*,\s*/,l=void 0;for(l in _){a[l]=o(a[l],f)||null;var c=a,h=D[l],p=o(a[D[l]],f),d=a[l],v=[],m=!0,y=void 0;p?m=!1:p={};for(y in d)y.charAt(0)=="!"&&(y=y.slice(1),v.push(y),p[y]=!0,m=!1);for(;y=v.pop();)d[y]=d["!"+y],delete d["!"+y];c[h]=(m?!1:p)||null}a.match=a.match||null,r.push(u),e.push(u)}for(var t=i.elements,i=i.generic,b,n=0,r=e.length;n<r;++n){s=L(e[n]),u=s.classes===!0||s.styles===!0||s.attributes===!0,a=s,l=h=f=void 0;for(f in _)a[f]=g(a[f]);c=!0;for(l in D){f=D[l],h=a[f],p=[],d=void 0;for(d in h)d.indexOf("*")>-1?p.push(RegExp("^"+d.replace(/\*/g,".*")+"$")):p.push(d);h=p,h.length&&(a[f]=h,c=!1)}a.nothingRequired=c,a.noProperties=!(a.attributes||a.classes||a.styles);if(s.elements===!0||s.elements===null)i[u?"unshift":"push"](s);else{a=s.elements,delete s.elements;for(b in a)t[b]?t[b][u?"unshift":"push"](s):t[b]=[s]}}}function t(e,t,r,i){if(!e.match||e.match(t))if(i||u(e,t)){e.propertiesOnly||(r.valid=!0),r.allAttributes||(r.allAttributes=n(e.attributes,t.attributes,r.validAttributes)),r.allStyles||(r.allStyles=n(e.styles,t.styles,r.validStyles));if(!r.allClasses){e=e.classes,t=t.classes,i=r.validClasses;if(e)if(e===!0)e=!0;else{for(var s=0,o=t.length,a;s<o;++s)a=t[s],i[a]||(i[a]=e(a));e=!1}else e=!1;r.allClasses=e}}}function n(e,t,n){if(!e)return!1;if(e===!0)return!0;for(var r in t)n[r]||(n[r]=e(r));return!1}function r(e,t,n){if(!e.match||e.match(t)){if(e.noProperties)return!1;n.hadInvalidAttribute=i(e.attributes,t.attributes)||n.hadInvalidAttribute,n.hadInvalidStyle=i(e.styles,t.styles)||n.hadInvalidStyle,e=e.classes,t=t.classes;if(e){for(var r=!1,s=e===!0,o=t.length;o--;)if(s||e(t[o]))t.splice(o,1),r=!0;e=r}else e=!1;n.hadInvalidClass=e||n.hadInvalidClass}}function i(e,t){if(!e)return!1;var n=!1,r=e===!0,i;for(i in t)if(r||e(i))delete t[i],n=!0;return n}function s(e,t,n){return e.disabled||e.customConfig&&!n||!t?!1:(e._.cachedChecks={},!0)}function o(e,t){if(!e)return!1;if(e===!0)return e;if(typeof e=="string")return e=A(e),e=="*"?!0:CKEDITOR.tools.convertArrayToObject(e.split(t));if(CKEDITOR.tools.isArray(e))return e.length?CKEDITOR.tools.convertArrayToObject(e):!1;var n={},r=0,i;for(i in e)n[i]=e[i],r++;return r?n:!1}function u(e,t){if(e.nothingRequired)return!0;var n,r,i,s;if(i=e.requiredClasses){s=t.classes;for(n=0;n<i.length;++n){r=i[n];if(typeof r=="string"){if(CKEDITOR.tools.indexOf(s,r)==-1)return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(s,r))return!1}}return a(t.styles,e.requiredStyles)&&a(t.attributes,e.requiredAttributes)}function a(e,t){if(!t)return!0;for(var n=0,r;n<t.length;++n){r=t[n];if(typeof r=="string"){if(!(r in e))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(e,r))return!1}return!0}function f(e){if(!e)return{};for(var e=e.split(/\s*,\s*/).sort(),t={};e.length;)t[e.shift()]=O;return t}function l(e){for(var t,n,r,i,s={},o=1,e=A(e);t=e.match(P);)(n=t[2])?(r=c(n,"styles"),i=c(n,"attrs"),n=c(n,"classes")):r=i=n=null,s["$"+o++]={elements:t[1],classes:n,styles:r,attributes:i},e=e.slice(t[0].length);return s}function c(e,t){var n=e.match(H[t]);return n?A(n[1]):null}function h(e){var t=e.styleBackup=e.attributes.style,n=e.classBackup=e.attributes["class"];e.styles||(e.styles=CKEDITOR.tools.parseCssText(t||"",1)),e.classes||(e.classes=n?n.split(/\s+/):[])}function p(e,n,i,s){var o=0,u;s.toHtml&&(n.name=n.name.replace(B,"$1"));if(s.doCallbacks&&e.elementCallbacks){e:for(var a=e.elementCallbacks,f=0,l=a.length,c;f<l;++f)if(c=a[f](n)){u=c;break e}if(u)return u}if(s.doTransform)if(u=e._.transformations[n.name]){h(n);for(a=0;a<u.length;++a)E(e,n,u[a]);v(n)}if(s.doFilter){e:{a=n.name,f=e._,e=f.allowedRules.elements[a],u=f.allowedRules.generic,a=f.disallowedRules.elements[a],f=f.disallowedRules.generic,l=s.skipRequired,c={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1};var p,d;if(!e&&!u)e=null;else{h(n);if(a){p=0;for(d=a.length;p<d;++p)if(r(a[p],n,c)===!1){e=null;break e}}if(f){p=0;for(d=f.length;p<d;++p)r(f[p],n,c)}if(e){p=0;for(d=e.length;p<d;++p)t(e[p],n,c,l)}if(u){p=0;for(d=u.length;p<d;++p)t(u[p],n,c,l)}e=c}}if(!e)return i.push(n),k;if(!e.valid)return i.push(n),k;d=e.validAttributes;var g=e.validStyles;u=e.validClasses;var a=n.attributes,y=n.styles,f=n.classes,l=n.classBackup,b=n.styleBackup,w,S,x=[];c=[];var T=/^data-cke-/;p=!1,delete a.style,delete a["class"],delete n.classBackup,delete n.styleBackup;if(!e.allAttributes)for(w in a)d[w]||(T.test(w)?w!=(S=w.replace(/^data-cke-saved-/,""))&&!d[S]&&(delete a[w],p=!0):(delete a[w],p=!0));if(!e.allStyles||e.hadInvalidStyle){for(w in y)e.allStyles||g[w]?x.push(w+":"+y[w]):p=!0;x.length&&(a.style=x.sort().join("; "))}else b&&(a.style=b);if(!e.allClasses||e.hadInvalidClass){for(w=0;w<f.length;++w)(e.allClasses||u[f[w]])&&c.push(f[w]);c.length&&(a["class"]=c.sort().join(" ")),l&&c.length<l.split(/\s+/).length&&(p=!0)}else l&&(a["class"]=l);p&&(o=k);if(!s.skipFinalValidation&&!m(n))return i.push(n),k}return s.toHtml&&(n.name=n.name.replace(j,"cke:$1")),o}function d(e){var t=[],n;for(n in e)n.indexOf("*")>-1&&t.push(n.replace(/\*/g,".*"));return t.length?RegExp("^(?:"+t.join("|")+")$"):null}function v(e){var t=e.attributes,n;delete t.style,delete t["class"];if(n=CKEDITOR.tools.writeCssText(e.styles,!0))t.style=n;e.classes.length&&(t["class"]=e.classes.sort().join(" "))}function m(e){switch(e.name){case"a":if(!e.children.length&&!e.attributes.name)return!1;break;case"img":if(!e.attributes.src)return!1}return!0}function g(e){if(!e)return!1;if(e===!0)return!0;var t=d(e);return function(n){return n in e||t&&n.match(t)}}function y(){return new CKEDITOR.htmlParser.element("br")}function b(e){return e.type==CKEDITOR.NODE_ELEMENT&&(e.name=="br"||C.$block[e.name])}function w(e,t,n){var r=e.name;if(C.$empty[r]||!e.children.length)r=="hr"&&t=="br"?e.replaceWith(y()):(e.parent&&n.push({check:"it",el:e.parent}),e.remove());else if(C.$block[r]||r=="tr")if(t=="br")e.previous&&!b(e.previous)&&(t=y(),t.insertBefore(e)),e.next&&!b(e.next)&&(t=y(),t.insertAfter(e)),e.replaceWithChildren();else{var r=e.children,i;e:{i=C[t];for(var s=0,o=r.length,u;s<o;++s){u=r[s];if(u.type==CKEDITOR.NODE_ELEMENT&&!i[u.name]){i=!1;break e}}i=!0}if(i)e.name=t,e.attributes={},n.push({check:"parent-down",el:e});else{i=e.parent;for(var s=i.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||i.name=="body",a,f,o=r.length;o>0;)u=r[--o],s&&(u.type==CKEDITOR.NODE_TEXT||u.type==CKEDITOR.NODE_ELEMENT&&C.$inline[u.name])?(a||(a=new CKEDITOR.htmlParser.element(t),a.insertAfter(e),n.push({check:"parent-down",el:a})),a.add(u,0)):(a=null,f=C[i.name]||C.span,u.insertAfter(e),i.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&u.type==CKEDITOR.NODE_ELEMENT&&!f[u.name]&&n.push({check:"el-up",el:u}));e.remove()}}else r=="style"?e.remove():(e.parent&&n.push({check:"it",el:e.parent}),e.replaceWithChildren())}function E(e,t,n){var r,i;for(r=0;r<n.length;++r){i=n[r];if((!i.check||e.check(i.check,!1))&&(!i.left||i.left(t))){i.right(t,F);break}}}function S(e,t){var n=t.getDefinition(),r=n.attributes,i=n.styles,s,o,u,a;if(e.name!=n.element)return!1;for(s in r)if(s=="class"){n=r[s].split(/\s+/);for(u=e.classes.join("|");a=n.pop();)if(u.indexOf(a)==-1)return!1}else if(e.attributes[s]!=r[s])return!1;for(o in i)if(e.styles[o]!=i[o])return!1;return!0}function x(e,t){var n,r;return typeof e=="string"?n=e:e instanceof CKEDITOR.style?r=e:(n=e[0],r=e[1]),[{element:n,left:r,right:function(e,n){n.transform(e,t)}}]}function T(e){return function(t){return S(t,e)}}function N(e){return function(t,n){n[e](t)}}var C=CKEDITOR.dtd,k=1,L=CKEDITOR.tools.copy,A=CKEDITOR.tools.trim,O="cke-test",M=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2,CKEDITOR.filter=function(e){this.allowedContent=[],this.disallowedContent=[],this.elementCallbacks=null,this.disabled=!1,this.editor=null,this.id=CKEDITOR.tools.getNextNumber(),this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}},CKEDITOR.filter.instances[this.id]=this;if(e instanceof CKEDITOR.editor){e=this.editor=e,this.customConfig=!0;var t=e.config.allowedContent;t===!0?this.disabled=!0:(t||(this.customConfig=!1),this.allow(t,"config",1),this.allow(e.config.extraAllowedContent,"extra",1),this.allow(M[e.enterMode]+" "+M[e.shiftEnterMode],"default",1),this.disallow(e.config.disallowedContent))}else this.customConfig=!1,this.allow(e,"default",1)},CKEDITOR.filter.instances={},CKEDITOR.filter.prototype={allow:function(t,n,r){if(!s(this,t,r))return!1;var i,o;if(typeof t=="string")t=l(t);else if(t instanceof CKEDITOR.style){if(t.toAllowedContentRules)return this.allow(t.toAllowedContentRules(this.editor),n,r);i=t.getDefinition(),t={},r=i.attributes,t[i.element]=i={styles:i.styles,requiredStyles:i.styles&&CKEDITOR.tools.objectKeys(i.styles)},r&&(r=L(r),i.classes=r["class"]?r["class"].split(/\s+/):null,i.requiredClasses=i.classes,delete r["class"],i.attributes=r,i.requiredAttributes=r&&CKEDITOR.tools.objectKeys(r))}else if(CKEDITOR.tools.isArray(t)){for(i=0;i<t.length;++i)o=this.allow(t[i],n,r);return o}return e(this,t,n,this.allowedContent,this._.allowedRules),!0},applyTo:function(e,t,n,r){if(this.disabled)return!1;var i=this,s=[],o=this.editor&&this.editor.config.protectedSource,u,a=!1,f={doFilter:!n,doTransform:!0,doCallbacks:!0,toHtml:t};e.forEach(function(e){if(e.type==CKEDITOR.NODE_ELEMENT){if(e.attributes["data-cke-filter"]=="off")return!1;if(!t||e.name!="span"||!~CKEDITOR.tools.objectKeys(e.attributes).join("|").indexOf("data-cke-")){u=p(i,e,s,f);if(u&k)a=!0;else if(u&2)return!1}}else if(e.type==CKEDITOR.NODE_COMMENT&&e.value.match(/^\{cke_protected\}(?!\{C\})/)){var n;e:{var r=decodeURIComponent(e.value.replace(/^\{cke_protected\}/,""));n=[];var l,c,h;if(o)for(c=0;c<o.length;++c)if((h=r.match(o[c]))&&h[0].length==r.length){n=!0;break e}r=CKEDITOR.htmlParser.fragment.fromHtml(r),r.children.length==1&&(l=r.children[0]).type==CKEDITOR.NODE_ELEMENT&&p(i,l,n,f),n=!n.length}n||s.push(e)}},null,!0),s.length&&(a=!0);for(var l,e=[],r=M[r||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)],c;n=s.pop();)n.type==CKEDITOR.NODE_ELEMENT?w(n,r,e):n.remove();for(;l=e.pop();){n=l.el;if(n.parent){c=C[n.parent.name]||C.span;switch(l.check){case"it":C.$removeEmpty[n.name]&&!n.children.length?w(n,r,e):m(n)||w(n,r,e);break;case"el-up":n.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!c[n.name]&&w(n,r,e);break;case"parent-down":n.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!c[n.name]&&w(n.parent,r,e)}}}return a},checkFeature:function(e){return this.disabled||!e?!0:(e.toFeature&&(e=e.toFeature(this.editor)),!e.requiredContent||this.check(e.requiredContent))},disable:function(){this.disabled=!0},disallow:function(t){return s(this,t,!0)?(typeof t=="string"&&(t=l(t)),e(this,t,null,this.disallowedContent,this._.disallowedRules),!0):!1},addContentForms:function(e){if(!this.disabled&&e){var t,n,r=[],i;for(t=0;t<e.length&&!i;++t)n=e[t],(typeof n=="string"||n instanceof CKEDITOR.style)&&this.check(n)&&(i=n);if(i){for(t=0;t<e.length;++t)r.push(x(e[t],i));this.addTransformations(r)}}},addElementCallback:function(e){this.elementCallbacks||(this.elementCallbacks=[]),this.elementCallbacks.push(e)},addFeature:function(e){return this.disabled||!e?!0:(e.toFeature&&(e=e.toFeature(this.editor)),this.allow(e.allowedContent,e.name),this.addTransformations(e.contentTransformations),this.addContentForms(e.contentForms),e.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(e.requiredContent):!0)},addTransformations:function(e){var t,n;if(!this.disabled&&e){var r=this._.transformations,i;for(i=0;i<e.length;++i){t=e[i];var s=void 0,o=void 0,u=void 0,a=void 0,f=void 0,l=void 0;n=[];for(o=0;o<t.length;++o)u=t[o],typeof u=="string"?(u=u.split(/\s*:\s*/),a=u[0],f=null,l=u[1]):(a=u.check,f=u.left,l=u.right),s||(s=u,s=s.element?s.element:a?a.match(/^([a-z0-9]+)/i)[0]:s.left.getDefinition().element),f instanceof CKEDITOR.style&&(f=T(f)),n.push({check:a==s?null:a,left:f,right:typeof l=="string"?N(l):l});t=s,r[t]||(r[t]=[]),r[t].push(n)}}},check:function(e,t,n){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(e)){for(var r=e.length;r--;)if(this.check(e[r],t,n))return!0;return!1}var i,s;if(typeof e=="string"){s=e+"<"+(t===!1?"0":"1")+(n?"1":"0")+">";if(s in this._.cachedChecks)return this._.cachedChecks[s];r=l(e).$1,i=r.styles;var o=r.classes;r.name=r.elements,r.classes=o=o?o.split(/\s*,\s*/):[],r.styles=f(i),r.attributes=f(r.attributes),r.children=[],o.length&&(r.attributes["class"]=o.join(" ")),i&&(r.attributes.style=CKEDITOR.tools.writeCssText(r.styles)),i=r}else r=e.getDefinition(),i=r.styles,o=r.attributes||{},i?(i=L(i),o.style=CKEDITOR.tools.writeCssText(i,!0)):i={},i={name:r.element,attributes:o,classes:o["class"]?o["class"].split(/\s+/):[],styles:i,children:[]};var o=CKEDITOR.tools.clone(i),u=[],a;if(t!==!1&&(a=this._.transformations[i.name])){for(r=0;r<a.length;++r)E(this,i,a[r]);v(i)}return p(this,o,u,{doFilter:!0,doTransform:t!==!1,skipRequired:!n,skipFinalValidation:!n}),t=u.length>0?!1:CKEDITOR.tools.objectCompare(i.attributes,o.attributes,!0)?!0:!1,typeof e=="string"&&(this._.cachedChecks[s]=t),t},getAllowedEnterMode:function(){var e=["p","div","br"],t={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(n,r){var i=e.slice(),s;if(this.check(M[n]))return n;for(r||(i=i.reverse());s=i.pop();)if(this.check(s))return t[s];return CKEDITOR.ENTER_BR}}(),destroy:function(){delete CKEDITOR.filter.instances[this.id],delete this._,delete this.allowedContent,delete this.disallowedContent}};var _={styles:1,attributes:1,classes:1},D={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},P=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,H={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},B=/^cke:(object|embed|param)$/,j=/^(object|embed|param)$/,F=CKEDITOR.filter.transformationsTools={sizeToStyle:function(e){this.lengthToStyle(e,"width"),this.lengthToStyle(e,"height")},sizeToAttribute:function(e){this.lengthToAttribute(e,"width"),this.lengthToAttribute(e,"height")},lengthToStyle:function(e,t,n){n=n||t;if(!(n in e.styles)){var r=e.attributes[t];r&&(/^\d+$/.test(r)&&(r+="px"),e.styles[n]=r)}delete e.attributes[t]},lengthToAttribute:function(e,t,n){n=n||t;if(!(n in e.attributes)){var r=e.styles[t],i=r&&r.match(/^(\d+)(?:\.\d*)?px$/);i?e.attributes[n]=i[1]:r==O&&(e.attributes[n]=O)}delete e.styles[t]},alignmentToStyle:function(e){if(!("float"in e.styles)){var t=e.attributes.align;if(t=="left"||t=="right")e.styles["float"]=t}delete e.attributes.align},alignmentToAttribute:function(e){if(!("align"in e.attributes)){var t=e.styles["float"];if(t=="left"||t=="right")e.attributes.align=t}delete e.styles["float"]},matchesStyle:S,transform:function(e,t){if(typeof t=="string")e.name=t;else{var n=t.getDefinition(),r=n.styles,i=n.attributes,s,o,u,a;e.name=n.element;for(s in i)if(s=="class"){n=e.classes.join("|");for(u=i[s].split(/\s+/);a=u.pop();)n.indexOf(a)==-1&&e.classes.push(a)}else e.attributes[s]=i[s];for(o in r)e.styles[o]=r[o]}}}}(),function(){CKEDITOR.focusManager=function(e){return e.focusManager?e.focusManager:(this.hasFocus=!1,this.currentActive=null,this._={editor:e},this)},CKEDITOR.focusManager._={blurDelay:200},CKEDITOR.focusManager.prototype={focus:function(e){this._.timer&&clearTimeout(this._.timer),e&&(this.currentActive=e),!this.hasFocus&&!this._.locked&&((e=CKEDITOR.currentInstance)&&e.focusManager.blur(1),this.hasFocus=!0,(e=this._.editor.container)&&e.addClass("cke_focus"),this._.editor.fire("focus"))},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(e){function t(){if(this.hasFocus){this.hasFocus=!1;var e=this._.editor.container;e&&e.removeClass("cke_focus"),this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var n=CKEDITOR.focusManager._.blurDelay;e||!n?t.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer,t.call(this)},n,this)}},add:function(e,t){var n=e.getCustomData("focusmanager");if(!n||n!=this){n&&n.remove(e);var n="focus",r="blur";t&&(CKEDITOR.env.ie?(n="focusin",r="focusout"):CKEDITOR.event.useCapture=1);var i={blur:function(){e.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(e)}};e.on(n,i.focus,this),e.on(r,i.blur,this),t&&(CKEDITOR.event.useCapture=0),e.setCustomData("focusmanager",this),e.setCustomData("focusmanager_handlers",i)}},remove:function(e){e.removeCustomData("focusmanager");var t=e.removeCustomData("focusmanager_handlers");e.removeListener("blur",t.blur),e.removeListener("focus",t.focus)}}}(),CKEDITOR.keystrokeHandler=function(e){return e.keystrokeHandler?e.keystrokeHandler:(this.keystrokes={},this.blockedKeystrokes={},this._={editor:e},this)},function(){var e,t=function(t){var t=t.data,n=t.getKeystroke(),r=this.keystrokes[n],i=this._.editor;return e=i.fire("key",{keyCode:n,domEvent:t})===!1,e||(r&&(e=i.execCommand(r,{from:"keystrokeHandler"})!==!1),e||(e=!!this.blockedKeystrokes[n])),e&&t.preventDefault(!0),!e},n=function(t){e&&(e=!1,t.data.preventDefault(!0))};CKEDITOR.keystrokeHandler.prototype={attach:function(e){e.on("keydown",t,this),CKEDITOR.env.gecko&&CKEDITOR.env.mac&&e.on("keypress",n,this)}}}(),function(){CKEDITOR.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es: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,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no: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(e,t,n){if(!e||!CKEDITOR.lang.languages[e])e=this.detect(t,e);var r=this,t=function(){r[e].dir=r.rtl[e]?"rtl":"ltr",n(e,r[e])};this[e]?t():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+e+".js"),t,this)},detect:function(e,t){var n=this.languages,t=t||navigator.userLanguage||navigator.language||e,r=t.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),i=r[1],r=r[2];return n[i+"-"+r]?i=i+"-"+r:n[i]||(i=null),CKEDITOR.lang.detect=i?function(){return i}:function(e){return e},i||e}}}(),CKEDITOR.scriptLoader=function(){var e={},t={};return{load:function(n,r,i,s){var o=typeof n=="string";o&&(n=[n]),i||(i=CKEDITOR);var u=n.length,f=[],l=[],c=function(e){r&&(o?r.call(i,e):r.call(i,f,l))};if(u===0)c(!0);else{var h=function(e,t){(t?f:l).push(e),--u<=0&&(s&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),c(t))},p=function(n,r){e[n]=1;var i=t[n];delete t[n];for(var s=0;s<i.length;s++)i[s](n,r)},d=function(n){if(e[n])h(n,!0);else{var i=t[n]||(t[n]=[]);i.push(h);if(!(i.length>1)){var s=new CKEDITOR.dom.element("script");s.setAttributes({type:"text/javascript",src:n}),r&&(CKEDITOR.env.ie&&CKEDITOR.env.version<11?s.$.onreadystatechange=function(){if(s.$.readyState=="loaded"||s.$.readyState=="complete")s.$.onreadystatechange=null,p(n,!0)}:(s.$.onload=function(){setTimeout(function(){p(n,!0)},0)},s.$.onerror=function(){p(n,!1)})),s.appendTo(CKEDITOR.document.getHead())}}};s&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var v=0;v<u;v++)d(n[v])}},queue:function(){function e(){var e;(e=t[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var t=[];return function(n,r){var i=this;t.push({scriptUrl:n,callback:function(){r&&r.apply(this,arguments),t.shift(),e.call(i)}}),t.length==1&&e.call(this)}}()}}(),CKEDITOR.resourceManager=function(e,t){this.basePath=e,this.fileName=t,this.registered={},this.loaded={},this.externals={},this._={waitingList:{}}},CKEDITOR.resourceManager.prototype={add:function(e,t){if(this.registered[e])throw'[CKEDITOR.resourceManager.add] The resource name "'+e+'" is already registered.';var n=this.registered[e]=t||{};return n.name=e,n.path=this.getPath(e),CKEDITOR.fire(e+CKEDITOR.tools.capitalize(this.fileName)+"Ready",n),this.get(e)},get:function(e){return this.registered[e]||null},getPath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(t&&t.dir||this.basePath+e+"/")},getFilePath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(this.getPath(e)+(t?t.file:this.fileName+".js"))},addExternal:function(e,t,n){for(var e=e.split(","),r=0;r<e.length;r++){var i=e[r];n||(t=t.replace(/[^\/]+$/,function(e){return n=e,""})),this.externals[i]={dir:t,file:n||this.fileName+".js"}}},load:function(e,t,n){CKEDITOR.tools.isArray(e)||(e=e?[e]:[]);for(var r=this.loaded,i=this.registered,s=[],o={},u={},a=0;a<e.length;a++){var f=e[a];if(f)if(!r[f]&&!i[f]){var l=this.getFilePath(f);s.push(l),l in o||(o[l]=[]),o[l].push(f)}else u[f]=this.get(f)}CKEDITOR.scriptLoader.load(s,function(e,i){if(i.length)throw'[CKEDITOR.resourceManager.load] Resource name "'+o[i[0]].join(",")+'" was not found at "'+i[0]+'".';for(var s=0;s<e.length;s++)for(var a=o[e[s]],f=0;f<a.length;f++){var l=a[f];u[l]=this.get(l),r[l]=1}t.call(n,u)},this)}},CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin"),CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(e){var t={};return function(n,r,i){var s={},o=function(n){e.call(this,n,function(e){CKEDITOR.tools.extend(s,e);var n=[],u;for(u in e){var a=e[u],f=a&&a.requires;if(!t[u]){if(a.icons)for(var l=a.icons.split(","),h=l.length;h--;)CKEDITOR.skin.addIcon(l[h],a.path+"icons/"+(CKEDITOR.env.hidpi&&a.hidpi?"hidpi/":"")+l[h]+".png");t[u]=1}if(f){f.split&&(f=f.split(","));for(a=0;a<f.length;a++)s[f[a]]||n.push(f[a])}}if(n.length)o.call(this,n);else{for(u in s)a=s[u],a.onLoad&&!a.onLoad._called&&(a.onLoad()===!1&&delete s[u],a.onLoad._called=1);r&&r.call(i||window,s)}},this)};o.call(this,n)}}),CKEDITOR.plugins.setLang=function(e,t,n){var r=this.get(e),e=r.langEntries||(r.langEntries={}),r=r.lang||(r.lang=[]);r.split&&(r=r.split(",")),CKEDITOR.tools.indexOf(r,t)==-1&&r.push(t),e[t]=n},CKEDITOR.ui=function(e){return e.ui?e.ui:(this.items={},this.instances={},this.editor=e,this._={handlers:{}},this)},CKEDITOR.ui.prototype={add:function(e,t,n){n.name=e.toLowerCase();var r=this.items[e]={type:t,command:n.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(r,n)},get:function(e){return this.instances[e]},create:function(e){var t=this.items[e],n=t&&this._.handlers[t.type],r=t&&t.command&&this.editor.getCommand(t.command),n=n&&n.create.apply(this,t.args);return this.instances[e]=n,r&&r.uiItems.push(n),n&&!n.type&&(n.type=t.type),n},addHandler:function(e,t){this._.handlers[e]=t},space:function(e){return CKEDITOR.document.getById(this.spaceId(e))},spaceId:function(e){return this.editor.id+"_"+e}},CKEDITOR.event.implementOn(CKEDITOR.ui),function(){function e(e,r,s){CKEDITOR.event.call(this),e=e&&CKEDITOR.tools.clone(e);if(r!==void 0){if(!(r instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!s)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&s==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!(s==CKEDITOR.ELEMENT_MODE_INLINE?r.is(CKEDITOR.dtd.$editable)||r.is("textarea"):s==CKEDITOR.ELEMENT_MODE_REPLACE?!r.is(CKEDITOR.dtd.$nonBodyContent):1))throw Error('The specified element mode is not supported on element: "'+r.getName()+'".');this.element=r,this.elementMode=s,this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(r.getId()||r.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={},this.commands={},this.templates={},this.name=this.name||t(),this.id=CKEDITOR.tools.getNextId(),this.status="unloaded",this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config),this.ui=new CKEDITOR.ui(this),this.focusManager=new CKEDITOR.focusManager(this),this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this),this.on("readOnly",n),this.on("selectionChange",function(e){i(this,e.data.path)}),this.on("activeFilterChange",function(){i(this,this.elementPath(),!0)}),this.on("mode",n),this.on("instanceReady",function(){this.config.startupFocus&&this.focus()}),CKEDITOR.fire("instanceCreated",null,this),CKEDITOR.add(this),CKEDITOR.tools.setTimeout(function(){o(this,e)},0,this)}function t(){do var e="editor"+ ++h;while(CKEDITOR.instances[e]);return e}function n(){var e=this.commands,t;for(t in e)r(this,e[t])}function r(e,t){t[t.startDisabled?"disable":e.readOnly&&!t.readOnly?"disable":t.modes[e.mode]?"enable":"disable"]()}function i(e,t,n){if(t){var r,i,s=e.commands;for(i in s)r=s[i],(n||r.contextSensitive)&&r.refresh(e,t)}}function s(e){var t=e.config.customConfig;if(!t)return!1;var t=CKEDITOR.getUrl(t),n=p[t]||(p[t]={});return n.fn?(n.fn.call(e,e.config),(CKEDITOR.getUrl(e.config.customConfig)==t||!s(e))&&e.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(t,function(){n.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){},s(e)}),!0}function o(e,t){e.on("customConfigLoaded",function(){if(t){if(t.on)for(var n in t.on)e.on(n,t.on[n]);CKEDITOR.tools.extend(e.config,t,!0),delete e.config.on}n=e.config,e.readOnly=!!n.readOnly||!!(e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.element.is("textarea")?e.element.hasAttribute("disabled"):e.element.isReadOnly():e.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&e.element.hasAttribute("disabled")),e.blockless=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!e.element.is("textarea")&&!CKEDITOR.dtd[e.element.getName()].p:!1,e.tabIndex=n.tabIndex||e.element&&e.element.getAttribute("tabindex")||0,e.activeEnterMode=e.enterMode=e.blockless?CKEDITOR.ENTER_BR:n.enterMode,e.activeShiftEnterMode=e.shiftEnterMode=e.blockless?CKEDITOR.ENTER_BR:n.shiftEnterMode,n.skin&&(CKEDITOR.skinName=n.skin),e.fireOnce("configLoaded"),e.dataProcessor=new CKEDITOR.htmlDataProcessor(e),e.filter=e.activeFilter=new CKEDITOR.filter(e),u(e)}),t&&t.customConfig!=null&&(e.config.customConfig=t.customConfig),s(e)||e.fireOnce("customConfigLoaded")}function u(e){CKEDITOR.skin.loadPart("editor",function(){a(e)})}function a(e){CKEDITOR.lang.load(e.config.language,e.config.defaultLanguage,function(t,n){var r=e.config.title;e.langCode=t,e.lang=CKEDITOR.tools.prototypedCopy(n),e.title=typeof r=="string"||r===!1?r:[e.lang.editor,e.name].join(", "),e.config.contentsLangDirection||(e.config.contentsLangDirection=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.element.getDirection(1):e.lang.dir),e.fire("langLoaded"),f(e)})}function f(e){e.getStylesSet(function(t){e.once("loaded",function(){e.fire("stylesSet",{styles:t})},null,null,1),l(e)})}function l(e){var t=e.config,n=t.plugins,r=t.extraPlugins,i=t.removePlugins;if(r)var s=RegExp("(?:^|,)(?:"+r.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),n=n.replace(s,""),n=n+(","+r);if(i)var o=RegExp("(?:^|,)(?:"+i.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),n=n.replace(o,"");CKEDITOR.env.air&&(n+=",adobeair"),CKEDITOR.plugins.load(n.split(","),function(n){var r=[],i=[],s=[];e.plugins=n;for(var u in n){var a=n[u],f=a.lang,l=null,c=a.requires,h;CKEDITOR.tools.isArray(c)&&(c=c.join(","));if(c&&(h=c.match(o)))for(;c=h.pop();)CKEDITOR.tools.setTimeout(function(e,t){throw Error('Plugin "'+e.replace(",","")+'" cannot be removed from the plugins list, because it\'s required by "'+t+'" plugin.')},0,null,[c,u]);f&&!e.lang[u]&&(f.split&&(f=f.split(",")),CKEDITOR.tools.indexOf(f,e.langCode)>=0?l=e.langCode:(l=e.langCode.replace(/-.*/,""),l=l!=e.langCode&&CKEDITOR.tools.indexOf(f,l)>=0?l:CKEDITOR.tools.indexOf(f,"en")>=0?"en":f[0]),!a.langEntries||!a.langEntries[l]?s.push(CKEDITOR.getUrl(a.path+"lang/"+l+".js")):(e.lang[u]=a.langEntries[l],l=null)),i.push(l),r.push(a)}CKEDITOR.scriptLoader.load(s,function(){for(var n=["beforeInit","init","afterInit"],s=0;s<n.length;s++)for(var o=0;o<r.length;o++){var u=r[o];s===0&&i[o]&&u.lang&&u.langEntries&&(e.lang[u.name]=u.langEntries[i[o]]),u[n[s]]&&u[n[s]](e)}e.fireOnce("pluginsLoaded"),t.keystrokes&&e.setKeystroke(e.config.keystrokes);for(o=0;o<e.config.blockedKeystrokes.length;o++)e.keystrokeHandler.blockedKeystrokes[e.config.blockedKeystrokes[o]]=1;e.status="loaded",e.fireOnce("loaded"),CKEDITOR.fire("instanceLoaded",null,e)})})}function c(){var e=this.element;if(e&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var t=this.getData();return this.config.htmlEncodeOutput&&(t=CKEDITOR.tools.htmlEncode(t)),e.is("textarea")?e.setValue(t):e.setHtml(t),!0}return!1}e.prototype=CKEDITOR.editor.prototype,CKEDITOR.editor=e;var h=0,p={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(e,t){t.name=e.toLowerCase();var n=new CKEDITOR.command(this,t);return this.mode&&r(this,n),this.commands[e]=n},_attachToForm:function(){function e(e){t.updateElement(),t._.required&&!n.getValue()&&t.fire("required")===!1&&e.data.preventDefault()}var t=this,n=t.element,r=new CKEDITOR.dom.element(n.$.form);n.is("textarea")&&r&&(r.on("submit",e),r.$.submit&&r.$.submit.call&&r.$.submit.apply&&(r.$.submit=CKEDITOR.tools.override(r.$.submit,function(t){return function(){e(),t.apply?t.apply(this):t()}})),t.on("destroy",function(){r.removeListener("submit",e)}))},destroy:function(e){this.fire("beforeDestroy"),!e&&c.call(this),this.editable(null),this.filter.destroy(),delete this.filter,delete this.activeFilter,this.status="destroyed",this.fire("destroy"),this.removeAllListeners(),CKEDITOR.remove(this),CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(e){if(!e){e=this.getSelection();if(!e)return null;e=e.getStartElement()}return e?new CKEDITOR.dom.elementPath(e,this.editable()):null},createRange:function(){var e=this.editable();return e?new CKEDITOR.dom.range(e):null},execCommand:function(e,t){var n=this.getCommand(e),r={name:e,commandData:t,command:n};if(n&&n.state!=CKEDITOR.TRISTATE_DISABLED&&this.fire("beforeCommandExec",r)!==!1){r.returnValue=n.exec(r.commandData);if(!n.async&&this.fire("afterCommandExec",r)!==!1)return r.returnValue}return!1},getCommand:function(e){return this.commands[e]},getData:function(e){!e&&this.fire("beforeGetData");var t=this._.data;return typeof t!="string"&&(t=(t=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?t.is("textarea")?t.getValue():t.getHtml():""),t={dataValue:t},!e&&this.fire("getData",t),t.dataValue},getSnapshot:function(){var e=this.fire("getSnapshot");if(typeof e!="string"){var t=this.element;t&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(e=t.is("textarea")?t.getValue():t.getHtml())}return e},loadSnapshot:function(e){this.fire("loadSnapshot",e)},setData:function(e,t,n){var r=!0,i=t;t&&typeof t=="object"&&(n=t.internal,i=t.callback,r=!t.noSnapshot),!n&&r&&this.fire("saveSnapshot"),(i||!n)&&this.once("dataReady",function(e){!n&&r&&this.fire("saveSnapshot"),i&&i.call(e.editor)}),e={dataValue:e},!n&&this.fire("setData",e),this._.data=e.dataValue,!n&&this.fire("afterSetData",e)},setReadOnly:function(e){e=e==null||e,this.readOnly!=e&&(this.readOnly=e,this.keystrokeHandler.blockedKeystrokes[8]=+e,this.editable().setReadOnly(e),this.fire("readOnly"))},insertHtml:function(e,t){this.fire("insertHtml",{dataValue:e,mode:t})},insertText:function(e){this.fire("insertText",e)},insertElement:function(e){this.fire("insertElement",e)},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return this.status=="ready"&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return c.call(this)},setKeystroke:function(){for(var e=this.keystrokeHandler.keystrokes,t=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],n,r,i=t.length;i--;)n=t[i],r=0,CKEDITOR.tools.isArray(n)&&(r=n[1],n=n[0]),r?e[n]=r:delete e[n]},addFeature:function(e){return this.filter.addFeature(e)},setActiveFilter:function(e){e||(e=this.filter),this.activeFilter!==e&&(this.activeFilter=e,this.fire("activeFilterChange"),e===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(e.getAllowedEnterMode(this.enterMode),e.getAllowedEnterMode(this.shiftEnterMode,!0)))},setActiveEnterMode:function(e,t){e=e?this.blockless?CKEDITOR.ENTER_BR:e:this.enterMode,t=t?this.blockless?CKEDITOR.ENTER_BR:t:this.shiftEnterMode;if(this.activeEnterMode!=e||this.activeShiftEnterMode!=t)this.activeEnterMode=e,this.activeShiftEnterMode=t,this.fire("activeEnterModeChange")}})}(),CKEDITOR.ELEMENT_MODE_NONE=0,CKEDITOR.ELEMENT_MODE_REPLACE=1,CKEDITOR.ELEMENT_MODE_APPENDTO=2,CKEDITOR.ELEMENT_MODE_INLINE=3,CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}},function(){var e=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,t={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){for(var r,i,s=0,o;r=this._.htmlPartsRegex.exec(n);){i=r.index,i>s&&(s=n.substring(s,i),o?o.push(s):this.onText(s)),s=this._.htmlPartsRegex.lastIndex;if(i=r[1]){i=i.toLowerCase(),o&&CKEDITOR.dtd.$cdata[i]&&(this.onCDATA(o.join("")),o=null);if(!o){this.onTagClose(i);continue}}if(o)o.push(r[0]);else if(i=r[3]){i=i.toLowerCase();if(!/="/.test(i)){var u={},f,l=r[4];r=!!r[5];if(l)for(;f=e.exec(l);){var c=f[1].toLowerCase();f=f[2]||f[3]||f[4]||"",u[c]=!f&&t[c]?c:CKEDITOR.tools.htmlDecodeAttr(f)}this.onTagOpen(i,u,r),!o&&CKEDITOR.dtd.$cdata[i]&&(o=[])}}else(i=r[2])&&this.onComment(i)}n.length>s&&this.onText(n.substring(s,n.length))}}}(),CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(e){this._.output.push("<",e)},openTagClose:function(e,t){t?this._.output.push(" />"):this._.output.push(">")},attribute:function(e,t){typeof t=="string"&&(t=CKEDITOR.tools.htmlEncodeAttr(t)),this._.output.push(" ",e,'="',t,'"')},closeTag:function(e){this._.output.push("</",e,">")},text:function(e){this._.output.push(e)},comment:function(e){this._.output.push("<!--",e,"-->")},write:function(e){this._.output.push(e)},reset:function(){this._.output=[],this._.indent=!1},getHtml:function(e){var t=this._.output.join("");return e&&this.reset(),t}}}),"use strict",function(){CKEDITOR.htmlParser.node=function(){},CKEDITOR.htmlParser.node.prototype={remove:function(){var e=this.parent.children,t=CKEDITOR.tools.indexOf(e,this),n=this.previous,r=this.next;n&&(n.next=r),r&&(r.previous=n),e.splice(t,1),this.parent=null},replaceWith:function(e){var t=this.parent.children,n=CKEDITOR.tools.indexOf(t,this),r=e.previous=this.previous,i=e.next=this.next;r&&(r.next=e),i&&(i.previous=e),t[n]=e,e.parent=this.parent,this.parent=null},insertAfter:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e),r=e.next;t.splice(n+1,0,this),this.next=e.next,this.previous=e,e.next=this,r&&(r.previous=this),this.parent=e.parent},insertBefore:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e);t.splice(n,0,this),this.next=e,(this.previous=e.previous)&&(e.previous.next=this),e.previous=this,this.parent=e.parent},getAscendant:function(e){var t=typeof e=="function"?e:typeof e=="string"?function(t){return t.name==e}:function(t){return t.name in e},n=this.parent;for(;n&&n.type==CKEDITOR.NODE_ELEMENT;){if(t(n))return n;n=n.parent}return null},wrapWith:function(e){return this.replaceWith(e),e.add(this),e},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(e){return e||{}}}}(),"use strict",CKEDITOR.htmlParser.comment=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(e,t){var n=this.value;return(n=e.onComment(t,n,this))?typeof n!="string"?(this.replaceWith(n),!1):(this.value=n,!0):(this.remove(),!1)},writeHtml:function(e,t){t&&this.filter(t),e.comment(this.value)}}),"use strict",function(){CKEDITOR.htmlParser.text=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(e,t){if(!(this.value=e.onText(t,this.value,this)))return this.remove(),!1},writeHtml:function(e,t){t&&this.filter(t),e.text(this.value)}})}(),"use strict",function(){CKEDITOR.htmlParser.cdata=function(e){this.value=e},CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(e){e.write(this.value)}})}(),"use strict",CKEDITOR.htmlParser.fragment=function(){this.children=[],this.parent=null,this._={isBlockLike:!0,hasInlineStarted:!1}},function(){function e(e){return e.attributes["data-cke-survive"]?!1:e.name=="a"&&e.attributes.href||CKEDITOR.dtd.$removeEmpty[e.name]}var t=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),n={ol:1,ul:1},r=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),i={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(s,o,u){function f(e){var t;if(w.length>0)for(var n=0;n<w.length;n++){var r=w[n],i=r.name,s=CKEDITOR.dtd[i],o=S.name&&CKEDITOR.dtd[S.name];(!o||o[i])&&(!e||!s||s[e]||!CKEDITOR.dtd[e])?(t||(l(),t=1),r=r.clone(),r.parent=S,S=r,w.splice(n,1),n--):i==S.name&&(p(S,S.parent,1),n--)}}function l(){for(;E.length;)p(E.shift(),S)}function h(e){if(e._.isBlockLike&&e.name!="pre"&&e.name!="textarea"){var t=e.children.length,n=e.children[t-1],r;n&&n.type==CKEDITOR.NODE_TEXT&&((r=CKEDITOR.tools.rtrim(n.value))?n.value=r:e.children.length=t-1)}}function p(t,n,r){var n=n||S||y,i=S;t.previous===void 0&&(d(n,t)&&(S=n,m.onTagOpen(u,{}),t.returnPoint=n=S),h(t),(!e(t)||t.children.length)&&n.add(t),t.name=="pre"&&(T=!1),t.name=="textarea"&&(x=!1)),t.returnPoint?(S=t.returnPoint,delete t.returnPoint):S=r?n:i}function d(e,t){if((e==y||e.name=="body")&&u&&(!e.name||CKEDITOR.dtd[e.name][u])){var n,r;return(n=t.attributes&&(r=t.attributes["data-cke-real-element-type"])?r:t.name)&&n in CKEDITOR.dtd.$inline&&!(n in CKEDITOR.dtd.head)&&!t.isOrphan||t.type==CKEDITOR.NODE_TEXT}}function v(e,t){return e in CKEDITOR.dtd.$listItem||e in CKEDITOR.dtd.$tableContent?e==t||e=="dt"&&t=="dd"||e=="dd"&&t=="dt":!1}var m=new CKEDITOR.htmlParser,y=o instanceof CKEDITOR.htmlParser.element?o:typeof o=="string"?new CKEDITOR.htmlParser.element(o):new CKEDITOR.htmlParser.fragment,w=[],E=[],S=y,x=y.name=="textarea",T=y.name=="pre";m.onTagOpen=function(i,s,o,u){s=new CKEDITOR.htmlParser.element(i,s),s.isUnknown&&o&&(s.isEmpty=!0),s.isOptionalClose=u;if(e(s))w.push(s);else{if(i=="pre")T=!0;else{if(i=="br"&&T){S.add(new CKEDITOR.htmlParser.text("\n"));return}i=="textarea"&&(x=!0)}if(i=="br")E.push(s);else{for(;;){u=(o=S.name)?CKEDITOR.dtd[o]||(S._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):r;if(!(!s.isUnknown&&!S.isUnknown&&!u[i]))break;if(S.isOptionalClose)m.onTagClose(o);else if(i in n&&o in n)o=S.children,(o=o[o.length-1])&&o.name=="li"||p(o=new CKEDITOR.htmlParser.element("li"),S),!s.returnPoint&&(s.returnPoint=S),S=o;else if(i in CKEDITOR.dtd.$listItem&&!v(i,o))m.onTagOpen(i=="li"?"ul":"dl",{},0,1);else if(o in t&&!v(i,o))!s.returnPoint&&(s.returnPoint=S),S=S.parent;else{o in CKEDITOR.dtd.$inline&&w.unshift(S);if(!S.parent){s.isOrphan=1;break}p(S,S.parent,1)}}f(i),l(),s.parent=S,s.isEmpty?p(s):S=s}}},m.onTagClose=function(e){for(var t=w.length-1;t>=0;t--)if(e==w[t].name){w.splice(t,1);return}for(var n=[],r=[],i=S;i!=y&&i.name!=e;)i._.isBlockLike||r.unshift(i),n.push(i),i=i.returnPoint||i.parent;if(i!=y){for(t=0;t<n.length;t++){var s=n[t];p(s,s.parent)}S=i,i._.isBlockLike&&l(),p(i,i.parent),i==S&&(S=S.parent),w=w.concat(r)}e=="body"&&(u=!1)},m.onText=function(e){if((!S._.hasInlineStarted||E.length)&&!T&&!x){e=CKEDITOR.tools.ltrim(e);if(e.length===0)return}var n=S.name,s=n?CKEDITOR.dtd[n]||(S._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):r;!x&&!s["#"]&&n in t?(m.onTagOpen(i[n]||""),m.onText(e)):(l(),f(),!T&&!x&&(e=e.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," ")),e=new CKEDITOR.htmlParser.text(e),d(S,e)&&this.onTagOpen(u,{},0,1),S.add(e))},m.onCDATA=function(e){S.add(new CKEDITOR.htmlParser.cdata(e))},m.onComment=function(e){l(),f(),S.add(new CKEDITOR.htmlParser.comment(e))},m.parse(s);for(l();S!=y;)p(S,S.parent,1);return h(y),y},CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(e,t){isNaN(t)&&(t=this.children.length);var n=t>0?this.children[t-1]:null;if(n){if(e._.isBlockLike&&n.type==CKEDITOR.NODE_TEXT){n.value=CKEDITOR.tools.rtrim(n.value);if(n.value.length===0){this.children.pop(),this.add(e);return}}n.next=e}e.previous=n,e.parent=this,this.children.splice(t,0,e),this._.hasInlineStarted||(this._.hasInlineStarted=e.type==CKEDITOR.NODE_TEXT||e.type==CKEDITOR.NODE_ELEMENT&&!e._.isBlockLike)},filter:function(e,t){t=this.getFilterContext(t),e.onRoot(t,this),this.filterChildren(e,!1,t)},filterChildren:function(e,t,n){if(this.childrenFilteredBy!=e.id){n=this.getFilterContext(n),t&&!this.parent&&e.onRoot(n,this),this.childrenFilteredBy=e.id;for(t=0;t<this.children.length;t++)this.children[t].filter(e,n)===!1&&t--}},writeHtml:function(e,t){t&&this.filter(t),this.writeChildrenHtml(e)},writeChildrenHtml:function(e,t,n){var r=this.getFilterContext();n&&!this.parent&&t&&t.onRoot(r,this),t&&this.filterChildren(t,!1,r),t=0,n=this.children;for(r=n.length;t<r;t++)n[t].writeHtml(e)},forEach:function(e,t,n){if(!n&&(!t||this.type==t))var r=e(this);if(r!==!1)for(var n=this.children,i=0;i<n.length;i++)r=n[i],r.type==CKEDITOR.NODE_ELEMENT?r.forEach(e,t):(!t||r.type==t)&&e(r)},getFilterContext:function(e){return e||{}}}}(),"use strict",function(){function e(){this.rules=[]}function t(t,n,r,i){var s,o;for(s in n)(o=t[s])||(o=t[s]=new e),o.add(n[s],r,i)}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(t){this.id=CKEDITOR.tools.getNextNumber(),this.elementNameRules=new e,this.attributeNameRules=new e,this.elementsRules={},this.attributesRules={},this.textRules=new e,this.commentRules=new e,this.rootRules=new e,t&&this.addRules(t,10)},proto:{addRules:function(e,n){var r;typeof n=="number"?r=n:n&&"priority"in n&&(r=n.priority),typeof r!="number"&&(r=10),typeof n!="object"&&(n={}),e.elementNames&&this.elementNameRules.addMany(e.elementNames,r,n),e.attributeNames&&this.attributeNameRules.addMany(e.attributeNames,r,n),e.elements&&t(this.elementsRules,e.elements,r,n),e.attributes&&t(this.attributesRules,e.attributes,r,n),e.text&&this.textRules.add(e.text,r,n),e.comment&&this.commentRules.add(e.comment,r,n),e.root&&this.rootRules.add(e.root,r,n)},applyTo:function(e){e.filter(this)},onElementName:function(e,t){return this.elementNameRules.execOnName(e,t)},onAttributeName:function(e,t){return this.attributeNameRules.execOnName(e,t)},onText:function(e,t,n){return this.textRules.exec(e,t,n)},onComment:function(e,t,n){return this.commentRules.exec(e,t,n)},onRoot:function(e,t){return this.rootRules.exec(e,t)},onElement:function(e,t){for(var n=[this.elementsRules["^"],this.elementsRules[t.name],this.elementsRules.$],r,i=0;i<3;i++)if(r=n[i]){r=r.exec(e,t,this);if(r===!1)return null;if(r&&r!=t)return this.onNode(e,r);if(t.parent&&!t.name)break}return t},onNode:function(e,t){var n=t.type;return n==CKEDITOR.NODE_ELEMENT?this.onElement(e,t):n==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(e,t.value)):n==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(e,t.value)):null},onAttribute:function(e,t,n,r){return(n=this.attributesRules[n])?n.exec(e,r,t,this):r}}}),CKEDITOR.htmlParser.filterRulesGroup=e,e.prototype={add:function(e,t,n){this.rules.splice(this.findIndex(t),0,{value:e,priority:t,options:n})},addMany:function(e,t,n){for(var r=[this.findIndex(t),0],i=0,s=e.length;i<s;i++)r.push({value:e[i],priority:t,options:n});this.rules.splice.apply(this.rules,r)},findIndex:function(e){for(var t=this.rules,n=t.length-1;n>=0&&e<t[n].priority;)n--;return n+1},exec:function(e,t){var n=t instanceof CKEDITOR.htmlParser.node||t instanceof CKEDITOR.htmlParser.fragment,r=Array.prototype.slice.call(arguments,1),i=this.rules,s=i.length,o,u,a,f;for(f=0;f<s;f++){n&&(o=t.type,u=t.name),a=i[f];if(!(e.nonEditable&&!a.options.applyToAll||e.nestedEditable&&a.options.excludeNestedEditable)){a=a.value.apply(null,r);if(a===!1||n&&a&&(a.name!=u||a.type!=o))return a;a!=null&&(r[0]=t=a)}}return t},execOnName:function(e,t){for(var n=0,r=this.rules,i=r.length,s;t&&n<i;n++)s=r[n],!(e.nonEditable&&!s.options.applyToAll||e.nestedEditable&&s.options.excludeNestedEditable)&&(t=t.replace(s.value[0],s.value[1]));return t}}}(),function(){function e(e,t){function u(e){return e||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function a(e,t){return function(i){if(i.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var o=[],a=n(i),l,h;if(a)for(f(a,1)&&o.push(a);a;)s(a)&&(l=r(a))&&f(l)&&((h=r(l))&&!s(h)?o.push(l):(u(c).insertAfter(l),l.remove())),a=a.previous;for(a=0;a<o.length;a++)o[a].remove();if(o=!e||(typeof t=="function"?t(i):t)!==!1)!c&&!CKEDITOR.env.needsBrFiller&&i.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT?o=!1:!c&&!CKEDITOR.env.needsBrFiller&&(document.documentMode>7||i.name in CKEDITOR.dtd.tr||i.name in CKEDITOR.dtd.$listItem)?o=!1:(o=n(i),o=!o||i.name=="form"&&o.name=="input");o&&i.add(u(e))}}}function f(e,t){if((!c||CKEDITOR.env.needsBrFiller)&&e.type==CKEDITOR.NODE_ELEMENT&&e.name=="br"&&!e.attributes["data-cke-eol"])return!0;var n;if(e.type==CKEDITOR.NODE_TEXT&&(n=e.value.match(m))){n.index&&((new CKEDITOR.htmlParser.text(e.value.substring(0,n.index))).insertBefore(e),e.value=n[0]);if(!CKEDITOR.env.needsBrFiller&&c&&(!t||e.parent.name in h))return!0;if(!c)if((n=e.previous)&&n.name=="br"||!n||s(n))return!0}return!1}var l={elements:{}},c=t=="html",h=CKEDITOR.tools.extend({},w),p;for(p in h)"#"in y[p]||delete h[p];for(p in h)l.elements[p]=a(c,e.config.fillEmptyBlocks);return l.root=a(c,!1),l.elements.br=function(e){return function(t){if(t.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var n=t.attributes;if("data-cke-bogus"in n||"data-cke-eol"in n)delete n["data-cke-bogus"];else{for(n=t.next;n&&i(n);)n=n.next;var a=r(t);!n&&s(t.parent)?o(t.parent,u(e)):s(n)&&a&&!s(a)&&u(e).insertBefore(n)}}}}(c),l}function t(e,t){return e!=CKEDITOR.ENTER_BR&&t!==!1?e==CKEDITOR.ENTER_DIV?"div":"p":!1}function n(e){for(e=e.children[e.children.length-1];e&&i(e);)e=e.previous;return e}function r(e){for(e=e.previous;e&&i(e);)e=e.previous;return e}function i(e){return e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(e.value)||e.type==CKEDITOR.NODE_ELEMENT&&e.attributes["data-cke-bookmark"]}function s(e){return e&&(e.type==CKEDITOR.NODE_ELEMENT&&e.name in w||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function o(e,t){var n=e.children[e.children.length-1];e.children.push(t),t.parent=e,n&&(n.next=t,t.previous=n)}function u(e){e=e.attributes,e.contenteditable!="false"&&(e["data-cke-editable"]=e.contenteditable?"true":1),e.contenteditable="false"}function a(e){e=e.attributes;switch(e["data-cke-editable"]){case"true":e.contenteditable="true";break;case"1":delete e.contenteditable}}function f(e){return e.replace(N,function(e,t,n){return"<"+t+n.replace(C,function(e,t){return k.test(t)&&n.indexOf("data-cke-saved-"+t)==-1?" data-cke-saved-"+e+" data-cke-"+CKEDITOR.rnd+"-"+e:e})+">"})}function l(e,t){return e.replace(t,function(e,t,n){return e.indexOf("<textarea")===0&&(e=t+p(n).replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</textarea>"),"<cke:encoded>"+encodeURIComponent(e)+"</cke:encoded>"})}function c(e){return e.replace(O,function(e,t){return decodeURIComponent(t)})}function h(e){return e.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,function(e){return"<!--"+g+"{C}"+encodeURIComponent(e).replace(/--/g,"%2D%2D")+"-->"})}function p(e){return e.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(e,t){return decodeURIComponent(t)})}function d(e,t){var n=t._.dataStore;return e.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(e,t){return decodeURIComponent(t)}).replace(/\{cke_protected_(\d+)\}/g,function(e,t){return n&&n[t]||""})}function v(e,t){for(var n=[],r=t.config.protectedSource,i=t._.dataStore||(t._.dataStore={id:1}),s=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,r=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(r),e=e.replace(/<\!--[\s\S]*?--\>/g,function(e){return"<!--{cke_tempcomment}"+(n.push(e)-1)+"-->"}),o=0;o<r.length;o++)e=e.replace(r[o],function(e){return e=e.replace(s,function(e,t,r){return n[r]}),/cke_temp(comment)?/.test(e)?e:"<!--{cke_temp}"+(n.push(e)-1)+"-->"});return e=e.replace(s,function(e,t,r){return"<!--"+g+(t?"{C}":"")+encodeURIComponent(n[r]).replace(/--/g,"%2D%2D")+"-->"}),e=e.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=>]+))+\s*>/g,function(e){return e.replace(/<\!--\{cke_protected\}([^>]*)--\>/g,function(e,t){return i[i.id]=decodeURIComponent(t),"{cke_protected_"+i.id++ +"}"})}),e=e.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(e,n,r,i){return"<"+n+r+">"+d(p(i),t)+"</"+n+">"})}CKEDITOR.htmlDataProcessor=function(n){var r,i,s=this;this.editor=n,this.dataFilter=r=new CKEDITOR.htmlParser.filter,this.htmlFilter=i=new CKEDITOR.htmlParser.filter,this.writer=new CKEDITOR.htmlParser.basicWriter,r.addRules(E),r.addRules(S,{applyToAll:!0}),r.addRules(e(n,"data"),{applyToAll:!0}),i.addRules(x),i.addRules(T,{applyToAll:!0}),i.addRules(e(n,"html"),{applyToAll:!0}),n.on("toHtml",function(e){var e=e.data,r=e.dataValue,i,r=v(r,n),r=l(r,A),r=f(r),r=l(r,L),r=r.replace(M,"$1cke:$2"),r=r.replace(D,"<cke:$1$2></cke:$1>"),r=r.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),r=r.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");i=e.context||n.editable().getName();var s;CKEDITOR.env.ie&&CKEDITOR.env.version<9&&i=="pre"&&(i="div",r="<pre>"+r+"</pre>",s=1),i=n.document.createElement(i),i.setHtml("a"+r),r=i.getHtml().substr(1),r=r.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),""),s&&(r=r.replace(/^<pre>|<\/pre>$/gi,"")),r=r.replace(_,"$1$2"),r=c(r),r=p(r),i=e.fixForBody===!1?!1:t(e.enterMode,n.config.autoParagraph),r=CKEDITOR.htmlParser.fragment.fromHtml(r,e.context,i),i&&(s=r,!s.children.length&&CKEDITOR.dtd[s.name][i]&&(i=new CKEDITOR.htmlParser.element(i),s.add(i))),e.dataValue=r},null,null,5),n.on("toHtml",function(e){e.data.filter.applyTo(e.data.dataValue,!0,e.data.dontFilter,e.data.enterMode)&&n.fire("dataFiltered")},null,null,6),n.on("toHtml",function(e){e.data.dataValue.filterChildren(s.dataFilter,!0)},null,null,10),n.on("toHtml",function(e){var e=e.data,t=e.dataValue,n=new CKEDITOR.htmlParser.basicWriter;t.writeChildrenHtml(n),t=n.getHtml(!0),e.dataValue=h(t)},null,null,15),n.on("toDataFormat",function(e){var r=e.data.dataValue;e.data.enterMode!=CKEDITOR.ENTER_BR&&(r=r.replace(/^<br *\/?>/i,"")),e.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(r,e.data.context,t(e.data.enterMode,n.config.autoParagraph))},null,null,5),n.on("toDataFormat",function(e){e.data.dataValue.filterChildren(s.htmlFilter,!0)},null,null,10),n.on("toDataFormat",function(e){e.data.filter.applyTo(e.data.dataValue,!1,!0)},null,null,11),n.on("toDataFormat",function(e){var t=e.data.dataValue,r=s.writer;r.reset(),t.writeChildrenHtml(r),t=r.getHtml(!0),t=p(t),t=d(t,n),e.data.dataValue=t},null,null,15)},CKEDITOR.htmlDataProcessor.prototype={toHtml:function(e,t,n,r){var i=this.editor,s,o,u;return t&&typeof t=="object"?(s=t.context,n=t.fixForBody,r=t.dontFilter,o=t.filter,u=t.enterMode):s=t,!s&&s!==null&&(s=i.editable().getName()),i.fire("toHtml",{dataValue:e,context:s,fixForBody:n,dontFilter:r,filter:o||i.filter,enterMode:u||i.enterMode}).dataValue},toDataFormat:function(e,t){var n,r,i;return t&&(n=t.context,r=t.filter,i=t.enterMode),!n&&n!==null&&(n=this.editor.editable().getName()),this.editor.fire("toDataFormat",{dataValue:e,filter:r||this.editor.filter,context:n,enterMode:i||this.editor.enterMode}).dataValue}};var m=/(?:&nbsp;|\xa0)$/,g="{cke_protected}",y=CKEDITOR.dtd,b=["caption","colgroup","col","thead","tfoot","tbody"],w=CKEDITOR.tools.extend({},y.$blockLimit,y.$block),E={elements:{input:u,textarea:u}},S={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},x={elements:{embed:function(e){var t=e.parent;if(t&&t.name=="object"){var n=t.attributes.width,t=t.attributes.height;n&&(e.attributes.width=n),t&&(e.attributes.height=t)}},a:function(e){if(!e.children.length&&!e.attributes.name&&!e.attributes["data-cke-saved-name"])return!1}}},T={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(e){var t=e.attributes;if(t){if(t["data-cke-temp"])return!1;for(var n=["name","href","src"],r,i=0;i<n.length;i++)r="data-cke-saved-"+n[i],r in t&&delete t[n[i]]}return e},table:function(e){e.children.slice(0).sort(function(e,t){var n,r;return e.type==CKEDITOR.NODE_ELEMENT&&t.type==e.type&&(n=CKEDITOR.tools.indexOf(b,e.name),r=CKEDITOR.tools.indexOf(b,t.name)),n>-1&&r>-1&&n!=r||(n=e.parent?e.getIndex():-1,r=t.parent?t.getIndex():-1),n>r?1:-1})},param:function(e){return e.children=[],e.isEmpty=!0,e},span:function(e){e.attributes["class"]=="Apple-style-span"&&delete e.name},html:function(e){delete e.attributes.contenteditable,delete e.attributes["class"]},body:function(e){delete e.attributes.spellcheck,delete e.attributes.contenteditable},style:function(e){var t=e.children[0];t&&t.value&&(t.value=CKEDITOR.tools.trim(t.value)),e.attributes.type||(e.attributes.type="text/css")},title:function(e){var t=e.children[0];!t&&o(e,t=new CKEDITOR.htmlParser.text),t.value=e.attributes["data-cke-title"]||""},input:a,textarea:a},attributes:{"class":function(e){return CKEDITOR.tools.ltrim(e.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(T.attributes.style=function(e){return e.replace(/(^|;)([^\:]+)/g,function(e){return e.toLowerCase()})});var N=/<(a|area|img|input|source)\b([^>]*)>/gi,C=/([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,k=/^(href|src|name)$/i,L=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,A=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,O=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,M=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,_=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,D=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi}(),"use strict",CKEDITOR.htmlParser.element=function(e,t){this.name=e,this.attributes=t||{},this.children=[];var n=e||"",r=n.match(/^cke:(.*)/);r&&(n=r[1]),n=!(!CKEDITOR.dtd.$nonBodyContent[n]&&!CKEDITOR.dtd.$block[n]&&!CKEDITOR.dtd.$listItem[n]&&!CKEDITOR.dtd.$tableContent[n]&&!CKEDITOR.dtd.$nonEditable[n]&&n!="br"),this.isEmpty=!!CKEDITOR.dtd.$empty[e],this.isUnknown=!CKEDITOR.dtd[e],this._={isBlockLike:n,hasInlineStarted:this.isEmpty||!n}},CKEDITOR.htmlParser.cssStyle=function(e){var t={};return((e instanceof CKEDITOR.htmlParser.element?e.attributes.style:e)||"").replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,n,r){n=="font-family"&&(r=r.replace(/["']/g,"")),t[n.toLowerCase()]=r}),{rules:t,populate:function(e){var t=this.toString();t&&(e instanceof CKEDITOR.dom.element?e.setAttribute("style",t):e instanceof CKEDITOR.htmlParser.element?e.attributes.style=t:e.style=t)},toString:function(){var e=[],n;for(n in t)t[n]&&e.push(n,":",t[n],";");return e.join("")}}},function(){function e(e){return function(t){return t.type==CKEDITOR.NODE_ELEMENT&&(typeof e=="string"?t.name==e:t.name in e)}}var t=function(e,t){return e=e[0],t=t[0],e<t?-1:e>t?1:0},n=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:n.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(e,t){var n=this,r,i,t=n.getFilterContext(t);if(t.off)return!0;n.parent||e.onRoot(t,n);for(;;){r=n.name;if(!(i=e.onElementName(t,r)))return this.remove(),!1;n.name=i;if(!(n=e.onElement(t,n)))return this.remove(),!1;if(n!==this)return this.replaceWith(n),!1;if(n.name==r)break;if(n.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(n),!1;if(!n.name)return this.replaceWithChildren(),!1}r=n.attributes;var s,o;for(s in r){o=s;for(i=r[s];;){if(!(o=e.onAttributeName(t,s))){delete r[s];break}if(o==s)break;delete r[s],s=o}o&&((i=e.onAttribute(t,n,o,i))===!1?delete r[o]:r[o]=i)}return n.isEmpty||this.filterChildren(e,!1,t),!0},filterChildren:n.filterChildren,writeHtml:function(e,n){n&&this.filter(n);var r=this.name,i=[],s=this.attributes,o,u;e.openTag(r,s);for(o in s)i.push([o,s[o]]);e.sortAttributes&&i.sort(t),o=0;for(u=i.length;o<u;o++)s=i[o],e.attribute(s[0],s[1]);e.openTagClose(r,this.isEmpty),this.writeChildrenHtml(e),this.isEmpty||e.closeTag(r)},writeChildrenHtml:n.writeChildrenHtml,replaceWithChildren:function(){for(var e=this.children,t=e.length;t;)e[--t].insertAfter(this);this.remove()},forEach:n.forEach,getFirst:function(t){if(!t)return this.children.length?this.children[0]:null;typeof t!="function"&&(t=e(t));for(var n=0,r=this.children.length;n<r;++n)if(t(this.children[n]))return this.children[n];return null},getHtml:function(){var e=new CKEDITOR.htmlParser.basicWriter;return this.writeChildrenHtml(e),e.getHtml()},setHtml:function(e){for(var e=this.children=CKEDITOR.htmlParser.fragment.fromHtml(e).children,t=0,n=e.length;t<n;++t)e[t].parent=this},getOuterHtml:function(){var e=new CKEDITOR.htmlParser.basicWriter;return this.writeHtml(e),e.getHtml()},split:function(e){for(var t=this.children.splice(e,this.children.length-e),n=this.clone(),r=0;r<t.length;++r)t[r].parent=n;return n.children=t,t[0]&&(t[0].previous=null),e>0&&(this.children[e-1].next=null),this.parent.add(n,this.getIndex()+1),n},addClass:function(e){if(!this.hasClass(e)){var t=this.attributes["class"]||"";this.attributes["class"]=t+(t?" ":"")+e}},removeClass:function(e){var t=this.attributes["class"];t&&((t=CKEDITOR.tools.trim(t.replace(RegExp("(?:\\s+|^)"+e+"(?:\\s+|$)")," ")))?this.attributes["class"]=t:delete this.attributes["class"])},hasClass:function(e){var t=this.attributes["class"];return t?RegExp("(?:^|\\s)"+e+"(?=\\s|$)").test(t):!1},getFilterContext:function(e){var t=[];e||(e={off:!1,nonEditable:!1,nestedEditable:!1}),!e.off&&this.attributes["data-cke-processor"]=="off"&&t.push("off",!0),!e.nonEditable&&this.attributes.contenteditable=="false"?t.push("nonEditable",!0):e.nonEditable&&!e.nestedEditable&&this.attributes.contenteditable=="true"&&t.push("nestedEditable",!0);if(t.length)for(var e=CKEDITOR.tools.copy(e),n=0;n<t.length;n+=2)e[t[n]]=t[n+1];return e}},!0)}(),function(){var e={},t=/{([^}]+)}/g,n=/([\\'])/g,r=/\n/g,i=/\r/g;CKEDITOR.template=function(s){if(e[s])this.output=e[s];else{var o=s.replace(n,"\\$1").replace(r,"\\n").replace(i,"\\r").replace(t,function(e,t){return"',data['"+t+"']==undefined?'{"+t+"}':data['"+t+"'],'"});this.output=e[s]=Function("data","buffer","return buffer?buffer.push('"+o+"'):['"+o+"'].join('');")}}}(),delete CKEDITOR.loadFullCore,CKEDITOR.instances={},CKEDITOR.document=new CKEDITOR.dom.document(document),CKEDITOR.add=function(e){CKEDITOR.instances[e.name]=e,e.on("focus",function(){CKEDITOR.currentInstance!=e&&(CKEDITOR.currentInstance=e,CKEDITOR.fire("currentInstance"))}),e.on("blur",function(){CKEDITOR.currentInstance==e&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}),CKEDITOR.fire("instance",null,e)},CKEDITOR.remove=function(e){delete CKEDITOR.instances[e.name]},function(){var e={};CKEDITOR.addTemplate=function(t,n){var r=e[t];return r?r:(r={name:t,source:n},CKEDITOR.fire("template",r),e[t]=new CKEDITOR.template(r.source))},CKEDITOR.getTemplate=function(t){return e[t]}}(),function(){var e=[];CKEDITOR.addCss=function(t){e.push(t)},CKEDITOR.getCss=function(){return e.join("\n")}}(),CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")}),CKEDITOR.TRISTATE_ON=1,CKEDITOR.TRISTATE_OFF=2,CKEDITOR.TRISTATE_DISABLED=0,function(){CKEDITOR.inline=function(e,t){if(!CKEDITOR.env.isCompatible)return null;e=CKEDITOR.dom.element.get(e);if(e.getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var n=new CKEDITOR.editor(t,e,CKEDITOR.ELEMENT_MODE_INLINE),r=e.is("textarea")?e:null;return r?(n.setData(r.getValue(),null,!0),e=CKEDITOR.dom.element.createFromHtml('<div contenteditable="'+!!n.readOnly+'" class="cke_textarea_inline">'+r.getValue()+"</div>",CKEDITOR.document),e.insertAfter(r),r.hide(),r.$.form&&n._attachToForm()):n.setData(e.getHtml(),null,!0),n.on("loaded",function(){n.fire("uiReady"),n.editable(e),n.container=e,n.setData(n.getData(1)),n.resetDirty(),n.fire("contentDom"),n.mode="wysiwyg",n.fire("mode"),n.status="ready",n.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,n)},null,null,1e4),n.on("destroy",function(){r&&(n.container.clearCustomData(),n.container.remove(),r.show()),n.element.clearCustomData(),delete n.element}),n},CKEDITOR.inlineAll=function(){var e,t,n;for(n in CKEDITOR.dtd.$editable)for(var r=CKEDITOR.document.getElementsByTag(n),i=0,s=r.count();i<s;i++)e=r.getItem(i),e.getAttribute("contenteditable")=="true"&&(t={element:e,config:{}},CKEDITOR.fire("inline",t)!==!1&&CKEDITOR.inline(e,t.config))},CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})}(),CKEDITOR.replaceClass="ckeditor",function(){function e(e,r,i,s){if(!CKEDITOR.env.isCompatible)return null;e=CKEDITOR.dom.element.get(e);if(e.getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var o=new CKEDITOR.editor(r,e,s);return s==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.setStyle("visibility","hidden"),o._.required=e.hasAttribute("required"),e.removeAttribute("required")),i&&o.setData(i,null,!0),o.on("loaded",function(){n(o),s==CKEDITOR.ELEMENT_MODE_REPLACE&&o.config.autoUpdateElement&&e.$.form&&o._attachToForm(),o.setMode(o.config.startupMode,function(){o.resetDirty(),o.status="ready",o.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,o)})}),o.on("destroy",t),o}function t(){var e=this.container,t=this.element;e&&(e.clearCustomData(),e.remove()),t&&(t.clearCustomData(),this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(t.show(),this._.required&&t.setAttribute("required","required")),delete this.element)}function n(e){var t=e.name,n=e.element,r=e.elementMode,i=e.fire("uiSpace",{space:"top",html:""}).html,s=e.fire("uiSpace",{space:"bottom",html:""}).html,o=new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'"  dir="{langDir}" lang="{langCode}" role="application"'+(e.title?' aria-labelledby="cke_{name}_arialbl"':"")+">"+(e.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':"")+'<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'),t=CKEDITOR.dom.element.createFromHtml(o.output({id:e.id,name:t,langDir:e.lang.dir,langCode:e.langCode,voiceLabel:e.title,topHtml:i?'<span id="'+e.ui.spaceId("top")+'" class="cke_top cke_reset_all" role="presentation" style="height:auto">'+i+"</span>":"",contentId:e.ui.spaceId("contents"),bottomHtml:s?'<span id="'+e.ui.spaceId("bottom")+'" class="cke_bottom cke_reset_all" role="presentation">'+s+"</span>":"",outerEl:CKEDITOR.env.ie?"span":"div"}));r==CKEDITOR.ELEMENT_MODE_REPLACE?(n.hide(),t.insertAfter(n)):n.append(t),e.container=t,i&&e.ui.space("top").unselectable(),s&&e.ui.space("bottom").unselectable(),n=e.config.width,r=e.config.height,n&&t.setStyle("width",CKEDITOR.tools.cssLength(n)),r&&e.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(r)),t.disableContextMenu(),CKEDITOR.env.webkit&&t.on("focus",function(){e.focus()}),e.fireOnce("uiReady")}CKEDITOR.replace=function(t,n){return e(t,n,null,CKEDITOR.ELEMENT_MODE_REPLACE)},CKEDITOR.appendTo=function(t,n,r){return e(t,n,r,CKEDITOR.ELEMENT_MODE_APPENDTO)},CKEDITOR.replaceAll=function(){for(var e=document.getElementsByTagName("textarea"),t=0;t<e.length;t++){var n=null,r=e[t];if(r.name||r.id){if(typeof arguments[0]=="string"){if(!RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)").test(r.className))continue}else if(typeof arguments[0]=="function"){n={};if(arguments[0](r,n)===!1)continue}this.replace(r,n)}}},CKEDITOR.editor.prototype.addMode=function(e,t){(this._.modes||(this._.modes={}))[e]=t},CKEDITOR.editor.prototype.setMode=function(e,t){var n=this,r=this._.modes;if(e!=n.mode&&!!r&&!!r[e]){n.fire("beforeSetMode",e);if(n.mode){var i=n.checkDirty(),r=n._.previousModeData,s,o=0;n.fire("beforeModeUnload"),n.editable(0),n._.previousMode=n.mode,n._.previousModeData=s=n.getData(1),n.mode=="source"&&r==s&&(n.fire("lockSnapshot",{forceUpdate:!0}),o=1),n.ui.space("contents").setHtml(""),n.mode=""}else n._.previousModeData=n.getData(1);this._.modes[e](function(){n.mode=e,i!==void 0&&!i&&n.resetDirty(),o?n.fire("unlockSnapshot"):e=="wysiwyg"&&n.fire("saveSnapshot"),setTimeout(function(){n.fire("mode"),t&&t.call(n)},0)})}},CKEDITOR.editor.prototype.resize=function(e,t,n,r){var i=this.container,s=this.ui.space("contents"),o=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement,r=r?this.container.getFirst(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.hasClass("cke_inner")}):i;r.setSize("width",e,!0),o&&(o.style.width="1%"),s.setStyle("height",Math.max(t-(n?0:(r.$.offsetHeight||0)-(s.$.clientHeight||0)),0)+"px"),o&&(o.style.width="100%"),this.fire("resize")},CKEDITOR.editor.prototype.getResizable=function(e){return e?this.ui.space("contents"):this.container},CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})}(),CKEDITOR.config.startupMode="wysiwyg",function(){function e(e){var n=e.editor,i=e.data.path,s=i.blockLimit,u=e.data.selection,a=u.getRanges()[0],f;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(u=t(u,i))u.appendBogus(),f=CKEDITOR.env.ie;if(o(n,i.block,s)&&a.collapsed&&!a.getCommonAncestor().isReadOnly()){i=a.clone(),i.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),s=new CKEDITOR.dom.walker(i),s.guard=function(e){return!r(e)||e.type==CKEDITOR.NODE_COMMENT||e.isReadOnly()};if(!s.checkForward()||i.checkStartOfBlock()&&i.checkEndOfBlock())n=a.fixBlock(!0,n.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(n=n.getFirst(r))&&n.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(n.getText()).match(/^(?:&nbsp;|\xa0)$/)&&n.remove(),f=1,e.cancel()}f&&a.select()}function t(e,t){if(e.isFake)return 0;var n=t.block||t.blockLimit,i=n&&n.getLast(r);if(n&&n.isBlockBoundary()&&(!i||i.type!=CKEDITOR.NODE_ELEMENT||!i.isBlockBoundary())&&!n.is("pre")&&!n.getBogus())return n}function n(e){var t=e.data.getTarget();t.is("input")&&(t=t.getAttribute("type"),(t=="submit"||t=="reset")&&e.data.preventDefault())}function r(e){return h(e)&&p(e)}function i(e,t){return function(n){var r=CKEDITOR.dom.element.get(n.data.$.toElement||n.data.$.fromElement||n.data.$.relatedTarget);(!r||!t.equals(r)&&!t.contains(r))&&e.call(this,n)}}function s(e){function t(e){return function(t,i){i&&t.type==CKEDITOR.NODE_ELEMENT&&t.is(s)&&(n=t);if(!i&&r(t)&&(!e||!l(t)))return!1}}var n,i=e.getRanges()[0],e=e.root,s={table:1,ul:1,ol:1,dl:1};if(i.startPath().contains(s)){var o=i.clone();o.collapse(1),o.setStartAt(e,CKEDITOR.POSITION_AFTER_START),e=new CKEDITOR.dom.walker(o),e.guard=t(),e.checkBackward();if(n)return o=i.clone(),o.collapse(),o.setEndAt(n,CKEDITOR.POSITION_AFTER_END),e=new CKEDITOR.dom.walker(o),e.guard=t(!0),n=!1,e.checkForward(),n}return null}function o(e,t,n){return e.config.autoParagraph!==!1&&e.activeEnterMode!=CKEDITOR.ENTER_BR&&e.editable().equals(n)&&!t||t&&t.getAttribute("contenteditable")=="true"}function u(e){e.editor.focus(),e.editor.fire("saveSnapshot")}function a(e){var t=e.editor;t.getSelection().scrollIntoView(),setTimeout(function(){t.fire("saveSnapshot")},0)}function f(e,t,n){for(var r=e.getCommonAncestor(t),t=e=n?t:e;(e=e.getParent())&&!r.equals(e)&&e.getChildCount()==1;)t=e;t.remove()}CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(e,t){this.base(t.$||t),this.editor=e,this.status="unloaded",this.hasFocus=!1,this.setup()},proto:{focus:function(){var e;if(CKEDITOR.env.webkit&&!this.hasFocus){e=this.editor._.previousActive||this.getDocument().getActive();if(this.contains(e)){e.focus();return}}try{this.$[CKEDITOR.env.ie&&this.getDocument().equals(CKEDITOR.document)?"setActive":"focus"]()}catch(t){if(!CKEDITOR.env.ie)throw t}CKEDITOR.env.safari&&!this.isInline()&&(e=CKEDITOR.document.getActive(),e.equals(this.getWindow().getFrame())||this.getWindow().focus())},on:function(e,t){var n=Array.prototype.slice.call(arguments,0);return CKEDITOR.env.ie&&/^focus|blur$/.exec(e)&&(e=e=="focus"?"focusin":"focusout",t=i(t,this),n[0]=e,n[1]=t),CKEDITOR.dom.element.prototype.on.apply(this,n)},attachListener:function(e){!this._.listeners&&(this._.listeners=[]);var t=Array.prototype.slice.call(arguments,1),t=e.on.apply(e,t);return this._.listeners.push(t),t},clearListeners:function(){var e=this._.listeners;try{for(;e.length;)e.pop().removeListener()}catch(t){}},restoreAttrs:function(){var e=this._.attrChanges,t,n;for(n in e)e.hasOwnProperty(n)&&(t=e[n],t!==null?this.setAttribute(n,t):this.removeAttribute(n))},attachClass:function(e){var t=this.getCustomData("classes");this.hasClass(e)||(!t&&(t=[]),t.push(e),this.setCustomData("classes",t),this.addClass(e))},changeAttr:function(e,t){var n=this.getAttribute(e);t!==n&&(!this._.attrChanges&&(this._.attrChanges={}),e in this._.attrChanges||(this._.attrChanges[e]=n),this.setAttribute(e,t))},insertHtml:function(e,t){u(this),d(this,t||"html",e)},insertText:function(e){u(this);var t=this.editor,n=t.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:t.activeEnterMode,t=n==CKEDITOR.ENTER_BR,r=CKEDITOR.tools,e=r.htmlEncode(e.replace(/\r\n/g,"\n")),e=e.replace(/\t/g,"&nbsp;&nbsp; &nbsp;"),n=n==CKEDITOR.ENTER_P?"p":"div";if(!t){var i=/\n{2}/g;if(i.test(e))var s="<"+n+">",o="</"+n+">",e=s+e.replace(i,function(){return o+s})+o}e=e.replace(/\n/g,"<br>"),t||(e=e.replace(RegExp("<br>(?=</"+n+">)"),function(e){return r.repeat(e,2)})),e=e.replace(/^ | $/g,"&nbsp;"),e=e.replace(/(>|\s) /g,function(e,t){return t+"&nbsp;"}).replace(/ (?=<)/g,"&nbsp;"),d(this,"text",e)},insertElement:function(e,t){t?this.insertElementIntoRange(e,t):this.insertElementIntoSelection(e)},insertElementIntoRange:function(e,t){var n=this.editor,r=n.config.enterMode,i=e.getName(),s=CKEDITOR.dtd.$block[i];if(t.checkReadOnly())return!1;t.deleteContents(1),t.startContainer.type==CKEDITOR.NODE_ELEMENT&&t.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})&&v(t);var o,u;if(s)for(;(o=t.getCommonAncestor(0,1))&&(u=CKEDITOR.dtd[o.getName()])&&(!u||!u[i]);)o.getName()in CKEDITOR.dtd.span?t.splitElement(o):t.checkStartOfBlock()&&t.checkEndOfBlock()?(t.setStartBefore(o),t.collapse(!0),o.remove()):t.splitBlock(r==CKEDITOR.ENTER_DIV?"div":"p",n.editable());return t.insertNode(e),!0},insertElementIntoSelection:function(e){u(this);var t=this.editor,n=t.activeEnterMode,t=t.getSelection(),i=t.getRanges()[0],s=e.getName(),s=CKEDITOR.dtd.$block[s];this.insertElementIntoRange(e,i)&&(i.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),s&&((s=e.getNext(function(e){return r(e)&&!l(e)}))&&s.type==CKEDITOR.NODE_ELEMENT&&s.is(CKEDITOR.dtd.$block)?s.getDtd()["#"]?i.moveToElementEditStart(s):i.moveToElementEditEnd(e):!s&&n!=CKEDITOR.ENTER_BR&&(s=i.fixBlock(!0,n==CKEDITOR.ENTER_DIV?"div":"p"),i.moveToElementEditStart(s)))),t.selectRanges([i]),a(this)},setData:function(e,t){t||(e=this.editor.dataProcessor.toHtml(e)),this.setHtml(e),this.fixInitialSelection(),this.status=="unloaded"&&(this.status="ready"),this.editor.fire("dataReady")},getData:function(e){var t=this.getHtml();return e||(t=this.editor.dataProcessor.toDataFormat(t)),t},setReadOnly:function(e){this.setAttribute("contenteditable",!e)},detach:function(){this.removeClass("cke_editable"),this.status="detached";var e=this.editor;this._.detach(),delete e.document,delete e.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function e(){var e=n.getDocument().$,t=e.getSelection(),r;if(t.anchorNode&&t.anchorNode==n.$)r=!0;else if(CKEDITOR.env.webkit){var i=n.getDocument().getActive();i&&i.equals(n)&&!t.anchorNode&&(r=!0)}r&&(r=new CKEDITOR.dom.range(n),r.moveToElementEditStart(n),e=e.createRange(),e.setStart(r.startContainer.$,r.startOffset),e.collapse(!0),t.removeAllRanges(),t.addRange(e))}function t(){var e=n.getDocument().$,t=e.selection,r=n.getDocument().getActive();t.type=="None"&&r.equals(n)&&(t=new CKEDITOR.dom.range(n),e=e.body.createTextRange(),t.moveToElementEditStart(n),t=t.startContainer,t.type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent()),e.moveToElementText(t.$),e.collapse(!0),e.select())}var n=this;CKEDITOR.env.ie&&(CKEDITOR.env.version<9||CKEDITOR.env.quirks)?this.hasFocus&&(this.focus(),t()):this.hasFocus?(this.focus(),e()):this.once("focus",function(){e()},null,null,-999)},setup:function(){var e=this.editor;this.attachListener(e,"beforeGetData",function(){var t=this.getData();this.is("textarea")||e.config.ignoreEmptyParagraph!==!1&&(t=t.replace(c,function(e,t){return t})),e.setData(t,null,1)},this),this.attachListener(e,"getSnapshot",function(e){e.data=this.getData(1)},this),this.attachListener(e,"afterSetData",function(){this.setData(e.getData(1))},this),this.attachListener(e,"loadSnapshot",function(e){this.setData(e.data,1)},this),this.attachListener(e,"beforeFocus",function(){var t=e.getSelection();(t=t&&t.getNative())&&t.type=="Control"||this.focus()},this),this.attachListener(e,"insertHtml",function(e){this.insertHtml(e.data.dataValue,e.data.mode)},this),this.attachListener(e,"insertElement",function(e){this.insertElement(e.data)},this),this.attachListener(e,"insertText",function(e){this.insertText(e.data)},this),this.setReadOnly(e.readOnly),this.attachClass("cke_editable"),this.attachClass(e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"cke_editable_inline":e.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||e.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO?"cke_editable_themed":""),this.attachClass("cke_contents_"+e.config.contentsLangDirection),e.keystrokeHandler.blockedKeystrokes[8]=+e.readOnly,e.keystrokeHandler.attach(this),this.on("blur",function(){this.hasFocus=!1},null,null,-1),this.on("focus",function(){this.hasFocus=!0},null,null,-1),e.focusManager.add(this),this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,e.once("contentDom",function(){e.focusManager.focus(this)},this)),this.isInline()&&this.changeAttr("tabindex",e.tabIndex);if(!this.is("textarea")){e.document=this.getDocument(),e.window=this.getWindow();var t=e.document;this.changeAttr("spellcheck",!e.config.disableNativeSpellChecker);var i=e.config.contentsLangDirection;this.getDirection(1)!=i&&this.changeAttr("dir",i);var o=CKEDITOR.getCss();o&&(i=t.getHead(),i.getCustomData("stylesheet")||(o=t.appendStyleText(o),o=new CKEDITOR.dom.element(o.ownerNode||o.owningElement),i.setCustomData("stylesheet",o),o.data("cke-temp",1))),i=t.getCustomData("stylesheet_ref")||0,t.setCustomData("stylesheet_ref",i+1),this.setCustomData("cke_includeReadonly",!e.config.disableReadonlyStyling),this.attachListener(this,"click",function(e){var e=e.data,t=(new CKEDITOR.dom.elementPath(e.getTarget(),this)).contains("a");t&&e.$.button!=2&&t.isReadOnly()&&e.preventDefault()});var u={8:1,46:1};this.attachListener(e,"key",function(t){if(e.readOnly)return!0;var n=t.data.domEvent.getKey(),r;if(n in u){var t=e.getSelection(),i,o=t.getRanges()[0],a=o.startPath(),f,l,c,n=n==8;CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(i=t.getSelectedElement())||(i=s(t))?(e.fire("saveSnapshot"),o.moveToPosition(i,CKEDITOR.POSITION_BEFORE_START),i.remove(),o.select(),e.fire("saveSnapshot"),r=1):o.collapsed&&((f=a.block)&&(c=f[n?"getPrevious":"getNext"](h))&&c.type==CKEDITOR.NODE_ELEMENT&&c.is("table")&&o[n?"checkStartOfBlock":"checkEndOfBlock"]()?(e.fire("saveSnapshot"),o[n?"checkEndOfBlock":"checkStartOfBlock"]()&&f.remove(),o["moveToElementEdit"+(n?"End":"Start")](c),o.select(),e.fire("saveSnapshot"),r=1):a.blockLimit&&a.blockLimit.is("td")&&(l=a.blockLimit.getAscendant("table"))&&o.checkBoundaryOfElement(l,n?CKEDITOR.START:CKEDITOR.END)&&(c=l[n?"getPrevious":"getNext"](h))?(e.fire("saveSnapshot"),o["moveToElementEdit"+(n?"End":"Start")](c),o.checkStartOfBlock()&&o.checkEndOfBlock()?c.remove():o.select(),e.fire("saveSnapshot"),r=1):(l=a.contains(["td","th","caption"]))&&o.checkBoundaryOfElement(l,n?CKEDITOR.START:CKEDITOR.END)&&(r=1))}return!r}),e.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(t){t.data.getKeystroke()in u&&!this.getFirst(r)&&(this.appendBogus(),t=e.createRange(),t.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),t.select())}),this.attachListener(this,"dblclick",function(t){if(e.readOnly)return!1;t={element:t.data.getTarget()},e.fire("doubleclick",t)}),CKEDITOR.env.ie&&this.attachListener(this,"click",n),CKEDITOR.env.ie||this.attachListener(this,"mousedown",function(t){var n=t.data.getTarget();n.is("img","hr","input","textarea","select")&&!n.isReadOnly()&&(e.getSelection().selectElement(n),n.is("input","textarea","select")&&t.data.preventDefault())}),CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(t){if(t.data.$.button==2){t=t.data.getTarget();if(!t.getOuterHtml().replace(c,"")){var n=e.createRange();n.moveToElementEditStart(t),n.select(!0)}}}),CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(e){e.data.getTarget().is("input","select")&&e.data.preventDefault()}),this.attachListener(this,"mouseup",function(e){e.data.getTarget().is("input","textarea")&&e.data.preventDefault()})),CKEDITOR.env.webkit&&this.attachListener(e,"key",function(t){t=t.data.domEvent.getKey();if(t in u){var n=t==8,r=e.getSelection().getRanges()[0],t=r.startPath();if(r.collapsed){var i;e:{var s=t.block;if(s)if(r[n?"checkStartOfBlock":"checkEndOfBlock"]())if(!r.moveToClosestEditablePosition(s,!n)||!r.collapsed)i=!1;else{if(r.startContainer.type==CKEDITOR.NODE_ELEMENT){var o=r.startContainer.getChild(r.startOffset-(n?1:0));if(o&&o.type==CKEDITOR.NODE_ELEMENT&&o.is("hr")){e.fire("saveSnapshot"),o.remove(),i=!0;break e}}if((r=r.startPath().block)&&(!r||!r.contains(s))){e.fire("saveSnapshot");var a;(a=(n?r:s).getBogus())&&a.remove(),i=e.getSelection(),a=i.createBookmarks(),(n?s:r).moveChildren(n?r:s,!1),t.lastElement.mergeSiblings(),f(s,r,!n),i.selectBookmarks(a),i=!0}}else i=!1;else i=!1}if(!i)return}else{n=r,i=t.block,a=n.endPath().block,!i||!a||i.equals(a)?t=!1:(e.fire("saveSnapshot"),(s=i.getBogus())&&s.remove(),n.deleteContents(),a.getParent()&&(a.moveChildren(i,!1),t.lastElement.mergeSiblings(),f(i,a,!0)),n=e.getSelection().getRanges()[0],n.collapse(1),n.select(),t=!0);if(!t)return}return e.getSelection().scrollIntoView(),e.fire("saveSnapshot"),!1}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1),this.clearListeners(),this.restoreAttrs();var e;if(e=this.removeCustomData("classes"))for(;e.length;)this.removeClass(e.pop());if(!this.is("textarea")){e=this.getDocument();var t=e.getHead();if(t.getCustomData("stylesheet")){var n=e.getCustomData("stylesheet_ref");--n?e.setCustomData("stylesheet_ref",n):(e.removeCustomData("stylesheet_ref"),t.removeCustomData("stylesheet").remove())}}this.editor.fire("contentDomUnload"),delete this.editor}}}),CKEDITOR.editor.prototype.editable=function(e){var t=this._.editable;return t&&e?0:(arguments.length&&(t=this._.editable=e?e instanceof CKEDITOR.editable?e:new CKEDITOR.editable(this,e):(t&&t.detach(),null)),t)};var l=CKEDITOR.dom.walker.bogus(),c=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,h=CKEDITOR.dom.walker.whitespaces(!0),p=CKEDITOR.dom.walker.bookmark(!1,!0);CKEDITOR.on("instanceLoaded",function(t){var n=t.editor;n.on("insertElement",function(e){e=e.data,e.type==CKEDITOR.NODE_ELEMENT&&(e.is("input")||e.is("textarea"))&&(e.getAttribute("contentEditable")!="false"&&e.data("cke-editable",e.hasAttribute("contenteditable")?"true":"1"),e.setAttribute("contentEditable",!1))}),n.on("selectionChange",function(t){if(!n.readOnly){var r=n.getSelection();r&&!r.isLocked&&(r=n.checkDirty(),n.fire("lockSnapshot"),e(t),n.fire("unlockSnapshot"),!r&&n.resetDirty())}})}),CKEDITOR.on("instanceCreated",function(e){var t=e.editor;t.on("mode",function(){var e=t.editable();if(e&&e.isInline()){var n=t.title;e.changeAttr("role","textbox"),e.changeAttr("aria-label",n),n&&e.changeAttr("title",n);var r=t.fire("ariaEditorHelpLabel",{}).label;if(r)if(n=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var i=CKEDITOR.tools.getNextId(),r=CKEDITOR.dom.element.createFromHtml('<span id="'+i+'" class="cke_voice_label">'+r+"</span>");n.append(r),e.changeAttr("aria-describedby",i)}}})}),CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");var d=function(){function e(e){return e.type==CKEDITOR.NODE_ELEMENT}function t(n,r){var i,s,o,u,a=[],l=r.range.startContainer;i=r.range.startPath();for(var l=f[l.getName()],c=0,h=n.getChildren(),p=h.count(),d=-1,v=-1,m=0,g=i.contains(f.$list);c<p;++c)i=h.getItem(c),e(i)?(o=i.getName(),g&&o in CKEDITOR.dtd.$list?a=a.concat(t(i,r)):(u=!!l[o],o=="br"&&i.data("cke-eol")&&(!c||c==p-1)&&(m=(s=c?a[c-1].node:h.getItem(c+1))&&(!e(s)||!s.is("br")),s=s&&e(s)&&f.$block[s.getName()]),d==-1&&!u&&(d=c),u||(v=c),a.push({isElement:1,isLineBreak:m,isBlock:i.isBlockBoundary(),hasBlockSibling:s,node:i,name:o,allowed:u}),s=m=0)):a.push({isElement:0,node:i,allowed:1});return d>-1&&(a[d].firstNotAllowed=1),v>-1&&(a[v].lastNotAllowed=1),a}function n(t,r){var i=[],s=t.getChildren(),o=s.count(),u,a=0,l=f[r],c=!t.is(f.$inline)||t.is("br");for(c&&i.push(" ");a<o;a++)u=s.getItem(a),e(u)&&!u.is(l)?i=i.concat(n(u,r)):i.push(u);return c&&i.push(" "),i}function i(t){return t&&e(t)&&(t.is(f.$removeEmpty)||t.is("a")&&!t.isBlockBoundary())}function s(t,n,r,i){var o=t.clone(),u,a;o.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),(u=(new CKEDITOR.dom.walker(o)).next())&&e(u)&&l[u.getName()]&&(a=u.getPrevious())&&e(a)&&!a.getParent().equals(t.startContainer)&&r.contains(a)&&i.contains(u)&&u.isIdentical(a)&&(u.moveChildren(a),u.remove(),s(t,n,r,i))}function u(t,n){function r(t,n){if(n.isBlock&&n.isElement&&!n.node.is("br")&&e(t)&&t.is("br"))return t.remove(),1}var i=n.endContainer.getChild(n.endOffset),s=n.endContainer.getChild(n.endOffset-1);i&&r(i,t[t.length-1]),s&&r(s,t[0])&&(n.setEnd(n.endContainer,n.endOffset-1),n.collapse())}var f=CKEDITOR.dtd,l={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},c={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},h=CKEDITOR.tools.extend({},f.$inline);return delete h.br,function(l,p,d){var v=l.editor,y=v.getSelection().getRanges()[0],w=!1;p=="unfiltered_html"&&(p="html",w=!0);if(!y.checkReadOnly()){var E=(new CKEDITOR.dom.elementPath(y.startContainer,y.root)).blockLimit||y.root,p={type:p,dontFilter:w,editable:l,editor:v,range:y,blockLimit:E,mergeCandidates:[],zombies:[]},v=p.range,w=p.mergeCandidates,S,x,T,N;p.type=="text"&&v.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(S=CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",v.document),v.insertNode(S),v.setStartAfter(S)),x=new CKEDITOR.dom.elementPath(v.startContainer),p.endPath=T=new CKEDITOR.dom.elementPath(v.endContainer);if(!v.collapsed){var E=T.block||T.blockLimit,C=v.getCommonAncestor();E&&!E.equals(C)&&!E.contains(C)&&v.checkEndOfBlock()&&p.zombies.push(E),v.deleteContents()}for(;(N=e(v.startContainer)&&v.startContainer.getChild(v.startOffset-1))&&e(N)&&N.isBlockBoundary()&&x.contains(N);)v.moveToPosition(N,CKEDITOR.POSITION_BEFORE_END);s(v,p.blockLimit,x,T),S&&(v.setEndBefore(S),v.collapse(),S.remove()),S=v.startPath();if(E=S.contains(i,!1,1))v.splitElement(E),p.inlineStylesRoot=E,p.inlineStylesPeak=S.lastElement;S=v.createBookmark(),(E=S.startNode.getPrevious(r))&&e(E)&&i(E)&&w.push(E),(E=S.startNode.getNext(r))&&e(E)&&i(E)&&w.push(E);for(E=S.startNode;(E=E.getParent())&&i(E);)w.push(E);v.moveToBookmark(S);if(S=d){S=p.range;if(p.type=="text"&&p.inlineStylesRoot){N=p.inlineStylesPeak,v=N.getDocument().createText("{cke-peak}");for(w=p.inlineStylesRoot.getParent();!N.equals(w);)v=v.appendTo(N.clone()),N=N.getParent();d=v.getOuterHtml().split("{cke-peak}").join(d)}N=p.blockLimit.getName();if(/^\s+|\s+$/.test(d)&&"span"in CKEDITOR.dtd[N])var k='<span data-cke-marker="1">&nbsp;</span>',d=k+d+k;d=p.editor.dataProcessor.toHtml(d,{context:null,fixForBody:!1,dontFilter:p.dontFilter,filter:p.editor.activeFilter,enterMode:p.editor.activeEnterMode}),N=S.document.createElement("body"),N.setHtml(d),k&&(N.getFirst().remove(),N.getLast().remove());if((k=S.startPath().block)&&(k.getChildCount()!=1||!k.getBogus()))e:{var L;if(N.getChildCount()==1&&e(L=N.getFirst())&&L.is(c)){k=L.getElementsByTag("*"),S=0;for(w=k.count();S<w;S++){v=k.getItem(S);if(!v.is(h))break e}L.moveChildren(L.getParent(1)),L.remove()}}p.dataWrapper=N,S=d}if(S){L=p.range;var k=L.document,A,d=p.blockLimit;S=0;var O;N=[];var M,_,w=v=0,D,P;x=L.startContainer;var E=p.endPath.elements[0],H;T=E.getPosition(x),C=!!E.getCommonAncestor(x)&&T!=CKEDITOR.POSITION_IDENTICAL&&!(T&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED),x=t(p.dataWrapper,p);for(u(x,L);S<x.length;S++){T=x[S];if(A=T.isLineBreak){A=L,D=d;var B=void 0,F=void 0;T.hasBlockSibling?A=1:(B=A.startContainer.getAscendant(f.$block,1),!B||!B.is({div:1,p:1})?A=0:(F=B.getPosition(D),F==CKEDITOR.POSITION_IDENTICAL||F==CKEDITOR.POSITION_CONTAINS?A=0:(D=A.splitElement(B),A.moveToPosition(D,CKEDITOR.POSITION_AFTER_START),A=1)))}if(A)w=S>0;else{A=L.startPath(),!T.isBlock&&o(p.editor,A.block,A.blockLimit)&&(_=p.editor.activeEnterMode!=CKEDITOR.ENTER_BR&&p.editor.config.autoParagraph!==!1?p.editor.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":!1)&&(_=k.createElement(_),_.appendBogus(),L.insertNode(_),CKEDITOR.env.needsBrFiller&&(O=_.getBogus())&&O.remove(),L.moveToPosition(_,CKEDITOR.POSITION_BEFORE_END));if((A=L.startPath().block)&&!A.equals(M)){if(O=A.getBogus())O.remove(),N.push(A);M=A}T.firstNotAllowed&&(v=1);if(v&&T.isElement){A=L.startContainer;for(D=null;A&&!f[A.getName()][T.name];){if(A.equals(d)){A=null;break}D=A,A=A.getParent()}if(A)D&&(P=L.splitElement(D),p.zombies.push(P),p.zombies.push(D));else{D=d.getName(),H=!S,A=S==x.length-1,D=n(T.node,D);for(var B=[],F=D.length,I=0,q=void 0,R=0,U=-1;I<F;I++)q=D[I],q==" "?(!R&&(!H||I)&&(B.push(new CKEDITOR.dom.text(" ")),U=B.length),R=1):(B.push(q),R=0);A&&U==B.length&&B.pop(),H=B}}if(H){for(;A=H.pop();)L.insertNode(A);H=0}else L.insertNode(T.node);T.lastNotAllowed&&S<x.length-1&&((P=C?E:P)&&L.setEndAt(P,CKEDITOR.POSITION_AFTER_START),v=0),L.collapse()}}p.dontMoveCaret=w,p.bogusNeededBlocks=N}O=p.range;var z;P=p.bogusNeededBlocks;for(H=O.createBookmark();M=p.zombies.pop();)M.getParent()&&(_=O.clone(),_.moveToElementEditStart(M),_.removeEmptyBlocksAtEnd());if(P)for(;M=P.pop();)CKEDITOR.env.needsBrFiller?M.appendBogus():M.append(O.document.createText(" "));for(;M=p.mergeCandidates.pop();)M.mergeSiblings();O.moveToBookmark(H);if(!p.dontMoveCaret){for(M=e(O.startContainer)&&O.startContainer.getChild(O.startOffset-1);M&&e(M)&&!M.is(f.$empty);){if(M.isBlockBoundary())O.moveToPosition(M,CKEDITOR.POSITION_BEFORE_END);else{if(i(M)&&M.getHtml().match(/(\s|&nbsp;)$/g)){z=null;break}z=O.clone(),z.moveToPosition(M,CKEDITOR.POSITION_BEFORE_END)}M=M.getLast(r)}z&&O.moveToRange(z)}y.select(),a(l)}}}(),v=function(){function e(e){return e=new CKEDITOR.dom.walker(e),e.guard=function(e,t){if(t)return!1;if(e.type==CKEDITOR.NODE_ELEMENT)return e.is(CKEDITOR.dtd.$tableContent)},e.evaluator=function(e){return e.type==CKEDITOR.NODE_ELEMENT},e}function t(e,t,n){return t=e.getDocument().createElement(t),e.append(t,n),t}function n(e){var t=e.count(),n;for(t;t-->0;)n=e.getItem(t),CKEDITOR.tools.trim(n.getHtml())||(n.appendBogus(),CKEDITOR.env.ie&&CKEDITOR.env.version<9&&n.getChildCount()&&n.getFirst().remove())}return function(r){var i=r.startContainer,s=i.getAscendant("table",1),o=!1;n(s.getElementsByTag("td")),n(s.getElementsByTag("th")),s=r.clone(),s.setStart(i,0),s=e(s).lastBackward(),s||(s=r.clone(),s.setEndAt(i,CKEDITOR.POSITION_BEFORE_END),s=e(s).lastForward(),o=!0),s||(s=i),s.is("table")?(r.setStartAt(s,CKEDITOR.POSITION_BEFORE_START),r.collapse(!0),s.remove()):(s.is({tbody:1,thead:1,tfoot:1})&&(s=t(s,"tr",o)),s.is("tr")&&(s=t(s,s.getParent().is("thead")?"th":"td",o)),(i=s.getBogus())&&i.remove(),r.moveToPosition(s,o?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}()}(),function(){function e(){var e=this._.fakeSelection,t;if(e){t=this.getSelection(1);if(!t||!t.isHidden())e.reset(),e=0}if(!e){e=t||this.getSelection(1);if(!e||e.getType()==CKEDITOR.SELECTION_NONE)return}this.fire("selectionCheck",e),t=this.elementPath(),t.compare(this._.selectionPreviousPath)||(CKEDITOR.env.webkit&&(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=t,this.fire("selectionChange",{selection:e,path:t}))}function t(){d=!0,p||(n.call(this),p=CKEDITOR.tools.setTimeout(n,200,this))}function n(){p=null,d&&(CKEDITOR.tools.setTimeout(e,0,this),d=!1)}function r(e){return v(e)||e.type==CKEDITOR.NODE_ELEMENT&&!e.is(CKEDITOR.dtd.$empty)?!0:!1}function i(e){function t(t,n){return!t||t.type==CKEDITOR.NODE_TEXT?!1:e.clone()["moveToElementEdit"+(n?"End":"Start")](t)}if(e.root instanceof CKEDITOR.editable){var n=e.startContainer,i=e.getPreviousNode(r,null,n),s=e.getNextNode(r,null,n);return t(i)||t(s,1)||!i&&!s&&(n.type!=CKEDITOR.NODE_ELEMENT||!n.isBlockBoundary()||!n.getBogus())?!0:!1}return!1}function s(e){return e.getCustomData("cke-fillingChar")}function o(e,t){var n=e&&e.removeCustomData("cke-fillingChar");if(n){if(t!==!1){var r,i=e.getDocument().getSelection().getNative(),s=i&&i.type!="None"&&i.getRangeAt(0);n.getLength()>1&&s&&s.intersectsNode(n.$)&&(r=a(i),s=i.focusNode==n.$&&i.focusOffset>0,i.anchorNode==n.$&&i.anchorOffset>0&&r[0].offset--,s&&r[1].offset--)}n.setText(u(n.getText())),r&&f(e.getDocument().$,r)}}function u(e){return e.replace(/\u200B( )?/g,function(e){return e[1]?" ":""})}function a(e){return[{node:e.anchorNode,offset:e.anchorOffset},{node:e.focusNode,offset:e.focusOffset}]}function f(e,t){var n=e.getSelection(),r=e.createRange();r.setStart(t[0].node,t[0].offset),r.collapse(!0),n.removeAllRanges(),n.addRange(r),n.extend(t[1].node,t[1].offset)}function l(e){var t=CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="'+(CKEDITOR.env.ie?"display:none":"position:fixed;top:0;left:-1000px")+'">&nbsp;</div>',e.document);e.fire("lockSnapshot"),e.editable().append(t);var n=e.getSelection(1),r=e.createRange(),i=n.root.on("selectionchange",function(e){e.cancel()},null,null,0);r.setStartAt(t,CKEDITOR.POSITION_AFTER_START),r.setEndAt(t,CKEDITOR.POSITION_BEFORE_END),n.selectRanges([r]),i.removeListener(),e.fire("unlockSnapshot"),e._.hiddenSelectionContainer=t}function c(e){var t={37:1,39:1,8:1,46:1};return function(n){var r=n.data.getKeystroke();if(t[r]){var i=e.getSelection().getRanges(),s=i[0];i.length==1&&s.collapsed&&(r=s[r<38?"getPreviousEditableNode":"getNextEditableNode"]())&&r.type==CKEDITOR.NODE_ELEMENT&&r.getAttribute("contenteditable")=="false"&&(e.getSelection().fake(r),n.data.preventDefault(),n.cancel())}}}function h(e){for(var t=0;t<e.length;t++){var n=e[t];n.getCommonAncestor().isReadOnly()&&e.splice(t,1);if(!n.collapsed){if(n.startContainer.isReadOnly())for(var r=n.startContainer,i;r;){if((i=r.type==CKEDITOR.NODE_ELEMENT)&&r.is("body")||!r.isReadOnly())break;i&&r.getAttribute("contentEditable")=="false"&&n.setStartAfter(r),r=r.getParent()}r=n.startContainer,i=n.endContainer;var s=n.startOffset,o=n.endOffset,u=n.clone();r&&r.type==CKEDITOR.NODE_TEXT&&(s>=r.getLength()?u.setStartAfter(r):u.setStartBefore(r)),i&&i.type==CKEDITOR.NODE_TEXT&&(o?u.setEndAfter(i):u.setEndBefore(i)),r=new CKEDITOR.dom.walker(u),r.evaluator=function(r){if(r.type==CKEDITOR.NODE_ELEMENT&&r.isReadOnly()){var i=n.clone();return n.setEndBefore(r),n.collapsed&&e.splice(t--,1),r.getPosition(u.endContainer)&CKEDITOR.POSITION_CONTAINS||(i.setStartAfter(r),i.collapsed||e.splice(t+1,0,i)),!0}return!1},r.next()}}return e}var p,d,v=CKEDITOR.dom.walker.invisible(1),m=function(){function e(e){return function(t){var n=t.editor.createRange();return n.moveToClosestEditablePosition(t.selected,e)&&t.editor.getSelection().selectRanges([n]),!1}}function t(e){return function(t){var n=t.editor,r=n.createRange(),i;return(i=r.moveToClosestEditablePosition(t.selected,e))||(i=r.moveToClosestEditablePosition(t.selected,!e)),i&&n.getSelection().selectRanges([r]),n.fire("saveSnapshot"),t.selected.remove(),i||(r.moveToElementEditablePosition(n.editable()),n.getSelection().selectRanges([r])),n.fire("saveSnapshot"),!1}}var n=e(),r=e(1);return{37:n,38:n,39:r,40:r,8:t(),46:t(1)}}();CKEDITOR.on("instanceCreated",function(n){function r(){var e=i.getSelection();e&&e.removeAllRanges()}var i=n.editor;i.on("contentDom",function(){function n(){d=new CKEDITOR.dom.selection(i.getSelection()),d.lock()}function r(){u.removeListener("mouseup",r),l.removeListener("mouseup",r);var e=CKEDITOR.document.$.selection,t=e.createRange();e.type!="None"&&t.parentElement().ownerDocument==s.$&&t.select()}var s=i.document,u=CKEDITOR.document,a=i.editable(),f=s.getBody(),l=s.getDocumentElement(),h=a.isInline(),p,d;CKEDITOR.env.gecko&&a.attachListener(a,"focus",function(e){e.removeListener(),p!==0&&(e=i.getSelection().getNative())&&e.isCollapsed&&e.anchorNode==a.$&&(e=i.createRange(),e.moveToElementEditStart(a),e.select())},null,null,-2),a.attachListener(a,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){p&&CKEDITOR.env.webkit&&(p=i._.previousActive&&i._.previousActive.equals(s.getActive())),i.unlockSelection(p),p=0},null,null,-1),a.attachListener(a,"mousedown",function(){p=0});if(CKEDITOR.env.ie||h)g?a.attachListener(a,"beforedeactivate",n,null,null,-1):a.attachListener(i,"selectionCheck",n,null,null,-1),a.attachListener(a,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){i.lockSelection(d),p=1},null,null,-1),a.attachListener(a,"mousedown",function(){p=0});if(CKEDITOR.env.ie&&!h){var v;a.attachListener(a,"mousedown",function(e){if(e.data.$.button==2){e=i.document.getSelection();if(!e||e.getType()==CKEDITOR.SELECTION_NONE)v=i.window.getScrollPosition()}}),a.attachListener(a,"mouseup",function(e){e.data.$.button==2&&v&&(i.document.$.documentElement.scrollLeft=v.x,i.document.$.documentElement.scrollTop=v.y),v=null}),s.$.compatMode!="BackCompat"&&((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&l.on("mousedown",function(e){function t(e){e=e.data.$;if(r){var t=f.$.createTextRange();try{t.moveToPoint(e.clientX,e.clientY)}catch(n){}r.setEndPoint(s.compareEndPoints("StartToStart",t)<0?"EndToEnd":"StartToStart",t),r.select()}}function n(){l.removeListener("mousemove",t),u.removeListener("mouseup",n),l.removeListener("mouseup",n),r.select()}e=e.data;if(e.getTarget().is("html")&&e.$.y<l.$.clientHeight&&e.$.x<l.$.clientWidth){var r=f.$.createTextRange();try{r.moveToPoint(e.$.clientX,e.$.clientY)}catch(i){}var s=r.duplicate();l.on("mousemove",t),u.on("mouseup",n),l.on("mouseup",n)}}),CKEDITOR.env.version>7&&CKEDITOR.env.version<11&&l.on("mousedown",function(e){e.data.getTarget().is("html")&&(u.on("mouseup",r),l.on("mouseup",r))}))}a.attachListener(a,"selectionchange",e,i),a.attachListener(a,"keyup",t,i),a.attachListener(a,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){i.forceNextSelectionCheck(),i.selectionChange(1)});if(h&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var m;a.attachListener(a,"mousedown",function(){m=1}),a.attachListener(s.getDocumentElement(),"mouseup",function(){m&&t.call(i),m=0})}else a.attachListener(CKEDITOR.env.ie?a:s.getDocumentElement(),"mouseup",t,i);CKEDITOR.env.webkit&&a.attachListener(s,"keydown",function(e){switch(e.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:o(a)}},null,null,-1),a.attachListener(a,"keydown",c(i),null,null,-1)}),i.on("setData",function(){i.unlockSelection(),CKEDITOR.env.webkit&&r()}),i.on("contentDomUnload",function(){i.unlockSelection()}),CKEDITOR.env.ie9Compat&&i.on("beforeDestroy",r,null,null,9),i.on("dataReady",function(){delete i._.fakeSelection,delete i._.hiddenSelectionContainer,i.selectionChange(1)}),i.on("loadSnapshot",function(){var e=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),t=i.editable().getLast(e);t&&t.hasAttribute("data-cke-hidden-sel")&&(t.remove(),CKEDITOR.env.gecko&&(e=i.editable().getFirst(e))&&e.is("br")&&e.getAttribute("_moz_editor_bogus_node")&&e.remove())},null,null,100),i.on("key",function(e){if(i.mode=="wysiwyg"){var t=i.getSelection();if(t.isFake){var n=m[e.data.keyCode];if(n)return n({editor:i,selected:t.getSelectedElement(),selection:t,keyEvent:e})}}})}),CKEDITOR.on("instanceReady",function(e){function t(){var e=r.editable();if(e)if(e=s(e)){var t=r.document.$.getSelection();t.type!="None"&&(t.anchorNode==e.$||t.focusNode==e.$)&&(l=a(t)),i=e.getText(),e.setText(u(i))}}function n(){var e=r.editable();e&&(e=s(e))&&(e.setText(i),l&&(f(r.document.$,l),l=null))}var r=e.editor,i,l;CKEDITOR.env.webkit&&(r.on("selectionChange",function(){var e=r.editable(),t=s(e);t&&(t.getCustomData("ready")?o(e):t.setCustomData("ready",1))},null,null,-1),r.on("beforeSetMode",function(){o(r.editable())},null,null,-1),r.on("beforeUndoImage",t),r.on("afterUndoImage",n),r.on("beforeGetData",t,null,null,0),r.on("getData",n))}),CKEDITOR.editor.prototype.selectionChange=function(n){(n?e:t).call(this)},CKEDITOR.editor.prototype.getSelection=function(e){return(this._.savedSelection||this._.fakeSelection)&&!e?this._.savedSelection||this._.fakeSelection:(e=this.editable())&&this.mode=="wysiwyg"?new CKEDITOR.dom.selection(e):null},CKEDITOR.editor.prototype.lockSelection=function(e){return e=e||this.getSelection(1),e.getType()!=CKEDITOR.SELECTION_NONE?(!e.isLocked&&e.lock(),this._.savedSelection=e,!0):!1},CKEDITOR.editor.prototype.unlockSelection=function(e){var t=this._.savedSelection;return t?(t.unlock(e),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)},CKEDITOR.dom.range.prototype.select=function(){var e=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);return e.selectRanges([this]),e},CKEDITOR.SELECTION_NONE=1,CKEDITOR.SELECTION_TEXT=2,CKEDITOR.SELECTION_ELEMENT=3;var g=typeof window.getSelection!="function",y=1;CKEDITOR.dom.selection=function(e){if(e instanceof CKEDITOR.dom.selection)var t=e,e=e.root;var n=e instanceof CKEDITOR.dom.element;this.rev=t?t.rev:y++,this.document=e instanceof CKEDITOR.dom.document?e:e.getDocument(),this.root=n?e:this.document.getBody(),this.isLocked=0,this._={cache:{}};if(t)return CKEDITOR.tools.extend(this._.cache,t._.cache),this.isFake=t.isFake,this.isLocked=t.isLocked,this;var e=this.getNative(),r,i;if(e)if(e.getRangeAt)r=(i=e.rangeCount&&e.getRangeAt(0))&&new CKEDITOR.dom.node(i.commonAncestorContainer);else{try{i=e.createRange()}catch(s){}r=i&&CKEDITOR.dom.element.get(i.item&&i.item(0)||i.parentElement())}if(!r||r.type!=CKEDITOR.NODE_ELEMENT&&r.type!=CKEDITOR.NODE_TEXT||!this.root.equals(r)&&!this.root.contains(r))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var b={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.dom.selection.prototype={getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=g?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:g?function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_NONE;try{var n=this.getNative(),r=n.type;r=="Text"&&(t=CKEDITOR.SELECTION_TEXT),r=="Control"&&(t=CKEDITOR.SELECTION_ELEMENT),n.createRange().parentElement()&&(t=CKEDITOR.SELECTION_TEXT)}catch(i){}return e.type=t}:function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_TEXT,n=this.getNative();if(!n||!n.rangeCount)t=CKEDITOR.SELECTION_NONE;else if(n.rangeCount==1){var n=n.getRangeAt(0),r=n.startContainer;r==n.endContainer&&r.nodeType==1&&n.endOffset-n.startOffset==1&&b[r.childNodes[n.startOffset].nodeName.toLowerCase()]&&(t=CKEDITOR.SELECTION_ELEMENT)}return e.type=t},getRanges:function(){var e=g?function(){function e(e){return(new CKEDITOR.dom.node(e)).getIndex()}var t=function(t,n){t=t.duplicate(),t.collapse(n);var r=t.parentElement();if(!r.hasChildNodes())return{container:r,offset:0};for(var i=r.children,s,o,u=t.duplicate(),a=0,f=i.length-1,l=-1,c,h;a<=f;){l=Math.floor((a+f)/2),s=i[l],u.moveToElementText(s),c=u.compareEndPoints("StartToStart",t);if(c>0)f=l-1;else{if(!(c<0))return{container:r,offset:e(s)};a=l+1}}if(l==-1||l==i.length-1&&c<0){u.moveToElementText(r),u.setEndPoint("StartToStart",t),u=u.text.replace(/(\r\n|\r)/g,"\n").length,i=r.childNodes;if(!u)return s=i[i.length-1],s.nodeType!=CKEDITOR.NODE_TEXT?{container:r,offset:i.length}:{container:s,offset:s.nodeValue.length};for(r=i.length;u>0&&r>0;)o=i[--r],o.nodeType==CKEDITOR.NODE_TEXT&&(h=o,u-=o.nodeValue.length);return{container:h,offset:-u}}u.collapse(c>0?!0:!1),u.setEndPoint(c>0?"StartToStart":"EndToStart",t),u=u.text.replace(/(\r\n|\r)/g,"\n").length;if(!u)return{container:r,offset:e(s)+(c>0?0:1)};for(;u>0;)try{o=s[c>0?"previousSibling":"nextSibling"],o.nodeType==CKEDITOR.NODE_TEXT&&(u-=o.nodeValue.length,h=o),s=o}catch(p){return{container:r,offset:e(s)}}return{container:h,offset:c>0?-u:h.nodeValue.length+u}};return function(){var e=this.getNative(),n=e&&e.createRange(),r=this.getType();if(!e)return[];if(r==CKEDITOR.SELECTION_TEXT)return e=new CKEDITOR.dom.range(this.root),r=t(n,!0),e.setStart(new CKEDITOR.dom.node(r.container),r.offset),r=t(n),e.setEnd(new CKEDITOR.dom.node(r.container),r.offset),e.endContainer.getPosition(e.startContainer)&CKEDITOR.POSITION_PRECEDING&&e.endOffset<=e.startContainer.getIndex()&&e.collapse(),[e];if(r==CKEDITOR.SELECTION_ELEMENT){for(var r=[],i=0;i<n.length;i++){for(var s=n.item(i),o=s.parentNode,u=0,e=new CKEDITOR.dom.range(this.root);u<o.childNodes.length&&o.childNodes[u]!=s;u++);e.setStart(new CKEDITOR.dom.node(o),u),e.setEnd(new CKEDITOR.dom.node(o),u+1),r.push(e)}return r}return[]}}():function(){var e=[],t,n=this.getNative();if(!n)return e;for(var r=0;r<n.rangeCount;r++){var i=n.getRangeAt(r);t=new CKEDITOR.dom.range(this.root),t.setStart(new CKEDITOR.dom.node(i.startContainer),i.startOffset),t.setEnd(new CKEDITOR.dom.node(i.endContainer),i.endOffset),e.push(t)}return e};return function(t){var n=this._.cache,r=n.ranges;return r||(n.ranges=r=new CKEDITOR.dom.rangeList(e.call(this))),t?h(new CKEDITOR.dom.rangeList(r.slice())):r}}(),getStartElement:function(){var e=this._.cache;if(e.startElement!==void 0)return e.startElement;var t;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var n=this.getRanges()[0];if(n){if(n.collapsed)t=n.startContainer,t.type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent());else{for(n.optimize();;){t=n.startContainer;if(n.startOffset!=(t.getChildCount?t.getChildCount():t.getLength())||!!t.isBlockBoundary())break;n.setStartAfter(t)}t=n.startContainer;if(t.type!=CKEDITOR.NODE_ELEMENT)return t.getParent();t=t.getChild(n.startOffset);if(!t||t.type!=CKEDITOR.NODE_ELEMENT)t=n.startContainer;else for(n=t.getFirst();n&&n.type==CKEDITOR.NODE_ELEMENT;)t=n,n=n.getFirst()}t=t.$}}return e.startElement=t?new CKEDITOR.dom.element(t):null},getSelectedElement:function(){var e=this._.cache;if(e.selectedElement!==void 0)return e.selectedElement;var t=this,n=CKEDITOR.tools.tryThese(function(){return t.getNative().createRange().item(0)},function(){for(var e=t.getRanges()[0].clone(),n,r,i=2;i&&(!(n=e.getEnclosedNode())||n.type!=CKEDITOR.NODE_ELEMENT||!b[n.getName()]||!(r=n));i--)e.shrink(CKEDITOR.SHRINK_ELEMENT);return r&&r.$});return e.selectedElement=n?new CKEDITOR.dom.element(n):null},getSelectedText:function(){var e=this._.cache;if(e.selectedText!==void 0)return e.selectedText;var t=this.getNative(),t=g?t.type=="Control"?"":t.createRange().text:t.toString();return e.selectedText=t},lock:function(){this.getRanges(),this.getStartElement(),this.getSelectedElement(),this.getSelectedText(),this._.cache.nativeSel=null,this.isLocked=1},unlock:function(e){if(this.isLocked){if(e)var t=this.getSelectedElement(),n=!t&&this.getRanges(),r=this.isFake;this.isLocked=0,this.reset(),e&&(e=t||n[0]&&n[0].getCommonAncestor())&&e.getAscendant("body",1)&&(r?this.fake(t):t?this.selectElement(t):this.selectRanges(n))}},reset:function(){this._.cache={},this.isFake=0;var e=this.root.editor;if(e&&e._.fakeSelection&&this.rev==e._.fakeSelection.rev){delete e._.fakeSelection;var t=e._.hiddenSelectionContainer;if(t){var n=e.checkDirty();e.fire("lockSnapshot"),t.remove(),e.fire("unlockSnapshot"),!n&&e.resetDirty()}delete e._.hiddenSelectionContainer}this.rev=y++},selectElement:function(e){var t=new CKEDITOR.dom.range(this.root);t.setStartBefore(e),t.setEndAfter(e),this.selectRanges([t])},selectRanges:function(e){var t=this.root.editor,t=t&&t._.hiddenSelectionContainer;this.reset();if(t)for(var t=this.root,n,r=0;r<e.length;++r)n=e[r],n.endContainer.equals(t)&&(n.endOffset=Math.min(n.endOffset,t.getChildCount()));if(e.length)if(this.isLocked){var s=CKEDITOR.document.getActive();this.unlock(),this.selectRanges(e),this.lock(),s&&!s.equals(this.root)&&s.focus()}else{var u;e:{var a,f;if(e.length==1&&!(f=e[0]).collapsed&&(u=f.getEnclosedNode())&&u.type==CKEDITOR.NODE_ELEMENT){f=f.clone(),f.shrink(CKEDITOR.SHRINK_ELEMENT,!0),(a=f.getEnclosedNode())&&a.type==CKEDITOR.NODE_ELEMENT&&(u=a);if(u.getAttribute("contenteditable")=="false")break e}u=void 0}if(u)this.fake(u);else{if(g){f=CKEDITOR.dom.walker.whitespaces(!0),a=/\ufeff|\u00a0/,t={table:1,tbody:1,tr:1},e.length>1&&(u=e[e.length-1],e[0].setEnd(u.endContainer,u.endOffset)),u=e[0];var e=u.collapsed,l,c,h;if((n=u.getEnclosedNode())&&n.type==CKEDITOR.NODE_ELEMENT&&n.getName()in b&&(!n.is("a")||!n.getText()))try{h=n.$.createControlRange(),h.addElement(n.$),h.select();return}catch(p){}if(u.startContainer.type==CKEDITOR.NODE_ELEMENT&&u.startContainer.getName()in t||u.endContainer.type==CKEDITOR.NODE_ELEMENT&&u.endContainer.getName()in t)u.shrink(CKEDITOR.NODE_ELEMENT,!0),e=u.collapsed;h=u.createBookmark(),t=h.startNode,e||(s=h.endNode),h=u.document.$.body.createTextRange(),h.moveToElementText(t.$),h.moveStart("character",1),s?(a=u.document.$.body.createTextRange(),a.moveToElementText(s.$),h.setEndPoint("EndToEnd",a),h.moveEnd("character",-1)):(l=t.getNext(f),c=t.hasAscendant("pre"),l=!(l&&l.getText&&l.getText().match(a))&&(c||!t.hasPrevious()||t.getPrevious().is&&t.getPrevious().is("br")),c=u.document.createElement("span"),c.setHtml("&#65279;"),c.insertBefore(t),l&&u.document.createText("﻿").insertBefore(t)),u.setStartBefore(t),t.remove(),e?(l?(h.moveStart("character",-1),h.select(),u.document.$.selection.clear()):h.select(),u.moveToPosition(c,CKEDITOR.POSITION_BEFORE_START),c.remove()):(u.setEndBefore(s),s.remove(),h.select())}else{s=this.getNative();if(!s)return;this.removeAllRanges();for(h=0;h<e.length;h++){if(h<e.length-1){l=e[h],c=e[h+1],a=l.clone(),a.setStart(l.endContainer,l.endOffset),a.setEnd(c.startContainer,c.startOffset);if(!a.collapsed){a.shrink(CKEDITOR.NODE_ELEMENT,!0),u=a.getCommonAncestor(),a=a.getEnclosedNode();if(u.isReadOnly()||a&&a.isReadOnly()){c.setStart(l.startContainer,l.startOffset),e.splice(h--,1);continue}}}u=e[h],c=this.document.$.createRange(),u.collapsed&&CKEDITOR.env.webkit&&i(u)&&(l=this.root,o(l,!1),a=l.getDocument().createText("​"),l.setCustomData("cke-fillingChar",a),u.insertNode(a),(l=a.getNext())&&!a.getPrevious()&&l.type==CKEDITOR.NODE_ELEMENT&&l.getName()=="br"?(o(this.root),u.moveToPosition(l,CKEDITOR.POSITION_BEFORE_START)):u.moveToPosition(a,CKEDITOR.POSITION_AFTER_END)),c.setStart(u.startContainer.$,u.startOffset);try{c.setEnd(u.endContainer.$,u.endOffset)}catch(d){if(!(d.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0))throw d;u.collapse(1),c.setEnd(u.endContainer.$,u.endOffset)}s.addRange(c)}}this.reset(),this.root.fire("selectionchange")}}},fake:function(e){var t=this.root.editor;this.reset(),l(t);var n=this._.cache,r=new CKEDITOR.dom.range(this.root);r.setStartBefore(e),r.setEndAfter(e),n.ranges=new CKEDITOR.dom.rangeList(r),n.selectedElement=n.startElement=e,n.type=CKEDITOR.SELECTION_ELEMENT,n.selectedText=n.nativeSel=null,this.isFake=1,this.rev=y++,t._.fakeSelection=this,this.root.fire("selectionchange")},isHidden:function(){var e=this.getCommonAncestor();return e&&e.type==CKEDITOR.NODE_TEXT&&(e=e.getParent()),!!e&&!!e.data("cke-hidden-sel")},createBookmarks:function(e){return e=this.getRanges().createBookmarks(e),this.isFake&&(e.isFake=1),e},createBookmarks2:function(e){return e=this.getRanges().createBookmarks2(e),this.isFake&&(e.isFake=1),e},selectBookmarks:function(e){for(var t=[],n=0;n<e.length;n++){var r=new CKEDITOR.dom.range(this.root);r.moveToBookmark(e[n]),t.push(r)}return e.isFake?this.fake(t[0].getEnclosedNode()):this.selectRanges(t),this},getCommonAncestor:function(){var e=this.getRanges();return e.length?e[0].startContainer.getCommonAncestor(e[e.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var e=this.getNative();try{e&&e[g?"empty":"removeAllRanges"]()}catch(t){}this.reset()}}}}(),"use strict",CKEDITOR.STYLE_BLOCK=1,CKEDITOR.STYLE_INLINE=2,CKEDITOR.STYLE_OBJECT=3,function(){function e(e,t){for(var n,r;e=e.getParent();){if(e.equals(t))break;if(e.getAttribute("data-nostyle"))n=e;else if(!r){var i=e.getAttribute("contentEditable");i=="false"?n=e:i=="true"&&(r=1)}}return n}function t(n){var i=n.document;if(n.collapsed)i=m(this,i),n.insertNode(i),n.moveToPosition(i,CKEDITOR.POSITION_BEFORE_END);else{var s=this.element,o=this._.definition,u,a=o.ignoreReadonly,f=a||o.includeReadonly;f==null&&(f=n.root.getCustomData("cke_includeReadonly"));var l=CKEDITOR.dtd[s];l||(u=!0,l=CKEDITOR.dtd.span),n.enlarge(CKEDITOR.ENLARGE_INLINE,1),n.trim();var c=n.createBookmark(),h=c.startNode,d=c.endNode,v=h,g;if(!a){var y=n.getCommonAncestor(),a=e(h,y),y=e(d,y);a&&(v=a.getNextSourceNode(!0)),y&&(d=y)}for(v.getPosition(d)==CKEDITOR.POSITION_FOLLOWING&&(v=0);v;){a=!1;if(v.equals(d))v=null,a=!0;else{var b=v.type==CKEDITOR.NODE_ELEMENT?v.getName():null,y=b&&v.getAttribute("contentEditable")=="false",w=b&&v.getAttribute("data-nostyle");if(b&&v.data("cke-bookmark")){v=v.getNextSourceNode(!0);continue}if(y&&f&&CKEDITOR.dtd.$block[b])for(var E=v,S=r(E),x=void 0,T=S.length,N=0,E=T&&new CKEDITOR.dom.range(E.getDocument());N<T;++N){var x=S[N],k=CKEDITOR.filter.instances[x.data("cke-filter")];if(k?k.check(this):1)E.selectNodeContents(x),t.call(this,E)}S=b?!l[b]||w?0:y&&!f?0:(v.getPosition(d)|L)==L&&(!o.childRule||o.childRule(v)):1;if(S)if((S=v.getParent())&&((S.getDtd()||CKEDITOR.dtd.span)[s]||u)&&(!o.parentRule||o.parentRule(S))){!g&&(!b||!CKEDITOR.dtd.$removeEmpty[b]||(v.getPosition(d)|L)==L)&&(g=n.clone(),g.setStartBefore(v)),b=v.type;if(b==CKEDITOR.NODE_TEXT||y||b==CKEDITOR.NODE_ELEMENT&&!v.getChildCount()){for(var b=v,O;(a=!b.getNext(C))&&(O=b.getParent(),l[O.getName()])&&(O.getPosition(h)|A)==A&&(!o.childRule||o.childRule(O));)b=O;g.setEndAfter(b)}}else a=!0;else a=!0;v=v.getNextSourceNode(w||y)}if(a&&g&&!g.collapsed){for(var a=m(this,i),y=a.hasAttributes(),w=g.getCommonAncestor(),b={},S={},x={},T={},M,_,P;a&&w;){if(w.getName()==s){for(M in o.attributes)!T[M]&&(P=w.getAttribute(_))&&(a.getAttribute(M)==P?S[M]=1:T[M]=1);for(_ in o.styles)!x[_]&&(P=w.getStyle(_))&&(a.getStyle(_)==P?b[_]=1:x[_]=1)}w=w.getParent()}for(M in S)a.removeAttribute(M);for(_ in b)a.removeStyle(_);y&&!a.hasAttributes()&&(a=null),a?(g.extractContents().appendTo(a),g.insertNode(a),p.call(this,a),a.mergeSiblings(),CKEDITOR.env.ie||a.$.normalize()):(a=new CKEDITOR.dom.element("span"),g.extractContents().appendTo(a),g.insertNode(a),p.call(this,a),a.remove(!0)),g=null}}n.moveToBookmark(c),n.shrink(CKEDITOR.SHRINK_TEXT),n.shrink(CKEDITOR.NODE_ELEMENT,!0)}}function n(e){function t(){for(var e=new CKEDITOR.dom.elementPath(r.getParent()),t=new CKEDITOR.dom.elementPath(f.getParent()),n=null,i=null,s=0;s<e.elements.length;s++){var o=e.elements[s];if(o==e.block||o==e.blockLimit)break;l.checkElementRemovable(o,!0)&&(n=o)}for(s=0;s<t.elements.length;s++){o=t.elements[s];if(o==t.block||o==t.blockLimit)break;l.checkElementRemovable(o,!0)&&(i=o)}i&&f.breakParent(i),n&&r.breakParent(n)}e.enlarge(CKEDITOR.ENLARGE_INLINE,1);var n=e.createBookmark(),r=n.startNode;if(e.collapsed){for(var i=new CKEDITOR.dom.elementPath(r.getParent(),e.root),s,o=0,u;o<i.elements.length&&(u=i.elements[o]);o++){if(u==i.block||u==i.blockLimit)break;if(this.checkElementRemovable(u)){var a;e.collapsed&&(e.checkBoundaryOfElement(u,CKEDITOR.END)||(a=e.checkBoundaryOfElement(u,CKEDITOR.START)))?(s=u,s.match=a?"start":"end"):(u.mergeSiblings(),u.is(this.element)?h.call(this,u):d(u,b(this)[u.getName()]))}}if(s){u=r;for(o=0;;o++){a=i.elements[o];if(a.equals(s))break;if(a.match)continue;a=a.clone(),a.append(u),u=a}u[s.match=="start"?"insertBefore":"insertAfter"](s)}}else{var f=n.endNode,l=this;t();for(i=r;!i.equals(f);)s=i.getNextSourceNode(),i.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(i)&&(i.getName()==this.element?h.call(this,i):d(i,b(this)[i.getName()]),s.type==CKEDITOR.NODE_ELEMENT&&s.contains(r)&&(t(),s=r.getNext())),i=s}e.moveToBookmark(n),e.shrink(CKEDITOR.NODE_ELEMENT,!0)}function r(e){var t=[];return e.forEach(function(e){if(e.getAttribute("contenteditable")=="true")return t.push(e),!1},CKEDITOR.NODE_ELEMENT,!0),t}function i(e){var t=e.getEnclosedNode()||e.getCommonAncestor(!1,!0);(e=(new CKEDITOR.dom.elementPath(t,e.root)).contains(this.element,1))&&!e.isReadOnly()&&g(e,this)}function s(e){var t=e.getCommonAncestor(!0,!0);if(e=(new CKEDITOR.dom.elementPath(t,e.root)).contains(this.element,1)){var t=this._.definition,n=t.attributes;if(n)for(var r in n)e.removeAttribute(r,n[r]);if(t.styles)for(var i in t.styles)t.styles.hasOwnProperty(i)&&e.removeStyle(i)}}function o(e){var t=e.createBookmark(!0),n=e.createIterator();n.enforceRealBlocks=!0,this._.enterMode&&(n.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var r,i=e.document,s;r=n.getNextParagraph();)!r.isReadOnly()&&(n.activeFilter?n.activeFilter.check(this):1)&&(s=m(this,i,r),a(r,s));e.moveToBookmark(t)}function u(e){var t=e.createBookmark(1),n=e.createIterator();n.enforceRealBlocks=!0,n.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var r,i;r=n.getNextParagraph();)this.checkElementRemovable(r)&&(r.is("pre")?((i=this._.enterMode==CKEDITOR.ENTER_BR?null:e.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&r.copyAttributes(i),a(r,i)):h.call(this,r));e.moveToBookmark(t)}function a(e,t){var n=!t;n&&(t=e.getDocument().createElement("div"),e.copyAttributes(t));var r=t&&t.is("pre"),i=e.is("pre"),s=!r&&i;if(r&&!i){i=t,(s=e.getBogus())&&s.remove(),s=e.getHtml(),s=l(s,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,""),s=s.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1"),s=s.replace(/([ \t\n\r]+|&nbsp;)/g," "),s=s.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var o=e.getDocument().createElement("div");o.append(i),i.$.outerHTML="<pre>"+s+"</pre>",i.copyAttributes(o.getFirst()),i=o.getFirst().remove()}else i.setHtml(s);t=i}else s?t=c(n?[e.getHtml()]:f(e),t):e.moveChildren(t);t.replace(e);if(r){var n=t,u;(u=n.getPrevious(k))&&u.type==CKEDITOR.NODE_ELEMENT&&u.is("pre")&&(r=l(u.getHtml(),/\n$/,"")+"\n\n"+l(n.getHtml(),/^\n/,""),CKEDITOR.env.ie?n.$.outerHTML="<pre>"+r+"</pre>":n.setHtml(r),u.remove())}else n&&v(t)}function f(e){var t=[];return l(e.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(e,t,n){return t+"</pre>"+n+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(e,n){t.push(n)}),t}function l(e,t,n){var r="",i="",e=e.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(e,t,n){return t&&(r=t),n&&(i=n),""});return r+e.replace(t,n)+i}function c(e,t){var n;e.length>1&&(n=new CKEDITOR.dom.documentFragment(t.getDocument()));for(var r=0;r<e.length;r++){var i=e[r],i=i.replace(/(\r\n|\r)/g,"\n"),i=l(i,/^[ \t]*\n/,""),i=l(i,/\n$/,""),i=l(i,/^[ \t]+|[ \t]+$/g,function(e,t){return e.length==1?"&nbsp;":t?" "+CKEDITOR.tools.repeat("&nbsp;",e.length-1):CKEDITOR.tools.repeat("&nbsp;",e.length-1)+" "}),i=i.replace(/\n/g,"<br>"),i=i.replace(/[ \t]{2,}/g,function(e){return CKEDITOR.tools.repeat("&nbsp;",e.length-1)+" "});if(n){var s=t.clone();s.setHtml(i),n.append(s)}else t.setHtml(i)}return n||t}function h(e,t){var n=this._.definition,r=n.attributes,n=n.styles,i=b(this)[e.getName()],s=CKEDITOR.tools.isEmpty(r)&&CKEDITOR.tools.isEmpty(n),o;for(o in r)(o!="class"&&!this._.definition.fullMatch||e.getAttribute(o)==w(o,r[o]))&&(!t||o.slice(0,5)!="data-")&&(s=e.hasAttribute(o),e.removeAttribute(o));for(var u in n)if(!this._.definition.fullMatch||e.getStyle(u)==w(u,n[u],true))s=s||!!e.getStyle(u),e.removeStyle(u);d(e,i,S[e.getName()]),s&&(this._.definition.alwaysRemoveElement?v(e,1):!CKEDITOR.dtd.$block[e.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!e.hasAttributes()?v(e):e.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function p(e){for(var t=b(this),n=e.getElementsByTag(this.element),r,i=n.count();--i>=0;)r=n.getItem(i),r.isReadOnly()||h.call(this,r,!0);for(var s in t)if(s!=this.element){n=e.getElementsByTag(s);for(i=n.count()-1;i>=0;i--)r=n.getItem(i),r.isReadOnly()||d(r,t[s])}}function d(e,t,n){if(t=t&&t.attributes)for(var r=0;r<t.length;r++){var i=t[r][0],s;if(s=e.getAttribute(i)){var o=t[r][1];(o===null||o.test&&o.test(s)||typeof o=="string"&&s==o)&&e.removeAttribute(i)}}n||v(e)}function v(e,t){if(!e.hasAttributes()||t)if(CKEDITOR.dtd.$block[e.getName()]){var n=e.getPrevious(k),r=e.getNext(k);n&&(n.type==CKEDITOR.NODE_TEXT||!n.isBlockBoundary({br:1}))&&e.append("br",1),r&&(r.type==CKEDITOR.NODE_TEXT||!r.isBlockBoundary({br:1}))&&e.append("br"),e.remove(!0)}else n=e.getFirst(),r=e.getLast(),e.remove(!0),n&&(n.type==CKEDITOR.NODE_ELEMENT&&n.mergeSiblings(),r&&!n.equals(r)&&r.type==CKEDITOR.NODE_ELEMENT&&r.mergeSiblings())}function m(e,t,n){var r;return r=e.element,r=="*"&&(r="span"),r=new CKEDITOR.dom.element(r,t),n&&n.copyAttributes(r),r=g(r,e),t.getCustomData("doc_processing_style")&&r.hasAttribute("id")?r.removeAttribute("id"):t.setCustomData("doc_processing_style",1),r}function g(e,t){var n=t._.definition,r=n.attributes,n=CKEDITOR.style.getStyleText(n);if(r)for(var i in r)e.setAttribute(i,r[i]);return n&&e.setAttribute("style",n),e}function y(e,t){for(var n in e)e[n]=e[n].replace(N,function(e,n){return t[n]})}function b(e){if(e._.overrides)return e._.overrides;var t=e._.overrides={},n=e._.definition.overrides;if(n){CKEDITOR.tools.isArray(n)||(n=[n]);for(var r=0;r<n.length;r++){var i=n[r],s,o;typeof i=="string"?s=i.toLowerCase():(s=i.element?i.element.toLowerCase():e.element,o=i.attributes),i=t[s]||(t[s]={});if(o){var i=i.attributes=i.attributes||[],u;for(u in o)i.push([u.toLowerCase(),o[u]])}}}return t}function w(e,t,n){var r=new CKEDITOR.dom.element("span");return r[n?"setStyle":"setAttribute"](e,t),r[n?"getStyle":"getAttribute"](e)}function E(e,t,n){for(var r=e.document,i=e.getRanges(),t=t?this.removeFromRange:this.applyToRange,s,o=i.createIterator();s=o.getNextRange();)t.call(this,s,n);e.selectRanges(i),r.removeCustomData("doc_processing_style")}var S={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},x={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},T=/\s*(?:;\s*|$)/,N=/#\((.+?)\)/g,C=CKEDITOR.dom.walker.bookmark(0,1),k=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(e,t){if(typeof e.type=="string")return new CKEDITOR.style.customHandlers[e.type](e);var n=e.attributes;n&&n.style&&(e.styles=CKEDITOR.tools.extend({},e.styles,CKEDITOR.tools.parseCssText(n.style)),delete n.style),t&&(e=CKEDITOR.tools.clone(e),y(e.attributes,t),y(e.styles,t)),n=this.element=e.element?typeof e.element=="string"?e.element.toLowerCase():e.element:"*",this.type=e.type||(S[n]?CKEDITOR.STYLE_BLOCK:x[n]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE),typeof this.element=="object"&&(this.type=CKEDITOR.STYLE_OBJECT),this._={definition:e}},CKEDITOR.style.prototype={apply:function(e){if(e instanceof CKEDITOR.dom.document)return E.call(this,e.getSelection());if(this.checkApplicable(e.elementPath(),e)){var t=this._.enterMode;t||(this._.enterMode=e.activeEnterMode),E.call(this,e.getSelection(),0,e),this._.enterMode=t}},remove:function(e){if(e instanceof CKEDITOR.dom.document)return E.call(this,e.getSelection(),1);if(this.checkApplicable(e.elementPath(),e)){var t=this._.enterMode;t||(this._.enterMode=e.activeEnterMode),E.call(this,e.getSelection(),1,e),this._.enterMode=t}},applyToRange:function(e){return this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?t:this.type==CKEDITOR.STYLE_BLOCK?o:this.type==CKEDITOR.STYLE_OBJECT?i:null,this.applyToRange(e)},removeFromRange:function(e){return this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?n:this.type==CKEDITOR.STYLE_BLOCK?u:this.type==CKEDITOR.STYLE_OBJECT?s:null,this.removeFromRange(e)},applyToObject:function(e){g(e,this)},checkActive:function(e,t){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(e.block||e.blockLimit,!0,t);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var n=e.elements,r=0,i;r<n.length;r++){i=n[r];if(this.type!=CKEDITOR.STYLE_INLINE||i!=e.block&&i!=e.blockLimit){if(this.type==CKEDITOR.STYLE_OBJECT){var s=i.getName();if(!(typeof this.element=="string"?s==this.element:s in this.element))continue}if(this.checkElementRemovable(i,!0,t))return!0}}}return!1},checkApplicable:function(e,t,n){t&&t instanceof CKEDITOR.filter&&(n=t);if(n&&!n.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!e.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!e.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(e,t){var n=this._.definition;if(!e||!n.ignoreReadonly&&e.isReadOnly())return!1;var r=e.getName();if(typeof this.element=="string"?r==this.element:r in this.element){if(!t&&!e.hasAttributes())return!0;if(r=n._AC)n=r;else{var r={},i=0,s=n.attributes;if(s)for(var o in s)i++,r[o]=s[o];if(o=CKEDITOR.style.getStyleText(n))r.style||i++,r.style=o;r._length=i,n=n._AC=r}if(!n._length)return!0;for(var u in n)if(u!="_length"){i=e.getAttribute(u)||"";if(u=="style")e:{r=n[u],typeof r=="string"&&(r=CKEDITOR.tools.parseCssText(r)),typeof i=="string"&&(i=CKEDITOR.tools.parseCssText(i,!0)),o=void 0;for(o in r)if(!(o in i)||i[o]!=r[o]&&r[o]!="inherit"&&i[o]!="inherit"){r=!1;break e}r=!0}else r=n[u]==i;if(r){if(!t)return!0}else if(t)return!1}if(t)return!0}return!1},checkElementRemovable:function(e,t,n){if(this.checkElementMatch(e,t,n))return!0;if(t=b(this)[e.getName()]){var r;if(!(t=t.attributes))return!0;for(n=0;n<t.length;n++){r=t[n][0];if(r=e.getAttribute(r)){var i=t[n][1];if(i===null)return!0;if(typeof i=="string"){if(r==i)return!0}else if(i.test(r))return!0}}}return!1},buildPreview:function(e){var t=this._.definition,n=[],r=t.element;r=="bdo"&&(r="span");var n=["<",r],i=t.attributes;if(i)for(var s in i)n.push(" ",s,'="',i[s],'"');return(i=CKEDITOR.style.getStyleText(t))&&n.push(' style="',i,'"'),n.push(">",e||t.name,"</",r,">"),n.join("")},getDefinition:function(){return this._.definition}},CKEDITOR.style.getStyleText=function(e){var t=e._ST;if(t)return t;var t=e.styles,n=e.attributes&&e.attributes.style||"",r="";n.length&&(n=n.replace(T,";"));for(var i in t){var s=t[i],o=(i+":"+s).replace(T,";");s=="inherit"?r+=o:n+=o}return n.length&&(n=CKEDITOR.tools.normalizeCssText(n,!0)),e._ST=n+r},CKEDITOR.style.customHandlers={},CKEDITOR.style.addCustomHandler=function(e){var t=function(e){this._={definition:e},this.setup&&this.setup(e)};return t.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},e,!0),this.customHandlers[e.type]=t};var L=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,A=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED}(),CKEDITOR.styleCommand=function(e,t){this.requiredContent=this.allowedContent=this.style=e,CKEDITOR.tools.extend(this,t,!0)},CKEDITOR.styleCommand.prototype.exec=function(e){e.focus(),this.state==CKEDITOR.TRISTATE_OFF?e.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&e.removeStyle(this.style)},CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet"),CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet),CKEDITOR.loadStylesSet=function(e,t,n){CKEDITOR.stylesSet.addExternal(e,t,""),CKEDITOR.stylesSet.load(e,n)},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(e,t){var n=this._.styleStateChangeCallbacks;n||(n=this._.styleStateChangeCallbacks=[],this.on("selectionChange",function(e){for(var t=0;t<n.length;t++){var r=n[t],i=r.style.checkActive(e.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;r.fn.call(this,i)}})),n.push({style:e,fn:t})},applyStyle:function(e){e.apply(this)},removeStyle:function(e){e.remove(this)},getStylesSet:function(e){if(this._.stylesDefinitions)e(this._.stylesDefinitions);else{var t=this,n=t.config.stylesCombo_stylesSet||t.config.stylesSet;if(n===!1)e(null);else if(n instanceof Array)t._.stylesDefinitions=n,e(n);else{n||(n="default");var n=n.split(":"),r=n[0];CKEDITOR.stylesSet.addExternal(r,n[1]?n.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),""),CKEDITOR.stylesSet.load(r,function(n){t._.stylesDefinitions=n[r],e(t._.stylesDefinitions)})}}}}),CKEDITOR.dom.comment=function(e,t){typeof e=="string"&&(e=(t?t.$:document).createComment(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node,CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<!--"+this.$.nodeValue+"-->"}}),"use strict",function(){var e={},t={},n;for(n in CKEDITOR.dtd.$blockLimit)n in CKEDITOR.dtd.$list||(e[n]=1);for(n in CKEDITOR.dtd.$block)n in CKEDITOR.dtd.$blockLimit||n in CKEDITOR.dtd.$empty||(t[n]=1);CKEDITOR.dom.elementPath=function(n,r){var i=null,s=null,o=[],u=n,f,r=r||n.getDocument().getBody();do if(u.type==CKEDITOR.NODE_ELEMENT){o.push(u);if(!this.lastElement){this.lastElement=u;if(u.is(CKEDITOR.dtd.$object)||u.getAttribute("contenteditable")=="false")continue}if(u.equals(r))break;if(!s){f=u.getName(),u.getAttribute("contenteditable")=="true"?s=u:!i&&t[f]&&(i=u);if(e[f]){var l;if(l=!i){if(f=f=="div"){e:{f=u.getChildren(),l=0;for(var c=f.count();l<c;l++){var h=f.getItem(l);if(h.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[h.getName()]){f=!0;break e}}f=!1}f=!f}l=f}l?i=u:s=u}}}while(u=u.getParent());s||(s=r),this.block=i,this.blockLimit=s,this.root=r,this.elements=o}}(),CKEDITOR.dom.elementPath.prototype={compare:function(e){var t=this.elements,e=e&&e.elements;if(!e||t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0},contains:function(e,t,n){var r;typeof e=="string"&&(r=function(t){return t.getName()==e}),e instanceof CKEDITOR.dom.element?r=function(t){return t.equals(e)}:CKEDITOR.tools.isArray(e)?r=function(t){return CKEDITOR.tools.indexOf(e,t.getName())>-1}:typeof e=="function"?r=e:typeof e=="object"&&(r=function(t){return t.getName()in e});var i=this.elements,s=i.length;t&&s--,n&&(i=Array.prototype.slice.call(i,0),i.reverse());for(t=0;t<s;t++)if(r(i[t]))return i[t];return null},isContextFor:function(e){var t;return e in CKEDITOR.dtd.$block?(t=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit,!!t.getDtd()[e]):!0},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}},CKEDITOR.dom.text=function(e,t){typeof e=="string"&&(e=(t?t.$:document).createTextNode(e)),this.$=e},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},getText:function(){return this.$.nodeValue},setText:function(e){this.$.nodeValue=e},split:function(e){var t=this.$.parentNode,n=t.childNodes.length,r=this.getLength(),i=this.getDocument(),s=new CKEDITOR.dom.text(this.$.splitText(e),i);return t.childNodes.length==n&&(e>=r?(s=i.createText(""),s.insertAfter(this)):(e=i.createText(""),e.insertAfter(s),e.remove())),s},substring:function(e,t){return typeof t!="number"?this.$.nodeValue.substr(e):this.$.nodeValue.substring(e,t)}}),function(){function e(e,t,n){var r=e.serializable,i=t[n?"endContainer":"startContainer"],s=n?"endOffset":"startOffset",o=r?t.document.getById(e.startNode):e.startNode,e=r?t.document.getById(e.endNode):e.endNode;return i.equals(o.getPrevious())?(t.startOffset=t.startOffset-i.getLength()-e.getPrevious().getLength(),i=e.getNext()):i.equals(e.getPrevious())&&(t.startOffset=t.startOffset-i.getLength(),i=e.getNext()),i.equals(o.getParent())&&t[s]++,i.equals(e.getParent())&&t[s]++,t[n?"endContainer":"startContainer"]=i,t}CKEDITOR.dom.rangeList=function(e){return e instanceof CKEDITOR.dom.rangeList?e:(e?e instanceof CKEDITOR.dom.range&&(e=[e]):e=[],CKEDITOR.tools.extend(e,t))};var t={createIterator:function(){var e=this,t=CKEDITOR.dom.walker.bookmark(),n=[],r;return{getNextRange:function(i){r=r===void 0?0:r+1;var s=e[r];if(s&&e.length>1){if(!r)for(var o=e.length-1;o>=0;o--)n.unshift(e[o].createBookmark(!0));if(i)for(var u=0;e[r+u+1];){for(var f=s.document,i=0,o=f.getById(n[u].endNode),f=f.getById(n[u+1].startNode);;){o=o.getNextSourceNode(!1);if(f.equals(o))i=1;else if(t(o)||o.type==CKEDITOR.NODE_ELEMENT&&o.isBlockBoundary())continue;break}if(!i)break;u++}for(s.moveToBookmark(n.shift());u--;)o=e[++r],o.moveToBookmark(n.shift()),s.setEnd(o.endContainer,o.endOffset)}return s}}},createBookmarks:function(t){for(var n=[],r,i=0;i<this.length;i++){n.push(r=this[i].createBookmark(t,!0));for(var s=i+1;s<this.length;s++)this[s]=e(r,this[s]),this[s]=e(r,this[s],!0)}return n},createBookmarks2:function(e){for(var t=[],n=0;n<this.length;n++)t.push(this[n].createBookmark2(e));return t},moveToBookmarks:function(e){for(var t=0;t<this.length;t++)this[t].moveToBookmark(e[t])}}}(),function(){function e(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function t(t){var n=CKEDITOR.skin["ua_"+t],r=CKEDITOR.env;if(n)for(var n=n.split(",").sort(function(e,t){return e>t?-1:1}),i=0,s;i<n.length;i++){s=n[i],r.ie&&(s.replace(/^ie/,"")==r.version||r.quirks&&s=="iequirks")&&(s="ie");if(r[s]){t+="_"+n[i];break}}return CKEDITOR.getUrl(e()+t+".css")}function n(e,n){s[e]||(CKEDITOR.document.appendStyleSheet(t(e)),s[e]=1),n&&n()}function r(e){var t=e.getById(o);return t||(t=e.getHead().append("style"),t.setAttribute("id",o),t.setAttribute("type","text/css")),t}function i(e,t,n){var r,i,s;if(CKEDITOR.env.webkit){t=t.split("}").slice(0,-1);for(i=0;i<t.length;i++)t[i]=t[i].split("{")}for(var o=0;o<e.length;o++)if(CKEDITOR.env.webkit)for(i=0;i<t.length;i++){s=t[i][1];for(r=0;r<n.length;r++)s=s.replace(n[r][0],n[r][1]);e[o].$.sheet.addRule(t[i][0],s)}else{s=t;for(r=0;r<n.length;r++)s=s.replace(n[r][0],n[r][1]);CKEDITOR.env.ie&&CKEDITOR.env.version<11?e[o].$.styleSheet.cssText=e[o].$.styleSheet.cssText+s:e[o].$.innerHTML=e[o].$.innerHTML+s}}var s={};CKEDITOR.skin={path:e,loadPart:function(t,r){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e()+"skin.js"),function(){n(t,r)}):n(t,r)},getPath:function(e){return CKEDITOR.getUrl(t(e))},icons:{},addIcon:function(e,t,n,r){e=e.toLowerCase(),this.icons[e]||(this.icons[e]={path:t,offset:n||0,bgsize:r||"16px"})},getIconStyle:function(e,t,n,r,i){var s;return e&&(e=e.toLowerCase(),t&&(s=this.icons[e+"-rtl"]),s||(s=this.icons[e])),e=n||s&&s.path||"",r=r||s&&s.offset,i=i||s&&s.bgsize||"16px",e&&"background-image:url("+CKEDITOR.getUrl(e)+");background-position:0 "+r+"px;background-size:"+i+";"}},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(e){var t=r(CKEDITOR.document);return(this.setUiColor=function(e){this.uiColor=e;var n=CKEDITOR.skin.chameleon,r="",s="";typeof n=="function"&&(r=n(this,"editor"),s=n(this,"panel")),e=[[a,e]],i([t],r,e),i(u,s,e)}).call(this,e)}});var o="cke_ui_color",u=[],a=/\$color/g;CKEDITOR.on("instanceLoaded",function(e){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var t=e.editor,e=function(e){e=(e.data[0]||e.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!e.getById("cke_ui_color")){e=r(e),u.push(e);var n=t.getUiColor();n&&i([e],CKEDITOR.skin.chameleon(t,"panel"),[[a,n]])}};t.on("panelShow",e),t.on("menuShow",e),t.config.uiColor&&t.setUiColor(t.config.uiColor)}})}(),function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var e=CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>',CKEDITOR.document);e.appendTo(CKEDITOR.document.getHead());try{var t=e.getComputedStyle("border-top-color"),n=e.getComputedStyle("border-right-color");CKEDITOR.env.hc=!!t&&t==n}catch(r){CKEDITOR.env.hc=!1}e.remove()}CKEDITOR.env.hc&&(CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc"),CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}"),CKEDITOR.status="loaded",CKEDITOR.fireOnce("loaded");if(e=CKEDITOR._.pending){delete CKEDITOR._.pending;for(t=0;t<e.length;t++)CKEDITOR.editor.prototype.constructor.apply(e[t][0],e[t][1]),CKEDITOR.add(e[t][0])}}(),CKEDITOR.skin.name="moono",CKEDITOR.skin.ua_editor="ie,iequirks,ie7,ie8,gecko",CKEDITOR.skin.ua_dialog="ie,iequirks,ie7,ie8",CKEDITOR.skin.chameleon=function(){var e=function(){return function(e,t){for(var n=e.match(/[^#]./g),r=0;r<3;r++){var i=n,s=r,o;o=parseInt(n[r],16),o=("0"+(t<0?0|o*(1+t):0|o+(255-o)*t).toString(16)).slice(-2),i[s]=o}return"#"+n.join("")}}(),t=function(){var e=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");return function(t,n){return e.output({from:t,to:n})}}(),n={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};return function(r,i){var s=r.uiColor,s={id:"."+r.id,defaultBorder:e(s,-0.1),defaultGradient:t(e(s,.9),s),lightGradient:t(e(s,1),e(s,.7)),mediumGradient:t(e(s,.8),e(s,.5)),ckeButtonOn:t(e(s,.6),e(s,.7)),ckeResizer:e(s,-0.4),ckeToolbarSeparator:e(s,.5),ckeColorauto:e(s,.8),dialogBody:e(s,.7),dialogTabSelected:t("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:e(s,-0.6),elementsPathBg:s,menubuttonIcon:e(s,.5),menubuttonIconHover:e(s,.3)};return n[i].output(s).replace(/\[/g,"{").replace(/\]/g,"}")}}(),CKEDITOR.plugins.add("dialogui",{onLoad:function(){var e=function(e){this._||(this._={}),this._["default"]=this._.initValue=e["default"]||"",this._.required=e.required||!1;for(var t=[this._],n=1;n<arguments.length;n++)t.push(arguments[n]);return t.push(!0),CKEDITOR.tools.extend.apply(CKEDITOR.tools,t),this._},t={build:function(e,t,n){return new CKEDITOR.ui.dialog.textInput(e,t,n)}},n={build:function(e,t,n){return new CKEDITOR.ui.dialog[t.type](e,t,n)}},r={isChanged:function(){return this.getValue()!=this.getInitValue()},reset:function(e){this.setValue(this.getInitValue(),e)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},i=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(e,t){this._.domOnChangeRegistered||(e.on("load",function(){this.getInputElement().on("change",function(){e.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0),this.on("change",t)}},!0),s=/^on([A-Z]\w+)/,o=function(e){for(var t in e)(s.test(t)||t=="title"||t=="type")&&delete e[t];return e};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(t,n,r,i){if(!(arguments.length<4)){var s=e.call(this,n);s.labelId=CKEDITOR.tools.getNextId()+"_label",this._.children=[];var o={role:n.role||"presentation"};n.includeLabel&&(o["aria-labelledby"]=s.labelId),CKEDITOR.ui.dialog.uiElement.call(this,t,n,r,"div",null,o,function(){var e=[],r=n.required?" cke_required":"";return n.labelLayout!="horizontal"?e.push('<label class="cke_dialog_ui_labeled_label'+r+'" ',' id="'+s.labelId+'"',s.inputId?' for="'+s.inputId+'"':"",(n.labelStyle?' style="'+n.labelStyle+'"':"")+">",n.label,"</label>",'<div class="cke_dialog_ui_labeled_content"',n.controlStyle?' style="'+n.controlStyle+'"':"",' role="presentation">',i.call(this,t,n),"</div>"):(r={type:"hbox",widths:n.widths,padding:0,children:[{type:"html",html:'<label class="cke_dialog_ui_labeled_label'+r+'" id="'+s.labelId+'" for="'+s.inputId+'"'+(n.labelStyle?' style="'+n.labelStyle+'"':"")+">"+CKEDITOR.tools.htmlEncode(n.label)+"</span>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content"'+(n.controlStyle?' style="'+n.controlStyle+'"':"")+">"+i.call(this,t,n)+"</span>"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(t,r,e)),e.join("")})}},textInput:function(t,n,r){if(!(arguments.length<3)){e.call(this,n);var i=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",s={"class":"cke_dialog_ui_input_"+n.type,id:i,type:n.type};n.validate&&(this.validate=n.validate),n.maxLength&&(s.maxlength=n.maxLength),n.size&&(s.size=n.size),n.inputStyle&&(s.style=n.inputStyle);var o=this,u=!1;t.on("load",function(){o.getInputElement().on("keydown",function(e){e.data.getKeystroke()==13&&(u=!0)}),o.getInputElement().on("keyup",function(e){e.data.getKeystroke()==13&&u&&(t.getButton("ok")&&setTimeout(function(){t.getButton("ok").click()},0),u=!1)},null,null,1e3)}),CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){var e=['<div class="cke_dialog_ui_input_',n.type,'" role="presentation"'];n.width&&e.push('style="width:'+n.width+'" '),e.push("><input "),s["aria-labelledby"]=this._.labelId,this._.required&&(s["aria-required"]=this._.required);for(var t in s)e.push(t+'="'+s[t]+'" ');return e.push(" /></div>"),e.join("")})}},textarea:function(t,n,r){if(!(arguments.length<3)){e.call(this,n);var i=this,s=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",o={};n.validate&&(this.validate=n.validate),o.rows=n.rows||5,o.cols=n.cols||20,o["class"]="cke_dialog_ui_input_textarea "+(n["class"]||""),typeof n.inputStyle!="undefined"&&(o.style=n.inputStyle),n.dir&&(o.dir=n.dir),CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){o["aria-labelledby"]=this._.labelId,this._.required&&(o["aria-required"]=this._.required);var e=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="',s,'" '],t;for(t in o)e.push(t+'="'+CKEDITOR.tools.htmlEncode(o[t])+'" ');return e.push(">",CKEDITOR.tools.htmlEncode(i._["default"]),"</textarea></div>"),e.join("")})}},checkbox:function(t,n,r){if(!(arguments.length<3)){var i=e.call(this,n,{"default":!!n["default"]});n.validate&&(this.validate=n.validate),CKEDITOR.ui.dialog.uiElement.call(this,t,n,r,"span",null,null,function(){var e=CKEDITOR.tools.extend({},n,{id:n.id?n.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),r=[],s=CKEDITOR.tools.getNextId()+"_label",u={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":s};return o(e),n["default"]&&(u.checked="checked"),typeof e.inputStyle!="undefined"&&(e.style=e.inputStyle),i.checkbox=new CKEDITOR.ui.dialog.uiElement(t,e,r,"input",null,u),r.push(' <label id="',s,'" for="',u.id,'"'+(n.labelStyle?' style="'+n.labelStyle+'"':"")+">",CKEDITOR.tools.htmlEncode(n.label),"</label>"),r.join("")})}},radio:function(t,n,r){if(!(arguments.length<3)){e.call(this,n),this._["default"]||(this._["default"]=this._.initValue=n.items[0][1]),n.validate&&(this.validate=n.valdiate);var i=[],s=this;n.role="radiogroup",n.includeLabel=!0,CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){for(var e=[],r=[],u=(n.id?n.id:CKEDITOR.tools.getNextId())+"_radio",a=0;a<n.items.length;a++){var f=n.items[a],l=f[2]!==void 0?f[2]:f[0],h=f[1]!==void 0?f[1]:f[0],p=CKEDITOR.tools.getNextId()+"_radio_input",d=p+"_label",p=CKEDITOR.tools.extend({},n,{id:p,title:null,type:null},!0),l=CKEDITOR.tools.extend({},p,{title:l},!0),v={type:"radio","class":"cke_dialog_ui_radio_input",name:u,value:h,"aria-labelledby":d},m=[];s._["default"]==h&&(v.checked="checked"),o(p),o(l),typeof p.inputStyle!="undefined"&&(p.style=p.inputStyle),p.keyboardFocusable=!0,i.push(new CKEDITOR.ui.dialog.uiElement(t,p,m,"input",null,v)),m.push(" "),new CKEDITOR.ui.dialog.uiElement(t,l,m,"label",null,{id:d,"for":v.id},f[0]),e.push(m.join(""))}return new CKEDITOR.ui.dialog.hbox(t,i,e,r),r.join("")}),this._.children=i}},button:function(t,n,r){if(arguments.length){typeof n=="function"&&(n=n(t.getParentEditor())),e.call(this,n,{disabled:n.disabled||!1}),CKEDITOR.event.implementOn(this);var i=this;t.on("load",function(){var e=this.getElement();(function(){e.on("click",function(e){i.click(),e.data.preventDefault()}),e.on("keydown",function(e){e.data.getKeystroke()in{32:1}&&(i.click(),e.data.preventDefault())})})(),e.unselectable()},this);var s=CKEDITOR.tools.extend({},n);delete s.style;var o=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,t,s,r,"a",null,{style:n.style,href:"javascript:void(0)",title:n.label,hidefocus:"true","class":n["class"],role:"button","aria-labelledby":o},'<span id="'+o+'" class="cke_dialog_ui_button">'+CKEDITOR.tools.htmlEncode(n.label)+"</span>")}},select:function(t,n,r){if(!(arguments.length<3)){var i=e.call(this,n);n.validate&&(this.validate=n.validate),i.inputId=CKEDITOR.tools.getNextId()+"_select",CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){var e=CKEDITOR.tools.extend({},n,{id:n.id?n.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),r=[],s=[],u={id:i.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};r.push('<div class="cke_dialog_ui_input_',n.type,'" role="presentation"'),n.width&&r.push('style="width:'+n.width+'" '),r.push(">"),n.size!==void 0&&(u.size=n.size),n.multiple!==void 0&&(u.multiple=n.multiple),o(e);for(var a=0,f;a<n.items.length&&(f=n.items[a]);a++)s.push('<option value="',CKEDITOR.tools.htmlEncode(f[1]!==void 0?f[1]:f[0]).replace(/"/g,"&quot;"),'" /> ',CKEDITOR.tools.htmlEncode(f[0]));return typeof e.inputStyle!="undefined"&&(e.style=e.inputStyle),i.select=new CKEDITOR.ui.dialog.uiElement(t,e,r,"select",null,u,s.join("")),r.push("</div>"),r.join("")})}},file:function(t,n,r){if(!(arguments.length<3)){n["default"]===void 0&&(n["default"]="");var i=CKEDITOR.tools.extend(e.call(this,n),{definition:n,buttons:[]});n.validate&&(this.validate=n.validate),t.on("load",function(){CKEDITOR.document.getById(i.frameId).getParent().addClass("cke_dialog_ui_input_file")}),CKEDITOR.ui.dialog.labeledElement.call(this,t,n,r,function(){i.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var e=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',i.frameId,'" title="',n.label,'" src="javascript:void('];return e.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0"),e.push(')"></iframe>'),e.join("")})}},fileButton:function(t,n,r){var i=this;if(!(arguments.length<3)){e.call(this,n),n.validate&&(this.validate=n.validate);var s=CKEDITOR.tools.extend({},n),o=s.onClick;s.className=(s.className?s.className+" ":"")+"cke_dialog_ui_button",s.onClick=function(e){var r=n["for"];if(!o||o.call(this,e)!==!1)t.getContentElement(r[0],r[1]).submit(),this.disable()},t.on("load",function(){t.getContentElement(n["for"][0],n["for"][1])._.buttons.push(i)}),CKEDITOR.ui.dialog.button.call(this,t,s,r)}},html:function(){var e=/^\s*<[\w:]+\s+([^>]*)?>/,t=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,n=/\/$/;return function(r,i,s){if(!(arguments.length<3)){var o=[],u=i.html;u.charAt(0)!="<"&&(u="<span>"+u+"</span>");var f=i.focus;if(f){var l=this.focus;this.focus=function(){(typeof f=="function"?f:l).call(this),this.fire("focus")},i.isFocusable&&(this.isFocusable=this.isFocusable),this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,r,i,o,"span",null,null,""),o=o.join("").match(e),u=u.match(t)||["","",""],n.test(u[1])&&(u[1]=u[1].slice(0,-1),u[2]="/"+u[2]),s.push([u[1]," ",o[1]||"",u[2]].join(""))}}}(),fieldset:function(e,t,n,r,i){var s=i.label;this._={children:t},CKEDITOR.ui.dialog.uiElement.call(this,e,i,r,"fieldset",null,null,function(){var e=[];s&&e.push("<legend"+(i.labelStyle?' style="'+i.labelStyle+'"':"")+">"+s+"</legend>");for(var t=0;t<n.length;t++)e.push(n[t]);return e.join("")})}},!0),CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement,CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(e){var t=CKEDITOR.document.getById(this._.labelId);return t.getChildCount()<1?(new CKEDITOR.dom.text(e,CKEDITOR.document)).appendTo(t):t.getChild(0).$.nodeValue=e,this},getLabel:function(){var e=CKEDITOR.document.getById(this._.labelId);return!e||e.getChildCount()<1?"":e.getChild(0).getText()},eventProcessors:i},!0),CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var e=this.getElement();e&&e.removeClass("cke_disabled")},disable:function(){this._.disabled=!0,this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(e,t){this.on("click",function(){t.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0),CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},focus:function(){var e=this.selectParentTab();setTimeout(function(){var t=e.getInputElement();t&&t.$.focus()},0)},select:function(){var e=this.selectParentTab();setTimeout(function(){var t=e.getInputElement();t&&(t.$.focus(),t.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(e){return!e&&(e=""),CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},keyboardFocusable:!0},r,!0),CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput,CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(e,t,n){var r=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),i=this.getInputElement().$;return r.$.text=e,r.$.value=t===void 0||t===null?e:t,n===void 0||n===null?CKEDITOR.env.ie?i.add(r.$):i.add(r.$,null):i.add(r.$,n),this},remove:function(e){return this.getInputElement().$.remove(e),this},clear:function(){for(var e=this.getInputElement().$;e.length>0;)e.remove(0);return this},keyboardFocusable:!0},r,!0),CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(e,t){this.getInputElement().$.checked=e,!t&&this.fire("change",{value:e})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(e,t){return!CKEDITOR.env.ie||CKEDITOR.env.version>8?i.onChange.apply(this,arguments):(e.on("load",function(){var e=this._.checkbox.getElement();e.on("propertychange",function(t){t=t.data.$,t.propertyName=="checked"&&this.fire("change",{value:e.$.checked})},this)},this),this.on("change",t),null)}},keyboardFocusable:!0},r,!0),CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setValue:function(e,t){for(var n=this._.children,r,i=0;i<n.length&&(r=n[i]);i++)r.getElement().$.checked=r.getValue()==e;!t&&this.fire("change",{value:e})},getValue:function(){for(var e=this._.children,t=0;t<e.length;t++)if(e[t].getElement().$.checked)return e[t].getValue();return null},accessKeyUp:function(){var e=this._.children,t;for(t=0;t<e.length;t++)if(e[t].getElement().$.checked){e[t].getElement().focus();return}e[0].getElement().focus()},eventProcessors:{onChange:function(e,t){return CKEDITOR.env.ie?(e.on("load",function(){for(var e=this._.children,t=this,n=0;n<e.length;n++)e[n].getElement().on("propertychange",function(e){e=e.data.$,e.propertyName=="checked"&&this.$.checked&&t.fire("change",{value:this.getAttribute("value")})})},this),this.on("change",t),null):i.onChange.apply(this,arguments)}}},r,!0),CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,r,{getInputElement:function(){var e=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return e.$.forms.length>0?new CKEDITOR.dom.element(e.$.forms[0].elements[0]):this.getElement()},submit:function(){return this.getInputElement().getParent().$.submit(),this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(e){var t=/^on([A-Z]\w+)/,n,r=function(e,t,n,r){e.on("formLoaded",function(){e.getInputElement().on(n,r,e)})},i;for(i in e)if(n=i.match(t))this.eventProcessors[i]?this.eventProcessors[i].call(this,this._.dialog,e[i]):r(this,this._.dialog,n[1].toLowerCase(),e[i]);return this},reset:function(){function e(){n.$.open();var e="";r.size&&(e=r.size-(CKEDITOR.env.ie?7:0));var f=t.frameId+"_input";n.$.write(['<html dir="'+u+'" lang="'+a+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+u+'" lang="'+a+'" action="',CKEDITOR.tools.htmlEncode(r.action),'"><label id="',t.labelId,'" for="',f,'" style="display:none">',CKEDITOR.tools.htmlEncode(r.label),'</label><input style="width:100%" id="',f,'" aria-labelledby="',t.labelId,'" type="file" name="',CKEDITOR.tools.htmlEncode(r.id||"cke_upload"),'" size="',CKEDITOR.tools.htmlEncode(e>0?e:""),'" /></form></body></html><script>',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+s+");","window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction("+o+")}","</script>"].join("")),n.$.close();for(e=0;e<i.length;e++)i[e].enable()}var t=this._,n=CKEDITOR.document.getById(t.frameId).getFrameDocument(),r=t.definition,i=t.buttons,s=this.formLoadedNumber,o=this.formUnloadNumber,u=t.dialog._.editor.lang.dir,a=t.dialog._.editor.langCode;s||(s=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),o=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(s),CKEDITOR.tools.removeFunction(o)})),CKEDITOR.env.gecko?setTimeout(e,500):e()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(e,t){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0),this.on("change",t)}},keyboardFocusable:!0},!0),CKEDITOR.ui.dialog.fileButton.prototype=new CKEDITOR.ui.dialog.button,CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype),CKEDITOR.dialog.addUIElement("text",t),CKEDITOR.dialog.addUIElement("password",t),CKEDITOR.dialog.addUIElement("textarea",n),CKEDITOR.dialog.addUIElement("checkbox",n),CKEDITOR.dialog.addUIElement("radio",n),CKEDITOR.dialog.addUIElement("button",n),CKEDITOR.dialog.addUIElement("select",n),CKEDITOR.dialog.addUIElement("file",n),CKEDITOR.dialog.addUIElement("fileButton",n),CKEDITOR.dialog.addUIElement("html",n),CKEDITOR.dialog.addUIElement("fieldset",{build:function(e,t,n){for(var r=t.children,i,s=[],o=[],u=0;u<r.length&&(i=r[u]);u++){var a=[];s.push(a),o.push(CKEDITOR.dialog._.uiElementBuilders[i.type].build(e,i,a))}return new CKEDITOR.ui.dialog[t.type](e,o,s,n,t)}})}}),CKEDITOR.DIALOG_RESIZE_NONE=0,CKEDITOR.DIALOG_RESIZE_WIDTH=1,CKEDITOR.DIALOG_RESIZE_HEIGHT=2,CKEDITOR.DIALOG_RESIZE_BOTH=3,function(){function e(){for(var e=this._.tabIdList.length,t=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+e,n=t-1;n>t-e;n--)if(this._.tabs[this._.tabIdList[n%e]][0].$.offsetHeight)return this._.tabIdList[n%e];return null}function t(){for(var e=this._.tabIdList.length,t=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),n=t+1;n<t+e;n++)if(this._.tabs[this._.tabIdList[n%e]][0].$.offsetHeight)return this._.tabIdList[n%e];return null}function n(e,t){for(var n=e.$.getElementsByTagName("input"),r=0,i=n.length;r<i;r++){var s=new CKEDITOR.dom.element(n[r]);s.getAttribute("type").toLowerCase()=="text"&&(t?(s.setAttribute("value",s.getCustomData("fake_value")||""),s.removeCustomData("fake_value")):(s.setCustomData("fake_value",s.getAttribute("value")),s.setAttribute("value","")))}}function r(e,t){var n=this.getInputElement();n&&(e?n.removeAttribute("aria-invalid"):n.setAttribute("aria-invalid",!0)),e||(this.select?this.select():this.focus()),t&&alert(t),this.fire("validated",{valid:e,msg:t})}function i(){var e=this.getInputElement();e&&e.removeAttribute("aria-invalid")}function s(e){var e=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",v).output({id:CKEDITOR.tools.getNextNumber(),editorId:e.id,langDir:e.lang.dir,langCode:e.langCode,editorDialogClass:"cke_editor_"+e.name.replace(/\./g,"\\.")+"_dialog",closeTitle:e.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),t=e.getChild([0,0,0,0,0]),n=t.getChild(0),r=t.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var i="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())";CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="'+i+'" tabIndex="-1"></iframe>').appendTo(t.getParent())}return n.unselectable(),r.unselectable(),{element:e,parts:{dialog:e.getChild(0),title:n,close:r,tabs:t.getChild(2),contents:t.getChild([3,0,0,0]),footer:t.getChild([3,0,1,0])}}}function o(e,t,n){this.element=t,this.focusIndex=n,this.tabIndex=0,this.isFocusable=function(){return!t.getAttribute("disabled")&&t.isVisible()},this.focus=function(){e._.currentFocusIndex=this.focusIndex,this.element.focus()},t.on("keydown",function(e){e.data.getKeystroke()in{32:1,13:1}&&this.fire("click")}),t.on("focus",function(){this.fire("mouseover")}),t.on("blur",function(){this.fire("mouseout")})}function u(e){function t(){e.layout()}var n=CKEDITOR.document.getWindow();n.on("resize",t),e.on("hide",function(){n.removeListener("resize",t)})}function a(e,t){this._={dialog:e},CKEDITOR.tools.extend(this,t)}function f(e){function t(t){var n=e.getSize(),a=CKEDITOR.document.getWindow().getViewPaneSize(),f=t.data.$.screenX,l=t.data.$.screenY,c=f-r.x,h=l-r.y;r={x:f,y:l},i.x=i.x+c,i.y=i.y+h,e.move(i.x+u[3]<o?-u[3]:i.x-u[1]>a.width-n.width-o?a.width-n.width+(s.lang.dir=="rtl"?0:u[1]):i.x,i.y+u[0]<o?-u[0]:i.y-u[2]>a.height-n.height-o?a.height-n.height+u[2]:i.y,1),t.data.preventDefault()}function n(){CKEDITOR.document.removeListener("mousemove",t),CKEDITOR.document.removeListener("mouseup",n);if(CKEDITOR.env.ie6Compat){var e=x.getChild(0).getFrameDocument();e.removeListener("mousemove",t),e.removeListener("mouseup",n)}}var r=null,i=null,s=e.getParentEditor(),o=s.config.dialog_magnetDistance,u=CKEDITOR.skin.margins||[0,0,0,0];typeof o=="undefined"&&(o=20),e.parts.title.on("mousedown",function(s){r={x:s.data.$.screenX,y:s.data.$.screenY},CKEDITOR.document.on("mousemove",t),CKEDITOR.document.on("mouseup",n),i=e.getPosition();if(CKEDITOR.env.ie6Compat){var o=x.getChild(0).getFrameDocument();o.on("mousemove",t),o.on("mouseup",n)}s.data.preventDefault()},e)}function l(e){function r(r){var i=u.lang.dir=="rtl",h=c.width,p=c.height,d=h+(r.data.$.screenX-t)*(i?-1:1)*(e._.moved?1:2),v=p+(r.data.$.screenY-n)*(e._.moved?1:2),m=e._.element.getFirst(),m=i&&m.getComputedStyle("right"),g=e.getPosition();g.y+v>l.height&&(v=l.height-g.y),(i?m:g.x)+d>l.width&&(d=l.width-(i?m:g.x));if(o==CKEDITOR.DIALOG_RESIZE_WIDTH||o==CKEDITOR.DIALOG_RESIZE_BOTH)h=Math.max(s.minWidth||0,d-a);if(o==CKEDITOR.DIALOG_RESIZE_HEIGHT||o==CKEDITOR.DIALOG_RESIZE_BOTH)p=Math.max(s.minHeight||0,v-f);e.resize(h,p),e._.moved||e.layout(),r.data.preventDefault()}function i(){CKEDITOR.document.removeListener("mouseup",i),CKEDITOR.document.removeListener("mousemove",r),h&&(h.remove(),h=null);if(CKEDITOR.env.ie6Compat){var e=x.getChild(0).getFrameDocument();e.removeListener("mouseup",i),e.removeListener("mousemove",r)}}var t,n,s=e.definition,o=s.resizable;if(o!=CKEDITOR.DIALOG_RESIZE_NONE){var u=e.getParentEditor(),a,f,l,c,h,p=CKEDITOR.tools.addFunction(function(s){c=e.getSize();var o=e.parts.contents;o.$.getElementsByTagName("iframe").length&&(h=CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>'),o.append(h)),f=c.height-e.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks)),a=c.width-e.parts.contents.getSize("width",1),t=s.screenX,n=s.screenY,l=CKEDITOR.document.getWindow().getViewPaneSize(),CKEDITOR.document.on("mousemove",r),CKEDITOR.document.on("mouseup",i),CKEDITOR.env.ie6Compat&&(o=x.getChild(0).getFrameDocument(),o.on("mousemove",r),o.on("mouseup",i)),s.preventDefault&&s.preventDefault()});e.on("load",function(){var t="";o==CKEDITOR.DIALOG_RESIZE_WIDTH?t=" cke_resizer_horizontal":o==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(t=" cke_resizer_vertical"),t=CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer'+t+" cke_resizer_"+u.lang.dir+'" title="'+CKEDITOR.tools.htmlEncode(u.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+p+', event )">'+(u.lang.dir=="ltr"?"◢":"◣")+"</div>"),e.parts.footer.append(t,1)}),u.on("destroy",function(){CKEDITOR.tools.removeFunction(p)})}}function c(e){e.data.preventDefault(1)}function h(e){var t=CKEDITOR.document.getWindow(),n=e.config,r=n.dialog_backgroundCoverColor||"white",i=n.dialog_backgroundCoverOpacity,s=n.baseFloatZIndex,n=CKEDITOR.tools.genKey(r,i,s),o=S[n];o?o.show():(s=['<div tabIndex="-1" style="position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",s,"; top: 0px; left: 0px; ",CKEDITOR.env.ie6Compat?"":"background-color: "+r,'" class="cke_dialog_background_cover">'],CKEDITOR.env.ie6Compat&&(r="<html><body style=\\'background-color:"+r+";\\'></body></html>",s.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'),s.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+r+"' );document.close();")+"})())"),s.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')),s.push("</div>"),o=CKEDITOR.dom.element.createFromHtml(s.join("")),o.setOpacity(i!==void 0?i:.5),o.on("keydown",c),o.on("keypress",c),o.on("keyup",c),o.appendTo(CKEDITOR.document.getBody()),S[n]=o),e.focusManager.add(o),x=o;var e=function(){var e=t.getViewPaneSize();o.setStyles({width:e.width+"px",height:e.height+"px"})},u=function(){var e=t.getScrollPosition(),n=CKEDITOR.dialog._.currentTop;o.setStyles({left:e.x+"px",top:e.y+"px"});if(n)do e=n.getPosition(),n.move(e.x,e.y);while(n=n._.parentDialog)};E=e,t.on("resize",e),e(),(!CKEDITOR.env.mac||!CKEDITOR.env.webkit)&&o.focus();if(CKEDITOR.env.ie6Compat){var a=function(){u(),arguments.callee.prevScrollHandler.apply(this,arguments)};t.$.setTimeout(function(){a.prevScrollHandler=window.onscroll||function(){},window.onscroll=a},0),u()}}function p(e){x&&(e.focusManager.remove(x),e=CKEDITOR.document.getWindow(),x.hide(),e.removeListener("resize",E),CKEDITOR.env.ie6Compat&&e.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),E=null)}var d=CKEDITOR.tools.cssLength,v='<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';CKEDITOR.dialog=function(n,o){function u(){var e=x._.focusList;e.sort(function(e,t){return e.tabIndex!=t.tabIndex?t.tabIndex-e.tabIndex:e.focusIndex-t.focusIndex});for(var t=e.length,n=0;n<t;n++)e[n].focusIndex=n}function a(e){var t=x._.focusList,e=e||0;if(!(t.length<1)){var n=x._.currentFocusIndex;try{t[n].getInputElement().$.blur()}catch(r){}for(var i=n=(n+e+t.length)%t.length;e&&!t[i].isFocusable();){i=(i+e+t.length)%t.length;if(i==n)break}t[i].focus(),t[i].type=="text"&&t[i].select()}}function c(r){if(x==CKEDITOR.dialog._.currentTop){var i=r.data.getKeystroke(),s=n.lang.dir=="rtl";b=E=0;if(i==9||i==CKEDITOR.SHIFT+9)i=i==CKEDITOR.SHIFT+9,x._.tabBarMode?(i=i?e.call(x):t.call(x),x.selectPage(i),x._.tabs[i][0].focus()):a(i?-1:1),b=1;else if(i==CKEDITOR.ALT+121&&!x._.tabBarMode&&x.getPageCount()>1)x._.tabBarMode=!0,x._.tabs[x._.currentTabId][0].focus(),b=1;else if(i!=37&&i!=39||!x._.tabBarMode)if(i!=13&&i!=32||!x._.tabBarMode)if(i==13)i=r.data.getTarget(),!i.is("a","button","select","textarea")&&(!i.is("input")||i.$.type!="button")&&((i=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(i.click,0,i),b=1),E=1;else{if(i!=27)return;(i=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(i.click,0,i):this.fire("cancel",{hide:!0}).hide!==!1&&this.hide(),E=1}else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=-1,a(1),b=1;else i=i==(s?39:37)?e.call(x):t.call(x),x.selectPage(i),x._.tabs[i][0].focus(),b=1;h(r)}}function h(e){b?e.data.preventDefault(1):E&&e.data.stopPropagation()}var p=CKEDITOR.dialog._.dialogDefinitions[o],d=CKEDITOR.tools.clone(m),v=n.config.dialog_buttonsOrder||"OS",g=n.lang.dir,y={},b,E;(v=="OS"&&CKEDITOR.env.mac||v=="rtl"&&g=="ltr"||v=="ltr"&&g=="rtl")&&d.buttons.reverse(),p=CKEDITOR.tools.extend(p(n),d),p=CKEDITOR.tools.clone(p),p=new w(this,p),d=s(n),this._={editor:n,element:d.element,name:o,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1},this.parts=d.parts,CKEDITOR.tools.setTimeout(function(){n.fire("ariaWidget",this.parts.contents)},0,this),d={position:CKEDITOR.env.ie6Compat?"absolute":"fixed",top:0,visibility:"hidden"},d[g=="rtl"?"right":"left"]=0,this.parts.dialog.setStyles(d),CKEDITOR.event.call(this),this.definition=p=CKEDITOR.fire("dialogDefinition",{name:o,definition:p},n).definition;if(!("removeDialogTabs"in n._)&&n.config.removeDialogTabs){d=n.config.removeDialogTabs.split(";");for(g=0;g<d.length;g++){v=d[g].split(":");if(v.length==2){var S=v[0];y[S]||(y[S]=[]),y[S].push(v[1])}}n._.removeDialogTabs=y}if(n._.removeDialogTabs&&(y=n._.removeDialogTabs[o]))for(g=0;g<y.length;g++)p.removeContents(y[g]);p.onLoad&&this.on("load",p.onLoad),p.onShow&&this.on("show",p.onShow),p.onHide&&this.on("hide",p.onHide),p.onOk&&this.on("ok",function(e){n.fire("saveSnapshot"),setTimeout(function(){n.fire("saveSnapshot")},0),p.onOk.call(this,e)===!1&&(e.data.hide=!1)}),p.onCancel&&this.on("cancel",function(e){p.onCancel.call(this,e)===!1&&(e.data.hide=!1)});var x=this,T=function(e){var t=x._.contents,n=!1,r;for(r in t)for(var i in t[r])if(n=e.call(this,t[r][i]))return};this.on("ok",function(e){T(function(t){if(t.validate){var n=t.validate(this),i=typeof n=="string"||n===!1;return i&&(e.data.hide=!1,e.stop()),r.call(t,!i,typeof n=="string"?n:void 0),i}})},this,null,0),this.on("cancel",function(e){T(function(t){if(t.isChanged())return!n.config.dialog_noConfirmCancel&&!confirm(n.lang.common.confirmCancel)&&(e.data.hide=!1),!0})},this,null,0),this.parts.close.on("click",function(e){this.fire("cancel",{hide:!0}).hide!==!1&&this.hide(),e.data.preventDefault()},this),this.changeFocus=a;var N=this._.element;n.focusManager.add(N,1),this.on("show",function(){N.on("keydown",c,this),CKEDITOR.env.gecko&&N.on("keypress",h,this)}),this.on("hide",function(){N.removeListener("keydown",c),CKEDITOR.env.gecko&&N.removeListener("keypress",h),T(function(e){i.apply(e)})}),this.on("iframeAdded",function(e){(new CKEDITOR.dom.document(e.data.iframe.$.contentWindow.document)).on("keydown",c,this,null,0)}),this.on("show",function(){u();if(n.config.dialog_startupFocusTab&&x._.pageCount>1)x._.tabBarMode=!0,x._.tabs[x._.currentTabId][0].focus();else if(!this._.hasFocus){this._.currentFocusIndex=-1;if(p.onFocus){var e=p.onFocus.call(this);e&&e.focus()}else a(1)}},this,null,4294967295),CKEDITOR.env.ie6Compat&&this.on("load",function(){var e=this.getElement(),t=e.getFirst();t.remove(),t.appendTo(e)},this),f(this),l(this),(new CKEDITOR.dom.text(p.title,CKEDITOR.document)).appendTo(this.parts.title);for(g=0;g<p.contents.length;g++)(y=p.contents[g])&&this.addPage(y);this.parts.tabs.on("click",function(e){var t=e.data.getTarget();t.hasClass("cke_dialog_tab")&&(t=t.$.id,this.selectPage(t.substring(4,t.lastIndexOf("_"))),this._.tabBarMode&&(this._.tabBarMode=!1,this._.currentFocusIndex=-1,a(1)),e.data.preventDefault())},this),g=[],y=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:p.buttons},g).getChild(),this.parts.footer.setHtml(g.join(""));for(g=0;g<y.length;g++)this._.buttons[y[g].id]=y[g]},CKEDITOR.dialog.prototype={destroy:function(){this.hide(),this._.element.remove()},resize:function(){return function(e,t){if(!this._.contentSize||this._.contentSize.width!=e||this._.contentSize.height!=t)CKEDITOR.dialog.fire("resize",{dialog:this,width:e,height:t},this._.editor),this.fire("resize",{width:e,height:t},this._.editor),this.parts.contents.setStyles({width:e+"px",height:t+"px"}),this._.editor.lang.dir=="rtl"&&this._.position&&(this._.position.x=CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)),this._.contentSize={width:e,height:t}}}(),getSize:function(){var e=this._.element.getFirst();return{width:e.$.offsetWidth||0,height:e.$.offsetHeight||0}},move:function(e,t,n){var r=this._.element.getFirst(),i=this._.editor.lang.dir=="rtl",s=r.getComputedStyle("position")=="fixed";CKEDITOR.env.ie&&r.setStyle("zoom","100%");if(!s||!this._.position||this._.position.x!=e||this._.position.y!=t)this._.position={x:e,y:t},s||(s=CKEDITOR.document.getWindow().getScrollPosition(),e+=s.x,t+=s.y),i&&(s=this.getSize(),e=CKEDITOR.document.getWindow().getViewPaneSize().width-s.width-e),t={top:(t>0?t:0)+"px"},t[i?"right":"left"]=(e>0?e:0)+"px",r.setStyles(t),n&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var e=this._.element,t=this.definition;!e.getParent()||!e.getParent().equals(CKEDITOR.document.getBody())?e.appendTo(CKEDITOR.document.getBody()):e.setStyle("display","block"),this.resize(this._.contentSize&&this._.contentSize.width||t.width||t.minWidth,this._.contentSize&&this._.contentSize.height||t.height||t.minHeight),this.reset(),this.selectPage(this.definition.contents[0].id),CKEDITOR.dialog._.currentZIndex===null&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex),this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex=CKEDITOR.dialog._.currentZIndex+10),CKEDITOR.dialog._.currentTop===null?(CKEDITOR.dialog._.currentTop=this,this._.parentDialog=null,h(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this),e.on("keydown",N),e.on("keyup",C),this._.hasFocus=!1;for(var n in t.contents)if(t.contents[n]){var e=t.contents[n],r=this._.tabs[e.id],i=e.requiredContent,s=0;if(r){for(var o in this._.contents[e.id]){var a=this._.contents[e.id][o];a.type!="hbox"&&a.type!="vbox"&&!!a.getInputElement()&&(a.requiredContent&&!this._.editor.activeFilter.check(a.requiredContent)?a.disable():(a.enable(),s++))}!s||i&&!this._.editor.activeFilter.check(i)?r[0].addClass("cke_dialog_tab_disabled"):r[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout(),u(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(e){e.setInitValue&&e.setInitValue()})},100,this)},layout:function(){var e=this.parts.dialog,t=this.getSize(),n=CKEDITOR.document.getWindow().getViewPaneSize(),r=(n.width-t.width)/2,i=(n.height-t.height)/2;CKEDITOR.env.ie6Compat||(t.height+(i>0?i:0)>n.height||t.width+(r>0?r:0)>n.width?e.setStyle("position","absolute"):e.setStyle("position","fixed")),this.move(this._.moved?this._.position.x:r,this._.moved?this._.position.y:i)},foreach:function(e){for(var t in this._.contents)for(var n in this._.contents[t])e.call(this,this._.contents[t][n]);return this},reset:function(){var e=function(e){e.reset&&e.reset(1)};return function(){return this.foreach(e),this}}(),setupContent:function(){var e=arguments;this.foreach(function(t){t.setup&&t.setup.apply(t,e)})},commitContent:function(){var e=arguments;this.foreach(function(t){CKEDITOR.env.ie&&this._.currentFocusIndex==t.focusIndex&&t.getInputElement().$.blur(),t.commit&&t.commit.apply(t,e)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{}),this._.editor.fire("dialogHide",this),this.selectPage(this._.tabIdList[0]);var e=this._.element;e.setStyle("display","none"),this.parts.dialog.setStyle("visibility","hidden");for(L(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var t=this._.parentDialog.getElement().getFirst();t.setStyle("z-index",parseInt(t.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else p(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex=CKEDITOR.dialog._.currentZIndex-10;else{CKEDITOR.dialog._.currentZIndex=null,e.removeListener("keydown",N),e.removeListener("keyup",C);var n=this._.editor;n.focus(),setTimeout(function(){n.focusManager.unlock(),CKEDITOR.env.iOS&&n.window.focus()},0)}delete this._.parentDialog,this.foreach(function(e){e.resetInitValue&&e.resetInitValue()})}},addPage:function(e){if(!e.requiredContent||this._.editor.filter.check(e.requiredContent)){for(var t=[],n=e.label?' title="'+CKEDITOR.tools.htmlEncode(e.label)+'"':"",r=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:e.elements,expand:!!e.expand,padding:e.padding,style:e.style||"width: 100%;"},t),i=this._.contents[e.id]={},s=r.getChild(),o=0;r=s.shift();)!r.notAllowed&&r.type!="hbox"&&r.type!="vbox"&&o++,i[r.id]=r,typeof r.getChild=="function"&&s.push.apply(s,r.getChild());o||(e.hidden=!0),t=CKEDITOR.dom.element.createFromHtml(t.join("")),t.setAttribute("role","tabpanel"),r=CKEDITOR.env,i="cke_"+e.id+"_"+CKEDITOR.tools.getNextNumber(),n=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',this._.pageCount>0?" cke_last":"cke_first",n,e.hidden?' style="display:none"':"",' id="',i,'"',r.gecko&&!r.hc?"":' href="javascript:void(0)"',' tabIndex="-1" hidefocus="true" role="tab">',e.label,"</a>"].join("")),t.setAttribute("aria-labelledby",i),this._.tabs[e.id]=[n,t],this._.tabIdList.push(e.id),!e.hidden&&this._.pageCount++,this._.lastTab=n,this.updateStyle(),t.setAttribute("name",e.id),t.appendTo(this.parts.contents),n.unselectable(),this.parts.tabs.append(n),e.accessKey&&(k(this,this,"CTRL+"+e.accessKey,O,A),this._.accessKeyMap["CTRL+"+e.accessKey]=e.id)}},selectPage:function(e){if(this._.currentTabId!=e&&!this._.tabs[e][0].hasClass("cke_dialog_tab_disabled")&&this.fire("selectPage",{page:e,currentPage:this._.currentTabId})!==!1){for(var t in this._.tabs){var r=this._.tabs[t][0],i=this._.tabs[t][1];t!=e&&(r.removeClass("cke_dialog_tab_selected"),i.hide()),i.setAttribute("aria-hidden",t!=e)}var s=this._.tabs[e];s[0].addClass("cke_dialog_tab_selected"),CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(n(s[1]),s[1].show(),setTimeout(function(){n(s[1],1)},0)):s[1].show(),this._.currentTabId=e,this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,e)}},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(t){var n=this._.tabs[t]&&this._.tabs[t][0];n&&this._.pageCount!=1&&n.isVisible()&&(t==this._.currentTabId&&this.selectPage(e.call(this)),n.hide(),this._.pageCount--,this.updateStyle())},showPage:function(e){if(e=this._.tabs[e]&&this._.tabs[e][0])e.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(e,t){var n=this._.contents[e];return n&&n[t]},getValueOf:function(e,t){return this.getContentElement(e,t).getValue()},setValueOf:function(e,t,n){return this.getContentElement(e,t).setValue(n)},getButton:function(e){return this._.buttons[e]},click:function(e){return this._.buttons[e].click()},disableButton:function(e){return this._.buttons[e].disable()},enableButton:function(e){return this._.buttons[e].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(e,t){if(typeof t=="undefined")t=this._.focusList.length,this._.focusList.push(new o(this,e,t));else{this._.focusList.splice(t,0,new o(this,e,t));for(var n=t+1;n<this._.focusList.length;n++)this._.focusList[n].focusIndex++}}},CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(e,t){if(!this._.dialogDefinitions[e]||typeof t=="function")this._.dialogDefinitions[e]=t},exists:function(e){return!!this._.dialogDefinitions[e]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(e,t,n){return e=e.config.removeDialogTabs,!e||!e.match(RegExp("(?:^|;)"+t+":"+n+"(?:$|;)","i"))},okButton:function(){var e=function(e,t){return t=t||{},CKEDITOR.tools.extend({id:"ok",type:"button",label:e.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(e){e=e.data.dialog,e.fire("ok",{hide:!0}).hide!==!1&&e.hide()}},t,!0)};return e.type="button",e.override=function(t){return CKEDITOR.tools.extend(function(n){return e(n,t)},{type:"button"},!0)},e}(),cancelButton:function(){var e=function(e,t){return t=t||{},CKEDITOR.tools.extend({id:"cancel",type:"button",label:e.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(e){e=e.data.dialog,e.fire("cancel",{hide:!0}).hide!==!1&&e.hide()}},t,!0)};return e.type="button",e.override=function(t){return CKEDITOR.tools.extend(function(n){return e(n,t)},{type:"button"},!0)},e}(),addUIElement:function(e,t){this._.uiElementBuilders[e]=t}}),CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null},CKEDITOR.event.implementOn(CKEDITOR.dialog),CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);var m={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},g=function(e,t,n){for(var r=0,i;i=e[r];r++){if(i.id==t)return i;if(n&&i[n])if(i=g(i[n],t,n))return i}return null},y=function(e,t,n,r,i){if(n){for(var s=0,o;o=e[s];s++){if(o.id==n)return e.splice(s,0,t),t;if(r&&o[r])if(o=y(o[r],t,n,r,!0))return o}if(i)return null}return e.push(t),t},b=function(e,t,n){for(var r=0,i;i=e[r];r++){if(i.id==t)return e.splice(r,1);if(n&&i[n])if(i=b(i[n],t,n))return i}return null},w=function(e,t){this.dialog=e;for(var n=t.contents,r=0,i;i=n[r];r++)n[r]=i&&new a(e,i);CKEDITOR.tools.extend(this,t)};w.prototype={getContents:function(e){return g(this.contents,e)},getButton:function(e){return g(this.buttons,e)},addContents:function(e,t){return y(this.contents,e,t)},addButton:function(e,t){return y(this.buttons,e,t)},removeContents:function(e){b(this.contents,e)},removeButton:function(e){b(this.buttons,e)}},a.prototype={get:function(e){return g(this.elements,e,"children")},add:function(e,t){return y(this.elements,e,t,"children")},remove:function(e){b(this.elements,e,"children")}};var E,S={},x,T={},N=function(e){var t=e.data.$.ctrlKey||e.data.$.metaKey,n=e.data.$.altKey,r=e.data.$.shiftKey,i=String.fromCharCode(e.data.$.keyCode);(t=T[(t?"CTRL+":"")+(n?"ALT+":"")+(r?"SHIFT+":"")+i])&&t.length&&(t=t[t.length-1],t.keydown&&t.keydown.call(t.uiElement,t.dialog,t.key),e.data.preventDefault())},C=function(e){var t=e.data.$.ctrlKey||e.data.$.metaKey,n=e.data.$.altKey,r=e.data.$.shiftKey,i=String.fromCharCode(e.data.$.keyCode);(t=T[(t?"CTRL+":"")+(n?"ALT+":"")+(r?"SHIFT+":"")+i])&&t.length&&(t=t[t.length-1],t.keyup&&(t.keyup.call(t.uiElement,t.dialog,t.key),e.data.preventDefault()))},k=function(e,t,n,r,i){(T[n]||(T[n]=[])).push({uiElement:e,dialog:t,key:n,keyup:i||e.accessKeyUp,keydown:r||e.accessKeyDown})},L=function(e){for(var t in T){for(var n=T[t],r=n.length-1;r>=0;r--)(n[r].dialog==e||n[r].uiElement==e)&&n.splice(r,1);n.length===0&&delete T[t]}},A=function(e,t){e._.accessKeyMap[t]&&e.selectPage(e._.accessKeyMap[t])},O=function(){};(function(){CKEDITOR.ui.dialog={uiElement:function(e,t,n,r,i,s,o){if(!(arguments.length<4)){var u=(r.call?r(t):r)||"div",a=["<",u," "],f=(i&&i.call?i(t):i)||{},l=(s&&s.call?s(t):s)||{},c=(o&&o.call?o.call(this,e,t):o)||"",h=this.domId=l.id||CKEDITOR.tools.getNextId()+"_uiElement";t.requiredContent&&!e.getParentEditor().filter.check(t.requiredContent)&&(f.display="none",this.notAllowed=!0),l.id=h;var p={};t.type&&(p["cke_dialog_ui_"+t.type]=1),t.className&&(p[t.className]=1),t.disabled&&(p.cke_disabled=1);for(var d=l["class"]&&l["class"].split?l["class"].split(" "):[],h=0;h<d.length;h++)d[h]&&(p[d[h]]=1);d=[];for(h in p)d.push(h);l["class"]=d.join(" "),t.title&&(l.title=t.title),p=(t.style||"").split(";"),t.align&&(d=t.align,f["margin-left"]=d=="left"?0:"auto",f["margin-right"]=d=="right"?0:"auto");for(h in f)p.push(h+":"+f[h]);t.hidden&&p.push("display:none");for(h=p.length-1;h>=0;h--)p[h]===""&&p.splice(h,1);p.length>0&&(l.style=(l.style?l.style+"; ":"")+p.join("; "));for(h in l)a.push(h+'="'+CKEDITOR.tools.htmlEncode(l[h])+'" ');a.push(">",c,"</",u,">"),n.push(a.join("")),(this._||(this._={})).dialog=e,typeof t.isChanged=="boolean"&&(this.isChanged=function(){return t.isChanged}),typeof t.isChanged=="function"&&(this.isChanged=t.isChanged),typeof t.setValue=="function"&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(e){return function(n){e.call(this,t.setValue.call(this,n))}})),typeof t.getValue=="function"&&(this.getValue=CKEDITOR.tools.override(this.getValue,function(e){return function(){return t.getValue.call(this,e.call(this))}})),CKEDITOR.event.implementOn(this),this.registerEvents(t),this.accessKeyUp&&this.accessKeyDown&&t.accessKey&&k(this,e,"CTRL+"+t.accessKey);var v=this;e.on("load",function(){var t=v.getInputElement();if(t){var n=v.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?"cke_dialog_ui_focused":"";t.on("focus",function(){e._.tabBarMode=!1,e._.hasFocus=!0,v.fire("focus"),n&&this.addClass(n)}),t.on("blur",function(){v.fire("blur"),n&&this.removeClass(n)})}}),CKEDITOR.tools.extend(this,t),this.keyboardFocusable&&(this.tabIndex=t.tabIndex||0,this.focusIndex=e._.focusList.push(this)-1,this.on("focus",function(){e._.currentFocusIndex=v.focusIndex}))}},hbox:function(e,t,n,r,i){if(!(arguments.length<4)){this._||(this._={});var s=this._.children=t,o=i&&i.widths||null,u=i&&i.height||null,a,f={role:"presentation"};i&&i.align&&(f.align=i.align),CKEDITOR.ui.dialog.uiElement.call(this,e,i||{type:"hbox"},r,"table",{},f,function(){var e=['<tbody><tr class="cke_dialog_ui_hbox">'];for(a=0;a<n.length;a++){var t="cke_dialog_ui_hbox_child",r=[];a===0&&(t="cke_dialog_ui_hbox_first"),a==n.length-1&&(t="cke_dialog_ui_hbox_last"),e.push('<td class="',t,'" role="presentation" '),o?o[a]&&r.push("width:"+d(o[a])):r.push("width:"+Math.floor(100/n.length)+"%"),u&&r.push("height:"+d(u)),i&&i.padding!==void 0&&r.push("padding:"+d(i.padding)),CKEDITOR.env.ie&&CKEDITOR.env.quirks&&s[a].align&&r.push("text-align:"+s[a].align),r.length>0&&e.push('style="'+r.join("; ")+'" '),e.push(">",n[a],"</td>")}return e.push("</tr></tbody>"),e.join("")})}},vbox:function(e,t,n,r,i){if(!(arguments.length<3)){this._||(this._={});var s=this._.children=t,o=i&&i.width||null,u=i&&i.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,e,i||{type:"vbox"},r,"div",null,{role:"presentation"},function(){var t=['<table role="presentation" cellspacing="0" border="0" '];t.push('style="'),i&&i.expand&&t.push("height:100%;"),t.push("width:"+d(o||"100%"),";"),CKEDITOR.env.webkit&&t.push("float:none;"),t.push('"'),t.push('align="',CKEDITOR.tools.htmlEncode(i&&i.align||(e.getParentEditor().lang.dir=="ltr"?"left":"right")),'" '),t.push("><tbody>");for(var r=0;r<n.length;r++){var a=[];t.push('<tr><td role="presentation" '),o&&a.push("width:"+d(o||"100%")),u?a.push("height:"+d(u[r])):i&&i.expand&&a.push("height:"+Math.floor(100/n.length)+"%"),i&&i.padding!==void 0&&a.push("padding:"+d(i.padding)),CKEDITOR.env.ie&&CKEDITOR.env.quirks&&s[r].align&&a.push("text-align:"+s[r].align),a.length>0&&t.push('style="',a.join("; "),'" '),t.push(' class="cke_dialog_ui_vbox_child">',n[r],"</td></tr>")}return t.push("</tbody></table>"),t.join("")})}}}})(),CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(e,t){return this.getInputElement().setValue(e),!t&&this.fire("change",{value:e}),this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var e=this.getInputElement();(e=e.getParent())&&e.$.className.search("cke_dialog_page_contents")==-1;);return e?(e=e.getAttribute("name"),this._.dialog._.currentTabId!=e&&this._.dialog.selectPage(e),this):this},focus:function(){return this.selectParentTab().getInputElement().focus(),this},registerEvents:function(e){var t=/^on([A-Z]\w+)/,n,r=function(e,t,n,r){t.on("load",function(){e.getInputElement().on(n,r,e)})},i;for(i in e)if(n=i.match(t))this.eventProcessors[i]?this.eventProcessors[i].call(this,this._.dialog,e[i]):r(this,this._.dialog,n[1].toLowerCase(),e[i]);return this},eventProcessors:{onLoad:function(e,t){e.on("load",t,this)},onShow:function(e,t){e.on("show",t,this)},onHide:function(e,t){e.on("hide",t,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var e=this.getElement();this.getInputElement().setAttribute("disabled","true"),e.addClass("cke_disabled")},enable:function(){var e=this.getElement();this.getInputElement().removeAttribute("disabled"),e.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return!this.isEnabled()||!this.isVisible()?!1:!0}},CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(e){return arguments.length<1?this._.children.concat():(e.splice||(e=[e]),e.length<2?this._.children[e[0]]:this._.children[e[0]]&&this._.children[e[0]].getChild?this._.children[e[0]].getChild(e.slice(1,e.length)):null)}},!0),CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox,function(){var e={build:function(e,t,n){for(var r=t.children,i,s=[],o=[],u=0;u<r.length&&(i=r[u]);u++){var a=[];s.push(a),o.push(CKEDITOR.dialog._.uiElementBuilders[i.type].build(e,i,a))}return new CKEDITOR.ui.dialog[t.type](e,o,s,n,t)}};CKEDITOR.dialog.addUIElement("hbox",e),CKEDITOR.dialog.addUIElement("vbox",e)}(),CKEDITOR.dialogCommand=function(e,t){this.dialogName=e,CKEDITOR.tools.extend(this,t,!0)},CKEDITOR.dialogCommand.prototype={exec:function(e){e.openDialog(this.dialogName)},canUndo:!1,editorFocus:1},function(){var e=/^([a]|[^a])+$/,t=/^\d*$/,n=/^\d*(?:\.\d+)?$/,r=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,i=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,s=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1,CKEDITOR.VALIDATE_AND=2,CKEDITOR.dialog.validate={functions:function(){var e=arguments;return function(){var t=this&&this.getValue?this.getValue():e[0],n,r=CKEDITOR.VALIDATE_AND,i=[],s;for(s=0;s<e.length;s++){if(typeof e[s]!="function")break;i.push(e[s])}s<e.length&&typeof e[s]=="string"&&(n=e[s],s++),s<e.length&&typeof e[s]=="number"&&(r=e[s]);var o=r==CKEDITOR.VALIDATE_AND?!0:!1;for(s=0;s<i.length;s++)o=r==CKEDITOR.VALIDATE_AND?o&&i[s](t):o||i[s](t);return o?!0:n}},regex:function(e,t){return function(n){return n=this&&this.getValue?this.getValue():n,e.test(n)?!0:t}},notEmpty:function(t){return this.regex(e,t)},integer:function(e){return this.regex(t,e)},number:function(e){return this.regex(n,e)},cssLength:function(e){return this.functions(function(e){return i.test(CKEDITOR.tools.trim(e))},e)},htmlLength:function(e){return this.functions(function(e){return r.test(CKEDITOR.tools.trim(e))},e)},inlineStyle:function(e){return this.functions(function(e){return s.test(CKEDITOR.tools.trim(e))},e)},equals:function(e,t){return this.functions(function(t){return t==e},t)},notEqual:function(e,t){return this.functions(function(t){return t!=e},t)}},CKEDITOR.on("instanceDestroyed",function(e){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var t;t=CKEDITOR.dialog._.currentTop;)t.hide();for(var n in S)S[n].remove();S={}}var e=e.editor._.storedDialogs,r;for(r in e)e[r].destroy()})}(),CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(e,t){var n=null,r=CKEDITOR.dialog._.dialogDefinitions[e];CKEDITOR.dialog._.currentTop===null&&h(this);if(typeof r=="function")n=this._.storedDialogs||(this._.storedDialogs={}),n=n[e]||(n[e]=new CKEDITOR.dialog(this,e)),t&&t.call(n,n),n.show();else{if(r=="failed")throw p(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+e+'" failed when loading definition.');typeof r=="string"&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(r),function(){typeof CKEDITOR.dialog._.dialogDefinitions[e]!="function"&&(CKEDITOR.dialog._.dialogDefinitions[e]="failed"),this.openDialog(e,t)},this,0,1)}return CKEDITOR.skin.loadPart("dialog"),n}})}(),CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(e){e.on("doubleclick",function(t){t.data.dialog&&e.openDialog(t.data.dialog)},null,null,999)}}),function(){CKEDITOR.plugins.add("a11yhelp",{requires:"dialog",availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},init:function(e){var t=this;e.addCommand("a11yHelp",{exec:function(){var n=e.langCode,n=t.availableLangs[n]?n:t.availableLangs[n.replace(/-.*/,"")]?n.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(t.path+"dialogs/lang/"+n+".js"),function(){e.lang.a11yhelp=t.langEntries[n],e.openDialog("a11yHelp")})},modes:{wysiwyg:1,source:1},readOnly:1,canUndo:!1}),e.setKeystroke(CKEDITOR.ALT+48,"a11yHelp"),CKEDITOR.dialog.add("a11yHelp",this.path+"dialogs/a11yhelp.js"),e.on("ariaEditorHelpLabel",function(t){t.data.label=e.lang.common.editorHelp})}})}(),CKEDITOR.plugins.add("about",{requires:"dialog",init:function(e){var t=e.addCommand("about",new CKEDITOR.dialogCommand("about"));t.modes={wysiwyg:1,source:1},t.canUndo=!1,t.readOnly=1,e.ui.addButton&&e.ui.addButton("About",{label:e.lang.about.title,command:"about",toolbar:"about"}),CKEDITOR.dialog.add("about",this.path+"dialogs/about.js")}}),CKEDITOR.plugins.add("basicstyles",{init:function(e){var t=0,n=function(n,i,s,o){if(o){var o=new CKEDITOR.style(o),u=r[s];u.unshift(o),e.attachStyleStateChange(o,function(t){!e.readOnly&&e.getCommand(s).setState(t)}),e.addCommand(s,new CKEDITOR.styleCommand(o,{contentForms:u})),e.ui.addButton&&e.ui.addButton(n,{label:i,command:s,toolbar:"basicstyles,"+(t+=10)})}},r={bold:["strong","b",["span",function(e){return e=e.styles["font-weight"],e=="bold"||+e>=700}]],italic:["em","i",["span",function(e){return e.styles["font-style"]=="italic"}]],underline:["u",["span",function(e){return e.styles["text-decoration"]=="underline"}]],strike:["s","strike",["span",function(e){return e.styles["text-decoration"]=="line-through"}]],subscript:["sub"],superscript:["sup"]},i=e.config,s=e.lang.basicstyles;n("Bold",s.bold,"bold",i.coreStyles_bold),n("Italic",s.italic,"italic",i.coreStyles_italic),n("Underline",s.underline,"underline",i.coreStyles_underline),n("Strike",s.strike,"strike",i.coreStyles_strike),n("Subscript",s.subscript,"subscript",i.coreStyles_subscript),n("Superscript",s.superscript,"superscript",i.coreStyles_superscript),e.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}}),CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"},CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"},CKEDITOR.config.coreStyles_underline={element:"u"},CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"},CKEDITOR.config.coreStyles_subscript={element:"sub"},CKEDITOR.config.coreStyles_superscript={element:"sup"},function(){var e={exec:function(e){var t=e.getCommand("blockquote").state,n=e.getSelection(),r=n&&n.getRanges()[0];if(r){var i=n.createBookmarks();if(CKEDITOR.env.ie){var s=i[0].startNode,o=i[0].endNode,u;if(s&&s.getParent().getName()=="blockquote")for(u=s;u=u.getNext();)if(u.type==CKEDITOR.NODE_ELEMENT&&u.isBlockBoundary()){s.move(u,!0);break}if(o&&o.getParent().getName()=="blockquote")for(u=o;u=u.getPrevious();)if(u.type==CKEDITOR.NODE_ELEMENT&&u.isBlockBoundary()){o.move(u);break}}var a=r.createIterator();a.enlargeBr=e.config.enterMode!=CKEDITOR.ENTER_BR;if(t==CKEDITOR.TRISTATE_OFF){for(s=[];t=a.getNextParagraph();)s.push(t);s.length<1&&(t=e.document.createElement(e.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),o=i.shift(),r.insertNode(t),t.append(new CKEDITOR.dom.text("﻿",e.document)),r.moveToBookmark(o),r.selectNodeContents(t),r.collapse(!0),o=r.createBookmark(),s.push(t),i.unshift(o)),u=s[0].getParent(),r=[];for(o=0;o<s.length;o++)t=s[o],u=u.getCommonAncestor(t.getParent());for(t={table:1,tbody:1,tr:1,ol:1,ul:1};t[u.getName()];)u=u.getParent();for(o=null;s.length>0;){for(t=s.shift();!t.getParent().equals(u);)t=t.getParent();t.equals(o)||r.push(t),o=t}for(;r.length>0;){t=r.shift();if(t.getName()=="blockquote"){for(o=new CKEDITOR.dom.documentFragment(e.document);t.getFirst();)o.append(t.getFirst().remove()),s.push(o.getLast());o.replace(t)}else s.push(t)}r=e.document.createElement("blockquote");for(r.insertBefore(s[0]);s.length>0;)t=s.shift(),r.append(t)}else if(t==CKEDITOR.TRISTATE_ON){o=[];for(u={};t=a.getNextParagraph();){for(s=r=null;t.getParent();){if(t.getParent().getName()=="blockquote"){r=t.getParent(),s=t;break}t=t.getParent()}r&&s&&!s.getCustomData("blockquote_moveout")&&(o.push(s),CKEDITOR.dom.element.setMarker(u,s,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(u),t=[],s=[];for(u={};o.length>0;)a=o.shift(),r=a.getParent(),a.getPrevious()?a.getNext()?(a.breakParent(a.getParent()),s.push(a.getNext())):a.remove().insertAfter(r):a.remove().insertBefore(r),r.getCustomData("blockquote_processed")||(s.push(r),CKEDITOR.dom.element.setMarker(u,r,"blockquote_processed",!0)),t.push(a);CKEDITOR.dom.element.clearAllMarkers(u);for(o=s.length-1;o>=0;o--){r=s[o];e:{u=r;for(var a=0,f=u.getChildCount(),l=void 0;a<f&&(l=u.getChild(a));a++)if(l.type==CKEDITOR.NODE_ELEMENT&&l.isBlockBoundary()){u=!1;break e}u=!0}u&&r.remove()}if(e.config.enterMode==CKEDITOR.ENTER_BR)for(r=!0;t.length;){a=t.shift();if(a.getName()=="div"){o=new CKEDITOR.dom.documentFragment(e.document),r&&a.getPrevious()&&(a.getPrevious().type!=CKEDITOR.NODE_ELEMENT||!a.getPrevious().isBlockBoundary())&&o.append(e.document.createElement("br"));for(r=a.getNext()&&(a.getNext().type!=CKEDITOR.NODE_ELEMENT||!a.getNext().isBlockBoundary());a.getFirst();)a.getFirst().remove().appendTo(o);r&&o.append(e.document.createElement("br")),o.replace(a),r=!1}}}n.selectBookmarks(i),e.focus()}},refresh:function(e,t){this.setState(e.elementPath(t.block||t.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(t){t.blockless||(t.addCommand("blockquote",e),t.ui.addButton&&t.ui.addButton("Blockquote",{label:t.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})}(),"use strict",function(){function e(e){function t(){var t=e.editable();t.on(y,function(e){(!CKEDITOR.env.ie||!v)&&h(e)}),CKEDITOR.env.ie&&t.on("paste",function(t){m||(i(),t.data.preventDefault(),h(t),o("paste")||e.openDialog("paste"))}),CKEDITOR.env.ie&&(t.on("contextmenu",s,null,null,0),t.on("beforepaste",function(e){e.data&&!e.data.$.ctrlKey&&!e.data.$.shiftKey&&s()},null,null,0)),t.on("beforecut",function(){!v&&a(e)});var n;t.attachListener(CKEDITOR.env.ie?t:e.document.getDocumentElement(),"mouseup",function(){n=setTimeout(function(){p()},0)}),e.on("destroy",function(){clearTimeout(n)}),t.on("keyup",p)}function n(t){return{type:t,canUndo:t=="cut",startDisabled:!0,exec:function(){this.type=="cut"&&a();var t,n=this.type;if(CKEDITOR.env.ie)t=o(n);else try{t=e.document.$.execCommand(n,!1,null)}catch(r){t=!1}return t||alert(e.lang.clipboard[this.type+"Error"]),t}}}function r(){return{canUndo:!1,async:!0,exec:function(e,t){var n=function(t,n){t&&u(t.type,t.dataValue,!!n),e.fire("afterCommandExec",{name:"paste",command:r,returnValue:!!t})},r=this;typeof t=="string"?n({type:"auto",dataValue:t},1):e.getClipboardData(n)}}}function i(){m=1,setTimeout(function(){m=0},100)}function s(){v=1,setTimeout(function(){v=0},10)}function o(t){var n=e.document,r=n.getBody(),i=!1,s=function(){i=!0};return r.on(t,s),(CKEDITOR.env.version>7?n.$:n.$.selection.createRange()).execCommand(t),r.removeListener(t,s),i}function u(t,n,r){return t={type:t},r&&e.fire("beforePaste",t)===!1||!n?!1:(t.dataValue=n,e.fire("paste",t))}function a(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var t=e.getSelection(),n,r,i;t.getType()==CKEDITOR.SELECTION_ELEMENT&&(n=t.getSelectedElement())&&(r=t.getRanges()[0],i=e.document.createText(""),i.insertBefore(n),r.setStartBefore(i),r.setEndAfter(n),t.selectRanges([r]),setTimeout(function(){n.getParent()&&(i.remove(),t.selectElement(n))},0))}}function f(t,n){var r=e.document,i=e.editable(),s=function(e){e.cancel()},o;if(!r.getById("cke_pastebin")){var u=e.getSelection(),a=u.createBookmarks();CKEDITOR.env.ie&&u.root.fire("selectionchange");var f=new CKEDITOR.dom.element((CKEDITOR.env.webkit||i.is("body"))&&!CKEDITOR.env.ie?"body":"div",r);f.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var l=0,r=r.getWindow();CKEDITOR.env.webkit?(i.append(f),f.addClass("cke_editable"),i.is("body")||(l=i.getComputedStyle("position")!="static"?i:CKEDITOR.dom.element.get(i.$.offsetParent),l=l.getDocumentPosition().y)):i.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(f),f.setStyles({position:"absolute",top:r.getScrollPosition().y-l+10+"px",width:"1px",height:Math.max(1,r.getViewPaneSize().height-20)+"px",overflow:"hidden",margin:0,padding:0}),CKEDITOR.env.safari&&f.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text")),(l=f.getParent().isReadOnly())?(f.setOpacity(0),f.setAttribute("contenteditable",!0)):f.setStyle(e.config.contentsLangDirection=="ltr"?"left":"right","-1000px"),e.on("selectionChange",s,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)o=i.once("blur",s,null,null,-100);l&&f.focus(),l=new CKEDITOR.dom.range(f),l.selectNodeContents(f);var c=l.select();CKEDITOR.env.ie&&(o=i.once("blur",function(){e.lockSelection(c)}));var h=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=h),o&&o.removeListener(),CKEDITOR.env.ie&&i.focus(),u.selectBookmarks(a),f.remove();var t;CKEDITOR.env.webkit&&(t=f.getFirst())&&t.is&&t.hasClass("Apple-style-span")&&(f=t),e.removeListener("selectionChange",s),n(f.getHtml())},0)}}function l(){if(CKEDITOR.env.ie){e.focus(),i();var t=e.focusManager;t.lock();if(e.editable().fire(y)&&!o("paste"))return t.unlock(),!1;t.unlock()}else try{if(e.editable().fire(y)&&!e.document.$.execCommand("Paste",!1,null))throw 0}catch(n){return!1}return!0}function c(t){if(e.mode=="wysiwyg")switch(t.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:t=e.editable(),i(),!CKEDITOR.env.ie&&t.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:e.fire("saveSnapshot"),setTimeout(function(){e.fire("saveSnapshot")},50)}}function h(t){var n={type:"auto"},r=e.fire("beforePaste",n);f(t,function(e){e=e.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,""),r&&u(n.type,e,0,1)})}function p(){if(e.mode=="wysiwyg"){var t=d("paste");e.getCommand("cut").setState(d("cut")),e.getCommand("copy").setState(d("copy")),e.getCommand("paste").setState(t),e.fire("pasteState",t)}}function d(t){if(g&&t in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if(t=="paste")return CKEDITOR.TRISTATE_OFF;var t=e.getSelection(),n=t.getRanges();return t.getType()==CKEDITOR.SELECTION_NONE||n.length==1&&n[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var v=0,m=0,g=0,y=CKEDITOR.env.ie?"beforepaste":"paste";(function(){e.on("key",c),e.on("contentDom",t),e.on("selectionChange",function(e){g=e.data.selection.getRanges()[0].checkReadOnly(),p()}),e.contextMenu&&e.contextMenu.addListener(function(e,t){return g=t.getRanges()[0].checkReadOnly(),{cut:d("cut"),copy:d("copy"),paste:d("paste")}})})(),function(){function t(t,n,r,i,s){var o=e.lang.clipboard[n];e.addCommand(n,r),e.ui.addButton&&e.ui.addButton(t,{label:o,command:n,toolbar:"clipboard,"+i}),e.addMenuItems&&e.addMenuItem(n,{label:o,command:n,group:"clipboard",order:s})}t("Cut","cut",n("cut"),10,1),t("Copy","copy",n("copy"),20,4),t("Paste","paste",r(),30,8)}(),e.getClipboardData=function(t,n){function r(e){e.removeListener(),e.cancel(),n(e.data)}function i(e){e.removeListener(),e.cancel(),a=!0,n({type:u,dataValue:e.data})}function s(){this.customTitle=t&&t.title}var o=!1,u="auto",a=!1;n||(n=t,t=null),e.on("paste",r,null,null,0),e.on("beforePaste",function(e){e.removeListener(),o=!0,u=e.data.type},null,null,1e3),l()===!1&&(e.removeListener("paste",r),o&&e.fire("pasteDialog",s)?(e.on("pasteDialogCommit",i),e.on("dialogHide",function(e){e.removeListener(),e.data.removeListener("pasteDialogCommit",i),setTimeout(function(){a||n(null)},10)})):n(null))}}function t(e){if(CKEDITOR.env.webkit){if(!e.match(/^[^<]*$/g)&&!e.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!e.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!e.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else{if(!CKEDITOR.env.gecko)return"html";if(!e.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}return"htmlifiedtext"}function n(e,t){function n(e){return CKEDITOR.tools.repeat("</p><p>",~~(e/2))+(e%2==1?"<br>":"")}return t=t.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>"),t=t.replace(/<\/?[A-Z]+>/g,function(e){return e.toLowerCase()}),t.match(/^[^<]$/)?t:(CKEDITOR.env.webkit&&t.indexOf("<div>")>-1&&(t=t.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>"),t.match(/<div>(<br>|)<\/div>/)&&(t="<p>"+t.replace(/(<div>(<br>|)<\/div>)+/g,function(e){return n(e.split("</div><div>").length+1)})+"</p>"),t=t.replace(/<\/div><div>/g,"<br>"),t=t.replace(/<\/?div>/g,"")),CKEDITOR.env.gecko&&e.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(t=t.replace(/^<br><br>$/,"<br>")),t.indexOf("<br><br>")>-1&&(t="<p>"+t.replace(/(<br>){2,}/g,function(e){return n(e.length/4)})+"</p>")),s(e,t))}function r(){var e=new CKEDITOR.htmlParser.filter,t={blockquote:1,dl:1,fieldset:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ol:1,p:1,table:1,ul:1},n=CKEDITOR.tools.extend({br:0},CKEDITOR.dtd.$inline),r={p:1,br:1,"cke:br":1},i=CKEDITOR.dtd,s=CKEDITOR.tools.extend({area:1,basefont:1,embed:1,iframe:1,map:1,object:1,param:1},CKEDITOR.dtd.$nonBodyContent,CKEDITOR.dtd.$cdata),o=function(e){delete e.name,e.add(new CKEDITOR.htmlParser.text(" "))},u=function(e){for(var t=e,n;(t=t.next)&&t.name&&t.name.match(/^h\d$/);){n=new CKEDITOR.htmlParser.element("cke:br"),n.isEmpty=!0;for(e.add(n);n=t.children.shift();)e.add(n)}};return e.addRules({elements:{h1:u,h2:u,h3:u,h4:u,h5:u,h6:u,img:function(e){var e=CKEDITOR.tools.trim(e.attributes.alt||""),t=" ";return e&&!e.match(/(^http|\.(jpe?g|gif|png))/i)&&(t=" ["+e+"] "),new CKEDITOR.htmlParser.text(t)},td:o,th:o,$:function(e){var o=e.name,u;if(s[o])return!1;e.attributes={};if(o=="br")return e;if(t[o])e.name="p";else if(n[o])delete e.name;else if(i[o]){u=new CKEDITOR.htmlParser.element("cke:br"),u.isEmpty=!0;if(CKEDITOR.dtd.$empty[o])return u;e.add(u,0),u=u.clone(),u.isEmpty=!0,e.add(u),delete e.name}return r[e.name]||delete e.name,e}}},{applyToAll:!0}),e}function i(e,t,n){var t=new CKEDITOR.htmlParser.fragment.fromHtml(t),r=new CKEDITOR.htmlParser.basicWriter;t.writeHtml(r,n);var t=r.getHtml(),t=t.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g,"$1").replace(/(<cke:br \/>){2,}/g,"<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g,"$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g,"$1").replace(/<(cke:)?br( \/)?>/g,"<br>").replace(/<p><\/p>/g,""),i=0,t=t.replace(/<\/?p>/g,function(e){if(e=="<p>"){if(++i>1)return"</p><p>"}else if(--i>0)return"</p><p>";return e}).replace(/<p><\/p>/g,"");return s(e,t)}function s(e,t){return e.enterMode==CKEDITOR.ENTER_BR?t=t.replace(/(<\/p><p>)+/g,function(e){return CKEDITOR.tools.repeat("<br>",e.length/7*2)}).replace(/<\/?p>/g,""):e.enterMode==CKEDITOR.ENTER_DIV&&(t=t.replace(/<(\/)?p>/g,"<$1div>")),t}CKEDITOR.plugins.add("clipboard",{requires:"dialog",init:function(s){var o;e(s),CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js")),s.on("paste",function(e){var t=e.data.dataValue,n=CKEDITOR.dtd.$block;t.indexOf("Apple-")>-1&&(t=t.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi," "),e.data.type!="html"&&(t=t.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(e,t){return t.replace(/\t/g,"&nbsp;&nbsp; &nbsp;")})),t.indexOf('<br class="Apple-interchange-newline">')>-1&&(e.data.startsWithEOL=1,e.data.preSniffing="html",t=t.replace(/<br class="Apple-interchange-newline">/,"")),t=t.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(t.match(/^<[^<]+cke_(editable|contents)/i)){var r,i,s=new CKEDITOR.dom.element("div");for(s.setHtml(t);s.getChildCount()==1&&(r=s.getFirst())&&r.type==CKEDITOR.NODE_ELEMENT&&(r.hasClass("cke_editable")||r.hasClass("cke_contents"));)s=i=r;i&&(t=i.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?t=t.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(t,r){return r.toLowerCase()in n?(e.data.preSniffing="html","<"+r):t}):CKEDITOR.env.webkit?t=t.replace(/<\/(\w+)><div><br><\/div>$/,function(t,r){return r in n?(e.data.endsWithEOL=1,"</"+r+">"):t}):CKEDITOR.env.gecko&&(t=t.replace(/(\s)<br>$/,"$1")),e.data.dataValue=t},null,null,3),s.on("paste",function(e){var e=e.data,u=e.type,a=e.dataValue,l,h=s.config.clipboard_defaultContentType||"html";l=u=="html"||e.preSniffing=="html"?"html":t(a),l=="htmlifiedtext"?a=n(s.config,a):u=="text"&&l=="html"&&(a=i(s.config,a,o||(o=r(s)))),e.startsWithEOL&&(a='<br data-cke-eol="1">'+a),e.endsWithEOL&&(a+='<br data-cke-eol="1">'),u=="auto"&&(u=l=="html"||h=="html"?"html":"text"),e.type=u,e.dataValue=a,delete e.preSniffing,delete e.startsWithEOL,delete e.endsWithEOL},null,null,6),s.on("paste",function(e){e=e.data,s.insertHtml(e.dataValue,e.type),setTimeout(function(){s.fire("afterPaste")},0)},null,null,1e3),s.on("pasteDialog",function(e){setTimeout(function(){s.openDialog("paste",e.data)},0)})}})}(),function(){CKEDITOR.plugins.add("panel",{beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}}),CKEDITOR.UI_PANEL="panel",CKEDITOR.ui.panel=function(e,t){t&&CKEDITOR.tools.extend(this,t),CKEDITOR.tools.extend(this,{className:"",css:[]}),this.id=CKEDITOR.tools.getNextId(),this.document=e,this.isFramed=this.forceIFrame||this.css.length,this._={blocks:{}}},CKEDITOR.ui.panel.handler={create:function(e){return new CKEDITOR.ui.panel(e)}};var e=CKEDITOR.addTemplate("panel",'<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),t=CKEDITOR.addTemplate("panel-frame",'<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),n=CKEDITOR.addTemplate("panel-frame-inner",'<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');CKEDITOR.ui.panel.prototype={render:function(r,i){this.getHolderElement=function(){var e=this._.holder;if(!e){if(this.isFramed){var e=this.document.getById(this.id+"_frame"),t=e.getParent(),e=e.getFrameDocument();CKEDITOR.env.iOS&&t.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"}),t=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0,this.onLoad&&this.onLoad()},this)),e.write(n.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+t+");"},s))),e.getWindow().$.CKEDITOR=CKEDITOR,e.on("keydown",function(e){var t=e.data.getKeystroke(),n=this.document.getById(this.id).getAttribute("dir");this._.onKeyDown&&this._.onKeyDown(t)===!1?e.data.preventDefault():(t==27||t==(n=="rtl"?39:37))&&this.onEscape&&this.onEscape(t)===!1&&e.data.preventDefault()},this),e=e.getBody(),e.unselectable(),CKEDITOR.env.air&&CKEDITOR.tools.callFunction(t)}else e=this.document.getById(this.id);this._.holder=e}return e};var s={editorId:r.id,id:this.id,langCode:r.langCode,dir:r.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":r.config.baseFloatZIndex+1};if(this.isFramed){var o=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";s.frame=t.output({id:this.id+"_frame",src:o})}return o=e.output(s),i&&i.push(o),o},addBlock:function(e,t){return t=this._.blocks[e]=t instanceof CKEDITOR.ui.panel.block?t:new CKEDITOR.ui.panel.block(this.getHolderElement(),t),this._.currentBlock||this.showBlock(e),t},getBlock:function(e){return this._.blocks[e]},showBlock:function(e){var e=this._.blocks[e],t=this._.currentBlock,n=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");return t&&t.hide(),this._.currentBlock=e,CKEDITOR.fire("ariaWidget",n),e._.focusIndex=-1,this._.onKeyDown=e.onKeyDown&&CKEDITOR.tools.bind(e.onKeyDown,e),e.show(),e},destroy:function(){this.element&&this.element.remove()}},CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(e,t){this.element=e.append(e.getDocument().createElement("div",{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}})),t&&CKEDITOR.tools.extend(this,t),this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]}),this.keys={},this._.focusIndex=-1,this.element.disableContextMenu()},_:{markItem:function(e){e!=-1&&(e=this.element.getElementsByTag("a").getItem(this._.focusIndex=e),CKEDITOR.env.webkit&&e.getDocument().getWindow().focus(),e.focus(),this.onMark&&this.onMark(e))}},proto:{show:function(){this.element.setStyle("display","")},hide:function(){(!this.onHide||this.onHide.call(this)!==!0)&&this.element.setStyle("display","none")},onKeyDown:function(e,t){var n=this.keys[e];switch(n){case"next":for(var r=this._.focusIndex,n=this.element.getElementsByTag("a"),i;i=n.getItem(++r);)if(i.getAttribute("_cke_focus")&&i.$.offsetWidth){this._.focusIndex=r,i.focus();break}if(!i&&!t)return this._.focusIndex=-1,this.onKeyDown(e,1);return!1;case"prev":r=this._.focusIndex;for(n=this.element.getElementsByTag("a");r>0&&(i=n.getItem(--r));){if(i.getAttribute("_cke_focus")&&i.$.offsetWidth){this._.focusIndex=r,i.focus();break}i=null}if(!i&&!t)return this._.focusIndex=n.count(),this.onKeyDown(e,1);return!1;case"click":case"mouseup":return r=this._.focusIndex,(i=r>=0&&this.element.getElementsByTag("a").getItem(r))&&(i.$[n]?i.$[n]():i.$["on"+n]()),!1}return!0}}})}(),CKEDITOR.plugins.add("floatpanel",{requires:"panel"}),function(){function e(e,n,r,i,s){var s=CKEDITOR.tools.genKey(n.getUniqueId(),r.getUniqueId(),e.lang.dir,e.uiColor||"",i.css||"",s||""),o=t[s];return o||(o=t[s]=new CKEDITOR.ui.panel(n,i),o.element=r.append(CKEDITOR.dom.element.createFromHtml(o.render(e),n)),o.element.setStyles({display:"none",position:"absolute"})),o}var t={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(t,n,r,i){function s(){l.hide()}r.forceIFrame=1,r.toolbarRelated&&t.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(n=CKEDITOR.document.getById("cke_"+t.name));var o=n.getDocument(),i=e(t,o,n,r,i||0),u=i.element,f=u.getFirst(),l=this;u.disableContextMenu(),this.element=u,this._={editor:t,panel:i,parentElement:n,definition:r,document:o,iframe:f,children:[],dir:t.lang.dir},t.on("mode",s),t.on("resize",s),CKEDITOR.env.iOS||o.getWindow().on("resize",s)},proto:{addBlock:function(e,t){return this._.panel.addBlock(e,t)},addListBlock:function(e,t){return this._.panel.addListBlock(e,t)},getBlock:function(e){return this._.panel.getBlock(e)},showBlock:function(e,t,n,r,i,s){var o=this._.panel,u=o.showBlock(e);this.allowBlur(!1),e=this._.editor.editable(),this._.returnFocus=e.hasFocus?e:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement),this._.hideTimeout=0;var a=this.element,e=this._.iframe,e=CKEDITOR.env.ie?e:new CKEDITOR.dom.window(e.$.contentWindow),f=a.getDocument(),l=this._.parentElement.getPositionedAncestor(),c=t.getDocumentPosition(f),f=l?l.getDocumentPosition(f):{x:0,y:0},h=this._.dir=="rtl",p=c.x+(r||0)-f.x,d=c.y+(i||0)-f.y;!h||n!=1&&n!=4?!h&&(n==2||n==3)&&(p+=t.$.offsetWidth-1):p+=t.$.offsetWidth;if(n==3||n==4)d+=t.$.offsetHeight-1;this._.panel._.offsetParentId=t.getId(),a.setStyles({top:d+"px",left:0,display:""}),a.setOpacity(0),a.getFirst().removeStyle("width"),this._.editor.focusManager.add(e),this._.blurSet||(CKEDITOR.event.useCapture=!0,e.on("blur",function(e){function t(){delete this._.returnFocus,this.hide()}this.allowBlur()&&e.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(t,0,this)):t.call(this))},this),e.on("focus",function(){this._.focused=!0,this.hideChild(),this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(e.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),e.on("touchend",function(){this._.hideTimeout=0,this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1),o.onEscape=CKEDITOR.tools.bind(function(e){if(this.onEscape&&this.onEscape(e)===!1)return!1},this),CKEDITOR.tools.setTimeout(function(){var e=CKEDITOR.tools.bind(function(){a.removeStyle("width");if(u.autoSize){var e=u.element.getDocument(),e=(CKEDITOR.env.webkit?u.element:e.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&e>0&&(e+=(a.$.offsetWidth||0)-(a.$.clientWidth||0)+3),a.setStyle("width",e+10+"px"),e=u.element.$.scrollHeight,CKEDITOR.env.ie&&CKEDITOR.env.quirks&&e>0&&(e+=(a.$.offsetHeight||0)-(a.$.clientHeight||0)+3),a.setStyle("height",e+"px"),o._.currentBlock.element.setStyle("display","none").removeStyle("display")}else a.removeStyle("height");h&&(p-=a.$.offsetWidth),a.setStyle("left",p+"px");var t=o.element.getWindow(),e=a.$.getBoundingClientRect(),t=t.getViewPaneSize(),n=e.width||e.right-e.left,r=e.height||e.bottom-e.top,i=h?e.right:t.width-e.left,f=h?t.width-e.right:e.left;h?i<n&&(p=f>n?p+n:t.width>n?p-e.left:p-e.right+t.width):i<n&&(p=f>n?p-n:t.width>n?p-e.right+t.width:p-e.left),n=e.top,t.height-e.top<r&&(d=n>r?d-r:t.height>r?d-e.bottom+t.height:d-e.top),CKEDITOR.env.ie&&(t=e=new CKEDITOR.dom.element(a.$.offsetParent),t.getName()=="html"&&(t=t.getDocument().getBody()),t.getComputedStyle("direction")=="rtl"&&(p=CKEDITOR.env.ie8Compat?p-a.getDocument().getDocumentElement().$.scrollLeft*2:p-(e.$.scrollWidth-e.$.clientWidth)));var e=a.getFirst(),l;(l=e.getCustomData("activePanel"))&&l.onHide&&l.onHide.call(this,1),e.setCustomData("activePanel",this),a.setStyles({top:d+"px",left:p+"px"}),a.setOpacity(1),s&&s()},this);o.isLoaded?e():o.onLoad=e,CKEDITOR.tools.setTimeout(function(){var e=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus(),u.element.focus(),CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=e),this.allowBlur(!0),this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this),this.visible=1,this.onShow&&this.onShow.call(this)},focus:function(){if(CKEDITOR.env.webkit){var e=CKEDITOR.document.getActive();e&&!e.equals(this._.iframe)&&e.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var e=this._.iframe.getFrameDocument().getActive();e&&e.is("a")&&(this._.lastFocused=e)},hide:function(e){if(this.visible&&(!this.onHide||this.onHide.call(this)!==!0)){this.hideChild(),CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur(),this.element.setStyle("display","none"),this.visible=0,this.element.getFirst().removeCustomData("activePanel");if(e=e&&this._.returnFocus)CKEDITOR.env.webkit&&e.type&&e.getWindow().$.focus(),e.focus();delete this._.lastFocused,this._.editor.fire("panelHide",this)}},allowBlur:function(e){var t=this._.panel;return e!==void 0&&(t.allowBlur=e),t.allowBlur},showAsChild:function(e,t,n,r,i,s){if(this._.activeChild!=e||e._.panel._.offsetParentId!=n.getId())this.hideChild(),e.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=e,this._.focused=!1,e.showBlock(t,n,r,i,s),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){e.element.getChild(0).$.style.cssText+=""},100)},hideChild:function(e){var t=this._.activeChild;t&&(delete t.onHide,delete this._.activeChild,t.hide(),e&&this.focus())}}}),CKEDITOR.on("instanceDestroyed",function(){var e=CKEDITOR.tools.isEmpty(CKEDITOR.instances),n;for(n in t){var r=t[n];e?r.destroy():r.element.hide()}e&&(t={})})}(),CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(e){for(var t=e.config.menu_groups.split(","),n=e._.menuGroups={},r=e._.menuItems={},i=0;i<t.length;i++)n[t[i]]=i+1;e.addMenuGroup=function(e,t){n[e]=t||100},e.addMenuItem=function(e,t){n[t.group]&&(r[e]=new CKEDITOR.menuItem(this,e,t))},e.addMenuItems=function(e){for(var t in e)this.addMenuItem(t,e[t])},e.getMenuItem=function(e){return r[e]},e.removeMenuItem=function(e){delete r[e]}}}),function(){function e(e){e.sort(function(e,t){return e.group<t.group?-1:e.group>t.group?1:e.order<t.order?-1:e.order>t.order?1:0})}var t='<span class="cke_menuitem"><a id="{id}" class="cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href="{href}" title="{title}" tabindex="-1"_cke_focus=1 hidefocus="true" role="{role}" aria-haspopup="{hasPopup}" aria-disabled="{disabled}" {ariaChecked}';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(t+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(t+=' onblur="this.style.cssText = this.style.cssText;"');var t=t+(' onmouseover="CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout="CKEDITOR.tools.callFunction({moveOutFn},{index});" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},{index}); return false;">'),n=CKEDITOR.addTemplate("menuItem",t+'<span class="cke_menubutton_inner"><span class="cke_menubutton_icon"><span class="cke_button_icon cke_button__{iconName}_icon" style="{iconStyle}"></span></span><span class="cke_menubutton_label">{label}</span>{arrowHtml}</span></a></span>'),r=CKEDITOR.addTemplate("menuArrow",'<span class="cke_menuarrow"><span>{label}</span></span>');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(e,t){t=this._.definition=t||{},this.id=CKEDITOR.tools.getNextId(),this.editor=e,this.items=[],this._.listeners=[],this._.level=t.level||1;var n=CKEDITOR.tools.extend({},t.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),r=n.block.attributes=n.attributes||{};!r.role&&(r.role="menu"),this._.panelDefinition=n},_:{onShow:function(){var e=this.editor.getSelection(),t=e&&e.getStartElement(),n=this.editor.elementPath(),r=this._.listeners;this.removeAll();for(var i=0;i<r.length;i++){var s=r[i](t,e,n);if(s)for(var o in s){var u=this.editor.getMenuItem(o);u&&(!u.command||this.editor.getCommand(u.command).state)&&(u.state=s[o],this.add(u))}}},onClick:function(e){this.hide(),e.onClick?e.onClick():e.command&&this.editor.execCommand(e.command)},onEscape:function(e){var t=this.parent;return t?t._.panel.hideChild(1):e==27&&this.hide(1),!1},onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(e){var t=this._.subMenu,n=this.items[e];if(n=n.getItems&&n.getItems()){t?t.removeAll():(t=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},!0)),t.parent=this,t._.onClick=CKEDITOR.tools.bind(this._.onClick,this));for(var r in n){var i=this.editor.getMenuItem(r);i&&(i.state=n[r],t.add(i))}var s=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+(""+e));setTimeout(function(){t.show(s,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(e){e.order||(e.order=this.items.length),this.items.push(e)},removeAll:function(){this.items=[]},show:function(t,n,r,i){if(!this.parent){this._.onShow();if(!this.items.length)return}var n=n||(this.editor.lang.dir=="rtl"?2:1),s=this.items,o=this.editor,u=this._.panel,f=this._.element;if(!u){u=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level),u.onEscape=CKEDITOR.tools.bind(function(e){if(this._.onEscape(e)===!1)return!1},this),u.onShow=function(){u._.panel.getHolderElement().getParent().addClass("cke cke_reset_all")},u.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this),f=u.addBlock(this.id,this._.panelDefinition.block),f.autoSize=!0;var l=f.keys;l[40]="next",l[9]="next",l[38]="prev",l[CKEDITOR.SHIFT+9]="prev",l[o.lang.dir=="rtl"?37:39]=CKEDITOR.env.ie?"mouseup":"click",l[32]=CKEDITOR.env.ie?"mouseup":"click",CKEDITOR.env.ie&&(l[13]="mouseup"),f=this._.element=f.element,l=f.getDocument(),l.getBody().setStyle("overflow","hidden"),l.getElementsByTag("html").getItem(0).setStyle("overflow","hidden"),this._.itemOverFn=CKEDITOR.tools.addFunction(function(e){clearTimeout(this._.showSubTimeout),this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,o.config.menu_subMenuDelay||400,this,[e])},this),this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this),this._.itemClickFn=CKEDITOR.tools.addFunction(function(e){var t=this.items[e];t.state==CKEDITOR.TRISTATE_DISABLED?this.hide(1):t.getItems?this._.showSubMenu(e):this._.onClick(t)},this)}e(s);for(var l=o.elementPath(),l=['<div class="cke_menu'+(l&&l.direction()!=o.lang.dir?" cke_mixed_dir_content":"")+'" role="presentation">'],c=s.length,h=c&&s[0].group,p=0;p<c;p++){var d=s[p];h!=d.group&&(l.push('<div class="cke_menuseparator" role="separator"></div>'),h=d.group),d.render(this,p,l)}l.push("</div>"),f.setHtml(l.join("")),CKEDITOR.ui.fire("ready",this),this.parent?this.parent._.panel.showAsChild(u,this.id,t,n,r,i):u.showBlock(this.id,t,n,r,i),o.fire("menuShow",[u])},addListener:function(e){this._.listeners.push(e)},hide:function(e){this._.onHide&&this._.onHide(),this._.panel&&this._.panel.hide(e)}}}),CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(e,t,n){CKEDITOR.tools.extend(this,n,{order:0,className:"cke_menubutton__"+t}),this.group=e._.menuGroups[this.group],this.editor=e,this.name=t},proto:{render:function(e,t,i){var s=e.id+(""+t),o=typeof this.state=="undefined"?CKEDITOR.TRISTATE_OFF:this.state,u="",a=o==CKEDITOR.TRISTATE_ON?"on":o==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(u=' aria-checked="'+(o==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var f=this.getItems,l="&#"+(this.editor.lang.dir=="rtl"?"9668":"9658")+";",c=this.name;this.icon&&!/\./.test(this.icon)&&(c=this.icon),e={id:s,name:this.name,iconName:c,label:this.label,cls:this.className||"",state:a,hasPopup:f?"true":"false",disabled:o==CKEDITOR.TRISTATE_DISABLED,title:this.label,href:"javascript:void('"+(this.label||"").replace("'")+"')",hoverFn:e._.itemOverFn,moveOutFn:e._.itemOutFn,clickFn:e._.itemClickFn,index:t,iconStyle:CKEDITOR.skin.getIconStyle(c,this.editor.lang.dir=="rtl",c==this.icon?null:this.icon,this.iconOffset),arrowHtml:f?r.output({label:l}):"",role:this.role?this.role:"menuitem",ariaChecked:u},n.output(e,i)}}})}(),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,$:function(e){this.base.call(this,e,{panel:{className:"cke_menu_panel",attributes:{"aria-label":e.lang.contextmenu.options}}})},proto:{addTarget:function(e,t){e.on("contextmenu",function(e){var e=e.data,r=CKEDITOR.env.webkit?n:CKEDITOR.env.mac?e.$.metaKey:e.$.ctrlKey;if(!t||!r){e.preventDefault();if(CKEDITOR.env.mac&&CKEDITOR.env.webkit){var r=this.editor,i=(new CKEDITOR.dom.elementPath(e.getTarget(),r.editable())).contains(function(e){return e.hasAttribute("contenteditable")},!0);i&&i.getAttribute("contenteditable")=="false"&&r.getSelection().fake(i)}var i=e.getTarget().getDocument(),s=e.getTarget().getDocument().getDocumentElement(),r=!i.equals(CKEDITOR.document),i=i.getWindow().getScrollPosition(),o=r?e.$.clientX:e.$.pageX||i.x+e.$.clientX,u=r?e.$.clientY:e.$.pageY||i.y+e.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(s,null,o,u)},CKEDITOR.env.ie?200:0,this)}},this);if(CKEDITOR.env.webkit){var n,r=function(){n=0};e.on("keydown",function(e){n=CKEDITOR.env.mac?e.data.$.metaKey:e.data.$.ctrlKey}),e.on("keyup",r),e.on("contextmenu",r)}},open:function(e,t,n,r){this.editor.focus(),e=e||CKEDITOR.document.getDocumentElement(),this.editor.selectionChange(1),this.show(e,t,n,r)}}})},beforeInit:function(e){var t=e.contextMenu=new CKEDITOR.plugins.contextMenu(e);e.on("contentDom",function(){t.addTarget(e.editable(),e.config.browserContextMenuOnCtrl!==!1)}),e.addCommand("contextMenu",{exec:function(){e.contextMenu.open(e.document.getBody())}}),e.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu"),e.setKeystroke(CKEDITOR.CTRL+CKEDITOR.SHIFT+121,"contextMenu")}}),function(){function t(t,r){function s(e){e=l.list[e];if(e.equals(t.editable())||e.getAttribute("contenteditable")=="true"){var n=t.createRange();n.selectNodeContents(e),n.select()}else t.getSelection().selectElement(e);t.focus()}function o(){f&&f.setHtml(n),delete l.list}var u=t.ui.spaceId("path"),f,l=t._.elementsPath,h=l.idBase;r.html=r.html+('<span id="'+u+'_label" class="cke_voice_label">'+t.lang.elementspath.eleLabel+'</span><span id="'+u+'" class="cke_path" role="group" aria-labelledby="'+u+'_label">'+n+"</span>"),t.on("uiReady",function(){var e=t.ui.space("path");e&&t.focusManager.add(e,1)}),l.onClick=s;var p=CKEDITOR.tools.addFunction(s),d=CKEDITOR.tools.addFunction(function(e,n){var r=l.idBase,i,n=new CKEDITOR.dom.event(n);i=t.lang.dir=="rtl";switch(n.getKeystroke()){case i?39:37:case 9:return(i=CKEDITOR.document.getById(r+(e+1)))||(i=CKEDITOR.document.getById(r+"0")),i.focus(),!1;case i?37:39:case CKEDITOR.SHIFT+9:return(i=CKEDITOR.document.getById(r+(e-1)))||(i=CKEDITOR.document.getById(r+(l.list.length-1))),i.focus(),!1;case 27:return t.focus(),!1;case 13:case 32:return s(e),!1}return!0});t.on("selectionChange",function(){for(var e=[],r=l.list=[],s=[],o=l.filters,a=!0,v=t.elementPath().elements,g,y=v.length;y--;){var w=v[y],E=0;g=w.data("cke-display-name")?w.data("cke-display-name"):w.data("cke-real-element-type")?w.data("cke-real-element-type"):w.getName(),a=w.hasAttribute("contenteditable")?w.getAttribute("contenteditable")=="true":a,!a&&!w.hasAttribute("contenteditable")&&(E=1);for(var S=0;S<o.length;S++){var x=o[S](w,g);if(x===!1){E=1;break}g=x||g}E||(r.unshift(w),s.unshift(g))}r=r.length;for(o=0;o<r;o++)g=s[o],a=t.lang.elementspath.eleTitle.replace(/%1/,g),g=i.output({id:h+o,label:a,text:g,jsTitle:"javascript:void('"+g+"')",index:o,keyDownFn:d,clickFn:p}),e.unshift(g);f||(f=CKEDITOR.document.getById(u)),s=f,s.setHtml(e.join("")+n),t.fire("elementsPathUpdate",{space:s})}),t.on("readOnly",o),t.on("contentDomUnload",o),t.addCommand("elementsPathFocus",e),t.setKeystroke(CKEDITOR.ALT+122,"elementsPathFocus")}var e;e={editorFocus:!1,readOnly:1,exec:function(e){(e=CKEDITOR.document.getById(e._.elementsPath.idBase+"0"))&&e.focus(CKEDITOR.env.ie||CKEDITOR.env.air)}};var n='<span class="cke_path_empty">&nbsp;</span>',r="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(r+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(r+=' onblur="this.style.cssText = this.style.cssText;"');var i=CKEDITOR.addTemplate("pathItem",'<a id="{id}" href="{jsTitle}" tabindex="-1" class="cke_path_item" title="{label}"'+r+' hidefocus="true"  onkeydown="return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick="CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role="button" aria-label="{label}">{text}</a>');CKEDITOR.plugins.add("elementspath",{init:function(e){e._.elementsPath={idBase:"cke_elementspath_"+CKEDITOR.tools.getNextNumber()+"_",filters:[]},e.on("uiSpace",function(n){n.data.space=="bottom"&&t(e,n.data)})}})}(),function(){function e(e,r){var i,s;r.on("refresh",function(e){var r=[t],i;for(i in e.data.states)r.push(e.data.states[i]);this.setState(CKEDITOR.tools.search(r,n)?n:t)},r,null,100),r.on("exec",function(t){i=e.getSelection(),s=i.createBookmarks(1),t.data||(t.data={}),t.data.done=!1},r,null,0),r.on("exec",function(){e.forceNextSelectionCheck(),i.selectBookmarks(s)},r,null,100)}var t=CKEDITOR.TRISTATE_DISABLED,n=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(t){var n=CKEDITOR.plugins.indent.genericDefinition;e(t,t.addCommand("indent",new n(!0))),e(t,t.addCommand("outdent",new n)),t.ui.addButton&&(t.ui.addButton("Indent",{label:t.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),t.ui.addButton("Outdent",{label:t.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"})),t.on("dirChanged",function(e){var n=t.createRange(),r=e.data.node;n.setStartBefore(r),n.setEndAfter(r);for(var i=new CKEDITOR.dom.walker(n),s;s=i.next();)if(s.type==CKEDITOR.NODE_ELEMENT)if(!s.equals(r)&&s.getDirection())n.setStartAfter(s),i=new CKEDITOR.dom.walker(n);else{var o=t.config.indentClasses;if(o)for(var u=e.data.dir=="ltr"?["_rtl",""]:["","_rtl"],a=0;a<o.length;a++)s.hasClass(o[a]+u[0])&&(s.removeClass(o[a]+u[0]),s.addClass(o[a]+u[1]));o=s.getStyle("margin-right"),u=s.getStyle("margin-left"),o?s.setStyle("margin-left",o):s.removeStyle("margin-left"),u?s.setStyle("margin-right",u):s.removeStyle("margin-right")}})}}),CKEDITOR.plugins.indent={genericDefinition:function(e){this.isIndent=!!e,this.startDisabled=!this.isIndent},specificDefinition:function(e,t,n){this.name=t,this.editor=e,this.jobs={},this.enterBr=e.config.enterMode==CKEDITOR.ENTER_BR,this.isIndent=!!n,this.relatedGlobal=n?"indent":"outdent",this.indentKey=n?9:CKEDITOR.SHIFT+9,this.database={}},registerCommands:function(e,t){e.on("pluginsLoaded",function(){for(var e in t)(function(e,t){var n=e.getCommand(t.relatedGlobal),r;for(r in t.jobs)n.on("exec",function(n){n.data.done||(e.fire("lockSnapshot"),t.execJob(e,r)&&(n.data.done=!0),e.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(t.database))},this,null,r),n.on("refresh",function(n){n.data.states||(n.data.states={}),n.data.states[t.name+"@"+r]=t.refreshJob(e,r,n.data.path)},this,null,r);e.addFeature(t)})(this,t[e])})}},CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}},CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(e,n){var r=this.jobs[n];if(r.state!=t)return r.exec.call(this,e)},refreshJob:function(e,n,r){return n=this.jobs[n],n.state=e.activeFilter.checkFeature(this)?n.refresh.call(this,e,r):t,n.state},getContext:function(e){return e.contains(this.context)}}}(),function(){function e(e){function r(t){for(var r=a.startContainer,u=a.endContainer;r&&!r.getParent().equals(t);)r=r.getParent();for(;u&&!u.getParent().equals(t);)u=u.getParent();if(!r||!u)return!1;for(var f=r,r=[],l=!1;!l;)f.equals(u)&&(l=!0),r.push(f),f=f.getNext();if(r.length<1)return!1;f=t.getParents(!0);for(u=0;u<f.length;u++)if(f[u].getName&&o[f[u].getName()]){t=f[u];break}for(var f=i.isIndent?1:-1,u=r[0],r=r[r.length-1],l=CKEDITOR.plugins.list.listToArray(t,s),c=l[r.getCustomData("listarray_index")].indent,u=u.getCustomData("listarray_index");u<=r.getCustomData("listarray_index");u++){l[u].indent=l[u].indent+f;if(f>0){var h=l[u].parent;l[u].parent=new CKEDITOR.dom.element(h.getName(),h.getDocument())}}for(u=r.getCustomData("listarray_index")+1;u<l.length&&l[u].indent>c;u++)l[u].indent=l[u].indent+f;r=CKEDITOR.plugins.list.arrayToList(l,s,null,e.config.enterMode,t.getDirection());if(!i.isIndent){var p;if((p=t.getParent())&&p.is("li"))for(var f=r.listNode.getChildren(),v=[],m,u=f.count()-1;u>=0;u--)(m=f.getItem(u))&&m.is&&m.is("li")&&v.push(m)}r&&r.listNode.replace(t);if(v&&v.length)for(u=0;u<v.length;u++){for(m=t=v[u];(m=m.getNext())&&m.is&&m.getName()in o;)CKEDITOR.env.needsNbspFiller&&!t.getFirst(n)&&t.append(a.document.createText(" ")),t.append(m);t.insertAfter(p)}return r&&e.fire("contentDomInvalidated"),!0}for(var i=this,s=this.database,o=this.context,u=e.getSelection(),u=(u&&u.getRanges()).createIterator(),a;a=u.getNextRange();){for(var f=a.getCommonAncestor();f&&(f.type!=CKEDITOR.NODE_ELEMENT||!o[f.getName()]);)f=f.getParent();f||(f=a.startPath().contains(o))&&a.setEndAt(f,CKEDITOR.POSITION_BEFORE_END);if(!f){var l=a.getEnclosedNode();l&&l.type==CKEDITOR.NODE_ELEMENT&&l.getName()in o&&(a.setStartAt(l,CKEDITOR.POSITION_AFTER_START),a.setEndAt(l,CKEDITOR.POSITION_BEFORE_END),f=l)}f&&a.startContainer.type==CKEDITOR.NODE_ELEMENT&&a.startContainer.getName()in o&&(l=new CKEDITOR.dom.walker(a),l.evaluator=t,a.startContainer=l.next()),f&&a.endContainer.type==CKEDITOR.NODE_ELEMENT&&a.endContainer.getName()in o&&(l=new CKEDITOR.dom.walker(a),l.evaluator=t,a.endContainer=l.previous());if(f)return r(f)}return 0}function t(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.is("li")}function n(e){return r(e)&&i(e)}var r=CKEDITOR.dom.walker.whitespaces(!0),i=CKEDITOR.dom.walker.bookmark(!1,!0),s=CKEDITOR.TRISTATE_DISABLED,o=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(t){function n(t){r.specificDefinition.apply(this,arguments),this.requiredContent=["ul","ol"],t.on("key",function(e){if(t.mode=="wysiwyg"&&e.data.keyCode==this.indentKey){var n=this.getContext(t.elementPath());n&&(!this.isIndent||!CKEDITOR.plugins.indentList.firstItemInPath(this.context,t.elementPath(),n))&&(t.execCommand(this.relatedGlobal),e.cancel())}},this),this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(e,t){var n=this.getContext(t),r=CKEDITOR.plugins.indentList.firstItemInPath(this.context,t,n);return!n||!this.isIndent||r?s:o}:function(e,t){return!this.getContext(t)||this.isIndent?s:o},exec:CKEDITOR.tools.bind(e,this)}}var r=CKEDITOR.plugins.indent;r.registerCommands(t,{indentlist:new n(t,"indentlist",!0),outdentlist:new n(t,"outdentlist")}),CKEDITOR.tools.extend(n.prototype,r.specificDefinition.prototype,{context:{ol:1,ul:1}})}}),CKEDITOR.plugins.indentList={},CKEDITOR.plugins.indentList.firstItemInPath=function(e,n,r){var i=n.contains(t);return r||(r=n.contains(e)),r&&i&&i.equals(r.getFirst(t))}}(),function(){function e(e,t,n){function r(n){(f=a[n?"getFirst":"getLast"]())&&(!f.is||!f.isBlockBoundary())&&(l=t.root[n?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))&&(!l.is||!l.isBlockBoundary({br:1}))&&e.document.createElement("br")[n?"insertBefore":"insertAfter"](f)}for(var i=CKEDITOR.plugins.list.listToArray(t.root,n),s=[],o=0;o<t.contents.length;o++){var u=t.contents[o];(u=u.getAscendant("li",!0))&&!u.getCustomData("list_item_processed")&&(s.push(u),CKEDITOR.dom.element.setMarker(n,u,"list_item_processed",!0))}u=null;for(o=0;o<s.length;o++)u=s[o].getCustomData("listarray_index"),i[u].indent=-1;for(o=u+1;o<i.length;o++)if(i[o].indent>i[o-1].indent+1){s=i[o-1].indent+1-i[o].indent;for(u=i[o].indent;i[o]&&i[o].indent>=u;)i[o].indent=i[o].indent+s,o++;o--}var a=CKEDITOR.plugins.list.arrayToList(i,n,null,e.config.enterMode,t.root.getAttribute("dir")).listNode,f,l;r(!0),r(),a.replace(t.root),e.fire("contentDomInvalidated")}function t(e,t){this.name=e,this.context=this.type=t,this.allowedContent=t+" li",this.requiredContent=t}function n(e,t,n,r){for(var i,s;i=e[r?"getLast":"getFirst"](p);)(s=i.getDirection(1))!==t.getDirection(1)&&i.setAttribute("dir",s),i.remove(),n?i[r?"insertBefore":"insertAfter"](n):t.append(i,r)}function r(e){function t(t){var r=e[t?"getPrevious":"getNext"](l);r&&r.type==CKEDITOR.NODE_ELEMENT&&r.is(e.getName())&&(n(e,r,null,!t),e.remove(),e=r)}t(),t(1)}function i(e){return e.type==CKEDITOR.NODE_ELEMENT&&(e.getName()in CKEDITOR.dtd.$block||e.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[e.getName()]["#"]}function s(e,t,i){e.fire("saveSnapshot"),i.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var s=i.extractContents();t.trim(!1,!0);var u=t.createBookmark(),a=new CKEDITOR.dom.elementPath(t.startContainer),f=a.block,a=a.lastElement.getAscendant("li",1)||f,h=new CKEDITOR.dom.elementPath(i.startContainer),p=h.contains(CKEDITOR.dtd.$listItem),h=h.contains(CKEDITOR.dtd.$list);f?(f=f.getBogus())&&f.remove():h&&(f=h.getPrevious(l))&&c(f)&&f.remove(),(f=s.getLast())&&f.type==CKEDITOR.NODE_ELEMENT&&f.is("br")&&f.remove(),(f=t.startContainer.getChild(t.startOffset))?s.insertBefore(f):t.startContainer.append(s),p&&(s=o(p))&&(a.contains(p)?(n(s,p.getParent(),p),s.remove()):a.append(s));for(;i.checkStartOfBlock()&&i.checkEndOfBlock();){h=i.startPath(),s=h.block;if(!s)break;s.is("li")&&(a=s.getParent(),s.equals(a.getLast(l))&&s.equals(a.getFirst(l))&&(s=a)),i.moveToPosition(s,CKEDITOR.POSITION_BEFORE_START),s.remove()}i=i.clone(),s=e.editable(),i.setEndAt(s,CKEDITOR.POSITION_BEFORE_END),i=new CKEDITOR.dom.walker(i),i.evaluator=function(e){return l(e)&&!c(e)},(i=i.next())&&i.type==CKEDITOR.NODE_ELEMENT&&i.getName()in CKEDITOR.dtd.$list&&r(i),t.moveToBookmark(u),t.select(),e.fire("saveSnapshot")}function o(e){return(e=e.getLast(l))&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in u?e:null}var u={ol:1,ul:1},a=CKEDITOR.dom.walker.whitespaces(),f=CKEDITOR.dom.walker.bookmark(),l=function(e){return!a(e)&&!f(e)},c=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(e,t,n,r,i){if(!u[e.getName()])return[];r||(r=0),n||(n=[]);for(var s=0,o=e.getChildCount();s<o;s++){var a=e.getChild(s);a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(a,t,n,r+1);if(a.$.nodeName.toLowerCase()=="li"){var f={parent:e,indent:r,element:a,contents:[]};i?f.grandparent=i:(f.grandparent=e.getParent(),f.grandparent&&f.grandparent.$.nodeName.toLowerCase()=="li"&&(f.grandparent=f.grandparent.getParent())),t&&CKEDITOR.dom.element.setMarker(t,a,"listarray_index",n.length),n.push(f);for(var l=0,c=a.getChildCount(),h;l<c;l++)h=a.getChild(l),h.type==CKEDITOR.NODE_ELEMENT&&u[h.getName()]?CKEDITOR.plugins.list.listToArray(h,t,n,r+1,f.grandparent):f.contents.push(h)}}return n},arrayToList:function(e,t,n,r,i){n||(n=0);if(!e||e.length<n+1)return null;for(var s,o=e[n].parent.getDocument(),a=new CKEDITOR.dom.documentFragment(o),c=null,h=n,p=Math.max(e[n].indent,0),d=null,v,m,g=r==CKEDITOR.ENTER_P?"p":"div";;){var y=e[h];s=y.grandparent,v=y.element.getDirection(1);if(y.indent==p){if(!c||e[h].parent.getName()!=c.getName())c=e[h].parent.clone(!1,1),i&&c.setAttribute("dir",i),a.append(c);d=c.append(y.element.clone(0,1)),v!=c.getDirection(1)&&d.setAttribute("dir",v);for(s=0;s<y.contents.length;s++)d.append(y.contents[s].clone(1,1));h++}else if(y.indent==Math.max(p,0)+1)y=e[h-1].element.getDirection(1),h=CKEDITOR.plugins.list.arrayToList(e,null,h,r,y!=v?v:null),!d.getChildCount()&&CKEDITOR.env.needsNbspFiller&&o.$.documentMode<=7&&d.append(o.createText(" ")),d.append(h.listNode),h=h.nextIndex;else{if(y.indent!=-1||!!n||!s)return null;u[s.getName()]?(d=y.element.clone(!1,!0),v!=s.getDirection(1)&&d.setAttribute("dir",v)):d=new CKEDITOR.dom.documentFragment(o);var c=s.getDirection(1)!=v,b=y.element,w=b.getAttribute("class"),E=b.getAttribute("style"),S=d.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(r!=CKEDITOR.ENTER_BR||c||E||w),x,T=y.contents.length,N;for(s=0;s<T;s++){x=y.contents[s];if(f(x)&&T>1)S?N=x.clone(1,1):d.append(x.clone(1,1));else if(x.type==CKEDITOR.NODE_ELEMENT&&x.isBlockBoundary()){c&&!x.getDirection()&&x.setAttribute("dir",v),m=x;var C=b.getAttribute("style");C&&m.setAttribute("style",C.replace(/([^;])$/,"$1;")+(m.getAttribute("style")||"")),w&&x.addClass(w),m=null,N&&(d.append(N),N=null),d.append(x.clone(1,1))}else S?(m||(m=o.createElement(g),d.append(m),c&&m.setAttribute("dir",v)),E&&m.setAttribute("style",E),w&&m.setAttribute("class",w),N&&(m.append(N),N=null),m.append(x.clone(1,1))):d.append(x.clone(1,1))}N&&((m||d).append(N),N=null),d.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&h!=e.length-1&&(CKEDITOR.env.needsBrFiller&&(v=d.getLast())&&v.type==CKEDITOR.NODE_ELEMENT&&v.is("br")&&v.remove(),v=d.getLast(l),(!v||v.type!=CKEDITOR.NODE_ELEMENT||!v.is(CKEDITOR.dtd.$block))&&d.append(o.createElement("br"))),v=d.$.nodeName.toLowerCase(),(v=="div"||v=="p")&&d.appendBogus(),a.append(d),c=null,h++}m=null;if(e.length<=h||Math.max(e[h].indent,0)<p)break}if(t)for(e=a.getFirst();e;){if(e.type==CKEDITOR.NODE_ELEMENT){CKEDITOR.dom.element.clearMarkers(t,e);if(e.getName()in CKEDITOR.dtd.$listItem){n=e,o=i=r=void 0;if(r=n.getDirection()){for(i=n.getParent();i&&!(o=i.getDirection());)i=i.getParent();r==o&&n.removeAttribute("dir")}}}e=e.getNextSourceNode()}return{listNode:a,nextIndex:h}}};var h=/^h[1-6]$/,p=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);t.prototype={exec:function(t){this.refresh(t,t.elementPath());var n=t.config,i=t.getSelection(),s=i&&i.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var o=t.editable();if(o.getFirst(l)){var a=s.length==1&&s[0];(n=a&&a.getEnclosedNode())&&n.is&&this.type==n.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else n.enterMode==CKEDITOR.ENTER_BR?o.appendBogus():s[0].fixBlock(1,n.enterMode==CKEDITOR.ENTER_P?"p":"div"),i.selectRanges(s)}for(var n=i.createBookmarks(!0),o=[],f={},s=s.createIterator(),c=0;(a=s.getNextRange())&&++c;){var p=a.getBoundaryNodes(),d=p.startNode,v=p.endNode;d.type==CKEDITOR.NODE_ELEMENT&&d.getName()=="td"&&a.setStartAt(p.startNode,CKEDITOR.POSITION_AFTER_START),v.type==CKEDITOR.NODE_ELEMENT&&v.getName()=="td"&&a.setEndAt(p.endNode,CKEDITOR.POSITION_BEFORE_END),a=a.createIterator();for(a.forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;p=a.getNextParagraph();)if(!p.getCustomData("list_block")){CKEDITOR.dom.element.setMarker(f,p,"list_block",1);for(var m=t.elementPath(p),d=m.elements,v=0,m=m.blockLimit,y,b=d.length-1;b>=0&&(y=d[b]);b--)if(u[y.getName()]&&m.contains(y)){m.removeCustomData("list_group_object_"+c),(d=y.getCustomData("list_group_object"))?d.contents.push(p):(d={root:y,contents:[p]},o.push(d),CKEDITOR.dom.element.setMarker(f,y,"list_group_object",d)),v=1;break}v||(v=m,v.getCustomData("list_group_object_"+c)?v.getCustomData("list_group_object_"+c).contents.push(p):(d={root:v,contents:[p]},CKEDITOR.dom.element.setMarker(f,v,"list_group_object_"+c,d),o.push(d)))}}for(y=[];o.length>0;){d=o.shift();if(this.state==CKEDITOR.TRISTATE_OFF)if(u[d.root.getName()]){s=t,c=d,d=f,a=y,v=CKEDITOR.plugins.list.listToArray(c.root,d),m=[];for(p=0;p<c.contents.length;p++)b=c.contents[p],(b=b.getAscendant("li",!0))&&!b.getCustomData("list_item_processed")&&(m.push(b),CKEDITOR.dom.element.setMarker(d,b,"list_item_processed",!0));for(var b=c.root.getDocument(),w=void 0,E=void 0,p=0;p<m.length;p++){var S=m[p].getCustomData("listarray_index"),w=v[S].parent;w.is(this.type)||(E=b.createElement(this.type),w.copyAttributes(E,{start:1,type:1}),E.removeStyle("list-style-type"),v[S].parent=E)}d=CKEDITOR.plugins.list.arrayToList(v,d,null,s.config.enterMode),v=void 0,m=d.listNode.getChildCount();for(p=0;p<m&&(v=d.listNode.getChild(p));p++)v.getName()==this.type&&a.push(v);d.listNode.replace(c.root),s.fire("contentDomInvalidated")}else{v=t,p=d,a=y,m=p.contents,s=p.root.getDocument(),c=[],m.length==1&&m[0].equals(p.root)&&(d=s.createElement("div"),m[0].moveChildren&&m[0].moveChildren(d),m[0].append(d),m[0]=d),p=p.contents[0].getParent();for(b=0;b<m.length;b++)p=p.getCommonAncestor(m[b].getParent());w=v.config.useComputedState,v=d=void 0,w=w===void 0||w;for(b=0;b<m.length;b++)for(E=m[b];S=E.getParent();){if(S.equals(p)){c.push(E),!v&&E.getDirection()&&(v=1),E=E.getDirection(w),d!==null&&(d=d&&d!=E?null:E);break}E=S}if(!(c.length<1)){m=c[c.length-1].getNext(),b=s.createElement(this.type),a.push(b);for(w=a=void 0;c.length;)a=c.shift(),w=s.createElement("li"),a.is("pre")||h.test(a.getName())||a.getAttribute("contenteditable")=="false"?a.appendTo(w):(a.copyAttributes(w),d&&a.getDirection()&&(w.removeStyle("direction"),w.removeAttribute("dir")),a.moveChildren(w),a.remove()),w.appendTo(b);d&&v&&b.setAttribute("dir",d),m?b.insertBefore(m):b.appendTo(p)}}else this.state==CKEDITOR.TRISTATE_ON&&u[d.root.getName()]&&e.call(this,t,d,f)}for(b=0;b<y.length;b++)r(y[b]);CKEDITOR.dom.element.clearAllMarkers(f),i.selectBookmarks(n),t.focus()},refresh:function(e,t){var n=t.contains(u,1),r=t.blockLimit||t.root;n&&r.contains(n)?this.setState(n.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(e){e.blockless||(e.addCommand("numberedlist",new t("numberedlist","ol")),e.addCommand("bulletedlist",new t("bulletedlist","ul")),e.ui.addButton&&(e.ui.addButton("NumberedList",{label:e.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),e.ui.addButton("BulletedList",{label:e.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),e.on("key",function(t){var n=t.data.domEvent.getKey(),r;if(e.mode=="wysiwyg"&&n in{8:1,46:1}){var a=e.getSelection().getRanges()[0],f=a&&a.startPath();if(a&&a.collapsed){var h=n==8,p=e.editable(),v=new CKEDITOR.dom.walker(a.clone());v.evaluator=function(e){return l(e)&&!c(e)},v.guard=function(e,t){return!t||e.type!=CKEDITOR.NODE_ELEMENT||!e.is("table")},n=a.clone();if(h){var m;(m=f.contains(u))&&a.checkBoundaryOfElement(m,CKEDITOR.START)&&(m=m.getParent())&&m.is("li")&&(m=o(m))?(r=m,m=m.getPrevious(l),n.moveToPosition(m&&c(m)?m:r,CKEDITOR.POSITION_BEFORE_START)):(v.range.setStartAt(p,CKEDITOR.POSITION_AFTER_START),v.range.setEnd(a.startContainer,a.startOffset),(m=v.previous())&&m.type==CKEDITOR.NODE_ELEMENT&&(m.getName()in u||m.is("li"))&&(m.is("li")||(v.range.selectNodeContents(m),v.reset(),v.evaluator=i,m=v.previous()),r=m,n.moveToElementEditEnd(r))),r?(s(e,n,a),t.cancel()):(n=f.contains(u))&&a.checkBoundaryOfElement(n,CKEDITOR.START)&&(r=n.getFirst(l),a.checkBoundaryOfElement(r,CKEDITOR.START)&&(m=n.getPrevious(l),o(r)?m&&(a.moveToElementEditEnd(m),a.select()):e.execCommand("outdent"),t.cancel()))}else(r=f.contains("li"))?(v.range.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),r=(f=r.getLast(l))&&i(f)?f:r,p=0,(m=v.next())&&m.type==CKEDITOR.NODE_ELEMENT&&m.getName()in u&&m.equals(f)?(p=1,m=v.next()):a.checkBoundaryOfElement(r,CKEDITOR.END)&&(p=1),p&&m&&(a=a.clone(),a.moveToElementEditStart(m),s(e,n,a),t.cancel())):(v.range.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),(m=v.next())&&m.type==CKEDITOR.NODE_ELEMENT&&m.is(u)&&(m=m.getFirst(l),f.block&&a.checkStartOfBlock()&&a.checkEndOfBlock()?(f.block.remove(),a.moveToElementEditStart(m),a.select()):o(m)?(a.moveToElementEditStart(m),a.select()):(a=a.clone(),a.moveToElementEditStart(m),s(e,n,a)),t.cancel()));setTimeout(function(){e.selectionChange(1)})}}}))}})}(),function(){function e(e,t,n){n=e.config.forceEnterMode||n,e.mode=="wysiwyg"&&(t||(t=e.activeEnterMode),e.elementPath().isContextFor("p")||(t=CKEDITOR.ENTER_BR,n=1),e.fire("saveSnapshot"),t==CKEDITOR.ENTER_BR?o(e,t,null,n):u(e,t,null,n),e.fire("saveSnapshot"))}function t(e){for(var e=e.getSelection().getRanges(!0),t=e.length-1;t>0;t--)e[t].deleteContents();return e[0]}function n(e){var t=e.startContainer.getAscendant(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.getAttribute("contenteditable")=="true"},!0);return e.root.equals(t)?e:(t=new CKEDITOR.dom.range(t),t.moveToRange(e),t)}CKEDITOR.plugins.add("enterkey",{init:function(t){t.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(t){e(t)}}),t.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(t){e(t,t.activeShiftEnterMode,1)}}),t.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var r=CKEDITOR.dom.walker.whitespaces(),i=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(e,s,u,f){if(u=u||t(e)){var u=n(u),l=u.document,p=u.checkStartOfBlock(),d=u.checkEndOfBlock(),v=e.elementPath(u.startContainer),m=v.block,y=s==CKEDITOR.ENTER_DIV?"div":"p",w;if(p&&d){if(m&&(m.is("li")||m.getParent().is("li"))){m.is("li")||(m=m.getParent()),u=m.getParent(),w=u.getParent();var f=!m.hasPrevious(),E=!m.hasNext(),y=e.getSelection(),S=y.createBookmarks(),p=m.getDirection(1),d=m.getAttribute("class"),x=m.getAttribute("style"),T=w.getDirection(1)!=p,e=e.enterMode!=CKEDITOR.ENTER_BR||T||x||d;if(w.is("li"))f||E?m[f?"insertBefore":"insertAfter"](w):m.breakParent(w);else{if(e)v.block.is("li")?(w=l.createElement(s==CKEDITOR.ENTER_P?"p":"div"),T&&w.setAttribute("dir",p),x&&w.setAttribute("style",x),d&&w.setAttribute("class",d),m.moveChildren(w)):w=v.block,f||E?w[f?"insertBefore":"insertAfter"](u):(m.breakParent(u),w.insertAfter(u));else{m.appendBogus(!0);if(f||E)for(;l=m[f?"getFirst":"getLast"]();)l[f?"insertBefore":"insertAfter"](u);else for(m.breakParent(u);l=m.getLast();)l.insertAfter(u)}m.remove()}y.selectBookmarks(S);return}if(m&&m.getParent().is("blockquote")){m.breakParent(m.getParent()),m.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||m.getPrevious().remove(),m.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||m.getNext().remove(),u.moveToElementEditStart(m),u.select();return}}else if(m&&m.is("pre")&&!d){o(e,s,u,f);return}if(p=u.splitBlock(y)){s=p.previousBlock,m=p.nextBlock,v=p.wasStartOfBlock,e=p.wasEndOfBlock,m?(S=m.getParent(),S.is("li")&&(m.breakParent(S),m.move(m.getNext(),1))):s&&(S=s.getParent())&&S.is("li")&&(s.breakParent(S),S=s.getNext(),u.moveToElementEditStart(S),s.move(s.getPrevious()));if(!v&&!e)m.is("li")&&(w=u.clone(),w.selectNodeContents(m),w=new CKEDITOR.dom.walker(w),w.evaluator=function(e){return!(i(e)||r(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$inline&&!(e.getName()in CKEDITOR.dtd.$empty))},(S=w.next())&&S.type==CKEDITOR.NODE_ELEMENT&&S.is("ul","ol")&&(CKEDITOR.env.needsBrFiller?l.createElement("br"):l.createText(" ")).insertBefore(S)),m&&u.moveToElementEditStart(m);else{if(s){if(s.is("li")||!a.test(s.getName())&&!s.is("pre"))w=s.clone()}else m&&(w=m.clone());w?f&&!w.is("li")&&w.renameNode(y):S&&S.is("li")?w=S:(w=l.createElement(y),s&&(E=s.getDirection())&&w.setAttribute("dir",E));if(l=p.elementPath){f=0;for(y=l.elements.length;f<y;f++){S=l.elements[f];if(S.equals(l.block)||S.equals(l.blockLimit))break;CKEDITOR.dtd.$removeEmpty[S.getName()]&&(S=S.clone(),w.moveChildren(S),w.append(S))}}w.appendBogus(),w.getParent()||u.insertNode(w),w.is("li")&&w.removeAttribute("value"),CKEDITOR.env.ie&&v&&(!e||!s.getChildCount())&&(u.moveToElementEditStart(e?s:w),u.select()),u.moveToElementEditStart(v&&!e?m:w)}u.select(),u.scrollIntoView()}}},enterBr:function(e,n,r,i){if(r=r||t(e)){var s=r.document,o=r.checkEndOfBlock(),l=new CKEDITOR.dom.elementPath(e.getSelection().getStartElement()),c=l.block,p=c&&l.block.getName();!i&&p=="li"?u(e,n,r,i):(!i&&o&&a.test(p)?(o=c.getDirection())?(s=s.createElement("div"),s.setAttribute("dir",o),s.insertAfter(c),r.setStart(s,0)):(s.createElement("br").insertAfter(c),CKEDITOR.env.gecko&&s.createText("").insertAfter(c),r.setStartAt(c.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(e=p=="pre"&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?s.createText("\r"):s.createElement("br"),r.deleteContents(),r.insertNode(e),CKEDITOR.env.needsBrFiller?(s.createText("﻿").insertAfter(e),o&&(c||l.blockLimit).appendBogus(),e.getNext().$.nodeValue="",r.setStartAt(e.getNext(),CKEDITOR.POSITION_AFTER_START)):r.setStartAt(e,CKEDITOR.POSITION_AFTER_END)),r.collapse(!0),r.select(),r.scrollIntoView())}}};var s=CKEDITOR.plugins.enterkey,o=s.enterBr,u=s.enterBlock,a=/^h[1-6]$/}(),function(){function e(e,t){var n={},r=[],i={nbsp:" ",shy:"­",gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},e=e.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(e,s){var o=t?"&"+s+";":i[s];return n[o]=t?i[s]:"&"+s+";",r.push(o),""});if(!t&&e){var e=e.split(","),s=document.createElement("div"),o;s.innerHTML="&"+e.join(";&")+";",o=s.innerHTML,s=null;for(s=0;s<o.length;s++){var u=o.charAt(s);n[u]="&"+e[s]+";",r.push(u)}}return n.regex=r.join(t?"|":""),n}CKEDITOR.plugins.add("entities",{afterInit:function(t){function n(e){return f[e]}function r(e){return i.entities_processNumerical=="force"||!o[e]?"&#"+e.charCodeAt(0)+";":o[e]}var i=t.config;if(t=(t=t.dataProcessor)&&t.htmlFilter){var s=[];i.basicEntities!==!1&&s.push("nbsp,gt,lt,amp"),i.entities&&(s.length&&s.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"),i.entities_latin&&s.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"),i.entities_greek&&s.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"),i.entities_additional&&s.push(i.entities_additional));var o=e(s.join(",")),u=o.regex?"["+o.regex+"]":"a^";delete o.regex,i.entities&&i.entities_processNumerical&&(u="[^ -~]|"+u);var u=RegExp(u,"g"),f=e("nbsp,gt,lt,amp,shy",!0),l=RegExp(f.regex,"g");t.addRules({text:function(e){return e.replace(l,n).replace(u,r)}},{applyToAll:!0,excludeNestedEditable:!0})}}})}(),CKEDITOR.config.basicEntities=!0,CKEDITOR.config.entities=!0,CKEDITOR.config.entities_latin=!0,CKEDITOR.config.entities_greek=!0,CKEDITOR.config.entities_additional="#39",CKEDITOR.plugins.add("popup"),CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{popup:function(e,t,n,r){t=t||"80%",n=n||"70%",typeof t=="string"&&t.length>1&&t.substr(t.length-1,1)=="%"&&(t=parseInt(window.screen.width*parseInt(t,10)/100,10)),typeof n=="string"&&n.length>1&&n.substr(n.length-1,1)=="%"&&(n=parseInt(window.screen.height*parseInt(n,10)/100,10)),t<640&&(t=640),n<420&&(n=420);var i=parseInt((window.screen.height-n)/2,10),s=parseInt((window.screen.width-t)/2,10),r=(r||"location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes")+",width="+t+",height="+n+",top="+i+",left="+s,o=window.open("",null,r,!0);if(!o)return!1;try{navigator.userAgent.toLowerCase().indexOf(" chrome/")==-1&&(o.moveTo(s,i),o.resizeTo(t,n)),o.focus(),o.location.href=e}catch(u){window.open(e,null,r,!0)}return!0}}),function(){function e(e,t){var n=[];if(!t)return e;for(var r in t)n.push(r+"="+encodeURIComponent(t[r]));return e+(e.indexOf("?")!=-1?"&":"?")+n.join("&")}function t(e){return e+="",e.charAt(0).toUpperCase()+e.substr(1)}function n(){var n=this.getDialog(),r=n.getParentEditor();r._.filebrowserSe=this;var i=r.config["filebrowser"+t(n.getName())+"WindowWidth"]||r.config.filebrowserWindowWidth||"80%",n=r.config["filebrowser"+t(n.getName())+"WindowHeight"]||r.config.filebrowserWindowHeight||"70%",s=this.filebrowser.params||{};s.CKEditor=r.name,s.CKEditorFuncNum=r._.filebrowserFn,s.langCode||(s.langCode=r.langCode),s=e(this.filebrowser.url,s),r.popup(s,i,n,r.config.filebrowserWindowFeatures||r.config.fileBrowserWindowFeatures)}function r(){var e=this.getDialog();return e.getParentEditor()._.filebrowserSe=this,!e.getContentElement(this["for"][0],this["for"][1]).getInputElement().$.value||!e.getContentElement(this["for"][0],this["for"][1]).getAction()?!1:!0}function i(t,n,r){var i=r.params||{};i.CKEditor=t.name,i.CKEditorFuncNum=t._.filebrowserFn,i.langCode||(i.langCode=t.langCode),n.action=e(r.url,i),n.filebrowser=r}function s(e,o,u,a){if(a&&a.length)for(var f,l=a.length;l--;){f=a[l],(f.type=="hbox"||f.type=="vbox"||f.type=="fieldset")&&s(e,o,u,f.children);if(f.filebrowser){typeof f.filebrowser=="string"&&(f.filebrowser={action:f.type=="fileButton"?"QuickUpload":"Browse",target:f.filebrowser});if(f.filebrowser.action=="Browse"){var h=f.filebrowser.url;h===void 0&&(h=e.config["filebrowser"+t(o)+"BrowseUrl"],h===void 0&&(h=e.config.filebrowserBrowseUrl)),h&&(f.onClick=n,f.filebrowser.url=h,f.hidden=!1)}else if(f.filebrowser.action=="QuickUpload"&&f["for"]){h=f.filebrowser.url,h===void 0&&(h=e.config["filebrowser"+t(o)+"UploadUrl"],h===void 0&&(h=e.config.filebrowserUploadUrl));if(h){var p=f.onClick;f.onClick=function(e){var t=e.sender;return p&&p.call(t,e)===!1?!1:r.call(t,e)},f.filebrowser.url=h,f.hidden=!1,i(e,u.getContents(f["for"][0]).get(f["for"][1]),f.filebrowser)}}}}}function o(e,t,n){if(n.indexOf(";")!==-1){for(var n=n.split(";"),r=0;r<n.length;r++)if(o(e,t,n[r]))return!0;return!1}return(e=e.getContents(t).get(n).filebrowser)&&e.url}function u(e,t){var n=this._.filebrowserSe.getDialog(),r=this._.filebrowserSe["for"],i=this._.filebrowserSe.filebrowser.onSelect;r&&n.getContentElement(r[0],r[1]).reset();if((typeof t!="function"||t.call(this._.filebrowserSe)!==!1)&&(!i||i.call(this._.filebrowserSe,e,t)!==!1)){typeof t=="string"&&t&&alert(t);if(e){r=this._.filebrowserSe,n=r.getDialog();if(r=r.filebrowser.target||null){r=r.split(":");if(i=n.getContentElement(r[0],r[1]))i.setValue(e),n.selectPage(r[0])}}}}CKEDITOR.plugins.add("filebrowser",{requires:"popup",init:function(e){e._.filebrowserFn=CKEDITOR.tools.addFunction(u,e),e.on("destroy",function(){CKEDITOR.tools.removeFunction(this._.filebrowserFn)})}}),CKEDITOR.on("dialogDefinition",function(e){if(e.editor.plugins.filebrowser)for(var t=e.data.definition,n,r=0;r<t.contents.length;++r)if(n=t.contents[r])s(e.editor,e.data.name,t,n.elements),n.hidden&&n.filebrowser&&(n.hidden=!o(t,n.id,n.filebrowser))})}(),function(){function e(e){var r=e.config,i=e.fire("uiSpace",{space:"top",html:""}).html,s=function(){function i(e,t,r){u.setStyle(t,n(r)),u.setStyle("position",e)}function o(e){var t=f.getDocumentPosition();switch(e){case"top":i("absolute","top",t.y-v-y);break;case"pin":i("fixed","top",E);break;case"bottom":i("absolute","top",t.y+(p.height||p.bottom-p.top)+y)}a=e}var a,f,l,p,d,v,m,g=r.floatSpaceDockedOffsetX||0,y=r.floatSpaceDockedOffsetY||0,w=r.floatSpacePinnedOffsetX||0,E=r.floatSpacePinnedOffsetY||0;return function(r){if(f=e.editable()){r&&r.name=="focus"&&u.show(),u.removeStyle("left"),u.removeStyle("right"),l=u.getClientRect(),p=f.getClientRect(),d=t.getViewPaneSize(),v=l.height,m="pageXOffset"in t.$?t.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft;if(a){v+y<=p.top?o("top"):v+y>d.height-p.bottom?o("pin"):o("bottom");var r=d.width/2,r=p.left>0&&p.right<d.width&&p.width>l.width?e.config.contentsLangDirection=="rtl"?"right":"left":r-p.left>p.right-r?"left":"right",i;l.width>d.width?(r="left",i=0):(i=r=="left"?p.left>0?p.left:0:p.right<d.width?d.width-p.right:0,i+l.width>d.width&&(r=r=="left"?"right":"left",i=0)),u.setStyle(r,n((a=="pin"?w:g)+i+(a=="pin"?0:r=="left"?m:-m)))}else a="pin",o("pin"),s(r)}}}();if(i){var o=new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}"'+(e.title?' aria-labelledby="cke_{name}_arialbl"':" ")+">"+(e.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':" ")+'<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),u=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(o.output({content:i,id:e.id,langDir:e.lang.dir,langCode:e.langCode,name:e.name,style:"display:none;z-index:"+(r.baseFloatZIndex-1),topId:e.ui.spaceId("top"),voiceLabel:e.title}))),a=CKEDITOR.tools.eventsBuffer(500,s),f=CKEDITOR.tools.eventsBuffer(100,s);u.unselectable(),u.on("mousedown",function(e){e=e.data,e.getTarget().hasAscendant("a",1)||e.preventDefault()}),e.on("focus",function(n){s(n),e.on("change",a.input),t.on("scroll",f.input),t.on("resize",f.input)}),e.on("blur",function(){u.hide(),e.removeListener("change",a.input),t.removeListener("scroll",f.input),t.removeListener("resize",f.input)}),e.on("destroy",function(){t.removeListener("scroll",f.input),t.removeListener("resize",f.input),u.clearCustomData(),u.remove()}),e.focusManager.hasFocus&&u.show(),e.focusManager.add(u,1)}}var t=CKEDITOR.document.getWindow(),n=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(t){t.on("loaded",function(){e(this)},null,null,20)}})}(),CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var e=CKEDITOR.addTemplate("panel-list",'<ul role="presentation" class="cke_panel_list">{items}</ul>'),t=CKEDITOR.addTemplate("panel-list-item",'<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')"  {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),n=CKEDITOR.addTemplate("panel-list-group",'<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),r=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(e,t){return this.addBlock(e,new CKEDITOR.ui.listBlock(this.getHolderElement(),t))},CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(e,t){var t=t||{},n=t.attributes||(t.attributes={});(this.multiSelect=!!t.multiSelect)&&(n["aria-multiselectable"]=!0),!n.role&&(n.role="listbox"),this.base.apply(this,arguments),this.element.setAttribute("role",n.role),n=this.keys,n[40]="next",n[9]="next",n[38]="prev",n[CKEDITOR.SHIFT+9]="prev",n[32]=CKEDITOR.env.ie?"mouseup":"click",CKEDITOR.env.ie&&(n[13]="mouseup"),this._.pendingHtml=[],this._.pendingList=[],this._.items={},this._.groups={}},_:{close:function(){if(this._.started){var t=e.output({items:this._.pendingList.join("")});this._.pendingList=[],this._.pendingHtml.push(t),delete this._.started}},getClick:function(){return this._.click||(this._.click=CKEDITOR.tools.addFunction(function(e){var t=this.toggle(e);this.onClick&&this.onClick(e,t)},this)),this._.click}},proto:{add:function(e,n,i){var s=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0),this._.items[e]=s;var o;o=CKEDITOR.tools.htmlEncodeAttr(e).replace(r,"\\'"),e={id:s,val:o,onclick:CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(i||e),text:n||e},this._.pendingList.push(t.output(e))},startGroup:function(e){this._.close();var t=CKEDITOR.tools.getNextId();this._.groups[e]=t,this._.pendingHtml.push(n.output({id:t,label:e}))},commit:function(){this._.close(),this.element.appendHtml(this._.pendingHtml.join("")),delete this._.size,this._.pendingHtml=[]},toggle:function(e){var t=this.isMarked(e);return t?this.unmark(e):this.mark(e),!t},hideGroup:function(e){var t=(e=this.element.getDocument().getById(this._.groups[e]))&&e.getNext();e&&(e.setStyle("display","none"),t&&t.getName()=="ul"&&t.setStyle("display","none"))},hideItem:function(e){this.element.getDocument().getById(this._.items[e]).setStyle("display","none")},showAll:function(){var e=this._.items,t=this._.groups,n=this.element.getDocument(),r;for(r in e)n.getById(e[r]).setStyle("display","");for(var i in t)e=n.getById(t[i]),r=e.getNext(),e.setStyle("display",""),r&&r.getName()=="ul"&&r.setStyle("display","")},mark:function(e){this.multiSelect||this.unmarkAll();var e=this._.items[e],t=this.element.getDocument().getById(e);t.addClass("cke_selected"),this.element.getDocument().getById(e+"_option").setAttribute("aria-selected",!0),this.onMark&&this.onMark(t)},unmark:function(e){var t=this.element.getDocument(),e=this._.items[e],n=t.getById(e);n.removeClass("cke_selected"),t.getById(e+"_option").removeAttribute("aria-selected"),this.onUnmark&&this.onUnmark(n)},unmarkAll:function(){var e=this._.items,t=this.element.getDocument(),n;for(n in e){var r=e[n];t.getById(r).removeClass("cke_selected"),t.getById(r+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(e){return this.element.getDocument().getById(this._.items[e]).hasClass("cke_selected")},focus:function(e){this._.focusIndex=-1;var t=this.element.getElementsByTag("a"),n,r=-1;if(e){for(n=this.element.getDocument().getById(this._.items[e]).getFirst();e=t.getItem(++r);)if(e.equals(n)){this._.focusIndex=r;break}}else this.element.focus();n&&setTimeout(function(){n.focus()},0)}}})}}),function(){var e='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;"');var e=e+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),e=e+'>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',t=CKEDITOR.addTemplate("buttonArrow",'<span class="cke_button_arrow">'+(CKEDITOR.env.hc?"&#9660;":"")+"</span>"),n=CKEDITOR.addTemplate("button",e);CKEDITOR.plugins.add("button",{beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}}),CKEDITOR.UI_BUTTON="button",CKEDITOR.ui.button=function(e){CKEDITOR.tools.extend(this,e,{title:e.label,click:e.click||function(t){t.execCommand(e.command)}}),this._={}},CKEDITOR.ui.button.handler={create:function(e){return new CKEDITOR.ui.button(e)}},CKEDITOR.ui.button.prototype={render:function(e,r){function i(){var t=e.mode;t&&(t=this.modes[t]?d[t]!==void 0?d[t]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,t=e.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:t,this.setState(t),this.refresh&&this.refresh())}var s=CKEDITOR.env,o=this._.id=CKEDITOR.tools.getNextId(),u="",a=this.command,f;this._.editor=e;var l={id:o,button:this,editor:e,focus:function(){CKEDITOR.document.getById(o).focus()},execute:function(){this.button.click(e)},attach:function(e){this.button.attach(e)}},c=CKEDITOR.tools.addFunction(function(e){if(l.onkey)return e=new CKEDITOR.dom.event(e),l.onkey(l,e.getKeystroke())!==!1}),h=CKEDITOR.tools.addFunction(function(e){var t;return l.onfocus&&(t=l.onfocus(l,new CKEDITOR.dom.event(e))!==!1),t}),p=0;l.clickFn=f=CKEDITOR.tools.addFunction(function(){p&&(e.unlockSelection(1),p=0),l.execute(),s.iOS&&e.focus()});if(this.modes){var d={};e.on("beforeModeUnload",function(){e.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(d[e.mode]=this._.state)},this),e.on("activeFilterChange",i,this),e.on("mode",i,this),!this.readOnly&&e.on("readOnly",i,this)}else a&&(a=e.getCommand(a))&&(a.on("state",function(){this.setState(a.state)},this),u+=a.state==CKEDITOR.TRISTATE_ON?"on":a.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");this.directional&&e.on("contentDirChanged",function(t){var n=CKEDITOR.document.getById(this._.id),r=n.getFirst(),t=t.data;t!=e.lang.dir?n.addClass("cke_"+t):n.removeClass("cke_ltr").removeClass("cke_rtl"),r.setAttribute("style",CKEDITOR.skin.getIconStyle(m,t=="rtl",this.icon,this.iconOffset))},this),a||(u+="off");var v=this.name||this.command,m=v;return this.icon&&!/\./.test(this.icon)&&(m=this.icon,this.icon=null),u={id:o,name:v,iconName:m,label:this.label,cls:this.className||"",state:u,ariaDisabled:u=="disabled"?"true":"false",title:this.title,titleJs:s.gecko&&!s.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:c,focusFn:h,clickFn:f,style:CKEDITOR.skin.getIconStyle(m,e.lang.dir=="rtl",this.icon,this.iconOffset),arrowHtml:this.hasArrow?t.output():""},n.output(u,r),this.onRender&&this.onRender(),l},setState:function(e){if(this._.state==e)return!1;this._.state=e;var t=CKEDITOR.document.getById(this._.id);return t?(t.setState(e,"cke_button"),e==CKEDITOR.TRISTATE_DISABLED?t.setAttribute("aria-disabled",!0):t.removeAttribute("aria-disabled"),this.hasArrow?(e=e==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(e)):e==CKEDITOR.TRISTATE_ON?t.setAttribute("aria-pressed",!0):t.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(e){if(this._.feature)return this._.feature;var t=this;return!this.allowedContent&&!this.requiredContent&&this.command&&(t=e.getCommand(this.command)||t),this._.feature=t}},CKEDITOR.ui.prototype.addButton=function(e,t){this.add(e,CKEDITOR.UI_BUTTON,t)}}(),CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}),function(){var e='<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" title="{title}" tabindex="-1"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;"');var e=e+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">'+(CKEDITOR.env.hc?"&#9660;":CKEDITOR.env.air?"&nbsp;":"")+"</span></span></a></span>"),t=CKEDITOR.addTemplate("combo",e);CKEDITOR.UI_RICHCOMBO="richcombo",CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(e){CKEDITOR.tools.extend(this,e,{canGroup:!1,title:e.label,modes:{wysiwyg:1},editorFocus:1}),e=this.panel||{},delete this.panel,this.id=CKEDITOR.tools.getNextNumber(),this.document=e.parent&&e.parent.getDocument()||CKEDITOR.document,e.className="cke_combopanel",e.block={multiSelect:e.multiSelect,attributes:e.attributes},e.toolbarRelated=!0,this._={panelDefinition:e,items:{}}},proto:{renderHtml:function(e){var t=[];return this.render(e,t),t.join("")},render:function(e,n){function r(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var t=this.modes[e.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;e.readOnly&&!this.readOnly&&(t=CKEDITOR.TRISTATE_DISABLED),this.setState(t),this.setValue(""),t!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var i=CKEDITOR.env,s="cke_"+this.id,o=CKEDITOR.tools.addFunction(function(t){c&&(e.unlockSelection(1),c=0),a.execute(t)},this),u=this,a={id:s,combo:this,focus:function(){CKEDITOR.document.getById(s).getChild(1).focus()},execute:function(t){var n=u._;if(n.state!=CKEDITOR.TRISTATE_DISABLED){u.createPanel(e);if(n.on)n.panel.hide();else{u.commit();var r=u.getValue();r?n.list.mark(r):n.list.unmarkAll(),n.panel.showBlock(u.id,new CKEDITOR.dom.element(t),4)}}},clickFn:o};e.on("activeFilterChange",r,this),e.on("mode",r,this),e.on("selectionChange",r,this),!this.readOnly&&e.on("readOnly",r,this);var f=CKEDITOR.tools.addFunction(function(t,n){var t=new CKEDITOR.dom.event(t),r=t.getKeystroke();r==40&&e.once("panelShow",function(e){e.data._.panel._.currentBlock.onKeyDown(40)});switch(r){case 13:case 32:case 40:CKEDITOR.tools.callFunction(o,n);break;default:a.onkey(a,r)}t.preventDefault()}),l=CKEDITOR.tools.addFunction(function(){a.onfocus&&a.onfocus()}),c=0;return a.keyDownFn=f,i={id:s,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:i.gecko&&!i.hc?"":(this.title||"").replace("'",""),keydownFn:f,focusFn:l,clickFn:o},t.output(i,n),this.onRender&&this.onRender(),a},createPanel:function(e){if(!this._.panel){var t=this._.panelDefinition,n=this._.panelDefinition.block,r=t.parent||CKEDITOR.document.getBody(),i="cke_combopanel__"+this.name,s=new CKEDITOR.ui.floatPanel(e,r,t),o=s.addListBlock(this.id,n),u=this;s.onShow=function(){this.element.addClass(i),u.setState(CKEDITOR.TRISTATE_ON),u._.on=1,u.editorFocus&&!e.focusManager.hasFocus&&e.focus(),u.onOpen&&u.onOpen(),e.once("panelShow",function(){o.focus(!o.multiSelect&&u.getValue())})},s.onHide=function(t){this.element.removeClass(i),u.setState(u.modes&&u.modes[e.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),u._.on=0,!t&&u.onClose&&u.onClose()},s.onEscape=function(){s.hide(1)},o.onClick=function(e,t){u.onClick&&u.onClick.call(u,e,t),s.hide()},this._.panel=s,this._.list=o,s.getBlock(this.id).onHide=function(){u._.on=0,u.setState(CKEDITOR.TRISTATE_OFF)},this.init&&this.init()}},setValue:function(e,t){this._.value=e;var n=this.document.getById("cke_"+this.id+"_text");n&&(!e&&!t?(t=this.label,n.addClass("cke_combo_inlinelabel")):n.removeClass("cke_combo_inlinelabel"),n.setText(typeof t!="undefined"?t:e))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(e){this._.list.mark(e)},hideItem:function(e){this._.list.hideItem(e)},hideGroup:function(e){this._.list.hideGroup(e)},showAll:function(){this._.list.showAll()},add:function(e,t,n){this._.items[e]=n||e,this._.list.add(e,t,n)},startGroup:function(e){this._.list.startGroup(e)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this)),this._.committed=1},setState:function(e){if(this._.state!=e){var t=this.document.getById("cke_"+this.id);t.setState(e,"cke_combo"),e==CKEDITOR.TRISTATE_DISABLED?t.setAttribute("aria-disabled",!0):t.removeAttribute("aria-disabled"),this._.state=e}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))}},statics:{handler:{create:function(e){return new CKEDITOR.ui.richCombo(e)}}}}),CKEDITOR.ui.prototype.addRichCombo=function(e,t){this.add(e,CKEDITOR.UI_RICHCOMBO,t)}}(),CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(e){if(!e.blockless){for(var t=e.config,n=e.lang.format,r=t.format_tags.split(";"),i={},s=0,o=[],u=0;u<r.length;u++){var a=r[u],f=new CKEDITOR.style(t["format_"+a]);if(!e.filter.customConfig||e.filter.check(f))s++,i[a]=f,i[a]._.enterMode=e.config.enterMode,o.push(f)}s!==0&&e.ui.addRichCombo("Format",{label:n.label,title:n.panelTitle,toolbar:"styles,20",allowedContent:o,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(t.contentsCss),multiSelect:!1,attributes:{"aria-label":n.panelTitle}},init:function(){this.startGroup(n.panelTitle);for(var e in i){var t=n["tag_"+e];this.add(e,i[e].buildPreview(t),t)}},onClick:function(t){e.focus(),e.fire("saveSnapshot");var t=i[t],n=e.elementPath();e[t.checkActive(n,e)?"removeStyle":"applyStyle"](t),setTimeout(function(){e.fire("saveSnapshot")},0)},onRender:function(){e.on("selectionChange",function(t){var n=this.getValue(),t=t.data.path;this.refresh();for(var r in i)if(i[r].checkActive(t,e)){r!=n&&this.setValue(r,e.lang.format["tag_"+r]);return}this.setValue("")},this)},onOpen:function(){this.showAll();for(var t in i)e.activeFilter.check(i[t])||this.hideItem(t)},refresh:function(){var t=e.elementPath();if(t){if(t.isContextFor("p"))for(var n in i)if(e.activeFilter.check(i[n]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}}),CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div",CKEDITOR.config.format_p={element:"p"},CKEDITOR.config.format_div={element:"div"},CKEDITOR.config.format_pre={element:"pre"},CKEDITOR.config.format_address={element:"address"},CKEDITOR.config.format_h1={element:"h1"},CKEDITOR.config.format_h2={element:"h2"},CKEDITOR.config.format_h3={element:"h3"},CKEDITOR.config.format_h4={element:"h4"},CKEDITOR.config.format_h5={element:"h5"},CKEDITOR.config.format_h6={element:"h6"},function(){var e={canUndo:!1,exec:function(e){var t=e.document.createElement("hr");e.insertElement(t)},allowedContent:"hr",requiredContent:"hr"};CKEDITOR.plugins.add("horizontalrule",{init:function(t){t.blockless||(t.addCommand("horizontalrule",e),t.ui.addButton&&t.ui.addButton("HorizontalRule",{label:t.lang.horizontalrule.toolbar,command:"horizontalrule",toolbar:"insert,40"}))}})}(),CKEDITOR.plugins.add("htmlwriter",{init:function(e){var t=new CKEDITOR.htmlWriter;t.forceSimpleAmpersand=e.config.forceSimpleAmpersand,t.indentationChars=e.config.dataIndentationChars||"	",e.dataProcessor.writer=t}}),CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,$:function(){this.base(),this.indentationChars="	",this.selfClosingEnd=" />",this.lineBreakChars="\n",this.sortAttributes=1,this._.indent=0,this._.indentation="",this._.inPre=0,this._.rules={};var e=CKEDITOR.dtd,t;for(t in CKEDITOR.tools.extend({},e.$nonBodyContent,e.$block,e.$listItem,e.$tableContent))this.setRules(t,{indent:!e[t]["#"],breakBeforeOpen:1,breakBeforeClose:!e[t]["#"],breakAfterClose:1,needsSpace:t in e.$block&&!(t in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1}),this.setRules("title",{indent:0,breakAfterOpen:0}),this.setRules("style",{indent:0,breakBeforeClose:1}),this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(e){var t=this._.rules[e];this._.afterCloser&&t&&t.needsSpace&&this._.needsSpace&&this._.output.push("\n"),this._.indent?this.indentation():t&&t.breakBeforeOpen&&(this.lineBreak(),this.indentation()),this._.output.push("<",e),this._.afterCloser=0},openTagClose:function(e,t){var n=this._.rules[e];t?(this._.output.push(this.selfClosingEnd),n&&n.breakAfterClose&&(this._.needsSpace=n.needsSpace)):(this._.output.push(">"),n&&n.indent&&(this._.indentation=this._.indentation+this.indentationChars)),n&&n.breakAfterOpen&&this.lineBreak(),e=="pre"&&(this._.inPre=1)},attribute:function(e,t){typeof t=="string"&&(this.forceSimpleAmpersand&&(t=t.replace(/&amp;/g,"&")),t=CKEDITOR.tools.htmlEncodeAttr(t)),this._.output.push(" ",e,'="',t,'"')},closeTag:function(e){var t=this._.rules[e];t&&t.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length)),this._.indent?this.indentation():t&&t.breakBeforeClose&&(this.lineBreak(),this.indentation()),this._.output.push("</",e,">"),e=="pre"&&(this._.inPre=0),t&&t.breakAfterClose&&(this.lineBreak(),this._.needsSpace=t.needsSpace),this._.afterCloser=1},text:function(e){this._.indent&&(this.indentation(),!this._.inPre&&(e=CKEDITOR.tools.ltrim(e))),this._.output.push(e)},comment:function(e){this._.indent&&this.indentation(),this._.output.push("<!--",e,"-->")},lineBreak:function(){!this._.inPre&&this._.output.length>0&&this._.output.push(this.lineBreakChars),this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation),this._.indent=0},reset:function(){this._.output=[],this._.indent=0,this._.indentation="",this._.afterCloser=0,this._.inPre=0},setRules:function(e,t){var n=this._.rules[e];n?CKEDITOR.tools.extend(n,t,!0):this._.rules[e]=t}}}),function(){function e(e,t){t||(t=e.getSelection().getSelectedElement());if(t&&t.is("img")&&!t.data("cke-realelement")&&!t.isReadOnly())return t}function t(e){var t=e.getStyle("float");if(t=="inherit"||t=="none")t=0;return t||(t=e.getAttribute("align")),t}CKEDITOR.plugins.add("image",{requires:"dialog",init:function(t){if(!t.plugins.image2){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var n="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";CKEDITOR.dialog.isTabEnabled(t,"image","advanced")&&(n="img[alt,dir,id,lang,longdesc,!src,title]{*}(*)"),t.addCommand("image",new CKEDITOR.dialogCommand("image",{allowedContent:n,requiredContent:"img[alt,src]",contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]})),t.ui.addButton&&t.ui.addButton("Image",{label:t.lang.common.image,command:"image",toolbar:"insert,10"}),t.on("doubleclick",function(e){var t=e.data.element;t.is("img")&&!t.data("cke-realelement")&&!t.isReadOnly()&&(e.data.dialog="image")}),t.addMenuItems&&t.addMenuItems({image:{label:t.lang.image.menu,command:"image",group:"image"}}),t.contextMenu&&t.contextMenu.addListener(function(n){if(e(t,n))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(n){function r(r){var i=n.getCommand("justify"+r);i&&((r=="left"||r=="right")&&i.on("exec",function(i){var s=e(n),o;s&&(o=t(s),o==r?(s.removeStyle("float"),r==t(s)&&s.removeAttribute("align")):s.setStyle("float",r),i.cancel())}),i.on("refresh",function(i){var s=e(n);s&&(s=t(s),this.setState(s==r?CKEDITOR.TRISTATE_ON:r=="right"||r=="left"?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),i.cancel())}))}n.plugins.image2||(r("left"),r("right"),r("center"),r("block"))}})}(),CKEDITOR.config.image_removeLinkByEmptyURL=!0,function(){function e(e,t){var n=r.exec(e),i=r.exec(t);if(n){if(!n[2]&&i[2]=="px")return i[1];if(n[2]=="px"&&!i[2])return i[1]+"px"}return t}var t=CKEDITOR.htmlParser.cssStyle,n=CKEDITOR.tools.cssLength,r=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,i={elements:{$:function(n){var r=n.attributes;if((r=(r=(r=r&&r["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(r)))&&r.children[0])&&n.attributes["data-cke-resizable"]){var i=(new t(n)).rules,n=r.attributes,s=i.width,i=i.height;s&&(n.width=e(n.width,s)),i&&(n.height=e(n.height,i))}return r}}};CKEDITOR.plugins.add("fakeobjects",{init:function(e){e.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(e){(e=(e=e.dataProcessor)&&e.htmlFilter)&&e.addRules(i,{applyToAll:!0})}}),CKEDITOR.editor.prototype.createFakeElement=function(e,r,i,s){var o=this.lang.fakeobjects,o=o[i]||o.unknown,r={"class":r,"data-cke-realelement":encodeURIComponent(e.getOuterHtml()),"data-cke-real-node-type":e.type,alt:o,title:o,align:e.getAttribute("align")||""};return CKEDITOR.env.hc||(r.src=CKEDITOR.tools.transparentImageData),i&&(r["data-cke-real-element-type"]=i),s&&(r["data-cke-resizable"]=s,i=new t,s=e.getAttribute("width"),e=e.getAttribute("height"),s&&(i.rules.width=n(s)),e&&(i.rules.height=n(e)),i.populate(r)),this.document.createElement("img",{attributes:r})},CKEDITOR.editor.prototype.createFakeParserElement=function(e,r,i,s){var o=this.lang.fakeobjects,o=o[i]||o.unknown,u;return u=new CKEDITOR.htmlParser.basicWriter,e.writeHtml(u),u=u.getHtml(),r={"class":r,"data-cke-realelement":encodeURIComponent(u),"data-cke-real-node-type":e.type,alt:o,title:o,align:e.attributes.align||""},CKEDITOR.env.hc||(r.src=CKEDITOR.tools.transparentImageData),i&&(r["data-cke-real-element-type"]=i),s&&(r["data-cke-resizable"]=s,s=e.attributes,e=new t,i=s.width,s=s.height,i!==void 0&&(e.rules.width=n(i)),s!==void 0&&(e.rules.height=n(s)),e.populate(r)),new CKEDITOR.htmlParser.element("img",r)},CKEDITOR.editor.prototype.restoreRealElement=function(t){if(t.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var n=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(t.data("cke-realelement")),this.document);if(t.data("cke-resizable")){var r=t.getStyle("width"),t=t.getStyle("height");r&&n.setAttribute("width",e(n.getAttribute("width"),r)),t&&n.setAttribute("height",e(n.getAttribute("height"),t))}return n}}(),"use strict",function(){function e(e){return e.replace(/'/g,"\\$&")}function t(e){for(var t,n=e.length,r=[],i=0;i<n;i++)t=e.charCodeAt(i),r.push(t);return"String.fromCharCode("+r.join(",")+")"}function n(t,n){var r=t.plugins.link,i=r.compiledProtectionFunction.params,s,o;o=[r.compiledProtectionFunction.name,"("];for(var u=0;u<i.length;u++)r=i[u].toLowerCase(),s=n[r],u>0&&o.push(","),o.push("'",s?e(encodeURIComponent(n[r])):"","'");return o.push(")"),o.join("")}function r(e){var e=e.config.emailProtection||"",t;return e&&e!="encode"&&(t={},e.replace(/^([^(]+)\(([^)]+)\)$/,function(e,n,r){t.name=n,t.params=[],r.replace(/[^,\s]+/g,function(e){t.params.push(e)})})),t}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function e(e){return n.replace(/%1/g,e=="rtl"?"right":"left").replace(/%2/g,"cke_contents_"+e)}var t="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",n=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+t+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+t+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(e("ltr")+e("rtl"))},init:function(e){var t="a[!href]";CKEDITOR.dialog.isTabEnabled(e,"link","advanced")&&(t=t.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)")),CKEDITOR.dialog.isTabEnabled(e,"link","target")&&(t=t.replace("]",",target,onclick]")),e.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:t,requiredContent:"a[href]"})),e.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"})),e.addCommand("unlink",new CKEDITOR.unlinkCommand),e.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand),e.setKeystroke(CKEDITOR.CTRL+76,"link"),e.ui.addButton&&(e.ui.addButton("Link",{label:e.lang.link.toolbar,command:"link",toolbar:"links,10"}),e.ui.addButton("Unlink",{label:e.lang.link.unlink,command:"unlink",toolbar:"links,20"}),e.ui.addButton("Anchor",{label:e.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"})),CKEDITOR.dialog.add("link",this.path+"dialogs/link.js"),CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js"),e.on("doubleclick",function(t){var n=CKEDITOR.plugins.link.getSelectedLink(e)||t.data.element;n.isReadOnly()||(n.is("a")?(t.data.dialog=n.getAttribute("name")&&(!n.getAttribute("href")||!n.getChildCount())?"anchor":"link",t.data.link=n):CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,n)&&(t.data.dialog="anchor"))},null,null,0),e.on("doubleclick",function(t){t.data.dialog in{link:1,anchor:1}&&t.data.link&&e.getSelection().selectElement(t.data.link)},null,null,20),e.addMenuItems&&e.addMenuItems({anchor:{label:e.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:e.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:e.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:e.lang.link.unlink,command:"unlink",group:"link",order:5}}),e.contextMenu&&e.contextMenu.addListener(function(t){if(!t||t.isReadOnly())return null;t=CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,t);if(!t&&!(t=CKEDITOR.plugins.link.getSelectedLink(e)))return null;var n={};return t.getAttribute("href")&&t.getChildCount()&&(n={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF}),t&&t.hasAttribute("name")&&(n.anchor=n.removeAnchor=CKEDITOR.TRISTATE_OFF),n}),this.compiledProtectionFunction=r(e)},afterInit:function(e){e.dataProcessor.dataFilter.addRules({elements:{a:function(t){return t.attributes.name?t.children.length?null:e.createFakeParserElement(t,"cke_anchor","anchor"):null}}});var t=e._.elementsPath&&e._.elementsPath.filters;t&&t.push(function(t,n){if(n=="a"&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,t)||t.getAttribute("name")&&(!t.getAttribute("href")||!t.getChildCount())))return"anchor"})}});var i=/^javascript:/,s=/^mailto:([^?]+)(?:\?(.+))?$/,o=/subject=([^;?:@&=$,\/]*)/,u=/body=([^;?:@&=$,\/]*)/,a=/^#(.*)$/,f=/^((?:http|https|ftp|news):\/\/)?(.*)$/,l=/^(_(?:self|top|parent|blank))$/,c=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,h=/^javascript:([^(]+)\(([^)]+)\)$/,p=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,d=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,v={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(e){var t=e.getSelection(),n=t.getSelectedElement();return n&&n.is("a")?n:(t=t.getRanges()[0])?(t.shrink(CKEDITOR.SHRINK_TEXT),e.elementPath(t.getCommonAncestor()).contains("a",1)):null},getEditorAnchors:function(e){for(var t=e.editable(),n=t.isInline()&&!e.plugins.divarea?e.document:t,t=n.getElementsByTag("a"),n=n.getElementsByTag("img"),r=[],i=0,s;s=t.getItem(i++);)(s.data("cke-saved-name")||s.hasAttribute("name"))&&r.push({name:s.data("cke-saved-name")||s.getAttribute("name"),id:s.getAttribute("id")});for(i=0;s=n.getItem(i++);)(s=this.tryRestoreFakeAnchor(e,s))&&r.push({name:s.getAttribute("name"),id:s.getAttribute("id")});return r},fakeAnchor:!0,tryRestoreFakeAnchor:function(e,t){if(t&&t.data("cke-real-element-type")&&t.data("cke-real-element-type")=="anchor"){var n=e.restoreRealElement(t);if(n.data("cke-saved-name"))return n}},parseLinkAttributes:function(e,t){var n=t&&(t.data("cke-saved-href")||t.getAttribute("href"))||"",r=e.plugins.link.compiledProtectionFunction,g=e.config.emailProtection,y,b={};n.match(i)&&(g=="encode"?n=n.replace(c,function(e,t,n){return"mailto:"+String.fromCharCode.apply(String,t.split(","))+(n&&n.replace(/\\'/g,"'"))}):g&&n.replace(h,function(e,t,n){if(t==r.name){b.type="email";for(var e=b.email={},t=/(^')|('$)/g,n=n.match(/[^,\s]+/g),i=n.length,s,o,u=0;u<i;u++)s=decodeURIComponent,o=n[u].replace(t,"").replace(/\\'/g,"'"),o=s(o),s=r.params[u].toLowerCase(),e[s]=o;e.address=[e.name,e.domain].join("@")}}));if(!b.type)if(g=n.match(a))b.type="anchor",b.anchor={},b.anchor.name=b.anchor.id=g[1];else if(g=n.match(s)){y=n.match(o),n=n.match(u),b.type="email";var w=b.email={};w.address=g[1],y&&(w.subject=decodeURIComponent(y[1])),n&&(w.body=decodeURIComponent(n[1]))}else n&&(y=n.match(f))&&(b.type="url",b.url={},b.url.protocol=y[1],b.url.url=y[2]);if(t){if(n=t.getAttribute("target"))b.target={type:n.match(l)?n:"frame",name:n};else if(n=(n=t.data("cke-pa-onclick")||t.getAttribute("onclick"))&&n.match(p))for(b.target={type:"popup",name:n[1]};g=d.exec(n[2]);)g[2]!="yes"&&g[2]!="1"||g[1]in{height:1,width:1,top:1,left:1}?isFinite(g[2])&&(b.target[g[1]]=g[2]):b.target[g[1]]=!0;var n={},E;for(E in v)(g=t.getAttribute(E))&&(n[v[E]]=g);if(E=t.data("cke-saved-name")||n.advName)n.advName=E;CKEDITOR.tools.isEmpty(n)||(b.advanced=n)}return b},getLinkAttributes:function(r,i){var s=r.config.emailProtection||"",o={};switch(i.type){case"url":var s=i.url&&i.url.protocol!==void 0?i.url.protocol:"http://",u=i.url&&CKEDITOR.tools.trim(i.url.url)||"";o["data-cke-saved-href"]=u.indexOf("/")===0?u:s+u;break;case"anchor":s=i.anchor&&i.anchor.id,o["data-cke-saved-href"]="#"+(i.anchor&&i.anchor.name||s||"");break;case"email":var a=i.email,u=a.address;switch(s){case"":case"encode":var f=encodeURIComponent(a.subject||""),l=encodeURIComponent(a.body||""),a=[];f&&a.push("subject="+f),l&&a.push("body="+l),a=a.length?"?"+a.join("&"):"",s=="encode"?(s=["javascript:void(location.href='mailto:'+",t(u)],a&&s.push("+'",e(a),"'"),s.push(")")):s=["mailto:",u,a];break;default:s=u.split("@",2),a.name=s[0],a.domain=s[1],s=["javascript:",n(r,a)]}o["data-cke-saved-href"]=s.join("")}if(i.target)if(i.target.type=="popup"){for(var s=["window.open(this.href, '",i.target.name||"","', '"],c=["resizable","status","location","toolbar","menubar","fullscreen","scrollbars","dependent"],u=c.length,f=function(e){i.target[e]&&c.push(e+"="+i.target[e])},a=0;a<u;a++)c[a]=c[a]+(i.target[c[a]]?"=yes":"=no");f("width"),f("left"),f("height"),f("top"),s.push(c.join(","),"'); return false;"),o["data-cke-pa-onclick"]=s.join("")}else i.target.type!="notSet"&&i.target.name&&(o.target=i.target.name);if(i.advanced){for(var h in v)(s=i.advanced[v[h]])&&(o[h]=s);o.name&&(o["data-cke-saved-name"]=o.name)}o["data-cke-saved-href"]&&(o.href=o["data-cke-saved-href"]),h=CKEDITOR.tools.extend({target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1},v);for(var p in o)delete h[p];return{set:o,removed:CKEDITOR.tools.objectKeys(h)}}},CKEDITOR.unlinkCommand=function(){},CKEDITOR.unlinkCommand.prototype={exec:function(e){var t=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});e.removeStyle(t)},refresh:function(e,t){var n=t.lastElement&&t.lastElement.getAscendant("a",!0);n&&n.getName()=="a"&&n.getAttribute("href")&&n.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]"},CKEDITOR.removeAnchorCommand=function(){},CKEDITOR.removeAnchorCommand.prototype={exec:function(e){var t=e.getSelection(),n=t.createBookmarks(),r;if(t&&(r=t.getSelectedElement())&&(r.getChildCount()?r.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,r)))r.remove(1);else if(r=CKEDITOR.plugins.link.getSelectedLink(e))r.hasAttribute("href")?(r.removeAttributes({name:1,"data-cke-saved-name":1}),r.removeClass("cke_anchor")):r.remove(1);t.selectBookmarks(n)},requiredContent:"a[name]"},CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0})}(),"use strict",function(){function e(e,t,n){return l(t)&&l(n)&&n.equals(t.getNext(function(e){return!(J(e)||K(e)||c(e))}))}function t(e){this.upper=e[0],this.lower=e[1],this.set.apply(this,e.slice(2))}function n(e){var t=e.element;if(t&&l(t)&&(t=t.getAscendant(e.triggers,!0))&&e.editable.contains(t)){var n=s(t);if(n.getAttribute("contenteditable")=="true")return t;if(n.is(e.triggers))return n}return null}function r(e,t,n){return b(e,t),b(e,n),e=t.size.bottom,n=n.size.top,e&&n?0|(e+n)/2:e||n}function i(e,t,n){return t=t[n?"getPrevious":"getNext"](function(t){return t&&t.type==CKEDITOR.NODE_TEXT&&!J(t)||l(t)&&!c(t)&&!f(e,t)})}function s(e,t){if(e.data("cke-editable"))return null;for(t||(e=e.getParent());e;){if(e.data("cke-editable"))break;if(e.hasAttribute("contenteditable"))return e;e=e.getParent()}return null}function o(e){var t=e.doc,n=N('<span contenteditable="false" style="'+W+"position:absolute;border-top:1px dashed "+e.boxColor+'"></span>',t),r=CKEDITOR.getUrl(this.path+"images/"+(C.hidpi?"hidpi/":"")+"icon"+(e.rtl?"-rtl":"")+".png");x(n,{attach:function(){return this.wrap.getParent()||this.wrap.appendTo(e.editable,!0),this},lineChildren:[x(N('<span title="'+e.editor.lang.magicline.title+'" contenteditable="false">&#8629;</span>',t),{base:W+"height:17px;width:17px;"+(e.rtl?"left":"right")+":17px;background:url("+r+") center no-repeat "+e.boxColor+";cursor:pointer;"+(C.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(C.hidpi?"background-size: 9px 10px;":""),looks:["top:-8px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","2px",1),"top:-17px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","2px 2px 0px 0px",1),"top:-1px;"+CKEDITOR.tools.cssVendorPrefix("border-radius","0px 0px 2px 2px",1)]}),x(N(V,t),{base:X+"left:0px;border-left-color:"+e.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"]}),x(N(V,t),{base:X+"right:0px;border-right-color:"+e.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"]})],detach:function(){return this.wrap.getParent()&&this.wrap.remove(),this},mouseNear:function(){b(e,this);var t=e.holdDistance,n=this.size;return n&&e.mouse.y>n.top-t&&e.mouse.y<n.bottom+t&&e.mouse.x>n.left-t&&e.mouse.x<n.right+t?!0:!1},place:function(){var t=e.view,n=e.editable,r=e.trigger,i=r.upper,s=r.lower,o=i||s,u=o.getParent(),a={};this.trigger=r,i&&b(e,i,!0),s&&b(e,s,!0),b(e,u,!0),e.inInlineMode&&w(e,!0),u.equals(n)?(a.left=t.scroll.x,a.right=-t.scroll.x,a.width=""):(a.left=o.size.left-o.size.margin.left+t.scroll.x-(e.inInlineMode?t.editable.left+t.editable.border.left:0),a.width=o.size.outerWidth+o.size.margin.left+o.size.margin.right+t.scroll.x,a.right=""),i&&s?a.top=i.size.margin.bottom===s.size.margin.top?0|i.size.bottom+i.size.margin.bottom/2:i.size.margin.bottom<s.size.margin.top?i.size.bottom+i.size.margin.bottom:i.size.bottom+i.size.margin.bottom-s.size.margin.top:i?s||(a.top=i.size.bottom+i.size.margin.bottom):a.top=s.size.top-s.size.margin.top,r.is(H)||a.top>t.scroll.y-15&&a.top<t.scroll.y+5?(a.top=e.inInlineMode?0:t.scroll.y,this.look(H)):r.is(B)||a.top>t.pane.bottom-5&&a.top<t.pane.bottom+15?(a.top=e.inInlineMode?t.editable.height+t.editable.padding.top+t.editable.padding.bottom:t.pane.bottom-1,this.look(B)):(e.inInlineMode&&(a.top=a.top-(t.editable.top+t.editable.border.top)),this.look(j)),e.inInlineMode&&(a.top--,a.top=a.top+t.editable.scroll.top,a.left=a.left+t.editable.scroll.left);for(var f in a)a[f]=CKEDITOR.tools.cssLength(a[f]);this.setStyles(a)},look:function(e){if(this.oldLook!=e){for(var t=this.lineChildren.length,n;t--;)(n=this.lineChildren[t]).setAttribute("style",n.base+n.looks[0|e/2]);this.oldLook=e}},wrap:new T("span",e.doc)});for(t=n.lineChildren.length;t--;)n.lineChildren[t].appendTo(n);n.look(j),n.appendTo(n.wrap),n.unselectable(),n.lineChildren[0].on("mouseup",function(t){n.detach(),u(e,function(t){var n=e.line.trigger;t[n.is(O)?"insertBefore":"insertAfter"](n.is(O)?n.lower:n.upper)},!0),e.editor.focus(),!C.ie&&e.enterMode!=CKEDITOR.ENTER_BR&&e.hotNode.scrollIntoView(),t.data.preventDefault(!0)}),n.on("mousedown",function(e){e.data.preventDefault(!0)}),e.line=n}function u(e,t,n){var r=new CKEDITOR.dom.range(e.doc),i=e.editor,o;C.ie&&e.enterMode==CKEDITOR.ENTER_BR?o=e.doc.createText(F):(o=(o=s(e.element,!0))&&o.data("cke-enter-mode")||e.enterMode,o=new T(A[o],e.doc),o.is("br")||e.doc.createText(F).appendTo(o)),n&&i.fire("saveSnapshot"),t(o),r.moveToPosition(o,CKEDITOR.POSITION_AFTER_START),i.getSelection().selectRanges([r]),e.hotNode=o,n&&i.fire("saveSnapshot")}function a(e,t){return{canUndo:!0,modes:{wysiwyg:1},exec:function(){function r(n){var r=C.ie&&C.version<9?" ":F,i=e.hotNode&&e.hotNode.getText()==r&&e.element.equals(e.hotNode)&&e.lastCmdDirection===!!t;u(e,function(r){i&&e.hotNode&&e.hotNode.remove(),r[t?"insertAfter":"insertBefore"](n),r.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!t}),e.lastCmdDirection=!!t}),!C.ie&&e.enterMode!=CKEDITOR.ENTER_BR&&e.hotNode.scrollIntoView(),e.line.detach()}return function(o){var o=o.getSelection().getStartElement(),u,o=o.getAscendant(U,1);if(!d(e,o)&&o&&!o.equals(e.editable)&&!o.contains(e.editable)){(u=s(o))&&u.getAttribute("contenteditable")=="false"&&(o=u),e.element=o,u=i(e,o,!t);var a;l(u)&&u.is(e.triggers)&&u.is(R)&&(!i(e,u,!t)||(a=i(e,u,!t))&&l(a)&&a.is(e.triggers))?r(u):(a=n(e,o),l(a)&&(i(e,a,!t)?(o=i(e,a,!t))&&l(o)&&o.is(e.triggers)&&r(a):r(a)))}}}()}}function f(e,t){if(!t||t.type!=CKEDITOR.NODE_ELEMENT||!t.$)return!1;var n=e.line;return n.wrap.equals(t)||n.wrap.contains(t)}function l(e){return e&&e.type==CKEDITOR.NODE_ELEMENT&&e.$}function c(e){if(!l(e))return!1;var t;return(t=h(e))||(l(e)?(t={left:1,right:1,center:1},t=!!t[e.getComputedStyle("float")]||!!t[e.getAttribute("align")]):t=!1),t}function h(e){return!!{absolute:1,fixed:1}[e.getComputedStyle("position")]}function p(e,t){return l(t)?t.is(e.triggers):null}function d(e,t){if(!t)return!1;for(var n=t.getParents(1),r=n.length;r--;)for(var i=e.tabuList.length;i--;)if(n[r].hasAttribute(e.tabuList[i]))return!0;return!1}function v(e,t,n){return t=t[n?"getLast":"getFirst"](function(t){return e.isRelevant(t)&&!t.is(q)}),t?(b(e,t),n?t.size.top>e.mouse.y:t.size.bottom<e.mouse.y):!1}function m(e){var n=e.editable,r=e.mouse,i=e.view,s=e.triggerOffset;w(e);var o=r.y>(e.inInlineMode?i.editable.top+i.editable.height/2:Math.min(i.editable.height,i.pane.height)/2),n=n[o?"getLast":"getFirst"](function(e){return!J(e)&&!K(e)});return n?(f(e,n)&&(n=e.line.wrap[o?"getPrevious":"getNext"](function(e){return!J(e)&&!K(e)})),!l(n)||c(n)||!p(e,n)?null:(b(e,n),!o&&n.size.top>=0&&r.y>0&&r.y<n.size.top+s?(e=e.inInlineMode||i.scroll.y===0?H:j,new t([null,n,O,D,e])):o&&n.size.bottom<=i.pane.height&&r.y>n.size.bottom-s&&r.y<i.pane.height?(e=e.inInlineMode||n.size.bottom>i.pane.height-s&&n.size.bottom<i.pane.height?B:j,new t([n,null,M,D,e])):null)):null}function g(e){var r=e.mouse,s=e.view,o=e.triggerOffset,u=n(e);if(!u)return null;b(e,u);var o=Math.min(o,0|u.size.outerHeight/2),a=[],f,h;if(r.y>u.size.top-1&&r.y<u.size.top+o)h=!1;else{if(!(r.y>u.size.bottom-o&&r.y<u.size.bottom+1))return null;h=!0}if(c(u)||v(e,u,h)||u.getParent().is(I))return null;var d=i(e,u,!h);if(d){if(d&&d.type==CKEDITOR.NODE_TEXT)return null;if(l(d)){if(c(d)||!p(e,d)||d.getParent().is(I))return null;a=[d,u][h?"reverse":"concat"]().concat([_,D])}}else u.equals(e.editable[h?"getLast":"getFirst"](e.isRelevant))?(w(e),h&&r.y>u.size.bottom-o&&r.y<s.pane.height&&u.size.bottom>s.pane.height-o&&u.size.bottom<s.pane.height?f=B:r.y>0&&r.y<u.size.top+o&&(f=H)):f=j,a=[null,u][h?"reverse":"concat"]().concat([h?M:O,D,f,u.equals(e.editable[h?"getLast":"getFirst"](e.isRelevant))?h?B:H:j]);return 0 in a?new t(a):null}function y(e,t,n,r){for(var i=function(){var n=C.ie?t.$.currentStyle:e.win.$.getComputedStyle(t.$,"");return C.ie?function(e){return n[CKEDITOR.tools.cssStyleToDomStyle(e)]}:function(e){return n.getPropertyValue(e)}}(),s=t.getDocumentPosition(),o={},u={},a={},f={},l=G.length;l--;)o[G[l]]=parseInt(i("border-"+G[l]+"-width"),10)||0,a[G[l]]=parseInt(i("padding-"+G[l]),10)||0,u[G[l]]=parseInt(i("margin-"+G[l]),10)||0;return(!n||r)&&E(e,r),f.top=s.y-(n?0:e.view.scroll.y),f.left=s.x-(n?0:e.view.scroll.x),f.outerWidth=t.$.offsetWidth,f.outerHeight=t.$.offsetHeight,f.height=f.outerHeight-(a.top+a.bottom+o.top+o.bottom),f.width=f.outerWidth-(a.left+a.right+o.left+o.right),f.bottom=f.top+f.outerHeight,f.right=f.left+f.outerWidth,e.inInlineMode&&(f.scroll={top:t.$.scrollTop,left:t.$.scrollLeft}),x({border:o,padding:a,margin:u,ignoreScroll:n},f,!0)}function b(e,t,n){if(!l(t))return t.size=null;if(t.size){if(t.size.ignoreScroll==n&&t.size.date>new Date-z)return null}else t.size={};return x(t.size,y(e,t,n),{date:+(new Date)},!0)}function w(e,t){e.view.editable=y(e,e.editable,t,!0)}function E(e,t){e.view||(e.view={});var n=e.view;if(t||!(n&&n.date>new Date-z)){var r=e.win,n=r.getScrollPosition(),r=r.getViewPaneSize();x(e.view,{scroll:{x:n.x,y:n.y,width:e.doc.$.documentElement.scrollWidth-r.width,height:e.doc.$.documentElement.scrollHeight-r.height},pane:{width:r.width,height:r.height,bottom:r.height+n.y},date:+(new Date)},!0)}}function S(e,n,r,i){for(var s=i,o=i,u=0,a=!1,f=!1,l=e.view.pane.height,c=e.mouse;c.y+u<l&&c.y-u>0;){a||(a=n(s,i)),f||(f=n(o,i)),!a&&c.y-u>0&&(s=r(e,{x:c.x,y:c.y-u})),!f&&c.y+u<l&&(o=r(e,{x:c.x,y:c.y+u}));if(a&&f)break;u+=2}return new t([s,o,null,null])}CKEDITOR.plugins.add("magicline",{init:function(e){var r=e.config,s=r.magicline_triggerOffset||30,p={editor:e,enterMode:r.enterMode,triggerOffset:s,holdDistance:0|s*(r.magicline_holdDistance||.5),boxColor:r.magicline_color||"#ff0000",rtl:r.contentsLangDirection=="rtl",tabuList:["data-cke-hidden-sel"].concat(r.magicline_tabuList||[]),triggers:r.magicline_everywhere?U:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}},v,b,S;p.isRelevant=function(e){return l(e)&&!f(p,e)&&!c(e)},e.on("contentDom",function(){var s=e.editable(),l=e.document,c=e.window;x(p,{editable:s,inInlineMode:s.isInline(),doc:l,win:c,hotNode:null},!0),p.boundary=p.inInlineMode?p.editable:p.doc.getDocumentElement(),s.is(L.$inline)||(p.inInlineMode&&!h(s)&&s.setStyles({position:"relative",top:null,left:null}),o.call(this,p),E(p),s.attachListener(e,"beforeUndoImage",function(){p.line.detach()}),s.attachListener(e,"beforeGetData",function(){p.line.wrap.getParent()&&(p.line.detach(),e.once("getData",function(){p.line.attach()},null,null,1e3))},null,null,0),s.attachListener(p.inInlineMode?l:l.getWindow().getFrame(),"mouseout",function(t){if(e.mode=="wysiwyg")if(p.inInlineMode){var n=t.data.$.clientX,t=t.data.$.clientY;E(p),w(p,!0);var r=p.view.editable,i=p.view.scroll;if(!(n>r.left-i.x&&n<r.right-i.x)||!(t>r.top-i.y&&t<r.bottom-i.y))clearTimeout(S),S=null,p.line.detach()}else clearTimeout(S),S=null,p.line.detach()}),s.attachListener(s,"keyup",function(){p.hiddenMode=0}),s.attachListener(s,"keydown",function(t){if(e.mode=="wysiwyg")switch(t.data.getKeystroke()){case 2228240:case 16:p.hiddenMode=1,p.line.detach()}}),s.attachListener(p.inInlineMode?s:l,"mousemove",function(t){b=!0;if(e.mode=="wysiwyg"&&!e.readOnly&&!S){var n={x:t.data.$.clientX,y:t.data.$.clientY};S=setTimeout(function(){p.mouse=n,S=p.trigger=null,E(p),b&&!p.hiddenMode&&e.focusManager.hasFocus&&!p.line.mouseNear()&&(p.element=$(p,!0))&&((p.trigger=m(p)||g(p)||Q(p))&&!d(p,p.trigger.upper||p.trigger.lower)?p.line.attach().place():(p.trigger=null,p.line.detach()),b=!1)},30)}}),s.attachListener(c,"scroll",function(){e.mode=="wysiwyg"&&(p.line.detach(),C.webkit&&(p.hiddenMode=1,clearTimeout(v),v=setTimeout(function(){p.mouseDown||(p.hiddenMode=0)},50)))}),s.attachListener(k?l:c,"mousedown",function(){e.mode=="wysiwyg"&&(p.line.detach(),p.hiddenMode=1,p.mouseDown=1)}),s.attachListener(k?l:c,"mouseup",function(){p.hiddenMode=0,p.mouseDown=0}),e.addCommand("accessPreviousSpace",a(p)),e.addCommand("accessNextSpace",a(p,!0)),e.setKeystroke([[r.magicline_keystrokePrevious,"accessPreviousSpace"],[r.magicline_keystrokeNext,"accessNextSpace"]]),e.on("loadSnapshot",function(){var t,n,r,i;for(i in{p:1,br:1,div:1}){t=e.document.getElementsByTag(i);for(r=t.count();r--;)if((n=t.getItem(r)).data("cke-magicline-hot")){p.hotNode=n,p.lastCmdDirection=n.data("cke-magicline-dir")==="true"?!0:!1;return}}}),this.backdoor={accessFocusSpace:u,boxTrigger:t,isLine:f,getAscendantTrigger:n,getNonEmptyNeighbour:i,getSize:y,that:p,triggerEdge:g,triggerEditable:m,triggerExpand:Q})},this)}});var x=CKEDITOR.tools.extend,T=CKEDITOR.dom.element,N=T.createFromHtml,C=CKEDITOR.env,k=CKEDITOR.env.ie&&CKEDITOR.env.version<9,L=CKEDITOR.dtd,A={},O=128,M=64,_=32,D=16,P=8,H=4,B=2,j=1,F=" ",I=L.$listItem,q=L.$tableContent,R=x({},L.$nonEditable,L.$empty),U=L.$block,z=100,W="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",X=W+"border-color:transparent;display:block;border-style:solid;",V="<span>"+F+"</span>";A[CKEDITOR.ENTER_BR]="br",A[CKEDITOR.ENTER_P]="p",A[CKEDITOR.ENTER_DIV]="div",t.prototype={set:function(e,t,n){return this.properties=e+t+(n||j),this},is:function(e){return(this.properties&e)==e}};var $=function(){function e(e,t){var n=e.$.elementFromPoint(t.x,t.y);return n&&n.nodeType?new CKEDITOR.dom.element(n):null}return function(t,n,r){if(!t.mouse)return null;var i=t.doc,s=t.line.wrap,r=r||t.mouse,o=e(i,r);return n&&f(t,o)&&(s.hide(),o=e(i,r),s.show()),!o||o.type!=CKEDITOR.NODE_ELEMENT||!o.$||C.ie&&C.version<9&&!t.boundary.equals(o)&&!t.boundary.contains(o)?null:o}}(),J=CKEDITOR.dom.walker.whitespaces(),K=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),Q=function(){function t(t){var i=t.element,s,o,u;if(!l(i)||i.contains(t.editable)||i.isReadOnly())return null;u=S(t,function(e,t){return!t.equals(e)},function(e,t){return $(e,!0,t)},i),s=u.upper,o=u.lower;if(e(t,s,o))return u.set(_,P);if(s&&i.contains(s))for(;!s.getParent().equals(i);)s=s.getParent();else s=i.getFirst(function(e){return n(t,e)});if(o&&i.contains(o))for(;!o.getParent().equals(i);)o=o.getParent();else o=i.getLast(function(e){return n(t,e)});if(!s||!o)return null;b(t,s),b(t,o);if(t.mouse.y>s.size.top&&t.mouse.y<o.size.bottom){for(var i=Number.MAX_VALUE,a,f,c,h;o&&!o.equals(s);){if(!(f=s.getNext(t.isRelevant)))break;a=Math.abs(r(t,s,f)-t.mouse.y),a<i&&(i=a,c=s,h=f),s=f,b(t,s)}return!!c&&!!h&&t.mouse.y>c.size.top&&t.mouse.y<h.size.bottom?(u.upper=c,u.lower=h,u.set(_,P)):null}return null}function n(e,t){return!(t&&t.type==CKEDITOR.NODE_TEXT||K(t)||c(t)||f(e,t)||t.type==CKEDITOR.NODE_ELEMENT&&t.$&&t.is("br"))}return function(n){var r=t(n),i;if(i=r){i=r.upper;var s=r.lower;i=!i||!s||c(s)||c(i)||s.equals(i)||i.equals(s)||s.contains(i)||i.contains(s)?!1:p(n,i)&&p(n,s)&&e(n,i,s)?!0:!1}return i?r:null}}(),G=["top","left","right","bottom"]}(),CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51,CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52,function(){function e(e){if(!e||e.type!=CKEDITOR.NODE_ELEMENT||e.getName()!="form")return[];for(var t=[],n=["style","className"],r=0;r<n.length;r++){var i=e.$.elements.namedItem(n[r]);i&&(i=new CKEDITOR.dom.element(i),t.push([i,i.nextSibling]),i.remove())}return t}function t(e,t){if(e&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()=="form"&&t.length>0)for(var n=t.length-1;n>=0;n--){var r=t[n][0],i=t[n][1];i?r.insertBefore(i):r.appendTo(e)}}function n(n,r){var i=e(n),s={},o=n.$;return r||(s["class"]=o.className||"",o.className=""),s.inline=o.style.cssText||"",r||(o.style.cssText="position: static; overflow: visible"),t(i),s}function r(n,r){var i=e(n),s=n.$;"class"in r&&(s.className=r["class"]),"inline"in r&&(s.style.cssText=r.inline),t(i)}function i(e){if(!e.editable().isInline()){var t=CKEDITOR.instances,n;for(n in t){var r=t[n];r.mode=="wysiwyg"&&!r.readOnly&&(r=r.document.getBody(),r.setAttribute("contentEditable",!1),r.setAttribute("contentEditable",!0))}e.editable().hasFocus&&(e.toolbox.focus(),e.focus())}}CKEDITOR.plugins.add("maximize",{init:function(e){function t(){var t=u.getViewPaneSize();e.resize(t.width,t.height,null,!0)}if(e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var s=e.lang,o=CKEDITOR.document,u=o.getWindow(),a,f,l,h=CKEDITOR.TRISTATE_OFF;e.addCommand("maximize",{modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},readOnly:1,editorFocus:!1,exec:function(){var p=e.container.getFirst(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.hasClass("cke_inner")}),d=e.ui.space("contents");if(e.mode=="wysiwyg"){var v=e.getSelection();a=v&&v.getRanges(),f=u.getScrollPosition()}else{var m=e.editable().$;a=!CKEDITOR.env.ie&&[m.selectionStart,m.selectionEnd],f=[m.scrollLeft,m.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){u.on("resize",t),l=u.getScrollPosition();for(v=e.container;v=v.getParent();)v.setCustomData("maximize_saved_styles",n(v)),v.setStyle("z-index",e.config.baseFloatZIndex-5);d.setCustomData("maximize_saved_styles",n(d,!0)),p.setCustomData("maximize_saved_styles",n(p,!0)),d={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0},o.getDocumentElement().setStyles(d),!CKEDITOR.env.gecko&&o.getDocumentElement().setStyle("position","fixed"),(!CKEDITOR.env.gecko||!CKEDITOR.env.quirks)&&o.getBody().setStyles(d),CKEDITOR.env.ie?setTimeout(function(){u.$.scrollTo(0,0)},0):u.$.scrollTo(0,0),p.setStyle("position",CKEDITOR.env.gecko&&CKEDITOR.env.quirks?"fixed":"absolute"),p.$.offsetLeft,p.setStyles({"z-index":e.config.baseFloatZIndex-5,left:"0px",top:"0px"}),p.addClass("cke_maximized"),t(),d=p.getDocumentPosition(),p.setStyles({left:-1*d.x+"px",top:-1*d.y+"px"}),CKEDITOR.env.gecko&&i(e)}else if(this.state==CKEDITOR.TRISTATE_ON){u.removeListener("resize",t),d=[d,p];for(v=0;v<d.length;v++)r(d[v],d[v].getCustomData("maximize_saved_styles")),d[v].removeCustomData("maximize_saved_styles");for(v=e.container;v=v.getParent();)r(v,v.getCustomData("maximize_saved_styles")),v.removeCustomData("maximize_saved_styles");CKEDITOR.env.ie?setTimeout(function(){u.$.scrollTo(l.x,l.y)},0):u.$.scrollTo(l.x,l.y),p.removeClass("cke_maximized"),CKEDITOR.env.webkit&&(p.setStyle("display","inline"),setTimeout(function(){p.setStyle("display","block")},0)),e.fire("resize")}this.toggleState();if(v=this.uiItems[0])d=this.state==CKEDITOR.TRISTATE_OFF?s.maximize.maximize:s.maximize.minimize,v=CKEDITOR.document.getById(v._.id),v.getChild(1).setHtml(d),v.setAttribute("title",d),v.setAttribute("href",'javascript:void("'+d+'");');e.mode=="wysiwyg"?a?(CKEDITOR.env.gecko&&i(e),e.getSelection().selectRanges(a),(m=e.getSelection().getStartElement())&&m.scrollIntoView(!0)):u.$.scrollTo(f.x,f.y):(a&&(m.selectionStart=a[0],m.selectionEnd=a[1]),m.scrollLeft=f[0],m.scrollTop=f[1]),a=f=null,h=this.state,e.fire("maximize",this.state)},canUndo:!1}),e.ui.addButton&&e.ui.addButton("Maximize",{label:s.maximize.maximize,command:"maximize",toolbar:"tools,10"}),e.on("mode",function(){var t=e.getCommand("maximize");t.setState(t.state==CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:h)},null,null,100)}}})}(),function(){function e(e,t,n){var r=CKEDITOR.cleanWord;return r?n():(e=CKEDITOR.getUrl(e.config.pasteFromWordCleanupFile||t+"filter/default.js"),CKEDITOR.scriptLoader.load(e,n,null,!0)),!r}function t(e){e.data.type="html"}CKEDITOR.plugins.add("pastefromword",{requires:"clipboard",init:function(n){var r=0,i=this.path;n.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(e){var n=this;r=1,e.once("beforePaste",t),e.getClipboardData({title:e.lang.pastefromword.title},function(t){t&&e.fire("paste",{type:"html",dataValue:t.dataValue}),e.fire("afterCommandExec",{name:"pastefromword",command:n,returnValue:!!t})})}}),n.ui.addButton&&n.ui.addButton("PasteFromWord",{label:n.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"}),n.on("pasteState",function(e){n.getCommand("pastefromword").setState(e.data)}),n.on("paste",function(t){var s=t.data,o=s.dataValue;if(o&&(r||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(o))){var u=e(n,i,function(){if(u)n.fire("paste",s);else if(!n.config.pasteFromWordPromptCleanup||r||confirm(n.lang.pastefromword.confirmCleanup))s.dataValue=CKEDITOR.cleanWord(o,n);r=0});u&&t.cancel()}},null,null,3)}})}(),function(){var e={canUndo:!1,async:!0,exec:function(t){t.getClipboardData({title:t.lang.pastetext.title},function(n){n&&t.fire("paste",{type:"text",dataValue:n.dataValue}),t.fire("afterCommandExec",{name:"pastetext",command:e,returnValue:!!n})})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(t){t.addCommand("pastetext",e),t.ui.addButton&&t.ui.addButton("PasteText",{label:t.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"}),t.config.forcePasteAsPlainText&&t.on("beforePaste",function(e){e.data.type!="html"&&(e.data.type="text")}),t.on("pasteState",function(e){t.getCommand("pastetext").setState(e.data)})}})}(),CKEDITOR.plugins.add("removeformat",{init:function(e){e.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat),e.ui.addButton&&e.ui.addButton("RemoveFormat",{label:e.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}}),CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(e){for(var t=e._.removeFormatRegex||(e._.removeFormatRegex=RegExp("^(?:"+e.config.removeFormatTags.replace(/,/g,"|")+")$","i")),n=e._.removeAttributes||(e._.removeAttributes=e.config.removeFormatAttributes.split(",")),r=CKEDITOR.plugins.removeformat.filter,i=e.getSelection().getRanges(),s=i.createIterator(),o=function(e){return e.type==CKEDITOR.NODE_ELEMENT},u;u=s.getNextRange();){u.collapsed||u.enlarge(CKEDITOR.ENLARGE_ELEMENT);var a=u.createBookmark(),f=a.startNode,l=a.endNode,c=function(n){for(var i=e.elementPath(n),s=i.elements,o=1,u;u=s[o];o++){if(u.equals(i.block)||u.equals(i.blockLimit))break;t.test(u.getName())&&r(e,u)&&n.breakParent(u)}};c(f);if(l){c(l);for(f=f.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);f;){if(f.equals(l))break;if(f.isReadOnly()){if(f.getPosition(l)&CKEDITOR.POSITION_CONTAINS)break;f=f.getNext(o)}else c=f.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),(f.getName()!="img"||!f.data("cke-realelement"))&&r(e,f)&&(t.test(f.getName())?f.remove(1):(f.removeAttributes(n),e.fire("removeFormatCleanup",f))),f=c}}u.moveToBookmark(a)}e.forceNextSelectionCheck(),e.getSelection().selectRanges(i)}}},filter:function(e,t){for(var n=e._.removeFormatFilters||[],r=0;r<n.length;r++)if(n[r](t)===!1)return!1;return!0}},CKEDITOR.editor.prototype.addRemoveFormatFilter=function(e){this._.removeFormatFilters||(this._.removeFormatFilters=[]),this._.removeFormatFilters.push(e)},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",CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign",CKEDITOR.plugins.add("resize",{init:function(e){function s(s){var o=t,a=n,l=o+(s.data.$.screenX-r)*(f=="rtl"?-1:1),s=a+(s.data.$.screenY-i);c&&(o=Math.max(u.resize_minWidth,Math.min(l,u.resize_maxWidth))),h&&(a=Math.max(u.resize_minHeight,Math.min(s,u.resize_maxHeight))),e.resize(c?o:null,a)}function o(){CKEDITOR.document.removeListener("mousemove",s),CKEDITOR.document.removeListener("mouseup",o),e.document&&(e.document.removeListener("mousemove",s),e.document.removeListener("mouseup",o))}var t,n,r,i,u=e.config,a=e.ui.spaceId("resizer"),f=e.element?e.element.getDirection(1):"ltr";!u.resize_dir&&(u.resize_dir="vertical"),u.resize_maxWidth===void 0&&(u.resize_maxWidth=3e3),u.resize_maxHeight===void 0&&(u.resize_maxHeight=3e3),u.resize_minWidth===void 0&&(u.resize_minWidth=750),u.resize_minHeight===void 0&&(u.resize_minHeight=250);if(u.resize_enabled!==!1){var l=null,c=(u.resize_dir=="both"||u.resize_dir=="horizontal")&&u.resize_minWidth!=u.resize_maxWidth,h=(u.resize_dir=="both"||u.resize_dir=="vertical")&&u.resize_minHeight!=u.resize_maxHeight,p=CKEDITOR.tools.addFunction(function(a){l||(l=e.getResizable()),t=l.$.offsetWidth||0,n=l.$.offsetHeight||0,r=a.screenX,i=a.screenY,u.resize_minWidth>t&&(u.resize_minWidth=t),u.resize_minHeight>n&&(u.resize_minHeight=n),CKEDITOR.document.on("mousemove",s),CKEDITOR.document.on("mouseup",o),e.document&&(e.document.on("mousemove",s),e.document.on("mouseup",o)),a.preventDefault&&a.preventDefault()});e.on("destroy",function(){CKEDITOR.tools.removeFunction(p)}),e.on("uiSpace",function(t){if(t.data.space=="bottom"){var n="";c&&!h&&(n=" cke_resizer_horizontal"),!c&&h&&(n=" cke_resizer_vertical");var r='<span id="'+a+'" class="cke_resizer'+n+" cke_resizer_"+f+'" title="'+CKEDITOR.tools.htmlEncode(e.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+p+', event)">'+(f=="ltr"?"◢":"◣")+"</span>";f=="ltr"&&n=="ltr"?t.data.html=t.data.html+r:t.data.html=r+t.data.html}},e,null,100),e.on("maximize",function(t){e.ui.space("resizer")[t.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}}),CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var e=function(e){var t=this._,n=t.menu;t.state!==CKEDITOR.TRISTATE_DISABLED&&(t.on&&n?n.hide():(t.previousState=t.state,n||(n=t.menu=new CKEDITOR.menu(e,{panel:{className:"cke_menu_panel",attributes:{"aria-label":e.lang.common.options}}}),n.onHide=CKEDITOR.tools.bind(function(){var n=this.command?e.getCommand(this.command).modes:this.modes;this.setState(!n||n[e.mode]?t.previousState:CKEDITOR.TRISTATE_DISABLED),t.on=0},this),this.onMenu&&n.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),t.on=1,setTimeout(function(){n.show(CKEDITOR.document.getById(t.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(t){delete t.panel,this.base(t),this.hasArrow=!0,this.click=e},statics:{handler:{create:function(e){return new CKEDITOR.ui.menuButton(e)}}}})},beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}}),CKEDITOR.UI_MENUBUTTON="menubutton","use strict",CKEDITOR.plugins.add("scayt",{requires:"menubutton,dialog",tabToOpen:null,dialogName:"scaytDialog",init:function(e){var t=this,n=CKEDITOR.plugins.scayt;this.bindEvents(e),this.parseConfig(e),this.addRule(e),CKEDITOR.dialog.add(this.dialogName,CKEDITOR.getUrl(this.path+"dialogs/options.js")),this.addMenuItems(e);var r=e.lang.scayt,i=CKEDITOR.env;e.ui.add("Scayt",CKEDITOR.UI_MENUBUTTON,{label:r.text_title,title:e.plugins.wsc?e.lang.wsc.title:r.text_title,modes:{wysiwyg:!i.ie||!(i.version<8||i.quirks)},toolbar:"spellchecker,20",refresh:function(){var t=e.ui.instances.Scayt.getState();e.scayt&&(t=n.state[e.name]?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),e.fire("scaytButtonState",t)},onRender:function(){var t=this;e.on("scaytButtonState",function(e){typeof e.data!==void 0&&t.setState(e.data)})},onMenu:function(){var t=e.scayt;return e.getMenuItem("scaytToggle").label=e.lang.scayt[t&&n.state[e.name]?"btn_disable":"btn_enable"],t={scaytToggle:CKEDITOR.TRISTATE_OFF,scaytOptions:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytLangs:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytDict:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:t?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,WSC:e.plugins.wsc?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED},e.config.scayt_uiTabs[0]||delete t.scaytOptions,e.config.scayt_uiTabs[1]||delete t.scaytLangs,e.config.scayt_uiTabs[2]||delete t.scaytDict,t}}),e.contextMenu&&e.addMenuItems&&(e.contextMenu.addListener(function(){var n=e.scayt,r;if(n){var i=n.getSelectionNode();if(i=i?i.getAttribute(n.getNodeAttribute()):i)r=t.menuGenerator(e,i,t),n.showBanner("."+e.contextMenu._.definition.panel.className.split(" ").join(" ."))}return r}),e.contextMenu._.onHide=CKEDITOR.tools.override(e.contextMenu._.onHide,function(t){return function(){var n=e.scayt;return n&&n.hideBanner(),t.apply(this)}}))},addMenuItems:function(e){var t=this,n=CKEDITOR.plugins.scayt;e.addMenuGroup("scaytButton");var r=e.config.scayt_contextMenuItemsOrder.split("|");if(r&&r.length)for(var i=0;i<r.length;i++)e.addMenuGroup("scayt_"+r[i],i-10);r={scaytToggle:{label:e.lang.scayt.btn_enable,group:"scaytButton",onClick:function(){var t=e.scayt;n.state[e.name]=!n.state[e.name],n.state[e.name]===!0?t||n.createScayt(e):t&&n.destroy(e)}},scaytAbout:{label:e.lang.scayt.btn_about,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="about",e.lockSelection(),e.openDialog(t.dialogName)}},scaytOptions:{label:e.lang.scayt.btn_options,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="options",e.lockSelection(),e.openDialog(t.dialogName)}},scaytLangs:{label:e.lang.scayt.btn_langs,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="langs",e.lockSelection(),e.openDialog(t.dialogName)}},scaytDict:{label:e.lang.scayt.btn_dictionaries,group:"scaytButton",onClick:function(){e.scayt.tabToOpen="dictionaries",e.lockSelection(),e.openDialog(t.dialogName)}}},e.plugins.wsc&&(r.WSC={label:e.lang.wsc.toolbar,group:"scaytButton",onClick:function(){var t=CKEDITOR.plugins.scayt,n=e.scayt,r=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.container.getText():e.document.getBody().getText();(r=r.replace(/\s/g,""))?(n&&t.state[e.name]&&n.setMarkupPaused&&n.setMarkupPaused(!0),e.lockSelection(),e.execCommand("checkspell")):alert("Nothing to check!")}}),e.addMenuItems(r)},bindEvents:function(e){function t(){var t=e.scayt;t&&(t.removeMarkupInSelectionNode(),t.fire("startSpellCheck"))}var n=CKEDITOR.plugins.scayt,r=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE;CKEDITOR.on("dialogDefinition",function(e){e.data.name==="scaytDialog"&&e.data.definition.dialog.on("cancel",function(){return!1},this,null,-1)});var i=function(){e.scayt&&n.destroy(e)},s=function(){n.state[e.name]&&!e.readOnly&&n.createScayt(e)},o=function(){var t=e.editable();t.attachListener(t,"focus",function(){var t=CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state[e.name]&&e.scayt,n,i;if((r||t)&&e._.savedSelection)for(var t=e._.savedSelection.getSelectedElement(),t=!t&&e._.savedSelection.getRanges(),s=0;s<t.length;s++)i=t[s],n=i.startContainer.getText().length,(n<i.startOffset||n<i.endOffset)&&e.unlockSelection(!1)},this,null,-10)},u=function(){r?(e.on("blur",i),e.on("focus",s),e.focusManager.hasFocus&&s()):s(),o()};e.on("contentDom",u),e.on("beforeCommandExec",function(t){var r;if(t.data.name in n.options.disablingCommandExec&&e.mode=="wysiwyg"){if(r=e.scayt)n.destroy(e),e.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED)}else if(t.data.name==="bold"||t.data.name==="italic"||t.data.name==="underline"||t.data.name==="strike"||t.data.name==="subscript"||t.data.name==="superscript")if(r=e.scayt)r.removeMarkupInSelectionNode(),setTimeout(function(){r.fire("startSpellCheck")},0)}),e.on("beforeSetMode",function(t){if(t.data=="source"){if(t=e.scayt)n.destroy(e),e.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED);e.document&&(e.document.getBody().removeAttribute("_jquid"),e.document.getBody().removeAttribute("dir"))}}),e.on("afterCommandExec",function(t){var n;e.mode=="wysiwyg"&&(t.data.name=="undo"||t.data.name=="redo")&&(n=e.scayt)&&setTimeout(function(){n.fire("startSpellCheck")},250)}),e.on("readOnly",function(t){var r;t&&(r=e.scayt,t.editor.readOnly===!0?r&&r.fire("removeMarkupInDocument",{}):r?r.fire("startSpellCheck"):t.editor.mode=="wysiwyg"&&n.state[t.editor.name]===!0&&(n.createScayt(e),t.editor.fire("scaytButtonState",CKEDITOR.TRISTATE_ON)))}),e.on("beforeDestroy",i),e.on("setData",function(){i(),e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&u()},this,null,50),e.on("insertElement",function(){CKEDITOR.env.ie?setTimeout(function(){t()},50):t()},this,null,50),e.on("insertHtml",function(){t()},this,null,50),e.on("insertText",function(){t()},this,null,50),e.on("scaytDialogShown",function(t){t.data.selectPage(e.scayt.tabToOpen)})},parseConfig:function(e){var t=CKEDITOR.plugins.scayt;t.replaceOldOptionsNames(e.config),typeof e.config.scayt_autoStartup!="boolean"&&(e.config.scayt_autoStartup=!1),t.state[e.name]=e.config.scayt_autoStartup,e.config.scayt_contextCommands||(e.config.scayt_contextCommands="ignore|ignoreall|add"),e.config.scayt_contextMenuItemsOrder||(e.config.scayt_contextMenuItemsOrder="suggest|moresuggest|control"),e.config.scayt_sLang||(e.config.scayt_sLang="en_US");if(e.config.scayt_maxSuggestions===void 0||typeof e.config.scayt_maxSuggestions!="number"||e.config.scayt_maxSuggestions<0)e.config.scayt_maxSuggestions=5;if(e.config.scayt_customDictionaryIds===void 0||typeof e.config.scayt_customDictionaryIds!="string")e.config.scayt_customDictionaryIds="";if(e.config.scayt_userDictionaryName===void 0||typeof e.config.scayt_userDictionaryName!="string")e.config.scayt_userDictionaryName=null;if(typeof e.config.scayt_uiTabs=="string"&&e.config.scayt_uiTabs.split(",").length===3){var n=[],r=[];e.config.scayt_uiTabs=e.config.scayt_uiTabs.split(","),CKEDITOR.tools.search(e.config.scayt_uiTabs,function(e){Number(e)===1||Number(e)===0?(r.push(!0),n.push(Number(e))):r.push(!1)}),e.config.scayt_uiTabs=CKEDITOR.tools.search(r,!1)===null?n:[1,1,1]}else e.config.scayt_uiTabs=[1,1,1];typeof e.config.scayt_serviceProtocol!="string"&&(e.config.scayt_serviceProtocol=null),typeof e.config.scayt_serviceHost!="string"&&(e.config.scayt_serviceHost=null),typeof e.config.scayt_servicePort!="string"&&(e.config.scayt_servicePort=null),typeof e.config.scayt_servicePath!="string"&&(e.config.scayt_servicePath=null),e.config.scayt_moreSuggestions||(e.config.scayt_moreSuggestions="on"),typeof e.config.scayt_customerId!="string"&&(e.config.scayt_customerId="1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2"),typeof e.config.scayt_srcUrl!="string"&&(t=document.location.protocol,t=t.search(/https?:/)!=-1?t:"http:",e.config.scayt_srcUrl=t+"//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js"),typeof CKEDITOR.config.scayt_handleCheckDirty!="boolean"&&(CKEDITOR.config.scayt_handleCheckDirty=!0),typeof CKEDITOR.config.scayt_handleUndoRedo!="boolean"&&(CKEDITOR.config.scayt_handleUndoRedo=!0);if(e.config.scayt_disableOptionsStorage){var t=CKEDITOR.tools.isArray(e.config.scayt_disableOptionsStorage)?e.config.scayt_disableOptionsStorage:typeof e.config.scayt_disableOptionsStorage=="string"?[e.config.scayt_disableOptionsStorage]:void 0,i=["all","options","lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],s=["lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],o=CKEDITOR.tools.search,u=CKEDITOR.tools.indexOf;e.config.scayt_disableOptionsStorage=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],a=!!o(e,"options");if(!o(i,r)||a&&o(s,function(e){if(e==="lang")return!1}))return;o(s,r)&&s.splice(u(s,r),1);if(r==="all"||a&&o(e,"lang"))return[];r==="options"&&(s=["lang"])}return t=t.concat(s)}(t)}},addRule:function(e){var t=e.dataProcessor,n=t&&t.htmlFilter,r=e._.elementsPath&&e._.elementsPath.filters,t=t&&t.dataFilter,i=e.addRemoveFormatFilter,s=function(t){var n=CKEDITOR.plugins.scayt;if(e.scayt&&t.hasAttribute(n.options.data_attribute_name))return!1},o=function(t){var n=CKEDITOR.plugins.scayt,r=!0;return e.scayt&&t.hasAttribute(n.options.data_attribute_name)&&(r=!1),r};r&&r.push(s),t&&t.addRules({elements:{span:function(t){var n=CKEDITOR.plugins.scayt;return n&&n.state[e.name]&&t.classes&&CKEDITOR.tools.search(t.classes,n.options.misspelled_word_class)&&(t.classes&&t.parent.type===CKEDITOR.NODE_DOCUMENT_FRAGMENT?(delete t.attributes.style,delete t.name):delete t.classes[CKEDITOR.tools.indexOf(t.classes,n.options.misspelled_word_class)]),t}}}),n&&n.addRules({elements:{span:function(t){var n=CKEDITOR.plugins.scayt;return n&&n.state[e.name]&&t.hasClass(n.options.misspelled_word_class)&&t.attributes[n.options.data_attribute_name]&&(t.removeClass(n.options.misspelled_word_class),delete t.attributes[n.options.data_attribute_name],delete t.name),t}}}),i&&i.call(e,o)},scaytMenuDefinition:function(e){var t=this,e=e.scayt;return{scayt_ignore:{label:e.getLocal("btn_ignore"),group:"scayt_control",order:1,exec:function(e){e.scayt.ignoreWord()}},scayt_ignoreall:{label:e.getLocal("btn_ignoreAll"),group:"scayt_control",order:2,exec:function(e){e.scayt.ignoreAllWords()}},scayt_add:{label:e.getLocal("btn_addWord"),group:"scayt_control",order:3,exec:function(e){var t=e.scayt;setTimeout(function(){t.addWordToUserDictionary()},10)}},option:{label:e.getLocal("btn_options"),group:"scayt_control",order:4,exec:function(e){e.scayt.tabToOpen="options",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return e.config.scayt_uiTabs[0]==1?!0:!1}},language:{label:e.getLocal("btn_langs"),group:"scayt_control",order:5,exec:function(e){e.scayt.tabToOpen="langs",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return e.config.scayt_uiTabs[1]==1?!0:!1}},dictionary:{label:e.getLocal("btn_dictionaries"),group:"scayt_control",order:6,exec:function(e){e.scayt.tabToOpen="dictionaries",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return e.config.scayt_uiTabs[2]==1?!0:!1}},about:{label:e.getLocal("btn_about"),group:"scayt_control",order:7,exec:function(e){e.scayt.tabToOpen="about",e.lockSelection(),e.openDialog(t.dialogName)}}}},buildSuggestionMenuItems:function(e,t){var n={},r={},i=e.scayt;if(t.length>0&&t[0]!=="no_any_suggestions")for(var s=0;s<t.length;s++){var o="scayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[s].replace(" ","_");e.addCommand(o,this.createCommand(CKEDITOR.plugins.scayt.suggestions[s])),s<e.config.scayt_maxSuggestions?(e.addMenuItem(o,{label:t[s],command:o,group:"scayt_suggest",order:s+1}),n[o]=CKEDITOR.TRISTATE_OFF):(e.addMenuItem(o,{label:t[s],command:o,group:"scayt_moresuggest",order:s+1}),r[o]=CKEDITOR.TRISTATE_OFF,e.config.scayt_moreSuggestions==="on"&&(e.addMenuItem("scayt_moresuggest",{label:i.getLocal("btn_moreSuggestions"),group:"scayt_moresuggest",order:10,getItems:function(){return r}}),n.scayt_moresuggest=CKEDITOR.TRISTATE_OFF))}else n.no_scayt_suggest=CKEDITOR.TRISTATE_DISABLED,e.addCommand("no_scayt_suggest",{exec:function(){}}),e.addMenuItem("no_scayt_suggest",{label:i.getLocal("btn_noSuggestions")||"no_scayt_suggest",command:"no_scayt_suggest",group:"scayt_suggest",order:0});return n},menuGenerator:function(e,t){var n=e.scayt,r=this.scaytMenuDefinition(e),i={},s=e.config.scayt_contextCommands.split("|");n.fire("getSuggestionsList",{lang:n.getLang(),word:t}),i=this.buildSuggestionMenuItems(e,CKEDITOR.plugins.scayt.suggestions);if(e.config.scayt_contextCommands=="off")return i;for(var o in r)if(CKEDITOR.tools.indexOf(s,o.replace("scayt_",""))!=-1||e.config.scayt_contextCommands=="all")i[o]=CKEDITOR.TRISTATE_OFF,typeof r[o].verification=="function"&&!r[o].verification(e)&&delete i[o],e.addCommand(o,{exec:r[o].exec}),e.addMenuItem(o,{label:e.lang.scayt[r[o].label]||r[o].label,command:o,group:r[o].group,order:r[o].order});return i},createCommand:function(e){return{exec:function(t){t.scayt.replaceSelectionNode({word:e})}}}}),CKEDITOR.plugins.scayt={state:{},suggestions:[],loadingHelper:{loadOrder:[]},isLoading:!1,options:{disablingCommandExec:{source:!0,newpage:!0,templates:!0},data_attribute_name:"data-scayt-word",misspelled_word_class:"scayt-misspell-word"},backCompatibilityMap:{scayt_service_protocol:"scayt_serviceProtocol",scayt_service_host:"scayt_serviceHost",scayt_service_port:"scayt_servicePort",scayt_service_path:"scayt_servicePath",scayt_customerid:"scayt_customerId"},replaceOldOptionsNames:function(e){for(var t in e)t in this.backCompatibilityMap&&(e[this.backCompatibilityMap[t]]=e[t],delete e[t])},createScayt:function(e){var t=this;this.loadScaytLibrary(e,function(e){var n={lang:e.config.scayt_sLang,container:e.editable().$.nodeName=="BODY"?e.document.getWindow().$.frameElement:e.editable().$,customDictionary:e.config.scayt_customDictionaryIds,userDictionaryName:e.config.scayt_userDictionaryName,localization:e.langCode,customer_id:e.config.scayt_customerId,debug:e.config.scayt_debug,data_attribute_name:t.options.data_attribute_name,misspelled_word_class:t.options.misspelled_word_class,"options-to-restore":e.config.scayt_disableOptionsStorage,focused:e.editable().hasFocus,ignoreElementsRegex:e.config.scayt_elementsToIgnore};e.config.scayt_serviceProtocol&&(n.service_protocol=e.config.scayt_serviceProtocol),e.config.scayt_serviceHost&&(n.service_host=e.config.scayt_serviceHost),e.config.scayt_servicePort&&(n.service_port=e.config.scayt_servicePort),e.config.scayt_servicePath&&(n.service_path=e.config.scayt_servicePath),n=new SCAYT.CKSCAYT(n,function(){},function(){}),n.subscribe("suggestionListSend",function(e){for(var t={},n=[],r=0;r<e.suggestionList.length;r++)t["word_"+e.suggestionList[r]]||(t["word_"+e.suggestionList[r]]=e.suggestionList[r],n.push(e.suggestionList[r]));CKEDITOR.plugins.scayt.suggestions=n}),e.scayt=n,e.fire("scaytButtonState",e.readOnly?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_ON)})},destroy:function(e){e.scayt&&e.scayt.destroy(),delete e.scayt,e.fire("scaytButtonState",CKEDITOR.TRISTATE_OFF)},loadScaytLibrary:function(e,t){var n=this;typeof window.SCAYT=="undefined"||typeof window.SCAYT.CKSCAYT!="function"?(this.loadingHelper[e.name]=t,this.loadingHelper.loadOrder.push(e.name),CKEDITOR.scriptLoader.load(e.config.scayt_srcUrl,function(){var e;CKEDITOR.fireOnce("scaytReady");for(var t=0;t<n.loadingHelper.loadOrder.length;t++)e=n.loadingHelper.loadOrder[t],typeof n.loadingHelper[e]=="function"&&n.loadingHelper[e](CKEDITOR.instances[e]),delete n.loadingHelper[e];n.loadingHelper.loadOrder=[]})):window.SCAYT&&typeof window.SCAYT.CKSCAYT=="function"&&(CKEDITOR.fireOnce("scaytReady"),e.scayt||typeof t=="function"&&t(e))}},CKEDITOR.on("scaytReady",function(){if(CKEDITOR.config.scayt_handleCheckDirty===!0){var e=CKEDITOR.editor.prototype;e.checkDirty=CKEDITOR.tools.override(e.checkDirty,function(e){return function(){var t=null,n=this.scayt;if(!CKEDITOR.plugins.scayt||!CKEDITOR.plugins.scayt.state[this.name]||!this.scayt)t=e.call(this);else if(t=this.status=="ready")var r=n.removeMarkupFromString(this.getSnapshot()),n=n.removeMarkupFromString(this._.previousValue),t=t&&n!==r;return t}}),e.resetDirty=CKEDITOR.tools.override(e.resetDirty,function(e){return function(){var t=this.scayt;!CKEDITOR.plugins.scayt||!CKEDITOR.plugins.scayt.state[this.name]||!this.scayt?e.call(this):this._.previousValue=t.removeMarkupFromString(this.getSnapshot())}})}if(CKEDITOR.config.scayt_handleUndoRedo===!0){var e=CKEDITOR.plugins.undo.Image.prototype,t=typeof e.equalsContent=="function"?"equalsContent":"equals";e[t]=CKEDITOR.tools.override(e[t],function(e){return function(t){var n=t.editor.scayt,r=this.contents,i=t.contents,s=null;return CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state[t.editor.name]&&t.editor.scayt&&(this.contents=n.removeMarkupFromString(r)||"",t.contents=n.removeMarkupFromString(i)||""),s=e.apply(this,arguments),this.contents=r,t.contents=i,s}})}}),function(){var e={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(e){this.toggleState(),this.refresh(e)},refresh:function(e){if(e.document){var t=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";e.editable()[t]("cke_show_borders")}}};CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var e;e=(CKEDITOR.env.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:[".%1 table.%2,",".%1 table.%2 > tr > td, .%1 table.%2 > tr > th,",".%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,",".%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,",".%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th","{","border : #d3d3d3 1px dotted","}"]).join("").replace(/%2/g,"cke_show_border").replace(/%1/g,"cke_show_borders "),CKEDITOR.addCss(e)},init:function(t){var n=t.addCommand("showborders",e);n.canUndo=!1,t.config.startupShowBorders!==!1&&n.setState(CKEDITOR.TRISTATE_ON),t.on("mode",function(){n.state!=CKEDITOR.TRISTATE_DISABLED&&n.refresh(t)},null,null,100),t.on("contentDom",function(){n.state!=CKEDITOR.TRISTATE_DISABLED&&n.refresh(t)}),t.on("removeFormatCleanup",function(e){e=e.data,t.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&e.is("table")&&(!e.hasAttribute("border")||parseInt(e.getAttribute("border"),10)<=0)&&e.addClass("cke_show_border")})},afterInit:function(e){var t=e.dataProcessor,e=t&&t.dataFilter,t=t&&t.htmlFilter;e&&e.addRules({elements:{table:function(e){var e=e.attributes,t=e["class"],n=parseInt(e.border,10);(!n||n<=0)&&(!t||t.indexOf("cke_show_border")==-1)&&(e["class"]=(t||"")+" cke_show_border")}}}),t&&t.addRules({elements:{table:function(e){var e=e.attributes,t=e["class"];t&&(e["class"]=t.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/,""))}}})}}),CKEDITOR.on("dialogDefinition",function(e){var t=e.data.name;if(t=="table"||t=="tableProperties"){e=e.data.definition,t=e.getContents("info").get("txtBorder"),t.commit=CKEDITOR.tools.override(t.commit,function(e){return function(t,n){e.apply(this,arguments);var r=parseInt(this.getValue(),10);n[!r||r<=0?"addClass":"removeClass"]("cke_show_border")}});if(e=(e=e.getContents("advanced"))&&e.get("advCSSClasses"))e.setup=CKEDITOR.tools.override(e.setup,function(e){return function(){e.apply(this,arguments),this.setValue(this.getValue().replace(/cke_show_border/,""))}}),e.commit=CKEDITOR.tools.override(e.commit,function(e){return function(t,n){e.apply(this,arguments),parseInt(n.getAttribute("border"),10)||n.addClass("cke_show_border")}})}})}(),function(){CKEDITOR.plugins.add("sourcearea",{init:function(t){function n(){var e=i&&this.equals(CKEDITOR.document.getActive());this.hide(),this.setStyle("height",this.getParent().$.clientHeight+"px"),this.setStyle("width",this.getParent().$.clientWidth+"px"),this.show(),e&&this.focus()}if(t.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var r=CKEDITOR.plugins.sourcearea;t.addMode("source",function(r){var i=t.ui.space("contents").getDocument().createElement("textarea");i.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",t.config.sourceAreaTabSize||4))),i.setAttribute("dir","ltr"),i.addClass("cke_source cke_reset cke_enable_context_menu"),t.ui.space("contents").append(i),i=t.editable(new e(t,i)),i.setData(t.getData(1)),CKEDITOR.env.ie&&(i.attachListener(t,"resize",n,i),i.attachListener(CKEDITOR.document.getWindow(),"resize",n,i),CKEDITOR.tools.setTimeout(n,0,i)),t.fire("ariaWidget",this),r()}),t.addCommand("source",r.commands.source),t.ui.addButton&&t.ui.addButton("Source",{label:t.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"}),t.on("mode",function(){t.getCommand("source").setState(t.mode=="source"?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var i=CKEDITOR.env.ie&&CKEDITOR.env.version==9}}});var e=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(e){this.setValue(e),this.status="ready",this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(e){this[(e?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){e.baseProto.detach.call(this),this.clearCustomData(),this.remove()}}})}(),CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(e){e.mode=="wysiwyg"&&e.fire("saveSnapshot"),e.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED),e.setMode(e.mode=="source"?"wysiwyg":"source")},canUndo:!1}}},CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,en:1,"en-gb":1,eo:1,es:1,et:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,pl:1,pt:1,"pt-br":1,ru:1,si:1,sk:1,sl:1,sq:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(e){var t=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js"),e.addCommand("specialchar",{exec:function(){var n=e.langCode,n=t.availableLangs[n]?n:t.availableLangs[n.replace(/-.*/,"")]?n.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(t.path+"dialogs/lang/"+n+".js"),function(){CKEDITOR.tools.extend(e.lang.specialchar,t.langEntries[n]),e.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1}),e.ui.addButton&&e.ui.addButton("SpecialChar",{label:e.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}}),CKEDITOR.config.specialChars="! &quot; # $ % &amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ &euro; &lsquo; &rsquo; &ldquo; &rdquo; &ndash; &mdash; &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml; &copy; &ordf; &laquo; &not; &reg; &macr; &deg; &sup2; &sup3; &acute; &micro; &para; &middot; &cedil; &sup1; &ordm; &raquo; &frac14; &frac12; &frac34; &iquest; &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &times; &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; &divide; &oslash; &ugrave; &uacute; &ucirc; &uuml; &yacute; &thorn; &yuml; &OElig; &oelig; &#372; &#374 &#373 &#375; &sbquo; &#8219; &bdquo; &hellip; &trade; &#9658; &bull; &rarr; &rArr; &hArr; &diams; &asymp;".split(" "),function(){CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(e){var t=e.config,n=e.lang.stylescombo,r={},i=[],s=[];e.on("stylesSet",function(n){if(n=n.data.styles){for(var o,u,f,l=0,h=n.length;l<h;l++){o=n[l];if(!(e.blockless&&o.element in CKEDITOR.dtd.$block)){u=o.name,o=new CKEDITOR.style(o);if(!e.filter.customConfig||e.filter.check(o))o._name=u,o._.enterMode=t.enterMode,o._.type=f=o.assignedTo||o.type,o._.weight=l+(f==CKEDITOR.STYLE_OBJECT?1:f==CKEDITOR.STYLE_BLOCK?2:3)*1e3,r[u]=o,i.push(o),s.push(o)}}i.sort(function(e,t){return e._.weight-t._.weight})}}),e.ui.addRichCombo("Styles",{label:n.label,title:n.panelTitle,toolbar:"styles,10",allowedContent:s,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(t.contentsCss),multiSelect:!0,attributes:{"aria-label":n.panelTitle}},init:function(){var e,t,r,s,o,u;o=0;for(u=i.length;o<u;o++)e=i[o],t=e._name,s=e._.type,s!=r&&(this.startGroup(n["panelTitle"+s]),r=s),this.add(t,e.type==CKEDITOR.STYLE_OBJECT?t:e.buildPreview(),t);this.commit()},onClick:function(t){e.focus(),e.fire("saveSnapshot");var t=r[t],n=e.elementPath();e[t.checkActive(n,e)?"removeStyle":"applyStyle"](t),e.fire("saveSnapshot")},onRender:function(){e.on("selectionChange",function(t){for(var n=this.getValue(),t=t.data.path.elements,i=0,s=t.length,o;i<s;i++){o=t[i];for(var u in r)if(r[u].checkElementRemovable(o,!0,e)){u!=n&&this.setValue(u);return}}this.setValue("")},this)},onOpen:function(){var t=e.getSelection().getSelectedElement(),t=e.elementPath(t),i=[0,0,0,0];this.showAll(),this.unmarkAll();for(var s in r){var o=r[s],u=o._.type;o.checkApplicable(t,e,e.activeFilter)?i[u]++:this.hideItem(s),o.checkActive(t,e)&&this.mark(s)}i[CKEDITOR.STYLE_BLOCK]||this.hideGroup(n["panelTitle"+CKEDITOR.STYLE_BLOCK]),i[CKEDITOR.STYLE_INLINE]||this.hideGroup(n["panelTitle"+CKEDITOR.STYLE_INLINE]),i[CKEDITOR.STYLE_OBJECT]||this.hideGroup(n["panelTitle"+CKEDITOR.STYLE_OBJECT])},refresh:function(){var t=e.elementPath();if(t){for(var n in r)if(r[n].checkApplicable(t,e,e.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){r={},i=[]}})}})}(),function(){function e(e){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(t){if(t.editable().hasFocus){var n=t.getSelection(),r;if(r=(new CKEDITOR.dom.elementPath(n.getCommonAncestor(),n.root)).contains({td:1,th:1},1)){var n=t.createRange(),i=CKEDITOR.tools.tryThese(function(){var t=r.getParent().$.cells[r.$.cellIndex+(e?-1:1)];return t.parentNode.parentNode,t},function(){var t=r.getParent(),t=t.getAscendant("table").$.rows[t.$.rowIndex+(e?-1:1)];return t.cells[e?t.cells.length-1:0]});if(!i&&!e){for(var s=r.getAscendant("table").$,i=r.getParent().$.cells,s=new CKEDITOR.dom.element(s.insertRow(-1),t.document),o=0,u=i.length;o<u;o++)s.append((new CKEDITOR.dom.element(i[o],t.document)).clone(!1,!1)).appendBogus();n.moveToElementEditStart(s)}else{if(!i)return!0;i=new CKEDITOR.dom.element(i),n.moveToElementEditStart(i),(!n.checkStartOfBlock()||!n.checkEndOfBlock())&&n.selectNodeContents(i)}return n.select(!0),!0}}return!1}}}var t={editorFocus:!1,modes:{wysiwyg:1,source:1}},n={exec:function(e){e.container.focusNext(!0,e.tabIndex)}},r={exec:function(e){e.container.focusPrevious(!0,e.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(i){for(var s=i.config.enableTabKeyTools!==!1,o=i.config.tabSpaces||0,u="";o--;)u+=" ";u&&i.on("key",function(e){e.data.keyCode==9&&(i.insertText(u),e.cancel())}),s&&i.on("key",function(e){(e.data.keyCode==9&&i.execCommand("selectNextCell")||e.data.keyCode==CKEDITOR.SHIFT+9&&i.execCommand("selectPreviousCell"))&&e.cancel()}),i.addCommand("blur",CKEDITOR.tools.extend(n,t)),i.addCommand("blurBack",CKEDITOR.tools.extend(r,t)),i.addCommand("selectNextCell",e()),i.addCommand("selectPreviousCell",e(!0))}})}(),CKEDITOR.dom.element.prototype.focusNext=function(e,t){var n=t===void 0?this.getTabIndex():t,r,i,s,o,u,a;if(n<=0)for(u=this.getNextSourceNode(e,CKEDITOR.NODE_ELEMENT);u;){if(u.isVisible()&&u.getTabIndex()===0){s=u;break}u=u.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(u=this.getDocument().getBody().getFirst();u=u.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!r)if(!i&&u.equals(this)){i=!0;if(e){if(!(u=u.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;r=1}}else i&&!this.contains(u)&&(r=1);if(u.isVisible()&&!((a=u.getTabIndex())<0)){if(r&&a==n){s=u;break}a>n&&(!s||!o||a<o)?(s=u,o=a):!s&&a===0&&(s=u,o=a)}}s&&s.focus()},CKEDITOR.dom.element.prototype.focusPrevious=function(e,t){for(var n=t===void 0?this.getTabIndex():t,r,i,s,o=0,u,a=this.getDocument().getBody().getLast();a=a.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!r)if(!i&&a.equals(this)){i=!0;if(e){if(!(a=a.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;r=1}}else i&&!this.contains(a)&&(r=1);if(a.isVisible()&&!((u=a.getTabIndex())<0))if(n<=0){if(r&&u===0){s=a;break}u>o&&(s=a,o=u)}else{if(r&&u==n){s=a;break}u<n&&(!s||u>o)&&(s=a,o=u)}}s&&s.focus()},CKEDITOR.plugins.add("table",{requires:"dialog",init:function(e){function t(e){return CKEDITOR.tools.extend(e||{},{contextSensitive:1,refresh:function(e,t){this.setState(t.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!e.blockless){var n=e.lang.table;e.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];"+(e.plugins.dialogadvtab?"table"+e.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"]]})),e.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",t())),e.addCommand("tableDelete",t({exec:function(e){var t=e.elementPath().contains("table",1);if(t){var n=t.getParent(),r=e.editable();n.getChildCount()==1&&!n.is("td","th")&&!n.equals(r)&&(t=n),e=e.createRange(),e.moveToPosition(t,CKEDITOR.POSITION_BEFORE_START),t.remove(),e.select()}}})),e.ui.addButton&&e.ui.addButton("Table",{label:n.toolbar,command:"table",toolbar:"insert,30"}),CKEDITOR.dialog.add("table",this.path+"dialogs/table.js"),CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js"),e.addMenuItems&&e.addMenuItems({table:{label:n.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:n.deleteTable,command:"tableDelete",group:"table",order:1}}),e.on("doubleclick",function(e){e.data.element.is("table")&&(e.data.dialog="tableProperties")}),e.contextMenu&&e.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}}),function(){function e(e){function t(e){!(n.length>0)&&e.type==CKEDITOR.NODE_ELEMENT&&h.test(e.getName())&&!e.getCustomData("selected_cell")&&(CKEDITOR.dom.element.setMarker(r,e,"selected_cell",!0),n.push(e))}for(var e=e.getRanges(),n=[],r={},i=0;i<e.length;i++){var s=e[i];if(s.collapsed)s=s.getCommonAncestor(),(s=s.getAscendant("td",!0)||s.getAscendant("th",!0))&&n.push(s);else{var s=new CKEDITOR.dom.walker(s),o;for(s.guard=t;o=s.next();)(o.type!=CKEDITOR.NODE_ELEMENT||!o.is(CKEDITOR.dtd.table))&&(o=o.getAscendant("td",!0)||o.getAscendant("th",!0))&&!o.getCustomData("selected_cell")&&(CKEDITOR.dom.element.setMarker(r,o,"selected_cell",!0),n.push(o))}}return CKEDITOR.dom.element.clearAllMarkers(r),n}function t(t,n){for(var r=e(t),i=r[0],s=i.getAscendant("table"),i=i.getDocument(),o=r[0].getParent(),u=o.$.rowIndex,r=r[r.length-1],a=r.getParent().$.rowIndex+r.$.rowSpan-1,r=new CKEDITOR.dom.element(s.$.rows[a]),u=n?u:a,o=n?o:r,r=CKEDITOR.tools.buildTableMap(s),s=r[u],u=n?r[u-1]:r[u+1],r=r[0].length,i=i.createElement("tr"),a=0;s[a]&&a<r;a++){var f;s[a].rowSpan>1&&u&&s[a]==u[a]?(f=s[a],f.rowSpan=f.rowSpan+1):(f=(new CKEDITOR.dom.element(s[a])).clone(),f.removeAttribute("rowSpan"),f.appendBogus(),i.append(f),f=f.$),a+=f.colSpan-1}n?i.insertBefore(o):i.insertAfter(o)}function n(t){if(t instanceof CKEDITOR.dom.selection){for(var r=e(t),i=r[0].getAscendant("table"),s=CKEDITOR.tools.buildTableMap(i),t=r[0].getParent().$.rowIndex,r=r[r.length-1],o=r.getParent().$.rowIndex+r.$.rowSpan-1,r=[],u=t;u<=o;u++){for(var a=s[u],f=new CKEDITOR.dom.element(i.$.rows[u]),l=0;l<a.length;l++){var c=new CKEDITOR.dom.element(a[l]),h=c.getParent().$.rowIndex;c.$.rowSpan==1?c.remove():(c.$.rowSpan=c.$.rowSpan-1,h==u&&(h=s[u+1],h[l-1]?c.insertAfter(new CKEDITOR.dom.element(h[l-1])):(new CKEDITOR.dom.element(i.$.rows[u+1])).append(c,1))),l+=c.$.colSpan-1}r.push(f)}s=i.$.rows,i=new CKEDITOR.dom.element(s[o+1]||(t>0?s[t-1]:null)||i.$.parentNode);for(u=r.length;u>=0;u--)n(r[u]);return i}return t instanceof CKEDITOR.dom.element&&(i=t.getAscendant("table"),i.$.rows.length==1?i.remove():t.remove()),null}function r(e,t){for(var n=t?Infinity:0,r=0;r<e.length;r++){var i;i=e[r];for(var s=t,o=i.getParent().$.cells,u=0,a=0;a<o.length;a++){var f=o[a],u=u+(s?1:f.colSpan);if(f==i.$)break}i=u-1;if(t?i<n:i>n)n=i}return n}function i(t,n){for(var i=e(t),s=i[0].getAscendant("table"),o=r(i,1),i=r(i),o=n?o:i,u=CKEDITOR.tools.buildTableMap(s),s=[],i=[],a=u.length,f=0;f<a;f++)s.push(u[f][o]),i.push(n?u[f][o-1]:u[f][o+1]);for(f=0;f<a;f++)s[f]&&(s[f].colSpan>1&&i[f]==s[f]?(o=s[f],o.colSpan=o.colSpan+1):(o=(new CKEDITOR.dom.element(s[f])).clone(),o.removeAttribute("colSpan"),o.appendBogus(),o[n?"insertBefore":"insertAfter"].call(o,new CKEDITOR.dom.element(s[f])),o=o.$),f+=o.rowSpan-1)}function s(e,t){var n=e.getStartElement();if(n=n.getAscendant("td",1)||n.getAscendant("th",1)){var r=n.clone();r.appendBogus(),t?r.insertBefore(n):r.insertAfter(n)}}function o(t){if(t instanceof CKEDITOR.dom.selection){var t=e(t),n=t[0]&&t[0].getAscendant("table"),r;e:{var i=0;r=t.length-1;for(var s={},a,f;a=t[i++];)CKEDITOR.dom.element.setMarker(s,a,"delete_cell",!0);for(i=0;a=t[i++];)if((f=a.getPrevious())&&!f.getCustomData("delete_cell")||(f=a.getNext())&&!f.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(s),r=f;break e}CKEDITOR.dom.element.clearAllMarkers(s),f=t[0].getParent(),(f=f.getPrevious())?r=f.getLast():(f=t[r].getParent(),r=(f=f.getNext())?f.getChild(0):null)}for(f=t.length-1;f>=0;f--)o(t[f]);r?u(r,!0):n&&n.remove()}else t instanceof CKEDITOR.dom.element&&(n=t.getParent(),n.getChildCount()==1?n.remove():t.remove())}function u(e,t){var n=e.getDocument(),r=CKEDITOR.document;CKEDITOR.env.ie&&CKEDITOR.env.version==10&&(r.focus(),n.focus()),n=new CKEDITOR.dom.range(n),n["moveToElementEdit"+(t?"End":"Start")](e)||(n.selectNodeContents(e),n.collapse(t?!1:!0)),n.select(!0)}function a(e,t,n){e=e[t];if(typeof n=="undefined")return e;for(t=0;e&&t<e.length;t++){if(n.is&&e[t]==n.$)return t;if(t==n)return new CKEDITOR.dom.element(e[t])}return n.is?-1:null}function f(t,n,r){var i=e(t),s;if((n?i.length!=1:i.length<2)||(s=t.getCommonAncestor())&&s.type==CKEDITOR.NODE_ELEMENT&&s.is("table"))return!1;var o,t=i[0];s=t.getAscendant("table");var u=CKEDITOR.tools.buildTableMap(s),f=u.length,l=u[0].length,c=t.getParent().$.rowIndex,h=a(u,c,t);if(n){var p;try{var d=parseInt(t.getAttribute("rowspan"),10)||1;o=parseInt(t.getAttribute("colspan"),10)||1,p=u[n=="up"?c-d:n=="down"?c+d:c][n=="left"?h-o:n=="right"?h+o:h]}catch(v){return!1}if(!p||t.$==p)return!1;i[n=="up"||n=="left"?"unshift":"push"](new CKEDITOR.dom.element(p))}for(var n=t.getDocument(),m=c,d=p=0,g=!r&&new CKEDITOR.dom.documentFragment(n),y=0,n=0;n<i.length;n++){o=i[n];var b=o.getParent(),w=o.getFirst(),E=o.$.colSpan,S=o.$.rowSpan,b=b.$.rowIndex,x=a(u,b,o),y=y+E*S,d=Math.max(d,x-h+E);p=Math.max(p,b-c+S),r||(E=o,(S=E.getBogus())&&S.remove(),E.trim(),o.getChildren().count()&&(b!=m&&w&&(!w.isBlockBoundary||!w.isBlockBoundary({br:1}))&&(m=g.getLast(CKEDITOR.dom.walker.whitespaces(!0)))&&(!m.is||!m.is("br"))&&g.append("br"),o.moveChildren(g)),n?o.remove():o.setHtml("")),m=b}if(r)return p*d==y;g.moveChildren(t),t.appendBogus(),d>=l?t.removeAttribute("rowSpan"):t.$.rowSpan=p,p>=f?t.removeAttribute("colSpan"):t.$.colSpan=d,r=new CKEDITOR.dom.nodeList(s.$.rows),i=r.count();for(n=i-1;n>=0;n--)s=r.getItem(n),s.$.cells.length||(s.remove(),i++);return t}function l(t,n){var r=e(t);if(r.length>1)return!1;if(n)return!0;var r=r[0],i=r.getParent(),s=i.getAscendant("table"),o=CKEDITOR.tools.buildTableMap(s),u=i.$.rowIndex,f=a(o,u,r),l=r.$.rowSpan,c;if(l>1){c=Math.ceil(l/2);for(var l=Math.floor(l/2),i=u+c,s=new CKEDITOR.dom.element(s.$.rows[i]),o=a(o,i),h,i=r.clone(),u=0;u<o.length;u++){h=o[u];if(h.parentNode==s.$&&u>f){i.insertBefore(new CKEDITOR.dom.element(h));break}h=null}h||s.append(i)}else{l=c=1,s=i.clone(),s.insertAfter(i),s.append(i=r.clone()),h=a(o,u);for(f=0;f<h.length;f++)h[f].rowSpan++}return i.appendBogus(),r.$.rowSpan=c,i.$.rowSpan=l,c==1&&r.removeAttribute("rowSpan"),l==1&&i.removeAttribute("rowSpan"),i}function c(t,n){var r=e(t);if(r.length>1)return!1;if(n)return!0;var r=r[0],i=r.getParent(),s=i.getAscendant("table"),s=CKEDITOR.tools.buildTableMap(s),o=a(s,i.$.rowIndex,r),u=r.$.colSpan;if(u>1)i=Math.ceil(u/2),u=Math.floor(u/2);else{for(var u=i=1,f=[],l=0;l<s.length;l++){var c=s[l];f.push(c[o]),c[o].rowSpan>1&&(l+=c[o].rowSpan-1)}for(s=0;s<f.length;s++)f[s].colSpan++}return s=r.clone(),s.insertAfter(r),s.appendBogus(),r.$.colSpan=i,s.$.colSpan=u,i==1&&r.removeAttribute("colSpan"),u==1&&s.removeAttribute("colSpan"),s}var h=/^(?:td|th)$/;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(r){function a(e){return CKEDITOR.tools.extend(e||{},{contextSensitive:1,refresh:function(e,t){this.setState(t.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function h(e,t){var n=r.addCommand(e,t);r.addFeature(n)}var p=r.lang.table;h("cellProperties",new CKEDITOR.dialogCommand("cellProperties",a({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:"table"}))),CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js"),h("rowDelete",a({requiredContent:"table",exec:function(e){e=e.getSelection(),u(n(e))}})),h("rowInsertBefore",a({requiredContent:"table",exec:function(e){e=e.getSelection(),t(e,!0)}})),h("rowInsertAfter",a({requiredContent:"table",exec:function(e){e=e.getSelection(),t(e)}})),h("columnDelete",a({requiredContent:"table",exec:function(t){for(var t=t.getSelection(),t=e(t),n=t[0],r=t[t.length-1],t=n.getAscendant("table"),i=CKEDITOR.tools.buildTableMap(t),s,o,a=[],f=0,l=i.length;f<l;f++)for(var c=0,h=i[f].length;c<h;c++)i[f][c]==n.$&&(s=c),i[f][c]==r.$&&(o=c);for(f=s;f<=o;f++)for(c=0;c<i.length;c++)r=i[c],n=new CKEDITOR.dom.element(t.$.rows[c]),r=new CKEDITOR.dom.element(r[f]),r.$&&(r.$.colSpan==1?r.remove():r.$.colSpan=r.$.colSpan-1,c+=r.$.rowSpan-1,n.$.cells.length||a.push(n));o=t.$.rows[0]&&t.$.rows[0].cells,s=new CKEDITOR.dom.element(o[s]||(s?o[s-1]:t.$.parentNode)),a.length==l&&t.remove(),s&&u(s,!0)}})),h("columnInsertBefore",a({requiredContent:"table",exec:function(e){e=e.getSelection(),i(e,!0)}})),h("columnInsertAfter",a({requiredContent:"table",exec:function(e){e=e.getSelection(),i(e)}})),h("cellDelete",a({requiredContent:"table",exec:function(e){e=e.getSelection(),o(e)}})),h("cellMerge",a({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(e){u(f(e.getSelection()),!0)}})),h("cellMergeRight",a({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(e){u(f(e.getSelection(),"right"),!0)}})),h("cellMergeDown",a({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(e){u(f(e.getSelection(),"down"),!0)}})),h("cellVerticalSplit",a({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(e){u(l(e.getSelection()))}})),h("cellHorizontalSplit",a({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(e){u(c(e.getSelection()))}})),h("cellInsertBefore",a({requiredContent:"table",exec:function(e){e=e.getSelection(),s(e,!0)}})),h("cellInsertAfter",a({requiredContent:"table",exec:function(e){e=e.getSelection(),s(e)}})),r.addMenuItems&&r.addMenuItems({tablecell:{label:p.cell.menu,group:"tablecell",order:1,getItems:function(){var t=r.getSelection(),n=e(t);return{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:f(t,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:f(t,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:f(t,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:l(t,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:c(t,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_properties:n.length>0?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED}}},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",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",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},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",command:"columnDelete",order:15}}),r.contextMenu&&r.contextMenu.addListener(function(e,t,n){return(e=n.contains({td:1,th:1},1))&&!e.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getSelectedCells:e},CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)}(),CKEDITOR.tools.buildTableMap=function(e){for(var e=e.$.rows,t=-1,n=[],r=0;r<e.length;r++){t++,!n[t]&&(n[t]=[]);for(var i=-1,s=0;s<e[r].cells.length;s++){var o=e[r].cells[s];for(i++;n[t][i];)i++;for(var u=isNaN(o.colSpan)?1:o.colSpan,o=isNaN(o.rowSpan)?1:o.rowSpan,a=0;a<o;a++){n[t+a]||(n[t+a]=[]);for(var f=0;f<u;f++)n[t+a][i+f]=e[r].cells[s]}i+=u-1}}return n},function(){function e(e){function n(){for(var n=r(),s=CKEDITOR.tools.clone(e.config.toolbarGroups)||t(e),o=0;o<s.length;o++){var u=s[o];if(u!="/"){typeof u=="string"&&(u=s[o]={name:u});var l,c=u.groups;if(c)for(var h=0;h<c.length;h++)l=c[h],(l=n[l])&&i(u,l);(l=n[u.name])&&i(u,l)}}return s}function r(){var t={},n,r,i;for(n in e.ui.items)r=e.ui.items[n],i=r.toolbar||"others",i=i.split(","),r=i[0],i=parseInt(i[1]||-1,10),t[r]||(t[r]=[]),t[r].push({name:n,order:i});for(r in t)t[r]=t[r].sort(function(e,t){return e.order==t.order?0:t.order<0?-1:e.order<0?1:e.order<t.order?-1:1});return t}function i(t,n){if(n.length){t.items?t.items.push(e.ui.create("-")):t.items=[];for(var r;r=n.shift();)r=typeof r=="string"?r:r.name,(!o||CKEDITOR.tools.indexOf(o,r)==-1)&&(r=e.ui.create(r))&&e.addFeature(r)&&t.items.push(r)}}function s(e){var t=[],n,r,s;for(n=0;n<e.length;++n)r=e[n],s={},r=="/"?t.push(r):CKEDITOR.tools.isArray(r)?(i(s,CKEDITOR.tools.clone(r)),t.push(s)):r.items&&(i(s,CKEDITOR.tools.clone(r.items)),s.name=r.name,t.push(s));return t}var o=e.config.removeButtons,o=o&&o.split(","),u=e.config.toolbar;return typeof u=="string"&&(u=e.config["toolbar_"+u]),e.toolbar=u?s(u):n()}function t(e){return e._.toolbarGroups||(e._.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"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var n=function(){this.toolbars=[],this.focusCommandExecuted=!1};n.prototype.focus=function(){for(var e=0,t;t=this.toolbars[e++];)for(var n=0,r;r=t.items[n++];)if(r.focus){r.focus();return}};var r={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(e){e.toolbox&&(e.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){e.toolbox.focus()},100):e.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(t){var i,s=function(e,n){var r,o=t.lang.dir=="rtl",u=t.config.toolbarGroupCycling,a=o?37:39,o=o?39:37,u=u===void 0||u;switch(n){case 9:case CKEDITOR.SHIFT+9:for(;!r||!r.items.length;){r=n==9?(r?r.next:e.toolbar.next)||t.toolbox.toolbars[0]:(r?r.previous:e.toolbar.previous)||t.toolbox.toolbars[t.toolbox.toolbars.length-1];if(r.items.length)for(e=r.items[i?r.items.length-1:0];e&&!e.focus;)(e=i?e.previous:e.next)||(r=0)}return e&&e.focus(),!1;case a:r=e;do r=r.next,!r&&u&&(r=e.toolbar.items[0]);while(r&&!r.focus);return r?r.focus():s(e,9),!1;case 40:return e.button&&e.button.hasArrow?(t.once("panelShow",function(e){e.data._.panel._.currentBlock.onKeyDown(40)}),e.execute()):s(e,n==40?a:o),!1;case o:case 38:r=e;do r=r.previous,!r&&u&&(r=e.toolbar.items[e.toolbar.items.length-1]);while(r&&!r.focus);return r?r.focus():(i=1,s(e,CKEDITOR.SHIFT+9),i=0),!1;case 27:return t.focus(),!1;case 13:case 32:return e.execute(),!1}return!0};t.on("uiSpace",function(r){if(r.data.space==t.config.toolbarLocation){r.removeListener(),t.toolbox=new n;var i=CKEDITOR.tools.getNextId(),o=['<span id="',i,'" class="cke_voice_label">',t.lang.toolbar.toolbars,"</span>",'<span id="'+t.ui.spaceId("toolbox")+'" class="cke_toolbox" role="group" aria-labelledby="',i,'" onmousedown="return false;">'],i=t.config.toolbarStartupExpanded!==!1,u,f;t.config.toolbarCanCollapse&&t.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&o.push('<span class="cke_toolbox_main"'+(i?">":' style="display:none">'));for(var l=t.toolbox.toolbars,h=e(t),p=0;p<h.length;p++){var d,v=0,m,g=h[p],y;if(g){u&&(o.push("</span>"),f=u=0);if(g==="/")o.push('<span class="cke_toolbar_break"></span>');else{y=g.items||g;for(var w=0;w<y.length;w++){var E=y[w],S;if(E)if(E.type==CKEDITOR.UI_SEPARATOR)f=u&&E;else{S=E.canGroup!==!1;if(!v){d=CKEDITOR.tools.getNextId(),v={id:d,items:[]},m=g.name&&(t.lang.toolbar.toolbarGroups[g.name]||g.name),o.push('<span id="',d,'" class="cke_toolbar"',m?' aria-labelledby="'+d+'_label"':"",' role="toolbar">'),m&&o.push('<span id="',d,'_label" class="cke_voice_label">',m,"</span>"),o.push('<span class="cke_toolbar_start"></span>');var x=l.push(v)-1;x>0&&(v.previous=l[x-1],v.previous.next=v)}S?u||(o.push('<span class="cke_toolgroup" role="presentation">'),u=1):u&&(o.push("</span>"),u=0),d=function(e){e=e.render(t,o),x=v.items.push(e)-1,x>0&&(e.previous=v.items[x-1],e.previous.next=e),e.toolbar=v,e.onkey=s,e.onfocus=function(){t.toolbox.focusCommandExecuted||t.focus()}},f&&(d(f),f=0),d(E)}}u&&(o.push("</span>"),f=u=0),v&&o.push('<span class="cke_toolbar_end"></span></span>')}}}t.config.toolbarCanCollapse&&o.push("</span>");if(t.config.toolbarCanCollapse&&t.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var T=CKEDITOR.tools.addFunction(function(){t.execCommand("toolbarCollapse")});t.on("destroy",function(){CKEDITOR.tools.removeFunction(T)}),t.addCommand("toolbarCollapse",{readOnly:1,exec:function(e){var t=e.ui.space("toolbar_collapser"),n=t.getPrevious(),r=e.ui.space("contents"),i=n.getParent(),s=parseInt(r.$.style.height,10),o=i.$.offsetHeight,u=t.hasClass("cke_toolbox_collapser_min");u?(n.show(),t.removeClass("cke_toolbox_collapser_min"),t.setAttribute("title",e.lang.toolbar.toolbarCollapse)):(n.hide(),t.addClass("cke_toolbox_collapser_min"),t.setAttribute("title",e.lang.toolbar.toolbarExpand)),t.getFirst().setText(u?"▲":"◀"),r.setStyle("height",s-(i.$.offsetHeight-o)+"px"),e.fire("resize")},modes:{wysiwyg:1,source:1}}),t.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse"),o.push('<a title="'+(i?t.lang.toolbar.toolbarCollapse:t.lang.toolbar.toolbarExpand)+'" id="'+t.ui.spaceId("toolbar_collapser")+'" tabIndex="-1" class="cke_toolbox_collapser'),i||o.push(" cke_toolbox_collapser_min"),o.push('" onclick="CKEDITOR.tools.callFunction('+T+')">','<span class="cke_arrow">&#9650;</span>',"</a>")}o.push("</span>"),r.data.html=r.data.html+o.join("")}}),t.on("destroy",function(){if(this.toolbox){var e,t=0,n,r,i;for(e=this.toolbox.toolbars;t<e.length;t++){r=e[t].items;for(n=0;n<r.length;n++)i=r[n],i.clickFn&&CKEDITOR.tools.removeFunction(i.clickFn),i.keyDownFn&&CKEDITOR.tools.removeFunction(i.keyDownFn)}}}),t.on("uiReady",function(){var e=t.ui.space("toolbox");e&&t.focusManager.add(e,1)}),t.addCommand("toolbarFocus",r),t.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus"),t.ui.add("-",CKEDITOR.UI_SEPARATOR,{}),t.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(e,t){return t.push('<span class="cke_toolbar_separator" role="separator"></span>'),{}}}}})}}),CKEDITOR.ui.prototype.addToolbarGroup=function(e,n,r){var i=t(this.editor),s=n===0,o={name:e};if(r){if(r=CKEDITOR.tools.search(i,function(e){return e.name==r})){!r.groups&&(r.groups=[]);if(n){n=CKEDITOR.tools.indexOf(r.groups,n);if(n>=0){r.groups.splice(n+1,0,e);return}}s?r.groups.splice(0,0,e):r.groups.push(e);return}n=null}n&&(n=CKEDITOR.tools.indexOf(i,function(e){return e.name==n})),s?i.splice(0,0,e):typeof n=="number"?i.splice(n+1,0,o):i.push(e)}}(),CKEDITOR.UI_SEPARATOR="separator",CKEDITOR.config.toolbarLocation="top","use strict",function(){var e=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],t={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(t){function r(e){o.enabled&&e.data.command.canUndo!==!1&&o.save()}function i(){o.enabled=t.readOnly?!1:t.mode=="wysiwyg",o.onChange()}var o=t.undoManager=new n(t),u=o.editingHandler=new s(o),f=t.addCommand("undo",{exec:function(){o.undo()&&(t.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),l=t.addCommand("redo",{exec:function(){o.redo()&&(t.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});t.setKeystroke([[e[0],"undo"],[e[1],"redo"],[e[2],"redo"]]),o.onChange=function(){f.setState(o.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),l.setState(o.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)},t.on("beforeCommandExec",r),t.on("afterCommandExec",r),t.on("saveSnapshot",function(e){o.save(e.data&&e.data.contentOnly)}),t.on("contentDom",u.attachListeners,u),t.on("instanceReady",function(){t.fire("saveSnapshot")}),t.on("beforeModeUnload",function(){t.mode=="wysiwyg"&&o.save(!0)}),t.on("mode",i),t.on("readOnly",i),t.ui.addButton&&(t.ui.addButton("Undo",{label:t.lang.undo.undo,command:"undo",toolbar:"undo,10"}),t.ui.addButton("Redo",{label:t.lang.undo.redo,command:"redo",toolbar:"undo,20"})),t.resetUndo=function(){o.reset(),t.fire("saveSnapshot")},t.on("updateSnapshot",function(){o.currentImage&&o.update()}),t.on("lockSnapshot",function(e){e=e.data,o.lock(e&&e.dontUpdate,e&&e.forceUpdate)}),t.on("unlockSnapshot",o.unlock,o)}}),CKEDITOR.plugins.undo={};var n=CKEDITOR.plugins.undo.UndoManager=function(e){this.strokesRecorded=[0,0],this.locked=null,this.previousKeyGroup=-1,this.limit=e.config.undoStackSize||20,this.strokesLimit=25,this.editor=e,this.reset()};n.prototype={type:function(e,t){var r=n.getKeyGroup(e),i=this.strokesRecorded[r]+1,t=t||i>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange()),t?(i=0,this.editor.fire("saveSnapshot")):this.editor.fire("change"),this.strokesRecorded[r]=i,this.previousKeyGroup=r},keyGroupChanged:function(e){return n.getKeyGroup(e)!=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(e,t,n){var i=this.editor;if(this.locked||i.status!="ready"||i.mode!="wysiwyg")return!1;var s=i.editable();if(!s||s.status!="ready")return!1;s=this.snapshots,t||(t=new r(i));if(t.contents===!1)return!1;if(this.currentImage)if(t.equalsContent(this.currentImage)){if(e||t.equalsSelection(this.currentImage))return!1}else n!==!1&&i.fire("change");return s.splice(this.index+1,s.length-this.index-1),s.length==this.limit&&s.shift(),this.index=s.push(t)-1,this.currentImage=t,n!==!1&&this.refreshState(),!0},restoreImage:function(e){var t=this.editor,n;e.bookmarks&&(t.focus(),n=t.getSelection()),this.locked={level:999},this.editor.loadSnapshot(e.contents),e.bookmarks?n.selectBookmarks(e.bookmarks):CKEDITOR.env.ie&&(n=this.editor.document.getBody().$.createTextRange(),n.collapse(!0),n.select()),this.locked=null,this.index=e.index,this.currentImage=this.snapshots[this.index],this.update(),this.refreshState(),t.fire("change")},getNextImage:function(e){var t=this.snapshots,n=this.currentImage,r;if(n)if(e)for(r=this.index-1;r>=0;r--){e=t[r];if(!n.equalsContent(e))return e.index=r,e}else for(r=this.index+1;r<t.length;r++){e=t[r];if(!n.equalsContent(e))return e.index=r,e}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 e=this.getNextImage(!0);if(e)return this.restoreImage(e),!0}return!1},redo:function(){if(this.redoable()){this.save(!0);if(this.redoable()){var e=this.getNextImage(!1);if(e)return this.restoreImage(e),!0}}return!1},update:function(e){if(!this.locked){e||(e=new r(this.editor));for(var t=this.index,n=this.snapshots;t>0&&this.currentImage.equalsContent(n[t-1]);)t-=1;n.splice(t,this.index-t+1,e),this.index=t,this.currentImage=e}},updateSelection:function(e){if(!this.snapshots.length)return!1;var t=this.snapshots,n=t[t.length-1];return n.equalsContent(e)&&!n.equalsSelection(e)?(this.currentImage=t[t.length-1]=e,!0):!1},lock:function(e,t){if(this.locked)this.locked.level++;else if(e)this.locked={level:1};else{var n=null;if(t)n=!0;else{var i=new r(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(i)&&(n=i)}this.locked={update:n,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var e=this.locked.update;this.locked=null;if(e===!0)this.update();else if(e){var t=new r(this.editor,!0);e.equalsContent(t)||this.update()}}}},n.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1},n.keyGroups={PRINTABLE:0,FUNCTIONAL:1},n.isNavigationKey=function(e){return!!n.navigationKeyCodes[e]},n.getKeyGroup=function(e){var r=n.keyGroups;return t[e]?r.FUNCTIONAL:r.PRINTABLE},n.getOppositeKeyGroup=function(e){var t=n.keyGroups;return e==t.FUNCTIONAL?t.PRINTABLE:t.FUNCTIONAL},n.ieFunctionalKeysBug=function(e){return CKEDITOR.env.ie&&n.getKeyGroup(e)==n.keyGroups.FUNCTIONAL};var r=CKEDITOR.plugins.undo.Image=function(e,t){this.editor=e,e.fire("beforeUndoImage");var n=e.getSnapshot();CKEDITOR.env.ie&&n&&(n=n.replace(/\s+data-cke-expando=".*?"/g,"")),this.contents=n,t||(this.bookmarks=(n=n&&e.getSelection())&&n.createBookmarks2(!0)),e.fire("afterUndoImage")},i=/\b(?:href|src|name)="[^"]*?"/gi;r.prototype={equalsContent:function(e){var t=this.contents,e=e.contents;return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(t=t.replace(i,""),e=e.replace(i,"")),t!=e?!1:!0},equalsSelection:function(e){var t=this.bookmarks,e=e.bookmarks;if(t||e){if(!t||!e||t.length!=e.length)return!1;for(var n=0;n<t.length;n++){var r=t[n],i=e[n];if(r.startOffset!=i.startOffset||r.endOffset!=i.endOffset||!CKEDITOR.tools.arrayCompare(r.start,i.start)||!CKEDITOR.tools.arrayCompare(r.end,i.end))return!1}}return!0}};var s=CKEDITOR.plugins.undo.NativeEditingHandler=function(e){this.undoManager=e,this.ignoreInputEvent=!1,this.keyEventsStack=new o,this.lastKeydownImage=null};s.prototype={onKeydown:function(t){var i=t.data.getKey();if(i!==229)if(CKEDITOR.tools.indexOf(e,t.data.getKeystroke())>-1)t.data.preventDefault();else{this.keyEventsStack.cleanUp(t),t=this.undoManager,this.keyEventsStack.getLast(i)||this.keyEventsStack.push(i),this.lastKeydownImage=new r(t.editor);if(n.isNavigationKey(i)||this.undoManager.keyGroupChanged(i))if(t.strokesRecorded[0]||t.strokesRecorded[1])t.save(!1,this.lastKeydownImage,!1),t.resetType()}},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var e=this.keyEventsStack.getLast();e||(e=this.keyEventsStack.push(0)),this.keyEventsStack.increment(e.keyCode),this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(e.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(e){var t=this.undoManager,e=e.data.getKey(),i=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(e);if(!n.ieFunctionalKeysBug(e)||!this.lastKeydownImage||!this.lastKeydownImage.equalsContent(new r(t.editor,!0)))i>0?t.type(e):n.isNavigationKey(e)&&this.onNavigationKey(!0)},onNavigationKey:function(e){var t=this.undoManager;(e||!t.save(!0,null,!1))&&t.updateSelection(new r(t.editor)),t.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},attachListeners:function(){var e=this.undoManager.editor,t=e.editable(),r=this;t.attachListener(t,"keydown",function(e){r.onKeydown(e),n.ieFunctionalKeysBug(e.data.getKey())&&r.onInput()},null,null,999),t.attachListener(t,CKEDITOR.env.ie?"keypress":"input",r.onInput,r,null,999),t.attachListener(t,"keyup",r.onKeyup,r,null,999),t.attachListener(t,"paste",r.ignoreInputEventListener,r,null,999),t.attachListener(t,"drop",r.ignoreInputEventListener,r,null,999),t.attachListener(t.isInline()?t:e.document.getDocumentElement(),"click",function(){r.onNavigationKey()},null,null,999),t.attachListener(this.undoManager.editor,"blur",function(){r.keyEventsStack.remove(9)},null,null,999)}};var o=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};o.prototype={push:function(e){return this.stack[this.stack.push({keyCode:e,inputs:0})-1]},getLastIndex:function(e){if(typeof e!="number")return this.stack.length-1;for(var t=this.stack.length;t--;)if(this.stack[t].keyCode==e)return t;return-1},getLast:function(e){return e=this.getLastIndex(e),e!=-1?this.stack[e]:null},increment:function(e){this.getLast(e).inputs++},remove:function(e){e=this.getLastIndex(e),e!=-1&&this.stack.splice(e,1)},resetInputs:function(e){if(typeof e=="number")this.getLast(e).inputs=0;else for(e=this.stack.length;e--;)this.stack[e].inputs=0},getTotalInputs:function(){for(var e=this.stack.length,t=0;e--;)t+=this.stack[e].inputs;return t},cleanUp:function(e){e=e.data.$,!e.ctrlKey&&!e.metaKey&&this.remove(17),e.shiftKey||this.remove(16),e.altKey||this.remove(18)}}}(),CKEDITOR.plugins.add("wsc",{requires:"dialog",parseApi:function(e){e.config.wsc_onFinish=typeof e.config.wsc_onFinish=="function"?e.config.wsc_onFinish:function(){},e.config.wsc_onClose=typeof e.config.wsc_onClose=="function"?e.config.wsc_onClose:function(){}},parseConfig:function(e){e.config.wsc_customerId=e.config.wsc_customerId||CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk",e.config.wsc_customDictionaryIds=e.config.wsc_customDictionaryIds||CKEDITOR.config.wsc_customDictionaryIds||"",e.config.wsc_userDictionaryName=e.config.wsc_userDictionaryName||CKEDITOR.config.wsc_userDictionaryName||"",e.config.wsc_customLoaderScript=e.config.wsc_customLoaderScript||CKEDITOR.config.wsc_customLoaderScript,CKEDITOR.config.wsc_cmd=e.config.wsc_cmd||CKEDITOR.config.wsc_cmd||"spell",CKEDITOR.config.wsc_version="v4.3.0-26-g5bcf855",CKEDITOR.config.wsc_removeGlobalVariable=!0},init:function(e){var t=CKEDITOR.env;this.parseConfig(e),this.parseApi(e),e.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes={wysiwyg:!CKEDITOR.env.opera&&!CKEDITOR.env.air&&document.domain==window.location.hostname&&(!t.ie||!(t.version<8||t.quirks))},typeof e.plugins.scayt=="undefined"&&e.ui.addButton&&e.ui.addButton("SpellChecker",{label:e.lang.wsc.toolbar,click:function(e){var t=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.container.getText():e.document.getBody().getText();(t=t.replace(/\s/g,""))?e.execCommand("checkspell"):alert("Nothing to check!")},toolbar:"spellchecker,10"}),CKEDITOR.dialog.add("checkspell",this.path+(CKEDITOR.env.ie&&CKEDITOR.env.version<=7?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}}),function(){function e(e){var n=this.editor,r=e.document,i=r.body,s=r.getElementById("cke_actscrpt");s&&s.parentNode.removeChild(s),(s=r.getElementById("cke_shimscrpt"))&&s.parentNode.removeChild(s),(s=r.getElementById("cke_basetagscrpt"))&&s.parentNode.removeChild(s),i.contentEditable=!0,CKEDITOR.env.ie&&(i.hideFocus=!0,i.disabled=!0,i.removeAttribute("disabled")),delete this._.isLoadingData,this.$=i,r=new CKEDITOR.dom.document(r),this.setup(),this.fixInitialSelection(),CKEDITOR.env.ie&&(r.getDocumentElement().addClass(r.$.compatMode),n.config.enterMode!=CKEDITOR.ENTER_P&&this.attachListener(r,"selectionchange",function(){var e=r.getBody(),t=n.getSelection(),i=t&&t.getRanges()[0];i&&e.getHtml().match(/^<p>(?:&nbsp;|<br>)<\/p>$/i)&&i.startContainer.equals(e)&&setTimeout(function(){i=n.getSelection().getRanges()[0],i.startContainer.equals("body")||(e.getFirst().remove(1),i.moveToElementEditEnd(e),i.select())},0)})),(CKEDITOR.env.webkit||CKEDITOR.env.ie&&CKEDITOR.env.version>10)&&r.getDocumentElement().on("mousedown",function(e){e.data.getTarget().is("html")&&setTimeout(function(){n.editable().focus()})}),t(n);try{n.document.$.execCommand("2D-position",!1,!0)}catch(o){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&n.document.$.compatMode=="CSS1Compat")&&this.attachListener(this,"keydown",function(e){var t=e.data.getKeystroke();if(t==33||t==34)if(CKEDITOR.env.ie)setTimeout(function(){n.getSelection().scrollIntoView()},0);else if(n.window.$.innerHeight>this.$.offsetHeight){var r=n.createRange();r[t==33?"moveToElementEditStart":"moveToElementEditEnd"](this),r.select(),e.data.preventDefault()}}),CKEDITOR.env.ie&&this.attachListener(r,"blur",function(){try{r.$.selection.empty()}catch(e){}}),CKEDITOR.env.iOS&&this.attachListener(r,"touchend",function(){e.focus()}),i=n.document.getElementsByTag("title").getItem(0),i.data("cke-title",i.getText()),CKEDITOR.env.ie&&(n.document.$.title=this._.docTitle),CKEDITOR.tools.setTimeout(function(){this.status=="unloaded"&&(this.status="ready"),n.fire("contentDom"),this._.isPendingFocus&&(n.focus(),this._.isPendingFocus=!1),setTimeout(function(){n.fire("dataReady")},0),CKEDITOR.env.ie&&setTimeout(function(){if(n.document){var e=n.document.$.body;e.runtimeStyle.marginBottom="0px",e.runtimeStyle.marginBottom=""}},1e3)},0,this)}function t(e){function t(){var t;e.editable().attachListener(e,"selectionChange",function(){var r=e.getSelection().getSelectedElement();r&&(t&&(t.detachEvent("onresizestart",n),t=null),r.$.attachEvent("onresizestart",n),t=r.$)})}function n(e){e.returnValue=!1}if(CKEDITOR.env.gecko)try{var r=e.document.$;r.execCommand("enableObjectResizing",!1,!e.config.disableObjectResizing),r.execCommand("enableInlineTableEditing",!1,!e.config.disableNativeTableHandles)}catch(i){}else CKEDITOR.env.ie&&CKEDITOR.env.version<11&&e.config.disableObjectResizing&&t(e)}function n(){var e=[];if(CKEDITOR.document.$.documentMode>=8){e.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");var t=[],n;for(n in CKEDITOR.dtd.$removeEmpty)t.push("html.CSS1Compat "+n+"[contenteditable=false]");e.push(t.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(e.push("html{height:100% !important}"),e.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));return e.push("html{cursor:text;*cursor:auto}"),e.push("img,input,textarea{cursor:default}"),e.join("\n")}CKEDITOR.plugins.add("wysiwygarea",{init:function(e){e.config.fullPage&&e.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"}),e.addMode("wysiwyg",function(t){function n(n){n&&n.removeListener(),e.editable(new r(e,s.$.contentWindow.document.body)),e.setData(e.getData(1),t)}var i="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",i=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent(i)+"}())":"",s=CKEDITOR.dom.element.createFromHtml('<iframe src="'+i+'" frameBorder="0"></iframe>');s.setStyles({width:"100%",height:"100%"}),s.addClass("cke_wysiwyg_frame cke_reset");var o=e.ui.space("contents");o.append(s),(i=CKEDITOR.env.ie||CKEDITOR.env.gecko)&&s.on("load",n);var u=e.title,f=e.fire("ariaEditorHelpLabel",{}).label;u&&(CKEDITOR.env.ie&&f&&(u+=", "+f),s.setAttribute("title",u));if(f){var u=CKEDITOR.tools.getNextId(),l=CKEDITOR.dom.element.createFromHtml('<span id="'+u+'" class="cke_voice_label">'+f+"</span>");o.append(l,1),s.setAttribute("aria-describedby",u)}e.on("beforeModeUnload",function(e){e.removeListener(),l&&l.remove()}),s.setAttributes({tabIndex:e.tabIndex,allowTransparency:"true"}),!i&&n(),CKEDITOR.env.webkit&&(i=function(){o.setStyle("width","100%"),s.hide(),s.setSize("width",o.getSize("width")),o.removeStyle("width"),s.show()},s.setCustomData("onResize",i),CKEDITOR.document.getWindow().on("resize",i)),e.fire("ariaWidget",s)})}}),CKEDITOR.editor.prototype.addContentsCss=function(e){var t=this.config,n=t.contentsCss;CKEDITOR.tools.isArray(n)||(t.contentsCss=n?[n]:[]),t.contentsCss.push(e)};var r=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments),this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(t){CKEDITOR.tools.setTimeout(e,0,this,t)},this),this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(e,t){var r=this.editor;if(t)this.setHtml(e),this.fixInitialSelection(),r.fire("dataReady");else{this._.isLoadingData=!0,r._.dataStore={id:1};var i=r.config,s=i.fullPage,o=i.docType,u=CKEDITOR.tools.buildStyleHtml(n()).replace(/<style>/,'<style data-cke-temp="1">');s||(u+=CKEDITOR.tools.buildStyleHtml(r.config.contentsCss));var a=i.baseHref?'<base href="'+i.baseHref+'" data-cke-temp="1" />':"";s&&(e=e.replace(/<!DOCTYPE[^>]*>/i,function(e){return r.docType=o=e,""}).replace(/<\?xml\s[^\?]*\?>/i,function(e){return r.xmlDeclaration=e,""})),e=r.dataProcessor.toHtml(e),s?(/<body[\s|>]/.test(e)||(e="<body>"+e),/<html[\s|>]/.test(e)||(e="<html>"+e+"</html>"),/<head[\s|>]/.test(e)?/<title[\s|>]/.test(e)||(e=e.replace(/<head[^>]*>/,"$&<title></title>")):e=e.replace(/<html[^>]*>/,"$&<head><title></title></head>"),a&&(e=e.replace(/<head[^>]*?>/,"$&"+a)),e=e.replace(/<\/head\s*>/,u+"$&"),e=o+e):e=i.docType+'<html dir="'+i.contentsLangDirection+'" lang="'+(i.contentsLanguage||r.langCode)+'"><head><title>'+this._.docTitle+"</title>"+a+u+"</head><body"+(i.bodyId?' id="'+i.bodyId+'"':"")+(i.bodyClass?' class="'+i.bodyClass+'"':"")+">"+e+"</body></html>",CKEDITOR.env.gecko&&(e=e.replace(/<body/,'<body contenteditable="true" '),CKEDITOR.env.version<2e4&&(e=e.replace(/<body[^>]*>/,"$&<!-- cke-content-start -->"))),i='<script id="cke_actscrpt" type="text/javascript"'+(CKEDITOR.env.ie?' defer="defer" ':"")+">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded=1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"</script>",CKEDITOR.env.ie&&CKEDITOR.env.version<9&&(i+='<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)</script>'),a&&CKEDITOR.env.ie&&CKEDITOR.env.version<10&&(i+='<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;</script>'),e=e.replace(/(?=\s*<\/(:?head)>)/,i),this.clearCustomData(),this.clearListeners(),r.fire("contentDomUnload");var f=this.getDocument();try{f.write(e)}catch(l){setTimeout(function(){f.write(e)},0)}}},getData:function(e){if(e)return this.getHtml();var e=this.editor,t=e.config,n=t.fullPage,r=n&&e.docType,i=n&&e.xmlDeclaration,s=this.getDocument(),n=n?s.getDocumentElement().getOuterHtml():s.getBody().getHtml();return CKEDITOR.env.gecko&&t.enterMode!=CKEDITOR.ENTER_BR&&(n=n.replace(/<br>(?=\s*(:?$|<\/body>))/,"")),n=e.dataProcessor.toDataFormat(n),i&&(n=i+"\n"+n),r&&(n=r+"\n"+n),n},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:r.baseProto.focus.call(this)},detach:function(){var e=this.editor,t=e.document,e=e.window.getFrame();r.baseProto.detach.call(this),this.clearCustomData(),t.getDocumentElement().clearCustomData(),e.clearCustomData(),CKEDITOR.tools.removeFunction(this._.frameLoadedHandler),(t=e.removeCustomData("onResize"))&&t.removeListener(),e.remove()}}})}(),CKEDITOR.config.disableObjectResizing=!1,CKEDITOR.config.disableNativeTableHandles=!0,CKEDITOR.config.disableNativeSpellChecker=!0,CKEDITOR.config.contentsCss=CKEDITOR.getUrl("contents.css"),CKEDITOR.config.plugins="dialogui,dialog,a11yhelp,about,basicstyles,blockquote,clipboard,panel,floatpanel,menu,contextmenu,elementspath,indent,indentlist,list,enterkey,entities,popup,filebrowser,floatingspace,listblock,button,richcombo,format,horizontalrule,htmlwriter,image,fakeobjects,link,magicline,maximize,pastefromword,pastetext,removeformat,resize,menubutton,scayt,showborders,sourcearea,specialchar,stylescombo,tab,table,tabletools,toolbar,undo,wsc,wysiwygarea",CKEDITOR.config.skin="moono",function(){var e=function(e,t){for(var n=CKEDITOR.getUrl("plugins/"+t),e=e.split(","),r=0;r<e.length;r++)CKEDITOR.skin.icons[e[r]]={path:n,offset:-e[++r],bgsize:e[++r]}};CKEDITOR.env.hidpi?e("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,,creatediv,456,,docprops-rtl,480,,docprops,504,,find-rtl,528,,find,552,,replace,576,,flash,600,,button,624,,checkbox,648,,form,672,,hiddenfield,696,,imagebutton,720,,radio,744,,select-rtl,768,,select,792,,textarea-rtl,816,,textarea,840,,textfield-rtl,864,,textfield,888,,horizontalrule,912,,iframe,936,,image,960,,indent-rtl,984,,indent,1008,,outdent-rtl,1032,,outdent,1056,,justifyblock,1080,,justifycenter,1104,,justifyleft,1128,,justifyright,1152,,language,1176,,anchor-rtl,1200,,anchor,1224,,link,1248,,unlink,1272,,bulletedlist-rtl,1296,,bulletedlist,1320,,numberedlist-rtl,1344,,numberedlist,1368,,mathjax,1392,,maximize,1416,,newpage-rtl,1440,,newpage,1464,,pagebreak-rtl,1488,,pagebreak,1512,,pastefromword-rtl,1536,,pastefromword,1560,,pastetext-rtl,1584,,pastetext,1608,,placeholder,1632,,preview-rtl,1656,,preview,1680,,print,1704,,removeformat,1728,,save,1752,,scayt,1776,,selectall,1800,,showblocks-rtl,1824,,showblocks,1848,,smiley,1872,,source-rtl,1896,,source,1920,,sourcedialog-rtl,1944,,sourcedialog,1968,,specialchar,1992,,table,2016,,templates-rtl,2040,,templates,2064,,uicolor,2088,,redo-rtl,2112,,redo,2136,,undo-rtl,2160,,undo,2184,,simplebox,4416,auto,spellchecker,2232,","icons_hidpi.png"):e("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,codesnippet,384,auto,bgcolor,408,auto,textcolor,432,auto,creatediv,456,auto,docprops-rtl,480,auto,docprops,504,auto,find-rtl,528,auto,find,552,auto,replace,576,auto,flash,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,imagebutton,720,auto,radio,744,auto,select-rtl,768,auto,select,792,auto,textarea-rtl,816,auto,textarea,840,auto,textfield-rtl,864,auto,textfield,888,auto,horizontalrule,912,auto,iframe,936,auto,image,960,auto,indent-rtl,984,auto,indent,1008,auto,outdent-rtl,1032,auto,outdent,1056,auto,justifyblock,1080,auto,justifycenter,1104,auto,justifyleft,1128,auto,justifyright,1152,auto,language,1176,auto,anchor-rtl,1200,auto,anchor,1224,auto,link,1248,auto,unlink,1272,auto,bulletedlist-rtl,1296,auto,bulletedlist,1320,auto,numberedlist-rtl,1344,auto,numberedlist,1368,auto,mathjax,1392,auto,maximize,1416,auto,newpage-rtl,1440,auto,newpage,1464,auto,pagebreak-rtl,1488,auto,pagebreak,1512,auto,pastefromword-rtl,1536,auto,pastefromword,1560,auto,pastetext-rtl,1584,auto,pastetext,1608,auto,placeholder,1632,auto,preview-rtl,1656,auto,preview,1680,auto,print,1704,auto,removeformat,1728,auto,save,1752,auto,scayt,1776,auto,selectall,1800,auto,showblocks-rtl,1824,auto,showblocks,1848,auto,smiley,1872,auto,source-rtl,1896,auto,source,1920,auto,sourcedialog-rtl,1944,auto,sourcedialog,1968,auto,specialchar,1992,auto,table,2016,auto,templates-rtl,2040,auto,templates,2064,auto,uicolor,2088,auto,redo-rtl,2112,auto,redo,2136,auto,undo-rtl,2160,auto,undo,2184,auto,simplebox,2208,auto,spellchecker,2232,auto","icons.png")}()}(),define("ckeditor",function(){}),function(e){function n(){var e=arguments[0],t=n.cache;if(!t[e]||!t.hasOwnProperty(e))t[e]=n.parse(e);return n.format.call(null,t[e],arguments)}function i(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function s(e,t){return Array(t+1).join(e)}var t={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};n.format=function(e,r){var o=1,u=e.length,a="",f,l=[],c,h,p,d,v,m,g=!0,y="";for(c=0;c<u;c++){a=i(e[c]);if(a==="string")l[l.length]=e[c];else if(a==="array"){p=e[c];if(p[2]){f=r[o];for(h=0;h<p[2].length;h++){if(!f.hasOwnProperty(p[2][h]))throw new Error(n("[sprintf] property '%s' does not exist",p[2][h]));f=f[p[2][h]]}}else p[1]?f=r[p[1]]:f=r[o++];i(f)=="function"&&(f=f());if(t.not_string.test(p[8])&&t.not_json.test(p[8])&&i(f)!="number"&&isNaN(f))throw new TypeError(n("[sprintf] expecting number but found %s",i(f)));t.number.test(p[8])&&(g=f>=0);switch(p[8]){case"b":f=f.toString(2);break;case"c":f=String.fromCharCode(f);break;case"d":case"i":f=parseInt(f,10);break;case"j":f=JSON.stringify(f,null,p[6]?parseInt(p[6]):0);break;case"e":f=p[7]?f.toExponential(p[7]):f.toExponential();break;case"f":f=p[7]?parseFloat(f).toFixed(p[7]):parseFloat(f);break;case"g":f=p[7]?parseFloat(f).toPrecision(p[7]):parseFloat(f);break;case"o":f=f.toString(8);break;case"s":f=(f=String(f))&&p[7]?f.substring(0,p[7]):f;break;case"u":f>>>=0;break;case"x":f=f.toString(16);break;case"X":f=f.toString(16).toUpperCase()}t.json.test(p[8])?l[l.length]=f:(t.number.test(p[8])&&(!g||p[3])?(y=g?"+":"-",f=f.toString().replace(t.sign,"")):y="",v=p[4]?p[4]==="0"?"0":p[4].charAt(1):" ",m=p[6]-(y+f).length,d=p[6]?m>0?s(v,m):"":"",l[l.length]=p[5]?y+f+d:v==="0"?y+d+f:d+y+f)}}return l.join("")},n.cache={},n.parse=function(e){var n=e,r=[],i=[],s=0;while(n){if((r=t.text.exec(n))!==null)i[i.length]=r[0];else if((r=t.modulo.exec(n))!==null)i[i.length]="%";else{if((r=t.placeholder.exec(n))===null)throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){s|=1;var o=[],u=r[2],a=[];if((a=t.key.exec(u))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=a[1];while((u=u.substring(a[0].length))!=="")if((a=t.key_access.exec(u))!==null)o[o.length]=a[1];else{if((a=t.index_access.exec(u))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=a[1]}r[2]=o}else s|=2;if(s===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=r}n=n.substring(r[0].length)}return i};var r=function(e,t,r){return r=(t||[]).slice(0),r.splice(0,0,e),n.apply(null,r)};typeof exports!="undefined"?(exports.sprintf=n,exports.vsprintf=r):(e.sprintf=n,e.vsprintf=r,typeof define=="function"&&define.amd&&define("sprintf",[],function(){return{sprintf:n,vsprintf:r}}))}(typeof window=="undefined"?this:window),function(e){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal,"undefined"!=typeof e&&(e.extend(e.fn,{ckeditorGet:function(){var e=this.eq(0).data("ckeditorInstance");if(!e)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return e},ckeditor:function(t,n){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!e.isFunction(t))var r=n,n=t,t=r;var i=[],n=n||{};this.each(function(){var r=e(this),s=r.data("ckeditorInstance"),o=r.data("_ckeditorInstanceLock"),u=this,f=new e.Deferred;i.push(f.promise());if(s&&!o)t&&t.apply(s,[this]),f.resolve();else if(o)s.once("instanceReady",function(){setTimeout(function(){s.element?(s.element.$==u&&t&&t.apply(s,[u]),f.resolve()):setTimeout(arguments.callee,100)},0)},null,null,9999);else{if(n.autoUpdateElement||"undefined"==typeof n.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)n.autoUpdateElementJquery=!0;n.autoUpdateElement=!1,r.data("_ckeditorInstanceLock",!0),s=e(this).is("textarea")?CKEDITOR.replace(u,n):CKEDITOR.inline(u,n),r.data("ckeditorInstance",s),s.on("instanceReady",function(n){var i=n.editor;setTimeout(function(){if(i.element){n.removeListener(),i.on("dataReady",function(){r.trigger("dataReady.ckeditor",[i])}),i.on("setData",function(e){r.trigger("setData.ckeditor",[i,e.data])}),i.on("getData",function(e){r.trigger("getData.ckeditor",[i,e.data])},999),i.on("destroy",function(){r.trigger("destroy.ckeditor",[i])}),i.on("save",function(){return e(u.form).submit(),!1},null,null,20);if(i.config.autoUpdateElementJquery&&r.is("textarea")&&e(u.form).length){var s=function(){r.ckeditor(function(){i.updateElement()})};e(u.form).submit(s),e(u.form).bind("form-pre-serialize",s),r.bind("destroy.ckeditor",function(){e(u.form).unbind("submit",s),e(u.form).unbind("form-pre-serialize",s)})}i.on("destroy",function(){r.removeData("ckeditorInstance")}),r.removeData("_ckeditorInstanceLock"),r.trigger("instanceReady.ckeditor",[i]),t&&t.apply(i,[u]),f.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var s=new e.Deferred;return this.promise=s.promise(),e.when.apply(this,i).then(function(){s.resolve()}),this.editor=this.eq(0).data("ckeditorInstance"),this}}),CKEDITOR.config.jqueryOverrideVal&&(e.fn.val=CKEDITOR.tools.override(e.fn.val,function(t){return function(n){if(arguments.length){var r=this,i=[],s=this.each(function(){var r=e(this),s=r.data("ckeditorInstance");if(r.is("textarea")&&s){var o=new e.Deferred;return s.setData(n,function(){o.resolve()}),i.push(o.promise()),!0}return t.call(r,n)});if(i.length){var o=new e.Deferred;return e.when.apply(this,i).done(function(){o.resolveWith(r)}),o.promise()}return s}var s=e(this).eq(0),u=s.data("ckeditorInstance");return s.is("textarea")&&u?u.getData():t.call(s)}})))}(window.jQuery),define("jqueryAdapter",function(){}),define("pasteFromWordPlugin",[],function(){"use strict";var e=function(e,t){var n=e.document.createElement("p");n.setHtml(t),e.insertElement(n)};return function(t){return{init:function(n){n.addCommand("pasteFromWordDialog",{dialogName:"pasteFromWordDialog",exec:function(){var r=$("<div/>");$("body").append(r),t.start([{name:"ckeditor/plugins/paste-from-word@husky",options:{el:r,title:n.lang.pastefromword.title,info:n.lang.clipboard.copyError,enterMode:n.config.enterMode,message:n.lang.clipboard.pasteMsg,saveCallback:function(i){t.stop(r),e(n,i)}}}])}}),n.ui.addButton("PasteFromWord",{label:n.lang.pastefromword.toolbar,command:"pasteFromWordDialog",toolbar:"clipboard,50"})}}}}),function(e,t){typeof define=="function"&&define.amd?define("html.sortable",["jquery"],t):typeof exports=="object"?module.exports=t(require("jquery")):e.sortable=t(e.jQuery)}(this,function(e){var t,n,r=e(),i=[],s=function(e){e.off("dragstart.h5s"),e.off("dragend.h5s"),e.off("selectstart.h5s"),e.off("dragover.h5s"),e.off("dragenter.h5s"),e.off("drop.h5s")},o=function(e){e.off("dragover.h5s"),e.off("dragenter.h5s"),e.off("drop.h5s")},u=function(e,t){e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text",""),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(t.item,t.x,t.y)},a=function(e,t){return t.x||(t.x=parseInt(e.pageX-t.draggedItem.offset().left)),t.y||(t.y=parseInt(e.pageY-t.draggedItem.offset().top)),t},f=function(e){return{item:e[0],draggedItem:e}},l=function(e,t){var n=f(t);n=a(e,n),u(e,n)},c=function(e,t){return typeof e=="undefined"?t:e},h=function(e){e.removeData("opts"),e.removeData("connectWith"),e.removeData("items"),e.removeAttr("aria-dropeffect")},p=function(e){e.removeAttr("aria-grabbed"),e.removeAttr("draggable"),e.removeAttr("role")},d=function(e,t){return e[0]===t[0]?!0:e.data("connectWith")!==undefined?e.data("connectWith")===t.data("connectWith"):!1},v=function(e){var t=e.data("opts")||{},n=e.children(t.items),r=t.handle?n.find(t.handle):n;o(e),h(e),r.off("mousedown.h5s"),s(n),p(n)},m=function(t){var n=t.data("opts"),r=t.children(n.items),i=n.handle?r.find(n.handle):r;t.attr("aria-dropeffect","move"),i.attr("draggable","true");var s=(document||window.document).createElement("span");typeof s.dragDrop=="function"&&!n.disableIEFix&&i.on("mousedown.h5s",function(){r.index(this)!==-1?this.dragDrop():e(this).parents(n.items)[0].dragDrop()})},g=function(e){var t=e.data("opts"),n=e.children(t.items),r=t.handle?n.find(t.handle):n;e.attr("aria-dropeffect","none"),r.attr("draggable",!1),r.off("mousedown.h5s")},y=function(e){var t=e.data("opts"),n=e.children(t.items),r=t.handle?n.find(t.handle):n;s(n),r.off("mousedown.h5s"),o(e)},b=function(s,o){var a=e(s),f=String(o);return o=e.extend({connectWith:!1,placeholder:null,dragImage:null,disableIEFix:!1,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1},o),a.each(function(){var s=e(this);if(/enable|disable|destroy/.test(f)){b[f](s);return}o=c(s.data("opts"),o),s.data("opts",o),y(s);var a=s.children(o.items),h,p,v,g=o.placeholder===null?e("<"+(/^ul|ol$/i.test(this.tagName)?"li":"div")+' class="'+o.placeholderClass+'"/>'):e(o.placeholder).addClass(o.placeholderClass);if(!s.attr("data-sortable-id")){var w=i.length;i[w]=s,s.attr("data-sortable-id",w),a.attr("data-item-sortable-id",w)}s.data("items",o.items),r=r.add(g),o.connectWith&&s.data("connectWith",o.connectWith),m(s),a.attr("role","option"),a.attr("aria-grabbed","false");if(o.hoverClass){var E="sortable-over";typeof o.hoverClass=="string"&&(E=o.hoverClass),a.hover(function(){e(this).addClass(E)},function(){e(this).removeClass(E)})}a.on("dragstart.h5s",function(r){r.stopImmediatePropagation(),o.dragImage?(u(r.originalEvent,{item:o.dragImage,x:0,y:0}),console.log("WARNING: dragImage option is deprecated and will be removed in the future!")):l(r.originalEvent,e(this),o.dragImage),t=e(this),t.addClass(o.draggingClass),t.attr("aria-grabbed","true"),h=t.index(),n=t.height(),p=e(this).parent(),t.parent().triggerHandler("sortstart",{item:t,placeholder:g,startparent:p})}),a.on("dragend.h5s",function(){if(!t)return;t.removeClass(o.draggingClass),t.attr("aria-grabbed","false"),t.show(),r.detach(),v=e(this).parent(),t.parent().triggerHandler("sortstop",{item:t,startparent:p}),(h!==t.index()||p.get(0)!==v.get(0))&&t.parent().triggerHandler("sortupdate",{item:t,index:v.children(v.data("items")).index(t),oldindex:a.index(t),elementIndex:t.index(),oldElementIndex:h,startparent:p,endparent:v}),t=null,n=null}),e(this).add([g]).on("drop.h5s",function(n){if(!d(s,e(t).parent()))return;return n.stopPropagation(),r.filter(":visible").after(t),t.trigger("dragend.h5s"),!1}),a.add([this]).on("dragover.h5s dragenter.h5s",function(i){if(!d(s,e(t).parent()))return;i.preventDefault(),i.originalEvent.dataTransfer.dropEffect="move";if(a.is(this)){var u=e(this).height();o.forcePlaceholderSize&&g.height(n);if(u>n){var f=u-n,l=e(this).offset().top;if(g.index()<e(this).index()&&i.originalEvent.pageY<l+f)return!1;if(g.index()>e(this).index()&&i.originalEvent.pageY>l+u-f)return!1}t.hide(),g.index()<e(this).index()?e(this).after(g):e(this).before(g),r.not(g).detach()}else!r.is(this)&&!e(this).children(o.items).length&&(r.detach(),e(this).append(g));return!1})})};return b.destroy=function(e){v(e)},b.enable=function(e){m(e)},b.disable=function(e){g(e)},e.fn.sortable=function(e){return b(this,e)},b}),function(e){"use strict";function a(e){var t;if(e===null||e===undefined)return!1;if(n.isArray(e))return e.length>0;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return!0;for(t in e)if(e.hasOwnProperty(t)&&a(e[t]))return!0;return!1}var t=function(){function e(e){this.options=e}return e.prototype.toString=function(){return JSON&&JSON.stringify?JSON.stringify(this.options):this.options},e}(),n=function(){function e(e){return Object.prototype.toString.apply(e)==="[object Array]"}function t(e){return Object.prototype.toString.apply(e)==="[object String]"}function n(e){return Object.prototype.toString.apply(e)==="[object Number]"}function r(e){return Object.prototype.toString.apply(e)==="[object Boolean]"}function i(e,t){var n="",r=!0,i;for(i=0;i<e.length;i+=1)r?r=!1:n+=t,n+=e[i];return n}function s(e,t){var n=[],r=0;for(;r<e.length;r+=1)n.push(t(e[r]));return n}function o(e,t){var n=[],r=0;for(;r<e.length;r+=1)t(e[r])&&n.push(e[r]);return n}function u(e){if(typeof e!="object"||e===null)return e;Object.freeze(e);var t,n;for(n in e)e.hasOwnProperty(n)&&(t=e[n],typeof t=="object"&&a(t));return e}function a(e){return typeof Object.freeze=="function"?u(e):e}return{isArray:e,isString:t,isNumber:n,isBoolean:r,join:i,map:s,filter:o,deepFreeze:a}}(),r=function(){function e(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}function t(e){return e>="0"&&e<="9"}function n(e){return t(e)||e>="a"&&e<="f"||e>="A"&&e<="F"}return{isAlpha:e,isDigit:t,isHexDigit:n}}(),i=function(){function t(t){var n="",r=e.encode(t),i,s;for(s=0;s<r.length;s+=1)i=r.charCodeAt(s),n+="%"+(i<16?"0":"")+i.toString(16).toUpperCase();return n}function n(e,t){return e.charAt(t)==="%"&&r.isHexDigit(e.charAt(t+1))&&r.isHexDigit(e.charAt(t+2))}function i(e,t){return parseInt(e.substr(t,2),16)}function s(t){if(!n(t,0))return!1;var r=i(t,1),s=e.numBytes(r);if(s===0)return!1;for(var o=1;o<s;o+=1)if(!n(t,3*o)||!e.isValidFollowingCharCode(i(t,3*o+1)))return!1;return!0}function o(t,r){var s=t.charAt(r);if(!n(t,r))return s;var o=i(t,r+1),u=e.numBytes(o);if(u===0)return s;for(var a=1;a<u;a+=1)if(!n(t,r+3*a)||!e.isValidFollowingCharCode(i(t,r+3*a+1)))return s;return t.substr(r,3*u)}var e={encode:function(e){return unescape(encodeURIComponent(e))},numBytes:function(e){return e<=127?1:194<=e&&e<=223?2:224<=e&&e<=239?3:240<=e&&e<=244?4:0},isValidFollowingCharCode:function(e){return 128<=e&&e<=191}};return{encodeCharacter:t,isPctEncoded:s,pctCharAt:o}}(),s=function(){function e(e){return r.isAlpha(e)||r.isDigit(e)||e==="_"||i.isPctEncoded(e)}function t(e){return r.isAlpha(e)||r.isDigit(e)||e==="-"||e==="."||e==="_"||e==="~"}function n(e){return e===":"||e==="/"||e==="?"||e==="#"||e==="["||e==="]"||e==="@"||e==="!"||e==="$"||e==="&"||e==="("||e===")"||e==="*"||e==="+"||e===","||e===";"||e==="="||e==="'"}return{isVarchar:e,isUnreserved:t,isReserved:n}}(),o=function(){function e(e,t){var n="",r,o="";if(typeof e=="number"||typeof e=="boolean")e=e.toString();for(r=0;r<e.length;r+=o.length)o=e.charAt(r),n+=s.isUnreserved(o)||t&&s.isReserved(o)?o:i.encodeCharacter(o);return n}function t(t){return e(t,!0)}function n(e,t){var n=i.pctCharAt(e,t);return n.length>1?n:s.isReserved(n)||s.isUnreserved(n)?n:i.encodeCharacter(n)}function r(e){var t="",n,r="";for(n=0;n<e.length;n+=r.length)r=i.pctCharAt(e,n),r.length>1?t+=r:t+=s.isReserved(r)||s.isUnreserved(r)?r:i.encodeCharacter(r);return t}return{encode:e,encodePassReserved:t,encodeLiteral:r,encodeLiteralCharacter:n}}(),u=function(){function t(t){e[t]={symbol:t,separator:t==="?"?"&":t===""||t==="+"||t==="#"?",":t,named:t===";"||t==="&"||t==="?",ifEmpty:t==="&"||t==="?"?"=":"",first:t==="+"?"":t,encode:t==="+"||t==="#"?o.encodePassReserved:o.encode,toString:function(){return this.symbol}}}var e={};return t(""),t("+"),t("#"),t("."),t("/"),t(";"),t("?"),t("&"),{valueOf:function(t){return e[t]?e[t]:"=,!@|".indexOf(t)>=0?null:e[""]}}}(),f=function(){function e(e){this.literal=o.encodeLiteral(e)}return e.prototype.expand=function(){return this.literal},e.prototype.toString=e.prototype.expand,e}(),l=function(){function e(e){function d(){var n=e.substring(f,h);if(n.length===0)throw new t({expressionText:e,message:"a varname must be specified",position:h});a={varname:n,exploded:!1,maxLength:null},f=null}function v(){if(l===h)throw new t({expressionText:e,message:"after a ':' you have to specify the length",position:h});a.maxLength=parseInt(e.substring(l,h),10),l=null}var n,o=[],a=null,f=null,l=null,h,p="";n=function(n){var r=u.valueOf(n);if(r===null)throw new t({expressionText:e,message:"illegal use of reserved operator",position:h,operator:n});return r}(e.charAt(0)),h=n.symbol.length,f=h;for(;h<e.length;h+=p.length){p=i.pctCharAt(e,h);if(f!==null){if(p==="."){if(f===h)throw new t({expressionText:e,message:"a varname MUST NOT start with a dot",position:h});continue}if(s.isVarchar(p))continue;d()}if(l!==null){if(h===l&&p==="0")throw new t({expressionText:e,message:"A :prefix must not start with digit 0",position:h});if(r.isDigit(p)){if(h-l>=4)throw new t({expressionText:e,message:"A :prefix must have max 4 digits",position:h});continue}v()}if(p===":"){if(a.maxLength!==null)throw new t({expressionText:e,message:"only one :maxLength is allowed per varspec",position:h});if(a.exploded)throw new t({expressionText:e,message:"an exploeded varspec MUST NOT be varspeced",position:h});l=h+1;continue}if(p==="*"){if(a===null)throw new t({expressionText:e,message:"exploded without varspec",position:h});if(a.exploded)throw new t({expressionText:e,message:"exploded twice",position:h});if(a.maxLength)throw new t({expressionText:e,message:"an explode (*) MUST NOT follow to a prefix",position:h});a.exploded=!0;continue}if(p===","){o.push(a),a=null,f=h+1;continue}throw new t({expressionText:e,message:"illegal character",character:p,position:h})}return f!==null&&d(),l!==null&&v(),o.push(a),new c(e,n,o)}function n(n){var r,i,s=[],o=null,u=0;for(r=0;r<n.length;r+=1){i=n.charAt(r);if(u!==null){if(i==="}")throw new t({templateText:n,message:"unopened brace closed",position:r});i==="{"&&(u<r&&s.push(new f(n.substring(u,r))),u=null,o=r);continue}if(o!==null){if(i==="{")throw new t({templateText:n,message:"brace already opened",position:r});if(i==="}"){if(o+1===r)throw new t({templateText:n,message:"empty braces",position:o});try{s.push(e(n.substring(o+1,r)))}catch(a){throw a.prototype===t.prototype?new t({templateText:n,message:a.options.message,position:o+a.options.position,details:a.options}):a}o=null,u=r+1}continue}throw new Error("reached unreachable code")}if(o!==null)throw new t({templateText:n,message:"unclosed brace",position:o});return u<n.length&&s.push(new f(n.substr(u))),new h(n,s)}return n}(),c=function(){function e(e){return JSON&&JSON.stringify?JSON.stringify(e):e}function t(e){if(!a(e))return!0;if(n.isString(e))return e==="";if(n.isNumber(e)||n.isBoolean(e))return!1;if(n.isArray(e))return e.length===0;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function r(e){var t=[],n;for(n in e)e.hasOwnProperty(n)&&t.push({name:n,value:e[n]});return t}function i(e,t,n){this.templateText=e,this.operator=t,this.varspecs=n}function s(e,t,n){var r="";n=n.toString();if(t.named){r+=o.encodeLiteral(e.varname);if(n==="")return r+=t.ifEmpty,r;r+="="}return e.maxLength!==null&&(n=n.substr(0,e.maxLength)),r+=t.encode(n),r}function u(e){return a(e.value)}function f(e,i,s){var f=[],l="";if(i.named){l+=o.encodeLiteral(e.varname);if(t(s))return l+=i.ifEmpty,l;l+="="}return n.isArray(s)?(f=s,f=n.filter(f,a),f=n.map(f,i.encode),l+=n.join(f,",")):(f=r(s),f=n.filter(f,u),f=n.map(f,function(e){return i.encode(e.name)+","+i.encode(e.value)}),l+=n.join(f,",")),l}function l(e,i,s){var f=n.isArray(s),l=[];return f?(l=s,l=n.filter(l,a),l=n.map(l,function(n){var r=o.encodeLiteral(e.varname);return t(n)?r+=i.ifEmpty:r+="="+i.encode(n),r})):(l=r(s),l=n.filter(l,u),l=n.map(l,function(e){var n=o.encodeLiteral(e.name);return t(e.value)?n+=i.ifEmpty:n+="="+i.encode(e.value),n})),n.join(l,i.separator)}function c(e,t){var i=[],s="";return n.isArray(t)?(i=t,i=n.filter(i,a),i=n.map(i,e.encode),s+=n.join(i,e.separator)):(i=r(t),i=n.filter(i,function(e){return a(e.value)}),i=n.map(i,function(t){return e.encode(t.name)+"="+e.encode(t.value)}),s+=n.join(i,e.separator)),s}return i.prototype.toString=function(){return this.templateText},i.prototype.expand=function(r){var i=[],o,u,h,p,d=!1,v=this.operator;for(o=0;o<this.varspecs.length;o+=1){u=this.varspecs[o],h=r[u.varname];if(h===null||h===undefined)continue;u.exploded&&(d=!0),p=n.isArray(h);if(typeof h=="string"||typeof h=="number"||typeof h=="boolean")i.push(s(u,v,h));else{if(u.maxLength&&a(h))throw new Error("Prefix modifiers are not applicable to variables that have composite values. You tried to expand "+this+" with "+e(h));u.exploded?a(h)&&(v.named?i.push(l(u,v,h)):i.push(c(v,h))):(v.named||!t(h))&&i.push(f(u,v,h))}}return i.length===0?"":v.first+n.join(i,v.separator)},i}(),h=function(){function e(e,t){this.templateText=e,this.expressions=t,n.deepFreeze(this)}return e.prototype.toString=function(){return this.templateText},e.prototype.expand=function(e){var t,n="";for(t=0;t<this.expressions.length;t+=1)n+=this.expressions[t].expand(e);return n},e.parse=l,e.UriTemplateError=t,e}();e(h)}(function(e){"use strict";typeof module!="undefined"?module.exports=e:typeof define=="function"?define("uri-template",[],function(){return e}):typeof window!="undefined"?window.UriTemplate=e:global.UriTemplate=e}),function(e){var t=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return typeof e=="string"},isNumber:function(e){return typeof e=="number"},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return typeof e=="undefined"},toStr:function(n){return t.isUndefined(n)||n===null?"":n+""},bind:e.proxy,each:function(t,n){function r(e,t){return n(t,e)}e.each(t,r)},map:e.map,filter:e.grep,every:function(t,n){var r=!0;return t?(e.each(t,function(e,i){if(!(r=n.call(null,i,e,t)))return!1}),!!r):r},some:function(t,n){var r=!1;return t?(e.each(t,function(e,i){if(r=n.call(null,i,e,t))return!1}),!!r):r},mixin:e.extend,getUniqueId:function(){var e=0;return function(){return e++}}(),templatify:function(n){function r(){return String(n)}return e.isFunction(n)?n:r},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r,i;return function(){var s=this,o=arguments,u,a;return u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r,clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},throttle:function(e,t){var n,r,i,s,o,u;return o=0,u=function(){o=new Date,i=null,s=e.apply(n,r)},function(){var a=new Date,f=t-(a-o);return n=this,r=arguments,f<=0?(clearTimeout(i),i=null,o=a,s=e.apply(n,r)):i||(i=setTimeout(u,f)),s}},noop:function(){}}}(),n="0.10.5",r=function(){"use strict";function e(e){return e=t.toStr(e),e?e.split(/\s+/):[]}function n(e){return e=t.toStr(e),e?e.split(/\W+/):[]}function r(e){return function(){var r=[].slice.call(arguments,0);return function(i){var s=[];return t.each(r,function(n){s=s.concat(e(t.toStr(i[n])))}),s}}}return{nonword:n,whitespace:e,obj:{nonword:r(n),whitespace:r(e)}}}(),i=function(){"use strict";function n(n){this.maxSize=t.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function r(){this.head=this.tail=null}function i(e,t){this.key=e,this.val=t,this.prev=this.next=null}return t.mixin(n.prototype,{set:function(t,n){var r=this.list.tail,s;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]),(s=this.hash[t])?(s.val=n,this.list.moveToFront(s)):(s=new i(t,n),this.list.add(s),this.hash[t]=s,this.size++)},get:function(t){var n=this.hash[t];if(n)return this.list.moveToFront(n),n.val},reset:function(){this.size=0,this.hash={},this.list=new r}}),t.mixin(r.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(e){this.remove(e),this.add(e)}}),n}(),s=function(){"use strict";function i(e){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix))}function s(){return(new Date).getTime()}function o(e){return JSON.stringify(t.isUndefined(e)?null:e)}function u(e){return JSON.parse(e)}var e,n;try{e=window.localStorage,e.setItem("~~~","!"),e.removeItem("~~~")}catch(r){e=null}return e&&window.JSON?n={_prefix:function(e){return this.prefix+e},_ttlKey:function(e){return this._prefix(e)+this.ttlKey},get:function(t){return this.isExpired(t)&&this.remove(t),u(e.getItem(this._prefix(t)))},set:function(n,r,i){return t.isNumber(i)?e.setItem(this._ttlKey(n),o(s()+i)):e.removeItem(this._ttlKey(n)),e.setItem(this._prefix(n),o(r))},remove:function(t){return e.removeItem(this._ttlKey(t)),e.removeItem(this._prefix(t)),this},clear:function(){var t,n,r=[],i=e.length;for(t=0;t<i;t++)(n=e.key(t)).match(this.keyMatcher)&&r.push(n.replace(this.keyMatcher,""));for(t=r.length;t--;)this.remove(r[t]);return this},isExpired:function(n){var r=u(e.getItem(this._ttlKey(n)));return t.isNumber(r)&&s()>r?!0:!1}}:n={get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(i.prototype,n),i}(),o=function(){"use strict";function u(t){t=t||{},this.cancelled=!1,this.lastUrl=null,this._send=t.transport?a(t.transport):e.ajax,this._get=t.rateLimiter?t.rateLimiter(this._get):this._get,this._cache=t.cache===!1?new i(0):o}function a(n){return function(i,s){function u(e){t.defer(function(){o.resolve(e)})}function a(e){t.defer(function(){o.reject(e)})}var o=e.Deferred();return n(i,s,u,a),o}}var n=0,r={},s=6,o=new i(10);return u.setMaxPendingRequests=function(t){s=t},u.resetCache=function(){o.reset()},t.mixin(u.prototype,{_get:function(e,t,i){function a(t){i&&i(null,t),o._cache.set(e,t)}function f(){i&&i(!0)}function l(){n--,delete r[e],o.onDeckRequestArgs&&(o._get.apply(o,o.onDeckRequestArgs),o.onDeckRequestArgs=null)}var o=this,u;if(this.cancelled||e!==this.lastUrl)return;(u=r[e])?u.done(a).fail(f):n<s?(n++,r[e]=this._send(e,t).done(a).fail(f).always(l)):this.onDeckRequestArgs=[].slice.call(arguments,0)},get:function(e,n,r){var i;return t.isFunction(n)&&(r=n,n={}),this.cancelled=!1,this.lastUrl=e,(i=this._cache.get(e))?t.defer(function(){r&&r(null,i)}):this._get(e,n,r),!!i},cancel:function(){this.cancelled=!0}}),u}(),u=function(){"use strict";function n(t){t=t||{},(!t.datumTokenizer||!t.queryTokenizer)&&e.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}function r(e){return e=t.filter(e,function(e){return!!e}),e=t.map(e,function(e){return e.toLowerCase()}),e}function i(){return{ids:[],children:{}}}function s(e){var t={},n=[];for(var r=0,i=e.length;r<i;r++)t[e[r]]||(t[e[r]]=!0,n.push(e[r]));return n}function o(e,t){function u(e,t){return e-t}var n=0,r=0,i=[];e=e.sort(u),t=t.sort(u);var s=e.length,o=t.length;while(n<s&&r<o)e[n]<t[r]?n++:e[n]>t[r]?r++:(i.push(e[n]),n++,r++);return i}return t.mixin(n.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(e){var n=this;e=t.isArray(e)?e:[e],t.each(e,function(e){var s,o;s=n.datums.push(e)-1,o=r(n.datumTokenizer(e)),t.each(o,function(e){var t,r,o;t=n.trie,r=e.split("");while(o=r.shift())t=t.children[o]||(t.children[o]=i()),t.ids.push(s)})})},get:function(n){var i=this,u,a;return u=r(this.queryTokenizer(n)),t.each(u,function(e){var t,n,r,s;if(a&&a.length===0)return!1;t=i.trie,n=e.split("");while(t&&(r=n.shift()))t=t.children[r];if(!t||n.length!==0)return a=[],!1;s=t.ids.slice(0),a=a?o(a,s):s}),a?t.map(s(a),function(e){return i.datums[e]}):[]},reset:function(){this.datums=[],this.trie=i()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),a=function(){"use strict";function r(e){return e.local||null}function i(r){var i,s;s={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}};if(i=r.prefetch||null)i=t.isString(i)?{url:i}:i,i=t.mixin(s,i),i.thumbprint=n+i.thumbprint,i.ajax.type=i.ajax.type||"GET",i.ajax.dataType=i.ajax.dataType||"json",!i.url&&e.error("prefetch requires url to be set");return i}function s(n){function s(e){return function(n){return t.debounce(n,e)}}function o(e){return function(n){return t.throttle(n,e)}}var r,i;i={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}};if(r=n.remote||null)r=t.isString(r)?{url:r}:r,r=t.mixin(i,r),r.rateLimiter=/^throttle$/i.test(r.rateLimitBy)?o(r.rateLimitWait):s(r.rateLimitWait),r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",delete r.rateLimitBy,delete r.rateLimitWait,!r.url&&e.error("remote requires url to be set");return r}return{local:r,prefetch:i,remote:s}}();(function(n){"use strict";function l(t){(!t||!t.local&&!t.prefetch&&!t.remote)&&e.error("one of local, prefetch, or remote is required"),this.limit=t.limit||5,this.sorter=c(t.sorter),this.dupDetector=t.dupDetector||h,this.local=a.local(t),this.prefetch=a.prefetch(t),this.remote=a.remote(t),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new u({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),this.storage=this.cacheKey?new s(this.cacheKey):null}function c(e){function n(t){return t.sort(e)}function r(e){return e}return t.isFunction(e)?n:r}function h(){return!1}var i,f;return i=n.Bloodhound,f={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.Bloodhound=l,l.noConflict=function(){return n.Bloodhound=i,l},l.tokenizers=r,t.mixin(l.prototype,{_loadPrefetch:function(n){function o(e){r.clear(),r.add(n.filter?n.filter(e):e),r._saveToStorage(r.index.serialize(),n.thumbprint,n.ttl)}var r=this,i,s;return(i=this._readFromStorage(n.thumbprint))?(this.index.bootstrap(i),s=e.Deferred().resolve()):s=e.ajax(n.url,n.ajax).done(o),s},_getFromRemote:function(t,n){function o(e,t){e?n([]):n(r.remote.filter?r.remote.filter(t):t)}var r=this,i,s;if(!this.transport)return;return t=t||"",s=encodeURIComponent(t),i=this.remote.replace?this.remote.replace(this.remote.url,t):this.remote.url.replace(this.remote.wildcard,s),this.transport.get(i,this.remote.ajax,o)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(t,n,r){this.storage&&(this.storage.set(f.data,t,r),this.storage.set(f.protocol,location.protocol,r),this.storage.set(f.thumbprint,n,r))},_readFromStorage:function(t){var n={},r;return this.storage&&(n.data=this.storage.get(f.data),n.protocol=this.storage.get(f.protocol),n.thumbprint=this.storage.get(f.thumbprint)),r=n.thumbprint!==t||n.protocol!==location.protocol,n.data&&!r?n.data:null},_initialize:function(){function u(){r.add(t.isFunction(i)?i():i)}var r=this,i=this.local,s;return s=this.prefetch?this._loadPrefetch(this.prefetch):e.Deferred().resolve(),i&&s.done(u),this.transport=this.remote?new o(this.remote):null,this.initPromise=s.promise()},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){this.index.add(t)},get:function(n,r){function u(e){var n=s.slice(0);t.each(e,function(e){var r;return r=t.some(n,function(t){return i.dupDetector(e,t)}),!r&&n.push(e),n.length<i.limit}),r&&r(i.sorter(n))}var i=this,s=[],o=!1;s=this.index.get(n),s=this.sorter(s).slice(0,this.limit),s.length<this.limit?o=this._getFromRemote(n,u):this._cancelLastRemoteRequest(),o||(s.length>0||!this.transport)&&r&&r(s)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&o.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),l})(this);var f=function(){return{wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'}}(),l=function(){"use strict";var e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&t.mixin(e.input,{marginTop:"-1px"}),e}(),c=function(){"use strict";function r(t){(!t||!t.el)&&e.error("EventBus initialized without el"),this.$el=e(t.el)}var n="typeahead:";return t.mixin(r.prototype,{trigger:function(e){var t=[].slice.call(arguments,1);this.$el.trigger(n+e,t)}}),r}(),h=function(){"use strict";function n(t,n,r,i){var s;if(!r)return this;n=n.split(e),r=i?f(r,i):r,this._callbacks=this._callbacks||{};while(s=n.shift())this._callbacks[s]=this._callbacks[s]||{sync:[],async:[]},this._callbacks[s][t].push(r);return this}function r(e,t,r){return n.call(this,"async",e,t,r)}function i(e,t,r){return n.call(this,"sync",e,t,r)}function s(t){var n;if(!this._callbacks)return this;t=t.split(e);while(n=t.shift())delete this._callbacks[n];return this}function o(n){var r,i,s,o,a;if(!this._callbacks)return this;n=n.split(e),s=[].slice.call(arguments,1);while((r=n.shift())&&(i=this._callbacks[r]))o=u(i.sync,this,[r].concat(s)),a=u(i.async,this,[r].concat(s)),o()&&t(a);return this}function u(e,t,n){function r(){var r;for(var i=0,s=e.length;!r&&i<s;i+=1)r=e[i].apply(t,n)===!1;return!r}return r}function a(){var e;return window.setImmediate?e=function(t){setImmediate(function(){t()})}:e=function(t){setTimeout(function(){t()},0)},e}function f(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}var e=/\s+/,t=a();return{onSync:i,onAsync:r,off:s,trigger:o}}(),p=function(e){"use strict";function r(e,n,r){var i=[],s;for(var o=0,u=e.length;o<u;o++)i.push(t.escapeRegExChars(e[o]));return s=r?"\\b("+i.join("|")+")\\b":"("+i.join("|")+")",n?new RegExp(s):new RegExp(s,"i")}var n={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(s){function u(t){var n,r,i;if(n=o.exec(t.data))i=e.createElement(s.tagName),s.className&&(i.className=s.className),r=t.splitText(n.index),r.splitText(n[0].length),i.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(i,r);return!!n}function a(e,t){var n,r=3;for(var i=0;i<e.childNodes.length;i++)n=e.childNodes[i],n.nodeType===r?i+=t(n)?1:0:a(n,t)}var o;s=t.mixin({},n,s);if(!s.node||!s.pattern)return;s.pattern=t.isArray(s.pattern)?s.pattern:[s.pattern],o=r(s.pattern,s.caseSensitive,s.wordsOnly),a(s.node,u)}}(window.document),d=function(){"use strict";function r(r){var s=this,o,u,a,f;r=r||{},r.input||e.error("input is missing"),o=t.bind(this._onBlur,this),u=t.bind(this._onFocus,this),a=t.bind(this._onKeydown,this),f=t.bind(this._onInput,this),this.$hint=e(r.hint),this.$input=e(r.input).on("blur.tt",o).on("focus.tt",u).on("keydown.tt",a),this.$hint.length===0&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(e){if(n[e.which||e.keyCode])return;t.defer(t.bind(s._onInput,s,e))}):this.$input.on("input.tt",f),this.query=this.$input.val(),this.$overflowHelper=i(this.$input)}function i(t){return e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function s(e,t){return r.normalizeQuery(e)===r.normalizeQuery(t)}function o(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var n;return n={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},r.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(r.prototype,h,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(t){var r=n[t.which||t.keyCode];this._managePreventDefault(r,t),r&&this._shouldTrigger(r,t)&&this.trigger(r+"Keyed",t)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(t,n){var r,i,s;switch(t){case"tab":i=this.getHint(),s=this.getInputValue(),r=i&&i!==s&&!o(n);break;case"up":case"down":r=!o(n);break;default:r=!1}r&&n.preventDefault()},_shouldTrigger:function(t,n){var r;switch(t){case"tab":r=!o(n);break;default:r=!0}return r},_checkInputValue:function(){var t,n,r;t=this.getInputValue(),n=s(t,this.query),r=n?this.query.length!==t.length:!1,this.query=t,n?r&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(t){this.query=t},getInputValue:function(){return this.$input.val()},setInputValue:function(t,n){this.$input.val(t),n?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,n,r,i;t=this.getInputValue(),n=this.getHint(),r=t!==n&&n.indexOf(t)===0,i=t!==""&&r&&!this.hasOverflow(),!i&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var e,n,r;return e=this.$input.val().length,n=this.$input[0].selectionStart,t.isNumber(n)?n===e:document.selection?(r=document.selection.createRange(),r.moveStart("character",-e),e===r.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),r}(),v=function(){"use strict";function s(n){n=n||{},n.templates=n.templates||{},n.source||e.error("missing source"),n.name&&!a(n.name)&&e.error("invalid dataset name: "+n.name),this.query=null,this.highlight=!!n.highlight,this.name=n.name||t.getUniqueId(),this.source=n.source,this.displayFn=o(n.display||n.displayKey),this.templates=u(n.templates,this.displayFn),this.$el=e(f.dataset.replace("%CLASS%",this.name))}function o(e){function n(t){return t[e]}return e=e||"value",t.isFunction(e)?e:n}function u(e,n){function r(e){return"<p>"+n(e)+"</p>"}return{empty:e.empty&&t.templatify(e.empty),header:e.header&&t.templatify(e.header),footer:e.footer&&t.templatify(e.footer),suggestion:e.suggestion||r}}function a(e){return/^[_a-zA-Z0-9-]+$/.test(e)}var n="ttDataset",r="ttValue",i="ttDatum";return s.extractDatasetName=function(r){return e(r).data(n)},s.extractValue=function(n){return e(n).data(r)},s.extractDatum=function(n){return e(n).data(i)},t.mixin(s.prototype,h,{_render:function(o,u){function h(){return a.templates.empty({query:o,isEmpty:!0})}function d(){function h(t){var s;return s=e(f.suggestion).append(a.templates.suggestion(t)).data(n,a.name).data(r,a.displayFn(t)).data(i,t),s.children().each(function(){e(this).css(l.suggestionChild)}),s}var s,c;return s=e(f.suggestions).css(l.suggestions),c=t.map(u,h),s.append.apply(s,c),a.highlight&&p({className:"tt-highlight",node:s[0],pattern:o}),s}function v(){return a.templates.header({query:o,isEmpty:!c})}function m(){return a.templates.footer({query:o,isEmpty:!c})}if(!this.$el)return;var a=this,c;this.$el.empty(),c=u&&u.length,!c&&this.templates.empty?this.$el.html(h()).prepend(a.templates.header?v():null).append(a.templates.footer?m():null):c&&this.$el.html(d()).prepend(a.templates.header?v():null).append(a.templates.footer?m():null),this.trigger("rendered")},getRoot:function(){return this.$el},update:function(t){function r(e){!n.canceled&&t===n.query&&n._render(t,e)}var n=this;this.query=t,this.canceled=!1,this.source(t,r)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),s}(),m=function(){"use strict";function n(n){var i=this,s,o,u;n=n||{},n.menu||e.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=t.map(n.datasets,r),s=t.bind(this._onSuggestionClick,this),o=t.bind(this._onSuggestionMouseEnter,this),u=t.bind(this._onSuggestionMouseLeave,this),this.$menu=e(n.menu).on("click.tt",".tt-suggestion",s).on("mouseenter.tt",".tt-suggestion",o).on("mouseleave.tt",".tt-suggestion",u),t.each(this.datasets,function(e){i.$menu.append(e.getRoot()),e.onSync("rendered",i._onRendered,i)})}function r(e){return new v(e)}return t.mixin(n.prototype,h,{_onSuggestionClick:function(n){this.trigger("suggestionClicked",e(n.currentTarget))},_onSuggestionMouseEnter:function(n){this._removeCursor(),this._setCursor(e(n.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function n(e){return e.isEmpty()}this.isEmpty=t.every(this.datasets,n),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(t,n){t.first().addClass("tt-cursor"),!n&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(t){var n,r,i,s;if(!this.isOpen)return;r=this._getCursor(),n=this._getSuggestions(),this._removeCursor(),i=n.index(r)+t,i=(i+1)%(n.length+1)-1;if(i===-1){this.trigger("cursorRemoved");return}i<-1&&(i=n.length-1),this._setCursor(s=n.eq(i)),this._ensureVisible(s)},_ensureVisible:function(t){var n,r,i,s;n=t.position().top,r=n+t.outerHeight(!0),i=this.$menu.scrollTop(),s=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),n<0?this.$menu.scrollTop(i+n):s<r&&this.$menu.scrollTop(i+(r-s))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(t){this.$menu.css(t==="ltr"?l.ltr:l.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(t){var n=null;return t.length&&(n={raw:v.extractDatum(t),value:v.extractValue(t),datasetName:v.extractDatasetName(t)}),n},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(n){function r(e){e.update(n)}t.each(this.datasets,r)},empty:function(){function n(e){e.clear()}t.each(this.datasets,n),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function n(e){e.destroy()}this.$menu.off(".tt"),this.$menu=null,t.each(this.datasets,n)}}),n}(),g=function(){"use strict";function r(n){var r,s,o;n=n||{},n.input||e.error("missing input"),this.isActivated=!1,this.autoselect=!!n.autoselect,this.minLength=t.isNumber(n.minLength)?n.minLength:1,this.$node=i(n.input,n.withHint),r=this.$node.find(".tt-dropdown-menu"),s=this.$node.find(".tt-input"),o=this.$node.find(".tt-hint"),s.on("blur.tt",function(e){var n,i,o;n=document.activeElement,i=r.is(n),o=r.has(n).length>0,t.isMsie()&&(i||o)&&(e.preventDefault(),e.stopImmediatePropagation(),t.defer(function(){s.focus()}))}),r.on("mousedown.tt",function(e){e.preventDefault()}),this.eventBus=n.eventBus||new c({el:s}),this.dropdown=(new m({menu:r,datasets:n.datasets})).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=(new d({input:s,hint:o})).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function i(t,r){var i,o,u,a;i=e(t),o=e(f.wrapper).css(l.wrapper),u=e(f.dropdown).css(l.dropdown),a=i.clone().css(l.hint).css(s(i)),a.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1}),i.data(n,{dir:i.attr("dir"),autocomplete:i.attr("autocomplete"),spellcheck:i.attr("spellcheck"),style:i.attr("style")}),i.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(r?l.input:l.inputWithNoHint);try{!i.attr("dir")&&i.attr("dir","auto")}catch(c){}return i.wrap(o).parent().prepend(r?a:null).append(u)}function s(e){return{backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}}function o(e){var r=e.find(".tt-input");t.each(r.data(n),function(e,n){t.isUndefined(e)?r.removeAttr(n):r.attr(n,e)}),r.detach().removeData(n).removeClass("tt-input").insertAfter(e),e.remove()}var n="ttAttrs";return t.mixin(r.prototype,{_onSuggestionClicked:function(t,n){var r;(r=this.dropdown.getDatumForSuggestion(n))&&this._select(r)},_onCursorMoved:function(){var t=this.dropdown.getDatumForCursor();this.input.setInputValue(t.value,!0),this.eventBus.trigger("cursorchanged",t.raw,t.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(t,n){var r,i;r=this.dropdown.getDatumForCursor(),i=this.dropdown.getDatumForTopSuggestion(),r?(this._select(r),n.preventDefault()):this.autoselect&&i&&(this._select(i),n.preventDefault())},_onTabKeyed:function(t,n){var r;(r=this.dropdown.getDatumForCursor())?(this._select(r),n.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){this.dir==="rtl"&&this._autocomplete()},_onRightKeyed:function(){this.dir==="ltr"&&this._autocomplete()},_onQueryChanged:function(t,n){this.input.clearHintIfInvalid(),n.length>=this.minLength?this.dropdown.update(n):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var t;this.dir!==(t=this.input.getLanguageDirection())&&(this.dir=t,this.$node.css("direction",t),this.dropdown.setLanguageDirection(t))},_updateHint:function(){var n,r,i,s,o,u;n=this.dropdown.getDatumForTopSuggestion(),n&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(r=this.input.getInputValue(),i=d.normalizeQuery(r),s=t.escapeRegExChars(i),o=new RegExp("^(?:"+s+")(.+$)","i"),u=o.exec(n.value),u?this.input.setHint(r+u[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(t){var n,r,i,s;n=this.input.getHint(),r=this.input.getQuery(),i=t||this.input.isCursorAtEnd(),n&&r!==n&&i&&(s=this.dropdown.getDatumForTopSuggestion(),s&&this.input.setInputValue(s.value),this.eventBus.trigger("autocompleted",s.raw,s.datasetName))},_select:function(n){this.input.setQuery(n.value),this.input.setInputValue(n.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",n.raw,n.datasetName),this.dropdown.close(),t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(n){n=t.toStr(n),this.isActivated?this.input.setInputValue(n):(this.input.setQuery(n),this.input.setInputValue(n,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),o(this.$node),this.$node=null}}),r}();(function(){"use strict";var n,r,i;n=e.fn.typeahead,r="ttTypeahead",i={initialize:function(i,s){function o(){var n=e(this),o,u;t.each(s,function(e){e.highlight=!!i.highlight}),u=new g({input:n,eventBus:o=new c({el:n}),withHint:t.isUndefined(i.hint)?!0:!!i.hint,minLength:i.minLength,autoselect:i.autoselect,datasets:s}),n.data(r,u)}return s=t.isArray(s)?s:[].slice.call(arguments,1),i=i||{},this.each(o)},open:function(){function n(){var t=e(this),n;(n=t.data(r))&&n.open()}return this.each(n)},close:function(){function n(){var t=e(this),n;(n=t.data(r))&&n.close()}return this.each(n)},val:function(n){function i(){var t=e(this),i;(i=t.data(r))&&i.setVal(n)}function s(e){var t,n;if(t=e.data(r))n=t.getVal();return n}return arguments.length?this.each(i):s(this.first())},destroy:function(){function n(){var t=e(this),n;if(n=t.data(r))n.destroy(),t.removeData(r)}return this.each(n)}},e.fn.typeahead=function(t){var n;return i[t]&&t!=="initialize"?(n=this.filter(function(){return!!e(this).data(r)}),i[t].apply(n,[].slice.call(arguments,1))):i.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this}})()}(window.jQuery),define("typeahead",function(){}),function(){var e,t,n,r,i,s,o,u,a=[].slice,f={}.hasOwnProperty,l=function(e,t){function r(){this.constructor=e}for(var n in t)f.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};o=function(){},t=function(){function e(){}return e.prototype.addEventListener=e.prototype.on,e.prototype.on=function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},e.prototype.emit=function(){var e,t,n,r,i,s;r=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],this._callbacks=this._callbacks||{},n=this._callbacks[r];if(n)for(i=0,s=n.length;i<s;i++)t=n[i],t.apply(this,e);return this},e.prototype.removeListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.off=function(e,t){var n,r,i,s,o;if(!this._callbacks||arguments.length===0)return this._callbacks={},this;r=this._callbacks[e];if(!r)return this;if(arguments.length===1)return delete this._callbacks[e],this;for(i=s=0,o=r.length;s<o;i=++s){n=r[i];if(n===t){r.splice(i,1);break}}return this},e}(),e=function(e){function i(e,t){var r,s,o;this.element=e,this.version=i.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],typeof this.element=="string"&&(this.element=document.querySelector(this.element));if(!this.element||this.element.nodeType==null)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");i.instances.push(this),this.element.dropzone=this,r=(o=i.optionsForElement(this.element))!=null?o:{},this.options=n({},this.defaultOptions,r,t!=null?t:{});if(this.options.forceFallback||!i.isBrowserSupported())return this.options.fallback.call(this);this.options.url==null&&(this.options.url=this.element.getAttribute("action"));if(!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(s=this.getExistingFallback())&&s.parentNode&&s.parentNode.removeChild(s),this.options.previewsContainer!==!1&&(this.options.previewsContainer?this.previewsContainer=i.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(this.options.clickable===!0?this.clickableElements=[this.element]:this.clickableElements=i.getElements(this.options.clickable,"clickable")),this.init()}var n,r;return l(i,e),i.prototype.Emitter=t,i.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],i.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,filesizeBase:1e3,maxFiles:null,filesizeBase:1e3,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,capture:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(e,t){return t()},init:function(){return o},forceFallback:!1,fallback:function(){var e,t,n,r,s,o;this.element.className=""+this.element.className+" dz-browser-not-supported",o=this.element.getElementsByTagName("div");for(r=0,s=o.length;r<s;r++){e=o[r];if(/(^| )dz-message($| )/.test(e.className)){t=e,e.className="dz-message";continue}}return t||(t=i.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(t)),n=t.getElementsByTagName("span")[0],n&&(n.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,n,r;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},n=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,t.optWidth==null&&t.optHeight==null?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):t.optWidth==null?t.optWidth=n*t.optHeight:t.optHeight==null&&(t.optHeight=1/n*t.optWidth),r=t.optWidth/t.optHeight,e.height<t.optHeight||e.width<t.optWidth?(t.trgHeight=t.srcHeight,t.trgWidth=t.srcWidth):n>r?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*r):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/r),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:o,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:o,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t,n,r,s,o,u,a,f,l,c,h,p,d;this.element===this.previewsContainer&&this.element.classList.add("dz-started");if(this.previewsContainer){e.previewElement=i.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]");for(s=0,a=c.length;s<a;s++)t=c[s],t.textContent=e.name;h=e.previewElement.querySelectorAll("[data-dz-size]");for(o=0,f=h.length;o<f;o++)t=h[o],t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=i.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),e.previewElement.appendChild(e._removeLink)),n=function(t){return function(n){return n.preventDefault(),n.stopPropagation(),e.status===i.UPLOADING?i.confirm(t.options.dictCancelUploadConfirmation,function(){return t.removeFile(e)}):t.options.dictRemoveFileConfirmation?i.confirm(t.options.dictRemoveFileConfirmation,function(){return t.removeFile(e)}):t.removeFile(e)}}(this),p=e.previewElement.querySelectorAll("[data-dz-remove]"),d=[];for(u=0,l=p.length;u<l;u++)r=p[u],d.push(r.addEventListener("click",n));return d}},removedfile:function(e){var t;return e.previewElement&&(t=e.previewElement)!=null&&t.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){var n,r,i,s;if(e.previewElement){e.previewElement.classList.remove("dz-file-preview"),s=e.previewElement.querySelectorAll("[data-dz-thumbnail]");for(r=0,i=s.length;r<i;r++)n=s[r],n.alt=e.name,n.src=t;return setTimeout(function(t){return function(){return e.previewElement.classList.add("dz-image-preview")}}(this),1)}},error:function(e,t){var n,r,i,s,o;if(e.previewElement){e.previewElement.classList.add("dz-error"),typeof t!="String"&&t.error&&(t=t.error),s=e.previewElement.querySelectorAll("[data-dz-errormessage]"),o=[];for(r=0,i=s.length;r<i;r++)n=s[r],o.push(n.textContent=t);return o}},errormultiple:o,processing:function(e){if(e.previewElement){e.previewElement.classList.add("dz-processing");if(e._removeLink)return e._removeLink.textContent=this.options.dictCancelUpload}},processingmultiple:o,uploadprogress:function(e,t,n){var r,i,s,o,u;if(e.previewElement){o=e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),u=[];for(i=0,s=o.length;i<s;i++)r=o[i],r.nodeName==="PROGRESS"?u.push(r.value=t):u.push(r.style.width=""+t+"%");return u}},totaluploadprogress:o,sending:o,sendingmultiple:o,success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:o,canceled:function(e){return this.emit("error",e,"Upload canceled.")},canceledmultiple:o,complete:function(e){e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile);if(e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:o,maxfilesexceeded:o,maxfilesreached:o,queuecomplete:o,previewTemplate:'<div class="dz-preview dz-file-preview">\n  <div class="dz-image"><img data-dz-thumbnail /></div>\n  <div class="dz-details">\n    <div class="dz-size"><span data-dz-size></span></div>\n    <div class="dz-filename"><span data-dz-name></span></div>\n  </div>\n  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n  <div class="dz-error-message"><span data-dz-errormessage></span></div>\n  <div class="dz-success-mark">\n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n      <title>Check</title>\n      <defs></defs>\n      <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n        <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n      </g>\n    </svg>\n  </div>\n  <div class="dz-error-mark">\n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n      <title>Error</title>\n      <defs></defs>\n      <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n        <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n          <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n        </g>\n      </g>\n    </svg>\n  </div>\n</div>'},n=function(){var e,t,n,r,i,s,o;r=arguments[0],n=2<=arguments.length?a.call(arguments,1):[];for(s=0,o=n.length;s<o;s++){t=n[s];for(e in t)i=t[e],r[e]=i}return r},i.prototype.getAcceptedFiles=function(){var e,t,n,r,i;r=this.files,i=[];for(t=0,n=r.length;t<n;t++)e=r[t],e.accepted&&i.push(e);return i},i.prototype.getRejectedFiles=function(){var e,t,n,r,i;r=this.files,i=[];for(t=0,n=r.length;t<n;t++)e=r[t],e.accepted||i.push(e);return i},i.prototype.getFilesWithStatus=function(e){var t,n,r,i,s;i=this.files,s=[];for(n=0,r=i.length;n<r;n++)t=i[n],t.status===e&&s.push(t);return s},i.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(i.QUEUED)},i.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(i.UPLOADING)},i.prototype.getActiveFiles=function(){var e,t,n,r,s;r=this.files,s=[];for(t=0,n=r.length;t<n;t++)e=r[t],(e.status===i.UPLOADING||e.status===i.QUEUED)&&s.push(e);return s},i.prototype.init=function(){var e,t,n,r,s,o,u;this.element.tagName==="form"&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(n=function(e){return function(){return e.hiddenFileInput&&document.body.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(e.options.maxFiles==null||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",e.options.acceptedFiles!=null&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),e.options.capture!=null&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.body.appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,r,i,s;r=e.hiddenFileInput.files;if(r.length)for(i=0,s=r.length;i<s;i++)t=r[i],e.addFile(t);return n()})}}(this),n()),this.URL=(o=window.URL)!=null?o:window.webkitURL,u=this.events;for(r=0,s=u.length;r<s;r++)e=u[r],this.on(e,this.options[e]);return this.on("uploadprogress",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("canceled",function(e){return function(t){return e.emit("complete",t)}}(this)),this.on("complete",function(e){return function(t){if(e.getUploadingFiles().length===0&&e.getQueuedFiles().length===0)return setTimeout(function(){return e.emit("queuecomplete")},0)}}(this)),t=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(e){return function(t){return e.emit("dragstart",t)}}(this),dragenter:function(e){return function(n){return t(n),e.emit("dragenter",n)}}(this),dragover:function(e){return function(n){var r;try{r=n.dataTransfer.effectAllowed}catch(i){}return n.dataTransfer.dropEffect="move"===r||"linkMove"===r?"move":"copy",t(n),e.emit("dragover",n)}}(this),dragleave:function(e){return function(t){return e.emit("dragleave",t)}}(this),drop:function(e){return function(n){return t(n),e.drop(n)}}(this),dragend:function(e){return function(t){return e.emit("dragend",t)}}(this)}}],this.clickableElements.forEach(function(e){return function(t){return e.listeners.push({element:t,events:{click:function(n){if(t!==e.element||n.target===e.element||i.elementInside(n.target,e.element.querySelector(".dz-message")))return e.hiddenFileInput.click()}}})}}(this)),this.enable(),this.options.init.call(this)},i.prototype.destroy=function(){var e;this.disable(),this.removeAllFiles(!0);if((e=this.hiddenFileInput)!=null?e.parentNode:void 0)this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null;return delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)},i.prototype.updateTotalUploadProgress=function(){var e,t,n,r,i,s,o,u;r=0,n=0,e=this.getActiveFiles();if(e.length){u=this.getActiveFiles();for(s=0,o=u.length;s<o;s++)t=u[s],r+=t.upload.bytesSent,n+=t.upload.total;i=100*r/n}else i=100;return this.emit("totaluploadprogress",i,n,r)},i.prototype._getParamName=function(e){return typeof this.options.paramName=="function"?this.options.paramName(e):""+this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")},i.prototype.getFallbackForm=function(){var e,t,n,r;return(e=this.getExistingFallback())?e:(n='<div class="dz-fallback">',this.options.dictFallbackText&&(n+="<p>"+this.options.dictFallbackText+"</p>"),n+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',t=i.createElement(n),this.element.tagName!=="FORM"?(r=i.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>'),r.appendChild(t)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),r!=null?r:t)},i.prototype.getExistingFallback=function(){var e,t,n,r,i,s;t=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++){t=e[n];if(/(^| )fallback($| )/.test(t.className))return t}},s=["div","form"];for(r=0,i=s.length;r<i;r++){n=s[r];if(e=t(this.element.getElementsByTagName(n)))return e}},i.prototype.setupEventListeners=function(){var e,t,n,r,i,s,o;s=this.listeners,o=[];for(r=0,i=s.length;r<i;r++)e=s[r],o.push(function(){var r,i;r=e.events,i=[];for(t in r)n=r[t],i.push(e.element.addEventListener(t,n,!1));return i}());return o},i.prototype.removeEventListeners=function(){var e,t,n,r,i,s,o;s=this.listeners,o=[];for(r=0,i=s.length;r<i;r++)e=s[r],o.push(function(){var r,i;r=e.events,i=[];for(t in r)n=r[t],i.push(e.element.removeEventListener(t,n,!1));return i}());return o},i.prototype.disable=function(){var e,t,n,r,i;this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),r=this.files,i=[];for(t=0,n=r.length;t<n;t++)e=r[t],i.push(this.cancelUpload(e));return i},i.prototype.enable=function(){return this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()},i.prototype.filesize=function(e){var t,n,r,i,s,o,u,a;o=["TB","GB","MB","KB","b"],r=i=null;for(n=u=0,a=o.length;u<a;n=++u){s=o[n],t=Math.pow(this.options.filesizeBase,4-n)/10;if(e>=t){r=e/Math.pow(this.options.filesizeBase,4-n),i=s;break}}return r=Math.round(10*r)/10,"<strong>"+r+"</strong> "+i},i.prototype._updateMaxFilesReachedClass=function(){return this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},i.prototype.drop=function(e){var t,n;if(!e.dataTransfer)return;this.emit("drop",e),t=e.dataTransfer.files,t.length&&(n=e.dataTransfer.items,n&&n.length&&n[0].webkitGetAsEntry!=null?this._addFilesFromItems(n):this.handleFiles(t))},i.prototype.paste=function(e){var t,n;if((e!=null?(n=e.clipboardData)!=null?n.items:void 0:void 0)==null)return;this.emit("paste",e),t=e.clipboardData.items;if(t.length)return this._addFilesFromItems(t)},i.prototype.handleFiles=function(e){var t,n,r,i;i=[];for(n=0,r=e.length;n<r;n++)t=e[n],i.push(this.addFile(t));return i},i.prototype._addFilesFromItems=function(e){var t,n,r,i,s;s=[];for(r=0,i=e.length;r<i;r++)n=e[r],n.webkitGetAsEntry!=null&&(t=n.webkitGetAsEntry())?t.isFile?s.push(this.addFile(n.getAsFile())):t.isDirectory?s.push(this._addFilesFromDirectory(t,t.name)):s.push(void 0):n.getAsFile!=null?n.kind==null||n.kind==="file"?s.push(this.addFile(n.getAsFile())):s.push(void 0):s.push(void 0);return s},i.prototype._addFilesFromDirectory=function(e,t){var n,r;return n=e.createReader(),r=function(e){return function(n){var r,i,s;for(i=0,s=n.length;i<s;i++)r=n[i],r.isFile?r.file(function(n){if(e.options.ignoreHiddenFiles&&n.name.substring(0,1)===".")return;return n.fullPath=""+t+"/"+n.name,e.addFile(n)}):r.isDirectory&&e._addFilesFromDirectory(r,""+t+"/"+r.name)}}(this),n.readEntries(r,function(e){return typeof console!="undefined"&&console!==null?typeof console.log=="function"?console.log(e):void 0:void 0})},i.prototype.accept=function(e,t){return e.size>this.options.maxFilesize*1024*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(e,this.options.acceptedFiles)?this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)},i.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=i.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},i.prototype.enqueueFiles=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++)t=e[n],this.enqueueFile(t);return null},i.prototype.enqueueFile=function(e){if(e.status!==i.ADDED||e.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");e.status=i.QUEUED;if(this.options.autoProcessQueue)return setTimeout(function(e){return function(){return e.processQueue()}}(this),0)},i.prototype._thumbnailQueue=[],i.prototype._processingThumbnail=!1,i.prototype._enqueueThumbnail=function(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=this.options.maxThumbnailFilesize*1024*1024)return this._thumbnailQueue.push(e),setTimeout(function(e){return function(){return e._processThumbnailQueue()}}(this),0)},i.prototype._processThumbnailQueue=function(){if(this._processingThumbnail||this._thumbnailQueue.length===0)return;return this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(e){return function(){return e._processingThumbnail=!1,e._processThumbnailQueue()}}(this))},i.prototype.removeFile=function(e){e.status===i.UPLOADING&&this.cancelUpload(e),this.files=u(this.files,e),this.emit("removedfile",e);if(this.files.length===0)return this.emit("reset")},i.prototype.removeAllFiles=function(e){var t,n,r,s;e==null&&(e=!1),s=this.files.slice();for(n=0,r=s.length;n<r;n++)t=s[n],(t.status!==i.UPLOADING||e)&&this.removeFile(t);return null},i.prototype.createThumbnail=function(e,t){var n;return n=new FileReader,n.onload=function(r){return function(){if(e.type==="image/svg+xml"){r.emit("thumbnail",e,n.result),t!=null&&t();return}return r.createThumbnailFromUrl(e,n.result,t)}}(this),n.readAsDataURL(e)},i.prototype.createThumbnailFromUrl=function(e,t,n){var r;return r=document.createElement("img"),r.onload=function(t){return function(){var i,o,u,a,f,l,c,h;e.width=r.width,e.height=r.height,u=t.options.resize.call(t,e),u.trgWidth==null&&(u.trgWidth=u.optWidth),u.trgHeight==null&&(u.trgHeight=u.optHeight),i=document.createElement("canvas"),o=i.getContext("2d"),i.width=u.trgWidth,i.height=u.trgHeight,s(o,r,(f=u.srcX)!=null?f:0,(l=u.srcY)!=null?l:0,u.srcWidth,u.srcHeight,(c=u.trgX)!=null?c:0,(h=u.trgY)!=null?h:0,u.trgWidth,u.trgHeight),a=i.toDataURL("image/png"),t.emit("thumbnail",e,a);if(n!=null)return n()}}(this),n!=null&&(r.onerror=n),r.src=t},i.prototype.processQueue=function(){var e,t,n,r;t=this.options.parallelUploads,n=this.getUploadingFiles().length,e=n;if(n>=t)return;r=this.getQueuedFiles();if(!(r.length>0))return;if(this.options.uploadMultiple)return this.processFiles(r.slice(0,t-n));while(e<t){if(!r.length)return;this.processFile(r.shift()),e++}},i.prototype.processFile=function(e){return this.processFiles([e])},i.prototype.processFiles=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++)t=e[n],t.processing=!0,t.status=i.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)},i.prototype._getFilesWithXhr=function(e){var t,n;return n=function(){var n,r,i,s;i=this.files,s=[];for(n=0,r=i.length;n<r;n++)t=i[n],t.xhr===e&&s.push(t);return s}.call(this)},i.prototype.cancelUpload=function(e){var t,n,r,s,o,u,a;if(e.status===i.UPLOADING){n=this._getFilesWithXhr(e.xhr);for(r=0,o=n.length;r<o;r++)t=n[r],t.status=i.CANCELED;e.xhr.abort();for(s=0,u=n.length;s<u;s++)t=n[s],this.emit("canceled",t);this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else if((a=e.status)===i.ADDED||a===i.QUEUED)e.status=i.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]);if(this.options.autoProcessQueue)return this.processQueue()},r=function(){var e,t;return t=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],typeof t=="function"?t.apply(this,e):t},i.prototype.uploadFile=function(e){return this.uploadFiles([e])},i.prototype.uploadFiles=function(e){var t,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j;S=new XMLHttpRequest;for(x=0,k=e.length;x<k;x++)t=e[x],t.xhr=S;v=r(this.options.method,e),w=r(this.options.url,e),S.open(v,w,!0),S.withCredentials=!!this.options.withCredentials,y=null,o=function(n){return function(){var r,i,s;s=[];for(r=0,i=e.length;r<i;r++)t=e[r],s.push(n._errorProcessing(e,y||n.options.dictResponseError.replace("{{statusCode}}",S.status),S));return s}}(this),b=function(n){return function(r){var i,s,o,u,a,f,l,c,h;if(r!=null){s=100*r.loaded/r.total;for(o=0,f=e.length;o<f;o++)t=e[o],t.upload={progress:s,total:r.total,bytesSent:r.loaded}}else{i=!0,s=100;for(u=0,l=e.length;u<l;u++){t=e[u];if(t.upload.progress!==100||t.upload.bytesSent!==t.upload.total)i=!1;t.upload.progress=s,t.upload.bytesSent=t.upload.total}if(i)return}h=[];for(a=0,c=e.length;a<c;a++)t=e[a],h.push(n.emit("uploadprogress",t,s,t.upload.bytesSent));return h}}(this),S.onload=function(t){return function(n){var r;if(e[0].status===i.CANCELED)return;if(S.readyState!==4)return;y=S.responseText;if(S.getResponseHeader("content-type")&&~S.getResponseHeader("content-type").indexOf("application/json"))try{y=JSON.parse(y)}catch(s){n=s,y="Invalid JSON response from server."}return b(),200<=(r=S.status)&&r<300?t._finished(e,y,n):o()}}(this),S.onerror=function(t){return function(){if(e[0].status===i.CANCELED)return;return o()}}(this),g=(_=S.upload)!=null?_:S,g.onprogress=b,f={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&n(f,this.options.headers);for(u in f)a=f[u],S.setRequestHeader(u,a);s=new FormData;if(this.options.params){D=this.options.params;for(d in D)E=D[d],s.append(d,E)}for(T=0,L=e.length;T<L;T++)t=e[T],this.emit("sending",t,S,s);this.options.uploadMultiple&&this.emit("sendingmultiple",e,S,s);if(this.element.tagName==="FORM"){P=this.element.querySelectorAll("input, textarea, select, button");for(N=0,A=P.length;N<A;N++){c=P[N],h=c.getAttribute("name"),p=c.getAttribute("type");if(c.tagName==="SELECT"&&c.hasAttribute("multiple")){H=c.options;for(C=0,O=H.length;C<O;C++)m=H[C],m.selected&&s.append(h,m.value)}else(!p||(B=p.toLowerCase())!=="checkbox"&&B!=="radio"||c.checked)&&s.append(h,c.value)}}for(l=M=0,j=e.length-1;0<=j?M<=j:M>=j;l=0<=j?++M:--M)s.append(this._getParamName(l),e[l],e[l].name);return S.send(s)},i.prototype._finished=function(e,t,n){var r,s,o;for(s=0,o=e.length;s<o;s++)r=e[s],r.status=i.SUCCESS,this.emit("success",r,t,n),this.emit("complete",r);this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e));if(this.options.autoProcessQueue)return this.processQueue()},i.prototype._errorProcessing=function(e,t,n){var r,s,o;for(s=0,o=e.length;s<o;s++)r=e[s],r.status=i.ERROR,this.emit("error",r,t,n),this.emit("complete",r);this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e));if(this.options.autoProcessQueue)return this.processQueue()},i}(t),e.version="4.0.1",e.options={},e.optionsForElement=function(t){return t.getAttribute("id")?e.options[n(t.getAttribute("id"))]:void 0},e.instances=[],e.forElement=function(e){typeof e=="string"&&(e=document.querySelector(e));if((e!=null?e.dropzone:void 0)==null)throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},e.autoDiscover=!0,e.discover=function(){var t,n,r,i,s,o;document.querySelectorAll?r=document.querySelectorAll(".dropzone"):(r=[],t=function(e){var t,n,i,s;s=[];for(n=0,i=e.length;n<i;n++)t=e[n],/(^| )dropzone($| )/.test(t.className)?s.push(r.push(t)):s.push(void 0);return s},t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))),o=[];for(i=0,s=r.length;i<s;i++)n=r[i],e.optionsForElement(n)!==!1?o.push(new e(n)):o.push(void 0);return o},e.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],e.isBrowserSupported=function(){var t,n,r,i,s;t=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){s=e.blacklistedBrowsers;for(r=0,i=s.length;r<i;r++){n=s[r];if(n.test(navigator.userAgent)){t=!1;continue}}}else t=!1;else t=!1;return t},u=function(e,t){var n,r,i,s;s=[];for(r=0,i=e.length;r<i;r++)n=e[r],n!==t&&s.push(n);return s},n=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})},e.createElement=function(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.childNodes[0]},e.elementInside=function(e,t){if(e===t)return!0;while(e=e.parentNode)if(e===t)return!0;return!1},e.getElement=function(e,t){var n;typeof e=="string"?n=document.querySelector(e):e.nodeType!=null&&(n=e);if(n==null)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return n},e.getElements=function(e,t){var n,r,i,s,o,u,a,f;if(e instanceof Array){i=[];try{for(s=0,u=e.length;s<u;s++)r=e[s],i.push(this.getElement(r,t))}catch(l){n=l,i=null}}else if(typeof e=="string"){i=[],f=document.querySelectorAll(e);for(o=0,a=f.length;o<a;o++)r=f[o],i.push(r)}else e.nodeType!=null&&(i=[e]);if(i==null||!i.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return i},e.confirm=function(e,t,n){if(window.confirm(e))return t();if(n!=null)return n()},e.isValidFile=function(e,t){var n,r,i,s,o;if(!t)return!0;t=t.split(","),r=e.type,n=r.replace(/\/.*$/,"");for(s=0,o=t.length;s<o;s++){i=t[s],i=i.trim();if(i.charAt(0)==="."){if(e.name.toLowerCase().indexOf(i.toLowerCase(),e.name.length-i.length)!==-1)return!0}else if(/\/\*$/.test(i)){if(n===i.replace(/\/.*$/,""))return!0}else if(r===i)return!0}return!1},typeof jQuery!="undefined"&&jQuery!==null&&(jQuery.fn.dropzone=function(t){return this.each(function(){return new e(this,t)})}),typeof module!="undefined"&&module!==null?module.exports=e:window.Dropzone=e,e.ADDED="added",e.QUEUED="queued",e.ACCEPTED=e.QUEUED,e.UPLOADING="uploading",e.PROCESSING=e.UPLOADING,e.CANCELED="canceled",e.ERROR="error",e.SUCCESS="success",i=function(e){var t,n,r,i,s,o,u,a,f,l;u=e.naturalWidth,o=e.naturalHeight,n=document.createElement("canvas"),n.width=1,n.height=o,r=n.getContext("2d"),r.drawImage(e,0,0),i=r.getImageData(0,0,1,o).data,l=0,s=o,a=o;while(a>l)t=i[(a-1)*4+3],t===0?s=a:l=a,a=s+l>>1;return f=a/o,f===0?1:f},s=function(e,t,n,r,s,o,u,a,f,l){var c;return c=i(t),e.drawImage(t,n,r,s,o,u,a,f,l/c)},r=function(e,t){var n,r,i,s,o,u,a,f,l;i=!1,l=!0,r=e.document,f=r.documentElement,n=r.addEventListener?"addEventListener":"attachEvent",a=r.addEventListener?"removeEventListener":"detachEvent",u=r.addEventListener?"":"on",s=function(n){if(n.type==="readystatechange"&&r.readyState!=="complete")return;(n.type==="load"?e:r)[a](u+n.type,s,!1);if(!i&&(i=!0))return t.call(e,n.type||n)},o=function(){var e;try{f.doScroll("left")}catch(t){e=t,setTimeout(o,50);return}return s("poll")};if(r.readyState!=="complete"){if(r.createEventObject&&f.doScroll){try{l=!e.frameElement}catch(c){}l&&o()}return r[n](u+"DOMContentLoaded",s,!1),r[n](u+"readystatechange",s,!1),e[n](u+"load",s,!1)}},e._autoDiscoverFunction=function(){if(e.autoDiscover)return e.discover()},r(window,e._autoDiscoverFunction)}.call(this),define("dropzone",["jquery"],function(e){return function(){var t,n;return t||e.Dropzone}}(this)),function(e){"use strict";var t={prefilled:null,CapitalizeFirstLetter:!1,preventSubmitOnEnter:!0,isClearInputOnEsc:!0,externalTagId:!1,prefillIdFieldName:"Id",prefillValueFieldName:"Value",AjaxPush:null,AjaxPushAllTags:null,AjaxPushParameters:null,delimiters:[9,13,44],backspace:[8],maxTags:0,hiddenTagListName:null,hiddenTagListId:null,replace:!0,output:null,deleteTagsOnBackspace:!0,tagsContainer:null,tagCloseIcon:"x",tagClass:"",validator:null,onlyTagList:!1,tagList:null,fillInputOnTagRemove:!1},n={pushTag:function(t,n,i){var s=e(this),o=s.data("opts"),u,a,f,l,c=s.data("tlis"),h=s.data("tlid"),p,d,v,m,g,y,b,w;t=r.trimTag(t,o.delimiterChars);if(!t||t.length<=0)return;if(o.onlyTagList&&undefined!==o.tagList&&o.tagList){var E=o.tagList;e.each(E,function(e,t){E[e]=t.toLowerCase()});var S=e.inArray(t.toLowerCase(),E);if(-1===S)return}o.CapitalizeFirstLetter&&t.length>1&&(t=t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());if(o.validator&&!o.validator(t)){s.trigger("tm:invalid",t);return}if(o.maxTags>0&&c.length>=o.maxTags)return;u=!1,a=jQuery.map(c,function(e){return e.toLowerCase()}),p=e.inArray(t.toLowerCase(),a),-1!==p&&(u=!0);if(u){s.trigger("tm:duplicated",t);if(o.blinkClass)for(var x=0;x<6;++x)e("#"+s.data("tm_rndid")+"_"+h[p]).queue(function(t){e(this).toggleClass(o.blinkClass),t()}).delay(100);else e("#"+s.data("tm_rndid")+"_"+h[p]).stop().animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100)}else o.externalTagId===!0?(i===undefined&&e.error("externalTagId is not passed for tag -"+t),l=i):(f=Math.max.apply(null,h),f=f===-Infinity?0:f,l=++f),n||s.trigger("tm:pushing",[t,l]),c.push(t),h.push(l),n||o.AjaxPush!==null&&o.AjaxPushAllTags==null&&e.inArray(t,o.prefilled)===-1&&e.post(o.AjaxPush,e.extend({tag:t},o.AjaxPushParameters)),d=s.data("tm_rndid")+"_"+l,v=s.data("tm_rndid")+"_Remover_"+l,m=e("<span/>").text(t).html(),g='<span class="'+r.tagClasses.call(s)+'" id="'+d+'">',g+="<span>"+m+"</span>",g+='<a href="#" class="tm-tag-remove" id="'+v+'" TagIdToRemove="'+l+'">',g+=o.tagCloseIcon+"</a></span> ",y=e(g),o.tagsContainer!==null?e(o.tagsContainer).append(y):h.length>1?(w=s.siblings("#"+s.data("tm_rndid")+"_"+h[h.length-2]),w.after(y)):s.before(y),y.find("#"+v).on("click",s,function(t){t.preventDefault();var n=parseInt(e(this).attr("TagIdToRemove"));r.spliceTag.call(s,n,t.data)}),r.refreshHiddenTagList.call(s),n||s.trigger("tm:pushed",[t,l]),r.showOrHide.call(s);s.val("")},popTag:function(){var t=e(this),n,i,s=t.data("tlis"),o=t.data("tlid");o.length>0&&(n=o.pop(),i=s[s.length-1],t.trigger("tm:popping",[i,n]),s.pop(),e("#"+t.data("tm_rndid")+"_"+n).remove(),r.refreshHiddenTagList.call(t),t.trigger("tm:popped",[i,n]))},empty:function(){var t=e(this),n=t.data("tlis"),i=t.data("tlid"),s;while(i.length>0)s=i.pop(),n.pop(),e("#"+t.data("tm_rndid")+"_"+s).remove(),r.refreshHiddenTagList.call(t);t.trigger("tm:emptied",null),r.showOrHide.call(t)},tags:function(){var e=this,t=e.data("tlis");return t}},r={showOrHide:function(){var e=this,t=e.data("opts"),n=e.data("tlis");t.maxTags>0&&n.length<t.maxTags&&(e.show(),e.trigger("tm:show")),t.maxTags>0&&n.length>=t.maxTags&&(e.hide(),e.trigger("tm:hide"))},tagClasses:function(){var t=e(this),n=t.data("opts"),r=n.tagBaseClass,i=n.inputBaseClass,s;return s=r,t.attr("class")&&e.each(t.attr("class").split(" "),function(e,t){t.indexOf(i+"-")!==-1&&(s+=" "+r+t.substring(i.length))}),s+=n.tagClass?" "+n.tagClass:"",s},trimTag:function(t,n){var r;t=e.trim(t),r=0;for(r;r<t.length;r++)if(e.inArray(t.charCodeAt(r),n)!==-1)break;return t.substring(0,r)},refreshHiddenTagList:function(){var t=e(this),n=t.data("tlis"),r=t.data("lhiddenTagList");r&&e(r).val(n.join(t.data("opts").baseDelimiter)).change(),t.trigger("tm:refresh",n.join(t.data("opts").baseDelimiter))},killEvent:function(e){e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation(),e.preventDefault()},keyInArray:function(t,n){return e.inArray(t.which,n)!==-1},applyDelimiter:function(t){var r=e(this);n.pushTag.call(r,e(this).val()),t.preventDefault()},prefill:function(t){var r=e(this),i=r.data("opts");e.each(t,function(e,t){i.externalTagId===!0?n.pushTag.call(r,t[i.prefillValueFieldName],!0,t[i.prefillIdFieldName]):n.pushTag.call(r,t,!0)})},pushAllTags:function(t,n){var r=e(this),i=r.data("opts"),s=r.data("tlis");i.AjaxPushAllTags&&(t.type!=="tm:pushed"||e.inArray(n,i.prefilled)===-1)&&e.post(i.AjaxPush,e.extend({tags:s.join(i.baseDelimiter)},i.AjaxPushParameters))},spliceTag:function(t){var n=this,i=n.data("tlis"),s=n.data("tlid"),o=e.inArray(t,s),u;-1!==o&&(u=i[o],n.trigger("tm:splicing",[u,t]),e("#"+n.data("tm_rndid")+"_"+t).remove(),i.splice(o,1),s.splice(o,1),r.refreshHiddenTagList.call(n),n.trigger("tm:spliced",[u,t])),r.showOrHide.call(n)},init:function(i){var s=e.extend({},t,i),o,u;return s.hiddenTagListName=s.hiddenTagListName===null?"hidden-"+this.attr("name"):s.hiddenTagListName,o=s.delimeters||s.delimiters,u=[9,13,17,18,19,37,38,39,40],s.delimiterChars=[],s.delimiterKeys=[],e.each(o,function(t,n){e.inArray(n,u)!==-1?s.delimiterKeys.push(n):s.delimiterChars.push(n)}),s.baseDelimiter=String.fromCharCode(s.delimiterChars[0]||44),s.tagBaseClass="tm-tag",s.inputBaseClass="tm-input",e.isFunction(s.validator)||(s.validator=null),this.each(function(){var t=e(this),i="",o="",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(t.data("tagManager"))return!1;t.data("tagManager",!0);for(var a=0;a<5;a++)o+=u.charAt(Math.floor(Math.random()*u.length));t.data("tm_rndid",o),t.data("opts",s).data("tlis",[]).data("tlid",[]),s.output===null?(i=e("<input/>",{type:"hidden",name:s.hiddenTagListName}),t.after(i),t.data("lhiddenTagList",i)):t.data("lhiddenTagList",e(s.output)),s.AjaxPushAllTags&&(t.on("tm:spliced",r.pushAllTags),t.on("tm:popped",r.pushAllTags),t.on("tm:pushed",r.pushAllTags)),t.on("focus keypress",function(t){e(this).popover&&e(this).popover("hide")}),s.isClearInputOnEsc&&t.on("keyup",function(t){t.which===27&&(e(this).val(""),r.killEvent(t))}),t.on("keypress",function(e){r.keyInArray(e,s.delimiterChars)&&r.applyDelimiter.call(t,e)}),t.on("keydown",function(e){e.which===13&&s.preventSubmitOnEnter&&r.killEvent(e),r.keyInArray(e,s.delimiterKeys)&&r.applyDelimiter.call(t,e)}),s.deleteTagsOnBackspace&&t.on("keydown",function(i){r.keyInArray(i,s.backspace)&&e(this).val().length<=0&&(n.popTag.call(t),r.killEvent(i))}),s.fillInputOnTagRemove&&t.on("tm:popped",function(t,n){e(this).val(n)}),t.change(function(e){/webkit/.test(navigator.userAgent.toLowerCase())||t.focus(),r.killEvent(e)});if(s.prefilled!==null)typeof s.prefilled=="object"?r.prefill.call(t,s.prefilled):typeof s.prefilled=="string"?r.prefill.call(t,s.prefilled.split(s.baseDelimiter)):typeof s.prefilled=="function"&&r.prefill.call(t,s.prefilled());else if(s.output!==null){if(e(s.output)&&e(s.output).val())var f=e(s.output);r.prefill.call(t,e(s.output).val().split(s.baseDelimiter))}}),this}};e.fn.tagsManager=function(t){var i=e(this);return 0 in this?n[t]?n[t].apply(i,Array.prototype.slice.call(arguments,1)):typeof t=="object"||!t?r.init.apply(this,arguments):(e.error("Method "+t+" does not exist."),!1):this}}(jQuery),define("tagsManager",function(){}),define("type/husky-select",["type/default","form/util"],function(e){"use strict";return function(t,n){var r={id:"id",label:"value",required:!1},i={setValue:function(e){if(e===undefined||e===""||e===null)return;typeof e=="object"?this.$el.data({selection:e[this.options.id],selectionValues:e[this.options.label]}).trigger("data-changed"):this.$el.data({selection:e}).trigger("data-changed")},getValue:function(){var e={},t=this.$el.data("selection"),n=this.$el.data("selection-values"),r=this.$el.attr("data-mapper-return-value");if(!t||t.length===0)return undefined;if(typeof r!="undefined"){if(r==="id")return Array.isArray(t)?t[0]:t;if(r==="value")return Array.isArray(n)?n[0]:n}return this.$el.attr("data-mapper-property-type")==="string"?Array.isArray(n)?n[0]:n:(e[this.options.label]=Array.isArray(n)?n[0]:n,e[this.options.id]=Array.isArray(t)?t[0]:t,e)},needsValidation:function(){var e=this.getValue();return!!e},validate:function(){var e=this.getValue();return typeof e=="object"&&e.hasOwnProperty("id")?!!e.id:e!==""&&typeof e!="undefined"}};return new e(t,r,n,"husky-select",i)}}),define("type/husky-auto-complete",["type/default","form/util"],function(e){"use strict";return function(t,n){var r={id:"id",name:"name",required:!1},i={setValue:function(e){var n=t.find("input");n.length||(t.data("value",e),t.attr("data-value",JSON.stringify(e))),n.data("id",e[this.options.id]),n.attr("data-id",e[this.options.id]),n.typeahead("val",e[this.options.name])},getValue:function(){var e=t.find("input");if(!e.data("id")||e.data("id")==="null")return;var n={};return n[this.options.id]=e.data("id"),n[this.options.name]=e.val(),n},needsValidation:function(){var e=this.getValue();return!!e},validate:function(){var e=this.getValue();return typeof e=="object"&&e.hasOwnProperty("id")?!!e.id:e!==""&&typeof e!="undefined"}};return new e(t,r,n,"husky-auto-complete",i)}}),define("services/husky/url-validator",[],function(){"use strict";function n(){}var e={regex:"(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00A1-\\uFFFF0-9]+-?)*[a-z\\u00A1-\\uFFFF0-9]+)(?:\\.(?:[a-z\\u00A1-\\uFFFF0-9]+-?)*[a-z\\u00A1-\\uFFFF0-9]+)*(?:\\.(?:[a-z\\u00A1-\\uFFFF]{2,})))(?::\\d{2,5})?(?:/[^\\s]*)?",regexOptions:"im",defaultProtocols:["http://","https://","ftp://","ftps://"],specificPartKey:3,schemeKey:1,urlKey:0},t=function(t){var n=_.map(t,function(e){return e.replace("://","")}),r=t.indexOf("//")>-1,i=[r?"((":"(",n.join("|"),r?"):)?":"):","\\/{2}"].join(""),s=[];return s.push("^("),t.length>0&&(s.push(i),s.push(")(")),s.push(e.regex),s.push(")$"),new RegExp(s.join(""),e.regexOptions)};return n.prototype.getDefaultSchemes=function(){return e.defaultProtocols},n.prototype.test=function(e,n){return n||(n=this.getDefaultSchemes()),t(n).test(e)},n.prototype.match=function(n,r){r||(r=this.getDefaultSchemes());if(!n)return!1;var i=n.match(t(r));return i?{scheme:i[e.schemeKey],specificPart:i[e.specificPartKey]}:i},new n}),define("type/husky-input",["type/default","services/husky/url-validator"],function(e,t){"use strict";return function(n,r){var i={id:"id",label:"value",required:!1,dateFormat:"d",timeFormat:"t"},s={phone:function(e){var t=/^[0-9 \\(\\)/+-]*$/;return t.test(e)},password:function(e){var t=/^.{6,30}$/;return t.test(e)},email:function(e){var t=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))){2,6}$/i;return t.test(e)},url:function(e){return t.test(e,[])},time:function(e){return Globalize.parseDate(e,this.options.timeFormat)!==null},color:function(e){var t=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;return t.test(e)}},o={"default":function(e){this.$el.data({value:e}).trigger("data-changed")},time:function(e){var t=Globalize.parseDate(e,"HH:mm:ss");o.default.call(this,Globalize.format(t,this.options.timeFormat))}},u={"default":function(){return this.$el.find("input").val()},time:function(){var e=u.default.call(this),t=Globalize.parseDate(e,this.options.timeFormat);return e===""?e:Globalize.format(t,"HH:mm:ss")},date:function(){return this.$el.data("value")}},a={setValue:function(e){var t=this.$el.data("auraSkin"),n=o[t]||o.default;n.call(this,e)},getValue:function(){var e=this.$el.data("auraSkin"),t=u[e]||u.default;return t.call(this)},needsValidation:function(){var e=this.getInputValue();return e!==""},getInputValue:function(){var e=this.$el.data("auraSkin");return e==="data"?u.date.call(this):u.default.call(this)},validate:function(){var e=this.getInputValue(),t=this.$el.data("auraSkin");return!t||!s[t]?!0:s[t].call(this,e)}};return new e(n,i,r,"husky-input",a)}}),define("type/url-input",["type/default","services/husky/url-validator"],function(e,t){"use strict";return function(n,r){var i={schemes:t.getDefaultSchemes()},s={dataKey:"url-data",dataChangedEvent:"data-changed"},o={setValue:function(e){var n=t.match(e,this.options.schemes);!n||(this.$el.data(s.dataKey,n),this.$el.trigger(s.dataChangedEvent))},getValue:function(){var e=this.$el.data(s.dataKey);return!e||!e.scheme||!e.specificPart?null:e.scheme+e.specificPart},needsValidation:function(){return this.getValue()!==null},validate:function(){var e=this.getValue();return t.test(e,this.options.schemes)}};return new e(n,i,r,"url-input",o)}}),require.config({paths:{sprintf:"bower_components/sprintf/sprintf"}}),define("services/husky/util",["sprintf"],function(e){"use strict";function s(){}var t=null,n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},r=function(e,t){var n=$.Deferred(),r=document.createElement("canvas"),i;return r.width=e.get(0).width,r.height=e.get(0).height,i=r.getContext("2d"),i.drawImage(e.get(0),0,0),r.toBlob(function(e){n.resolve(e)},t),n.promise()},i=function(e,t){var n=0,r=-1,i,s,o;for(s=0;s<e.length;s++){i=!1;for(o=r+1;o<t.length;o++)if(e[s]===t[o]){n+=1,r=s,i=!0;break}if(!i)break}return n};return s.prototype.compare=function(e,t){if(typeof e=="object"&&typeof t=="object")return JSON.stringify(e)===JSON.stringify(t)},s.prototype.typeOf=function(e){var t=typeof e;return t==="object"&&(e?e instanceof Array&&(t="array"):t="null"),t},s.prototype.isEqual=_.isEqual,s.prototype.isEmpty=_.isEmpty,s.prototype.foreach=function(e,t){if(e.length&&e.length>0)for(var n=-1,r=e.length;++n<r;)t(e[n],n)},s.prototype.load=function(e,t,n){var r=new $.Deferred,i={url:e,data:t||null,dataType:"json",success:function(e,t){r.resolve(e,t)}.bind(this),error:function(e,t,n){r.reject(t,n)}};return typeof n!="undefined"&&(i.dataType=n),this.ajax(i),r.promise()},s.prototype.save=function(e,t,n){var r=$.Deferred();return this.ajax({headers:{"Content-Type":"application/json"},url:e,type:t,data:JSON.stringify(n),success:function(e,t){r.resolve(e,t)}.bind(this),error:function(e,t,n){r.reject(e,t,n)}}),r.promise()},s.prototype.cropMiddle=function(e,t,n){var r;return!e||e.length<=t||!e.slice?e:(n||(n="..."),r=Math.floor((t-n.length)/2),e.slice(0,r)+n+e.slice(-r))},s.prototype.cropFront=function(e,t,n){return!e||e.length<=t||!e.slice?e:(n=n||"...",n+e.slice(-(t-n.length)))},s.prototype.cropTail=function(e,t,n){return!e||e.length<=t||!e.slice?e:(n=n||"...",e.slice(0,t-n.length)+n)},s.prototype.contains=function(e,t){return _.contains(e,t)},s.prototype.isAlphaNumeric=function(e){var t,n,r;for(n=0,r=e.length;n<r;n++){t=e.charCodeAt(n);if(!(t>47&&t<58)&&!(t>64&&t<91)&&!(t>96&&t<123))return!1}return!0},s.prototype.uniqueId=function(e){return _.uniqueId(e)},s.prototype.delay=function(e,t){return _.delay(e,t)},s.prototype.union=function(){return _.union.apply(this,arguments)},s.prototype.each=$.each,s.prototype.ajax=$.ajax,s.prototype.ajaxError=function(e){$(document).ajaxError(e)},s.prototype.when=function(){return $.when.apply(null,arguments)},s.prototype.deepCopy=function(e){var t={};return $.isArray(e)&&(t=[]),$.extend(!0,t,e)},s.prototype.arrayGetColumn=function(e,t){if(s.prototype.typeOf(e)==="array"&&e.length>0&&s.prototype.typeOf(e[0])==="object"){var n=[];return s.prototype.foreach(e,function(e){n.push(e[t])}.bind(this)),n}return e},s.prototype.removeFromArray=function(e,t){return $.grep(e,function(e){return t.indexOf(e)==-1})},s.prototype.getParameterByName=function(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)"),r=n.exec(t);return r===null?"":decodeURIComponent(r[1].replace(/\+/g," "))},s.prototype.template=_.template,s.prototype.extend=$.extend,s.prototype.Deferred=$.Deferred,s.prototype.arrayMap=_.map,s.prototype.object=_.object,s.prototype.escapeHtml=function(e){return e?String(e).replace(/[&<>"'\/]/g,function(e){return n[e]}):e},s.prototype.capitalizeFirstLetter=function(e){return e.slice?e.charAt(0).toUpperCase()+e.slice(1):e},s.prototype.formatBytes=function(e){if(e===0)return"0 Byte";var t=1e3,n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.floor(Math.log(e)/Math.log(t));return(e/Math.pow(t,r)).toFixed(2)+" "+n[r]},s.prototype.compareURIs=function(e,t){var n=e.split("/"),r=t.split("/"),s,o;return s=i(n,r),o=n.length-s,s-o},s.prototype.sprintf=e.sprintf,s.prototype.loadImageAsBlob=function(e,t){var n=$("<div/>"),i=$('<img crossOrigin="Anonymous" src="'+e+'"/>'),s=$.Deferred();return n.width(0),n.height(0),n.css("visibility","hidden"),$("body").append(n),i.on("load",function(){r(i,t).then(function(e){n.remove(),s.resolve(e)})}),n.append(i),s},s.getInstance=function(){return t==null&&(t=new s),t},s.getInstance()}),define("services/husky/mediator",[],function(){"use strict";function t(){}var e=null;return t.getInstance=function(){return e==null&&(e=new t),e},t.prototype.on=window.Husky.on,t.prototype.once=window.Husky.once,t.prototype.off=window.Husky.off,t.prototype.emit=window.Husky.emit,t.getInstance()}),define("services/husky/translator",[],function(){"use strict";function t(){}var e=null;return t.getInstance=function(){return e==null&&(e=new t),e},t.prototype.translate=window.Husky.translate,t.getInstance()}),define("services/husky/storage",[],function(){"use strict";function e(){this.values={}}e.prototype.set=function(e,t){this.values[e]=t},e.prototype.remove=function(e,t){delete this.values[e]},e.prototype.has=function(e){return this.values.hasOwnProperty(e)},e.prototype.get=function(e){if(!this.has(e))throw'Value for key "'+e+'" does not exist';return this.values[e]},e.prototype.getWithDefault=function(e,t){return this.has(e)?this.get(e):t};var t={};return{get:function(n,r){var i=n+"."+r;return t.hasOwnProperty(i)||(t[i]=new e),t[i]}}}),define("bower_components/aura/lib/platform",[],function(){typeof Function.prototype.bind!="function"&&(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice.call(arguments,1);return function(){return t.apply(e,Array.prototype.concat.apply(n,arguments))}}),typeof Array.isArray!="function"&&(Array.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"}),Object.create||(Object.create=function(e){function t(){}if(arguments.length>1)throw new Error("Object.create implementation only accepts the first parameter.");return t.prototype=e,new t}),Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(i){if(typeof i!="object"&&typeof i!="function"||i===null)throw new TypeError("Object.keys called on non-object");var s=[];for(var o in i)e.call(i,o)&&s.push(o);if(t)for(var u=0;u<r;u++)e.call(i,n[u])&&s.push(n[u]);return s}}())}),function(){window.jQuery?define("jquery",[],function(){return window.jQuery}):require.config({paths:{jquery:"bower_components/jquery/jquery"},shim:{jquery:{exports:"$"}}}),window._?define("underscore",[],function(){return window._}):require.config({paths:{underscore:"bower_components/underscore/underscore"},shim:{underscore:{exports:"_"}}}),define("bower_components/aura/lib/base",["module","underscore","jquery","./platform"],function(e,t,n,r){require.s.contexts._.config.paths.aura||require.config({paths:{aura:e.id.replace(/base$/,"")}});var i={};return i.dom={find:function(e,t){return t=t||document,n(t).find(e)},contains:function(e,t){return n.contains(t||document,e)},data:function(e,t){return n(e).data(t)}},i.data={deferred:n.Deferred,when:n.when},i.util={each:n.each,extend:n.extend,uniq:t.uniq,_:t,decamelize:function(e,t){return t=t===undefined?"_":t,e.replace(/([A-Z])/g,t+"$1").toLowerCase()}},i.events={listen:function(e,t,r,i){return n(e).on(t,r,i)},bindAll:function(){return t.bindAll.apply(this,arguments)}},i.template={parse:t.template},i})}(),define("bower_components/aura/lib/logger",[],function(){"use strict";function n(t){return this.name=t,this._log=e,this._warn=e,this._error=e,this._enabled=!1,this}var e=function(){},t=window.console||{};return n.prototype.isEnabled=function(){return this._enabled},n.prototype.setName=function(e){this.name=e},n.prototype.enable=function(){if(Function.prototype.bind&&typeof t=="object"){var n=["log","warn","error"];for(var r=0;r<n.length;r++)t[n[r]]=Function.prototype.call.bind(t[n[r]],t)}return this._log=t.log||e,this._warn=t.warn||this._log,this._error=t.error||this._log,this._enabled=!0,this},n.prototype.write=function(e,n){var r=Array.prototype.slice.call(n);r.unshift(this.name+":"),e.apply(t,r)},n.prototype.log=function(){this.write(this._log,arguments)},n.prototype.warn=function(){this.write(this._warn,arguments)},n.prototype.error=function(){this.write(this._error,arguments)},n}),define("bower_components/aura/lib/aura.extensions",["./base","./logger"],function(e,t){function u(){return this._extensions=[],this.initStatus=i(),this}function a(){var e=r.call(arguments),t;for(var n=0,i=e.length;n<i;n++){t=e[n];if(typeof t=="function")return t}return function(){}}function f(e){return typeof e=="function"?e.apply(undefined,r.call(arguments,1)):e}function l(e){var t=i(),n=e.ref,r=e.context,o=c(n,r);return o.fail(t.reject),o.done(function(e){if(!e)return t.resolve();var n=s(a(e,e.initialize)(r));n.done(function(){t.resolve(e)}),n.fail(t.reject)}),t.promise()}function c(e,t){var n=i(),r=function(e){e=f(e,t);if(e&&e.require&&e.require.paths){var r=Object.keys(e.require.paths)||[];require.config(e.require),require(r,function(){n.resolve(e)},s)}else n.resolve(e)},s=function(t){o.error("Error loading ext:",e,t),n.reject(t)};return typeof e=="string"?require([e],r,s):r(e),n}var n=e.util._,r=Array.prototype.slice,i=e.data.deferred,s=e.data.when,o=(new t("Extensions")).enable();return u.prototype.add=function(e){if(n.include(this._extensions,e)){var t=e.ref.toString()+" is already registered.";throw t+="Extensions can only be added once.",new Error(t)}if(this.initStarted)throw new Error("Init extensions already called");return this._extensions.push(e),this},u.prototype.onReady=function(e){return this.initStatus.then(e),this},u.prototype.onFailure=function(e){return this.initStatus.fail(e),this},u.prototype.init=function(){if(this.initStarted)throw new Error("Init extensions already called");this.initStarted=!0;var e=n.compact(this._extensions.slice(0)),t=[],r=this.initStatus;return function i(n){if(n){var o=l(n);t.push(o),o.done(function(){i(e.shift())}),o.fail(function(e){e||(e="Unknown error while loading an extension"),e instanceof Error||(e=new Error(e)),r.reject(e)})}else e.length===0&&s.apply(undefined,t).done(function(){r.resolve(Array.prototype.slice.call(arguments))})}(e.shift()),r.promise()},u}),define("bower_components/aura/lib/aura",["./base","./aura.extensions","./logger"],function(e,t,n){function o(i){function l(e){typeof e=="string"&&(e=u.sandboxes.get(e));if(e){var t=["aura","sandbox","stop"].join(u.config.mediator.delimiter);return r.invoke(e._children,"stop"),u.core.mediator.emit(t,e),e._component&&(e._component.invokeWithCallbacks("remove"),e._component.invokeWithCallbacks("destroy")),e.stopped=!0,e.el&&u.core.dom.find(e.el).remove(),a[e.ref]=null,delete a[e.ref],e}}if(this instanceof o){var s=new t,u=this;u.ref=r.uniqueId("aura_"),u.config=i=i||{},u.config.sources=u.config.sources||{"default":"./aura_components"};var a={},f=Object.create(e);u.sandboxes={},u.sandboxes.create=function(e,t){e=e||r.uniqueId("sandbox-");if(a[e])throw new Error("Sandbox with ref "+e+" already exists.");var s=Object.create(f);s.ref=e||r.uniqueId("sandbox-"),s.logger=new n(s.ref),a[s.ref]=s;var o=i.debug;return(o===!0||o.enable&&(o.components.length===0||o.components.indexOf(e)!==-1))&&s.logger.enable(),r.extend(s,t||{}),s},u.sandboxes.get=function(e){return a[e]},u.use=function(e){return s.add({ref:e,context:u}),u},u.components={},u.components.addSource=function(e,t){if(i.sources[e])throw new Error("Components source '"+e+"' is already registered");return i.sources[e]=t,u},u.core=Object.create(e),u.start=function(t){if(u.started)return u.logger.error("Aura already started!"),s.initStatus;u.logger.log("Starting Aura");var n=t||{};return typeof t=="string"?n={components:u.core.dom.find(t)}:Array.isArray(t)?n={components:t}:t&&t.widgets&&!t.components?n.components=t.widgets:n.components===undefined&&(n.components=u.core.dom.find(u.config.components||"body")),s.onReady(function(t){e.util.each(t,function(e,t){t&&typeof t.afterAppStart=="function"&&t.afterAppStart(u)})}),s.onFailure(function(){u.logger.error("Error initializing app:",u.config.name,arguments),u.stop()}),u.startOptions=n,u.started=!0,s.init()},u.stop=function(){u.started=!1},u.cleanUp=function(){r.defer(function(){r.each(a,function(e){!!e&&!!e.el&&!u.core.dom.contains($(e.el)[0],document)&&e.stop()})})},u.sandbox=f,u.logger=new n(u.ref),u.sandbox.stop=function(e){var t=u.sandboxes.get(e);t&&l(t);try{$.find(e)}catch(n){return n}e?u.core.dom.find(e,this.el).each(function(e,t){var n=u.core.dom.find(t).data("__sandbox_ref__");l(n)}):l(this)},i.debug=i.debug||{};var c=i.debug;return c===!0&&(i.debug=c={enable:!0}),c.enable&&(c.components?c.components=c.components.split(" "):c.components=[],u.logger.enable(),u.use("aura/ext/debug")),u.use("aura/ext/mediator"),u.use("aura/ext/components"),u}return new o(i)}var r=e.util._,i=function(){},s=Object.freeze||i;return o}),define("husky",["bower_components/aura/lib/aura"],function(e){"use strict";function t(n){if(!(this instanceof t))return new t(n);e.call(this,n);var r=this;r.components.addSource("husky","./husky_components"),r.use("./husky_extensions/jquery"),r.use("./husky_extensions/backbone"),r.use("./husky_extensions/collection"),r.use("./husky_extensions/model"),r.use("./husky_extensions/html.sortable"),r.use("./husky_extensions/husky-validation"),r.use("./husky_extensions/util"),r.use("./husky_extensions/confirm"),r.use("./husky_extensions/template"),r.use("./husky_extensions/globalize"),r.use("./husky_extensions/uri-template"),r.use("./husky_extensions/ckeditor-extension"),r.use("./husky_extensions/typeahead"),r.use("./husky_extensions/tagmanager"),r.use("./husky_extensions/dropzone"),r.use("./husky_extensions/colorpicker"),r.use("./husky_extensions/datepicker"),r.use("./husky_extensions/itembox"),r.use("./husky_extensions/itemgrid"),r.use("./husky_extensions/cache-factory"),r.use("./husky_extensions/infinite-scroll"),r.use(function(e){window.Husky=e.sandboxes.create("husky-sandbox")})}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.version="0.1.0",t}),define("__component__$navigation@husky",[],function(){"use strict";var e={skeleton:['<nav class="navigation<% if (collapsed === "true") {%> collapsed<% } %>">','   <div class="navigation-content">','       <div class="fa-chevron-left navigation-close-icon"></div>','       <div class="wrapper">','           <header class="navigation-header">','               <div class="logo"></div>','               <div class="navigation-header-title"><% if (data.title) { %> <%= translate(data.title) %><% } %></div>',"           </header>",'           <div id="navigation-item-container" class="navigation-item-container"></div>',"       </div>","       <footer>","       </footer>","   </div>","</nav>"].join(""),mainItem:['<li class="js-navigation-items navigation-items" id="<%= item.id %>" data-id="<%= item.id %>">','   <div <% if (!!item.items && item.items.length > 0) { %> class="navigation-items-toggle" <% } %> >','       <a class="<% if (!!item.action || !!item.event) { %>js-navigation-item <% } %>navigation-item" href="#">','           <span class="<%= icon %> navigation-item-icon"></span>','           <span class="navigation-item-title"><%= translate(item.title) %></span>',"       </a>","       <% if (!!item.items && item.items.length > 0) { %>",'           <a class="fa-chevron-right navigation-toggle-icon" href="#"></a>',"       <% } %>","   </div>","</li>"].join(""),subToggleItem:['   <li class="js-navigation-items navigation-subitems" id="<%= item.id %>" data-id="<%= item.id %>">','       <div class="navigation-subitems-toggle">','           <a class="<% if (!!item.action || !!item.event) { %>js-navigation-item <% } %> navigation-item" href="#"><%= translate(item.title) %></a>','           <a class="fa-chevron-right navigation-toggle-icon" href="#"></a>',"       </div>","</li>"].join(""),subItem:['<li class="js-navigation-sub-item" id="<%= item.id %>" data-id="<%= item.id %>">','   <a href="#"><%= translate(item.title) %></a>',"</li>"].join(""),footer:['<div class="user">','   <span class="fa-user pic"></span>','   <div class="name"><%= userName %></div>',"</div>",'<div class="options">','   <div class="locale-dropdown"></div>','       <a href="<%= logoutRoute %>" title="Logout" class="fa-lock logout"></a>',"   </div>",'<div class="version"><%= system %> (<%= version %>, <a href="#"><%= versionHistory %></a>)</div>'].join("")},t={footerTemplate:"",collapsed:!1,resizeWidth:1300,forceCollapse:!1,systemName:"Sulu 2.0",footer:!0,logoutRoute:"/logout",translations:{versionHistory:"navigation.version-history",user:"navigation.user"}},n={COMPONENT_CLASS:"husky-navigation",UNCOLLAPSED_WIDTH:250,COLLAPSED_WIDTH:50,ITEM_LABEL_HEIGHT:50,TRANSITIONEND_EVENT:"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",HIDDEN_CLASS:"disappeared"},r="husky.navigation.",i=r+"header.clicked",s=r+"item.select",o=r+"select-item",u=r+"select-id",a=r+"collapsed",f=r+"uncollapsed",l=r+"collapse",c=r+"uncollapse",h=r+"size.change",p=r+"size.changed",d=r+"user-locale.changed",v=r+"version-history.clicked",m=r+"username.clicked",g=r+"show",y=r+"size.update",b=r+"hide";return{initialize:function(){this.sandbox.logger.log("Initialized Navigation"),this.options=this.sandbox.util.extend(!0,{},t,this.options),this.stayCollapsed=!1,this.hidden=!1,this.tooltipsEnabled=!0,this.animating=!1,this.items=[],this.bindDOMEvents(),this.bindCustomEvents(),!this.options.url||this.sandbox.util.load(this.options.url,null,"json").then(function(e){this.options.data=e,this.render(),this.sandbox.emit("husky.navigation.initialized")}.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this))},render:function(){this.sandbox.dom.addClass(this.$el,n.COMPONENT_CLASS),this.renderSkeleton(),this.renderNavigationItems(this.options.data),this.renderFooter(),this.resizeListener(),!!this.options.selectAction&&this.options.selectAction.length>0&&this.preselectItem(this.options.selectAction)},renderSkeleton:function(){this.sandbox.dom.html(this.$el,this.sandbox.template.parse(e.skeleton,this.sandbox.util.extend(!0,{},this.options,{translate:this.sandbox.translate}))),this.$navigation=this.$find(".navigation"),this.$navigationContent=this.$find(".navigation-content")},renderNavigationItems:function(t){var n,r,i;this.sandbox.util.foreach(t.items,function(t){if(!t.items||!t.items.length)return;r=this.sandbox.dom.createElement('<div class="section">'),i=this.sandbox.dom.createElement('<ul class="section-items">');var s;!t.title||!(s=this.sandbox.translate(t.title))?!!n&&n.children().length>0&&this.sandbox.dom.append(r,'<hr class="section-headline-divider"/>'):this.sandbox.dom.append(r,'<div class="section-headline"><span class="section-headline-title">'+s.toUpperCase()+"</span></div>"),this.sandbox.dom.append(r,i),this.sandbox.dom.append("#navigation-item-container",r),this.sandbox.util.foreach(t.items,function(t){n=this.sandbox.dom.createElement(this.sandbox.template.parse(e.mainItem,{item:t,icon:t.icon?"fa-"+t.icon:"",translate:this.sandbox.translate})),this.sandbox.dom.append(i,n),t.items&&t.items.length>0&&this.renderSubNavigationItems(t,n),t.domObject=n,this.items.push(t)}.bind(this))}.bind(this))},renderSubNavigationItems:function(t,n){var r,i,s=this.sandbox.dom.createElement('<ul class="navigation-items-list" />');this.sandbox.dom.append(n,s),this.sandbox.util.foreach(t.items,function(n){n.parentTitle=t.title,this.items.push(n),!!n.items&&n.items.length>0?(r=this.sandbox.dom.createElement(this.sandbox.template.parse(e.subToggleItem,{item:n,translate:this.sandbox.translate})),this.renderSubNavigationItems(n,this.sandbox.dom.find("div",r))):r=this.sandbox.dom.createElement(this.sandbox.template.parse(e.subItem,{item:n,translate:this.sandbox.translate})),this.sandbox.dom.append(s,r),i=this.sandbox.dom.find("a",r),this.sandbox.dom.width(i)+20<this.sandbox.dom.get(i,0).scrollWidth&&this.sandbox.dom.attr(i,{title:this.sandbox.dom.html(i)}),n.domObject=r}.bind(this))},renderFooter:function(){if(this.options.footer===!0){var t=this.sandbox.dom.find("footer",this.$el);this.sandbox.dom.html(t,_.template(e.footer)({userName:this.sandbox.util.escapeHtml(this.options.userName),system:this.options.systemName,version:this.options.systemVersion,versionHistory:this.sandbox.translate(this.options.translations.versionHistory),logoutRoute:this.options.logoutRoute})),this.sandbox.start([{name:"select@husky",options:{el:this.sandbox.dom.find(".locale-dropdown",t),instanceName:"navigation-locale",value:"name",data:this.options.userLocales,preSelectedElements:[this.options.userLocale],style:"small",emitValues:!0}}])}},collapsedFooterClickHandler:function(){this.unCollapse(!0),this.sandbox.dom.one(this.sandbox.dom.$window,n.TRANSITIONEND_EVENT,this.checkBottomHit.bind(this,null,this.sandbox.dom.find("footer",this.$el)))},bindDOMEvents:function(){this.sandbox.dom.on(this.$el,"click",this.toggleItems.bind(this),".navigation-items-toggle, .navigation-subitems-toggle"),this.sandbox.dom.on(this.$el,"click",function(e){e.preventDefault(),this.selectMenuItem(e.currentTarget),_.delay(this.resizeListener.bind(this),700)}.bind(this),".js-navigation-sub-item, .js-navigation-item"),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(i)}.bind(this),".navigation-header div"),this.sandbox.dom.on(this.sandbox.dom.window,"resize",this.resizeListener.bind(this)),this.sandbox.dom.on(this.$el,"click",this.collapse.bind(this),".navigation.collapseIcon .navigation-close-icon"),this.sandbox.dom.on(this.$el,"click",this.collapsedFooterClickHandler.bind(this),".navigation.collapsed footer"),this.sandbox.dom.on(this.$el,"mouseenter",function(e){this.showToolTip.call(this,this.sandbox.translate(this.options.translations.user),e)}.bind(this),".navigation.collapsed footer"),this.sandbox.dom.on(this.$el,"mouseenter",this.showToolTip.bind(this,""),".navigation.collapsed .navigation-items"),this.sandbox.dom.on(this.$el,"mouseleave",this.hideToolTip.bind(this),".navigation.collapsed .navigation-items, .navigation.collapsed, .navigation.collapsed footer"),this.sandbox.dom.on(this.$el,n.TRANSITIONEND_EVENT,function(){this.sandbox.emit(p,this.sandbox.dom.width(this.$navigation)),this.tooltipsEnabled=!0}.bind(this)),this.sandbox.dom.on(this.$el,n.TRANSITIONEND_EVENT,function(e){e.stopPropagation()}.bind(this),".navigation *"),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(v)}.bind(this),"footer .version a"),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(m)}.bind(this),"footer .user")},bindCustomEvents:function(){this.sandbox.on("husky.navigation.footer.set",function(e){this.options=this.sandbox.util.extend(!0,{},this.options,e),this.renderFooter()}.bind(this)),this.sandbox.on("husky.select.navigation-locale.selected.item",function(e){this.sandbox.emit(d,e)}.bind(this)),this.sandbox.on(l,function(e){this.stayCollapsed=typeof e=="boolean"?e:!1,this.collapse()}.bind(this)),this.sandbox.on(c,function(e){this.stayCollapsed=!1,this.unCollapse(e)}.bind(this)),this.sandbox.on(b,this.hide.bind(this)),this.sandbox.on(g,this.show.bind(this)),this.sandbox.on(y,this.resizeListener.bind(this)),this.sandbox.on(o,this.preselectItem.bind(this)),this.sandbox.on(u,this.selectItem.bind(this))},resizeListener:function(){var e=this.sandbox.dom.width(this.sandbox.dom.window);e<=this.options.resizeWidth||this.stayCollapsed===!0?this.collapse():this.sandbox.dom.hasClass(this.$navigation,"collapsed")&&this.unCollapse()},showToolTip:function(e,t){if(this.tooltipsEnabled===!0){var n,r=t.currentTarget;e||(e=this.sandbox.dom.html(this.sandbox.dom.find(".navigation-item-title",t.currentTarget))),this.$tooltip||(this.$tooltip=this.sandbox.dom.createElement('<div class="navigation-tooltip">'+e+"</div>"),this.sandbox.dom.append("body",this.$tooltip)),n=this.sandbox.dom.offset(r),this.sandbox.dom.css(this.$tooltip,{top:n.top+(this.sandbox.dom.outerHeight(r)-30)/2})}},hideToolTip:function(){!this.$tooltip||(this.sandbox.dom.remove(this.$tooltip),this.$tooltip=null)},preselectItem:function(e){var t=0,n,r,i,s;this.sandbox.util.foreach(this.items,function(i){if(!i||!i.action)return;n=this.sandbox.util.compareURIs(i.action,e),n>t&&(r=i,t=n)}.bind(this)),!!r&&t>0?(s=r.domObject,this.sandbox.dom.hasClass(s,"js-navigation-sub-item")&&(i=this.sandbox.dom.closest(s,".navigation-items"),this.sandbox.dom.hasClass(i,"is-expanded")||this.toggleItems(null,i)),this.selectMenuItem(s,!1),this.checkBottomHit(null,s)):this.unmarkSelectedItem()},selectItem:function(e,t){var n=this.getItemById(e),r=n.domObject,i;if($(r).hasClass("is-selected"))return;this.sandbox.dom.hasClass(r,"js-navigation-sub-item")&&(i=this.sandbox.dom.closest(r,".navigation-items"),this.sandbox.dom.hasClass(i,"is-expanded")||this.toggleItems(null,i)),this.selectMenuItem(r,!1,t),this.checkBottomHit(null,r)},toggleItems:function(e,t){e?e.preventDefault():e={currentTarget:t};var n=this.sandbox.dom.closest(e.currentTarget,".js-navigation-items"),r=this.sandbox.dom.find("ul:first",n),i,s,o=this.sandbox.dom.hasClass(n,"is-expanded"),u;t||(u=this.showIfCollapsed()),o&&!u?(s=this.sandbox.dom.find(".fa-chevron-down",e.currentTarget),this.animateSlideUp(n,s)):this.collapsed!==!0&&(s=this.sandbox.dom.find(".fa-chevron-right",e.currentTarget),this.animateSlideDown(n,s,r)),i=this.getItemById(this.sandbox.dom.data(n,"id")),this.sandbox.emit("husky.navigation.item.toggle",!o,i)},animateSlideUp:function(e,t){this.animating===!1&&(this.animating=!0,this.sandbox.dom.animate(e,{height:n.ITEM_LABEL_HEIGHT},{duration:180,complete:function(){this.animating=!1}.bind(this)}),this.sandbox.dom.removeClass(e,"is-expanded"),this.sandbox.dom.removeClass(t,"fa-chevron-down"),this.sandbox.dom.prependClass(t,"fa-chevron-right"))},animateSlideDown:function(e,t,r){if(this.animating===!1){this.animating=!0;var i=n.ITEM_LABEL_HEIGHT+this.sandbox.dom.outerHeight(r);this.sandbox.dom.stop(e),this.sandbox.dom.animate(e,{height:i+30},{duration:120}),this.sandbox.dom.animate(e,{height:i},{duration:100,complete:function(){this.animating=!1}.bind(this)}),this.sandbox.dom.addClass(e,"is-expanded"),this.sandbox.dom.removeClass(t,"fa-chevron-right"),this.sandbox.dom.prependClass(t,"fa-chevron-down"),this.sandbox.dom.one(e,n.TRANSITIONEND_EVENT,this.checkBottomHit.bind(this))}},checkBottomHit:function(e,t){var n,r,i,s,o,u;e?u=e.currentTarget:u=t,s=this.sandbox.dom.offset(u).top,i=this.sandbox.dom.height(u),n=s+i,r=this.sandbox.dom.height(this.sandbox.dom.window),o=this.sandbox.dom.scrollTop(this.$navigationContent),n>r&&(i<r?this.sandbox.dom.scrollAnimate(o+(n-r+40),this.$navigationContent):this.sandbox.dom.scrollAnimate(s,this.$navigationContent))},removeHeightforExpanded:function(){var e=this.sandbox.dom.find(".is-expanded",this.$el),t,n;for(t=-1,n=e.length;++t<n;)this.sandbox.dom.removeAttr(e[t],"style")},setHeightForExpanded:function(){var e=this.sandbox.dom.find(".is-expanded",this.$el),t,r,i;for(r=-1,i=e.length;++r<i;)t=n.ITEM_LABEL_HEIGHT+this.sandbox.dom.outerHeight(this.sandbox.dom.find(".navigation-items-list",e[r])),this.sandbox.dom.css(e[r],{height:t})},showIfCollapsed:function(){return this.sandbox.dom.hasClass(this.$navigation,"collapsed")?(this.unCollapse(!0),!0):!1},collapse:function(){this.hidden===!1&&(this.sandbox.dom.addClass(this.$navigation,"collapsed"),this.sandbox.dom.removeClass(this.$navigation,"collapseIcon"),this.removeHeightforExpanded(),this.collapsed||(this.sandbox.dom.css(this.$el,{width:""}),this.sandbox.emit(a,n.COLLAPSED_WIDTH),this.sandbox.emit(h,n.COLLAPSED_WIDTH),this.collapsed=!0,this.tooltipsEnabled=!1))},unCollapse:function(e){(this.stayCollapsed===!1||e===!0)&&this.hidden===!1&&(e?(this.sandbox.dom.width(this.$el,this.sandbox.dom.width(this.$navigation)),this.sandbox.dom.addClass(this.$navigation,"collapseIcon")):(this.sandbox.dom.removeClass(this.$navigation,"collapseIcon"),this.sandbox.dom.css(this.$el,{width:""})),this.sandbox.dom.removeClass(this.$navigation,"collapsed"),this.hideToolTip(),this.setHeightForExpanded(),this.collapsed&&(this.sandbox.emit(f,n.UNCOLLAPSED_WIDTH,e),e||this.sandbox.emit(h,n.UNCOLLAPSED_WIDTH),this.collapsed=!this.collapsed,this.tooltipsEnabled=!1))},selectMenuItem:function(e,t,n){var r=$(e),i,s;r.hasClass("js-navigation-item")&&(r=$(e).closest("li"));if(r.hasClass("is-selected"))return;if($(e).parent().hasClass("navigation-items-toggle")||$(e).parent().hasClass("navigation-subitems-toggle"))return;i=this.getItemById(this.sandbox.dom.data(r,"id")),s=this.sandbox.util.extend(!0,{},i,n);if(!!i.event&&t!==!1){this.emitItemSelectEvent(s);return}t!==!1&&this.emitItemSelectEvent(s),this.markItemSelected(r)},markItemSelected:function(e){this.unmarkSelectedItem(),e.addClass("is-selected"),e.closest(".js-navigation-items").addClass("is-active")},unmarkSelectedItem:function(){this.sandbox.dom.removeClass(this.$find(".is-selected"),"is-selected"),this.sandbox.dom.removeClass(this.$find(".is-active"),"is-active")},emitItemSelectEvent:function(e){e.event?this.sandbox.emit("husky.navigation.item.event."+e.event,e.eventArgs):this.sandbox.emit(s,e)},getItemById:function(e){for(var t=-1,n=this.items.length;++t<n;)if(e==this.items[t].id)return this.items[t];return null},show:function(){this.sandbox.dom.removeClass(this.$navigation,n.HIDDEN_CLASS),!this.currentNavigationWidth||(this.sandbox.dom.removeAttr(this.$navigation,"style"),this.currentNavigationWidth=null,this.hidden=!1)},hide:function(){this.sandbox.dom.addClass(this.$navigation,n.HIDDEN_CLASS),this.currentNavigationWidth=this.sandbox.dom.width(this.$navigation),this.sandbox.dom.width(this.$navigation,0),this.hidden=!0}}}),define("__component__$column-options@husky",[],function(){"use strict";var e={url:null,data:[],trigger:null,instanceName:null,header:{disabled:!1,title:"Column Options"},footer:{disabled:!1},hidden:!1},t={listItem:['<li class="column-options-list-item" data-id="<%= id %>" draggable="true">','   <span class="move">&#8942;</span>','   <span class="text"><%= title %></span>','   <span class="<%= toggleIcon %> visibility-toggle"></span>',"</li>"].join(""),header:['<div class="column-options-header">','   <span class="title"><%= title %></span>','   <a href="#" class="fa-times close-button"></a>',"</div>"].join("")},n={visible:"fa-eye",hidden:"fa-eye-slash"},r=function(){return c.call(this,"initialized")},i=function(){return c.call(this,"item.enabled")},s=function(){return c.call(this,"item.disabled")},o=function(){return c.call(this,"saved")},u=function(){return c.call(this,"get-selected")},a=function(){return c.call(this,"get-all")},f=function(){this.sandbox.dom.on(this.$el,"click",g.bind(this),this.$container),this.sandbox.dom.on(this.$el,"mouseover",d.bind(this),"li"),this.sandbox.dom.on(this.$el,"mouseout",v.bind(this),"li"),this.sandbox.dom.on(this.$el,"click",S.bind(this),".visibility-toggle")},l=function(){this.sandbox.on(u.call(this),h.bind(this)),this.sandbox.on(a.call(this),p.bind(this))},c=function(e){return"husky.column-options."+(this.options.instanceName?this.options.instanceName+".":"")+e},h=function(e){var t,n,r=this.sandbox.dom.find("li:not(.disabled)",this.$el);n=[],this.sandbox.util.foreach(r,function(e){t=this.sandbox.dom.data(e,"id"),n.push(this.items[t])}.bind(this)),e(n)},p=function(e){var t,n,r=this.sandbox.dom.find("li",this.$el);n=[],this.sandbox.util.foreach(r,function(e){t=this.sandbox.dom.data(e,"id"),n.push(this.items[t])}.bind(this)),e(n)},d=function(e){this.sandbox.dom.addClass(e.currentTarget,"hover-style")},v=function(e){this.sandbox.dom.removeClass(e.currentTarget,"hover-style")},m=function(e){if(!e.id||!!this.items[e.id])do e.id=this.sandbox.util._.uniqueId();while(!!this.items[e.id])},g=function(e){e.preventDefault(),e.stopPropagation()},y=function(){var e=this.sandbox.dom.find(".column-options-list-item",this.$list),t=[],n;this.sandbox.util.foreach(e,function(e){n=this.sandbox.dom.data(e,"id"),t.push(this.items[n])}.bind(this)),this.data=t,this.options.data=this.data,p.call(this,function(e){this.sandbox.emit(o.call(this),e)}.bind(this))},b=function(){this.sandbox.dom.remove(this.$el)},w=function(){var e;this.items=[],this.sandbox.util.foreach(this.data,function(r){m.call(this,r),this.items[r.id]=r,e=this.sandbox.dom.createElement(this.sandbox.template.parse(t.listItem,{id:r.id,toggleIcon:r.default===!0||r.default==="true"?"":n.visible,title:this.sandbox.translate(r.translation)})),this.sandbox.dom.append(this.$list,e),typeof r.disabled!="undefined"&&r.disabled!=="false"&&r.disabled!==!1&&S.call(this,{currentTarget:this.sandbox.dom.find(".visibility-toggle",e),doNotEmitEvents:!0,preventDefault:function(){}})}.bind(this))},E=function(){if(this.overlayLoaded===!1){var e=this.sandbox.dom.createElement("<div/>");this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"overlay@husky",options:{el:e,container:this.$el,data:this.$list,okCallback:function(){y.call(this),b.call(this)}.bind(this),closeCallback:function(){b.call(this)}.bind(this),instanceName:"column-options-"+this.options.instanceName,title:this.options.header.title,openOnStart:!this.options.hidden,removeOnClose:!0}}]),this.overlayLoaded=!0}},S=function(e){e.preventDefault();var t=this.sandbox.dom.parent(e.currentTarget),r=this.sandbox.dom.hasClass(t,"disabled"),o=this.sandbox.dom.data(t,"id"),u=this.items[o],a=n.visible,f=n.hidden;if(r)this.numVisible++,this.sandbox.dom.removeClass(e.currentTarget,f),this.sandbox.dom.prependClass(e.currentTarget,a);else{if(this.numVisible===1)return;this.numVisible--,this.sandbox.dom.prependClass(e.currentTarget,f),this.sandbox.dom.removeClass(e.currentTarget,a)}this.sandbox.dom.toggleClass(t,"disabled"),u.disabled=!r,e.doNotEmitEvents||this.sandbox.emit(r?i.call(this):s.call(this),u)};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.overlayLoaded=!1,this.options.trigger=this.options.trigger||this.$el,this.options.url?this.sandbox.util.load(this.options.url).then(this.render.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.data?this.render(this.options.data):this.sandbox.logger.log("no data provided for tabs!"),f.call(this),l.call(this)},render:function(e){this.numVisible=e.length,this.options.data=e,this.data=this.sandbox.util.extend(!0,[],this.options.data),this.sandbox.dom.addClass(this.$el,"column-options-parent"),this.$list=this.sandbox.dom.createElement('<ul class="column-options-list" />'),w.call(this),this.sandbox.dom.sortable(this.$list,{handle:".move"}),E.call(this),this.sandbox.emit(r.call(this))},rerender:function(){this.data=this.sandbox.util.extend(!0,[],this.options.data),this.sandbox.dom.html(this.$list,""),w.call(this),this.sandbox.dom.sortable(this.$list,{handle:".move"})}}}),define("husky_components/datagrid/decorators/table-view",[],function(){"use strict";var e={editable:!1,removeRow:!1,selectItem:{type:"checkbox",inFirstCell:!1},noItemsText:"This list is empty",addRowTop:!0,excludeFields:[""],cssClass:"",thumbnailFormat:"sulu-50x50",showHead:!0,hideChildrenAtBeginning:!0,openChildId:null,highlightSelected:!1,icons:[],cssClasses:[],removeIcon:"trash-o",emptyIcon:"fa-coffee",noImgIcon:"fa-coffee",actionIcon:"pencil",actionIconColumn:null,croppedMaxLength:35,openPathToSelectedChildren:!0,cropContents:!0,editableOptions:{}},t={selectedRowClass:"selected",isSelectableClass:"is-selectable",sortableClass:"is-sortable",skeletonClass:"husky-table",containerClass:"table-container",overflowClass:"overflow",emptyListElementClass:"empty-list",rowRemoverClass:"row-remover",checkboxClass:"checkbox",radioClass:"radio",cellFitClass:"fit",tableClass:"table",rowClass:"row",thumbSrcKey:"url",thumbAltKey:"alt",evenClass:"even",oddClass:"odd",headerCellClass:"header-cell",ascSortedClass:"sorted-asc",descSortedClass:"sorted-desc",headerCellLoaderClass:"header-loader",headerLoadingClass:"is-loading",editableItemClass:"editable",editableInputClass:"editable-input",inputWrapperClass:"input-wrapper",editedErrorClass:"server-validation-error",newRecordId:"newrecord",gridIconClass:"grid-icon",gridBadgeClass:"badge",gridImageClass:"grid-image",childWrapperClass:"child-wrapper",parentClass:"children-toggler",noChildrenClass:"no-children",toggleIconClass:"toggle-icon",collapsedIcon:"fa-caret-right",expandedIcon:"fa-caret-down",checkboxCellClass:"checkbox-cell",thumbnailCellClass:"thumbnail-cell",textContainerClass:"cell-content",renderingClass:"rendering",actionClass:"has-action",inactiveClass:"inactive",childIndent:28},n={CHECKBOX:"checkbox",RADIO:"radio"},r={skeleton:['<div class="'+t.skeletonClass+'">','   <div class="'+t.containerClass+'"></div>',"</div>"].join(""),table:'<table class="'+t.tableClass+'"></table>',header:"<thead></thead>",body:"<tbody></tbody>",row:'<tr class="'+t.rowClass+'"></tr>',headerCell:'<th class="'+t.headerCellClass+'"></th>',cell:"<td></td>",textContainer:'<span class="'+t.textContainerClass+'"><%= content %></span>',headerCellLoader:'<div class="'+t.headerCellLoaderClass+'"></div>',removeCellContent:'<span class="fa-<%= icon %> '+t.rowRemoverClass+'"></span>',editableCellContent:{string:['<span class="'+t.editableItemClass+'"><%= value %></span>','<div class="'+t.inputWrapperClass+'">','   <input type="text" class="form-element husky-validate '+t.editableInputClass+'" value="<%= value %>">',"</div>"].join(""),select:['<select class="form-element husky-validate '+t.editableInputClass+'">',"<% _.each(options.values, function(title, index) { %>",'   <option value="<%= index %>" <% if (value === index) { %>selected<% } %>><%= translate(title) %></option>',"<% }); %>","</select>"].join("")},img:['<div class="'+t.gridImageClass+'">',"<% if (!!src) { %>",'   <img alt="<%= alt %>" src="<%= src %>"/>',"<% } else { %>",'   <div class="<%= noImgIcon %> empty"></div>',"<% } %>","</div>"].join(""),childWrapper:'<div class="'+t.childWrapperClass+'"></div>',toggleIcon:'<span class="'+t.toggleIconClass+'"></span>',icon:['<span class="',t.gridIconClass,' <%= cssClass %> <%= align %>" data-icon-index="<%= index %>">','   <span class="fa-<%= icon %>"></span>',"</span>"].join(""),badge:['<span class="'+t.gridBadgeClass+' <%= cssClass %>">','   <% if(!!icon) { %><span class="fa-<%= icon %>"></span><% } %>',"   <% if(!!title) { %><%= title %><% } %>","</span> "].join(""),checkbox:['<div class="custom-checkbox">','   <input class="'+t.checkboxClass+'" type="checkbox" data-form="false"/>','   <span class="icon"></span>',"</div>"].join(""),radio:['<div class="custom-radio">','    <input class="'+t.radioClass+'" name="<%= name %>" type="radio" data-form="false"/>','    <span class="icon"></span>',"</div>"].join(""),empty:['<div class="'+t.emptyListElementClass+'">','   <div class="<%= emptyIcon %> icon"></div>',"   <span><%= text %></span>","</div>"].join("")},i=function(){return this.datagrid.createEventName.call(this.datagrid,"update.table")},s=function(){return this.datagrid.createEventName.call(this.datagrid,"table.open-parents")},o=function(){return this.datagrid.createEventName.call(this.datagrid,"radio.selected")},u=function(){return this.datagrid.createEventName.call(this.datagrid,"children.collapsed")},a=function(){return this.datagrid.createEventName.call(this.datagrid,"children.expanded")};return{initialize:function(t,n){this.datagrid=t,this.keys={id:this.datagrid.options.idKey},this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n),this.editStatuses={},this.bindCustomEvents(),this.setVariables()},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.onResize.bind(this)),this.sandbox.on(s.call(this),this.openParents.bind(this));if(!!this.options.openPathToSelectedChildren){var e="";this.datagrid.options.instanceName?e="husky.datagrid."+this.datagrid.options.instanceName+".view.rendered":e="husky.datagrid.view.rendered",this.sandbox.on(e,this.openPathToSelectedChildren.bind(this))}},openPathToSelectedChildren:function(){this.sandbox.util.each(this.datagrid.selectedItems,function(e,t){this.openParents(t)}.bind(this))},unbindCustomEvents:function(){this.sandbox.off(i.call(this),this.onResize.bind(this)),this.sandbox.off(s.call(this),this.openParents.bind(this))},render:function(e,n){this.$el=this.sandbox.dom.createElement(r.skeleton),this.sandbox.dom.append(n,this.$el),this.addViewClasses(),this.addActionIcon(),this.data=e,this.renderTable(),this.bindDomEvents(),this.datagrid.options.resizeListeners===!0&&this.onResize(),!this.options.openChildId||(this.openParents(this.options.openChildId),this.options.openChildId=null),this.renderChildrenHidden=!1,this.sandbox.dom.removeClass(this.$el,t.renderingClass),this.rendered=!0},destroy:function(){this.sandbox.stop(this.sandbox.dom.find("*",this.$el)),this.sandbox.dom.remove(this.$el),this.setVariables()},addRecord:function(e,t){var n=t?!1:this.options.addRowTop;this.removeEmptyIndicator(),this.renderBodyRow(e,n),this.setAlternateClasses()},removeRecord:function(e){this.table.rows[e].$el.siblings().each(function(t,n){$(n).data("parent")===e&&this.removeRecord($(n).data("id"))}.bind(this)),this.deselectRecord(e),this.datagrid.removeRecord.call(this.datagrid,e),this.sandbox.dom.remove(this.table.rows[e].$el),delete this.table.rows[e],Object.keys(this.table.rows).length===0&&(this.toggleSelectAllItem(!1),this.renderEmptyIndicator())},onResize:function(){this.containerIsOverflown()===!0?this.overflowHandler():this.underflowHandler()},setVariables:function(){this.rendered=!1,this.$el=null,this.table={},this.data=null,this.rowClicked={},this.isFocusoutHandlerEnabled=this.options.editable===!0||this.options.editable==="true",this.renderChildrenHidden=this.options.hideChildrenAtBeginning,this.tableCropped=!1,this.cropBreakPoint=null,this.icons=this.sandbox.util.extend(!0,[],this.options.icons),this.badges=this.sandbox.util.extend(!0,[],this.options.badges),this.cssClasses=this.sandbox.util.extend(!0,[],this.options.cssClasses)},addViewClasses:function(){this.sandbox.dom.addClass(this.$el,this.options.cssClass),this.sandbox.dom.addClass(this.$el,t.renderingClass),(this.options.highlightSelected===!0||!!this.options.selectItem)&&this.options.editable!==!0&&this.sandbox.dom.addClass(this.$el,t.isSelectableClass)},addActionIcon:function(){typeof this.datagrid.options.actionCallback=="function"&&!!this.datagrid.matchings&&this.datagrid.matchings.length>0&&!!this.options.actionIcon&&this.icons.push({icon:this.options.actionIcon,column:this.options.actionIconColumn||this.datagrid.matchings[0].attribute,align:"left",callback:this.datagrid.options.actionCallback,actionIcon:!0})},renderTable:function(){this.table.$el=this.sandbox.dom.createElement(r.table),this.table.$container=this.sandbox.dom.find("."+t.containerClass,this.$el),this.options.showHead===!0&&this.renderHeader(),this.renderBody(),this.sandbox.dom.append(this.table.$container,this.table.$el),this.setAlternateClasses()},renderHeader:function(){this.table.header={},this.table.header.$el=this.sandbox.dom.createElement(r.header),this.table.header.$row=this.sandbox.dom.createElement(r.row),this.sandbox.dom.append(this.table.header.$el,this.table.header.$row),this.renderHeaderSelectItem(),this.renderHeaderCells(),this.renderHeaderRemoveItem(),this.sandbox.dom.append(this.table.$el,this.table.header.$el)},renderHeaderSelectItem:function(){if(!!this.options.selectItem&&!!this.options.selectItem.type){var e=this.sandbox.dom.createElement(r.headerCell);this.sandbox.dom.addClass(e,t.checkboxCellClass),this.options.selectItem.type===n.CHECKBOX&&this.sandbox.dom.html(e,r.checkbox),this.sandbox.dom.prepend(this.table.header.$row,e)}},renderHeaderCells:function(){var e;this.table.header.cells={},this.sandbox.util.foreach(this.datagrid.matchings,function(t){e=this.sandbox.dom.createElement(r.headerCell),!!t.class&&typeof t.class===this.datagrid.types.STRING&&this.sandbox.dom.addClass(e,t.class),this.sandbox.dom.html(e,this.sandbox.util.template(r.textContainer)({content:this.sandbox.translate(t.content)})),this.sandbox.dom.data(e,"attribute",t.attribute),this.table.header.cells[t.attribute]={$el:e,sortable:t.sortable},this.sandbox.dom.append(this.table.header.$row,this.table.header.cells[t.attribute].$el),this.setHeaderCellClasses(t.attribute)}.bind(this))},setHeaderCellClasses:function(e){if(this.datagrid.options.sortable===!0){var n=this.table.header.cells[e].$el,r;this.table.header.cells[e].sortable===!0&&(this.sandbox.dom.addClass(n,t.sortableClass),e===this.datagrid.sort.attribute&&(r=this.datagrid.sort.direction==="asc"?t.ascSortedClass:t.descSortedClass,this.sandbox.dom.addClass(n,r)))}},renderHeaderRemoveItem:function(){if(this.options.removeRow===!0){var e=this.sandbox.dom.createElement(r.headerCell);this.sandbox.dom.addClass(e,t.cellFitClass),this.sandbox.dom.append(this.table.header.$row,e)}},renderBody:function(){this.table.$body=this.sandbox.dom.createElement(r.body),this.table.rows={},this.data.embedded.length>0?this.sandbox.util.foreach(this.data.embedded,function(e){this.renderBodyRow(e)}.bind(this)):this.renderEmptyIndicator(),this.sandbox.dom.append(this.table.$el,this.table.$body)},renderRowSelectItem:function(e,i){if(this.datagrid.options.onlySelectLeaves===!0&&!!this.table.rows[e].hasChildren)return"";if(!!this.options.selectItem&&!!this.options.selectItem.type&&(this.options.selectItem.inFirstCell===!1||i===!0)){var s=this.sandbox.dom.createElement(r.cell);this.sandbox.dom.addClass(s,t.cellFitClass),this.options.selectItem.type===n.CHECKBOX?this.sandbox.dom.html(s,r.checkbox):this.options.selectItem.type===n.RADIO&&this.sandbox.dom.html(s,this.sandbox.util.template(r.radio)({name:"datagrid-"+this.datagrid.options.instanceName}));if(i===!0)return this.sandbox.dom.html(s);this.sandbox.dom.addClass(s,t.checkboxCellClass),this.sandbox.dom.prepend(this.table.rows[e].$el,s)}},renderBodyRow:function(e,n){this.removeNewRecordRow();var i=this.sandbox.dom.createElement(r.row),s=this.table.rows[e.id]?this.table.rows[e.id].$el:null,o=this.hasParent(e);e.id=e[this.keys.id]?e[this.keys.id]:t.newRecordId,this.sandbox.dom.data(i,"id",e.id),!e.parent||this.sandbox.dom.data(i,"parent",e.parent),o&&(this.table.rows[e.parent]||this.renderBodyRow(this.data.embedded[this.datagrid.getRecordIndexById(e.parent)],n),this.table.rows[e.parent].childrenLoaded=!0),this.table.rows[e.id]={$el:i,cells:{},childrenLoaded:this.table.rows[e.id]?this.table.rows[e.id].childrenLoaded:!1,childrenExpanded:!1,parent:o?e.parent:null,hasChildren:e[this.datagrid.options.childrenPropertyName]?e[this.datagrid.options.childrenPropertyName]:!1,selectedChildren:0,level:1},(typeof this.datagrid.options.clickCallback=="function"||typeof this.datagrid.options.actionCallback=="function"||this.table.rows[e.id].hasChildren===!0)&&this.sandbox.dom.addClass(i,t.actionClass),typeof this.datagrid.options.clickCallback!="function"&&this.table.rows[e.id].hasChildren===!1&&this.sandbox.dom.addClass(i,t.inactiveClass),this.renderRowSelectItem(e.id),this.renderBodyCellsForRow(e),this.renderRowRemoveItem(e.id),this.insertBodyRow(e,s,n),this.executeRowPostRenderActions(e)},insertBodyRow:function(e,t,n){var r=this.table.rows[e.parent]?this.table.rows[e.parent].$el:null,i=n===!0?this.sandbox.dom.prepend:this.sandbox.dom.append;!t||!t.length?!r||!r.length?i(this.table.$body,this.table.rows[e.id].$el):(this.renderChildrenHidden===!0?(this.sandbox.dom.hide(this.table.rows[e.id].$el),this.changeChildrenToggleIcon(e.parent,!1)):(this.table.rows[e.parent].childrenExpanded=!0,this.changeChildrenToggleIcon(e.parent,!0)),this.sandbox.dom.after(this.getLastChildElementOfParent(r)||r,this.table.rows[e.id].$el)):(this.sandbox.dom.after(t,this.table.rows[e.id].$el),this.sandbox.dom.remove(t))},getLastChildElementOfParent:function(e){var t=e.siblings().filter(function(){return $(this).data("parent")===e.data("id")});return t.length>0?t.last():null},executeRowPostRenderActions:function(e){this.datagrid.itemIsSelected.call(this.datagrid,e.id)?this.toggleSelectRecord(e.id,!0):this.toggleSelectAllItem(!1),this.options.editable===!0&&e.id===t.newRecordId&&this.showInput(e.id)},renderBodyCellsForRow:function(e){this.sandbox.util.foreach(this.datagrid.matchings,function(t,n){this.options.excludeFields.indexOf(t.attribute)===-1&&this.renderBodyCell(e,t,n)}.bind(this))},renderRowRemoveItem:function(e){if(this.options.removeRow===!0){var n=this.sandbox.dom.createElement(r.cell);this.sandbox.dom.html(n,this.sandbox.util.template(r.removeCellContent)({icon:this.options.removeIcon})),this.sandbox.dom.addClass(n,t.cellFitClass),this.sandbox.dom.append(this.table.rows[e].$el,n)}},renderBodyCell:function(e,n,i){var s=this.sandbox.dom.createElement(r.cell),o=this.getCellContent(e,n,s),u,a=!1;!!this.datagrid.options.childrenPropertyName&&i===0&&(o=this.wrapChildrenCellContent(o,e)),!!this.options.selectItem&&this.options.selectItem.inFirstCell===!0&&i===0&&(this.sandbox.dom.attr(s,"colspan",2),u=this.renderRowSelectItem(e.id,!0),typeof o===this.datagrid.types.STRING?o=u+o:this.sandbox.dom.prepend(o,u)),!!n.class&&typeof n.class===this.datagrid.types.STRING&&this.sandbox.dom.addClass(s,n.class),n.type===this.datagrid.types.THUMBNAILS&&(this.sandbox.dom.addClass(s,t.thumbnailCellClass),this.sandbox.dom.addClass(s,t.cellFitClass)),this.sandbox.dom.html(s,o),this.sandbox.dom.data(s,"attribute",n.attribute),!!this.sandbox.dom.find("."+t.textContainerClass,s).length&&this.sandbox.dom.children(this.sandbox.dom.find("."+t.textContainerClass,s)).length===0&&(a=!0),this.table.rows[e.id].cells[n.attribute]={$el:s,originalData:e[n.attribute],originalContent:this.sandbox.dom.text(s),editable:!!n.editable,croppable:a},this.sandbox.dom.append(this.table.rows[e.id].$el,this.table.rows[e.id].cells[n.attribute].$el)},getCellContent:function(e,n,i){var s=e[n.attribute];if(!n.type||n.type!==this.datagrid.types.THUMBNAILS){if(!n.type||n.type===this.datagrid.types.STRING||n.type===this.datagrid.types.TITLE)s=this.sandbox.util.escapeHtml(s);s=this.datagrid.processContentFilter(n.attribute,s,n.type,Object.keys(this.table.rows).length,e.hasOwnProperty("id")?e.id:null)}else s=this.datagrid.manipulateContent(s,n.type,this.options.thumbnailFormat),s=this.sandbox.util.template(r.img)({alt:s[t.thumbAltKey],src:s[t.thumbSrcKey],noImgIcon:typeof this.options.noImgIcon=="function"?this.options.noImgIcon(e):this.options.noImgIcon});return this.options.editable===!0&&n.editable===!0?s=this.getEditableCellContent(s,n.attribute,n.type):s=this.sandbox.util.template(r.textContainer)({content:s}),!this.icons||(s=this.addIconsToCellContent(s,n,i,e)),!this.badges||(s=this.addBadgesToCellContent(s,n,e)),!this.cssClasses||(s=this.addCssClassesToCellContent(s,n,e)),s},wrapChildrenCellContent:function(e,n){var i=this.sandbox.dom.createElement(r.childWrapper),s,o=0;return n[this.datagrid.options.childrenPropertyName]?(this.sandbox.dom.addClass(i,t.parentClass),s=this.sandbox.dom.createElement(r.toggleIcon),this.sandbox.dom.prependClass(s,t.collapsedIcon),this.sandbox.dom.prepend(i,s)):this.sandbox.dom.addClass(i,t.noChildrenClass),this.hasParent(n)&&(this.table.rows[n.id].level=this.table.rows[n.parent].level+1,o=t.childIndent*(this.table.rows[n.id].level-1)),this.datagrid.options.onlySelectLeaves==1&&this.table.rows[n.id].hasChildren==1&&(o+=40),!o||this.sandbox.dom.css(i,{"padding-left":o+"px"}),this.sandbox.dom.append(i,e),i},hasParent:function(e){return!!e.parent&&!!this.data.embedded[this.datagrid.getRecordIndexById(e.parent)]},getEditableCellContent:function(e,t,n){n=n?n:this.datagrid.types.STRING;var i=this.options.editableOptions[t]?this.options.editableOptions[t]:{};return this.sandbox.util.template(r.editableCellContent[n],{value:e,options:i,translate:this.sandbox.translate})},addIconsToCellContent:function(e,n,i,s){var o;return this.sandbox.util.foreach(this.icons,function(u,a){var f=u.icon;typeof f=="function"&&(f=f(s)),u.column===n.attribute&&(!u.disableCallback||u.disableCallback(s))&&(o=this.sandbox.util.template(r.icon,{icon:f,align:u.align,cssClass:u.cssClass,index:a}),typeof e=="object"?this.sandbox.dom.append(e,o):typeof e===this.datagrid.types.STRING&&(e+=o),u.actionIcon===!0&&this.sandbox.dom.addClass(i,t.actionClass))}.bind(this)),e},addBadgesToCellContent:function(e,t,n){var i;return this.sandbox.util.foreach(this.badges,function(s){if(s.column===t.attribute){!s.callback||(s=s.callback(n,s));if(!s)return;i=this.sandbox.util.template(r.badge)(this.sandbox.util.extend(!0,{cssClass:null,title:null,icon:null},s)),typeof e=="object"?this.sandbox.dom.prepend(e,i):typeof e===this.datagrid.types.STRING&&(e=i+e)}}.bind(this)),e},addCssClassesToCellContent:function(e,t,n){return this.sandbox.util.foreach(this.cssClasses,function(r){if(r.column===t.attribute){!r.callback||(r=r.callback(n,r));if(!r)return;typeof e=="object"?$(e).wrap(['<span class="',r,'" />'].join("")):typeof e===this.datagrid.types.STRING&&(e=['<span class="',r,'">',e,"</span>"].join(""))}}.bind(this)),e},renderEmptyIndicator:function(){this.sandbox.dom.append(this.$el,this.sandbox.util.template(r.empty)({text:this.sandbox.translate(this.options.noItemsText),emptyIcon:this.options.emptyIcon}))},removeNewRecordRow:function(){!this.table.rows[t.newRecordId]||(this.sandbox.dom.remove(this.table.rows[t.newRecordId].$el),delete this.table.rows[t.newRecordId])},containerIsOverflown:function(){return this.table.$container?this.sandbox.dom.get(this.table.$container,0).scrollWidth>this.sandbox.dom.width(this.table.$container):!1},overflowHandler:function(){!this.options.cropContents||this.toggleCropTable(!0),this.containerIsOverflown()===!0&&this.sandbox.dom.addClass(this.$el,t.overflowClass)},underflowHandler:function(){this.tableCropped===!0&&(!!this.options.cropContents&&this.sandbox.dom.width(this.table.$container)>this.cropBreakPoint&&this.toggleCropTable(!1),this.containerIsOverflown()===!1&&this.sandbox.dom.removeClass(this.$el,t.overflowClass))},toggleCropTable:function(e){if(this.tableCropped!==e){var n,r;this.sandbox.util.each(this.table.rows,function(i,s){this.sandbox.util.each(s.cells,function(i,s){s.croppable===!0&&(n=this.sandbox.dom.find("."+t.textContainerClass,s.$el),e===!0?(r=this.sandbox.util.cropMiddle(s.originalContent,this.options.croppedMaxLength),this.sandbox.dom.attr(n,"title",s.originalContent),this.tableCropped=!0,this.cropBreakPoint=this.sandbox.dom.width(this.table.$container)):(r=s.originalContent,this.sandbox.dom.removeAttr(n,"title"),this.tableCropped=!1),this.sandbox.dom.text(n,r))}.bind(this))}.bind(this))}},bindDomEvents:function(){this.sandbox.dom.on(this.table.$body,"click",this.selectItemChangeHandler.bind(this),"."+t.checkboxClass+", ."+t.radioClass),this.sandbox.dom.on(this.table.$body,"click",this.bodyRowClickHandler.bind(this),"."+t.rowClass),this.sandbox.dom.on(this.table.$body,"dblclick",this.bodyRowDblClickHandler.bind(this),"."+t.rowClass),this.sandbox.dom.on(this.table.$body,"click",this.cellActionCallback.bind(this),"td."+t.actionClass),this.options.removeRow===!0&&this.sandbox.dom.on(this.table.$body,"click",this.removeItemClickHandler.bind(this),"."+t.rowRemoverClass),!this.table.header||(this.sandbox.dom.on(this.table.header.$el,"change",this.allSelectItemChangeHandler.bind(this)),this.datagrid.options.sortable===!0&&this.sandbox.dom.on(this.table.header.$el,"click",this.sortItemClickHandler.bind(this),"."+t.headerCellClass+"."+t.sortableClass)),this.options.editable===!0&&(this.sandbox.dom.on(this.table.$body,"click",this.editableItemClickHandler.bind(this),"."+t.editableItemClass),this.sandbox.dom.on(this.table.$body,"focusout",this.editableInputFocusoutHandler.bind(this),"."+t.editableInputClass),this.sandbox.dom.on(this.table.$body,"keydown",this.editableInputKeyHandler.bind(this),"."+t.editableInputClass),this.sandbox.dom.on(this.table.$body,"change",this.editableInputEventHandler.bind(this),"."+t.editableInputClass)),!this.icons||this.sandbox.dom.on(this.table.$body,"click",this.iconClickHandler.bind(this),"."+t.gridIconClass),this.sandbox.dom.on(this.table.$body.find("img"),"error",function(){$(this).remove()}),this.sandbox.dom.on(this.table.$body.find("img"),"load",function(){$(this).parent().find(".fa-coffee").remove()}),this.sandbox.dom.on(this.table.$body,"click",this.radioButtonClickHandler.bind(this),'input[type="radio"]')},radioButtonClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id"),r=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"td"),"attribute");this.sandbox.emit(o.call(this),n,r)},iconClickHandler:function(e){var n=this.icons[this.sandbox.dom.data(e.currentTarget,"icon-index")],r=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id");typeof r!="undefined"&&!!n&&typeof n.callback=="function"&&(e.stopPropagation(),n.callback(r,this.datagrid.getRecordById(r)))},sortItemClickHandler:function(e){this.sandbox.dom.stopPropagation(e);if(this.sandbox.dom.hasClass(e.currentTarget,t.headerLoadingClass))return!1;var n=this.sandbox.dom.data(e.currentTarget,"attribute"),r="asc";this.datagrid.sort.attribute===n&&this.datagrid.sort.direction===r&&(r="desc"),this.startHeaderCellLoader(n),this.datagrid.sortGrid.call(this.datagrid,n,r)},editableItemClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id"),r=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"td"),"attribute");this.showInput(n,r)},showInput:function(e,n){var r,i,s,o;n||(i=this.sandbox.dom.find("."+t.editableInputClass,this.table.rows[e].$el),n=this.sandbox.dom.data(this.sandbox.dom.parents(i[0],"td"),"attribute")),r=this.table.rows[e].cells[n].$el,s=this.sandbox.dom.find("."+t.editableInputClass,r),o=this.sandbox.dom.find("."+t.inputWrapperClass,r),this.sandbox.dom.show(o),this.sandbox.dom.focus(s),this.sandbox.dom.select(s),this.editStatuses[e]=!0},editableInputKeyHandler:function(e){this.removeEditedErrorCallback($(e.currentTarget).parents("."+t.rowClass).data("id")),e.keyCode===13&&this.editableInputEventHandler(e)},editableInputFocusoutHandler:function(e){!this.isFocusoutHandlerEnabled||this.editableInputEventHandler(e)},editableInputEventHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),r=this.sandbox.dom.data(n,"id");(!!this.editStatuses[r]||$(e.currentTarget).is("select"))&&this.editRow(r),this.editStatuses[r]=!1},editRow:function(e){var n={};this.sandbox.util.each(this.table.rows[e].cells,function(e,r){!this.sandbox.dom.find("."+t.editableInputClass,r.$el).length||(n[e]=this.sandbox.dom.val(this.sandbox.dom.find("."+t.editableInputClass,r.$el)))}.bind(this)),this.saveRow(e,n,this.editedSuccessCallback.bind(this),this.editedErrorCallback.bind(this,e))},editedSuccessCallback:function(e){var n;!e.id||!this.table.rows[e.id]?!this.table.rows[t.newRecordId]||(n=this.table.rows[t.newRecordId].$el):n=this.table.rows[e.id].$el,!!n&&!!n.length&&(this.sandbox.dom.hide(this.sandbox.dom.find("."+t.inputWrapperClass,n)),this.renderBodyRow(e,this.options.addRowTop))},editedErrorCallback:function(e){var n=this.table.rows[e].$el;this.sandbox.dom.addClass(this.sandbox.dom.find("."+t.inputWrapperClass,n),t.editedErrorClass)},removeEditedErrorCallback:function(e){var n=this.table.rows[e].$el;n.find("."+t.inputWrapperClass).removeClass(t.editedErrorClass),this.editStatuses[e]=!0},saveRow:function(e,n,r,i){var s=!1,o;this.sandbox.util.each(this.table.rows[e].cells,function(e,t){t.editable===!0&&t.originalData!==n[e]&&(s=!0)}.bind(this)),o=this.sandbox.util.extend(!0,{},this.data.embedded[this.datagrid.getRecordIndexById(e)],n),e===t.newRecordId&&delete o.id,s===!0?this.datagrid.saveGrid.call(this.datagrid,o,this.datagrid.getUrlWithoutParams.call(this.datagrid),r,i,this.options.addRowTop):typeof r=="function"&&r(o)},startHeaderCellLoader:function(e){var n=this.sandbox.dom.createElement(r.headerCellLoader);this.sandbox.dom.addClass(this.table.header.cells[e].$el,t.headerLoadingClass),this.sandbox.dom.append(this.sandbox.dom.find("."+t.textContainerClass,this.table.header.cells[e].$el),n),this.sandbox.start([{name:"loader@husky",options:{el:n,size:"10px",color:"#999999"}}])},bodyRowClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var t=this.sandbox.dom.data(e.currentTarget,"id");!!t&&!!this.table.rows&&!!this.table.rows[t]&&(!this.table.rows[t].hasChildren||this.toggleChildren(t)),this.rowClickCallback(e)},bodyRowDblClickHandler:function(e){this.sandbox.dom.stopPropagation(e),this.rowActionCallback(e)},rowClickCallback:function(e){var t=this.sandbox.dom.data(e.currentTarget,"id");this.rowClicked[t]||(this.rowClicked[t]=!0,this.datagrid.itemClicked.call(this.datagrid,t),this.sandbox.util.delay(function(){this.rowClicked[t]=!1}.bind(this),500))},rowActionCallback:function(e){var t=this.sandbox.dom.data(e.currentTarget,"id");this.datagrid.itemAction.call(this.datagrid,t)},cellActionCallback:function(e){var t=this.sandbox.dom.data(this.sandbox.dom.parent(e.currentTarget),"id");!!this.table.rows[t]&&!this.table.rows[t].hasChildren&&this.datagrid.itemAction.call(this.datagrid,t)},removeItemClickHandler:function(e){this.sandbox.dom.stopPropagation(e);var n=this.sandbox.dom.data(this.sandbox.dom.parents(e.currentTarget,"."+t.rowClass),"id");this.removeRecord(n)},selectItemChangeHandler:function(e){!e.type||this.sandbox.dom.stopPropagation(e);var r=this.sandbox.dom.data(this.sandbox.dom.parents(e.target,"."+t.rowClass),"id"),i=this.sandbox.dom.is(e.target,":checked");this.options.selectItem.type===n.CHECKBOX?this.toggleSelectRecord(r,i):this.options.selectItem.type===n.RADIO&&this.uniqueSelectRecord(r)},allSelectItemChangeHandler:function(e){if(this.data.embedded.length==0)return this.sandbox.dom.prop(e.target,"checked",!1),!1;this.sandbox.dom.stopPropagation(e);var t=this.sandbox.dom.is(e.target,":checked");t===!0?this.selectAllRecords():this.deselectAllRecords()},selectAllRecords:function(){this.datagrid.selectAllItems.call(this.datagrid),this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass,this.table.$body),"checked",!0),this.sandbox.dom.addClass(this.sandbox.dom.find("."+t.rowClass,this.table.$body),t.selectedRowClass)},deselectAllRecords:function(){this.datagrid.deselectAllItems.call(this.datagrid),this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass,this.table.$body),"checked",!1),this.sandbox.dom.removeClass(this.sandbox.dom.find("."+t.rowClass,this.table.$body),t.selectedRowClass),this.updateSelectAll()},selectRecord:function(e){this.toggleSelectRecord(e,!0)},deselectRecord:function(e){this.toggleSelectRecord(e,!1)},toggleSelectRecord:function(e,n){n===!0?(this.datagrid.setItemSelected.call(this.datagrid,e),this.table.rows[e]&&(this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass+", ."+t.radioClass,this.table.rows[e].$el),"checked",!0),this.sandbox.dom.addClass(this.table.rows[e].$el,t.selectedRowClass),this.indeterminateSelectParents(e))):(this.datagrid.setItemUnselected.call(this.datagrid,e),this.table.rows[e]&&(this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass+", ."+t.radioClass,this.table.rows[e].$el),"checked",!1),this.table.rows[e].selectedChildren>0&&this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass+", ."+t.radioClass,this.table.rows[e].$el),"indeterminate",!0),this.sandbox.dom.removeClass(this.table.rows[e].$el,t.selectedRowClass),this.indeterminateUnselectParents(e))),this.updateSelectAll()},toggleSelectAllItem:function(e){!this.table.header||this.sandbox.dom.prop(this.sandbox.dom.find("."+t.checkboxClass,this.table.header.$el),"checked",e)},updateSelectAll:function(){!this.table.header||this.toggleSelectAllItem(this.datagrid.getSelectedItemIds.call(this.datagrid).length===this.data.embedded.length)},uniqueSelectRecord:function(e){this.datagrid.deselectAllItems.call(this.datagrid),this.datagrid.setItemSelected.call(this.datagrid,e)},removeEmptyIndicator:function(){this.sandbox.dom.remove(this.sandbox.dom.find("."+t.emptyListElementClass,this.$el))},changeChildrenToggleIcon:function(e,n){var r=this.sandbox.dom.find("."+t.toggleIconClass,this.table.rows[e].$el);!!r&&!!r.length&&(n===!0?(this.sandbox.dom.removeClass(r,t.collapsedIcon),this.sandbox.dom.prependClass(r,t.expandedIcon)):(this.sandbox.dom.removeClass(r,t.expandedIcon),this.sandbox.dom.prependClass(r,t.collapsedIcon)))},toggleChildren:function(e){this.table.rows[e].childrenLoaded===!0?this.table.rows[e].childrenExpanded===!0?(this.hideChildren(e),this.sandbox.emit(u.call(this))):(this.showChildren(e),this.sandbox.emit(a.call(this))):this.loadChildren(e)},hideChildren:function(e){this.sandbox.util.each(this.table.rows,function(t,n){n.parent==e&&(!n.hasChildren||this.hideChildren(t),this.sandbox.dom.hide(n.$el))}.bind(this)),this.table.rows[e].childrenExpanded=!1,this.changeChildrenToggleIcon(e,!1),this.setAlternateClasses()},showChildren:function(e){this.sandbox.util.each(this.table.rows,function(t,n){n.parent==e&&this.sandbox.dom.show(n.$el)}.bind(this)),this.table.rows[e].childrenExpanded=!0,this.changeChildrenToggleIcon(e,!0),this.setAlternateClasses()},loadChildren:function(e){var n=$('<div style="margin-right: -3px"/>'),r=$(this.table.rows[e].$el).find("."+t.toggleIconClass);this.sandbox.dom.append(r,n),this.sandbox.dom.removeClass(r,t.collapsedIcon),this.sandbox.start([{name:"loader@husky",options:{el:n,size:"8px",color:"#999999"}}]),this.datagrid.loadChildren.call(this.datagrid,e).then(function(){this.sandbox.stop(n)}.bind(this)),this.table.rows[e].childrenLoaded=!0},openParents:function(e){if(!!this.table.rows[e]){var t=this.table.rows[e].parent;!t||(!this.table.rows[t].parent||this.openParents(t),this.showChildren(t))}},indeterminateSelectParents:function(e){var n=this.table.rows[e].parent,r;!n||(this.table.rows[n].selectedChildren+=1,r=this.table.rows[n].$el.find("."+t.checkboxClass),r.prop("checked")||r.prop("indeterminate",!0),this.indeterminateSelectParents(n))},indeterminateUnselectParents:function(e){var n=this.table.rows[e].parent,r;!n||(this.table.rows[n].selectedChildren-=1,r=this.table.rows[n].$el.find("."+t.checkboxClass),this.table.rows[n].selectedChildren===0&&!!r.prop("indeterminate")&&r.prop("indeterminate",!1),this.indeterminateUnselectParents(n))},setAlternateClasses:function(){var e=this.sandbox.dom.find("."+t.rowClass,this.table.$body);this.sandbox.dom.removeClass(e,t.evenClass),this.sandbox.dom.removeClass(e,t.oddClass),this.sandbox.dom.addClass(this.sandbox.dom.filter(e,":visible:even"),t.evenClass),this.sandbox.dom.addClass(this.sandbox.dom.filter(e,":visible:odd"),t.oddClass)},collapseAllChildren:function(){for(var e=0,t=this.data.embedded.length;e<t;e++)this.hideChildren(this.data.embedded[e].id)},showSelected:function(e){var t=this.datagrid.$find("tbody .row:not(.selected)");e?t.hide():t.show()}}}),define("husky_components/datagrid/decorators/tiles-view",[],function(){"use strict";var e={icon:"fa-folder",showAddNewTile:!0,addNewIcon:"fa-plus-circle",fields:{title:["title"],description:["elementsCount"]},translations:{items:"public.items",addNew:"public.add-new"}},t={tile:['<div class="tile">','   <span class="<%= icon %> icon"></span>','   <span title="<%- title %>" class="title"><%- title %></span>','   <span class="description"><%- description %></span>',"</div>"].join(""),addNewTile:['<div class="add-new-tile">','   <span class="<%= icon %> icon"></span>','   <span class="title"><%- title %></span>',"</div>"].join("")},n=function(e){var t=this.sandbox.util.extend(!1,{},e),n;return this.datagrid.matchings.forEach(function(e){n=null,e.type===this.datagrid.types.COUNT&&(n=this.sandbox.translate(this.options.translations.items)),t[e.attribute]=this.datagrid.processContentFilter.call(this.datagrid,e.attribute,t[e.attribute],e.type,n)}.bind(this)),t},r=function(){return this.datagrid.createEventName.call(this.datagrid,"tiles.add-clicked")};return{initialize:function(t,n){this.datagrid=t,this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n)},render:function(e,t){this.rendered=!1,this.$el=null,this.$tiles={},this.renderContainer(t),e.embedded.map(this.renderRecord.bind(this)),!this.options.showAddNewTile||this.renderAddNewTile(),this.bindDomEvents(),this.rendered=!0},bindDomEvents:function(){this.$el.on("click",".tile",function(e){this.datagrid.itemAction.call(this.datagrid,$(e.currentTarget).data("id"))}.bind(this))},renderContainer:function(e){this.$el=$('<div class="tiles-view"/>'),e.append(this.$el)},renderAddNewTile:function(){var e=$(_.template(t.addNewTile,{icon:this.options.addNewIcon,title:this.sandbox.translate(this.options.translations.addNew)}));e.on("click",function(){this.sandbox.emit(r.call(this))}.bind(this)),this.$el.append(e)},renderRecord:function(e){e=n.call(this,e);var r=this.getTitle(e),i=this.getDescription(e),s,o,u,a;this.$tiles[e.id]=$(_.template(t.tile,{icon:this.options.icon,title:r,description:this.sandbox.util.cropMiddle(i,18)})),this.$tiles[e.id].data("id",e.id),this.$el.append(this.$tiles[e.id]),s=this.$tiles[e.id].find(".title"),o=parseInt(s.css("line-height").replace("px","")),u=s.height()/o,a=s.get(0).scrollWidth>s.innerWidth(),(u>2||!!a)&&this.$tiles[e.id].find(".title").html(this.sandbox.util.cropMiddle(r,18))},getTitle:function(e){var t="";return this.options.fields.title.forEach(function(n){t+=e[n]+" "}),t.trim()},getDescription:function(e){var t="";return this.options.fields.description.forEach(function(n){t+=e[n]+" "}),t.trim()},destroy:function(){this.$el.remove()}}}),define("husky_components/datagrid/decorators/dropdown-pagination",[],function(){"use strict";var e={showElementsSteps:[10,20,50,100,200],limit:20},t={paginationClass:"pagination-wrapper dropdowns",paginationElementClass:"pagination",prevClass:"previous",nextClass:"next",inputClass:"page-input",pageLabelClass:"page-label",sizeChangeClass:"size-change",loaderClass:"pagination-loader"},n={pageLabel:['<div class="',t.pageLabelClass,'">','    <%= translate("pagination.page") %>','    <input type="text" class="form-element ',t.inputClass,'" value="<%= i %>" />','    <%= translate("pagination.of") %> <%= pages %>',"</div>"].join(""),pageChanger:['<span class="inline-block"><%= label %></span>','<div class="',t.nextClass,' pagination-prev pull-right pointer <%= prevButtonClass %>"></div>','<div class="'+t.prevClass+' pagination-next pull-right pointer <%= nextButtonClass %>"></div>'].join(""),loader:['<div class="',t.loaderClass,'"></div>'].join(""),showElements:['<div class="show-elements">','<span class="text"><%= translate(text) %>:</span>','<div class="'+t.sizeChangeClass+' dropdown-trigger">',"<%= desc %>",'<span class="dropdown-toggle"></span>',"</div>","</div>"].join("")},r={show:"pagination.show",elementsOf:"pagination.elements-of",elementsPerPage:"pagination.elements-per-page"};return{initialize:function(t,n){this.datagrid=t,this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n),this.setVariables(),this.bindCustomEvents()},getHeight:function(){return this.sandbox.dom.outerHeight(this.$paginationContainer,!0)},render:function(e,n){this.$el=n,this.data=e,this.$paginationContainer=this.sandbox.dom.createElement('<div class="'+t.paginationClass+'"/>'),this.preparePagination(),this.sandbox.dom.append(this.$el,this.$paginationContainer),this.bindDomEvents()},getLimit:function(){return this.options.limit},setVariables:function(){this.$el=null,this.$paginationContainer=null,this.data=null},destroy:function(){this.sandbox.stop(this.sandbox.dom.find("*",this.$paginationContainer)),this.unbindDomEvents(),this.sandbox.dom.remove(this.$paginationContainer)},bindCustomEvents:function(){this.sandbox.on("husky.dropdown."+this.datagrid.options.instanceName+"-pagination-dropdown-show.item.click",function(e){if(this.data.limit!==e.id||this.data.embedded.length===this.data.total)this.startLoader(),this.datagrid.changePage.call(this.datagrid,null,1,e.id)}.bind(this))},startLoader:function(){var e=this.sandbox.dom.createElement(n.loader);this.sandbox.dom.append(this.$paginationContainer,e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"20px",color:"#999999"}}])},bindDomEvents:function(){var e=this.sandbox.dom.find("input."+t.inputClass,this.$el),n=parseInt(e.css("font-size"),10),r=parseInt(e.css("min-width"),10),i=parseInt(e.css("max-width"),10);this.sandbox.dom.on(this.sandbox.dom.find("."+t.nextClass,this.$el),"click",this.nextPage.bind(this)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.prevClass,this.$el),"click",this.prevPage.bind(this)),this.sandbox.dom.on(e,"focusout",this.inputHandler.bind(this)),this.sandbox.dom.on(e,"keydown",function(){if(event.which===13){this.inputHandler(event);return}var t=50+e.val().length*n/2;t>r&&t<=i&&e.css({width:t+"px"})}.bind(this))},inputHandler:function(e){var t=this.sandbox.dom.find(e.currentTarget),n=parseInt(t.val(),10);if(isNaN(n)){t.val(this.data.page);return}n<1&&(n=1),n>this.data.pages&&(n=this.data.pages);if(n===this.data.page){t.val(this.data.page);return}this.startLoader(),this.datagrid.changePage.call(this.datagrid,null,n)},nextPage:function(){!this.data.links.next||(this.startLoader(),this.datagrid.changePage.call(this.datagrid,this.data.links.next.href))},prevPage:function(){!this.data.links.previous||(this.startLoader(),this.datagrid.changePage.call(this.datagrid,this.data.links.previous.href))},unbindDomEvents:function(){this.sandbox.dom.unbind(this.sandbox.dom.find("*",this.$paginationContainer)),this.sandbox.dom.unbind(this.$paginationContainer)},preparePagination:function(){var e,i,s,o;this.data.total>this.options.showElementsSteps[0]&&(o=this.data.limit,i=this.sandbox.dom.createElement(this.sandbox.util.template(n.showElements)({desc:o,text:r.elementsPerPage,translate:this.sandbox.translate})),this.sandbox.dom.append(this.$paginationContainer,"<span></span>"),this.sandbox.dom.append(this.$paginationContainer,i),this.prepareShowElementsDropdown()),parseInt(this.data.pages,10)>1&&(e=this.sandbox.dom.createElement("<div/>"),e.addClass(t.paginationElementClass),this.sandbox.dom.append(this.$paginationContainer,e),s=this.renderPaginationRow(this.data.page,this.data.pages),this.sandbox.dom.append(e,this.sandbox.util.template(n.pageChanger,{label:s,prevButtonClass:this.data.page<this.data.pages?"":"disabled",nextButtonClass:this.data.page>1?"":"disabled"})))},renderPaginationRow:function(e,t){var r={translate:this.sandbox.translate,i:e,pages:t};return this.sandbox.util.template(n.pageLabel,r)},prepareShowElementsDropdown:function(){var e,n,r=[];for(e=-1,n=this.options.showElementsSteps.length;++e<n;)r.push({id:this.options.showElementsSteps[e],name:this.options.showElementsSteps[e]});this.sandbox.start([{name:"dropdown@husky",options:{el:this.sandbox.dom.find("."+t.sizeChangeClass,this.$paginationContainer),setParentDropDown:!0,instanceName:this.datagrid.options.instanceName+"-pagination-dropdown-show",alignment:"left",verticalAlignment:this.options.verticalAlignment,data:r}}])}}}),define("husky_components/datagrid/decorators/infinite-scroll-pagination",[],function(){"use strict";var e={scrollContainer:".page",reachedBottomMessage:"you reached the end of the list",scrollOffset:0,limit:50},t={paginationClass:"pagination-wrapper infinite-scroll",paginationElementClass:"pagination",loaderClass:"pagination-loader"},n={paginationContainer:['<div class="'+t.paginationClass+'">','   <div class="'+t.loaderClass+'"/>','   <span class="pagination-message"><%= reachedBottomMessage %></span>',"</div>"].join("")};return{initialize:function(t,n){this.datagrid=t,this.sandbox=this.datagrid.sandbox,this.options=this.sandbox.util.extend(!0,{},e,n),this.setVariables()},setVariables:function(){this.$el=null,this.$paginationContainer=null,this.$loader=null,this.data=null},getHeight:function(){return this.sandbox.dom.outerHeight(this.$paginationContainer,!0)},render:function(e,r){this.$el=r,this.data=e,this.$paginationContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.paginationContainer,{reachedBottomMessage:this.sandbox.translate(this.options.reachedBottomMessage)})),this.$loader=$(this.$paginationContainer).find("."+t.loaderClass),this.sandbox.dom.append(this.$el,this.$paginationContainer),this.startLoader(),this.bindInfiniteScroll(),this.fillScrollContainer()},startLoader:function(){this.sandbox.start([{name:"loader@husky",options:{el:this.$loader,size:"40px",color:"#cccccc"}}])},getLimit:function(){return this.options.limit},destroy:function(){this.sandbox.stop(this.sandbox.dom.find("*",this.$paginationContainer)),this.sandbox.dom.unbind(this.sandbox.dom.find("*",this.$paginationContainer)),this.sandbox.infiniteScroll.destroy(this.options.scrollContainer),this.sandbox.dom.remove(this.$paginationContainer)},bindInfiniteScroll:function(){this.sandbox.infiniteScroll.initialize(this.options.scrollContainer,this.appendNextPage.bind(this),this.options.scrollOffset)},fillScrollContainer:function(){var e=$(this.options.scrollContainer);e[0].clientHeight>=e[0].scrollHeight&&!!this.datagrid.data.links&&!!this.datagrid.data.links.next&&this.appendNextPage().then(function(){this.fillScrollContainer()}.bind(this))},appendNextPage:function(){var e=$.Deferred();return!this.datagrid.data.links||!this.datagrid.data.links.next?(!this.$paginationContainer.data("showReachedEnd")||this.$paginationContainer.addClass("reached-end"),e.resolve()):(this.$paginationContainer.addClass("loading"),this.sandbox.util.load(this.datagrid.data.links.next.href).then(function(t){this.updateDatagrid(t),this.$paginationContainer.data("showReachedEnd",!0),this.$paginationContainer.removeClass("loading"),e.resolve()}.bind(this))),e},updateDatagrid:function(e){this.datagrid.data.links=this.datagrid.parseLinks(e._links),this.datagrid.data.total=e.total,this.datagrid.data.page=e.page,this.datagrid.data.pages=e.pages,this.datagrid.data.limit=e.limit,this.addRecordsToDatagrid(e._embedded[this.datagrid.options.resultKey])},addRecordsToDatagrid:function(e){var t=[];e.forEach(function(e){!e.id||(t.push(e),this.datagrid.data.embedded.push(e))}.bind(this)),this.datagrid.gridViews[this.datagrid.viewId].addRecords?this.datagrid.gridViews[this.datagrid.viewId].addRecords(t,!0):t.forEach(function(e){this.datagrid.gridViews[this.datagrid.viewId].addRecord(e,!0)}.bind(this))}}}),function(){"use strict";define("__component__$datagrid@husky",["husky_components/datagrid/decorators/table-view","husky_components/datagrid/decorators/tiles-view","husky_components/datagrid/decorators/dropdown-pagination","husky_components/datagrid/decorators/infinite-scroll-pagination","services/husky/storage"],function(e,t,n,r,i){var s={view:"table",viewOptions:{table:{},thumbnail:{}},pagination:"dropdown",paginationOptions:{dropdown:{},"infinite-scroll":{}},contentFilters:null,sortable:!0,matchings:[],url:null,saveParams:{},data:null,instanceName:"",searchInstanceName:null,storageName:null,searchFields:[],columnOptionsInstanceName:null,defaultMeasureUnit:"px",preselected:[],onlySelectLeaves:!1,childrenPropertyName:!1,resizeListeners:!0,resultKey:"items",selectedCounter:!1,selectedCounterText:"public.elements-selected",selectedCounterShowSelectedText:"public.show-selected",selectedCounterShowAllText:"public.show-all",viewSpacingBottom:110,clickCallback:null,actionCallback:null,idKey:"id",childrenKey:"children"},o={STRING:"string",DATE:"date",DATETIME:"datetime",THUMBNAILS:"thumbnails",TITLE:"title",BYTES:"bytes",RADIO:"radio",CHECKBOX:"checkbox",CHECKBOX_READONLY:"checkbox_readonly",COUNT:"count",TRANSLATION:"translation",NUMBER:"number",CURRENCY:"currency"},u={views:{table:e,tiles:t},paginations:{dropdown:n,"infinite-scroll":r}},a={bytes:function(e){return this.sandbox.util.formatBytes(e)},title:function(e){return e},date:function(e){var t=this.sandbox.date.format(e);return t!==null?t:e},datetime:function(e){var t=this.sandbox.date.format(e,!0);return t!==null?t:e},translation:function(e){return this.sandbox.translate(e)},number:function(e){return this.sandbox.numberFormat(e,"n")},currency:function(e){return this.sandbox.numberFormat(e,"c")},count:function(e,t){return t?e+" "+t:e},thumbnails:function(e,t){var n={url:null,alt:null};return!!e&&!!e[t]&&(typeof e[t]=="object"?(n.url=e[t].url,n.alt=e[t].alt):(n.url=e[t],n.alt="")),n},radio:function(e,t,n){return this.sandbox.util.template(f.radio,{checked:!!e,columnName:n})},checkbox:function(e,t,n){return this.sandbox.util.template(f.checkbox,{checked:!!e,columnName:n,readonly:!1})},checkbox_readonly:function(e,t,n){return this.sandbox.util.template(f.checkbox,{checked:!!e,columnName:n,readonly:!0})}},f={radio:['<div class="custom-radio custom-filter">','   <input name="radio-<%= columnName %>" type="radio" class="form-element" <% if (checked) { print("checked")} %>/>','   <span class="icon"></span>',"</div>"].join(""),checkbox:['<div class="custom-checkbox custom-filter">','   <input name="radio-<%= columnName %>" type="checkbox" class="form-element"','       <% if (readonly) { %>readonly="readonly"<% } %>',"       <% if (checked) { %>checked<% } %>/>",'   <span class="icon"></span>',"</div>"].join(""),selectedCounter:['<span class="selected-elements invisible smaller-font grey-font">','    <span class="number">0</span>',"    &nbsp;<%= text %>",'    <span class="show-selected-container" <% if (!showSelectedLink) { %>style="display: none;"<% } %>>','        &nbsp;(<span class="show-selected"><%= showText %></span>)',"    </span>","</span>"].join("")},l="husky.datagrid.",c=function(){return this.createEventName("initialized")},h=function(){return this.createEventName("view.rendered")},p=function(){return this.createEventName("page.change")},d=function(){return this.createEventName("updated")},v=function(){return this.createEventName("loaded")},m=function(){return this.createEventName("item.deselect")},g=function(){return this.createEventName("number.selections")},y=function(){return this.createEventName("item.select")},b=function(){return this.createEventName("item.click")},w=function(){return this.createEventName("all.deselect")},E=function(){return this.createEventName("all.select")},S=function(){return this.createEventName("selected.update")},x=function(){return this.createEventName("updated")},T=function(){return this.createEventName("data.save.failed")},N=function(){return this.createEventName("loading.failed")},C=function(){return this.createEventName("data.changed")},k=function(){return this.createEventName("data.provide")},L=function(){return this.createEventName("view.change")},A=function(){return this.createEventName("change")},O=function(){return this.createEventName("pagination.change")},M=function(){return this.createEventName("change.page")},_=function(){return this.createEventName("record.add")},D=function(){return this.createEventName("records.add")},P=function(){return this.createEventName("record.remove")},H=function(){return this.createEventName("records.remove")},B=function(){return this.createEventName("records.change")},j=function(){return this.createEventName("records.set")},F=function(){return this.createEventName("records.get")},I=function(){return this.createEventName("page-size.changed")},q=function(){return this.createEventName("update")},R=function(){return this.createEventName("data.search")},U=function(){return this.createEventName("data.sort")},z=function(){return this.createEventName("url.update")},W=function(){return this.createEventName("data.get")},X=function(){return this.createEventName("data.set")},V=function(){return this.createEventName("items.get-selected")},$=function(){return this.createEventName("medium-loader.show")},J=function(){return this.createEventName("medium-loader.hide")},K=function(){return this.createEventName("select.item")},Q=function(){return this.createEventName("deselect.item")},G=function(){return this.createEventName("toggle.item")},Y=function(){return this.createEventName("items.deselect")},Z=function(e,t,n){if(e.indexOf(t+"=")>=0){var r=e.substring(0,e.indexOf(t+"=")),i=e.substring(e.indexOf(t+"="));i=i.substring(i.indexOf("=")+1),i=i.indexOf("&")>=0?i.substring(i.indexOf("&")):"",n?e=r+t+"="+n+i:e.substr(e.indexOf(t+"=")-1,1)==="&"?e=e.substring(0,r.length-1)+i:e=r+i.substring(1,i.length)}else!n||(e.indexOf("?")<0?e+="?"+t+"="+n:e+="&"+t+"="+n);return e};return{createEventName:function(e){return l+(this.options.instanceName?this.options.instanceName+".":"")+e},initialize:function(){this.sandbox.logger.log("initialized datagrid"),this.options=this.sandbox.util.extend(!0,{},s,this.options),this.storage=i.get("datagrid",this.options.storageName||this.sandbox.util.uniqueId("datgrid")),this.matchings=[],this.requestFields=[],this.selectedItems=[],this.decorators=this.sandbox.util.extend(!0,{},u),this.types=o,this.gridViews={},this.viewId=this.options.view,this.paginations={},this.paginationId=this.options.pagination,this.$loader=null,this.$mediumLoader=null,this.isLoading=!1,this.$element=this.sandbox.dom.$('<div class="husky-datagrid"/>'),this.$el.append(this.$element),this.dataGridWindowResize=null,this.sort={attribute:null,direction:null},this.bindCustomEvents(),this.bindDOMEvents(),this.renderMediumLoader(),this.loadAndInitializeDecorators().then(function(){this.options.selectedCounter===!0&&this.renderSelectedCounter(),this.loadAndEvaluateMatchings().then(function(){this.preSelectItems(),this.loadAndRenderData(),this.sandbox.emit(c.call(this))}.bind(this))}.bind(this))},remove:function(){this.unbindWindowResize(),this.destroy()},loadAndRenderData:function(){var e,t;this.options.url?(this.storage.has("url")?e=this.storage.get("url"):(e=this.options.url,t=e.indexOf("?")===-1?"?":"&",this.requestFields.length>0&&(e+=t+"fields="+this.requestFields.join(","),t="&")),this.sandbox.logger.log("load data from url"),this.loading(),this.load({url:e,success:function(e){this.sandbox.emit(v.call(this),e)}.bind(this)})):!this.options.data||(this.sandbox.logger.log("load data from array"),this.data={},!this.options.resultKey||!this.options.data[this.options.resultKey]?this.data.embedded=this.parseEmbedded(this.options.data):this.data.embedded=this.parseEmbedded(this.options.data[this.options.resultKey]),this.render(),!this.paginations[this.paginationId]||this.paginations[this.paginationId].render(this.data,this.$element))},loadAndEvaluateMatchings:function(){var e=this.sandbox.data.deferred(),t=this.options.matchings;return typeof t===o.STRING?(this.loading(),this.loadMatchings({url:t,success:function(t){this.filterMatchings(t),e.resolve()}.bind(this)})):(this.filterMatchings(t),e.resolve()),e},loadMatchings:function(e){this.sandbox.dom.addClass(this.$find(".selected-elements"),"invisible"),this.sandbox.util.load(e.url).then(function(t){this.updateSelectedCounter(),this.isLoading===!0&&this.stopLoading(),this.destroy(),!!e.success&&typeof e.success=="function"&&e.success(t)}.bind(this)).fail(function(e,t,n){this.sandbox.emit(N.call(this),e,t,n)}.bind(this))},filterMatchings:function(e){var t;this.matchings=[],this.requestFields=[],this.sandbox.util.foreach(e,function(e){t={};if(e.disabled!=="true"&&e.disabled!==!0){for(var n in e)n==="translation"?t.content=this.sandbox.translate(e.translation):n==="name"?t.attribute=e.name:n==="sortable"?(t.sortable=e.sortable,typeof e.sortable===o.STRING&&(t.sortable=JSON.parse(e.sortable))):t[n]=e[n];this.matchings.push(t),this.requestFields.push(e.name)}else e.name===this.options.idKey&&this.requestFields.push(e.name)}.bind(this))},render:function(){this.renderView(),!this.paginations[this.paginationId]||this.paginations[this.paginationId].render(this.data,this.$element),this.options.resizeListeners===!0&&this.windowResizeListener()},renderSelectedCounter:function(){this.sandbox.dom.append(this.$element,this.sandbox.util.template(f.selectedCounter,{text:this.sandbox.translate(this.options.selectedCounterText),showText:this.sandbox.translate(this.options.selectedCounterShowSelectedText),showSelectedLink:!!this.gridViews[this.viewId].showSelected})),this.updateSelectedCounter()},renderView:function(){this.gridViews[this.viewId].render(this.data,this.$element),this.updateSelectedCounter(),this.sandbox.emit(h.call(this))},preSelectItems:function(){var e=this.sandbox.dom.data(this.$el,"selected"),t=[];!e||(this.options.preselected=this.sandbox.util.union(this.options.preselected,e)),this.sandbox.util.foreach(this.options.preselected,function(e){typeof e=="object"?t.push(e.id):t.push(e)}.bind(this)),this.options.preselected=t,this.setSelectedItems(this.options.preselected),this.setSelectedItemsToData()},setSelectedItemsToData:function(){this.sandbox.dom.removeAttr(this.$el,"data-selected"),this.sandbox.dom.data(this.$el,"selected",this.getSelectedItemIds())},destroy:function(){!!this.gridViews[this.viewId]&&!!this.gridViews[this.viewId].rendered&&(this.gridViews[this.viewId].destroy(),!this.paginations[this.paginationId]||this.paginations[this.paginationId].destroy())},rerenderView:function(){this.gridViews[this.viewId].destroy(),this.renderView()},rerenderPagination:function(){!this.paginations[this.paginationId]||(this.paginations[this.paginationId].destroy(),this.paginations[this.paginationId].render(this.data,this.$element))},load:function(e){var t;return this.currentUrl=this.getUrl(e),e.data||(e.data={}),t=this.getSelectedItemIds(),t=this.options.expandIds?t.concat(this.options.expandIds):t,t.length&&(e.data.expandIds=t.join(",")),this.sandbox.dom.addClass(this.$find(".selected-elements"),"invisible"),this.sandbox.util.load(this.currentUrl,e.data).then(function(t){this.sandbox.dom.removeClass(this.$find(".selected-elements"),"invisible"),this.isLoading===!0&&this.stopLoading(),this.destroy(),this.parseData(t),this.getSortingFromUrl(this.currentUrl),this.render(),!!e.success&&typeof e.success=="function"&&e.success(t)}.bind(this)).fail(function(e,t,n){this.sandbox.emit(N.call(this),e,t,n)}.bind(this))},setData:function(e){this.destroy(),!e.resultKey||!e[e.resultKey]?this.data.embedded=e:this.data.embedded=e[e.resultKey],!this.paginations[this.paginationId]||this.paginations[this.paginationId].render(this.data,this.$element),this.render()},getSortingFromUrl:function(e){if(e.indexOf("sortOrder")>-1&&e.indexOf("sortBy")>-1){var t=this.sandbox.util.getParameterByName("sortBy",e),n=this.sandbox.util.getParameterByName("sortOrder",e);!!t&&!!n&&(this.sort.attribute=t,this.sort.direction=n)}},loading:function(){this.sandbox.dom.is(this.$element,":visible")&&(this.sandbox.dom.height(this.$element,this.sandbox.dom.outerHeight(this.$element)),this.sandbox.dom.width(this.$element,this.sandbox.dom.outerWidth(this.$element))),this.sandbox.dom.addClass(this.$element,"loading"),this.$loader||(this.$loader=this.sandbox.dom.createElement('<div class="datagrid-loader"/>'),this.sandbox.dom.hide(this.$loader),this.sandbox.dom.append(this.$element,this.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.$loader,size:"100px",color:"#cccccc"}}])),this.sandbox.dom.show(this.$loader),this.isLoading=!0},stopLoading:function(){return this.isLoading=!1,this.sandbox.dom.hide(this.$loader),this.sandbox.dom.removeClass(this.$element,"loading"),this.sandbox.dom.height(this.$element,""),this.sandbox.dom.width(this.$element,""),this.$element},loadAndInitializeDecorators:function(){var e=this.sandbox.data.deferred();return this.loadAndInitializePagination(this.paginationId).then(function(){this.loadAndInitializeView(this.viewId).then(function(){e.resolve()}.bind(this))}.bind(this)),e},renderMediumLoader:function(){this.$mediumLoader=this.sandbox.dom.createElement('<div class="medium-loader"/>'),this.sandbox.dom.append(this.$element,this.$mediumLoader),this.sandbox.start([{name:"loader@husky",options:{el:this.$mediumLoader,size:"50px",color:"#cccccc"}}])},showMediumLoader:function(){this.sandbox.dom.addClass(this.$mediumLoader,"show")},hideMediumLoader:function(){this.sandbox.dom.removeClass(this.$mediumLoader,"show")},parseData:function(e){this.data={},this.data.links=this.parseLinks(e._links),this.data.embedded=this.parseEmbedded(e._embedded[this.options.resultKey]),this.data.total=e.total,this.data.page=e.page,this.data.pages=e.pages,this.data.limit=e.limit},parseEmbedded:function(e,t){var n=[];for(var r=0,i=e.length;r<i;r++){var s=[];!t||(e[r].parent=t),e[r].id=e[r][this.options.idKey],e[r][this.options.childrenPropertyName]||(e[r][this.options.childrenPropertyName]=!1),e[r].hasOwnProperty(this.options.childrenKey)&&(s=this.parseEmbedded(e[r][this.options.childrenKey],e[r].id),e[r][this.options.childrenPropertyName]=s.length>0),n.push(e[r]),n=n.concat(s)}return n},parseLinks:function(e){var t={};return this.sandbox.util.each(e,function(e,n){t[e]={href:decodeURI(n.href)}}.bind(this)),t},loadAndInitializeView:function(e){this.viewId=e;var t=this.sandbox.data.deferred();return this.gridViews[this.viewId]?t.resolve():this.decorators.views[this.viewId]?(this.gridViews[this.viewId]=this.decorators.views[this.viewId],this.initializeViewDecorator(),t.resolve()):require([e],function(e){typeof e=="function"&&(e=new e),this.gridViews[this.viewId]=e,this.initializeViewDecorator(),t.resolve()}.bind(this)),t},initializeViewDecorator:function(){this.isViewValid(this.gridViews[this.viewId])?this.gridViews[this.viewId].initialize(this,this.options.viewOptions[this.viewId]):this.sandbox.logger.log("Error: View does not meet the configured requirements. See the documentation")},isViewValid:function(e){return!e||typeof e.initialize=="undefined"||typeof e.render=="undefined"||typeof e.destroy=="undefined"?!1:!0},loadAndInitializePagination:function(e){this.paginationId=e;var t=this.sandbox.data.deferred();return!e||!!this.paginations[this.paginationId]?t.resolve():this.decorators.paginations[this.paginationId]?(this.paginations[this.paginationId]=this.decorators.paginations[this.paginationId],this.initializePaginationDecorator(),t.resolve()):require([e],function(e){this.decorators.paginations[this.paginationId]=e,this.initializePaginationDecorator(),t.resolve()}.bind(this)),t},initializePaginationDecorator:function(){this.isPaginationValid(this.paginations[this.paginationId])?this.paginations[this.paginationId].initialize(this,this.options.paginationOptions[this.paginationId]):this.sandbox.logger.log("Error: Pagination does not meet the configured requirements. See the documentation")},changeView:function(e,t){if(e!==this.viewId||!!t)return this.destroy(),this.loadAndInitializeView(e).then(function(){this.extendViewOptions(t),this.render()}.bind(this))},changePagination:function(e){e!==this.paginationId&&(this.destroy(),this.loadAndInitializePagination(e).then(function(){this.render()}.bind(this)))},change:function(e,t,n,r,i){if(i===this.paginationId&&view===this.viewId)return;this.showMediumLoader(),this.changePage(null,e,t).then(function(){this.changeView(n,r).then(function(){this.changePagination(i),this.hideMediumLoader()}.bind(this))}.bind(this))},extendViewOptions:function(e){!!e&&!!this.gridViews[this.viewId].extendOptions&&this.gridViews[this.viewId].extendOptions(e)},isPaginationValid:function(e){return!e||typeof e.initialize=="undefined"||typeof e.render=="undefined"||typeof e.getLimit=="undefined"||typeof e.destroy=="undefined"?!1:!0},getUrl:function(e){if(!this.data||!this.data.links){var t="?",n=e.url;return!!this.options.pagination&&!!this.paginations[this.paginationId].getLimit()&&(e.url.indexOf("?")!==-1&&(t="&"),n=e.url+t+"limit="+this.paginations[this.paginationId].getLimit(),e.page>1&&(n+="&page="+e.page)),n}return e.url},getNumberAndUnit:function(e){e=String(e);var t=e.match(/(\d+)\s*(.*)/);return t[2]||(t[2]=this.options.defaultMeasureUnit),{number:parseInt(t[1],10),unit:t[2]}},manipulateContent:function(e,t,n,r){return typeof t=="function"?t(e,n,r):a.hasOwnProperty(t)?a[t].call(this,e,n,r):e},processContentFilter:function(e,t,n,r,i){if(!!this.options.contentFilters&&this.options.contentFilters.hasOwnProperty(e)){if(typeof this.options.contentFilters[e]=="function")return this.options.contentFilters[e].call(this,t,r,i);if(typeof this.options.contentFilters[e]===o.STRING)return n=this.options.contentFilters[e],this.manipulateContent(t,n,r,e)}else if(!!n)return this.manipulateContent(t,n,r);return t},resetSortingOptions:function(){this.sort.attribute=null,this.sort.direction=null},bindDOMEvents:function(){this.options.resizeListeners===!0&&(this.dataGridWindowResize=this.windowResizeListener.bind(this),this.sandbox.dom.on(this.sandbox.dom.$window,"resize."+this.createEventName("dom"),this.dataGridWindowResize)),this.options.selectedCounter&&this.sandbox.dom.on(this.$el,"click",this.toggleSelectedClickHandler.bind(this),".selected-elements .show-selected")},toggleSelectedClickHandler:function(e){this.sandbox.dom.stopPropagation(e);if(!this.gridViews[this.viewId].showSelected)return;this.show=!this.show,this.gridViews[this.viewId].showSelected(this.show),!this.show||!this.paginations[this.paginationId]?this.rerenderPagination():this.paginations[this.paginationId].destroy(),this.updateSelectedCounter()},unbindWindowResize:function(){this.sandbox.dom.off(this.sandbox.dom.$window,"resize."+this.createEventName("dom"))},bindCustomEvents:function(){this.options.resizeListeners===!0&&this.sandbox.on("husky.navigation.size.changed",this.windowResizeListener.bind(this)),this.sandbox.on(q.call(this),this.updateGrid.bind(this)),this.sandbox.on(X.call(this),this.setData.bind(this)),this.sandbox.on(W.call(this),this.provideData.bind(this)),this.sandbox.on(R.call(this),this.searchGrid.bind(this)),this.sandbox.on(z.call(this),this.updateUrl.bind(this)),this.sandbox.on(L.call(this),this.changeView.bind(this)),this.sandbox.on(A.call(this),this.change.bind(this)),this.sandbox.on(O.call(this),this.changePagination.bind(this)),this.sandbox.on(_.call(this),this.addRecordHandler.bind(this)),this.sandbox.on(D.call(this),this.addRecordsHandler.bind(this)),this.sandbox.on(P.call(this),this.removeRecordHandler.bind(this)),this.sandbox.on(H.call(this),this.removeRecordsHandler.bind(this)),this.sandbox.on(B.call(this),this.changeRecordsHandler.bind(this)),this.sandbox.on(j.call(this),this.setRecordsHandler.bind(this)),this.sandbox.on(F.call(this),this.getRecordsHandler.bind(this)),this.sandbox.on(g.call(this),this.updateSelectedCounter.bind(this)),this.sandbox.on($.call(this),this.showMediumLoader.bind(this)),this.sandbox.on(J.call(this),this.hideMediumLoader.bind(this)),this.sandbox.on(S.call(this),this.updateSelection.bind(this)),this.sandbox.on(K.call(this),this.selectItem.bind(this)),this.sandbox.on(Q.call(this),this.deselectItem.bind(this)),this.sandbox.on(G.call(this),this.toggleItem.bind(this)),this.sandbox.on(Y.call(this),function(){this.gridViews[this.viewId].deselectAllRecords()}.bind(this)),this.sandbox.on(V.call(this),function(e,t){if(!t)e(this.sandbox.util.deepCopy(this.getSelectedItemIds()));else{var n=this.getSelectedItemIds(),r=[];this.sandbox.util.foreach(n,function(e){r.push(this.getRecordById(e))}.bind(this)),e(n,r)}}.bind(this)),this.sandbox.on(M.call(this),function(e,t){isNaN(e)||this.changePage(null,e,t)}.bind(this)),this.startColumnOptionsListener(),this.startSearchListener()},startSearchListener:function(){if(this.options.searchInstanceName!==null){var e="."+this.options.searchInstanceName;this.sandbox.on("husky.search"+e,this.searchGrid.bind(this)),this.sandbox.on("husky.search"+e+".reset",this.searchGrid.bind(this,""))}},startColumnOptionsListener:function(){if(this.options.columnOptionsInstanceName!==null){var e=this.options.columnOptionsInstanceName!==""?"."+this.options.columnOptionsInstanceName:"";this.sandbox.on("husky.column-options"+e+".saved",this.filterGrid.bind(this))}},getUrlWithoutParams:function(){var e=this.data.links.self.href;return e.indexOf("?")!==-1?e.substring(0,e.indexOf("?")):e},getRecordIndexById:function(e){if(!!this.data&&!!this.data.embedded)for(var t=-1,n=this.data.embedded.length;++t<n;)if(this.data.embedded[t].id===e)return t;return null},getRecordById:function(e){for(var t=-1,n=this.data.embedded.length;++t<n;)if(this.data.embedded[t].id===e)return this.data.embedded[t];return null},provideData:function(){this.sandbox.emit(k.call(this),this.data)},windowResizeListener:function(){!!this.gridViews[this.viewId]&&!!this.gridViews[this.viewId].onResize&&this.gridViews[this.viewId].onResize()},addRecordHandler:function(e){if(!this.gridViews[this.viewId].addRecord)return;!e[this.options.idKey]||this.pushRecords([e]),this.gridViews[this.viewId].addRecord(e,!1),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},addRecordsHandler:function(e,t){if(!this.gridViews[this.viewId].addRecord)return;this.sandbox.util.foreach(e,function(e){!e[this.options.idKey]||(this.pushRecords([e]),this.gridViews[this.viewId].addRecord(e,!1))}.bind(this)),typeof t=="function"&&t(),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},removeRecordHandler:function(e){if(!this.gridViews[this.viewId].removeRecord||!e)return;this.gridViews[this.viewId].removeRecord(e),this.removeRecordFromSelected(e),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},removeRecordsHandler:function(e){if(!this.gridViews[this.viewId].removeRecord||!e)return;this.sandbox.util.foreach(e,function(e){this.gridViews[this.viewId].removeRecord(e),this.removeRecordFromSelected(e)}.bind(this)),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length)},removeRecordFromSelected:function(e){var t=this.selectedItems.indexOf(e);t>-1&&this.selectedItems.splice(t,1)},changeRecordsHandler:function(e){this.sandbox.dom.isArray(e)||(e=[e]),this.sandbox.util.foreach(e,function(e){this.changeRecord(e)}.bind(this)),this.rerenderView(),this.rerenderPagination()},setRecordsHandler:function(e){this.data.embedded=[],this.pushRecords(e),this.rerenderView(),this.rerenderPagination()},getRecordsHandler:function(e){e(this.sandbox.util.deepCopy(this.data.embedded))},itemClicked:function(e){typeof this.options.clickCallback=="function"&&this.options.clickCallback(e,this.data.embedded[this.getRecordIndexById(e)]),this.sandbox.emit(b.call(this),e,this.data.embedded[this.getRecordIndexById(e)])},itemAction:function(e){typeof this.options.actionCallback=="function"&&this.options.actionCallback(e,this.data.embedded[this.getRecordIndexById(e)])},getRemainingViewHeight:function(){var e=this.sandbox.dom.height(this.sandbox.dom.window)-this.sandbox.dom.offset(this.$element).top;return!!this.paginations[this.paginationId]&&!!this.paginations[this.paginationId].getHeight&&(e-=this.paginations[this.paginationId].getHeight()),e-=this.options.viewSpacingBottom,e},updateSelectedCounter:function(){this.options.selectedCounter===!0&&(this.sandbox.dom.html(this.$find(".selected-elements .number"),this.getSelectedItemIds().length),this.getSelectedItemIds().length===0?this.sandbox.dom.addClass(this.$find(".selected-elements"),"invisible"):this.sandbox.dom.removeClass(this.$find(".selected-elements"),"invisible"),!!this.gridViews[this.viewId]&&!!this.gridViews[this.viewId].showSelected&&this.getSelectedItemIds().length===0&&(this.show===!0&&!!this.gridViews[this.viewId].rendered&&this.gridViews[this.viewId].showSelected(!1),this.show=!1),this.show?this.sandbox.dom.text(this.$find(".show-selected"),this.sandbox.translate(this.options.selectedCounterShowAllText)):this.sandbox.dom.text(this.$find(".show-selected"),this.sandbox.translate(this.options.selectedCounterShowSelectedText)),this.gridViews[this.viewId].showSelected?this.sandbox.dom.show(this.$find(".show-selected-container")):this.sandbox.dom.hide(this.$find(".show-selected-container")))},deselectAllItems:function(){this.selectedItems=[],this.sandbox.emit(w.call(this)),this.sandbox.emit(g.call(this),0),this.setSelectedItemsToData()},selectAllItems:function(){var e,t;for(e=-1,t=this.data.embedded.length;++e<t;)this.setItemSelected(this.data.embedded[e].id);this.sandbox.emit(E.call(this),this.selectedItems),this.sandbox.emit(g.call(this),this.selectedItems.length),this.setSelectedItemsToData()},updateSelection:function(e){var t,n;this.gridViews[this.viewId].deselectAllRecords();for(t=-1,n=e.length;++t<n;)this.gridViews[this.viewId].selectRecord(e[t])},selectItem:function(e){this.gridViews[this.viewId].selectRecord(e)},deselectItem:function(e){!this.gridViews[this.viewId].deselectRecord||this.gridViews[this.viewId].deselectRecord(e)},toggleItem:function(e){this.itemIsSelected(e)?this.deselectItem(e):this.selectItem(e)},getSelectedItemIds:function(){return this.selectedItems},setSelectedItems:function(e){var t=0,n,r,i;for(n=-1,r=e.length;++n<r;)this.selectedItems.indexOf(e[n])===-1&&this.selectingAllowed(e[n])?(this.selectedItems.push(e[n]),t++):(i=this.selectedItems.indexOf(e[n]))!==-1&&this.selectedItems.splice(i,1);this.sandbox.emit(g.call(this),t)},itemIsSelected:function(e){return this.selectedItems.indexOf(e)!==-1},setItemSelected:function(e){return this.selectedItems.indexOf(e)===-1?(this.selectedItems.push(e),this.sandbox.emit(y.call(this),e,this.getRecordById(e)),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length),this.setSelectedItemsToData(),!0):!1},setItemUnselected:function(e){var t;return(t=this.selectedItems.indexOf(e))!==-1?(this.selectedItems.splice(t,1),this.sandbox.emit(m.call(this),e),this.sandbox.emit(g.call(this),this.getSelectedItemIds().length),this.setSelectedItemsToData(),!0):!1},selectingAllowed:function(e){var t=this.getRecordIndexById(e);return this.options.onlySelectLeaves===!0&&this.data.embedded[t][this.options.childrenPropertyName]?!1:!0},updateUrl:function(e){var t,n;t=this.currentUrl;for(n in e)t=Z.call(this,t,n,e[n]);this.storage.set("url",t),this.destroy(),this.loading(),this.load({url:t,success:function(e){this.sandbox.emit(d.call(this),e)}.bind(this)})},updateRecord:function(e){for(var t=-1,n=this.data.embedded.length;++t<n;)if(e[this.options.idKey]===this.data.embedded[t].id)return this.data.embedded[t]=e,!0;return!1},changeRecord:function(e){if(!e[this.options.idKey])return this.sandbox.logger.log("Error: Failed changing a record. Must contain id-property"),!1;for(var t=-1,n=this.data.embedded.length;++t<n;)if(e[this.options.idKey]===this.data.embedded[t].id)return this.data.embedded[t]=this.sandbox.util.extend(!0,{},this.data.embedded[t],e),!0},removeRecord:function(e){if(!!e){var t,n;for(t=-1,n=this.data.embedded.length;++t<n;)if(e===this.data.embedded[t].id)return this.removeRecordFromSelected(e),this.data.embedded.splice(t,1),this.rerenderPagination(),!0}return!1},pushRecords:function(e){for(var t=-1,n=e.length;++t<n;)this.data.embedded.push(e[t]);this.rerenderPagination()},unshiftRecords:function(e){for(var t=-1,n=e.length;++t<n;)this.data.embedded.unshift(e[t]),this.rerenderPagination()},changePage:function(e,t,n){if(!!this.data.links.pagination||!!e){var r=this.sandbox.data.deferred();this.show=!1,this.updateSelectedCounter();var i,s;if(!e){if(!t||t>this.data.pages||t<1)return this.sandbox.logger.log("invalid page number or reached start/end!"),r.resolve(),r;n?this.data.limit!==n&&this.sandbox.emit(I.call(this),n,this.paginationId):n=this.data.limit,s=this.sandbox.uritemplate.parse(this.data.links.pagination.href),i=this.sandbox.uritemplate.expand(s,{page:t,limit:n})}else i=e;return this.viewId==="table"&&this.storage.set("url",i),this.sandbox.emit(p.call(this),i),this.load({url:i,success:function(){r.resolve(),this.sandbox.emit(d.call(this),"changed page")}.bind(this)}),r}},updateGrid:function(){!this.data.links.self||(this.resetSortingOptions(),this.load({url:this.data.links.self.href,success:function(){this.sandbox.emit(d.call(this))}.bind(this)}))},filterGrid:function(e){if(!!this.data.links.filter){var t,n;this.filterMatchings(e),t=this.sandbox.uritemplate.parse(this.data.links.filter.href),n=this.sandbox.uritemplate.expand(t,{fieldsList:this.requestFields.join(",")}),this.destroy(),this.loading(),this.load({url:n,success:function(){this.sandbox.emit(d.call(this))}.bind(this)})}},sortGrid:function(e,t){if(this.options.sortable===!0&&!!this.data.links.sortable){var n,r;!e||(this.sort.attribute=e,this.sort.direction=t,n=this.sandbox.uritemplate.parse(this.data.links.sortable.href),r=this.sandbox.uritemplate.expand(n,{sortBy:e,sortOrder:t}),this.sandbox.emit(U.call(this),{attribute:e,direction:t}),this.load({url:r,success:function(e){this.sandbox.emit(d.call(this),e)}.bind(this)}))}},loadChildren:function(e){var t=this.sandbox.data.deferred();if(!this.data.links.children)t.resolve();else{var n=this.sandbox.uritemplate.parse(this.data.links.children.href),r=this.sandbox.uritemplate.expand(n,{parentId:e});this.sandbox.util.load(this.getUrl({url:r})).then(function(e){this.addRecordsHandler(e._embedded[this.options.resultKey]),t.resolve()}.bind(this)).fail(function(e,n){this.sandbox.logger.error(e,n),t.fail()}.bind(this))}return t},searchGrid:function(e,t){if(!!this.data.links.find){var n,r;n=this.sandbox.uritemplate.parse(this.data.links.find.href),t?r=this.sandbox.uritemplate.expand(n,{searchString:e,searchFields:t}):r=this.sandbox.uritemplate.expand(n,{searchString:e,searchFields:this.options.searchFields.join(",")}),e!==""?this.storage.set("url",r):this.storage.remove("url"),this.destroy(),this.loading(),this.load({url:r,success:function(){this.sandbox.emit(d.call(this))}.bind(this)})}},saveGrid:function(e,t,n,r,i){var s="POST",o=!0;!e.id||(s="PUT",o=!1,t=t+"/"+e.id);for(var u in this.options.saveParams)t=Z.call(this,t,u,this.options.saveParams[u]);this.sandbox.emit(C.call(this)),this.sandbox.util.save(t,s,e).then(function(e,t){this.sandbox.emit(x.call(this),e,t),typeof n=="function"&&n(e,t),o===!1?this.updateRecord(e):i===!0?this.unshiftRecords([e]):this.pushRecords([e])}.bind(this)).fail(function(t,n,i){this.sandbox.emit(T.call(this),t,n,i,e),typeof r=="function"&&r(t,n,i)}.bind(this))}}})}(),define("__component__$dropdown@husky",["underscore"],function(e){"use strict";var t="Husky.Ui.DropDown",n={url:"",data:[],trigger:"",triggerOutside:!1,shadow:!0,toggleClassOn:null,valueName:"name",infoName:"info",clickedName:"clickedInfo",setParentDropDown:!1,excludeItems:[],instanceName:"undefined",alignment:"left",verticalAlignment:"bottom",translateLabels:!0,clickDelay:1e3};return{initialize:function(){this.name=t,this.options=this.sandbox.util.extend({},n,this.options),this.$element=this.sandbox.dom.createElement("<div/>",{"class":"husky-drop-down"}),this.sandbox.dom.append(this.options.el,this.$element),this.render(),this.sandbox.emit("husky.dropdown."+this.options.instanceName+".initialized")},render:function(){var e=["dropdown-menu"];this.options.shadow===!0&&e.push("dropdown-shadow"),this.$dropDown=this.sandbox.dom.createElement("<div/>",{"class":e.join(" ")}),this.$dropDownList=this.sandbox.dom.createElement("<ul/>"),this.sandbox.dom.append(this.$element,this.$dropDown),this.sandbox.dom.append(this.$dropDown,this.$dropDownList),this.hideDropDown(),this.options.setParentDropDown&&this.sandbox.dom.addClass(this.sandbox.dom.parent(this.$element),"dropdown"),this.options.alignment==="right"&&this.sandbox.dom.addClass(this.$dropDown,"dropdown-align-right"),this.options.verticalAlignment==="top"&&this.sandbox.dom.addClass(this.$dropDown,"dropdown-align-top"),this.bindDOMEvents(),this.bindCustomEvents(),this.prepareData()},bindDOMEvents:function(){this.sandbox.dom.off(this.$element),this.options.trigger!==""?this.options.triggerOutside?($(this.options.trigger).addClass("husky-dropdown-trigger"),this.sandbox.dom.on(this.options.trigger,"click",this.triggerClick.bind(this))):($(this.options.el).addClass("husky-dropdown-trigger"),this.sandbox.dom.on(this.options.el,"click",this.triggerClick.bind(this),this.options.trigger)):($(this.options.el).addClass("husky-dropdown-trigger"),this.sandbox.dom.on(this.options.el,"click",this.triggerClick.bind(this))),this.sandbox.dom.on(this.$dropDownList,"click",function(e){this.sandbox.dom.hasClass(e.currentTarget,"disabled")||this.clickItem(this.sandbox.dom.data(e.currentTarget,"id"))}.bind(this),'li:not(".divider")')},bindCustomEvents:function(){this.sandbox.on(this.getEvent("toggle"),this.triggerClick.bind(this)),this.sandbox.on(this.getEvent("show"),this.showDropDown.bind(this)),this.sandbox.on(this.getEvent("hide"),this.hideDropDown.bind(this)),this.sandbox.on(this.getEvent("item.enable"),this.itemEnable.bind(this)),this.sandbox.on(this.getEvent("item.disable"),this.itemDisable.bind(this)),this.sandbox.on(this.getEvent("item.toggle"),this.itemToggle.bind(this))},getEvent:function(e){return"husky.dropdown."+this.options.instanceName+"."+e},itemToggle:function(e,t){t===!0?this.itemEnable(e):this.itemDisable(e)},itemEnable:function(e){this.sandbox.dom.removeClass(this.$find('li[data-id="'+e+'"]'),"disabled")},itemDisable:function(e){this.sandbox.dom.addClass(this.$find('li[data-id="'+e+'"]'),"disabled")},clickItem:function(t){var n=this.getItemById(t),r=this.$el.find('*[data-id="'+t+'"]'),i;if(!n)return;!n.callback||typeof n.callback!="function"?!this.options.clickCallback||typeof this.options.clickCallback!="function"?this.sandbox.emit(this.getEvent("item.click"),n,this.$el):this.options.clickCallback(n,this.$el):n.callback.call(this);if(!n[this.options.clickedName])return this.hideDropDown();i=r.find(".info, .info-clicked"),r.addClass("highlight-animation"),i.addClass("clicked"),e.delay(function(){return r.removeClass("highlight-animation"),i.removeClass("clicked"),this.hideDropDown()}.bind(this),this.options.clickDelay)},getItemById:function(e){for(var t=0,n=this.options.data.length,r;t<n;++t){r=this.options.data[t];if(typeof r.id!="undefined"&&r.id.toString()===e.toString())return r}},triggerClick:function(e){var t=$(e.target);if(t.hasClass("husky-dropdown-item")||t.parents().hasClass("husky-dropdown-item"))return;this.toggleDropDown()},prepareData:function(){this.options.data.length>0?this.generateDropDown(this.options.data):this.loadData()},loadData:function(){var e=this.getUrl();this.sandbox.logger.log(this.name,"load: "+e),this.sandbox.util.ajax({url:e,success:function(e){this.sandbox.logger.log(this.name,"load","success"),e.total>0&&e.items.length===e.total?this.options.data=e.items:this.options.data=[],this.generateDropDown(this.options.data)}.bind(this),error:function(){this.sandbox.logger.log(this.name,"load","error"),this.options.data=[],this.generateDropDown(this.options.data)}.bind(this)}),setTimeout(function(){this.sandbox.emit(this.getEvent("data.load"))}.bind(this),200)},generateDropDown:function(e){this.clearDropDown(),e.length>0?e.forEach(function(e){if(e.divider!==!0){if(this.isVisible(e)){var t=e[this.options.valueName],n=e[this.options.infoName],r=e[this.options.clickedName],i;this.options.translateLabels&&(t=this.sandbox.translate(t),n=this.sandbox.translate(n),r=this.sandbox.translate(r)),t=this.sandbox.util.cropMiddle(t,35),i=['<li class="husky-dropdown-item" data-id="',e.id,'">','<span class="label">',t,"</span>",n!==undefined?'<span class="info">'+n+"</span>":"",r!==undefined?'<span class="info-clicked">'+r+"</span>":"","</li>"].join(""),this.sandbox.dom.append(this.$dropDownList,i)}}else this.sandbox.dom.append(this.$dropDownList,'<li class="divider"/>')}.bind(this)):this.sandbox.dom.append(this.$dropDownList,"<li>No data received</li>"),this.sandbox.emit(this.getEvent("rendered"))},isVisible:function(e){var t=!0;return this.options.excludeItems.forEach(function(n){e.id===n.id&&(t=!1)}.bind(this)),t},clearDropDown:function(){this.sandbox.dom.remove(this.sandbox.dom.children(this.sandbox.dom.children(this.$dropDown,"ul"),"li"))},toggleDropDown:function(){this.sandbox.logger.log(this.name,"toggle dropdown"),this.sandbox.dom.is(this.$dropDown,":visible")?this.hideDropDown():this.showDropDown()},showDropDown:function(){this.sandbox.logger.log(this.name,"show dropdown"),this.sandbox.dom.removeClass(this.$dropDown,"top"),this.sandbox.dom.one(this.sandbox.dom.window,"click",this.hideDropDown.bind(this)),this.sandbox.dom.show(this.$dropDown),this.sandbox.emit("husky.dropdown."+this.options.instanceName+".showing"),!this.options.toggleClassOn||this.sandbox.dom.addClass(this.options.toggleClassOn,"is-active"),this.sandbox.dom.offset(this.$dropDown).top-this.sandbox.dom.scrollTop(this.sandbox.dom.window)+this.sandbox.dom.outerHeight(this.$dropDown)>this.sandbox.dom.height(this.sandbox.dom.window)&&this.sandbox.dom.addClass(this.$dropDown,"top")},hideDropDown:function(e){if(!!e){var t=$(e.target);if(t.is(".husky-dropdown-trigger:not(.husky-dropdown-item), .highlight-animation")||t.parents().is(".husky-dropdown-trigger:not(.husky-dropdown-item), .highlight-animation")){this.sandbox.dom.one(this.sandbox.dom.window,"click",this.hideDropDown.bind(this));return}}this.sandbox.logger.log(this.name,"hide dropdown"),this.sandbox.dom.off(this.sandbox.dom.window,"click",this.hideDropDown.bind(this)),this.sandbox.dom.hide(this.$dropDown),!this.options.toggleClassOn||this.sandbox.dom.removeClass(this.options.toggleClassOn,"is-active")},getUrl:function(){return this.options.url}}}),define("__component__$matrix@husky",[],function(){"use strict";var e="is-active",t="td:last-child > span:last-child";return{initialize:function(){this.$element=this.sandbox.dom.createElement('<div class="husky-matrix"/>'),this.prepare(),this.sandbox.dom.append(this.$el,this.$element),this.bindDOMEvents(),this.bindCustomEvents()},bindDOMEvents:function(){this.sandbox.dom.on(this.$element,"click",this.toggleIcon.bind(this),'tbody > tr > td.value > span[class^="fa-"]'),this.sandbox.dom.on(this.$element,"click",this.toggleRow.bind(this),t)},bindCustomEvents:function(){this.sandbox.on("husky.matrix.set-all",this.setAllActive.bind(this)),this.sandbox.on("husky.matrix.unset-all",this.unsetAllActive.bind(this))},toggleIcon:function(n){var r=n.currentTarget,i=this.sandbox.dom.parent(r),s=this.sandbox.dom.parent(i),o=this.sandbox.dom.find('span[class^="fa-"]',i),u,a=this.sandbox.dom.find(t,s);this.sandbox.dom.toggleClass(r,e),u=this.sandbox.dom.find('span[class^="fa-"].'+e,i),u.length==0?this.sandbox.dom.html(a,this.options.captions.all):this.sandbox.dom.html(a,this.options.captions.none),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(r,"section"),value:this.sandbox.dom.data(r,"value"),activated:this.sandbox.dom.hasClass(r,e)})},toggleRow:function(n){var r=this.sandbox.dom.parent(this.sandbox.dom.parent(n.currentTarget)),i=this.sandbox.dom.find('span[class^="fa-"]',r),s=this.sandbox.dom.find('span[class^="fa-"].'+e,r),o=this.sandbox.dom.find(t,r),u;s.length==0?(this.sandbox.dom.addClass(i,e),this.sandbox.dom.html(o,this.options.captions.none),u=!0):(this.sandbox.dom.removeClass(i,e),this.sandbox.dom.html(o,this.options.captions.all),u=!1),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(i,"section"),value:this.options.values.horizontal[r.data("row-count")],activated:u})},setAllActive:function(){var n=this.sandbox.dom.find('span[class^="fa-"]',this.$element),r=this.sandbox.dom.find("tbody > tr",this.$element);this.sandbox.dom.addClass(n,e),this.sandbox.dom.each(r,function(e,n){var r=this.sandbox.dom.find(t,n);this.sandbox.dom.html(r,this.options.captions.none),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(this.sandbox.dom.find("td.section",n),"section"),value:this.options.values.horizontal[$(n).data("row-count")],activated:!0})}.bind(this))},unsetAllActive:function(){var n=this.sandbox.dom.find('span[class^="fa-"]',this.$element),r=this.sandbox.dom.find("tbody > tr",this.$element);this.sandbox.dom.removeClass(n,e),this.sandbox.dom.each(r,function(e,n){var r=this.sandbox.dom.find(t,n);this.sandbox.dom.html(r,this.options.captions.all),this.sandbox.emit("husky.matrix.changed",{section:this.sandbox.dom.data(this.sandbox.dom.find("td.section",n),"section"),value:this.options.values.horizontal[$(n).data("row-count")],activated:!1})}.bind(this))},prepare:function(){this.$element.append(this.prepareTable())},prepareTable:function(){var e;return e=this.sandbox.dom.createElement('<table class="table matrix"/>'),this.sandbox.dom.append(e,this.prepareTableHead()),!this.options.captions.vertical||this.sandbox.dom.append(e,this.prepareTableBody()),e},prepareTableHead:function(){var e=this.sandbox.dom.createElement("<thead/>"),t=this.sandbox.dom.createElement("<tr/>"),n=this.sandbox.dom.createElement('<th class="section"/>'),r,i;return!this.options.captions.general||(r=this.sandbox.dom.createElement('<th class="general"/>'),this.sandbox.dom.html(r,this.options.captions.general),this.sandbox.dom.append(t,r)),this.sandbox.dom.html(n,this.options.captions.type),this.sandbox.dom.append(t,n),typeof this.options.captions.horizontal=="string"?(i=this.sandbox.dom.createElement("<th/>"),this.sandbox.dom.html(i,this.options.captions.horizontal),this.sandbox.dom.append(t,i)):this.options.captions.horizontal.forEach(function(e){var n=this.sandbox.dom.createElement("<th/>");this.sandbox.dom.html(n,e),this.sandbox.dom.append(t,n)}.bind(this)),this.sandbox.dom.append(e,t),e},prepareTableBody:function(){var e=this.sandbox.dom.createElement("<tbody/>"),t;for(t=0;t<this.options.captions.vertical.length;t++)this.prepareTableRow(e,t);return e},prepareTableRow:function(e,t){var n=this.sandbox.dom.createElement("<tr/>"),r=this.sandbox.dom.createElement('<td class="section"/>'),i=this.sandbox.dom.createElement('<td class="value"></td>'),s;n.data("row-count",t),!this.options.captions.general||this.sandbox.dom.append(n,this.sandbox.dom.createElement("<td/>")),this.sandbox.dom.html(r,this.options.captions.vertical[t]),this.sandbox.dom.data(r,"section",this.options.values.vertical[t]),this.sandbox.dom.append(n,r),s=this.prepareTableColumn(i,this.options.values.horizontal[t],this.options.values.vertical[t],this.options.data[t]),this.sandbox.dom.append(n,i),i.append(['<span class="all pointer">',s?this.options.captions.none:this.options.captions.all,"</span>"].join("")),this.sandbox.dom.append(n,i),this.sandbox.dom.append(e,n)},prepareTableColumn:function(t,n,r,i){var s=!1,o,u,a;for(a=0;a<n.length;a++)n[a].title?o='title="'+this.sandbox.translate(n[a].title)+'"':o="",u=this.sandbox.dom.createElement("<span "+o+' class="fa-'+n[a].icon+' matrix-icon pointer"/>'),this.sandbox.dom.data(u,"value",n[a].value),this.sandbox.dom.data(u,"section",r),!!i&&!!i[a]&&(this.sandbox.dom.addClass(u,e),s=!0),this.sandbox.dom.append(t,u);return s}}}),define("__component__$search@husky",["services/husky/storage"],function(e){"use strict";var t={skeleton:['<a href="#" class="fa-search fa-flip-horizontal search-icon" />','<a href="#" class="fa-times-circle remove-icon" />','<input id="search-input" type="text" class="form-element input-round search-input" placeholder="<%= placeholderText %>"/>'].join("")},n={instanceName:null,storageName:null,placeholderText:"public.search",appearance:"gray",slide:!1},r={slideClass:"search-slide",slideCollapsedClass:"slide-collapsed",slideExpandedClass:"slide-expanded"},i=function(){return this.getEventName()},s=function(){return this.getEventName("reset")},o=function(){return this.getEventName("clear")},u=function(){return this.getEventName("initialized")};return{initialize:function(){this.sandbox.logger.log("initialize",this),this.options=this.sandbox.util.extend({},n,this.options),this.storage=e.get("search",this.options.storageName||this.sandbox.util.uniqueId("search")),this.render(),this.bindDOMEvents(),this.bindCustomEvents(),this.sandbox.emit(u.call(this))},bindCustomEvents:function(){this.sandbox.on(o.call(this),function(){this.removeSearch(null,!0)}.bind(this))},render:function(){this.sandbox.dom.addClass(this.$el,"search-container"),this.sandbox.dom.addClass(this.$el,this.options.appearance),this.options.slide===!0&&(this.sandbox.dom.addClass(this.$el,r.slideClass),this.collapse()),this.sandbox.dom.html(this.$el,this.sandbox.template.parse(t.skeleton,{placeholderText:this.sandbox.translate(this.options.placeholderText)})),this.storage.has("searchString")&&(this.$el.find("input").val(this.storage.get("searchString")),this.$el.find(".remove-icon").show(),this.searchSubmitted=!0)},bindDOMEvents:function(){this.sandbox.dom.on(this.$el,"click",this.selectInput.bind(this),"input"),this.sandbox.dom.on(this.$el,"keyup onchange",this.checkKeyPressed.bind(this),"#search-input"),this.sandbox.dom.on(this.$find("input"),"focus",function(){this.sandbox.dom.addClass(this.$el,"focus")}.bind(this)),this.sandbox.dom.on(this.$el,"click",this.submitSearch.bind(this),".search-icon"),this.sandbox.dom.on(this.$el,"click",this.removeSearch.bind(this),".remove-icon"),this.sandbox.dom.on(this.$find("input"),"blur",function(){this.sandbox.dom.removeClass(this.$el,"focus")}.bind(this)),this.options.slide===!0&&(this.sandbox.dom.on(this.$find("input"),"focus",this.expand.bind(this)),this.sandbox.dom.on(this.$find("input"),"blur",this.collapse.bind(this))),this.$el.on("keydown keyup",function(e){e.stopPropagation()}.bind(this))},collapse:function(){this.sandbox.dom.removeClass(this.$el,r.slideExpandedClass),this.sandbox.dom.addClass(this.$el,r.slideCollapsedClass)},expand:function(){this.sandbox.dom.removeClass(this.$el,r.slideCollapsedClass),this.sandbox.dom.addClass(this.$el,r.slideExpandedClass)},resetSearch:function(e){e||this.sandbox.emit(s.call(this)),this.searchSubmitted=!1,this.storage.remove("searchString")},checkKeyPressed:function(e){var t;t=this.sandbox.dom.prev(e.currentTarget,".remove-icon"),this.sandbox.dom.val(e.currentTarget).length>0?this.sandbox.dom.show(t):this.sandbox.dom.hide(t),e.keyCode===13?this.submitSearch():e.keyCode===27&&this.removeSearch()},submitSearch:function(e){!e||this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.val(this.sandbox.dom.find("#search-input",this.$el));if(t===""){this.searchSubmitted&&this.resetSearch();return}this.searchSubmitted=!0,this.storage.set("searchString",t),this.sandbox.emit(i.call(this),t)},removeSearch:function(e,t){e?this.sandbox.dom.preventDefault(e):e={target:this.sandbox.dom.find(".remove-icon",this.$el),currentTarget:this.sandbox.dom.find(".remove-icon",this.$el)};var n=this.sandbox.dom.next(e.currentTarget,"input");this.sandbox.dom.hide(e.target),this.sandbox.dom.val(n,""),this.searchSubmitted&&this.resetSearch(t)},selectInput:function(e){this.sandbox.dom.trigger(e.currentTarget,"select")},getEventName:function(e){var t="husky.search";return e?e="."+e:e="",this.options.instanceName&&(t+="."+this.options.instanceName),t+e}}}),define("services/husky/logger",[],function(){"use strict";function e(){}return e.prototype=window.Husky.logger,new e}),define("services/husky/expression",["underscore","services/husky/logger"],function(e,t){"use strict";function n(){}return n.prototype.evaluate=function(n,r){for(var i=0,s=n.length;i<s;i++){var o=e.extend({property:null,operator:null,value:null},n[i]);if(!r.hasOwnProperty(o.property))return t.warn('property "'+o.property+'" does not exists in data'),!1;switch(o.operator){case"eq":if(r[o.property]!==o.value)return!1;break;case"neq":if(r[o.property]===o.value)return!1;break;default:return t.error('operator "'+o.operator+'" is not implemented.'),!1}}return!0},new n}),define("__component__$tabs@husky",["services/husky/expression"],function(e){"use strict";var t={url:null,data:[],instanceName:"",preselect:!0,preselector:"url",forceReload:!1,callback:null,forceSelect:!0,values:{},preSelectEvent:{enabled:!1,triggerSelectItem:!0}},n=function(){return this.createEventName("activate")},r=function(){return this.createEventName("deactivate")},i=function(){return this.createEventName("item.show")},s=function(){return this.createEventName("item.hide")},o=function(){return this.createEventName("item.select")},u=function(){return this.createEventName("item.preselect")},a=function(){return this.createEventName("item.clicked")},f=function(){return this.createEventName("getSelected")},l=function(){return this.createEventName("update")},c=function(){return this.createEventName("update-notification")},h=function(){return this.createEventName("updated")},p=function(){return this.createEventName("initialized")},d=function(e){e.preventDefault(),this.sandbox.emit(u.call(this),e),!this.options.preSelectEvent.triggerSelectItem||v.call(this,e)},v=function(e){e.preventDefault();if(this.active!==!0||this.sandbox.dom.hasClass(e.currentTarget,"is-selected")===!0)return!1;var t=this.items[this.sandbox.dom.data(e.currentTarget,"id")];!t||(this.sandbox.dom.removeClass(this.sandbox.dom.find(".is-selected",this.$el),"is-selected"),this.sandbox.dom.addClass(e.currentTarget,"is-selected"),this.sandbox.dom.addClass(this.$marker,"animate"),m.call(this),t.hasOwnProperty("callback")&&typeof t.callback=="function"?t.callback.call(this,t):!this.options.callback||typeof this.options.callback!="function"?g.call(this,t):this.options.callback.call(this,t))},m=function(){var e=this.$find("li.is-selected");!e.length||(this.sandbox.dom.width(this.$marker,this.sandbox.dom.outerWidth(e)),this.sandbox.dom.css(this.$marker,{left:this.sandbox.dom.position(e).left+"px"}))},g=function(e){e.forceReload=e.forceReload&&typeof e.forceReload!="undefined"?e.forceReload:this.options.forceReload,this.sandbox.emit(o.call(this),e)},y=function(e){this.sandbox.dom.show(this.domItems[e]),this.sandbox.dom.removeClass(this.$marker,"animate"),m.call(this)},b=function(e){this.sandbox.dom.hide(this.domItems[e]),this.sandbox.dom.removeClass(this.$marker,"animate"),m.call(this)},w=function(t){var n=0;this.sandbox.util.foreach(this.data,function(r){var i=this.$find('li[data-id="'+r.id+'"]');!!r.displayConditions&&!e.evaluate(r.displayConditions,t)?this.sandbox.dom.hide(i):(this.sandbox.dom.show(i),++n)}.bind(this)),n>=2?this.$el.show():this.$el.hide(),this.sandbox.emit(h.call(this),n),m.call(this)},E=function(e,t){var n=this.$find('li[data-id="'+e+'"] a');if(!!t)return n.attr("data-badge",t);n.removeAttr("data-badge")},S=function(){this.options.preSelectEvent.enabled?this.sandbox.dom.on(this.$el,"click",d.bind(this),"li"):this.sandbox.dom.on(this.$el,"click",v.bind(this),"li")},x=function(){this.sandbox.on(f.call(this),function(e){var t=this.sandbox.dom.find(".is-selected",this.options.el);e.call(this.items[this.sandbox.dom.data(t,"id")])}.bind(this)),this.sandbox.on(n.call(this),this.activate.bind(this)),this.sandbox.on(r.call(this),this.deactivate.bind(this)),this.sandbox.on(i.call(this),y.bind(this)),this.sandbox.on(s.call(this),b.bind(this)),this.sandbox.on(a.call(this),v.bind(this)),this.sandbox.on(l.call(this),w.bind(this)),this.sandbox.on(c.call(this),E.bind(this))};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},t,this.options),this.active=!0,this.$marker=null,this.items=[],this.domItems={},S.call(this),x.call(this),this.options.url?this.sandbox.util.load(this.options.url).then(function(e){this.render(e,this.options.values)}.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.data?this.render(this.options.data,this.options.values):this.sandbox.logger.log("no data provided for tabs!")},createEventName:function(e){var t=this.options.instanceName?this.options.instanceName+".":"";return"husky.tabs."+t+e},setMinWidth:function(e){this.sandbox.dom.addClass(e,"is-selected"),this.sandbox.dom.css(e,{"min-width":this.sandbox.dom.outerWidth(e)+"px"}),this.sandbox.dom.removeClass(e,"is-selected")},deactivate:function(){this.active=!1,this.sandbox.dom.addClass(this.sandbox.dom.find(".tabs-container",this.$el),"deactivated")},activate:function(){this.active=!0,this.sandbox.dom.removeClass(this.sandbox.dom.find(".tabs-container",this.$el),"deactivated")},generateIds:function(e){return this.sandbox.util.foreach(e,function(e){e.id||(e.id=this.getRandId())}.bind(this)),e},getRandId:function(){return Math.floor(Math.random()*16777215e8).toString(16)},render:function(t,n){this.data=this.generateIds(t);var r=this.sandbox.dom.createElement('<div class="tabs-container"></div>'),i=this.sandbox.dom.createElement("<ul/>"),s=null,o=null;this.$marker=this.sandbox.dom.createElement('<div class="marker"></div>'),this.sandbox.dom.append(r,this.$marker),this.sandbox.dom.append(this.$el,r),this.sandbox.dom.append(r,i),this.items=[],this.domItems={};var u=0;this.sandbox.util.foreach(this.data,function(t,r){this.items[t.id]=t,o=this.sandbox.dom.createElement(['<li data-id="'+t.id+'">','    <a href="#" ',t.notificationBadge?'data-badge="'+t.notificationBadge:"",'">',this.sandbox.translate(t.name),"    </a>","</li>"].join("")),this.sandbox.dom.append(i,o),!!t.disabled&&t.disabled.toString()==="true"||!!t.displayConditions&&!e.evaluate(t.displayConditions,n)?this.sandbox.dom.hide(o):++u,this.setMinWidth(o),!!this.options.preselect&&(this.options.preselector==="url"&&!!this.options.fragment&&this.options.fragment===t.action||this.options.preselector==="position"&&(r+1).toString()===this.options.preselect.toString()||this.options.preselector==="name"&&t.name===this.options.preselect)&&(this.sandbox.dom.addClass(o,"is-selected"),s=t),this.domItems[t.id]=o}.bind(this)),!s&&this.options.forceSelect&&(s=this.options.data[0],this.sandbox.dom.addClass(this.sandbox.dom.find("li",i).eq(0),"is-selected")),m.call(this),this.sandbox.emit(p.call(this),s,u),u<2&&this.$el.hide()}}}),define("__component__$toolbar@husky",[],function(){"use strict";var e={url:null,buttons:[],instanceName:"",dropdownItemsKey:"_embedded",searchOptions:null,hasSearch:!1,groups:[{id:1,align:"left"}],skin:"default",small:!1,showTitleAsTooltip:!1,showTitle:!0,responsive:!1},t={dropdownOptions:{}},n={collapsedWidth:50,dropdownToggleWidth:5,loaderWhiteColor:"white",loaderDarkColor:"#cccccc",markedClass:"marked"},r={dropdownMenu:".toolbar-dropdown-menu"},i={skeleton:['<div class="husky-toolbar">',"</div>"].join("")},s=function(){return ut.call(this,"initialized")},o=function(){return ut.call(this,"dropdown.opened")},u=function(){return ut.call(this,"dropdown.closed")},a=function(){return ut.call(this,"button.changed")},f=function(){return ut.call(this,"item.select")},l=function(){return ut.call(this,"item.enable")},c=function(){return ut.call(this,"item.disable")},h=function(){return ut.call(this,"item.loading")},p=function(){return ut.call(this,"item.change")},d=function(){return ut.call(this,"item.reset")},v=function(){return ut.call(this,"item.hide")},m=function(){return ut.call(this,"item.show")},g=function(){return ut.call(this,"item.mark")},y=function(){return ut.call(this,"item.unmark")},b=function(){return ut.call(this,"button.set")},w=function(){return ut.call(this,"items.set")},E=function(){return ut.call(this,"collapse")},S=function(){return ut.call(this,"expand")},x=function(){this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this),"li .content"),this.sandbox.dom.on(this.$el,"click",H.bind(this),"li"),this.sandbox.dom.on(this.$el,"click",F.bind(this),"li"),this.options.responsive===!0&&$(window).on("resize.husky-toolbar-"+this.options.instanceName,k.bind(this))},T=function(){this.sandbox.on(c.call(this),function(e,t){!this.items[e]||M.call(this,!1,e,t)}.bind(this)),this.sandbox.on(l.call(this),function(e,t){!this.items[e]||M.call(this,!0,e,t)}.bind(this)),this.sandbox.on(h.call(this),function(e){!this.items[e]||P.call(this,e)}.bind(this)),this.sandbox.on(v.call(this),function(e){!this.items[e]||_.call(this,this.items[e].$el)}.bind(this)),this.sandbox.on(m.call(this),function(e){!this.items[e]||D.call(this,this.items[e].$el)}.bind(this)),this.sandbox.on(E.call(this),function(e){Y.call(this),typeof e=="function"&&e()}.bind(this)),this.sandbox.on(S.call(this),function(e){Z.call(this),typeof e=="function"&&e()}.bind(this)),this.sandbox.on(g.call(this),K.bind(this)),this.sandbox.on(y.call(this),Q.bind(this)),this.sandbox.on(p.call(this),N.bind(this)),this.sandbox.on(d.call(this),C.bind(this)),this.sandbox.on(b.call(this),function(e,t){R.call(this,this.items[e].$el,t)}.bind(this)),this.sandbox.on(w.call(this),function(e,t,n){!this.items[e]||(t.length>0?(rt.call(this,this.items[e]),this.sandbox.dom.removeAttr(this.sandbox.dom.find(".dropdown-toggle",this.items[e].$el),"style"),this.items[e].dropdownItems=t,W.call(this,this.items[e].$el,this.items[e]),!n||N.call(this,this.items[e].id,n).then(function(t){if(!this.items[e].dropdownOptions||typeof this.items[e].dropdownOptions.preSelectedCallback!="function")return;this.items[e].dropdownOptions.preSelectedCallback(t)}.bind(this))):(rt.call(this,this.items[e]),this.sandbox.dom.hide(this.sandbox.dom.find(".dropdown-toggle",this.items[e].$el))))}.bind(this))},N=function(e,t,n){if(!this.items[e])return;var r=this.items[e],i=$.Deferred();return r.initialized.then(function(){var e=B.call(this,t,r);e===!0&&(e=0),R.call(this,r.$el,r.dropdownItems[e]),this.sandbox.emit(g.call(this),r.dropdownItems[e].id),(n===!0||!!r.dropdownItems[e].callback&&typeof r.dropdownItems[e].callback=="function")&&r.dropdownItems[e].callback(),i.resolve(r.dropdownItems[e])}.bind(this)),i.promise()},C=function(e){if(!this.items[e])return;this.items[e].initialized.then(function(){q.call(this,this.items[e].$el)}.bind(this))},k=function(){this.$el.width()<this.$el[0].scrollWidth?this.collapsed?L.call(this):(this.expandedWidth=this.$find(".husky-toolbar").outerWidth(),Y.call(this),L.call(this)):this.collapsed&&this.$el.width()>=this.expandedWidth?(Z.call(this),this.expandedWidth=this.$find(".husky-toolbar").outerWidth(),L.call(this)):L.call(this)},L=function(){this.$el.width()<this.$el[0].scrollWidth?this.$el.addClass("overflown"):this.$el.removeClass("overflown")},A=function(){var e=this.$el.scrollLeft();this.$el.css({overflow:"visible"}),this.$find(".husky-toolbar").css({"margin-left":-1*e+"px"})},O=function(){this.$el.removeAttr("style"),this.$find(".husky-toolbar").removeAttr("style")},M=function(e,t,n){if(!this.items[t])return;var r=this.items[t],i=this.sandbox.dom.find('[data-id="'+t+'"]',this.$el);this.items[t].disabled=!e,r.loading&&(r.loading=!1,this.sandbox.stop(this.sandbox.dom.find(".item-loader",i)),this.sandbox.dom.remove(this.sandbox.dom.find(".item-loader",i)),this.sandbox.dom.removeClass(i,"is-loading"),this.sandbox.dom.width(i,"")),n!==!1&&(this.sandbox.dom.addClass(i,"highlight-animation"),this.sandbox.dom.on(i,"animationend webkitAnimationEnd oanimationend MSAnimationEnd",function(e){this.sandbox.dom.removeClass(e.currentTarget,"highlight-animation")}.bind(this))),e?this.sandbox.dom.removeClass(i,"disabled"):this.sandbox.dom.addClass(i,"disabled"),this.options.responsive===!0&&k.call(this)},_=function(e){var t=e.parent(".toolbar-dropdown-menu");this.sandbox.dom.addClass(e,"hidden"),t.length>0&&J.call(this,t)},D=function(e){var t=e.parent(".toolbar-dropdown-menu");this.sandbox.dom.removeClass(e,"hidden"),t.length>0&&J.call(this,t)},P=function(e){var t=this.items[e],r=this.sandbox.dom.find('[data-id="'+e+'"]',this.$el),i,s=n.loaderWhiteColor;if(t.loading)return;t.loading=!0,this.sandbox.dom.width(r,this.sandbox.dom.width(r)),this.sandbox.dom.addClass(r,"is-loading"),i=this.sandbox.dom.createElement('<span class="item-loader"></span>'),this.sandbox.dom.append(r,i),this.sandbox.dom.hasClass(r,"highlight-white")&&(s=n.loaderDarkColor),this.sandbox.start([{name:"loader@husky",options:{el:i,size:this.options.small?"14px":"20px",color:s}}]),this.options.responsive===!0&&k.call(this)},H=function(e){e.preventDefault(),e.stopPropagation();var t=this.sandbox.dom.$(e.currentTarget),n=this.sandbox.dom.data(t,"id"),i=this.items[n],s;if(!!this.sandbox.dom.find(".dropdown-toggle",t).length){if(!i||i.disabled||i.dropdownOptions.onlyOnClickOnArrow===!0&&!this.sandbox.dom.hasClass(e.target,"dropdown-toggle")||!V(t.children(".toolbar-dropdown-menu")))return!1;this.sandbox.dom.hasClass(t,"is-expanded")&&(s=!0),j.call(this),s||(this.sandbox.dom.one("body","click",j.bind(this)),this.options.responsive===!0&&A.call(this),this.sandbox.dom.addClass(t,"is-expanded"),this.sandbox.dom.show(this.sandbox.dom.find(r.dropdownMenu,t)),this.sandbox.emit(o.call(this)))}},B=function(e,t){for(var n=-1,r=t.dropdownItems.length;++n<r;)if(t.dropdownItems[n].id===e)return n;return e},j=function(){this.sandbox.dom.removeClass(this.sandbox.dom.find(".is-expanded",this.$el),"is-expanded"),this.sandbox.dom.hide(this.$find(r.dropdownMenu)),this.options.responsive===!0&&O.call(this),this.sandbox.emit(u.call(this))},F=function(e){this.sandbox.dom.stopPropagation(e),this.sandbox.dom.preventDefault(e);var t=this.items[this.sandbox.dom.data(e.currentTarget,"id")],n=this.items[t.parentId]?this.items[t.parentId].$el:null;if(t.loading||!!t.dropdownItems&&t.dropdownOptions.onlyOnClickOnArrow!==!0&&!!V($(e.currentTarget).children(".toolbar-dropdown-menu"))||this.sandbox.dom.hasClass(e.target,"dropdown-toggle"))return!1;j.call(this),!!t.parentId&&!!this.items[t.parentId].dropdownOptions&&this.items[t.parentId].dropdownOptions.markSelected===!0&&K.call(this,t.id);if(!!t.disabled)return!1;I.call(this,t,n)},I=function(e,t){var n,r=e._original||e,i=this.sandbox.dom.find(".content",this.items[e.id].$el);!i.length||this.sandbox.dom.click(this.sandbox.dom.children(i)),e.parentId&&(n=this.items[e.parentId],!n.dropdownOptions.changeButton||R.call(this,t,e),!n.dropdownOptions||typeof n.dropdownOptions.callback=="function"&&n.dropdownOptions.callback(r)),e.callback?e.callback():this.sandbox.emit(f.call(this),e)},q=function(e){var t=this.sandbox.dom.find("span",e),n=this.sandbox.dom.data(e).id,i=this.items[n];this.sandbox.dom.removeClass(t.eq(0),""),i.icon=i.defaultIcon,!i.defaultIcon||this.sandbox.dom.addClass(t.eq(0),U.call(this,i)),i.title=this.sandbox.translate(i.defaultTitle),this.sandbox.dom.html(t.eq(1),i.title),this.items[n].title=i.title,!i.dropdownItems||this.sandbox.dom.removeClass(r.dropdownMenu+" li","marked"),this.options.responsive===!0&&k.call(this),this.sandbox.emit(a.call(this))},R=function(e,t){var n=this.sandbox.dom.find("span",e),r=this.sandbox.dom.data(e).id;!t.icon||(this.sandbox.dom.removeClass(n.eq(0),""),this.sandbox.dom.addClass(n.eq(0),U.call(this,t)),this.items[r].icon=t.icon),!t.title||(t.title=this.sandbox.translate(t.title),this.sandbox.dom.html(n.eq(1),t.title),this.items[r].icon=t.title),this.options.responsive===!0&&k.call(this),this.sandbox.emit(a.call(this))},U=function(e){var t,n="",r=z.call(this,e);return e.icon&&(t=[],t.push(r),t.push("icon"),n=t.join(" ")),n},z=function(e){return"fa-"+e.icon},W=function(e,t){var n=this.sandbox.dom.createElement('<ul class="toolbar-dropdown-menu" />');!!t.dropdownOptions&&!!t.dropdownOptions.maxHeight&&n.css("maxHeight",t.dropdownOptions.maxHeight),this.sandbox.dom.append(e,n),this.sandbox.util.foreach(t.dropdownItems,function(e){if(e.divider){if(this.items[t.id].dropdownItems.length<=2)return;this.sandbox.dom.append(n,'<li class="divider"></li>');return}e.parentId=t.id,nt.call(this,e);var r=this.sandbox.dom.createElement('<li data-id="'+e.id+'"></li>');this.sandbox.dom.append(n,r);if(!e.initialize||typeof e.initialize!="function")return X.call(this,n,r,e);var i=e.initialize(e,r,this.sandbox);if(!i.then)return X.call(this,n,r,i);i.then(function(e){X.call(this,n,r,e)}.bind(this))}.bind(this)),J.call(this,n)},X=function(e,t,n){n.title=this.sandbox.translate(n.title),typeof n.link!="undefined"&&!1===n.link?(t.addClass("no-link"),t.html(n.title)):t.append('<a href="#">'+n.title+"</a>"),n.$el=t,this.items[n.id]=n,n.hidden===!0&&this.sandbox.dom.addClass(t,"hidden"),n.disabled===!0&&this.sandbox.dom.addClass(t,"disabled"),n.marked===!0&&K.call(this,n.id),!n.styleClass||t.addClass(n.styleClass)},V=function(e){return e.children("li:not(.hidden)").length},J=function(e){var t=e.siblings(".dropdown-toggle");V(e)?t.css("display",""):t.css("display","none")},K=function(e){!!this.items[e]&&!!this.items[e].parentId&&!this.items[e].disabled&&(this.sandbox.util.each(this.items,function(t,r){r.parentId===this.items[e].parentId&&this.sandbox.dom.removeClass(r.$el,n.markedClass)}.bind(this)),this.sandbox.dom.addClass(this.items[e].$el,n.markedClass))},Q=function(e){!!this.items[e]&&!!this.items[e].parentId&&this.sandbox.dom.removeClass(this.items[e].$el,n.markedClass)},G=function(e,t){var n,r,i,s,o,u,a;this.items[t].dropdownItems=[];for(u=-1,a=e.length;++u<a;)this.items[t].dropdownOptions.idAttribute?n=e[u][this.items[t].dropdownOptions.idAttribute]:!e[u].id||(n=e[u].id),this.items[t].dropdownOptions.titleAttribute?r=e[u][this.items[t].dropdownOptions.titleAttribute]:!e[u].title||(r=e[u].title),!this.items[t].dropdownOptions.languageNamespace||(r+=this.items[t].dropdownOptions.languageNamespace+r),r=this.sandbox.translate(r),!e[u].icon||(i=e[u].icon),!e[u].callback||(s=e[u].callback),e[u].divider?o=e[u].divider:o=!1,this.items[t].dropdownItems[u]={id:n,title:r,icon:i,callback:s,divider:o,_original:e[u]};this.sandbox.emit(w.call(this),t,this.items[t].dropdownItems,this.items[t].dropdownOptions.preSelected)},Y=function(){for(var e in this.items)this.items.hasOwnProperty(e)&&et.call(this,this.items[e],!0);this.collapsed=!0},Z=function(){for(var e in this.items)this.items.hasOwnProperty(e)&&et.call(this,this.items[e],!1);this.collapsed=!1},et=function(e,t){!e.parentId&&!!e.icon&&(t===!0?this.sandbox.dom.hide(this.sandbox.dom.find(".title",e.$el)):this.sandbox.dom.removeAttr(this.sandbox.dom.find(".title",e.$el),"style"))},tt=function(e){for(var t=-1,n=e.length;++t<n;)typeof e[t].position!="number"&&(e[t].position=9e3);return e=e.sort(function(e,t){return e.position-t.position}),e},nt=function(e){if(!e.id||!!this.items[e.id])do e.id=this.sandbox.util.uniqueId();while(!!this.items[e.id]);e.disabled||(e.disabled=!1)},rt=function(e){if(!!e.dropdownItems){this.sandbox.dom.remove(this.sandbox.dom.find(r.dropdownMenu,e.$el)),this.sandbox.dom.hide(this.sandbox.dom.find(".dropdown-toggle",e.$el));for(var t=-1,n=e.dropdownItems.length;++t<n;)delete this.items[e.dropdownItems[t].id];e.dropdownItems=[]}},it=function(e){var t;this.sandbox.dom.removeClass(e),this.sandbox.dom.addClass(e,"toolbar-search"),this.sandbox.dom.append(e,'<div id="'+this.options.instanceName+'-toolbar-search"/>'),t={el:"#"+this.options.instanceName+"-toolbar-search",instanceName:this.options.instanceName,appearance:"white small",slide:!0},t=this.sandbox.util.extend(!0,{},t,this.options.searchOptions),this.sandbox.start([{name:"search@husky",options:t}])},st=function(e){this.options.skin!=="default"&&this.sandbox.dom.addClass(e,this.options.skin)},ot=function(e){var t={id:"search",align:"right"};return this.options.groups.unshift(t),e.push({id:"search",hasSearch:!0,group:"search"}),e},ut=function(e){return"husky.toolbar."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.collapsed=!1,this.itemGroups={},this.items={},this.expandedWidth=0,this.options.url?this.sandbox.util.load(this.options.url).then(this.render.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.buttons?this.render(this.options.buttons):this.sandbox.logger.log("no data provided for tabs!"),x.call(this),T.call(this),this.options.responsive===!0&&k.call(this),this.sandbox.emit(s.call(this))},destroy:function(){$(window).off("resize.husky-toolbar-"+this.options.instanceName)},render:function(e){var n,r,i,s;this.options.hasSearch===!0&&(e=ot.call(this,e)),this.renderSkeleton(),e=tt.call(this,e),this.sandbox.util.foreach(e,function(e){e=this.sandbox.util.extend(!0,{},e,t),e.title=this.sandbox.translate(e.title),nt.call(this,e);var o=this.sandbox.data.deferred();e.defaultTitle=e.title,e.defaultIcon=e.icon,this.items[e.id]=e,this.items[e.id].initialized=o.promise(),n=["toolbar-item"],!e["class"]||n.push(e["class"]),e.hidden&&n.push("hidden"),e.disabled&&n.push("disabled"),!e.group||!this.itemGroups[e.group]?r=this.itemGroups[Object.keys(this.itemGroups)[0]]:r=this.itemGroups[e.group],i=this.sandbox.dom.createElement('<li class="'+n.join(" ")+'" data-id="'+e.id+'"/>');if(e.hasSearch===!0)it.call(this,i);else{!e.icon||this.sandbox.dom.append(i,'<span class="'+U.call(this,e)+'" />');if(!!e.content){var u=this.sandbox.dom.createElement('<span class="content"/>');this.sandbox.dom.append(u,e.content),this.sandbox.dom.append(i,u),this.sandbox.start(u)}s="",!!e.title&&(this.options.showTitle===!0||e.showTitle===!0)&&(s=e.title),this.sandbox.dom.append(i,'<span class="title">'+s+"</span>"),this.sandbox.dom.append(i,this.sandbox.dom.createElement('<span class="dropdown-toggle" />')),this.sandbox.dom.hide(this.sandbox.dom.find(".dropdown-toggle",i)),this.options.showTitleAsTooltip===!0&&this.sandbox.dom.attr(i,{title:s}),e.hidden===!0&&_.call(this,i),!e.dropdownOptions||!e.dropdownOptions.url?(!e.dropdownItems||(this.sandbox.dom.removeAttr(this.sandbox.dom.find(".dropdown-toggle",i),"style"),W.call(this,i,e)),o.resolve()):this.sandbox.util.load(e.dropdownOptions.url).then(function(t){var n=t[this.options.dropdownItemsKey];!e.dropdownOptions.resultKey||(n=n[e.dropdownOptions.resultKey]),!e.dropdownItems||(n=e.dropdownOptions.concatRequestedItemsFirst?e.dropdownItems.concat(n):n.concat(e.dropdownItems)),G.call(this,n,e.id),o.resolve()}.bind(this)).fail(function(e){this.sandbox.logger.log("dorpdown-items could not be loaded",e)}.bind(this))}this.sandbox.dom.append(r,i),this.items[e.id].$el=i}.bind(this))},renderSkeleton:function(){var e,t,n,r;r=this.sandbox.dom.createElement(i.skeleton),this.options.small===!0&&this.sandbox.dom.addClass(r,"small"),st.call(this,r);for(e=-1,t=this.options.groups.length;++e<t;)n=this.sandbox.dom.createElement('<ul class="group"/>'),this.options.groups[e].align?this.sandbox.dom.addClass(n,this.options.groups[e].align):this.sandbox.dom.addClass(n,"left"),this.sandbox.dom.append(r,n),this.itemGroups[this.options.groups[e].id]=n;this.sandbox.dom.append(this.$el,r),this.sandbox.dom.addClass(this.sandbox.dom.last(this.sandbox.dom.find(".group.left",this.$el)),"last"),this.options.responsive===!0&&this.$el.addClass("husky-toolbar-responsive")}}}),define("__component__$auto-complete@husky",[],function(){"use strict";var e={prefetchUrl:"",localData:[],remoteUrl:"",getParameter:"query",valueKey:"name",resultKey:"countries",value:null,instanceName:"undefined",noNewValues:!1,suggestionClass:"suggestion",suggestionIcon:"",autoCompleteIcon:"search",stickToInput:!1,hint:!1,emptyOnBlur:!1,excludes:[],selectCallback:null,fields:[],dropdownSizeClass:"",footerContent:"",limit:5},t={main:['<div class="husky-auto-complete <%= dropdownSizeClass %>">','    <div class="front">','       <a class="fa-<%= autoCompleteIcon %>"></a>',"    </div>",'    <div class="input"></div>','    <div class="back">','       <div class="loader" style="display: none;"></div>',"    </div>","</div>"].join("")},n="husky.auto-complete.",r=function(){return p.call(this,"initialized")},i=function(){return p.call(this,"prefetch-data")},s=function(){return p.call(this,"remote-data-load")},o=function(){return p.call(this,"remote-data")},u=function(){return p.call(this,"request-match")},a=function(){return p.call(this,"select")},f=function(){return p.call(this,"selection-removed")},l=function(){return p.call(this,"set-excludes")},c=function(){return p.call(this,"is-matched")},h=function(){return p.call(this,"footer.clicked")},p=function(e){return n+(this.options.instanceName?this.options.instanceName+".":"")+e};return{getValueID:function(){return this.options.value?this.options.value.id:null},getValueName:function(){return this.options.value?this.sandbox.util.escapeHtml(this.options.value[this.options.valueKey]):""},initialize:function(){this.sandbox.logger.log("initialize",this),this.sandbox.logger.log(arguments),this.options=this.sandbox.util.extend({},e,this.options),this.suggestionTpl=null,this.footerTpl=null,this.data=null,this.matched=!0,this.matches=[],this.excludes=this.parseExcludes(this.options.excludes),this.localData={},this.localData._embedded={},this.localData._embedded[this.options.resultKey]=this.options.localData,this.setTemplates(),this.render(),this.bindDomEvents(),this.setCustomEvents(),this.sandbox.emit(r.call(this),this.$valueField)},setTemplates:function(){var e="";this.options.suggestionIcon!==""&&(e='<span class="fa-'+this.options.suggestionIcon+' icon"></span>'),this.options.fields.length?this.suggestionTpl=this.sandbox.util.template('<div class="'+this.options.suggestionClass+'" data-id="<%= context[\'id \']%>">'+'   <div class="border">'+'       <div class="text">'+"           <% _.each(fields, function(field, idx) { %>"+'           <div class="suggestion-column" style="width: <%= field.width %>;"><%- context[field.id] %></div>'+"           <% }) %>"+"       </div>"+"   </div>"+"</div>"):this.suggestionTpl=this.sandbox.util.template('<div class="'+this.options.suggestionClass+'" data-id="<%= context[\'id \']%>">'+'   <div class="border">'+e+'       <div class="text"><%- context[this.options.valueKey] %></div>'+"   </div>"+"</div>"),!this.options.footerContent||(this.footerTpl=this.sandbox.util.template('<div class="auto-complete-footer">'+this.options.footerContent+"</div>"))},buildSuggestionTemplate:function(e){var t;if(this.suggestionTpl!==null)return t=this.sandbox.dom.createElement(this.suggestionTpl({context:e,fields:this.options.fields})),this.isExcluded(e)&&this.sandbox.dom.addClass(t,"disabled"),this.sandbox.dom.html(this.sandbox.dom.append(this.sandbox.dom.$("<div/>"),t))},renderMain:function(){this.sandbox.dom.html(this.$el,this.sandbox.template.parse(t.main,{autoCompleteIcon:this.options.autoCompleteIcon,dropdownSizeClass:this.options.dropdownSizeClass}))},render:function(){this.renderMain(),this.initValueField(),this.appendValueField(),this.sandbox.start([{name:"loader@husky",options:{el:this.$el.find(".loader"),color:"#ccc",size:"20px"}}]),this.bindTypeahead()},initValueField:function(){this.$valueField=this.sandbox.dom.createElement('<input id="'+this.options.instanceName+'" '+'class="husky-validate" '+'type="text" '+'autofill="false" '+'autocomplete="off"'+'data-id="'+this.getValueID()+'" '+'value="'+this.getValueName()+'"/>')},appendValueField:function(){!this.$valueField.length||this.sandbox.dom.append(this.sandbox.dom.find(".input",this.$el),this.$valueField)},bindTypeahead:function(){var e=this.options.remoteUrl.indexOf("?")===-1?"?":"&",t={name:this.options.instanceName,local:this.handleData(this.localData),limit:this.options.limit,displayKey:this.options.valueKey,templates:{suggestion:function(e){return this.matches.push(e),this.matched=!0,this.buildSuggestionTemplate(e)}.bind(this),footer:function(){return this.footerTpl?this.footerTpl():null}.bind(this)}};!this.options.prefetchUrl||(t.prefetch={url:this.options.prefetchUrl,ttl:1,filter:function(e){return this.sandbox.emit(i.call(this),this.handleData(e)),this.data}.bind(this)}),!this.options.remoteUrl||(t.remote={url:this.options.remoteUrl+e+this.options.getParameter+"=%QUERY",ajax:{beforeSend:function(){this.sandbox.emit(s.call(this)),this.showLoader()}.bind(this)},filter:function(e){return this.sandbox.emit(o.call(this),this.handleData(e)),this.hideLoader(),this.data}.bind(this)}),this.sandbox.autocomplete.init(this.$valueField,t),this.options.stickToInput===!1&&this.sandbox.dom.css(this.sandbox.dom.find(".twitter-typeahead",this.$el),"position","static"),this.options.hint===!1&&this.sandbox.dom.remove(this.sandbox.dom.find(".tt-hint",this.$el))},showLoader:function(){this.$el.find(".loader").show()},hideLoader:function(){this.$el.find(".loader").hide()},isExcluded:function(e){for(var t=-1,n=this.excludes.length;++t<n;){if(e.id!==null&&e.id===this.excludes[t].id)return!0;if(e[this.options.valueKey]!==null&&e[this.options.valueKey]===this.excludes[t][this.options.valueKey])return!0}return!1},setCustomEvents:function(){this.sandbox.on(l.call(this),function(e){this.excludes=this.parseExcludes(e)}.bind(this)),this.sandbox.on(c.call(this),function(e){this.isMatchedExactly()===!0&&this.getClosestMatch()!==null?e(!0):this.checkMatches(this.getValueFieldValue(),e,!0)}.bind(this)),this.sandbox.on("husky.auto-complete."+this.options.instanceName+".select",function(e){this.selectedElement=e}.bind(this))},parseExcludes:function(e){var t=[];return!e.length||this.sandbox.util.foreach(e,function(e){typeof e!="object"?t.push({id:null,name:e}):t.push(e)}.bind(this)),t},bindDomEvents:function(){this.sandbox.dom.on(this.$valueField,"typeahead:selected",function(e,t){this.isExcluded(t)?(this.sandbox.dom.stopPropagation(e),this.clearValueFieldValue()):(this.sandbox.emit(a.call(this),t),this.setValueFieldId(t.id),typeof this.options.selectCallback=="function"&&this.options.selectCallback.call(this,t,e))}.bind(this)),this.sandbox.dom.on(this.$valueField,"keypress",function(e){e.keyCode!==13&&(this.matched=!1,this.matches=[])}.bind(this)),this.sandbox.dom.on(this.sandbox.dom.find(".tt-dropdown-menu",this.$el),"click",function(){return!1}.bind(this),".disabled"),this.sandbox.dom.on(this.$valueField,"blur",function(){this.options.emptyOnBlur===!1?this.handleBlur():this.clearValueFieldValue()}.bind(this)),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.dom.blur(this.$valueField),this.clearValueFieldValue(),this.sandbox.emit(h.call(this))}.bind(this),".auto-complete-footer"),this.sandbox.dom.on(this.$valueField,"focusout",function(){if(this.sandbox.dom.val(this.$valueField)===""){var e=this.sandbox.dom.attr(this.$valueField,"data-id");e!=null&&e!=="null"&&(this.sandbox.dom.removeAttr(this.$valueField,"data-id"),this.sandbox.dom.data(this.$valueField,"id","null"),this.sandbox.emit(f.call(this)))}}.bind(this))},handleBlur:function(){this.selectedElement?this.selectedElement=null:this.options.noNewValues===!0?this.isMatched()===!0&&this.getClosestMatch()!==null?(this.setValueFieldValue(this.getClosestMatch().name),this.setValueFieldId(this.getClosestMatch().id)):this.getValueFieldValue()!==""&&this.checkMatches(this.getValueFieldValue(),function(e){e===!0?(this.setValueFieldValue(this.getClosestMatch().name),this.setValueFieldId(this.getClosestMatch().id)):this.clearValueFieldValue()}.bind(this),!1):this.isMatchedExactly()===!0&&this.getClosestMatch()!==null&&(this.setValueFieldValue(this.getClosestMatch().name),this.setValueFieldId(this.getClosestMatch().id))},checkMatches:function(e,t,n){var r=this.options.remoteUrl.indexOf("?")===-1?"?":"&";this.sandbox.emit(u.call(this)),this.sandbox.util.ajax({url:this.options.remoteUrl+r+this.options.getParameter+"="+e,success:function(e){this.matches=this.handleData(e),n!==!0?this.matches.length>0?t(!0):t(!1):this.isMatchedExactly()===!0?t(!0):t(!1)}.bind(this),error:function(e){this.sandbox.logger.log("Error requesting auto-complete-matches",e),t(!1)}.bind(this)})},getClosestMatch:function(){return!this.matches.length||this.getValueFieldValue()===""?null:this.matches[0]},getValueFieldValue:function(){return this.sandbox.dom.val(this.$valueField)},setValueFieldValue:function(e){this.sandbox.autocomplete.setValue(this.$valueField,e)},clearValueFieldValue:function(){this.sandbox.autocomplete.setValue(this.$valueField,"")},setValueFieldId:function(e){this.sandbox.dom.attr(this.$valueField,{"data-id":e}),this.sandbox.dom.data(this.$valueField,"id",e)},isMatched:function(){return this.matched},isMatchedExactly:function(){return this.getClosestMatch()!==null&&this.getValueFieldValue().toLowerCase()===this.getClosestMatch().name.toLowerCase()?!0:!1},handleData:function(e){return typeof e=="object"?(this.data=[],this.sandbox.util.foreach(e._embedded[this.options.resultKey],function(e){this.isExcluded(e)===!1&&this.data.push(e)}.bind(this)),this.data):!1}}}),define("__component__$auto-complete-list@husky",[],function(){"use strict";var e={instanceName:"undefined",items:[],itemsUrl:"",resultKey:"tags",suggestions:[],suggestionsHeadline:"",suggestionsUrl:"",suggestionsKey:"suggestions",label:"",inputSelector:".husky-auto-complete-container",autocomplete:!0,localData:[],prefetchUrl:"",remoteUrl:"",autocompleteOptions:{},getParameter:"query",maxListItems:0,CapitalizeFirstLetter:!1,listItemClass:"auto-complete-list-selection",suggestionDeactivatedClass:"deactivated",AjaxPush:"",AjaxPushAllItems:!1,AjaxPushParameters:null,togglerSelector:".toggler",arrowDownClass:"fa-caret-down",arrowUpClass:"fa-caret-up",slideDuration:500,elementTagDataName:"tags",autoCompleteIcon:"search",suggestionIcon:"tag",delimiters:[9,188,13],noNewTags:!1,valueKey:"name"},t={main:['<div class="auto-complete-list-container">',"    <label>","        <%= label %>",'        <div class="auto-complete-list">','           <div class="husky-auto-complete-container"></div>','           <div class="toggler"></div>',"        </div>","    </label>","</div>"].join(""),suggestion:['<div class="auto-complete-list-suggestions">',"    <h5><%= headline %></h5>","    <ul></ul>","</div>"].join("")},n="up",r="down",i="husky.auto-complete-list.",s=function(){return g.call(this,"initialized")},o=function(){return g.call(this,"set-tags")},u=function(){return g.call(this,"get-tags")},a=function(){return g.call(this,"item-request")},f=function(){return g.call(this,"sug-request")},l=function(){return g.call(this,"sug-added")},c=function(){return g.call(this,"item-deleted")},h=function(){return g.call(this,"data-loaded")},p=function(){return g.call(this,"item-added")},d=function(){return g.call(this,"items-added")},v=function(){return g.call(this,"sug-closed")},m=function(){return g.call(this,"sug-opened")},g=function(e){return i+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.sandbox.logger.log("initialize",this),this.setVars(),this.options=this.sandbox.util.extend({},e,this.options),this.renderMain(),this.initInputCont(),this.initSuggestions(),this.initItems(),this.options.autocomplete===!0?this.sandbox.on("husky.auto-complete."+this.options.instanceName+".initialized",function(){this.sandbox.emit(s.call(this))}.bind(this)):this.sandbox.emit(s.call(this))},setVars:function(){this.suggestions=[],this.$suggestions=null,this.$input=null,this.tagApi=null,this.toggler=null,this.$inputCont=null},renderMain:function(){this.sandbox.dom.html(this.$el,_.template(t.main)({label:this.options.label}))},initInputCont:function(){return this.$inputCont=this.sandbox.dom.find(this.options.inputSelector,this.$el),this.$inputCont.length?!0:(this.sandbox.logger.log("Initializing input-container failed."),!1)},startPlugins:function(){this.options.autocomplete===!0?(this.bindStartTmEvent(),this.startAutocomplete()):(this.initInput(),this.appendInput(),this.startTagmanager(),this.bindEvents())},initInput:function(){this.$input=this.sandbox.dom.createElement('<input type="text" autocomplete="off"/>')},appendInput:function(){!this.$input.length||this.sandbox.dom.append(this.$inputCont,this.$input)},startAutocomplete:function(){this.sandbox.start([{name:"auto-complete@husky",options:this.sandbox.util.extend({el:this.$inputCont,emptyOnBlur:!0,instanceName:this.options.instanceName,localData:this.options.localData,prefetchUrl:this.options.prefetchUrl,remoteUrl:this.options.remoteUrl,getParameter:this.options.getParameter,suggestionIcon:this.options.suggestionIcon,autoCompleteIcon:this.options.autoCompleteIcon,resultKey:this.options.resultKey,footerContent:this.options.footerContent,valueKey:this.options.valueKey},this.options.autocompleteOptions)}])},startTagmanager:function(){this.tagApi=this.sandbox.autocompleteList.init(this.$input,{tagClass:this.options.listItemClass,prefilled:this.options.items,tagCloseIcon:"",maxTags:this.options.maxListItems,AjaxPush:this.options.AjaxPush,AjaxPushAllTags:this.options.AjaxPushAllItems,AjaxPushParameters:this.options.AjaxPushParameters,CapitalizeFirstLetter:this.options.CapitalizeFirstLetter,delimiters:[]}),this.setElementDataTags()},bindStartTmEvent:function(){this.sandbox.once("husky.auto-complete."+this.options.instanceName+".initialized",function(e){this.$input=e,this.startTagmanager(),this.bindEvents()}.bind(this))},bindEvents:function(){this.sandbox.on(u.call(this),function(e){typeof e=="function"?e(this.getTags()):this.sandbox.logger.log("Error: Callback is not a function")}.bind(this)),this.sandbox.on(o.call(this),function(e){this.pushTags(e)}.bind(this)),this.sandbox.on(p.call(this),function(){this.setElementDataTags(),this.sandbox.emit("husky.auto-complete."+this.options.instanceName+".set-excludes",this.getTags())}.bind(this)),this.sandbox.on(c.call(this),function(){this.sandbox.emit("husky.auto-complete."+this.options.instanceName+".set-excludes",this.getTags())}.bind(this)),this.sandbox.on("husky.auto-complete."+this.options.instanceName+".select",function(e){this.pushTag(e[this.options.valueKey])}.bind(this)),this.sandbox.dom.on(this.$input,"keydown",function(e){e.keyCode===8&&this.sandbox.dom.val(this.$input).trim()===""&&(this.itemDeleteHandler(),this.setElementDataTags()),this.options.delimiters.indexOf(e.keyCode)!==-1&&this.pushTagHandler(e,this.sandbox.dom.val(this.$input).trim())}.bind(this)),this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.hasClass(e.target,"tm-tag-remove")===!0&&(this.itemDeleteHandler(),this.setElementDataTags())}.bind(this)),this.toggler!==null&&this.sandbox.dom.on(this.toggler.$el,"click",function(e){this.sandbox.dom.preventDefault(e),this.changeToggler(),this.toggleSuggestions()}.bind(this))},pushTagHandler:function(e,t){e.keyCode!==9&&this.sandbox.dom.preventDefault(e),this.options.noNewTags!==!0?this.pushTag(t):this.sandbox.emit("husky.auto-complete."+this.options.instanceName+".is-matched",function(e){e===!0&&this.pushTag(t)}.bind(this))},setElementDataTags:function(){var e=this.getTags();this.sandbox.dom.data(this.$el,this.options.elementTagDataName,e)},initItems:function(){this.options.itemsUrl!==""?this.requestItems():this.startPlugins()},requestItems:function(){this.sandbox.util.ajax({url:this.options.itemsUrl,success:function(e){this.options.items=this.options.items.concat(e._embedded[this.options.resultKey]),this.startPlugins(),h.call(this)}.bind(this),error:function(e){this.sandbox.logger.log(e)}.bind(this)}),this.sandbox.emit(a.call(this))},initSuggestions:function(){this.options.suggestionsUrl!==""?this.requestSuggestions():(this.loadSuggestions(),this.renderSuggestions(),this.initToggler())},requestSuggestions:function(){this.sandbox.util.ajax({url:this.options.suggestionsUrl,success:function(e){this.options.suggestions=this.options.suggestions.concat(e[this.options.suggestionsKey]),this.loadSuggestions(),this.renderSuggestions(),this.initToggler()}.bind(this),error:function(e){this.sandbox.logger.log(e)}.bind(this)}),this.sandbox.emit(f.call(this))},loadSuggestions:function(){if(!!this.options.suggestions.length)for(var e=-1,t=this.options.suggestions.length;++e<t;)this.suggestions[e]={name:this.options.suggestions[e],$el:this.sandbox.dom.createElement("<li/>")},this.sandbox.dom.html(this.suggestions[e].$el,this.suggestions[e][this.options.valueKey])},renderSuggestions:function(){if(!!this.options.suggestions.length){var e,n,r=-1,i=this.suggestions.length;e=this.sandbox.dom.parseHTML(_.template(t.suggestion)({headline:this.options.suggestionsHeadline})),n=this.sandbox.dom.children(e,"ul");for(;++r<i;)this.sandbox.dom.append(n,this.suggestions[r].$el),this.bindSuggestionEvents(this.suggestions[r]);this.$suggestions=e,this.sandbox.dom.append(this.$el,this.$suggestions)}},initToggler:function(){!this.options.suggestions.length||(this.toggler={$el:this.sandbox.dom.find(this.options.togglerSelector,this.$el),pos:n},this.sandbox.dom.prependClass(this.toggler.$el,this.options.arrowUpClass))},changeToggler:function(){this.toggler.pos===r?this.togglerUp():this.togglerDown()},toggleSuggestions:function(){this.toggler.pos===r?this.hideSuggestions():this.showSuggestions()},hideSuggestions:function(){this.sandbox.dom.slideUp(this.$suggestions,this.options.slideDuration),this.sandbox.emit(v.call(this))},showSuggestions:function(){this.sandbox.dom.slideDown(this.$suggestions,this.options.slideDuration),this.sandbox.emit(m.call(this))},togglerDown:function(){this.sandbox.dom.removeClass(this.toggler.$el,this.options.arrowUpClass),this.sandbox.dom.prependClass(this.toggler.$el,this.options.arrowDownClass),this.toggler.pos=r},togglerUp:function(){this.sandbox.dom.removeClass(this.toggler.$el,this.options.arrowDownClass),this.sandbox.dom.prependClass(this.toggler.$el,this.options.arrowUpClass),this.toggler.pos=n},bindSuggestionEvents:function(e){this.sandbox.dom.on(e.$el,"click",function(){this.sandbox.dom.hasClass(e,this.options.suggestionDeactivatedClass)||(this.pushTag(e[this.options.valueKey]),this.deactivateSuggestion(e),this.sandbox.emit(l.call(this),e))}.bind(this))},itemDeleteHandler:function(){this.refreshSuggestions(),this.sandbox.emit(c.call(this))},deactivateSuggestion:function(e){this.sandbox.dom.addClass(e.$el,this.options.suggestionDeactivatedClass)},activateSuggestion:function(e){this.sandbox.dom.removeClass(e.$el,this.options.suggestionDeactivatedClass)},refreshSuggestions:function(){for(var e=-1,t=this.suggestions.length;++e<t;)this.sandbox.dom.hasClass(this.suggestions[e].$el,this.options.suggestionDeactivatedClass)===!0&&this.suggestionContainedInTags(this.suggestions[e])===!1&&this.activateSuggestion(this.suggestions[e])},suggestionContainedInTags:function(e){var t=this.getTags(),n,r;for(n=-1,r=t.length;++n<r;)if(t[n]===e[this.options.valueKey])return!0;return!1},pushTag:function(e){if(this.tagApi===null)return!1;this.tagApi.tagsManager("pushTag",e),this.sandbox.emit(p.call(this),e)},pushTags:function(e){for(var t=-1,n=e.length;++t<n;)this.pushTag(e[t]);this.sandbox.emit(d.call(this))},getTags:function(){return this.tagApi!==null?this.tagApi.tagsManager("tags"):[]}}}),define("__component__$dependent-select@husky",[],function(){"use strict";var e={url:null,data:[],instanceName:"",preselect:null,defaultLabels:"Please choose",selectOptions:[],container:null,isNative:!1,deselectField:!1},t={childContainerClass:"dependent-select-container",namespace:"husky.dependent-select."},n=function(){return u.call(this,"initialized")},r=function(){return u.call(this,"item.selected")},i=function(){return u.call(this,"item.deselected")},s=function(){return u.call(this,"all.items.deselected")},o=function(){return u.call(this,"all.items.selected")},u=function(e){return t.namespace+(this.options.instanceName?this.options.instanceName+".":"")+e},a=function(e){var t,n,r;for(t=e,n=this.options.container.length;++t<n;)r=l.call(this,this.options.container[t]),this.sandbox.start([{name:"select@husky",options:{el:r,disabled:!0,singleSelect:!0,instanceName:t,data:[],isNative:this.options.isNative,deselectField:this.options.deselectField,defaultLabel:this.sandbox.dom.isArray(this.options.defaultLabels)?this.options.defaultLabels[e]:this.options.defaultLabels}}])},f=function(e,t){for(var n=-1,r=e.length;++n<r;)if(e[n].id.toString()===t.toString())return e[n];return null},l=function(e){var n=this.$find(e),r=this.sandbox.dom.find("."+t.childContainerClass,n);if(!n)throw"dependent-select: no container with id "+e+" could be found";return!r||this.sandbox.stop(r),r=this.sandbox.dom.createElement('<div class="'+t.childContainerClass+'" />'),this.sandbox.dom.append(n,r),r},c=function(){var e=this.$find(this.options.container[this.options.container.length-1]),t=this.sandbox.dom.children(e)[0],n=this.sandbox.dom.data(t,"selection");!t||typeof n=="undefined"?this.allSelected&&(this.allSelected=!1,this.sandbox.emit(s.call(this))):this.allSelected||(this.allSelected=!0,this.sandbox.emit(o.call(this)))},h=function(e,t,n,s){t=typeof t!="undefined"?t:0;if(!this.options.container||!this.options.container[t])throw"dependent-select: no container at depth "+t+" specified";var o=null,u=null,p,d=l.call(this,this.options.container[t]);o=function(n,i){if(this.options.container.length>t&&!!e[0].items){var s=f.call(this,e,n).items;h.call(this,s,t+1,null,i)}this.sandbox.emit(r.call(this),n,t),c.call(this)}.bind(this),u=function(n){this.options.container.length>t&&!!e[0].items&&n===null&&a.call(this,t),this.sandbox.emit(i.call(this),n,t),c.call(this)}.bind(this),!this.options.selectOptions[t]||(p=this.options.selectOptions[t]),p=this.sandbox.util.extend(!0,{},{el:d,singleSelect:!0,instanceName:t,data:e,selectCallback:function(e){o(e,!1)}.bind(this),preselectCallback:function(e){o(e,!0)}.bind(this),deselectCallback:u,isNative:this.options.isNative,preSelectedElements:n?[n]:[],deselectField:this.options.deselectField,defaultLabel:this.sandbox.dom.isArray(this.options.defaultLabels)?this.options.defaultLabels[t]:this.options.defaultLabels},p),s||(p.preSelectedElements=[]),this.sandbox.start([{name:"select@husky",options:p}])};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.url?this.sandbox.util.load(this.options.url).then(this.render.bind(this)).fail(function(e){this.sandbox.logger.log("data could not be loaded:",e)}.bind(this)):this.options.data?this.render(this.options.data):this.sandbox.logger.log("no data provided for dependent select!")},render:function(e){h.call(this,e,0,this.options.preselect,!0),a.call(this,this.options.preselect?this.options.preselect.length:0),this.sandbox.emit(n.call(this))}}}),define("__component__$select@husky",[],function(){"use strict";var e={addItem:"select.add-item",editEntries:"select.edit-entries"},t={data:[],valueName:"name",instanceName:"undefined",defaultLabel:"Please choose",checkedAllLabel:"All Languages",preSelectedElements:[],multipleSelect:!1,deselectField:!1,disabled:!1,selectCallback:null,preselectCallback:null,deselectCallback:null,style:"normal",skin:"",emitValues:!1,fixedLabel:!1,icon:null,noItemsCallback:null,repeatSelect:!1,editable:!1,direction:"auto",resultKey:"",showToolTip:!1,translations:e,isNative:!1,defaultValue:null,dropdownPadding:0},n={selectClass:"husky-select",labelClass:"husky-select-label",listClass:"husky-select-list",dropdownContainerClass:"husky-select-dropdown-container",deselectFieldKey:"deselectindex",deselectFieldDefaultValue:"",disabledClass:"disabled",dropdownTopClass:"top",templateRemoveSelector:".remove-row",templateAddSelector:"#addRow",editableFieldKey:"editableindex",typeRowSelector:".type-row",contentInnerSelector:".content-inner",toggleClass:".toggle-icon",formElementSelector:".form-element",selectContainerSelector:".husky-select-container"},r={row:function(){return['<div class="grid-row type-row" data-id="">','   <div class="grid-col-10 pull-left"><input class="form-element" type="text" value=""/></div>','   <div class="grid-col-2 pull-right"><div class="remove-row btn gray-dark fit only-icon pull-right"><div class="fa-minus-circle"></div></div></div>',"</div>"].join("")},addOverlayRow:function(e,t){return['<div class="grid-row type-row" data-id="',t.id,'">','    <div class="grid-col-10 pull-left"><input class="form-element" type="text" value="',t[e],'"/></div>','    <div class="grid-col-2 pull-right"><div class="remove-row btn gray-dark fit only-icon pull-right"><div class="fa-minus-circle"></div></div></div>',"</div>"].join("")},addOverlaySkeleton:function(){return['<div class="content-inner">',"   <% _.each(data, function(item) { %>","        <%= rowTemplate(valueName, item) %>","   <% }); %>","</div>",'<div class="grid-row">','   <div id="addRow" class="addButton">',"   <span>",this.sandbox.translate(t.translations.addItem),"</span>","   </div>","</div>"].join("")}},i=function(){return b.call(this,"initialize")},s=function(){return b.call(this,"deselected.item")},o=function(){return b.call(this,"selected.item")},u=function(){return b.call(this,"preselected.item")},a=function(){return b.call(this,"enable")},f=function(){return b.call(this,"disable")},l=function(){return b.call(this,"toggle")},c=function(){return b.call(this,"show")},h=function(){return b.call(this,"hide")},p=function(){return b.call(this,"get-checked")},d=function(){return b.call(this,"update")},v=function(){return"data-changed"},m=function(){return b.call(this,"save")},g=function(){return b.call(this,"delete")},y=function(){return b.call(this,"revert")},b=function(e){return"husky.select."+this.options.instanceName+"."+e},w=function(){this.sandbox.dom.show(S.call(this))},E=function(){this.sandbox.dom.hide(S.call(this))},S=function(){return this.$find(n.toggleClass)},x=function(e){var t=["small","big","action"];if(!!this.options.style){var n=this.options.style.split(" ");this.sandbox.util.foreach(n,function(n){t.indexOf(n)>-1&&this.sandbox.dom.addClass(e,n)}.bind(this))}};return{initialize:function(){var e;this.sandbox.logger.log("initialize",this),this.options=this.sandbox.util.extend(!0,{},t,this.options),!!this.options.deselectField&&this.options.deselectField.toString()==="true"&&(this.options.deselectField=n.deselectFieldDefaultValue),this.selection=[],this.selectedElements=[],this.selectedElementsValues=[],this.dropdownVisible=!1,this.mergedData=null;if(!this.options.preSelectedElements||this.options.preSelectedElements.length===0)e=this.sandbox.dom.data(this.$el,"selection"),typeof e=="string"?this.options.preSelectedElements=e.split(","):Array.isArray(e)?this.options.preSelectedElements=e.map(String):typeof e=="number"?this.options.preSelectedElements.push(e.toString()):!this.options.defaultValue||(this.options.preSelectedElements=this.options.defaultValue);this.options.url?this.loadEntries(this.options.url):this.options.data?(this.mergedData=this.options.data.slice(0),this.render(),this.sandbox.emit(i.call(this))):this.sandbox.logger.warn("Neither data nor url defined!")},loadEntries:function(e){this.sandbox.util.load(e).then(function(e){this.options.resultKey?this.options.data=e._embedded[this.options.resultKey]:this.options.data=e._embedded,this.mergedData=this.options.data.slice(0),this.render(),this.sandbox.emit(i.call(this))}.bind(this)).fail(function(e,t,n){this.sandbox.logger.warn(e,t,n)}.bind(this))},render:function(){this.options.preSelectedElements=_.filter(this.options.preSelectedElements,function(e){return _.contains(this.options.data,e)||_.filter(this.options.data,function(t){return t.id==e}.bind(this)).length>0}.bind(this)),this.sandbox.dom.addClass(this.$el,n.selectClass);var e=this.sandbox.dom.$(this.options.el),t=this.sandbox.dom.createElement(this.sandbox.util.template(this.template.basicStructure.call(this,this.options.defaultLabel,this.options.icon),{isNative:this.options.isNative}));this.sandbox.dom.append(e,t),x.call(this,t),this.sandbox.dom.addClass(t,this.options.skin),this.$list=this.$find("."+n.listClass),this.$dropdownContainer=this.$find("."+n.dropdownContainerClass),this.$label=this.$find("."+n.labelClass),this.prepareData(),this.bindDOMEvents(),this.bindCustomEvents(),this.options.disabled===!0&&this.disable(),this.addEditEntry()},enable:function(){this.sandbox.dom.removeClass(this.sandbox.dom.children(this.$el,".husky-select-container"),n.disabledClass),this.bindDOMEvents()},disable:function(){this.sandbox.dom.addClass(this.sandbox.dom.children(this.$el,".husky-select-container"),n.disabledClass),this.hideDropDown(),this.sandbox.dom.off(this.$el)},addEditEntry:function(){this.options.editable===!0&&(this.addDivider(),this.addDropdownElement(n.editableFieldKey,this.sandbox.translate(e.editEntries),!1,null,null,!1))},prepareData:function(){this.options.data.length>0?(this.options.preSelectedElements.length>0&&this.options.preSelectedElements.map(function(e,t,n){if(!!n[t]||n[t]===0)n[t]=e.toString()}),this.generateDropDown(this.options.data)):this.sandbox.logger.log("error: data not set")},addDropdownElement:function(e,t,n,r,i,s){s=s!==!1;var o,u=this.options.isNative?this.template.optionElement:this.template.menuElement,a=e!==null&&typeof e!="undefined"?e.toString():this.sandbox.util.uniqueId();this.options.preSelectedElements.indexOf(a)>=0||this.options.preSelectedElements.indexOf(t)>=0?(this.setToolTip(t),o=this.sandbox.dom.createElement(this.sandbox.util.template(u.call(this,a,t,"checked",i,!0),{checked:!0})),this.selectedElements.push(a),this.selectedElementsValues.push(t),this.options.emitValues===!0?this.triggerPreSelect(t):this.triggerPreSelect(a)):o=this.sandbox.dom.createElement(this.sandbox.util.template(u.call(this,a,t,"",i,s),{checked:!1})),typeof r=="function"&&this.sandbox.dom.data(o,"selectCallback",r),!!n&&n===!0&&(this.sandbox.dom.addClass(o,"disabled"),this.options.isNative&&this.sandbox.dom.attr(o,"disabled","disabled")),this.sandbox.dom.append(this.$list,o)},addDivider:function(){var e=this.sandbox.dom.$('<hr class="divider"/>');this.sandbox.dom.append(this.$list,e)},generateDropDown:function(e){typeof this.options.deselectField=="string"&&this.options.deselectField!=="false"&&this.addDropdownElement(n.deselectFieldKey,this.sandbox.translate(this.options.deselectField)),e.length>0&&(typeof e[0]=="string"?this.sandbox.util.each(e,function(e,t){this.addDropdownElement(e,this.sandbox.translate(t))}.bind(this)):typeof e[0]=="object"&&this.sandbox.util.each(e,function(e,t){t.divider===!0?this.addDivider():this.addDropdownElement(t.id,this.sandbox.translate(t[this.options.valueName]),!!t.disabled,t.callback,this.sandbox.translate(t.updateLabel))}.bind(this)),this.changeLabel(),this.updateSelectionAttribute())},bindDOMEvents:function(){this.sandbox.dom.on(this.$el,"click",this.labelClickHandler.bind(this),".dropdown-label"),this.sandbox.dom.on(this.$el,"click",function(e){return this.sandbox.dom.stopPropagation(e),this.sandbox.dom.hasClass(e.currentTarget,"disabled")===!1?(this.clickItem(e),!0):(this.sandbox.dom.preventDefault(e),!1)}.bind(this),".husky-select-dropdown-container li"),this.sandbox.dom.on(this.$el,v.call(this),this.dataChanged.bind(this)),this.options.isNative&&this.sandbox.dom.on(this.$list,"change",this.onSelectChange.bind(this))},bindCustomEvents:function(){this.sandbox.on(l.call(this),this.toggleDropDown.bind(this)),this.sandbox.on(c.call(this),this.showDropDown.bind(this)),this.sandbox.on(h.call(this),this.hideDropDown.bind(this)),this.sandbox.on(f.call(this),this.disable.bind(this)),this.sandbox.on(a.call(this),this.enable.bind(this)),this.sandbox.on(p.call(this),this.getChecked.bind(this)),this.sandbox.on(d.call(this),this.updateDropdown.bind(this)),this.sandbox.on(y.call(this),this.revert.bind(this))},onSelectChange:function(e){var t=this.sandbox.dom.val(e.currentTarget),r=this.sandbox.dom.find('option[value="'+t+'"]',this.$list),i=this.sandbox.dom.data(r,"selectCallback"),s=this.sandbox.dom.text(r);this.selectedElements=[t],this.selectedElementsValues=[s],t===n.deselectFieldKey&&(this.selectedElements=[],this.selectedElementsValues=[]),this.updateSelectionAttribute(),this.changeLabel(),this.selectedElements.length?this.triggerSelect(t,s):this.triggerDeselect(t)},dataChanged:function(){var e=this.sandbox.dom.data(this.$el,"selection"),t=this.sandbox.dom.data(this.$el,"selectionValues"),n,r;this.selectedElements=[],this.selectedElementsValues=[],typeof e=="string"?this.selectedElements=e.split(","):Array.isArray(e)?this.selectedElements=e.map(String):typeof e=="number"&&this.selectedElements.push(e.toString()),typeof t=="string"?this.selectedElementsValues=t.split(","):!Array.isArray(t)||(this.selectedElementsValues=t),this.sandbox.util.foreach(this.sandbox.dom.children(this.$list),function(e){n=this.sandbox.dom.data(e,"id")||"",r=this.sandbox.dom.find("input[type=checkbox]",e),this.selectedElements.indexOf(n)>-1?(this.sandbox.dom.addClass(r,"is-selected"),this.sandbox.dom.prop(r,"checked",!0)):(this.sandbox.dom.removeClass(r,"is-selected"),this.sandbox.dom.prop(r,"checked",!1))}.bind(this)),this.changeLabel(),this.updateSelectionAttribute()},revert:function(){this.updateDropdown(this.mergedData,this.selectedElements,!1)},updateDropdown:function(e,t,n){n?(e=this.mergeDomAndRequestData(e,this.parseDataFromDom(this.domData,!0)),this.mergedData=e.slice(0)):(this.selectedElements=[],this.selectedElementsValues=[],this.updateSelectionAttribute(),this.dataChanged()),t!==null&&(this.options.preSelectedElements=t.map(String)),this.selectedElements=[],this.selectedElementsValues=[],this.sandbox.dom.empty(this.$list),this.options.data=e,!!e&&e.length>0?(w.call(this),this.generateDropDown(e)):(E.call(this),this.sandbox.logger.warn("error invalid data for update!")),this.addEditEntry()},updateSelectionAttribute:function(){this.sandbox.dom.data(this.$el,"selection",this.selectedElements),this.sandbox.dom.data(this.$el,"selectionValues",this.selectedElementsValues)},uncheckAll:function(e){var t=this.sandbox.dom.children(this.$list),n=-1,r=t.length,i,o,u;for(;++n<r;)i=this.sandbox.dom.data(t[n],"id"),i===undefined&&(i=""),u=this.sandbox.dom.find("input[type=checkbox]",t[n])[0],o=this.selectedElements.indexOf(i.toString()),o>=0&&e!==i&&(this.sandbox.dom.removeClass(u,"is-selected"),this.sandbox.dom.prop(u,"checked",!1),this.selectedElements.splice(o,1),this.selectedElementsValues.splice(o,1),this.sandbox.emit(s.call(this),i))},openEditDialog:function(){this.elementsToRemove=[],this.$elementsToRemove=[];var e=this.sandbox.dom.createElement("<div/>"),t=this.renderOverlayContent();this.sandbox.dom.append("body",e),this.bindOverlayContentEvents(t),this.sandbox.start([{name:"overlay@husky",options:{el:e,openOnStart:!0,removeOnClose:!0,instanceName:"husky-select",title:this.sandbox.translate("public.edit-entries"),cancelCallback:function(){this.onCloseWithCancel()}.bind(this),okCallback:function(e){this.onCloseWithOk(e)}.bind(this),data:t}}])},onCloseWithOk:function(e){this.domData=e,this.removeDeletedItems(),!e||this.saveNewEditedItemsAndClose(e,"PATCH")},saveNewEditedItemsAndClose:function(e){var t=this.parseDataFromDom(e),n,r=this.getChangedData(t);r.length>0&&(n=this.mergeDomAndRequestData(r,this.parseDataFromDom(e,!0)),this.options.data=n.slice(0),this.updateDropdown(n,this.selectedElements),this.sandbox.emit(m.call(this),r))},mergeDomAndRequestData:function(e,t){return this.sandbox.util.foreach(t,function(t){this.sandbox.util.foreach(e,function(e){t.id===e.id&&t.id!==""?t[this.options.valueName]=e[this.options.valueName]:t[this.options.valueName]===e[this.options.valueName]&&(t.id=e.id)}.bind(this))}.bind(this)),t},bindOverlayContentEvents:function(e){this.sandbox.dom.on(e,"click",this.markElementForRemoval.bind(this),n.templateRemoveSelector),this.sandbox.dom.on(e,"click",this.addElement.bind(this),n.templateAddSelector)},updateRemoveList:function(e,t){this.elementsToRemove.indexOf(e)===-1?(e!==null&&this.elementsToRemove.push(e),this.$elementsToRemove.push(t)):(e!==null&&this.elementsToRemove.splice(this.elementsToRemove.indexOf(e),1),this.$elementsToRemove.splice(this.elementsToRemove.indexOf(t),1))},deleteItem:function(e){var t=this.options.data.slice(0);this.sandbox.util.each(t,function(t,n){if(e===n.id){var r=this.options.data.indexOf(n);this.options.data.splice(r,1)}}.bind(this)),this.updateDropdown(this.options.data,this.selectedElements)},removeDeletedItems:function(){!!this.$elementsToRemove&&this.$elementsToRemove.length>0&&this.sandbox.util.each(this.$elementsToRemove,function(e,t){this.sandbox.dom.remove(t)}.bind(this)),!!this.elementsToRemove&&this.elementsToRemove.length>0&&(this.sandbox.util.each(this.elementsToRemove,function(e,t){this.deleteItem(t)}.bind(this)),this.sandbox.emit(g.call(this),this.elementsToRemove),this.elementsToRemove=[],this.$elementsToRemove=[])},parseDataFromDom:function(e,t){var r=this.sandbox.dom.find(n.typeRowSelector,e),i=[],s,o,u,a;return this.sandbox.dom.each(r,function(e,n){u=this.sandbox.dom.hasClass(n,"faded"),t?u||(s=this.sandbox.dom.data(n,"id"),o=this.sandbox.dom.val(this.sandbox.dom.find("input",n)),o!==""&&(a={id:s},a[this.options.valueName]=o,i.push(a))):(s=this.sandbox.dom.data(n,"id"),o=this.sandbox.dom.val(this.sandbox.dom.find("input",n)),o!==""&&(a={id:s},a[this.options.valueName]=o,i.push(a)))}.bind(this)),i},getChangedData:function(e){var t=[];return this.sandbox.util.each(e,function(e,n){n.id===""?t.push(n):this.sandbox.util.each(this.options.data,function(e,r){n.id===r.id&&n[this.options.valueName]!==r[this.options.valueName]&&n[this.options.valueName]!==""&&t.push(n)}.bind(this))}.bind(this)),t},setToolTip:function(e){if(this.options.showToolTip===!0&&this.options.multipleSelect===!1){var t=this.$find(n.selectContainerSelector);this.sandbox.dom.attr(t,"title",e)}},onCloseWithCancel:function(){this.elementsToRemove=[],this.$elementsToRemove=[]},renderOverlayContent:function(){return this.sandbox.dom.createElement(this.sandbox.util.template(r.addOverlaySkeleton.call(this),{data:this.options.data,rowTemplate:r.addOverlayRow,valueName:this.options.valueName}))},addElement:function(){var e=this.sandbox.dom.createElement(r.addOverlayRow.call(this,this.options.valueName,{}));this.sandbox.dom.append(this.sandbox.dom.find(n.contentInnerSelector),e),this.sandbox.dom.focus(this.sandbox.dom.find(n.formElementSelector,e))},markElementForRemoval:function(e){var t=this.sandbox.dom.parent(this.sandbox.dom.parent(e.currentTarget)),n=this.sandbox.dom.data(t,"id");n!==null&&this.updateRemoveList(n,t),this.toggleStateOfRow(t)},toggleStateOfRow:function(e){this.sandbox.dom.toggleClass(e,"faded")},clickItem:function(e){var t,r,i,s,o,u;t=this.sandbox.dom.data(e.currentTarget,"id").toString(),o=this.sandbox.dom.data(e.currentTarget,"selectCallback"),s=this.selectedElements.indexOf(t),u=this.sandbox.dom.attr(e.currentTarget,"data-update-label");if(t===n.editableFieldKey){this.hideDropDown(),this.openEditDialog();return}if(u!=="false"&&this.options.multipleSelect===!1)if(t===n.deselectFieldKey)s=0,this.uncheckAll(t);else if(s===-1)this.uncheckAll(t);else if(this.options.repeatSelect!==!0){this.hideDropDown();return}r=this.sandbox.dom.text(this.sandbox.dom.find(".item-value",e.currentTarget)),i=this.sandbox.dom.find("input[type=checkbox]",e.currentTarget)[0],!!u&&u!=="false"&&(s>=0?(this.sandbox.dom.removeClass(i,"is-selected"),this.sandbox.dom.prop(i,"checked",!1),this.selectedElements.splice(s,1),this.selectedElementsValues.splice(s,1)):(this.sandbox.dom.addClass(i,"is-selected"),this.sandbox.dom.prop(i,"checked",!0),this.selectedElements.push(t.toString()),this.selectedElementsValues.push(r)),this.updateSelectionAttribute(),this.changeLabel()),this.options.multipleSelect===!1&&this.hideDropDown(),this.options.emitValues===!0&&(t=r),typeof o=="function"&&o(),s>=0?this.triggerDeselect(t):this.triggerSelect(t,r),this.sandbox.dom.trigger(this.$el,"change")},triggerSelect:function(e,t){this.setToolTip(t),this.options.selectCallback?this.options.selectCallback.call(this,e,t):this.sandbox.emit(o.call(this),e,t)},triggerPreSelect:function(e){this.options.preselectCallback?this.options.preselectCallback.call(this,e):this.options.selectCallback?this.options.selectCallback.call(this,e):this.sandbox.emit(u.call(this),e)},triggerDeselect:function(e){this.options.deselectCallback?this.options.deselectCallback.call(this,e!==n.deselectFieldKey?e:null):this.sandbox.emit(s.call(this),e)},changeLabel:function(){if(this.options.fixedLabel!==!0)if(this.selectedElements.length===this.options.data.length&&this.options.multipleSelect===!0)this.sandbox.dom.text(this.$label,this.options.checkedAllLabel);else if(this.selectedElements.length===0)this.sandbox.dom.text(this.$label,this.options.defaultLabel);else{var e="";this.sandbox.util.each(this.selectedElementsValues,function(t,n){e+=" "+n+","}),this.sandbox.dom.text(this.$label,e.substring(1,e.length-1))}},labelClickHandler:function(){this.sandbox.dom.is(this.$find("."+n.listClass),":empty")?typeof this.options.noItemsCallback=="function"&&this.options.noItemsCallback():this.toggleDropDown()},toggleDropDown:function(){this.sandbox.logger.log("toggle dropdown "+this.options.instanceName),this.dropdownVisible===!0?this.hideDropDown():this.showDropDown()},showDropDown:function(){if(this.options.isNative)return;this.sandbox.dom.removeClass(this.$dropdownContainer,"hidden"),this.sandbox.dom.on(this.sandbox.dom.window,"click.dropdown."+this.options.instanceName,this.hideDropDown.bind(this)),this.dropdownVisible=!0,this.sandbox.dom.removeClass(this.$dropdownContainer,n.dropdownTopClass);var e=this.sandbox.dom.height(this.$dropdownContainer),t=this.sandbox.dom.offset(this.$dropdownContainer).top,r=this.sandbox.dom.height(this.sandbox.dom.window),i=this.sandbox.dom.scrollTop(this.sandbox.dom.window),s=r-t;this.options.direction==="top"?this.sandbox.dom.addClass(this.$dropdownContainer,n.dropdownTopClass):this.options.direction!=="bottom"&&e+t>r+i&&r/2<t-i&&(this.sandbox.dom.addClass(this.$dropdownContainer,n.dropdownTopClass),s=e+this.$dropdownContainer.offset().top),this.$dropdownContainer.css({maxHeight:s-this.options.dropdownPadding+"px"})},hideDropDown:function(e){if(!!e){if(!!this.sandbox.dom.find(e.target,this.$el).length)return!1;this.sandbox.dom.off(this.sandbox.dom.window,"click.dropdown."+this.options.instanceName)}return this.sandbox.dom.addClass(this.$dropdownContainer,"hidden"),this.dropdownVisible=!1,!0},getChecked:function(e){if(typeof e!="function")throw"error: callback is not a function";e(this.selectedElements)},template:{basicStructure:function(e,t){var r="",i="display:none";!t||(r='<span class="fa-'+t+' icon"></span>'),e&&(e=this.sandbox.util.escapeHtml(e));if(!!this.options.data&&!!this.options.data.length||this.options.editable)i="";return['<div class="husky-select-container">','   <div class="dropdown-label pointer">',"       <% if (isNative) { %>",'           <select class="'+n.listClass+'">',this.options.preSelectedElements.length===0?'           <option selected="true" disabled="true">'+e+"</option>":"","           </select>","       <% } %>",'       <div class="checkbox">',r,'           <span class="'+n.labelClass+'">',e,"</span>","       </div>",'       <span class="fa-caret-down toggle-icon" style="'+i+'"></span>',"   </div>","   <% if (!isNative) { %>",'   <div class="grid-row dropdown-list dropdown-shadow hidden '+n.dropdownContainerClass+'">','       <ul class="'+n.listClass+'"></ul>',"   </div>","   <% } %>","</div>"].join("")},menuElement:function(e,t,n,r,i){var s="",o="true";if(this.options.multipleSelect===!1||!i)s=" hidden";return r!==undefined&&r===!1&&(o="false"),['<li data-id="',e,'" data-update-label="',o,'">',"    <div>",'        <div class="check'+s+'">','           <div class="custom-checkbox no-spacing">','               <input type="checkbox" class="form-element"',n,"/>",'               <span class="icon"></span>',"           </div>","        </div>",'        <div class="item-value">',this.sandbox.util.escapeHtml(t),"</div>","    </div>","</li>"].join("")},optionElement:function(e,t,n,r,i){return['<option <% if (checked) { print("selected "); } %>value="'+e+'">',this.sandbox.util.escapeHtml(t),"</option>"].join("")}}}}),define("__component__$password-fields@husky",[],function(){"use strict";var e={instanceName:"undefined",validation:!1,labels:{inputPassword1:"Password",inputPassword2:"Repeat Password",generateLabel:"Generate password"},values:{inputPassword1:"",inputPassword2:""}};return{initialize:function(){this.sandbox.logger.log("initialize"),this.sandbox.logger.log(arguments),this.options=this.sandbox.util.extend({},e,this.options),this.options.ids={inputPassword1:"husky-password-fields-"+this.options.instanceName+"-password1",inputPassword2:"husky-password-fields-"+this.options.instanceName+"-password2",generateLabel:"husky-password-fields-"+this.options.instanceName+"-generate"},this.render()},render:function(){this.$originalElement=this.sandbox.dom.$(this.options.el),this.$element=this.sandbox.dom.$(this.template()),this.$originalElement.append(this.$element),!this.options.validation||(this.sandbox.form.addField(this.options.validation,this.$el.find("#"+this.options.ids.inputPassword1)),this.sandbox.form.addField(this.options.validation,this.$el.find("#"+this.options.ids.inputPassword2))),this.bindDomEvents(),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("husky.password.fields."+this.options.instanceName+".get.passwords",function(e){if(typeof e=="function"){var t=this.sandbox.dom.val("#"+this.options.ids.inputPassword1),n=this.sandbox.dom.val("#"+this.options.ids.inputPassword2);e(t,n)}}.bind(this))},bindDomEvents:function(){this.$element.on("click","#"+this.options.ids.generateLabel,function(){this.generatePasswords(),this.sandbox.emit("husky.passwords.fields."+this.options.instanceName+".generated.passwords")}.bind(this))},generatePasswords:function(){var e="test";this.sandbox.dom.val("#"+this.options.ids.inputPassword1,e),this.sandbox.dom.val("#"+this.options.ids.inputPassword2,e)},template:function(){return['<div class="husky-password-fields grid">','    <div class="grid-row">','        <div class="grid-col-6 form-group">','                <label for="',this.options.ids.inputPassword1,'">',this.options.labels.inputPassword1,"</label>",'                <div class="align-right hidden" id="',this.options.ids.generateLabel,'">','                    <span class="fa-key m-right-10"></span><span class="pointer">',this.options.labels.generateLabel,"</span>","                </div>",'                <input class="form-element" value="',this.options.values.inputPassword1,'" type="text" id="',this.options.ids.inputPassword1,'"',this.options.validation?'data-validation-equal="'+this.options.instanceName+'"':"","/>","        </div>",'        <div class="grid-col-6 form-group">','                <label for="',this.options.ids.inputPassword2,'">',this.options.labels.inputPassword2,"</label>",'                <input class="form-element" value="',this.options.values.inputPassword2,'" type="text" id="',this.options.ids.inputPassword2,'"',this.options.validation?'data-validation-equal="'+this.options.instanceName+'"':"","/>","        </div>","    </div>","</div>"].join("")}}}),define("__component__$column-navigation@husky",[],function(){"use strict";var e={url:null,fallbackUrl:null,prefilledData:null,selected:null,data:null,instanceName:"",hasSubName:"hasSub",actionIcon:"fa-pencil",unmarkIcon:"fa-minus-circle",actionButtonOnGhostText:"create",showActionButtonOnGhost:!1,addButton:!0,idName:"id",pathName:"path",linkedName:"linked",publishedStateName:"publishedState",publishedName:"published",titleName:"title",typeName:"type",noPageDescription:"public.no-pages",skin:"",resultKey:"nodes",responsive:!0,showOptions:!0,showStatus:!0,actionOnGhost:!1,premarkedIds:[],disableIds:[],disabledChildren:!1,markable:!1,singleMarkable:!1,orderable:!0,showActionIcon:!0,isBrokenCallback:function(e){return!1},orderConfirmTitle:"column-navigation.order-title",orderConfirmMessage:"column-navigation.order-message",tooltipTranslations:{ghost:"column-navigation.ghost",shadow:"column-navigation.shadow",unpublished:"public.unpublished",publishedWithDraft:"public.published-with-draft",internalLink:"public.internal-link",externalLink:"public.external-link"},actionCallback:null},t={responsiveHeightRation:.7,columnWidth:250,minVisibleRatio:.5,markedClass:"marked",displayedcolumns:2,wrapperClass:"column-navigation-wrapper",disabledClass:"disabled",columnClass:"column",optionsClass:"options",componentClass:"husky-column-navigation",nodeLoaderClass:"husky-column-navigation-loader",bigLoaderClass:"column-navigation-loader",columnItemClass:"column-item",iconsLeftClass:"icons-left",iconsRightClass:"icons-right",itemTextClass:"item-text",orderInputClass:"orderer",orderErrorClass:"husky-validate-error",highlightClass:"highlight-animation",orderModeClass:"order-mode"},n={wrapper:['<div class="',t.wrapperClass,'"></div>'].join(""),container:['<div class="column-navigation"></div>'].join(""),column:['<div data-column="<%= columnNumber %>" class="',t.columnClass,'" id="<%= id %>">',"    <ul></ul>","</div>"].join(""),noPage:['<div class="no-page">','    <span class="fa-coffee icon"></span>','    <div class="text"><%= description %></div>',"</div>"].join(""),optionsContainer:['<div class="',t.optionsClass,' grid-row"></div>'].join(""),optionsAdd:['<div class="align-center add pointer">','    <span class="fa-plus-circle"></span>',"</div>"].join(""),optionsSettings:['<div class="align-center settings pointer drop-down-trigger">','    <span class="fa-gear inline-block"></span><span class="dropdown-toggle inline-block"></span>',"</div>"].join(""),optionsOk:['<div class="align-center ok pointer">','    <span class="fa-check"></span>',"</div>"].join(""),item:['<li data-id="<%= id %>" class="'+t.columnItemClass+'">','    <span class="'+t.iconsLeftClass+'"></span>','    <span title="<%= title %>" class="'+t.itemTextClass+'"><%= title %></span>','    <span class="'+t.iconsRightClass+'"></span>',"</li>"].join(""),orderInput:['<span class="'+t.orderInputClass+'">','    <input type="text" class="form-element husky-validate" value="<%= value %>" />',"</span>"].join("")},r="husky.column-navigation.",i=function(){return T.call(this,"initialized")},s=function(){return T.call(this,"loaded")},o=function(){return T.call(this,"selected")},u=function(){return T.call(this,"settings")},a=function(){return T.call(this,"add")},f=function(){return T.call(this,"action")},l=function(){return T.call(this,"ordered")},c=function(){return T.call(this,"order")},h=function(){return T.call(this,"order-start")},p=function(){return T.call(this,"order-end")},d=function(){return T.call(this,"unmark")},v=function(){return T.call(this,"get-marked")},m=function(){return T.call(this,"highlight")},g=function(){return T.call(this,"get-breadcrumb")},y=function(){return T.call(this,"resize")},b=function(){return T.call(this,"set-options")},w=function(e){if(e<=0)return this.columns[e];var t={numberItems:0,hasSelected:!1,selectedItem:null,parent:null,children:[]};return!this.columns[e]||(t.numberItems=Object.keys(this.columns[e]).length,t.hasSelected=!!this.selected[e],t.children=this.columns[e],!this.selected[e]||(t.selectedItem=this.selected[e])),e>0&&(t.parent=w.call(this,e-1)),t},E=function(t){this.options.markable&&this.options.actionIcon===e.actionIcon&&(this.options.singleMarkable?this.options.actionIcon="fa-check":this.options.actionIcon="fa-plus-circle");var n=this.options.actionIcon;return typeof this.options.actionIcon=="function"&&(n=this.options.actionIcon(t)),n},S=function(){return typeof this.options.addButton=="function"?this.options.addButton(w.call(this,this.lastHoveredColumn)):this.options.addButton},x=function(){var e=this.$find("."+t.optionsClass+" > :visible"),n=100/e.length;e.each(function(e,t){$(t).width(n+"%")}),this.$find("."+t.optionsClass+" > :visible").removeClass("first"),this.$find("."+t.optionsClass+" > :visible").removeClass("last"),this.$find("."+t.optionsClass+" > :visible:first").addClass("first"),this.$find("."+t.optionsClass+" > :visible:last").addClass("last")},T=function(e){return r+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.setProperties(),this.render(),this.startBigLoader(),this.initData(),this.bindDOMEvents(),this.bindCustomEvents(),this.sandbox.emit(i.call(this))},initData:function(){this.options.prefilledData?this.handleResponse(this.options.prefilledData,0):this.load(this.options.url,0,function(){!this.options.fallbackUrl||(this.initiallySelected=null,this.load(this.options.fallbackUrl,0))}.bind(this))},setProperties:function(){this.initiallySelected=this.options.selected,this.$selectedElement=null,this.filledColumns=0,this.columnLoadStarted=!1,this.isOrdering=!1,this.inOrderMode=!1,this.optionsLocked=!1,this.dom={$wrapper:null,$container:null,$add:null,$settings:null,$bigLoader:null,$loader:null,$ok:null,$lastClicked:null},this.columns=[],this.selected=[],this.marked={},this.options.premarkedIds&&this.options.premarkedIds.forEach(function(e){this.marked[e]={}}.bind(this))},render:function(){this.renderWrapper(),!this.options.showOptions||this.renderOptions(),!this.options.data||this.initSettingsDropdown(),this.options.responsive===!0&&this.setContainerHeight()},getColumnForItem:function(e){for(var t=-1,n=this.columns.length;++t<n;)if(!!this.columns[t]&&!!this.columns[t][e])return t;return-1},renderOptions:function(){this.$optionsContainer=this.sandbox.dom.createElement(n.optionsContainer),this.dom.$add=this.sandbox.dom.createElement(n.optionsAdd),this.dom.$settings=this.sandbox.dom.createElement(n.optionsSettings),this.dom.$ok=this.sandbox.dom.createElement(n.optionsOk),this.sandbox.dom.hide(this.dom.$ok),this.sandbox.dom.append(this.$optionsContainer,this.dom.$add),this.sandbox.dom.append(this.$optionsContainer,this.dom.$settings),this.sandbox.dom.append(this.$optionsContainer,this.dom.$ok),this.hideOptions(),this.sandbox.dom.append(this.dom.$wrapper,this.$optionsContainer)},renderWrapper:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),!this.options.skin||this.sandbox.dom.addClass(this.$el,this.options.skin),this.dom.$wrapper=this.sandbox.dom.createElement(n.wrapper),this.sandbox.dom.append(this.$el,this.dom.$wrapper),this.dom.$container=this.sandbox.dom.createElement(n.container),this.sandbox.dom.append(this.dom.$wrapper,this.dom.$container)},startBigLoader:function(){this.dom.$bigLoader===null&&(this.dom.$bigLoader=this.sandbox.dom.createElement('<div class="'+t.bigLoaderClass+'"/>'),this.sandbox.dom.hide(this.dom.$bigLoader),this.sandbox.dom.html(this.dom.$container,this.dom.$bigLoader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$bigLoader,size:"100px",color:"#e4e4e4"}}])),this.sandbox.dom.show(this.dom.$bigLoader)},removeBigLoader:function(){this.sandbox.dom.hide(this.dom.$bigLoader)},setContainerHeight:function(){var e=this.sandbox.dom.height(this.sandbox.dom.$window),n=this.sandbox.dom.offset(this.$el).top;this.sandbox.dom.height(this.dom.$container,(e-n)*t.responsiveHeightRation)},initSettingsDropdown:function(){this.sandbox.start([{name:"dropdown@husky",options:{el:this.dom.$settings,setParentDropDown:!0,instanceName:this.options.instanceName+".settings.dropdown",alignment:"left",data:this.options.data}}])},load:function(e,t,n){e?(this.columnLoadStarted=!0,$.ajax({url:e,global:!1,success:function(e){this.handleResponse(e,t)}.bind(this),error:function(e,t){this.columnLoadStarted=!1,this.sandbox.logger.error("An error occured while fetching data from: ",t),typeof n=="function"&&n()}.bind(this)})):this.sandbox.logger.log("husky.column.navigation -  url not set, aborted loading of data")},handleResponse:function(e,t){this.removeBigLoader(),this.columnLoadStarted=!1,this.parseData(e,t),this.scrollIfNeeded(this.filledColumns+1),this.setOverflowClass(),this.showOptionsAtLast(),this.sandbox.emit(s.call(this))},removeColumns:function(e){var t=this.filledColumns,n;for(n=t;n>=e;n--)delete this.columns[n],this.sandbox.dom.remove("#column"+this.options.instanceName+"-"+n),this.filledColumns--},parseData:function(e,t){t===0&&(this.columns[0]=e);var n=t+1;this.renderColumn(n,e),this.removeLoadingIconForSelected()},renderColumn:function(e,t){var r=this.sandbox.dom.createElement(this.sandbox.util.template(n.column)({columnNumber:e,id:"column"+this.options.instanceName+"-"+e}));this.sandbox.dom.append(this.dom.$container,r),this.filledColumns=e,this.renderItems(r,e,t)},renderItems:function(e,t,n){var r=this.sandbox.dom.find("ul",e),i,s;this.sandbox.util.each(n._embedded[this.options.resultKey],function(e,n){n.order=e+1,n[this.options.idName]in this.marked&&(this.marked[this.options.idName]=n);var o=this.renderItem(n);n.$el=o,this.storeDataItem(t,n),this.sandbox.dom.append(r,o),this.setItemsTextWidth(o),!!n[this.options.hasSubName]&&!!n._embedded[this.options.resultKey]&&n._embedded[this.options.resultKey].length>0&&(i=n,this.setElementSelected(o),this.selected[t]=n),!!this.initiallySelected&&(this.initiallySelected===n[this.options.idName]||this.initiallySelected===n[this.options.pathName])&&(this.setElementSelected(o),this.selected[t]=n,s=n,this.initiallySelected=null)}.bind(this)),i?this.parseData(i,t):!!s&&!s[this.options.hasSubName]&&this.insertAddColumn(s,t)},renderItem:function(e){var r=this.sandbox.dom.createElement(this.sandbox.util.template(n.item)({title:this.sandbox.translate(this.sandbox.util.escapeHtml(e[this.options.titleName])),id:e[this.options.idName]})),i=this.options.disableIds.indexOf(e[this.options.idName])!==-1;return e[this.options.idName]in this.marked&&this.sandbox.dom.addClass(r,t.markedClass),i&&this.sandbox.dom.addClass(r,t.disabledClass),this.renderLeftInfo(r,e),this.renderItemText(r,e),this.renderRightInfo(r,e,i),this.options.isBrokenCallback(e)&&r.addClass("broken"),r},renderLeftInfo:function(e,r){var i=this.sandbox.dom.find("."+t.iconsLeftClass,e),s;this.sandbox.dom.append(i,'<span class="fa-check pull-left marked-icon"></span>'),!this.options.showStatus||(!r[this.options.linkedName]||(r[this.options.linkedName]==="internal"?this.sandbox.dom.append(i,'<span class="fa-internal-link col-icon" title="'+this.sandbox.translate(this.options.tooltipTranslations.internalLink)+'"></span>'):r[this.options.linkedName]==="external"&&this.sandbox.dom.append(i,'<span class="fa-external-link col-icon"  title="'+this.sandbox.translate(this.options.tooltipTranslations.externalLink)+'"></span>')),!r[this.options.typeName]||(r[this.options.typeName].name==="ghost"?this.sandbox.dom.append(i,'<span class="ghost col-icon"  title="'+this.sandbox.translate(this.options.tooltipTranslations.ghost)+'">'+r[this.options.typeName].value+"</span>"):r[this.options.typeName].name==="shadow"&&this.sandbox.dom.append(i,'<span class="fa-shadow-node col-icon"  title="'+this.sandbox.translate(this.options.tooltipTranslations.shadow)+'"></span>')),r[this.options.publishedStateName]||(s=this.sandbox.translate(this.options.tooltipTranslations.unpublished),!r[this.options.publishedName]||(s=this.sandbox.translate(this.options.tooltipTranslations.publishedWithDraft),this.sandbox.dom.append(i,'<span class="published-icon col-icon" title="'+s+'"></span>')),this.sandbox.dom.append(i,'<span class="draft-icon col-icon" title="'+s+'"></span>'))),!this.options.orderable||this.sandbox.dom.append(i,this.sandbox.util.template(n.orderInput)({value:r.order}))},renderItemText:function(e,n){var r=this.sandbox.dom.find("."+t.itemTextClass,e);!!n[this.options.typeName]&&n[this.options.typeName].name==="ghost"&&this.sandbox.dom.addClass(r,"inactive")},renderRightInfo:function(e,n,r){var i=this.sandbox.dom.find("."+t.iconsRightClass,e),s=E.call(this,n);n[this.options.idName]in this.marked&&(s=this.options.unmarkIcon),(!n[this.options.typeName]||n[this.options.typeName].name!=="ghost"||this.options.actionOnGhost)&&this.options.showActionIcon===!0&&s&&!r&&this.sandbox.dom.append(i,'<span class="'+s+' action col-icon"></span>'),!!n[this.options.typeName]&&n[this.options.typeName].name==="ghost"&&this.options.showActionButtonOnGhost&&this.options.showActionIcon===!0&&s&&!r&&this.sandbox.dom.append(i,'<span class="action col-icon">'+this.options.actionButtonOnGhostText+"</span>"),!!n[this.options.hasSubName]&&(!r||!this.options.disabledChildren)&&this.sandbox.dom.append(i,'<span class="fa-chevron-right arrow inactive col-icon"></span>')},setItemsTextWidth:function(e){var n,r;r=this.sandbox.dom.find(".item-text",e),n=t.columnWidth-this.sandbox.dom.outerWidth(this.sandbox.dom.find(".icons-left",e)),n-=parseInt(this.sandbox.dom.css(e,"padding-right").replace("px","")),n-=parseInt(this.sandbox.dom.css(e,"padding-left").replace("px","")),n-=this.sandbox.dom.outerWidth(this.sandbox.dom.find(".icons-right",e)),n-=17,this.sandbox.dom.width(r,n),this.cropItemsText(r)},setColumnTextWidth:function(e){this.sandbox.util.each(this.columns[e],function(e,t){this.setItemsTextWidth(t.$el)}.bind(this))},cropItemsText:function(e){var t=this.sandbox.dom.attr(e,"title"),n,r=t.length,i;this.sandbox.dom.text(e,t),this.sandbox.dom.css(e,"font-weight","bold"),i=this.sandbox.dom.get(e,0).scrollWidth>this.sandbox.dom.width(e);while(i===!0)r--,n=this.sandbox.util.cropMiddle(t,r),this.sandbox.dom.text(e,n),i=this.sandbox.dom.get(e,0).scrollWidth>this.sandbox.dom.width(e);this.sandbox.dom.css(e,"font-weight","")},setElementSelected:function(e){this.sandbox.dom.addClass(e,"selected");var t=this.sandbox.dom.find(".arrow",e);this.sandbox.dom.removeClass(t,"inactive")},addLoadingIcon:function(e){this.sandbox.dom.removeClass(e,"fa-chevron-right inactive"),this.dom.$loader===null&&(this.dom.$loader=this.sandbox.dom.createElement('<div class="'+t.nodeLoaderClass+'"/>'),this.sandbox.dom.hide(this.dom.$loader)),this.sandbox.dom.is(this.dom.$loader,":empty")&&this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"16px",color:"#666666"}}]),this.sandbox.dom.detach(this.dom.$loader),this.sandbox.dom.html(e,this.dom.$loader),this.sandbox.dom.show(this.dom.$loader)},removeLoadingIconForSelected:function(){if(!!this.$selectedElement){var e=this.sandbox.dom.find(".arrow",this.$selectedElement);this.sandbox.dom.hide(this.dom.$loader),this.sandbox.dom.prependClass(e,"fa-chevron-right")}},storeDataItem:function(e,t){this.columns[e]||(this.columns[e]={}),this.columns[e][t[this.options.idName]]=t},bindDOMEvents:function(){var e="li:not(.selected"+(this.options.disabledChildren?", ."+t.disabledClass:"")+")";this.sandbox.dom.on(this.dom.$container,"click",this.itemSelected.bind(this),e),this.sandbox.dom.on(this.$el,"mouseenter",this.itemMouseEnter.bind(this),".column-navigation li"),this.sandbox.dom.on(this.$el,"mouseleave",this.itemMouseLeave.bind(this),".column-navigation li"),this.sandbox.dom.on(this.$el,"mouseenter",this.showOptions.bind(this),".column"),this.sandbox.dom.on(this.dom.$add,"click",this.addNode.bind(this)),this.sandbox.dom.on(this.$el,"click",this.actionClickHandler.bind(this),".action"),this.sandbox.dom.on(this.dom.$container,"dblclick",this.actionClickHandler.bind(this),"li"),this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this),'input[type="checkbox"]'),this.options.responsive===!0&&this.sandbox.dom.on(this.sandbox.dom.$window,"resize",function(){this.setContainerHeight(),this.setOverflowClass()}.bind(this)),this.options.orderable&&(this.sandbox.dom.on(this.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this),"."+t.orderInputClass),this.sandbox.dom.on(this.$el,"focus",function(e){if(this.isOrdering===!0)return this.sandbox.dom.blur(e.currentTarget),!1;this.sandbox.dom.select(e.currentTarget)}.bind(this),"."+t.orderInputClass+" input"),this.sandbox.dom.on(this.dom.$wrapper,"mousedown",function(e){this.lastClicked=this.sandbox.dom.$(e.target)}.bind(this)),this.sandbox.dom.on(this.dom.$ok,"click",this.closeOrderMode.bind(this)),this.sandbox.dom.on(this.$el,"keydown",this.orderKeyHandler.bind(this),"."+t.orderInputClass+" input"),this.sandbox.dom.on(this.$el,"focusout",this.orderBlurHandler.bind(this),"."+t.orderInputClass))},unbindDOMEvents:function(){this.$el.off(),!this.dom.$add||this.dom.$add.off(),!this.dom.$container||this.dom.$container.off(),!this.dom.$wrapper||this.dom.$wrapper.off(),!this.dom.$ok||this.dom.$ok.off()},orderKeyHandler:function(e){e.keyCode===13&&this.sandbox.dom.blur(e.currentTarget);if(e.keyCode===27){var n=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnClass),"data-column"),r=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnItemClass),"data-id");this.resetOrderInput(n,r),this.sandbox.dom.blur(e.currentTarget)}},orderBlurHandler:function(e){if(this.isOrdering===!1){var n=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnClass),"data-column"),r=this.sandbox.dom.attr(this.sandbox.dom.parents(e.currentTarget,"."+t.columnItemClass),"data-id"),i=this.sandbox.dom.find("input",this.columns[n][r].$el);this.sandbox.dom.isNumeric(this.sandbox.dom.val(i))&&Math.floor(this.sandbox.dom.val(i))==this.sandbox.dom.val(i)?this.orderPrepare(n,r):this.orderError(n,r)}},orderPrepare:function(e,n){var r=this.sandbox.dom.find("input",this.columns[e][n].$el),i=this.normalizeOrderPosition(e,parseInt(this.sandbox.dom.val(r),10));this.sandbox.dom.val(r,i),this.sandbox.dom.removeClass(this.columns[e][n].$el,t.orderErrorClass),i!==this.columns[e][n].order&&(this.isOrdering=!0,this.confirmOrder(function(){this.order(e,n,i),this.isOrdering=!1,this.sandbox.dom.click(this.lastClicked)}.bind(this),function(){this.resetOrderInput(e,n),this.isOrdering=!1,this.sandbox.dom.click(this.lastClicked)}.bind(this)))},order:function(e,t,n){var r=this.columns[e][t].order;this.sandbox.util.each(this.columns[e],function(t){this.repositionItem(e,t,r,n),this.resetOrderInput(e,t)}.bind(this)),this.updateItemDomPosition(e,t),this.sandbox.util.delay(this.highlight.bind(this,t),550),this.sandbox.emit(l.call(this),t,n),this.isOrdering=!1},repositionItem:function(e,t,n,r){this.columns[e][t].order===n?this.columns[e][t].order=r:this.columns[e][t].order>n&&this.columns[e][t].order<=r?this.columns[e][t].order--:this.columns[e][t].order<n&&this.columns[e][t].order>=r&&this.columns[e][t].order++},updateItemDomPosition:function(e,n){var r=this.sandbox.dom.parent(this.columns[e][n].$el);this.sandbox.dom.detach(this.columns[e][n].$el),this.sandbox.dom.insertAt(this.columns[e][n].order-1,"."+t.columnItemClass,r,this.columns[e][n].$el),this.sandbox.dom.scrollAnimate(this.sandbox.dom.position(this.columns[e][n].$el).top,this.sandbox.dom.parents(this.columns[e][n].$el,"."+t.columnClass))},resetOrderInput:function(e,t){var n=this.sandbox.dom.find("input",this.columns[e][t].$el);this.sandbox.dom.val(n,this.columns[e][t].order)},normalizeOrderPosition:function(e,t){return t=t<1?1:t,t>Object.keys(this.columns[e]).length?Object.keys(this.columns[e]).length:t},orderError:function(e,n){this.sandbox.dom.addClass(this.columns[e][n].$el,t.orderErrorClass)},confirmOrder:function(e,t){this.sandbox.confirm.alert(this,this.options.orderConfirmTitle,this.options.orderConfirmMessage,e,t)},setOverflowClass:function(){var e=this.sandbox.dom.find(".column-navigation",this.$el);this.sandbox.dom.width(e)<this.sandbox.dom.get(e,0).scrollWidth?this.sandbox.dom.addClass(e,"overflow"):this.sandbox.dom.removeClass(e,"overflow")},bindCustomEvents:function(){if(!!this.customEvents)return;this.sandbox.on(g.call(this),this.getBreadCrumb.bind(this)),this.sandbox.on(d.call(this),this.unmark.bind(this)),this.sandbox.on(m.call(this),this.highlight.bind(this)),this.sandbox.on(c.call(this),this.startOrderModeItem.bind(this)),this.sandbox.on(b.call(this),function(e){this.unbindDOMEvents(),this.$el.children().remove(),this.options=this.sandbox.util.extend(!0,{},this.options,e),this.initialize()}.bind(this)),this.sandbox.on(v.call(this),function(e){typeof e=="function"&&e(this.marked)}.bind(this)),this.sandbox.on("husky.dropdown."+this.options.instanceName+".settings.dropdown.item.click",this.dropdownItemClicked.bind(this)),this.options.responsive===!0&&this.sandbox.on(y.call(this),function(){this.setContainerHeight(),this.setOverflowClass()}.bind(this)),this.customEvents=!0},startOrderModeItem:function(e){var t=this.getColumnForItem(e);t>0&&this.startOrderModeColumn(t)},startOrderModeColumn:function(e){if(this.inOrderMode===!1&&!!this.columns[e]&&Object.keys(this.columns[e]).length>1){this.inOrderMode=!0;var n=this.$find("."+t.columnClass+'[data-column="'+e+'"]');this.lockOptions(e),this.sandbox.dom.addClass(n,t.orderModeClass),this.sandbox.dom.hide(this.dom.$settings),this.sandbox.dom.hide(this.dom.$add),this.sandbox.dom.show(this.dom.$ok),x.call(this),this.setColumnTextWidth(e),this.sandbox.emit(h.call(this))}},closeOrderMode:function(){if(this.inOrderMode===!0){var e=this.$find("."+t.columnClass+"."+t.orderModeClass),n=this.sandbox.dom.data(e,"column");this.unlockOptions(),this.sandbox.dom.removeClass(e,t.orderModeClass),this.sandbox.dom.hide(this.dom.$ok),this.sandbox.dom.show(this.dom.$settings),this.sandbox.dom.show(this.dom.$add),this.setColumnTextWidth(n),this.inOrderMode=!1,this.sandbox.emit(p.call(this))}},highlight:function(e){var n=this.getColumnForItem(e);n>0&&(this.sandbox.dom.addClass(this.columns[n][e].$el,t.highlightClass),this.sandbox.dom.on(this.columns[n][e].$el,"animationend webkitAnimationEnd oanimationend MSAnimationEnd",function(){this.sandbox.dom.removeClass(this.columns[n][e].$el,t.highlightClass)}.bind(this)))},dropdownItemClicked:function(e){!!this.lastHoveredColumn&&!!e.mode&&e.mode==="order"&&this.startOrderModeColumn(this.lastHoveredColumn),!this.selected[this.lastHoveredColumn]||(e.callback?e.callback(e,this.selected[this.lastHoveredColumn],this.columns[this.lastHoveredColumn]):this.sandbox.emit(u.call(this),e,this.selected[this.lastHoveredColumn],this.columns[this.lastHoveredColumn]))},mark:function(e,n){var r=this.$find('li[data-id="'+e+'"]');if(!!r.length&&(!n.type||n.type.name!=="ghost"||this.options.showActionButtonOnGhost)){this.options.singleMarkable===!0&&$.each(this.marked,function(e,t){this.unmark(e)}.bind(this)),this.sandbox.dom.addClass(r,t.markedClass),e in this.marked||(this.marked[e]=n),this.setItemsTextWidth(r);var i=r.find("span:last-child > ."+this.options.actionIcon);i.removeClass(this.options.actionIcon),this.sandbox.dom.prependClass(i,this.options.unmarkIcon)}},unmark:function(e){var n=this.$find('li[data-id="'+e+'"]');if(!!n.length){n.removeClass(t.markedClass),e in this.marked&&delete this.marked[e];var r=n.find("span:last-child > ."+this.options.unmarkIcon);r.removeClass(this.options.unmarkIcon),this.sandbox.dom.prependClass(r,this.options.actionIcon)}},itemMouseEnter:function(e){this.setItemsTextWidth(e.currentTarget)},itemMouseLeave:function(e){this.setItemsTextWidth(e.currentTarget)},getBreadCrumb:function(e){typeof e=="function"?e(this.selected):this.sandbox.logger.log("callback is not a function")},showOptionsAtLast:function(){var e=this.sandbox.dom.last(this.sandbox.dom.find(".column",this.dom.$container));this.showOptions({currentTarget:e})},showOptions:function(e){if(this.optionsLocked===!1){var t=this.sandbox.dom.$(e.currentTarget);this.displayOptions(t),this.sandbox.dom.off(this.dom.$container,"scroll.column-navigation."+this.options.instanceName),this.sandbox.dom.on(this.dom.$container,"scroll.column-navigation."+this.options.instanceName,this.displayOptions.bind(this,t))}},lockOptions:function(e){var n=this.$find("."+t.columnClass+'[data-column="'+e+'"]');!n.length||(this.showOptions({currentTarget:n}),this.optionsLocked=!0)},unlockOptions:function(){this.optionsLocked=!1},displayOptions:function(e){if(!!this.inOrderMode)return;var n;this.lastHoveredColumn=this.sandbox.dom.data(e,"column"),this.sandbox.dom.position(e).left+this.sandbox.dom.width(e)>this.sandbox.dom.width(this.dom.$container)?n=(this.sandbox.dom.width(this.dom.$container)-this.sandbox.dom.position(e).left)/this.sandbox.dom.width(e):n=(this.sandbox.dom.width(e)+this.sandbox.dom.position(e).left)/this.sandbox.dom.width(e),n>=t.minVisibleRatio?(this.sandbox.dom.css(this.$optionsContainer,{visibility:"visible"}),this.moveOptions(e),this.toggleSettingDropdownItems(this.lastHoveredColumn)):this.hideOptions()},toggleSettingDropdownItems:function(e){if(!!this.options.data&&this.options.data.length>0){var t=w.call(this,e);this.sandbox.util.each(this.options.data,function(e,n){!!n.enabler&&typeof n.enabler=="function"&&this.sandbox.emit("husky.dropdown."+this.options.instanceName+".settings.dropdown.item.toggle",n.id,n.enabler(t))}.bind(this))}},moveOptions:function(e){var t=this.sandbox.dom.position(e).left-1;$(this.$optionsContainer).css("margin-left",t+"px"),S.call(this)?$(this.dom.$add).show():$(this.dom.$add).hide(),x.call(this)},hideOptions:function(){this.sandbox.dom.css(this.$optionsContainer,{visibility:"hidden"})},itemSelected:function(e){if(this.columnLoadStarted===!1){this.$selectedElement=this.sandbox.dom.$(e.currentTarget);var n=this.sandbox.dom.data(this.$selectedElement,"id"),r=this.sandbox.dom.parent(this.sandbox.dom.parent(this.$selectedElement)),i=r.data("column"),s=this.columns[i][n],u=this.selected.length-1,a,f;if(r.hasClass(t.orderModeClass))return this.$selectedElement.find("input").focus(),!1;this.closeOrderMode();if(this.sandbox.dom.hasClass(this.$selectedElement,"selected"))this.sandbox.emit(o.call(this),s);else{this.removeCurrentSelected(i),this.sandbox.dom.addClass(this.$selectedElement,"selected"),f=this.sandbox.dom.find(".arrow",this.$selectedElement),this.addLoadingIcon(f);if(!!s){for(a=u;a>=i;a--)delete this.selected[a];this.selected[i]=s,this.sandbox.emit(o.call(this),s),!s[this.options.hasSubName]||this.load(s._links.children.href,i),this.removeColumns(i+1),this.setOverflowClass()}}s[this.options.hasSubName]||(this.insertAddColumn(s,i),this.scrollIfNeeded(i),this.setOverflowClass(),this.toggleSettingDropdownItems(i))}},insertAddColumn:function(e,t){var r=this.sandbox.dom.createElement(this.sandbox.util.template(n.column)({columnNumber:t+1,id:"column"+this.options.instanceName+"-"+(t+1)}));this.sandbox.dom.append(r,this.sandbox.dom.createElement(this.sandbox.util.template(n.noPage)({description:this.sandbox.translate(this.options.noPageDescription)}))),this.sandbox.dom.append(this.dom.$container,r),this.filledColumns++},scrollIfNeeded:function(e){e>t.displayedcolumns&&this.sandbox.dom.scrollLeft(this.dom.$container,(e-t.displayedcolumns)*t.columnWidth)},removeCurrentSelected:function(e){var t=this.sandbox.dom.find("li","#column"+this.options.instanceName+"-"+e);this.sandbox.util.each(t,function(e,t){this.sandbox.dom.removeClass(t,"selected");var n=this.sandbox.dom.find(".arrow",t);this.sandbox.dom.addClass(n,"inactive")}.bind(this))},addNode:function(){var e=this.selected[this.lastHoveredColumn-1]||null;this.sandbox.emit(a.call(this),e)},actionClickHandler:function(e){var n,r,i,s;if(this.inOrderMode===!0)return!1;this.sandbox.dom.hasClass(e.currentTarget,"action")===!0?n=this.sandbox.dom.parent(this.sandbox.dom.parent(e.currentTarget)):n=this.sandbox.dom.$(e.currentTarget);if(n.hasClass(t.disabledClass))return;s=this.sandbox.dom.index(this.sandbox.dom.parents(e.currentTarget,".column")),r=this.sandbox.dom.attr(n,"data-id"),i=this.columns[s][r],this.options.markable===!0&&(r in this.marked?this.unmark(r):this.mark(r,i)),this.sandbox.dom.stopPropagation(e),this.options.actionCallback?this.options.actionCallback(i):this.sandbox.emit(f.call(this),i)}}}),define("__component__$loader@husky",[],function(){"use strict";var e={size:"40px",color:"#666",hidden:!1},t="husky.loader.",n=t+"show",r=t+"hide",i=t+"initialized",s={doubleBounce:['<div class="spinner">','<div class="double-bounce1"></div>','<div class="double-bounce2"></div>',"</div>"].join("")},o=function(){this.sandbox.on(n,a.bind(this)),this.sandbox.on(r,u.bind(this))},u=function(){this.sandbox.dom.hide(this.$spinner)},a=function(){this.sandbox.dom.show(this.$spinner)};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.render(),o.call(this),this.sandbox.emit(i)},render:function(){this.$spinner=this.sandbox.dom.createElement(s.doubleBounce);var e,t;this.sandbox.dom.html(this.$el,this.$spinner),t={width:this.options.size,height:this.options.size},this.sandbox.dom.css(this.$spinner,t),e=this.sandbox.dom.find("div",this.$spinner),this.sandbox.dom.css(e,"background-color",this.options.color),this.options.hidden&&this.sandbox.dom.hide(this.$spinner)}}}),define("__component__$ckeditor@husky",[],function(){"use strict";var e={initializedCallback:null,instanceName:null,table:!0,link:!0,pasteFromWord:!0,autoStart:!0,placeholder:"",entities:!1},t="husky.ckeditor.",n=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"initialized"},r=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"changed"},i=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"focusout"},s=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"start"},o=function(){return t+(this.options.instanceName!==null?this.options.instanceName+".":"")+"destroy"},u=function(){var e=this.sandbox.util.extend(!1,{},this.options),t=this.sandbox.ckeditor.getToolbarBuilder();return!e.toolbar||(t=this.sandbox.ckeditor.createToolbarBuilder(e.toolbar)),!this.options.pasteFromWord==1&&t.remove("paste",["PasteFromWord"]),e.linkShowTargetTab=!1,this.options.link||(t.remove("links",["Link","Unlink"]),e.linkShowTargetTab=!0),this.options.table||t.remove("insert",["Table"]),!this.options.height||(e.autoGrow_minHeight=this.options.height,e.height=this.options.height),!this.options.maxHeight||(e.autoGrow_maxHeight=this.options.maxHeight,e.height>e.autoGrow_maxHeight&&(e.height=e.autoGrow_maxHeight)),!this.options.enterMode||(e.enterMode=CKEDITOR["ENTER_"+this.options.enterMode.toUpperCase()]),(!e.stylesSet||0===e.stylesSet.length)&&t.remove("styles",["Styles"]),e.toolbar=t.get(),delete e.initializedCallback,delete e.baseUrl,delete e.el,delete e.property,delete e.name,delete e.ref,delete e._ref,delete e.require,delete e.element,delete e.link,delete e.table,delete e.maxHeight,delete e.autoStart,delete e.placeholder,e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.editorContent=null,this.options.autoStart?this.startEditor():this.renderStartTemplate(),this.sandbox.on(s.call(this),this.startEditor.bind(this)),this.sandbox.on(o.call(this),this.destroyEditor.bind(this))},renderStartTemplate:function(){var e=$("<body>"+this.$el.val()+"</body>"),t=e.text(),n=$(['<textarea class="form-element ckeditor-preview" placeholder="',this.options.placeholder,'">',t,"</textarea>"].join(""));this.$el.hide(),this.$el.parent().append(n),n.one("focus",function(e){$(e.currentTarget).remove(),this.startEditor(),this.editor.once("instanceReady",function(){this.editor.focus()}.bind(this))}.bind(this))},bindEditorEvents:function(){this.editor.on("dialogShow",function(){this.sandbox.dom.addClass(this.sandbox.dom.parent(".cke_dialog_ui_button_ok"),"sulu_ok_button"),this.sandbox.dom.addClass(this.sandbox.dom.parent(".cke_dialog_ui_button_cancel"),"sulu_cancel_button")}.bind(this)),this.editor.on("change",function(){this.emitChangedEvent()}.bind(this)),this.editor.on("mode",function(){this.data!==this.editor.getData()&&this.emitChangedEvent()}.bind(this)),this.editor.on("instanceReady",function(){this.sandbox.dom.addClass(this.sandbox.dom.find(".cke",this.sandbox.dom.parent(this.$el)),"form-element"),this.sandbox.emit(n.call(this))}.bind(this)),this.editor.on("blur",function(){this.sandbox.emit(i.call(this),this.editor.getData(),this.$el)}.bind(this))},emitChangedEvent:function(){this.data=this.editor.getData(),this.sandbox.emit(r.call(this),this.data,this.$el)},startEditor:function(){var e=u.call(this);this.options.autoStart||this.$el.show(),this.editor=this.sandbox.ckeditor.init(this.$el,this.options.initializedCallback,e),!this.editorContent||this.editor.setData(this.editorContent),this.data=this.editor.getData(),this.bindEditorEvents()},destroyEditor:function(){!this.editor||(this.editorContent=this.editor.getData(),!this.editor.window||!this.editor.window.getFrame()?delete CKEDITOR.instances[this.editor.name]:this.editor.destroy())},destroy:function(){this.destroyEditor()}}}),define("__component__$ckeditor/plugins/paste-from-word@husky",["underscore"],function(e){"use strict";var t={title:"Paste from Word",info:"",enterMode:"P",saveCallback:function(e){}};return{templates:{form:e.template('<p class="input-description"><%= info %></p><p class="input-description"><%= message %></p><textarea class="form-element"></textarea>')},initialize:function(){this.options=this.sandbox.util.extend(!0,{},t.options,this.options),this.initializeDialog()},initializeDialog:function(){var e=this.sandbox.dom.createElement('<div class="overlay-container"/>');this.sandbox.dom.append(this.$el,e),this.sandbox.start([{name:"overlay@husky",options:{openOnStart:!0,removeOnClose:!0,el:e,container:this.$el,instanceName:"paste-from-word",slides:[{title:this.options.title,data:this.templates.form({info:this.options.info,message:this.options.message}),buttons:[{type:"cancel",align:"left"},{type:"ok",text:"OK",align:"right"}],okCallback:function(){var e=this.$el.find("textarea").val();e=e.replace(/^ +| +$/gm,""),e=e.replace(/(?:\r\n|\r|\n)/g,"<br/>"),"P"===this.options.enterMode?(e=e.replace(/<br\/><br\/>/g,"</p><p>"),e="<p>"+e+"</p>"):"DIV"===this.options.enterMode&&(e=e.replace(/<br\/><br\/>/g,"</div><div>"),e="<div>"+e+"</div>"),this.options.saveCallback(e)}.bind(this)}]}}]),this.sandbox.once("husky.overlay.paste-from-word.opened",function(){this.$el.find("textarea").focus()}.bind(this))}}}),define("__component__$overlay@husky",[],function(){"use strict";var e={trigger:"click",triggerEl:null,instanceName:"undefined",openOnStart:!1,removeOnClose:!0,backdropClose:!0,skin:"",supportKeyInput:!0,contentSpacing:!0,propagateEvents:!0,type:"normal",cssClass:"",slides:[],startingSlide:null,top:null,left:null},t={index:-1,title:"",subTitle:null,displayHeader:!0,message:"",closeCallback:null,cancelCallback:null,okCallback:null,type:"normal",data:"",panelContent:"",tabs:null,okInactive:!1,buttonsDefaultAlign:"center",cancelDefaultText:"public.cancel",okDefaultText:"public.ok",languageChanger:null,contentSpacing:!0,cssClass:""},n={$el:null,$footer:null,$header:null,$content:null,$languageChanger:null,$subheader:null,tabs:null},r={closeSelector:".close-button",footerSelector:".overlay-footer",contentSelector:".overlay-content",headerSelector:".overlay-header",slidesSelector:".slides",overlayOkSelector:".overlay-ok",overlayCancelSelector:".overlay-cancel",overlayOtherButtonsSelector:".overlay-button",panelClass:"panel"},i={normal:{buttons:[{type:"ok",inactive:!1,align:"right"},{type:"cancel",inactive:!1,align:"left"}]},alert:{cssClass:"alert",removeOnClose:!0,openOnStart:!0,contentSpacing:!1,instanceName:"alert",buttons:[{type:"ok",inactive:!1,align:"right"},{type:"cancel",inactive:!1,align:"left"}]}},s={OK:"ok",CANCEL:"cancel"},o={overlaySkeleton:['<div class="husky-overlay-container <%= overflowClass %> <%= skin %> <%= cssClass %>">','   <div class="slides"></div>',"</div>"].join(""),slideSkeleton:['<div class="slide slide-<%= index %> <%= cssClass %>">',"   <% if(displayHeader) { %>",'      <div class="overlay-header<% if(subTitle) { %> with-sub-title<% } %>">','           <span class="title"><%= title %></span>','           <% if(subTitle) { %><div class="sub-title"><%= subTitle %></div><% } %>',"       </div>","   <% } %>",'   <div class="overlay-content <%= spacingClass %>"></div>','   <div class="overlay-footer">',"   </div>","</div>"].join(""),okButton:['<div class="btn action overlay-ok<%= classes %>">',"   <% if (!!icon) { %>",'   <span class="fa-<%= icon %>"></span>',"   <% } %>",'   <span class="text"><%= text %></span>',"</div>",'<div class="loader" style="display: none;"></div>'].join(""),cancelButton:['<div class="btn gray black-text overlay-cancel<%= classes %>">',"   <% if (!!icon) { %>",'   <span class="fa-<%= icon %>"></span>',"   <% } %>",'   <span class="text"><%= text %></span>',"</div>"].join(""),button:['<div class="btn overlay-button <%= classes %>" data-button-number="<%=buttonNumber%>">',"   <% if (!!icon) { %>",'   <span class="fa-<%= icon %>"></span>',"   <% } %>",'   <span class="text"><%= text %></span>',"</div>"].join(""),wrapper:['<div class="husky-overlay-wrapper">','   <div class="husky-overlay-scroll-wrapper"></div>','   <div class="husky-overlay-backdrop"></div>',"</div>"].join(""),subheader:['<div class="overlay-subheader">','   <div class="overlay-tabs"></div>',"</div>"].join(""),message:['<div class="message"><%= message %></div>'].join("")},u="husky.overlay.",a=function(){return x.call(this,"initialized")},f=function(){return x.call(this,"opened")},l=function(){return x.call(this,"closed")},c=function(){return x.call(this,"closing")},h=function(){return x.call(this,"okbutton.activate")},p=function(){return x.call(this,"okbutton.deactivate")},d=function(){return x.call(this,"remove")},v=function(){return x.call(this,"open")},m=function(){return x.call(this,"close")},g=function(){return x.call(this,"show-loader")},y=function(){return x.call(this,"hide-loader")},b=function(){return x.call(this,"language-changed")},w=function(){return x.call(this,"slide-left")},E=function(){return x.call(this,"slide-right")},S=function(){return x.call(this,"slide-to")},x=function(e){return u+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.sandbox.logger.log("initialize",this);var t=this.options.type||e.type;this.options=this.sandbox.util.extend(!0,{},e,i[t],this.options),this.setVariables(),this.initSlideOptions(),this.bindEvents(),this.options.openOnStart&&this.openOverlay()},initSlideOptions:function(){var e,n;if(this.options.slides.length===0){this.slides[0]=this.sandbox.util.extend({},t),this.slides[0].index=0;for(e in t)this.options.hasOwnProperty(e)&&(this.slides[0][e]=this.options[e]);n=i[this.slides[0].type],this.slides[0]=this.sandbox.util.extend({},n,this.slides[0])}else this.sandbox.util.foreach(this.options.slides,function(e,r){this.slides[r]=this.sandbox.util.extend({},t,e),n=i[this.slides[r].type],this.slides[r]=this.sandbox.util.extend({},n,this.slides[r]),this.slides[r].index===-1&&(this.slides[r].index=r)}.bind(this))},bindEvents:function(){!this.$trigger||this.sandbox.dom.on(this.$trigger,this.options.trigger+".overlay."+this.options.instanceName,function(e){this.sandbox.dom.preventDefault(e),this.triggerHandler()}.bind(this)),this.sandbox.on(d.call(this),this.removeComponent.bind(this)),this.sandbox.on(h.call(this),this.activateOkButtons.bind(this)),this.sandbox.on(p.call(this),this.deactivateOkButtons.bind(this)),this.sandbox.on(v.call(this),this.triggerHandler.bind(this)),this.sandbox.on(m.call(this),this.closeHandler.bind(this)),this.sandbox.on("husky.select."+this.options.instanceName+".selected.item",function(e){this.sandbox.emit(b.call(this),this.slides[this.activeSlide].languageChanger.locales[e],this.activeTab)}.bind(this))},activateOkButtons:function(){var e=this.sandbox.dom.find(r.overlayOkSelector,this.overlay.$footer),t,n;for(t=-1,n=e.length;++t<n;)this.sandbox.dom.removeClass(e[t],"inactive gray")},deactivateOkButtons:function(){var e=this.sandbox.dom.find(r.overlayOkSelector,this.overlay.$footer),t,n;for(t=-1,n=e.length;++t<n;)this.sandbox.dom.addClass(e[t],"inactive gray")},removeComponent:function(){this.sandbox.stop()},setVariables:function(){this.$trigger=null,!this.options.triggerEl||(this.$trigger=this.sandbox.dom.$(this.options.triggerEl)),this.overlay={opened:!1,collapsed:!1,normalHeight:null,$el:null,$slides:null,slides:[]},this.$wrapper=null,this.$backdrop=null,this.activeTab=null,this.slides=[],this.activeSlide=0},triggerHandler:function(){this.openOverlay()},openOverlay:function(){this.overlay.opened===!1&&(this.overlay.opened=!0,this.$wrapper==null&&this.initWrapper(),this.overlay.$el===null?(this.initSkeleton(),this.bindOverlayEvents(),this.bindCustomEvents(),this.options.okInactive===!0&&this.deactivateOkButtons(),this.sandbox.emit(a.call(this)),this.overlay.$content=this.sandbox.dom.find(r.contentSelector,this.overlay.$el),this.insertOverlay(!0),!this.options.startingSlide||this.slideTo(this.options.startingSlide,!1),this.sandbox.start([{name:"loader@husky",options:{el:this.$el.find(".loader"),size:"30px"}}])):this.insertOverlay(!0))},bindCustomEvents:function(){this.sandbox.on(w.call(this),this.slideLeft.bind(this)),this.sandbox.on(E.call(this),this.slideRight.bind(this)),this.sandbox.on(S.call(this),this.slideEvent.bind(this)),this.sandbox.on(g.call(this),this.showLoader.bind(this)),this.sandbox.on(y.call(this),this.hideLoader.bind(this))},showLoader:function(){this.$el.find(".btn").hide(),this.$el.find(".loader").show()},hideLoader:function(){this.$el.find(".btn").show(),this.$el.find(".loader").hide()},slideLeft:function(){var e=this.activeSlide-1;e<0&&(e=this.slides.length-1),this.slideTo(e,!0)},slideRight:function(){var e=this.activeSlide+1;e>=this.slides.length&&(e=0),this.slideTo(e,!0)},slideEvent:function(e){if(e<0||e>=this.slides.length){this.sandbox.logger.error("Slide index out bounds");return}this.slideTo(e,!0)},slideTo:function(e,t){this.activeSlide=e;var n=this.sandbox.dom.outerWidth(this.sandbox.dom.find(".slide",this.overlay.$slides));t=typeof t=="undefined"?!0:t,t||this.overlay.$slides.addClass("no-animation"),this.overlay.$slides.css("left","-"+e*n+"px"),t||(this.overlay.$slides[0].offsetHeight,this.overlay.$slides.removeClass("no-animation"))},initWrapper:function(){this.$wrapper=this.sandbox.dom.createElement(o.wrapper),this.$backdrop=this.$wrapper.find(".husky-overlay-backdrop"),this.$wrapper.hide()},closeOverlay:function(){this.sandbox.emit(c.call(this)),this.overlay.opened=!1,this.sandbox.emit(l.call(this)),this.sandbox.dom.off("body","keydown."+this.options.instanceName),this.$wrapper.hide(),this.options.removeOnClose?this.removeComponent():this.sandbox.dom.detach(this.overlay.$el)},insertOverlay:function(e){this.$wrapper.find(".husky-overlay-scroll-wrapper").append(this.overlay.$el),this.sandbox.dom.append(this.$el,this.$wrapper),this.$wrapper.show(),!e||this.sandbox.emit(f.call(this)),this.options.supportKeyInput===!0&&(this.sandbox.dom.off("body","keydown."+this.options.instanceName),this.sandbox.dom.on("body","keydown."+this.options.instanceName,this.keyHandler.bind(this)))},initSkeleton:function(){this.overlay.$el=this.sandbox.dom.createElement(this.sandbox.util.template(o.overlaySkeleton,{skin:this.options.skin?this.options.skin:"",cssClass:this.options.cssClass?this.options.cssClass:"",overflowClass:this.slides.length>1?"overflow-hidden":""})),this.overlay.$slides=this.sandbox.dom.find(r.slidesSelector,this.overlay.$el);var e,t;for(e in this.slides)this.slides.hasOwnProperty(e)&&(t=this.initSlideSkeleton(e),this.initButtons(e),this.setContent(e),!this.slides[e].languageChanger||this.renderLanguageChanger(e),this.sandbox.dom.append(this.overlay.$slides,t))},initSlideSkeleton:function(e){this.overlay.slides[e]=this.sandbox.util.extend({},n),this.overlay.slides[e].$el=this.sandbox.dom.createElement(this.sandbox.util.template(o.slideSkeleton,{title:this.sandbox.util.cropMiddle(this.slides[e].title,58),subTitle:this.slides[e].subTitle?this.slides[e].subTitle:null,index:this.slides[e].index,cssClass:this.slides[e].cssClass,displayHeader:this.slides[e].displayHeader,spacingClass:this.slides[e].contentSpacing?"content-spacing":""})),this.overlay.slides[e].$footer=this.sandbox.dom.find(r.footerSelector,this.overlay.slides[e].$el),this.overlay.slides[e].$content=this.sandbox.dom.find(r.contentSelector,this.overlay.slides[e].$el),this.overlay.slides[e].$header=this.sandbox.dom.find(r.headerSelector,this.overlay.slides[e].$el);if(!!this.slides[e].languageChanger||!!this.slides[e].tabs||!!this.slides[e].panelContent)this.overlay.slides[e].$subheader=$(o.subheader),this.overlay.slides[e].$header.after(this.overlay.slides[e].$subheader);if(!!this.slides[e].languageChanger||!!this.slides[e].panelContent)this.overlay.slides[e].$panel=$('<div class="'+r.panelClass+'"/>'),this.overlay.slides[e].$subheader.append(this.overlay.slides[e].$panel);return!this.slides[e].panelContent||(this.overlay.slides[e].$panel.append('<div class="panel-content"/>'),this.overlay.slides[e].$panel.find(".panel-content").append(this.slides[e].panelContent)),this.sandbox.dom.addClass(this.overlay.slides[e].$footer,this.options.buttonsDefaultAlign),this.sandbox.dom.addClass(this.overlay.slides[e].$el,this.options.cssClass),this.overlay.slides[e].$el},renderLanguageChanger:function(e){var t=this.sandbox.dom.createElement('<div class="language-changer"/>');this.overlay.slides[e].$panel.append(t),this.sandbox.start([{name:"select@husky",options:{el:t,data:this.slides[e].languageChanger.locales,preSelectedElements:[this.slides[e].languageChanger.preSelected],instanceName:this.options.instanceName}}])},initButtons:function(e){var t,n,r,i,u,a,f,l;for(t=-1,n=this.slides[e].buttons.length;++t<n;)i=this.slides[e].buttons[t],i.type===s.OK?(u=o.okButton,f=this.slides[e].okDefaultText,l=this.slides[e].okInactive):i.type===s.CANCEL?(u=o.cancelButton,f=this.slides[e].cancelDefaultText):u=o.button,a=i.classes?" "+i.classes:"",i.text?f=i.text:!i.icon||(f=""),l!==!0&&(l=i.inactive),r=this.sandbox.dom.createElement(this.sandbox.util.template(u,{icon:i.icon,text:this.sandbox.translate(f),buttonNumber:t,classes:l===!0?a+" inactive gray":a})),!i.align||this.sandbox.dom.addClass(r,i.align),this.sandbox.dom.append(this.overlay.slides[e].$footer,r)},setContent:function(e){this.slides[e].data?this.sandbox.dom.append(this.overlay.slides[e].$content,this.slides[e].data):this.slides[e].message?this.sandbox.dom.append(this.overlay.slides[e].$content,this.sandbox.util.template(o.message,{message:this.slides[e].message})):this.slides[e].tabs!==null?this.renderTabs(e):this.sandbox.logger.log("Error: either options.data, options.message or options.tabs has to be set",this)},renderTabs:function(e){this.overlay.slides[e].tabs=[];for(var t=-1,n=this.slides[e].tabs.length;++t<n;)this.overlay.slides[e].tabs.push({id:t,name:this.slides[e].tabs[t].title,$el:this.sandbox.dom.createElement(this.slides[e].tabs[t].data)}),this.sandbox.dom.hide(this.overlay.slides[e].tabs[t].$el),this.sandbox.dom.append(this.overlay.slides[e].$content,this.overlay.slides[e].tabs[t].$el);this.showTab(this.overlay.slides[e].tabs[0],e),this.startTabsComponent(e)},startTabsComponent:function(e){this.sandbox.start([{name:"tabs@husky",options:{el:this.overlay.slides[e].$subheader.find(".overlay-tabs"),data:this.overlay.slides[e].tabs,instanceName:"overlay"+this.options.instanceName,skin:"overlay"}}])},keyHandler:function(e){if(e.keyCode===27)this.closeHandler();else if(e.keyCode===13){if(e.target.tagName==="TEXTAREA")return;this.okHandler()}},bindOverlayEvents:function(){this.options.propagateEvents===!1&&(this.sandbox.dom.on(this.overlay.$el,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this)),this.sandbox.dom.on(this.$wrapper,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(this))),this.sandbox.dom.on(this.overlay.$el,"click",this.closeHandler.bind(this),r.overlayCancelSelector),this.sandbox.dom.on(this.overlay.$el,"click",this.okHandler.bind(this),r.overlayOkSelector),this.sandbox.dom.on(this.overlay.$el,"click",this.buttonHandler.bind(this),r.overlayOtherButtonsSelector),this.options.backdropClose===!0&&this.$backdrop.on("click",this.closeHandler.bind(this)),this.bindOverlayCustomEvents()},bindOverlayCustomEvents:function(){this.overlay.tabs!==null&&this.sandbox.on("husky.tabs.overlay"+this.options.instanceName+".item.select",this.showTab.bind(this))},showTab:function(e,t){t=t||this.activeSlide,this.activeTab=e,this.hideAllTabsElements(t),this.sandbox.dom.show(e.$el)},hideAllTabsElements:function(e){for(var t=-1,n=this.overlay.slides[e].tabs.length;++t<n;)this.sandbox.dom.hide(this.overlay.slides[e].tabs[t].$el)},okHandler:function(e){if(!!e&&this.sandbox.dom.hasClass(e.currentTarget,"inactive"))return;!e||(this.sandbox.dom.preventDefault(e),this.sandbox.dom.stopPropagation(e)),this.executeCallback(this.slides[this.activeSlide].okCallback,this.sandbox.dom.find(r.contentSelector,this.overlay.$el))!==!1&&this.closeOverlay()},closeHandler:function(e){var t=this.slides[this.activeSlide].closeCallback||this.slides[this.activeSlide].cancelCallback;!e||(this.sandbox.dom.preventDefault(e),this.sandbox.dom.stopPropagation(e)),this.executeCallback(t,this.sandbox.dom.find(r.contentSelector,this.overlay.$el))!==!1&&this.closeOverlay()},buttonHandler:function(e){if(!e||this.sandbox.dom.hasClass(e.currentTarget,"inactive"))return;var t=this.sandbox.dom.data(e.currentTarget,"buttonNumber"),n=this.slides[this.activeSlide].buttons[t];this.sandbox.dom.preventDefault(e),this.sandbox.dom.stopPropagation(e),this.executeCallback(n.callback,this.sandbox.dom.find(r.contentSelector,this.overlay.$el))},executeCallback:function(e,t){if(typeof e=="function")return e(t)}}}),define("__component__$label@husky",[],function(){"use strict";var e={instanceName:"undefined",type:"WARNING",html:null,title:null,counter:1,description:null,hasClose:!0,effectType:"slide",autoVanish:!0,vanishDelay:0,vanishDuration:250,showDuration:250,closeCallback:null,insertMethod:"append",additionalLabelClasses:"big",buttons:[]},t={APPEND:"append",PREPEND:"prepend"},n={textClass:"text",closeClass:"close",counterClass:"counter",closeIconClass:"fa-times-circle",buttonsClass:"buttons",buttonClass:"button",loaderColor:"#666",isLoading:"is-loading",loaderClass:"loader"},r={ERROR:{title:"Error",labelClass:"husky-label-error",vanishDelay:1e4},WARNING:{vanishDelay:5e3,title:"Warning",labelClass:"husky-label-warning"},SUCCESS:{vanishDelay:5e3,title:"Success",labelClass:"husky-label-success"},SUCCESS_ICON:{labelClass:"husky-label-success-icon",effectType:"fade",hasClose:!1,vanishDelay:2e3,showDuration:100}},i={basic:['<div class="'+n.closeClass+'">','   <% if (!!hasClose) { %><span class="'+n.closeIconClass+'"></span><% } %>',"</div>",'<div class="'+n.textClass+'">',"   <% if (!!title) { %><strong><%= title %></strong><% } %>","   <span><%= description %></span>",'   <div class="'+n.counterClass+'"><span><%= counter %></span></div>',"</div>"].join(""),buttons:'<div class="'+n.buttonsClass+'"></div>',button:'<div class="'+n.buttonClass+'"><%= title %></div>'},s="husky.label.",o=function(){return h.call(this,"initialized")},u=function(){return h.call(this,"destroyed")},a=function(){return h.call(this,"refresh")},f=function(){return h.call(this,"vanish")},l=function(){return h.call(this,"loading")},c=function(){return h.call(this,"reset")},h=function(e){return s+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,r[this.options.type],this.options),this.vanishTimer=null,this.label={$el:null,$content:null,$close:null,$buttons:null},this.buttons={},this.bindCustomEvents(),this.render(),this.bindDomEvents(),this.startEffects(),this.sandbox.emit(o.call(this))},destroy:function(){this.sandbox.emit(u.call(this))},bindDomEvents:function(){this.sandbox.dom.on(this.label.$close,"click",function(){this.vanish(),typeof this.options.closeCallback=="function"&&this.options.closeCallback()}.bind(this))},bindCustomEvents:function(){this.sandbox.on(a.call(this),this.refresh.bind(this)),this.sandbox.on(l.call(this),this.setLoadingState.bind(this)),this.sandbox.on(c.call(this),this.resetState.bind(this)),this.sandbox.on(f.call(this),this.vanish.bind(this))},refresh:function(){this.options.counter+=1,this.abortEffects(),this.label.$el.find("."+n.counterClass+" span").html(this.options.counter),this.updateCounterVisibility(),this.startEffects()},setLoadingState:function(){var e=$("<div/>");e.addClass(n.loaderClass),this.label.$el.append(e),this.label.$el.addClass(n.isLoading),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"20px",color:n.loaderColor}}])},resetState:function(){this.sandbox.stop(this.label.$el.find("*")),this.label.$el.removeClass(n.isLoading)},startEffects:function(){this.options.autoVanish===!0&&(this.vanishTimer=_.delay(function(){this.vanish()}.bind(this),this.options.vanishDelay))},abortEffects:function(){this.label.$el.stop(),this.label.$el.removeAttr("style"),clearTimeout(this.vanishTimer)},vanish:function(){this.options.effectType==="slide"?this.label.$el.slideUp({duration:this.options.vanishDuration,done:this.close.bind(this)}):this.options.effectType==="fade"&&this.label.$el.fadeOut({duration:this.options.vanishDuration,done:this.close.bind(this)})},show:function(){this.options.effectType==="slide"?this.label.$el.slideDown({duration:this.options.showDuration}):this.options.effectType==="fade"&&this.label.$el.fadeIn({duration:this.options.showDuration})},render:function(){this.renderElement(),this.renderContent(),this.renderButtons(),this.updateCounterVisibility(),this.insertLabel(),this.show()},renderElement:function(){this.label.$el=this.sandbox.dom.createElement('<div class="'+this.options.labelClass+(this.options.additionalLabelClasses?" "+this.options.additionalLabelClasses:"")+'"/>'),this.label.$el.hide()},renderContent:function(){this.options.html!==null?this.label.$content=this.sandbox.dom.createElement(this.options.html):this.label.$content=this.sandbox.dom.createElement(this.sandbox.util.template(i.basic,{title:this.sandbox.translate(this.options.title),description:this.sandbox.translate(this.options.description),counter:this.options.counter,hasClose:this.options.hasClose})),this.label.$close=this.label.$content.find("."+n.closeIconClass),this.sandbox.dom.append(this.label.$el,this.label.$content)},renderButtons:function(){this.options.buttons.length>0&&(this.label.$buttons=$(i.buttons),this.label.$el.append(this.label.$buttons),this.sandbox.util.foreach(this.options.buttons,this.renderButton.bind(this)))},renderButton:function(e){this.buttons[e.id]=e,this.buttons[e.id].$el=$(_.template(i.button,{title:e.title})),!e.skin||this.buttons[e.id].$el.addClass(e.skin),this.label.$buttons.append(this.buttons[e.id].$el),!e.onClick||this.buttons[e.id].$el.on("click",function(){this.buttons[e.id].onClick()}.bind(this))},updateCounterVisibility:function(){this.options.counter>1?this.sandbox.dom.show(this.label.$el.find("."+n.counterClass)):this.sandbox.dom.hide(this.label.$el.find("."+n.counterClass))},insertLabel:function(){this.options.insertMethod===t.APPEND?this.sandbox.dom.append(this.$el,this.label.$el):this.options.insertMethod===t.PREPEND?this.sandbox.dom.prepend(this.$el,this.label.$el):this.sandbox.logger.log("No insert method found for",this.options.insertMethod)},close:function(){this.sandbox.stop()}}}),define("__component__$toggler@husky",[],function(){"use strict";var e={instanceName:"undefined",hiddenCheckbox:!0,outline:!1},t={componentClass:"husky-toggler",switchClass:"switch",checkedClass:"checked",wrapperClass:"toggler-wrapper",outlineClass:"outline"},n="husky.toggler.",r=function(){return o.call(this,"initialized")},i=function(){return o.call(this,"changed")},s=function(){return o.call(this,"change")},o=function(e){return n+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.hasId=!1,this.$checkbox=null,this.$wrapper=null,this.render(),this.bindDomEvents(),this.bindCustomEvents(),this.$el.data("checked")===undefined&&this.setData(!1),this.sandbox.emit(r.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.attr(this.$el,"id")&&(this.options.instanceName=this.sandbox.dom.attr(this.$el,"id"),this.hasId=!0),this.options.outline===!0&&this.sandbox.dom.addClass(this.$el,t.outlineClass),this.$wrapper=this.sandbox.dom.createElement('<div class="'+t.wrapperClass+'"/>'),this.sandbox.dom.html(this.$el,this.$wrapper),this.generateHiddenCheckbox(),this.getData()===!0&&this.setChecked(!1),this.sandbox.dom.append(this.$wrapper,this.sandbox.dom.createElement('<div class="'+t.switchClass+'"/>'))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.toggleButton()}.bind(this)),this.hasId===!0&&this.sandbox.dom.on('label[for="'+this.options.instanceName+'"]',"click",function(){this.toggleButton()}.bind(this))},bindCustomEvents:function(){this.sandbox.on(s.call(this),function(e){this.getData()!==e&&(e===!0?this.setChecked(!0):this.unsetChecked(!0))}.bind(this))},toggleButton:function(){this.getData()===!0?this.unsetChecked(!0):this.setChecked(!0)},setChecked:function(e){this.sandbox.dom.addClass(this.$el,t.checkedClass),this.setData(!0),this.updateCheckbox(this.getData()),e!==!1&&this.sandbox.emit(i.call(this),!0)},unsetChecked:function(e){this.sandbox.dom.removeClass(this.$el,t.checkedClass),this.setData(!1),this.updateCheckbox(this.getData()),e!==!1&&this.sandbox.emit(i.call(this),!1)},generateHiddenCheckbox:function(){this.options.hiddenCheckbox===!0&&(this.$checkbox=this.sandbox.dom.createElement('<input type="checkbox" name="'+this.options.instanceName+'"/>'),this.sandbox.dom.append(this.$wrapper,this.$checkbox))},updateCheckbox:function(e){this.$checkbox!==null&&this.sandbox.dom.prop(this.$checkbox,"checked",e)},setData:function(e){this.$el.data("checked",!!e)},getData:function(){return this.$el.data("checked")}}}),define("__component__$dropzone@husky",[],function(){"use strict";var e={instanceName:"undefined",titleKey:"sulu.upload.dropzone-title",descriptionKey:"sulu.upload.dropzone-desc",descriptionIcon:"cloud-upload",cancelLoadingIcon:"coffee",method:"POST",url:"/",paramName:"file",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"},uploadMultiple:!1,successCallback:null,beforeSendingCallback:null,removeFileCallback:null,afterDropCallback:null,pluginOptions:{},maxFiles:null,fadeOutDuration:200,fadeOutDelay:1500,showOverlay:!0,overlayContainer:"body",keepFilesAfterSuccess:!1,skin:"",dropzoneEnabled:!0,cancelUploadOnOverlayClose:!1,maxFilesize:256,fileTooBigKey:"husky.upload.error.file-to-big"},t={overlayClass:"dropzone-overlay",contianerClass:"husky-dropzone",descriptionClass:"description",loaderClass:"dropzone-loader",uploadedItemContainerClass:"upload-items",uploadItemClass:"item",droppedClass:"dropped"},n={basic:['<div class="dropzone-container">','   <div class="'+t.descriptionClass+'">','<div class="fa-<%= icon %> icon"></div>','<span class="title"><%= title %></span>','<span class="addition"><%= description %></span>',"   </div>",'   <div class="'+t.uploadedItemContainerClass+'"></div>',"</div>"].join(""),uploadItem:['<div class="'+t.uploadItemClass+'">'+'<div class="loading-content">','<div class="fa-<%= cancelIcon %> icon" data-dz-remove></div>','<div class="file-size" data-dz-size></div>','<div class="progress">','<div class="bar" data-dz-uploadprogress></div>',"</div>","</div>",'<div class="success-content">','<div class="image">',"<img data-dz-thumbnail />","</div>",'<div class="fa-check tick"></div>',"</div>","</div>"].join("")},r="husky.dropzone.",i=function(){return m.call(this,"initialized")},s=function(){return m.call(this,"uploading")},o=function(){return m.call(this,"success")},u=function(){return m.call(this,"error.file-to-big",!0)},a=function(){return m.call(this,"error",!0)},f=function(){return m.call(this,"open-data-source")},l=function(){return m.call(this,"show-popup")},c=function(){return m.call(this,"files-added")},h=function(){return m.call(this,"change-url")},p=function(){return m.call(this,"enable")},d=function(){return m.call(this,"disable")},v=function(){return m.call(this,"add-image")},m=function(e,t){return[r,!t&&this.options.instanceName?this.options.instanceName+".":"",e].join("")},g=function(e){return e+".dropzone."+(this.options.instanceName?this.options.instanceName:"")};return{initialize:function(){this.sandbox.logger.log("initialize",this),this.options=this.sandbox.util.extend(!0,{},e,this.options),this.dropzone=null,this.dropzoneEnabled=this.options.dropzoneEnabled,this.$dropzone=null,this.$loader=null,this.lastUploadedFile=null,this.overlayOpened=!1,this.url=this.options.url,this.filesDropped=0,this.bindCustomEvents(),this.render(),this.bindDomEvents(),this.sandbox.emit(i.call(this))},destroy:function(){this.sandbox.stop(this.$loader),$("body").off(".dropzone"+this.options.instanceName),this.dropzone.destroy(),this.$dropzone.remove()},bindDomEvents:function(){this.$dropzone.find("."+t.descriptionClass).on("click",function(e){e.stopPropagation()}.bind(this)),this.options.showOverlay&&(this.sandbox.dom.on(this.sandbox.dom.$document,g.call(this,"dragenter"),function(){this.openOverlay()}.bind(this)),this.sandbox.dom.on(this.sandbox.dom.$document,g.call(this,"drop"),function(e){this.dropzoneEnabled&&this.addFiles(e.originalEvent.dataTransfer.files)}.bind(this)),this.$dropzone.on("click",function(){!this.options.cancelUploadOnOverlayClose||(this.sandbox.dom.removeClass(this.$dropzone,t.droppedClass),this.dropzone.removeAllFiles()),this.closeOverlay()}.bind(this))),this.sandbox.dom.on(this.sandbox.dom.$document,g.call(this,"dragover")+" "+g.call(this,"drop"),function(e){this.sandbox.dom.preventDefault(e)}.bind(this)),$("body").on("keydown.dropzone"+this.options.instanceName,function(e){e.keyCode===27&&this.closeOverlay()}.bind(this))},bindCustomEvents:function(){this.sandbox.on(f.call(this),function(){this.$dropzone.find("."+t.descriptionClass).trigger("click")}.bind(this)),this.sandbox.on(h.call(this),function(e){this.url=e}.bind(this)),this.sandbox.on(d.call(this),function(){this.dropzoneEnabled=!1,this.dropzone.disable()}.bind(this)),this.sandbox.on(p.call(this),function(){this.dropzoneEnabled=!0,this.dropzone.enable()}.bind(this)),this.options.showOverlay&&this.sandbox.on(l.call(this),function(){this.openOverlay()}.bind(this)),this.sandbox.on(v.call(this),this.addImage.bind(this))},addImage:function(e,t,n){this.sandbox.util.loadImageAsBlob(e,t).then(function(e){!n||(e.name=n),this.dropzone.addFile(e,t)}.bind(this))},openOverlay:function(){this.overlayOpened===!1&&!!this.dropzoneEnabled&&(this.$dropzone.show(),this.overlayOpened=!0)},closeOverlay:function(){this.overlayOpened===!0&&(this.$dropzone.hide(),this.overlayOpened=!1)},render:function(){this.$dropzone=this.sandbox.dom.createElement('<div class="'+t.contianerClass+'"/>'),this.sandbox.dom.html(this.$dropzone,this.sandbox.util.template(n.basic)({description:this.sandbox.translate(this.options.descriptionKey),title:this.sandbox.translate(this.options.titleKey),icon:this.options.descriptionIcon,instanceName:this.options.instanceName})),this.$dropzone.addClass(this.options.skin),!this.options.showOverlay||(this.$dropzone.addClass(t.overlayClass),this.$dropzone.hide()),!this.options.showOverlay||!this.options.overlayContainer?this.$el.append(this.$dropzone):$(this.options.overlayContainer).append(this.$dropzone),this.renderLoader(),this.startDropzone()},renderLoader:function(){this.$loader=$('<div class="'+t.loaderClass+'"/>'),this.$dropzone.prepend(this.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.$loader,size:"40px",color:"#ffffff"}}])},startDropzone:function(){var e=this,r={url:this.options.url,method:this.options.method,paramName:this.options.paramName,uploadMultiple:this.options.uploadMultiple,maxFiles:this.options.maxFiles,maxFilesize:this.options.maxFilesize,dictFileTooBig:this.sandbox.translate(this.options.fileTooBigKey),headers:this.options.headers,autoProcessQueue:!this.options.afterDropCallback,previewTemplate:this.sandbox.util.template(n.uploadItem)({cancelIcon:this.options.cancelLoadingIcon}),clickable:this.$dropzone.find("."+t.descriptionClass).get(0),previewsContainer:this.sandbox.dom.find("."+t.uploadedItemContainerClass,this.$dropzone)[0],init:function(){e.dropzone=this,this.on("drop",function(e){this.sandbox.dom.stopPropagation(e),this.filesDropped=e.dataTransfer.files.length}.bind(e)),this.on("addedfile",function(n){e.sandbox.dom.addClass(e.$dropzone,t.droppedClass),typeof e.options.afterDropCallback=="function"&&(this.files.length===e.filesDropped||e.filesDropped===0)&&e.options.afterDropCallback(n).then(function(){e.sandbox.util.foreach(this.files,function(t){e.sandbox.util.delay(this.processFile.bind(this,t),0)}.bind(this))}.bind(this)),e.sandbox.dom.on(n.previewElement,"click",function(e){this.sandbox.dom.stopPropagation(e)}.bind(e))}),this.on("sending",function(e){typeof this.options.beforeSendingCallback=="function"?this.options.beforeSendingCallback(e):this.sandbox.emit(s.call(this),e)}.bind(e)),this.on("success",function(e,t){this.lastUploadedFile!==e&&(e.response=t,this.lastUploadedFile=e,typeof this.options.successCallback=="function"?this.options.successCallback(e,t):this.sandbox.emit(o.call(this),e,t),this.removeAllFiles(this.options.keepFilesAfterSuccess))}.bind(e)),this.on("removedfile",function(e){typeof this.options.removeFileCallback=="function"&&this.options.removeFileCallback(e)}.bind(e)),this.on("reset",function(){this.options.keepFilesAfterSuccess===!1&&this.sandbox.dom.removeClass(this.$dropzone,t.droppedClass)}.bind(e)),this.on("processing",function(){this.options.url=e.url}),this.on("error",function(t,n){this.removeFile(t),t.size/1024>e.options.maxFilesize||t.xhr&&t.xhr.status===413?e.sandbox.emit(u.call(this),e.getMessage.call(e,e.options.fileTooBigKey,t),t):e.sandbox.emit(a.call(this),n,t)})}};r=this.sandbox.util.extend(!0,{},r,this.options.pluginOptions),this.sandbox.dropzone.initialize(this.$dropzone,r)},getMessage:function(e,t){return this.sandbox.translate(e).replace("{{filesize}}",Math.round(t.size/1048576*100)/100).replace("{{maxFilesize}}",this.options.maxFilesize).replace("{{filename}}",this.sandbox.util.cropMiddle(t.name,20))},addFiles:function(e){this.sandbox.util.each(e,function(e,t){this.dropzone.addFile(t)}.bind(this))},removeAllFiles:function(e){this.dropzone.getUploadingFiles.call(this.dropzone).length===0&&(e===!0?this.afterFadeOut(!0):this.sandbox.util.delay(function(){this.sandbox.dom.fadeOut(this.sandbox.dom.find("."+t.uploadItemClass,this.$dropzone),this.options.fadeOutDuration,function(){this.sandbox.dom.find("."+t.uploadItemClass+":animated",this.$dropzone).length===0&&this.afterFadeOut()}.bind(this))}.bind(this),this.options.fadeOutDelay))},afterFadeOut:function(e){this.closeOverlay(),this.sandbox.emit(c.call(this),this.getResponseArray(this.dropzone.files)),this.filesDropped=0,e===!0?this.dropzone.files=[]:(this.sandbox.dom.removeClass(this.$dropzone,t.droppedClass),this.dropzone.removeAllFiles())},getResponseArray:function(e){var t=[],n,r;for(n=-1,r=e.length;++n<r;)t.push(e[n].response);return t},remove:function(){this.dropzone.disable(),this.dropzone.destroy(),this.sandbox.dom.off(this.sandbox.dom.$document,g.call(this,"dragenter")),this.sandbox.dom.off(this.sandbox.dom.$document,g.call(this,"drop")),this.sandbox.dom.off(this.sandbox.dom.$document,g.call(this,"dragover"))}}}),define("__component__$input@husky",[],function(){"use strict";var e={instanceName:"undefined",inputId:"",inputName:"",value:"",placeholder:"",disabled:!1,skin:null,datepickerOptions:{orientation:"auto",startDate:-Infinity,endDate:Infinity,todayHighlight:!0},colorPickerOptions:{},lockOptions:{locked:!1},frontIcon:null,frontText:null,frontHtml:null,backIcon:null,backText:null,backHtml:null,renderMethod:null,inputType:"text"},t={componentClass:"husky-input",frontClass:"front",backClass:"back",textClass:"text",inputClass:"input",actionClass:"action",colorFieldClass:"color-field",colorpickerClass:"colorpicker",datepickerClass:"pickdate",linkClickableClass:"clickable",lockIconClass:"fa-lock",unlockIconClass:"fa-unlock"},n={input:'<input type="<%= type %>" value="<%= value %>" placeholder="<%= placeholder %>" id="<%= id %>" name="<%= name %>" data-from="false" <%= disabled %>/>',colorPickerFront:'<div class="'+t.colorFieldClass+'"/>'},r={colorpicker:function(){this.renderColorPicker()},datepicker:function(){this.renderDatePicker()},time:function(){this.renderTime()},url:function(){this.renderLink("http://")},email:function(){this.renderLink("mailto:")},lock:function(){this.renderLock()}},i={lock:function(e){this.lockClickedCallback(e)}},s={color:{frontHtml:n.colorPickerFront,renderMethod:"colorpicker"},phone:{frontIcon:"phone"},password:{frontIcon:"key",inputType:"password"},url:{frontText:"http://",renderMethod:"url"},email:{frontIcon:"envelope",renderMethod:"email"},date:{frontIcon:"calendar",renderMethod:"datepicker"},time:{frontIcon:"clock-o",placeholder:"HH - MM",renderMethod:"time"},lock:{frontIcon:"lock",renderMethod:"lock"}},o="husky.input.",u=function(){return l.call(this,"initialized")},a=function(){return l.call(this,"locked")},f=function(){return l.call(this,"unlocked")},l=function(e){return o+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.sandbox.logger.log("initialize",this);var t=this.sandbox.util.extend(!0,{},e);!!this.options.skin&&!!s[this.options.skin]&&(t=this.sandbox.util.extend(!0,{},e,s[this.options.skin])),this.options=this.sandbox.util.extend(!0,{},t,this.options),this.input={$front:null,$input:null,$back:null},this.linkProtocol=null,this.render(),this.bindDomEvents(),this.sandbox.emit(u.call(this))},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),!this.options.action||this.sandbox.dom.addClass(this.$el,t.actionClass),this.renderFront(),this.renderInput(),this.renderBack(),!!this.options.renderMethod&&!!r[this.options.renderMethod]&&r[this.options.renderMethod].call(this)},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"change",function(e){e.stopPropagation(),e.preventDefault(),this.$el.trigger("change")}.bind(this),"input"),this.sandbox.dom.on(this.$el.find("."+t.frontClass),"click",function(e){i.hasOwnProperty(this.options.skin)&&i[this.options.skin].call(this,e)}.bind(this)),this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.dom.focus(this.input.$input)}.bind(this)),this.sandbox.dom.on(this.input.$input,"click",function(){this.sandbox.dom.focus(this.input.$input)}.bind(this)),!this.sandbox.dom.attr(this.$el,"id")||this.sandbox.dom.on('label[for="'+this.sandbox.dom.attr(this.$el,"id")+'"]',"click",function(){this.sandbox.dom.focus(this.input.$input)}.bind(this)),this.sandbox.dom.on(this.$el,"data-changed",function(){this.updateValue()}.bind(this))},renderFront:function(){if(!!this.options.frontIcon||!!this.options.frontText||!!this.options.frontHtml)this.input.$front=this.sandbox.dom.createElement('<div class="'+t.frontClass+'"/>'),this.options.frontIcon?this.sandbox.dom.html(this.input.$front,'<a class="fa-'+this.options.frontIcon+'"></a>'):this.options.frontText?this.sandbox.dom.html(this.input.$front,'<a class="'+t.textClass+'">'+this.options.frontText+"</a>"):this.sandbox.dom.html(this.input.$front,this.options.frontHtml),this.sandbox.dom.append(this.$el,this.input.$front)},renderInput:function(){var e=this.sandbox.dom.createElement('<div class="'+t.inputClass+'"/>');this.input.$input=this.sandbox.dom.createElement(this.sandbox.util.template(n.input)({type:this.options.inputType,name:this.options.inputName?this.options.inputName:"husky-input-"+this.options.instanceName,id:this.options.inputId?this.options.inputId:"husky-input-"+this.options.instanceName,value:this.options.value,placeholder:this.options.placeholder,disabled:this.options.disabled===!0?"disabled":""})),this.sandbox.dom.append(e,this.input.$input),this.sandbox.dom.append(this.$el,e)},renderBack:function(){if(!!this.options.backIcon||!!this.options.backText||!!this.options.backHtml)this.input.$back=this.sandbox.dom.createElement('<div class="'+t.backClass+'"/>'),this.options.backIcon?this.sandbox.dom.html(this.input.$back,'<span class="fa-'+this.options.backIcon+'"></span>'):this.options.backText?this.sandbox.dom.html(this.input.$back,'<span class="'+t.textClass+'">'+this.options.backText+"</span>"):this.sandbox.dom.html(this.input.$back,this.options.backHtml),this.sandbox.dom.append(this.$el,this.input.$back)},renderColorPicker:function(){this.sandbox.dom.addClass(this.$el,t.colorpickerClass),this.changeColorPreview(this.sandbox.dom.val(this.input.$input)),this.sandbox.colorpicker.init(this.input.$input,this.sandbox.util.extend(!0,{},{change:this.changeColorPreview.bind(this)},this.options.colorPickerOptions))},renderDatePicker:function(){this.sandbox.dom.addClass(this.$el,t.datepickerClass),this.options.placeholder||this.sandbox.dom.attr(this.input.$input,"placeholder",this.sandbox.globalize.getDatePattern()),!!this.options.datepickerOptions.startDate&&typeof this.options.datepickerOptions.startDate=="string"&&(this.options.datepickerOptions.startDate=new Date(this.options.datepickerOptions.startDate)),!!this.options.datepickerOptions.endDate&&typeof this.options.datepickerOptions.endDate=="string"&&(this.options.datepickerOptions.endDate=new Date(this.options.datepickerOptions.endDate)),this.sandbox.datepicker.init(this.input.$input,this.options.datepickerOptions).on("changeDate",function(e){this.setDatepickerValueAttr(e.date)}.bind(this)),this.updateValue(),this.bindDatepickerDomEvents()},renderLink:function(e){this.linkProtocol=e,this.sandbox.dom.on(this.input.$input,"keyup",this.changeFrontLink.bind(this)),this.changeFrontLink()},renderLock:function(){var e=this.options.lockOptions.locked;this.sandbox.dom.addClass(this.sandbox.dom.find("a",this.input.$front),t.linkClickableClass),this.renderLockIcon(),this.$el.data("locked",e)},lockClickedCallback:function(e){if(this.options.disabled===!0)return;var t=!this.options.lockOptions.locked;this.options.lockOptions.locked=t,this.sandbox.dom.prop(this.input.$input,"disabled",t),this.renderLockIcon(),this.$el.data("locked",t),t?(this.sandbox.emit(a.call(this)),e.stopPropagation()):this.sandbox.emit(f.call(this))},renderLockIcon:function(){var e=t.lockIconClass,n=t.unlockIconClass;this.options.lockOptions.locked&&(e=t.unlockIconClass,n=t.lockIconClass),this.exchangeFrontIconClass(n,e)},exchangeFrontIconClass:function(e,n){var r=this.sandbox.dom.find("a",this.input.$front);this.sandbox.dom.removeClass(r,n),this.sandbox.dom.addClass(r,e),this.sandbox.dom.hasClass(r,t.linkClickableClass)&&(this.sandbox.dom.removeClass(r,t.linkClickableClass),this.sandbox.dom.addClass(r,t.linkClickableClass))},changeFrontLink:function(){var e=this.sandbox.dom.val(this.input.$input);e?(this.sandbox.dom.addClass(this.sandbox.dom.find("a",this.input.$front),t.linkClickableClass),this.sandbox.dom.attr(this.sandbox.dom.find("a",this.input.$front),"href",this.linkProtocol+e),this.linkProtocol.indexOf("mailto")<0&&this.sandbox.dom.attr(this.sandbox.dom.find("a",this.input.$front),"target","_blank")):(this.sandbox.dom.removeClass(this.sandbox.dom.find("a",this.input.$front),t.linkClickableClass),this.sandbox.dom.removeAttr(this.sandbox.dom.find("a",this.input.$front),"href"))},bindDatepickerDomEvents:function(){this.sandbox.dom.on(this.input.$input,"focusout",function(){return this.setDatepickerValueAttr(this.sandbox.datepicker.getDate(this.input.$input)),!1}.bind(this))},renderTime:function(){this.sandbox.dom.attr(this.input.$input,"placeholder",this.sandbox.globalize.getTimePatter())},changeColorPreview:function(e){this.sandbox.dom.css(this.$find("."+t.colorFieldClass),{"background-color":e})},setValue:function(e){this.options.renderMethod==="colorpicker"?e?this.sandbox.colorpicker.value(this.input.$input,e):this.sandbox.dom.val(this.input.$input,e):this.options.renderMethod==="datepicker"?(!e||(e=this.isoToDate(e),e=new Date(e)),this.sandbox.datepicker.setDate(this.input.$input,e),this.setDatepickerValueAttr(this.sandbox.datepicker.getDate(this.input.$input))):(this.sandbox.dom.val(this.input.$input,e),(this.options.renderMethod==="email"||this.options.renderMethod==="url")&&this.changeFrontLink())},isoToDate:function(e){return e.indexOf("T")>0?e.substr(0,e.indexOf("T")):e},setDatepickerValueAttr:function(e){!e||(this.sandbox.dom.isNumeric(e.valueOf())?e=e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2):(e="",this.sandbox.dom.val(this.input.$input,""))),this.sandbox.dom.data(this.$el,"value",e)},updateValue:function(){this.setValue(this.sandbox.dom.data(this.$el,"value"))}}}),define("husky_components/data-navigation/list-view",[],function(){var e={list:function(){return['<ul class="data-navigation-items">',"   <% if (!!data.children && !!data.children.length) { %>",e.children(),"   <% } else if (!!data.children && data.children.length === 0) { %>",'       <li class="not-selectable">','           <div class="data-navigation-info data-navigation-info-empty">','               <div class="fa-coffee icon"></div>',"               <span><%=options.translates.noData%></span>","           </div>","       </li>","   <% } else { %>",'       <li class="not-selectable">','           <div class="data-navigation-loader-container">','               <div class="spinner">','                   <div class="double-bounce1" style="background-color: rgb(204, 204, 204);"></div>','                   <div class="double-bounce2" style="background-color: rgb(204, 204, 204);"></div>',"               </div>","           </div>","       </li>","   <% } %>","</ul>"].join("")},children:function(){return["       <% _.each(data.children, function(child) { %>",'           <li data-id="<%= child.id %>" class="data-navigation-item">',"               <% if (!!child.preview && !child.locked) { %>",'                   <div class="data-navigation-item-thumb" style="background-image: url(\'<%=child.preview.url%>\')"></div>',"               <% } else { %>",'                   <div class="<% if(!child.locked) { %>fa-coffee<% } else { %>fa-lock<% } %> data-navigation-item-thumb" style="margin-top: 10px;padding-left: 10px;"></div>',"               <% } %>",'               <div class="data-navigation-item-name">',"                   <%= child[options.nameKey] %>","                   <% if (!!child.hasSub) { %>",'                       <span class="fa-chevron-right data-navigation-item-next"></span>',"                   <% } %>","               </div>","           </li>","       <% }) %>"].join("")}};return function(){return{init:function(){return this.template=_.template(e.list()),this.children=_.template(e.children()),this.$el=$("<div/>",{"class":"data-navigation-list"}),this},destroy:function(){return this.$el.off(),this.$el.remove(),this.$el=null,this},render:function(e,t){e=e||{};var n=this.template({data:e,options:t});return this.$el.html(n),this},append:function(e,t){var n=this.children({data:{children:e},options:t});this.$el.find("ul").append(n)},placeAt:function(e){return $(e).append(this.$el),this}}}}),define("__component__$data-navigation@husky",["husky_components/data-navigation/list-view"],function(e){"use strict";var t={url:null,rootUrl:null,resultKey:"items",parentResultKey:"parent",nameKey:"name",childrenLinkKey:"children",pageKey:"page",limitKey:"limit",searchKey:"search",limit:20,showAddButton:!0,globalEvents:!0,locale:null,translates:{noData:"No Data",title:"Data",addButton:"Add Data",search:"Search ..."}},n={header:function(){return['<div class="header-item data-navigation-back" style="display: none;">','    <div class="icon-container"><span class="fa-chevron-left"/></div>',"</div>",'<div class="header-item data-navigation-search" style="display: none;">','    <div class="icon-container"><span class="fa-search fa-flip-horizontal"/></div>','    <div class="content-container">','        <div class="search-container"/>',"    </div>","</div>","<% if (!!options.showAddButton) { %>",'   <div class="header-item ',r.addButtonClass,'">','       <div class="icon-container"><span class="fa-plus-circle"/></div>','       <div class="content-container">','           <span class="add-container"><%= options.translates.addButton %></span>',"       </div>","   </div>","<% } %>",'<div class="header-item header-filler"/>'].join("")},main:function(){return['<div class="data-navigation">','   <div class="data-navigation-header"></div>','   <div class="data-navigation-list-container iscroll">','       <div class="data-navigation-list-scroll iscroll-inner"></div>','       <div class="loader"></div>',"   </div>","</div>"].join("")}},r={ROOT_ID:"root",addButtonClass:"data-navigation-add"},i="husky.data-navigation.",s=function(e){return i+(this.options.instanceName?this.options.instanceName+".":"")+e},o=function(){return s.call(this,"initialized")},u=function(){return s.call(this,"select")},a=function(){return s.call(this,"selected")},f=function(){return i+"selected"},l=function(){return s.call(this,"add")},c=function(){return s.call(this,"add-button.hide")},h=function(){return s.call(this,"add-button.show")},p=function(){return s.call(this,"navigate")},d=function(){return s.call(this,"set-url")},v=function(){return s.call(this,"set-locale")},m=function(){return s.call(this,"reload")},g=function(){return s.call(this,"clear-cache")};return{page:1,loading:!1,initialize:function(){this.currentView=null,this.locale=null,this.cache=this.sandbox.cacheFactory.create(),this.options=this.sandbox.util.extend(!0,{},t,this.options),this.mainTpl=this.sandbox.util.template(n.main()),this.headerTpl=this.sandbox.util.template(n.header()),this.whenLocaleReceived=$.Deferred(),!this.options.locale||(this.locale=this.options.locale,this.whenLocaleReceived.resolve()),this.render(),this.bindCustomEvents(),this.bindDOMEvents(),this.sandbox.once("husky.loader.initialized",function(){this.showLoader(),this.whenLocaleReceived.then(function(){this.load().then(function(e){this.hideLoader(),this.sandbox.emit(o.call(this)),this.currentView=this.createView(e),this.updateHeader(e),this.storeData(e),this.appendView()}.bind(this))}.bind(this))}.bind(this))},setLocale:function(e){this.locale=e,this.whenLocaleReceived.resolve()},remove:function(){this.cache.destroy(),this.sandbox.infiniteScroll.destroy(".iscroll")},render:function(){var e=this.mainTpl({options:this.options});this.$el.html(e);var t=this.headerTpl({options:this.options});this.$el.find(".data-navigation-header").html(t),this.sandbox.start([{name:"loader@husky",options:{el:this.sandbox.dom.find(".loader",this.$el),color:"#ccc"}}]),this.startInfiniteScroll(),this.startSearch()},startSearch:function(){this.sandbox.start([{name:"search@husky",options:{el:this.sandbox.dom.find(".search-container",this.$el),appearance:"white",instanceName:"data-navigation",placeholderText:this.options.translates.search}}])},updateHeader:function(e){if(e.current.id!=="root"){$(".data-navigation-back").show();var t=e.parent?e.parent.id:"root";this.sandbox.dom.data($(".data-navigation-back"),"parent-id",t)}else $(".data-navigation-back").hide();e.children.length===0&&!this.searchTerm?$(".data-navigation-search").hide():$(".data-navigation-search").show()},startInfiniteScroll:function(){this.sandbox.infiniteScroll.initialize(".iscroll",this.loadNextPage.bind(this))},loadNextPage:function(){var e=this.sandbox.data.deferred();return!!this.data.hasNextPage&&!this.loading?(this.showLoader(),this.page+=1,this.sandbox.util.load(this.getUrl(this.getCurrentUrl()),{locale:this.locale}).then(function(t){var n=t._embedded[this.options.resultKey]||[];this.data.children=this.data.children.concat(n),this.data.hasNextPage=this.page<t.pages,this.currentView.append(n,this.options),this.hideLoader(),e.resolve()}.bind(this))):e.resolve(),e},bindDOMEvents:function(){this.$el.on("click",".data-navigation-item",this.selectChildrenDataHandler.bind(this)),this.$el.on("click",".data-navigation-item-thumb",this.selectChildrenDataHandler.bind(this)),this.$el.on("click",".data-navigation-back",this.selectParentDataHandler.bind(this)),this.$el.on("click",".data-navigation-add",this.addHandler.bind(this)),this.$el.on("click",".data-navigation-search > .icon-container",function(){$(".data-navigation-header").hasClass("header-search")?this.clearSearch():($(".data-navigation-header").addClass("header-search"),$(".data-navigation-search .icon-container span").attr("class","fa-times"),$(".data-navigation-search input").select())}.bind(this))},bindCustomEvents:function(){this.sandbox.on(d.call(this),function(e){e!==this.getCurrentUrl?this.setUrl(e,!0):this.cache.deleteAll()}.bind(this)),this.sandbox.on(v.call(this),this.setLocale.bind(this)),this.sandbox.on(u.call(this),function(e){this.showChildren(e)}.bind(this)),this.sandbox.on(h.call(this),this.showAddButton.bind(this)),this.sandbox.on(c.call(this),this.hideAddButton.bind(this)),this.sandbox.on(m.call(this),function(e){this.setUrl(this.getCurrentUrl(),!0,e)}.bind(this)),this.sandbox.on(g.call(this),function(){this.cache.deleteAll()}.bind(this)),this.sandbox.on("husky.search.data-navigation",function(e){this.searchTerm=e,this.setUrl(this.getCurrentUrl(),!0)}.bind(this)),this.sandbox.on("husky.search.data-navigation.reset",function(){this.searchTerm=null,this.setUrl(this.getCurrentUrl(),!0)}.bind(this))},getCurrentUrl:function(){var e=this.options.rootUrl;return!this.data.current.item||(e=this.data.current.item._links[this.options.childrenLinkKey].href),e},setUrl:function(e,t,n){!t||this.cache.deleteAll(),this.load(e).then(this.storeData.bind(this)).then(function(e){this.updateHeader(e),this.currentView.render(e,this.options),typeof n=="function"&&n.call(this)}.bind(this))},load:function(e){return this.page=1,this.loading=!0,this.sandbox.util.load(this.getUrl(e),{locale:this.locale}).then(this.parse.bind(this)).then(function(e){return this.loading=!1,e}.bind(this))},hideLoader:function(){this.sandbox.dom.hide(this.sandbox.dom.find(".loader",this.$el))},showLoader:function(){this.sandbox.dom.show(this.sandbox.dom.find(".loader",this.$el))},clearSearch:function(){$(".data-navigation-header").removeClass("header-search"),$(".data-navigation-search .icon-container span").attr("class","fa-search fa-flip-horizontal"),this.sandbox.emit("husky.search.data-navigation.clear"),!this.searchTerm||(this.sandbox.emit("husky.search.data-navigation.reset"),this.searchTerm=null)},getUrl:function(e){e=e||this.options.url||this.options.rootUrl;var t=e.indexOf("?")===-1?"?":"&";return e=[e,t,this.options.pageKey,"=",this.page,"&",this.options.limitKey,"=",this.options.limit].join(""),!this.searchTerm||(e=[e,"&",this.options.searchKey,"=",this.searchTerm].join("")),e},parse:function(e){var t={item:e},n=e._embedded.parent;return t.id=e.id||r.ROOT_ID,t.name=e[this.options.nameKey],n?n.id=n.id||r.ROOT_ID:t.id===r.ROOT_ID&&(t.item=null),this.data={children:e._embedded[this.options.resultKey]||null,parent:n,current:t,hasNextPage:!0},this.data},storeData:function(e){var t=e.current;return this.searchTerm||this.cache.put(t.id,e),e},getItems:function(e){var t=$.Deferred(),n=this.cache.get(e),i,s;return n?(this.data=n,t.resolve(n),t.promise()):(e===r.ROOT_ID||e==null?this.data.parent?s=this.data.parent._links[this.options.childrenLinkKey].href:s=this.options.rootUrl:(i=_.where(this.data.children,{id:e})[0],!i&&!!this.data.parent&&this.data.parent.id===e&&(i=this.data.parent),s=i._links[this.options.childrenLinkKey].href),this.load(s).then(this.storeData.bind(this)))},getItem:function(e){return _.where(this.data.children,{id:e})[0]},showChildren:function(e){var t=this.currentView;return this.clearSearch(),this.currentView=this.createView(),this.appendView(t),this.getItems(e).then(function(e){this.updateHeader(e),this.currentView.render(e,this.options)}.bind(this))},openChildrenHandler:function(e){return this.showChildren($(e.currentTarget).closest("li").data("id"))},openParentHandler:function(e){var t=$(e.currentTarget).closest(".data-navigation-back"),n=this.sandbox.dom.data(t,"parent-id"),r=this.createView();return this.clearSearch(),this.prependView(r),this.getItems(n).then(function(e){this.updateHeader(e),r.render(e,this.options)}.bind(this))},selectParentDataHandler:function(e){e.stopPropagation(),this.sandbox.emit(a.call(this),this.data.parent),this.options.globalEvents&&this.sandbox.emit(f.call(this),this.data.parent),this.openParentHandler(e)},navigateParentDataHandler:function(e){e.stopPropagation(),this.openParentHandler(e)},selectChildrenDataHandler:function(e){e.stopPropagation();var t=$(e.currentTarget).closest("li"),n=t.data("id"),r=this.getItem(n);this.sandbox.emit(a.call(this),r),this.options.globalEvents&&this.sandbox.emit(f.call(this),r),this.openChildrenHandler(e)},navigateChildrenHandler:function(e){e.stopPropagation();var t=$(e.currentTarget).closest("li"),n=t.data("id"),r=this.getItem(n);this.sandbox.emit(p.call(this),r),this.openChildrenHandler(e)},addHandler:function(){this.sandbox.emit(l.call(this),this.data.current.item)},showAddButton:function(){$("."+r.addButtonClass).show()},hideAddButton:function(){$("."+r.addButtonClass).hide()},createView:function(t){var n=(new e(this.options)).init();return n.render(t,this.options)},appendView:function(e){!e||(this.currentView.$el.addClass("is-animated"),this.playAppendAnimation(e)),this.currentView.placeAt(".data-navigation-list-container .iscroll-inner")},playAppendAnimation:function(e){this.currentView.$el.css({left:"100%"}).animate({left:"0%"},{duration:250,done:function(){e.destroy(),this.currentView.$el.removeClass("is-animated")}.bind(this)})},prependView:function(e){e.placeAt(".data-navigation-list-container .iscroll-inner"),this.currentView.$el.addClass("is-animated"),this.playPrependAnimation(e)},playPrependAnimation:function(e){var t=this.currentView;this.currentView=e,t.$el.stop().css({left:"0%"}).animate({left:"100%"},{duration:250,done:function(){t.destroy()}.bind(this)})}}}),define("__component__$url-input@husky",["services/husky/url-validator"],function(e){var t={instanceName:"url-input",inputClass:"",scheme:"http://",specificPart:""},n={triggerClass:"drop-down-trigger",toggleClass:"dropdown-toggle",schemeClass:"scheme",specificPartClass:"specific-part-input",linkClass:"link",dataKey:"url-data",dataChangedEvent:"data-changed"},r={skeleton:['<div class="front">','    <a class="<%= constants.schemeClass %> <%= constants.linkClass %> text text-link"','       href="<%= url %>" target="_blank"><%= data.scheme %></a>',"<% if (items.length > 1) { %>",'    <span class="<%= constants.triggerClass %>">','        <span class="<%= constants.toggleClass %>" style="display: inline-block;"/>',"    </span>","<% } %>","</div>",'<div class="input">','    <input type="text"','           class="<%= constants.specificPartClass %> <%= options.inputClass %>" ','           value="<%= data.specificPart %>"/>',"</div>"].join("")};return{initialize:function(){if(!this.options.schemes||this.options.schemes.length===0)this.options.schemes=e.getDefaultSchemes();this.options=this.sandbox.util.extend(!0,{},t,this.options),this.getData()===undefined&&this.setData({scheme:this.options.scheme,specificPart:this.options.specificPart}),this.prepareItems(this.options.schemes),this.render(),this.bindDomEvents()},prepareItems:function(e){this.items=this.sandbox.util.arrayMap(e,function(e){return{id:e,name:e}}.bind(this))},render:function(){this.$el.addClass("husky-input");var e=this.getData();this.html(this.sandbox.util.template(r.skeleton,{constants:n,options:this.options,url:this.getUrl(e),data:e,items:this.items})),this.sandbox.start([{name:"dropdown@husky",options:{el:this.$find(".front"),trigger:this.$find("."+n.triggerClass),instanceName:n.instanceName,data:this.items,clickCallback:this.selectSchemeHandler.bind(this)}}])},bindDomEvents:function(){this.sandbox.dom.on(this.$find("."+n.linkClass),"click",this.linkHandler.bind(this)),this.sandbox.dom.on(this.$find("."+n.specificPartClass),"focusout",this.specificPartChangedHandler.bind(this)),this.sandbox.dom.on(this.$el,n.dataChangedEvent,this.dataChangedHandler.bind(this))},linkHandler:function(){var e=this.getData(),t=this.getUrl(e);if(!t)return!1},specificPartChangedHandler:function(t){this.sandbox.dom.stopPropagation(t);var r=this.$find("."+n.specificPartClass),i=r.val(),s=e.match(i,this.options.schemes),o={specificPart:i};!s||(o.scheme=s.scheme,o.specificPart=s.specificPart),this.setData(o),this.dataChangedHandler()},dataChangedHandler:function(){var e=this.getData();this.$find("."+n.specificPartClass).val(e.specificPart),this.$find("."+n.schemeClass).html(e.scheme),this.$find("."+n.schemeClass).attr("href",this.getUrl(e))},selectSchemeHandler:function(e){this.setData({scheme:e.id}),this.dataChangedHandler()},setData:function(e){var t=this.sandbox.util.extend(!0,{},this.$el.data(n.dataKey),e);return this.$el.data(n.dataKey,t),this.$el.trigger("change"),t},getUrl:function(e){return!e||!e.scheme||!e.specificPart?null:e.scheme+e.specificPart},getData:function(){return this.$el.data(n.dataKey)}}}),function(){"use strict";window.Backbone?define("backbone",[],function(){return window.Backbone}):require.config({paths:{backbone:"bower_components/backbone/backbone"},shim:{backbone:{exports:"Backbone",deps:["underscore","jquery"]}}}),define("husky_extensions/backbone",["backbone"],{name:"Backbone",initialize:function(e){var t=e.core,n=e.sandbox,r=e.sandbox.util._,i={};t.mvc=require("backbone"),n.mvc={},n.mvc.routes=[],n.mvc.Router=function(e){return t.mvc.Router.extend(e)},n.mvc.View=function(e){return t.mvc.View.extend(e)},n.mvc.Model=function(e){return t.mvc.Model.extend(e)},n.mvc.Collection=function(e){return t.mvc.Collection.extend(e)},n.mvc.history=t.mvc.history,define("mvc/view",function(){return n.mvc.View}),define("mvc/model",function(){return n.mvc.Model}),define("mvc/collection",function(){return n.mvc.Collection}),e.components.before("initialize",function(e){if(!this)throw new Error("Missing context!");if(!!this.view){var t=i[e.ref],s;t||(s=r.pick(this,"model","collection","id","attributes","className","tagName","events"),i[e.ref]=t=n.mvc.View(s)),this.view=new t({el:this.$el}),this.view.sandbox=this.sandbox,this.view.parent=this}}),e.components.before("remove",function(){if(!this)throw new Error("Missing context!");this.view&&this.view.stopListening()})},afterAppStart:function(e){e.sandbox.util._.delay(function(){e.core.mvc.History.started||e.core.mvc.history.start()},250)}})}(),function(){"use strict";define("husky_extensions/cache-factory",[],{name:"cacheFactory",initialize:function(e){function n(e){var n={};return{get:function(e){return n[e]||null},put:function(e,t){return n[e]=t,t},"delete":function(e){delete n[e]},deleteAll:function(){n={}},destroy:function(){delete t[e]}}}var t={};e.sandbox.cacheFactory={create:function(r){r=r||e.core.util.uniqueId("cache");if(r in t)throw new Error("cacheId already exists.");return t[r]=new n(r)},get:function(e){return t[e]}}}})}(),function(){"use strict";require.config({paths:{ckeditor:"bower_components/ckeditor/ckeditor",jqueryAdapter:"bower_components/ckeditor/adapters/jquery",pasteFromWordPlugin:"husky_components/ckeditor/plugins/paste-from-word/plugin"},shim:{jqueryAdapter:{deps:["jquery","ckeditor"]}}}),define("husky_extensions/ckeditor-extension",["underscore","services/husky/util","pasteFromWordPlugin","ckeditor","jqueryAdapter"],function(e,t,n){function i(e){this.toolbar=e}var r=function(){return{format_tags:"p;h1;h2;h3;h4;h5;h6",width:"100%",defaultLanguage:"en",removeButtons:"",removePlugins:"elementspath,magicline",removeDialogTabs:"image:advanced;link:advanced",allowedContent:!0,resize_enabled:!1,enterMode:"P",uiColor:"#ffffff",skin:"husky"}};return i.prototype.add=function(e,t){this.toolbar[e]||(this.toolbar[e]=[]),this.toolbar[e]=this.toolbar[e].concat(t)},i.prototype.remove=function(t,n){this.toolbar[t]||(this.toolbar[t]=[]),this.toolbar[t]=e.difference(this.toolbar[t],n)},i.prototype.get=function(){return e.map(this.toolbar,function(e,t){return{name:t,items:e}})},i.getRaw=function(){return this.toolbar},{name:"ckeditor",initialize:function(e){var s={semantics:["Format"],basicstyles:["Superscript","Subscript","Italic","Bold","Underline","Strike"],blockstyles:["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],list:["NumberedList","BulletedList"],links:["Link"],insert:["Table"],styles:["Styles"],code:["Source"]},o,u=["justify","format","sourcearea","link","table","autogrow"],a={Format:"font",Strike:"strikethrough",JustifyLeft:"align-left",JustifyCenter:"align-center",JustifyRight:"align-right",JustifyBlock:"align-justify",NumberedList:"list-ol",BulletedList:"list",PasteFromWord:"clipboard",Styles:"header",Source:"code"},f={Link:["Unlink"]},l=function(e){var n={},r;return t.each(e,function(e,i){r=[],t.foreach(i,function(e){r.push(e),!f[e]||(r=r.concat(f[e]))}.bind(this)),n[e]=r}.bind(this)),n};e.sandbox.ckeditor={addPlugin:function(e,t){u.push(e),!t||CKEDITOR.plugins.add(e,t)},addToolbarButton:function(e,t,n,r){s[e]||(s[e]=[]),s[e].push(t),!n||(a[t]=n),f[t]=r},setToolbar:function(e){o=t.deepCopy(e)},getAvailableToolbarSections:function(){return t.deepCopy(s)},getToolbar:function(){return o?l(o):l(this.getAvailableToolbarSections())},getIcon:function(e){return a.hasOwnProperty(e)?a[e]:e.toLowerCase()},getToolbarBuilder:function(){return new i(this.getToolbar())},createToolbarBuilder:function(e){var t={};for(var n=0,r=e.length;n<r;++n)t[e[n].name]=e[n].items;return new i(t)},init:function(t,n,i){var s=e.sandbox.util.extend(!0,{},r.call(),i),o;return s.extraPlugins=u.join(","),!n||typeof n!="function"?o=$(t).ckeditor(s):o=$(t).ckeditor(n,s),CKEDITOR.on("dialogDefinition",function(e){var t=e.data.name,n=e.data.definition;if(t=="link"){var r=n.getContents("info"),i=n.getContents("target"),s=r.get("linkType"),o=i.get("linkTargetType"),u=["url","email"],a=[],f=["notSet","_blank","_self"],l=[];for(var c=0;c<s.items.length;c++)u.indexOf(s.items[c][1])!==-1&&a.push(s.items[c]);for(var c=0;c<o.items.length;c++)f.indexOf(o.items[c][1])!==-1&&l.push(o.items[c]);s.items=a,o.items=l}}),o.editor},getInstance:function(e){var t=CKEDITOR.instances[e];if(!!t)return t}},e.sandbox.ckeditor.addPlugin("huskyPasteFromWord",new n(e.sandboxes.create("plugin-paste-from-word"))),e.sandbox.ckeditor.addToolbarButton("paste","PasteFromWord")}}})}(),define("husky_extensions/collection",[],function(){"use strict";var e={byId:{},objs:[],add:function(e){this.byId[e.id]=e,this.objs.push(e)},get:function(e){return this.byId[e.id||e]}};return{name:"Collection",initialize:function(t){t.sandbox.data.Collection=e}}}),function(e){typeof define=="function"&&define.amd?define("jquery-minicolors",["jquery"],e):typeof exports=="object"?module.exports=e(require("jquery")):e(jQuery)}(function(e){function t(t,n){var r=e('<div class="minicolors" />'),i=e.minicolors.defaults;if(t.data("minicolors-initialized"))return;n=e.extend(!0,{},i,n),r.addClass("minicolors-theme-"+n.theme).toggleClass("minicolors-with-opacity",n.opacity).toggleClass("minicolors-no-data-uris",n.dataUris!==!0),n.position!==undefined&&e.each(n.position.split(" "),function(){r.addClass("minicolors-position-"+this)}),t.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",n).prop("size",7).wrap(r).after('<div class="minicolors-panel minicolors-slider-'+n.control+'">'+'<div class="minicolors-slider minicolors-sprite">'+'<div class="minicolors-picker"></div>'+"</div>"+'<div class="minicolors-opacity-slider minicolors-sprite">'+'<div class="minicolors-picker"></div>'+"</div>"+'<div class="minicolors-grid minicolors-sprite">'+'<div class="minicolors-grid-inner"></div>'+'<div class="minicolors-picker"><div></div></div>'+"</div>"+"</div>"),n.inline||(t.after('<span class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color"></span></span>'),t.next(".minicolors-swatch").on("click",function(e){e.preventDefault(),t.focus()})),t.parent().find(".minicolors-panel").on("selectstart",function(){return!1}).end(),n.inline&&t.parent().addClass("minicolors-inline"),u(t,!1),t.data("minicolors-initialized",!0)}function n(e){var t=e.parent();e.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),t.before(e).remove()}function r(e){var t=e.parent(),n=t.find(".minicolors-panel"),r=e.data("minicolors-settings");if(!e.data("minicolors-initialized")||e.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus"))return;i(),t.addClass("minicolors-focus"),n.stop(!0,!0).fadeIn(r.showSpeed,function(){r.show&&r.show.call(e.get(0))})}function i(){e(".minicolors-focus").each(function(){var t=e(this),n=t.find(".minicolors-input"),r=t.find(".minicolors-panel"),i=n.data("minicolors-settings");r.fadeOut(i.hideSpeed,function(){i.hide&&i.hide.call(n.get(0)),t.removeClass("minicolors-focus")})})}function s(e,t,n){var r=e.parents(".minicolors").find(".minicolors-input"),i=r.data("minicolors-settings"),s=e.find("[class$=-picker]"),u=e.offset().left,a=e.offset().top,f=Math.round(t.pageX-u),l=Math.round(t.pageY-a),c=n?i.animationSpeed:0,h,p,d,v;t.originalEvent.changedTouches&&(f=t.originalEvent.changedTouches[0].pageX-u,l=t.originalEvent.changedTouches[0].pageY-a),f<0&&(f=0),l<0&&(l=0),f>e.width()&&(f=e.width()),l>e.height()&&(l=e.height()),e.parent().is(".minicolors-slider-wheel")&&s.parent().is(".minicolors-grid")&&(h=75-f,p=75-l,d=Math.sqrt(h*h+p*p),v=Math.atan2(p,h),v<0&&(v+=Math.PI*2),d>75&&(d=75,f=75-75*Math.cos(v),l=75-75*Math.sin(v)),f=Math.round(f),l=Math.round(l)),e.is(".minicolors-grid")?s.stop(!0).animate({top:l+"px",left:f+"px"},c,i.animationEasing,function(){o(r,e)}):s.stop(!0).animate({top:l+"px"},c,i.animationEasing,function(){o(r,e)})}function o(e,t){function n(e,t){var n,r;return!e.length||!t?null:(n=e.offset().left,r=e.offset().top,{x:n-t.offset().left+e.outerWidth()/2,y:r-t.offset().top+e.outerHeight()/2})}var r,i,s,o,u,f,l,h=e.val(),d=e.attr("data-opacity"),v=e.parent(),g=e.data("minicolors-settings"),y=v.find(".minicolors-swatch"),b=v.find(".minicolors-grid"),w=v.find(".minicolors-slider"),E=v.find(".minicolors-opacity-slider"),S=b.find("[class$=-picker]"),x=w.find("[class$=-picker]"),T=E.find("[class$=-picker]"),N=n(S,b),C=n(x,w),k=n(T,E);if(t.is(".minicolors-grid, .minicolors-slider")){switch(g.control){case"wheel":o=b.width()/2-N.x,u=b.height()/2-N.y,f=Math.sqrt(o*o+u*u),l=Math.atan2(u,o),l<0&&(l+=Math.PI*2),f>75&&(f=75,N.x=69-75*Math.cos(l),N.y=69-75*Math.sin(l)),i=p(f/.75,0,100),r=p(l*180/Math.PI,0,360),s=p(100-Math.floor(C.y*(100/w.height())),0,100),h=m({h:r,s:i,b:s}),w.css("backgroundColor",m({h:r,s:i,b:100}));break;case"saturation":r=p(parseInt(N.x*(360/b.width()),10),0,360),i=p(100-Math.floor(C.y*(100/w.height())),0,100),s=p(100-Math.floor(N.y*(100/b.height())),0,100),h=m({h:r,s:i,b:s}),w.css("backgroundColor",m({h:r,s:100,b:s})),v.find(".minicolors-grid-inner").css("opacity",i/100);break;case"brightness":r=p(parseInt(N.x*(360/b.width()),10),0,360),i=p(100-Math.floor(N.y*(100/b.height())),0,100),s=p(100-Math.floor(C.y*(100/w.height())),0,100),h=m({h:r,s:i,b:s}),w.css("backgroundColor",m({h:r,s:i,b:100})),v.find(".minicolors-grid-inner").css("opacity",1-s/100);break;default:r=p(360-parseInt(C.y*(360/w.height()),10),0,360),i=p(Math.floor(N.x*(100/b.width())),0,100),s=p(100-Math.floor(N.y*(100/b.height())),0,100),h=m({h:r,s:i,b:s}),b.css("backgroundColor",m({h:r,s:100,b:100}))}e.val(c(h,g.letterCase))}t.is(".minicolors-opacity-slider")&&(g.opacity?d=parseFloat(1-k.y/E.height()).toFixed(2):d=1,g.opacity&&e.attr("data-opacity",d)),y.find("SPAN").css({backgroundColor:h,opacity:d}),a(e,h,d)}function u(e,t){var n,r,i,s,o,u,f,l=e.parent(),d=e.data("minicolors-settings"),v=l.find(".minicolors-swatch"),y=l.find(".minicolors-grid"),b=l.find(".minicolors-slider"),w=l.find(".minicolors-opacity-slider"),E=y.find("[class$=-picker]"),S=b.find("[class$=-picker]"),x=w.find("[class$=-picker]");n=c(h(e.val(),!0),d.letterCase),n||(n=c(h(d.defaultValue,!0),d.letterCase)),r=g(n),t||e.val(n),d.opacity&&(i=e.attr("data-opacity")===""?1:p(parseFloat(e.attr("data-opacity")).toFixed(2),0,1),isNaN(i)&&(i=1),e.attr("data-opacity",i),v.find("SPAN").css("opacity",i),o=p(w.height()-w.height()*i,0,w.height()),x.css("top",o+"px")),v.find("SPAN").css("backgroundColor",n);switch(d.control){case"wheel":u=p(Math.ceil(r.s*.75),0,y.height()/2),f=r.h*Math.PI/180,s=p(75-Math.cos(f)*u,0,y.width()),o=p(75-Math.sin(f)*u,0,y.height()),E.css({top:o+"px",left:s+"px"}),o=150-r.b/(100/y.height()),n===""&&(o=0),S.css("top",o+"px"),b.css("backgroundColor",m({h:r.h,s:r.s,b:100}));break;case"saturation":s=p(5*r.h/12,0,150),o=p(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height()),E.css({top:o+"px",left:s+"px"}),o=p(b.height()-r.s*(b.height()/100),0,b.height()),S.css("top",o+"px"),b.css("backgroundColor",m({h:r.h,s:100,b:r.b})),l.find(".minicolors-grid-inner").css("opacity",r.s/100);break;case"brightness":s=p(5*r.h/12,0,150),o=p(y.height()-Math.ceil(r.s/(100/y.height())),0,y.height()),E.css({top:o+"px",left:s+"px"}),o=p(b.height()-r.b*(b.height()/100),0,b.height()),S.css("top",o+"px"),b.css("backgroundColor",m({h:r.h,s:r.s,b:100})),l.find(".minicolors-grid-inner").css("opacity",1-r.b/100);break;default:s=p(Math.ceil(r.s/(100/y.width())),0,y.width()),o=p(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height()),E.css({top:o+"px",left:s+"px"}),o=p(b.height()-r.h/(360/b.height()),0,b.height()),S.css("top",o+"px"),y.css("backgroundColor",m({h:r.h,s:100,b:100}))}e.data("minicolors-initialized")&&a(e,n,i)}function a(e,t,n){var r=e.data("minicolors-settings"),i=e.data("minicolors-lastChange");if(!i||i.hex!==t||i.opacity!==n)e.data("minicolors-lastChange",{hex:t,opacity:n}),r.change&&(r.changeDelay?(clearTimeout(e.data("minicolors-changeTimeout")),e.data("minicolors-changeTimeout",setTimeout(function(){r.change.call(e.get(0),t,n)},r.changeDelay))):r.change.call(e.get(0),t,n)),e.trigger("change").trigger("input")}function f(t){var n=h(e(t).val(),!0),r=b(n),i=e(t).attr("data-opacity");return r?(i!==undefined&&e.extend(r,{a:parseFloat(i)}),r):null}function l(t,n){var r=h(e(t).val(),!0),i=b(r),s=e(t).attr("data-opacity");return i?(s===undefined&&(s=1),n?"rgba("+i.r+", "+i.g+", "+i.b+", "+parseFloat(s)+")":"rgb("+i.r+", "+i.g+", "+i.b+")"):null}function c(e,t){return t==="uppercase"?e.toUpperCase():e.toLowerCase()}function h(e,t){return e=e.replace(/[^A-F0-9]/ig,""),e.length!==3&&e.length!==6?"":(e.length===3&&t&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),"#"+e)}function p(e,t,n){return e<t&&(e=t),e>n&&(e=n),e}function d(e){var t={},n=Math.round(e.h),r=Math.round(e.s*255/100),i=Math.round(e.b*255/100);if(r===0)t.r=t.g=t.b=i;else{var s=i,o=(255-r)*i/255,u=(s-o)*(n%60)/60;n===360&&(n=0),n<60?(t.r=s,t.b=o,t.g=o+u):n<120?(t.g=s,t.b=o,t.r=s-u):n<180?(t.g=s,t.r=o,t.b=o+u):n<240?(t.b=s,t.r=o,t.g=s-u):n<300?(t.b=s,t.g=o,t.r=o+u):n<360?(t.r=s,t.g=o,t.b=s-u):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function v(t){var n=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];return e.each(n,function(e,t){t.length===1&&(n[e]="0"+t)}),"#"+n.join("")}function m(e){return v(d(e))}function g(e){var t=y(b(e));return t.s===0&&(t.h=360),t}function y(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),i=r-n;return t.b=r,t.s=r!==0?255*i/r:0,t.s!==0?e.r===r?t.h=(e.g-e.b)/i:e.g===r?t.h=2+(e.b-e.r)/i:t.h=4+(e.r-e.g)/i:t.h=-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t}function b(e){return e=parseInt(e.indexOf("#")>-1?e.substring(1):e,16),{r:e>>16,g:(e&65280)>>8,b:e&255}}e.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",dataUris:!0,defaultValue:"",hide:null,hideSpeed:100,inline:!1,letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default"}},e.extend(e.fn,{minicolors:function(s,o){switch(s){case"destroy":return e(this).each(function(){n(e(this))}),e(this);case"hide":return i(),e(this);case"opacity":if(o===undefined)return e(this).attr("data-opacity");return e(this).each(function(){u(e(this).attr("data-opacity",o))}),e(this);case"rgbObject":return f(e(this),s==="rgbaObject");case"rgbString":case"rgbaString":return l(e(this),s==="rgbaString");case"settings":if(o===undefined)return e(this).data("minicolors-settings");return e(this).each(function(){var t=e(this).data("minicolors-settings")||{};n(e(this)),e(this).minicolors(e.extend(!0,t,o))}),e(this);case"show":return r(e(this).eq(0)),e(this);case"value":if(o===undefined)return e(this).val();return e(this).each(function(){u(e(this).val(o))}),e(this);default:return s!=="create"&&(o=s),e(this).each(function(){t(e(this),o)}),e(this)}}}),e(document).on("mousedown.minicolors touchstart.minicolors",function(t){e(t.target).parents().add(t.target).hasClass("minicolors")||i()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(t){var n=e(this);t.preventDefault(),e(document).data("minicolors-target",n),s(n,t,!0)}).on("mousemove.minicolors touchmove.minicolors",function(t){var n=e(document).data("minicolors-target");n&&s(n,t)}).on("mouseup.minicolors touchend.minicolors",function(){e(this).removeData("minicolors-target")}).on("mousedown.minicolors touchstart.minicolors",".minicolors-swatch",function(t){var n=e(this).parent().find(".minicolors-input");t.preventDefault(),r(n)}).on("focus.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;r(t)}).on("blur.minicolors",".minicolors-input",function(){var t=e(this),n=t.data("minicolors-settings");if(!t.data("minicolors-initialized"))return;t.val(h(t.val(),!0)),t.val()===""&&t.val(h(n.defaultValue,!0)),t.val(c(t.val(),n.letterCase))}).on("keydown.minicolors",".minicolors-input",function(t){var n=e(this);if(!n.data("minicolors-initialized"))return;switch(t.keyCode){case 9:i();break;case 13:case 27:i(),n.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;u(t,!0)}).on("paste.minicolors",".minicolors-input",function(){var t=e(this);if(!t.data("minicolors-initialized"))return;setTimeout(function(){u(t,!0)},1)})}),function(){"use strict";require.config({paths:{"jquery-minicolors":"bower_components/jquery-minicolors/jquery.minicolors"},shim:{backbone:{deps:["jquery"]}}}),define("husky_extensions/colorpicker",["jquery-minicolors"],{name:"minicolor",initialize:function(e){e.sandbox.colorpicker={init:function(t,n){return e.core.dom.$(t).minicolors(n)},value:function(t,n){return e.core.dom.$(t).minicolors("value",n)}}}})}(),function(){"use strict";define("husky_extensions/confirm",{name:"Confirm",initialize:function(e){e.sandbox.confirm={alert:function(t,n,r,i,s,o){var u=e.core.dom.createElement("<div/>"),o=o||"alert";e.core.dom.append(t.$el,u),t.sandbox.start([{name:"overlay@husky",options:{el:u,title:e.sandbox.translate(n),message:e.sandbox.translate(r),closeCallback:s,okCallback:i,type:o}}])}}}})}(),function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){function u(e,t){return t.toLowerCase()}var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])");n=new RegExp("^"+n.toLowerCase());for(var a in r)n.test(a)&&(s=a.replace(o,u),i[s]=r[a]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.length=0},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .input-group-addon, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today, tfoot th.clear").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(t){this._o=e.extend({},this._o,t);var n=this.o=e.extend({},this._o),r=n.language;d[r]||(r=r.split("-")[0],d[r]||(r=h.language)),n.language=r;switch(n.startView){case 2:case"decade":n.startView=2;break;case 1:case"year":n.startView=1;break;default:n.startView=0}switch(n.minViewMode){case 1:case"months":n.minViewMode=1;break;case 2:case"years":n.minViewMode=2;break;default:n.minViewMode=0}n.startView=Math.max(n.startView,n.minViewMode),n.multidate!==!0&&(n.multidate=Number(n.multidate)||!1,n.multidate!==!1?n.multidate=Math.max(0,n.multidate):n.multidate=1),n.multidateSeparator=String(n.multidateSeparator),n.weekStart%=7,n.weekEnd=(n.weekStart+6)%7;var i=v.parseFormat(n.format);n.startDate!==-Infinity&&(n.startDate?n.startDate instanceof Date?n.startDate=this._local_to_utc(this._zero_time(n.startDate)):n.startDate=v.parseDate(n.startDate,i,n.language):n.startDate=-Infinity),n.endDate!==Infinity&&(n.endDate?n.endDate instanceof Date?n.endDate=this._local_to_utc(this._zero_time(n.endDate)):n.endDate=v.parseDate(n.endDate,i,n.language):n.endDate=Infinity),n.daysOfWeekDisabled=n.daysOfWeekDisabled||[],e.isArray(n.daysOfWeekDisabled)||(n.daysOfWeekDisabled=n.daysOfWeekDisabled.split(/[,\s]*/)),n.daysOfWeekDisabled=e.map(n.daysOfWeekDisabled,function(e){return parseInt(e,10)});var s=String(n.orientation).toLowerCase().split(/\s+/g),o=n.orientation.toLowerCase();s=e.grep(s,function(e){return/^auto|left|right|top|bottom$/.test(e)}),n.orientation={x:"auto",y:"auto"};if(!!o&&o!=="auto")if(s.length===1)switch(s[0]){case"top":case"bottom":n.orientation.y=s[0];break;case"left":case"right":n.orientation.x=s[0]}else o=e.grep(s,function(e){return/^left|right$/.test(e)}),n.orientation.x=o[0]||"auto",o=e.grep(s,function(e){return/^top|bottom$/.test(e)}),n.orientation.y=o[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var n=0,r,i,s;n<e.length;n++)r=e[n][0],e[n].length===2?(i=t,s=e[n][1]):e[n].length===3&&(i=e[n][1],s=e[n][2]),r.on(s,i)},_unapplyEvents:function(e){for(var n=0,r,i,s;n<e.length;n++)r=e[n][0],e[n].length===2?(s=t,i=e[n][1]):e[n].length===3&&(s=e[n][1],i=e[n][2]),r.off(i,s)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){var t=e.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,t),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){var t=e.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,e.map(t,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(n){n===t&&(n=this.o.format);var r=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,n,r)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=[];this.element.parents().each(function(){var t=e(this).css("z-index");t!=="auto"&&t!==0&&a.push(parseInt(t))});var f=Math.max.apply(Math,a)+10,l=this.component?this.component.parent().offset():this.element.offset(),c=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),h=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),p=l.left,d=l.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(p-=t-h)):(this.picker.addClass("datepicker-orient-left"),l.left<0?p-=l.left-i:l.left+t>s&&(p=s-t-i));var v=this.o.orientation.y,m,g;v==="auto"&&(m=-u+l.top-r,g=u+o-(l.top+c+r),Math.max(m,g)===g?v="top":v="bottom"),this.picker.addClass("datepicker-orient-"+v),v==="top"?d+=c:d-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:d,left:p,zIndex:f})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="cw">&nbsp;</th>';t+=n,this.picker.find(".datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()===r&&t.getUTCMonth()<i?n.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()===r&&t.getUTCMonth()>i)&&n.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===s.getFullYear()&&t.getUTCMonth()===s.getMonth()&&t.getUTCDate()===s.getDate()&&n.push("today"),this.dates.contains(t)!==-1&&n.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("range"),e.inArray(t.valueOf(),this.range)!==-1&&n.push("selected")),n},fill:function(){var n=new Date(this.viewDate),i=n.getUTCFullYear(),s=n.getUTCMonth(),o=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,u=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,f=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,l=d[this.o.language].today||d.en.today||"",c=d[this.o.language].clear||d.en.clear||"",h;if(isNaN(i)||isNaN(s))return;this.picker.find(".datepicker-days thead th.datepicker-switch").text(d[this.o.language].months[s]+" "+i),this.picker.find("tfoot th.today").text(l).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(c).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var p=r(i,s-1,28),m=v.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(m),p.setUTCDate(m-(p.getUTCDay()-this.o.weekStart+7)%7);var g=new Date(p);g.setUTCDate(g.getUTCDate()+42),g=g.valueOf();var y=[],b;while(p.valueOf()<g){if(p.getUTCDay()===this.o.weekStart){y.push("<tr>");if(this.o.calendarWeeks){var w=new Date(+p+(this.o.weekStart-p.getUTCDay()-7)%7*864e5),E=new Date(Number(w)+(11-w.getUTCDay())%7*864e5),S=new Date(Number(S=r(E.getUTCFullYear(),0,1))+(11-S.getUTCDay())%7*864e5),x=(E-S)/864e5/7+1;y.push('<td class="cw">'+x+"</td>")}}b=this.getClassNames(p),b.push("day");if(this.o.beforeShowDay!==e.noop){var T=this.o.beforeShowDay(this._utc_to_local(p));T===t?T={}:typeof T=="boolean"?T={enabled:T}:typeof T=="string"&&(T={classes:T}),T.enabled===!1&&b.push("disabled"),T.classes&&(b=b.concat(T.classes.split(/\s+/))),T.tooltip&&(h=T.tooltip)}b=e.unique(b),y.push('<td class="'+b.join(" ")+'"'+(h?' title="'+h+'"':"")+">"+p.getUTCDate()+"</td>"),h=null,p.getUTCDay()===this.o.weekEnd&&y.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(y.join(""));var N=this.picker.find(".datepicker-months").find("th:eq(1)").text(i).end().find("span").removeClass("active");e.each(this.dates,function(e,t){t.getUTCFullYear()===i&&N.eq(t.getUTCMonth()).addClass("active")}),(i<o||i>a)&&N.addClass("disabled"),i===o&&N.slice(0,u).addClass("disabled"),i===a&&N.slice(f+1).addClass("disabled"),y="",i=parseInt(i/10,10)*10;var C=this.picker.find(".datepicker-years").find("th:eq(1)").text(i+"-"+(i+9)).end().find("td");i-=1;var k=e.map(this.dates,function(e){return e.getUTCFullYear()}),L;for(var A=-1;A<11;A++)L=["year"],A===-1?L.push("old"):A===10&&L.push("new"),e.inArray(i,k)!==-1&&L.push("active"),(i<o||i>a)&&L.push("disabled"),y+='<span class="'+L.join(" ")+'">'+i+"</span>",i+=1;C.html(y)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length===1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var u=v.modes[this.viewMode].navStep*(n[0].className==="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn==="linked"?null:"view";this._setDate(a,f);break;case"clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".disabled")||(this.viewDate.setUTCDate(1),n.is(".month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".day")&&!n.is(".disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".old")?s===0?(s=11,i-=1):s-=1:n.is(".new")&&(s===11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e||this.dates.clear();if(this.o.multidate!==1||t!==0)t!==-1?this.dates.remove(t):this.dates.push(e);if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t==="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t==="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t==="date")&&this.hide()},moveMonth:function(e,n){if(!e)return t;if(!n)return e;var r=new Date(e.valueOf()),i=r.getUTCDate(),s=r.getUTCMonth(),o=Math.abs(n),u,a;n=n>0?1:-1;if(o===1){a=n===-1?function(){return r.getUTCMonth()===s}:function(){return r.getUTCMonth()!==u},u=s+n,r.setUTCMonth(u);if(u<0||u>11)u=(u+12)%12}else{for(var f=0;f<o;f++)r=this.moveMonth(r,n);u=r.getUTCMonth(),r.setUTCDate(i),a=function(){return u!==r.getUTCMonth()}}while(a())r.setUTCDate(--i),r.setUTCMonth(u);return r},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode===27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode===37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode===38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(o),t=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i===-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(n){var r=Array.apply(null,arguments);r.shift();var i;return this.each(function(){var s=e(this),o=s.data("datepicker"),c=typeof n=="object"&&n;if(!o){var p=f(this,"date"),d=e.extend({},h,p,c),v=l(d.language),m=e.extend({},h,v,p,c);if(s.is(".input-daterange")||m.inputs){var g={inputs:m.inputs||s.find("input").toArray()};s.data("datepicker",o=new a(this,e.extend(m,g)))}else s.data("datepicker",o=new u(this,m))}if(typeof n=="string"&&typeof o[n]=="function"){i=o[n].apply(o,r);if(i!==t)return!1}}),i!==t?i:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(n,i,s){function w(){var e=this.slice(0,a[c].length),t=a[c].slice(0,e.length);return e===t}if(!n)return t;if(n instanceof Date)return n;typeof i=="string"&&(i=v.parseFormat(i));var o=/([\-+]\d+)([dmwy])/,a=n.match(/([\-+]\d+)([dmwy])/g),f,l,c;if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(n)){n=new Date;for(c=0;c<a.length;c++){f=o.exec(a[c]),l=parseInt(f[1]);switch(f[2]){case"d":n.setUTCDate(n.getUTCDate()+l);break;case"m":n=u.prototype.moveMonth.call(u.prototype,n,l);break;case"w":n.setUTCDate(n.getUTCDate()+l*7);break;case"y":n=u.prototype.moveYear.call(u.prototype,n,l)}}return r(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),0,0,0)}a=n&&n.match(this.nonpunctuation)||[],n=new Date;var h={},p=["yyyy","yy","M","MM","m","mm","d","dd"],m={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!==t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},g,y;m.M=m.MM=m.mm=m.m,m.dd=m.d,n=r(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0);var b=i.parts.slice();a.length!==b.length&&(b=e(b).filter(function(t,n){return e.inArray(n,p)!==-1}).toArray());if(a.length===b.length){var E;for(c=0,E=b.length;c<E;c++){g=parseInt(a[c],10),f=b[c];if(isNaN(g))switch(f){case"MM":y=e(d[s].months).filter(w),g=e.inArray(y[0],d[s].months)+1;break;case"M":y=e(d[s].monthsShort).filter(w),g=e.inArray(y[0],d[s].monthsShort)+1}h[f]=g}var S,x;for(c=0;c<p.length;c++)x=p[c],x in h&&!isNaN(h[x])&&(S=new Date(n),m[x](S,h[x]),isNaN(S)||(n=S))}return n},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,t=[];var s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};v.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery),define("bootstrap-datepicker",function(){}),function(e){e.fn.datepicker.dates.az={days:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə","Bazar"],daysShort:["B.","B.e","Ç.a","Ç.","C.a","C.","Ş.","B."],daysMin:["B.","B.e","Ç.a","Ç.","C.a","C.","Ş.","B."],months:["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],monthsShort:["Yan","Fev","Mar","Apr","May","İyun","İyul","Avq","Sen","Okt","Noy","Dek"],today:"Bu gün",weekStart:1}}(jQuery),define("datepicker-ar",function(){}),function(e){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}(jQuery),define("datepicker-az",function(){}),function(e){e.fn.datepicker.dates.ar={days:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"],daysShort:["أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة","سبت","أحد"],daysMin:["ح","ن","ث","ع","خ","ج","س","ح"],months:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],monthsShort:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],today:"هذا اليوم",rtl:!0}}(jQuery),define("datepicker-bg",function(){}),function(e){e.fn.datepicker.dates.ca={days:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte","Diumenge"],daysShort:["Diu","Dil","Dmt","Dmc","Dij","Div","Dis","Diu"],daysMin:["dg","dl","dt","dc","dj","dv","ds","dg"],months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],monthsShort:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],today:"Avui",clear:"Esborrar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-ca",function(){}),function(e){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes",clear:"Vymazat",weekStart:1,format:"d.m.yyyy"}}(jQuery),define("datepicker-cs",function(){}),function(e){e.fn.datepicker.dates.cy={days:["Sul","Llun","Mawrth","Mercher","Iau","Gwener","Sadwrn","Sul"],daysShort:["Sul","Llu","Maw","Mer","Iau","Gwe","Sad","Sul"],daysMin:["Su","Ll","Ma","Me","Ia","Gwe","Sa","Su"],months:["Ionawr","Chewfror","Mawrth","Ebrill","Mai","Mehefin","Gorfennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"],monthsShort:["Ion","Chw","Maw","Ebr","Mai","Meh","Gor","Aws","Med","Hyd","Tach","Rha"],today:"Heddiw"}}(jQuery),define("datepicker-cy",function(){}),function(e){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}(jQuery),define("datepicker-da",function(){}),function(e){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-de",function(){}),function(e){e.fn.datepicker.dates.el={days:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο","Κυριακή"],daysShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ","Κυρ"],daysMin:["Κυ","Δε","Τρ","Τε","Πε","Πα","Σα","Κυ"],months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],monthsShort:["Ιαν","Φεβ","Μαρ","Απρ","Μάι","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],today:"Σήμερα",clear:"Καθαρισμός",weekStart:1,format:"d/m/yyyy"}}(jQuery),define("datepicker-el",function(){}),function(e){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy",clear:"Borrar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-es",function(){}),function(e){e.fn.datepicker.dates.et={days:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev","Pühapäev"],daysShort:["Pühap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup","Pühap"],daysMin:["P","E","T","K","N","R","L","P"],months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],monthsShort:["Jaan","Veebr","Märts","Apr","Mai","Juuni","Juuli","Aug","Sept","Okt","Nov","Dets"],today:"Täna",clear:"Tühjenda",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-et",function(){}),function(e){e.fn.datepicker.dates.fa={days:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه","یک‌شنبه"],daysShort:["یک","دو","سه","چهار","پنج","جمعه","شنبه","یک"],daysMin:["ی","د","س","چ","پ","ج","ش","ی"],months:["ژانویه","فوریه","مارس","آوریل","مه","ژوئن","ژوئیه","اوت","سپتامبر","اکتبر","نوامبر","دسامبر"],monthsShort:["ژان","فور","مار","آور","مه","ژون","ژوی","اوت","سپت","اکت","نوا","دسا"],today:"امروز",clear:"پاک کن",weekStart:1,format:"yyyy/mm/dd"}}(jQuery),define("datepicker-fa",function(){}),function(e){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}(jQuery),define("datepicker-fi",function(){}),function(e){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-fr",function(){}),function(e){e.fn.datepicker.dates.gl={days:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mér","Xov","Ven","Sáb","Dom"],daysMin:["Do","Lu","Ma","Me","Xo","Ve","Sa","Do"],months:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xuño","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],monthsShort:["Xan","Feb","Mar","Abr","Mai","Xun","Xul","Ago","Sep","Out","Nov","Dec"],today:"Hoxe",clear:"Limpar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-gl",function(){}),function(e){e.fn.datepicker.dates.he={days:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת","ראשון"],daysShort:["א","ב","ג","ד","ה","ו","ש","א"],daysMin:["א","ב","ג","ד","ה","ו","ש","א"],months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],monthsShort:["ינו","פבר","מרץ","אפר","מאי","יונ","יול","אוג","ספט","אוק","נוב","דצמ"],today:"היום",rtl:!0}}(jQuery),define("datepicker-he",function(){}),function(e){e.fn.datepicker.dates.hr={days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota","Nedjelja"],daysShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub","Ned"],daysMin:["Ne","Po","Ut","Sr","Če","Pe","Su","Ne"],months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],monthsShort:["Sij","Velj","Ožu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],today:"Danas"}}(jQuery),define("datepicker-hr",function(){}),function(e){e.fn.datepicker.dates.hu={days:["Vasárnap","Hétfő","Kedd","Szerda","Csütörtök","Péntek","Szombat","Vasárnap"],daysShort:["Vas","Hét","Ked","Sze","Csü","Pén","Szo","Vas"],daysMin:["Va","Hé","Ke","Sz","Cs","Pé","Sz","Va"],months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],monthsShort:["Jan","Feb","Már","Ápr","Máj","Jún","Júl","Aug","Sze","Okt","Nov","Dec"],today:"Ma",weekStart:1,format:"yyyy.mm.dd"}}(jQuery),define("datepicker-hu",function(){}),function(e){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}(jQuery),define("datepicker-id",function(){}),function(e){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}(jQuery),define("datepicker-is",function(){}),function(e){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-it",function(){}),function(e){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd",clear:"クリア"}}(jQuery),define("datepicker-ja",function(){}),function(e){e.fn.datepicker.dates.ka={days:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი","კვირა"],daysShort:["კვი","ორშ","სამ","ოთხ","ხუთ","პარ","შაბ","კვი"],daysMin:["კვ","ორ","სა","ოთ","ხუ","პა","შა","კვ"],months:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომები","ნოემბერი","დეკემბერი"],monthsShort:["იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექ","ოქტ","ნოე","დეკ"],today:"დღეს",clear:"გასუფთავება",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-ka",function(){}),function(e){e.fn.datepicker.dates.kk={days:["Жексенбі","Дүйсенбі","Сейсенбі","Сәрсенбі","Бейсенбі","Жұма","Сенбі","Жексенбі"],daysShort:["Жек","Дүй","Сей","Сәр","Бей","Жұм","Сен","Жек"],daysMin:["Жк","Дс","Сс","Ср","Бс","Жм","Сн","Жк"],months:["Қаңтар","Ақпан","Наурыз","Сәуір","Мамыр","Маусым","Шілде","Тамыз","Қыркүйек","Қазан","Қараша","Желтоқсан"],monthsShort:["Қаң","Ақп","Нау","Сәу","Мамыр","Мау","Шлд","Тмз","Қыр","Қзн","Қар","Жел"],today:"Бүгін",weekStart:1}}(jQuery),define("datepicker-kk",function(){}),function(e){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}(jQuery),define("datepicker-kr",function(){}),function(e){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}(jQuery),define("datepicker-lt",function(){}),function(e){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}(jQuery),define("datepicker-lv",function(){}),function(e){e.fn.datepicker.dates.mk={days:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота","Недела"],daysShort:["Нед","Пон","Вто","Сре","Чет","Пет","Саб","Нед"],daysMin:["Не","По","Вт","Ср","Че","Пе","Са","Не"],months:["Јануари","Февруари","Март","Април","Мај","Јуни","Јули","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Јан","Фев","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Ное","Дек"],today:"Денес",format:"dd.mm.yyyy"}}(jQuery),define("datepicker-mk",function(){}),function(e){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}(jQuery),define("datepicker-ms",function(){}),function(e){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}(jQuery),define("datepicker-nb",function(){}),function(e){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag",clear:"Wissen",weekStart:1,format:"dd-mm-yyyy"}}(jQuery),define("datepicker-nl",function(){}),function(e){e.fn.datepicker.dates["nl-BE"]={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag",clear:"Leegmaken",weekStart:1,format:"dd/mm/yyyy"}}(jQuery),define("datepicker-nl-BE",function(){}),function(e){e.fn.datepicker.dates.no={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I dag",clear:"Nullstill",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-no",function(){}),function(e){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1,clear:"Wyczyść"}}(jQuery),define("datepicker-pl",function(){}),function(e){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}(jQuery),define("datepicker-pt",function(){}),function(e){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}(jQuery),define("datepicker-pt-BR",function(){}),function(e){e.fn.datepicker.dates.ro={days:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă","Duminică"],daysShort:["Dum","Lun","Mar","Mie","Joi","Vin","Sâm","Dum"],daysMin:["Du","Lu","Ma","Mi","Jo","Vi","Sâ","Du"],months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],monthsShort:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov","Dec"],today:"Astăzi",clear:"Șterge",weekStart:1}}(jQuery),define("datepicker-ro",function(){}),function(e){e.fn.datepicker.dates.rs={days:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота","Недеља"],daysShort:["Нед","Пон","Уто","Сре","Чет","Пет","Суб","Нед"],daysMin:["Н","По","У","Ср","Ч","Пе","Су","Н"],months:["Јануар","Фебруар","Март","Април","Мај","Јун","Јул","Август","Септембар","Октобар","Новембар","Децембар"],monthsShort:["Јан","Феб","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Нов","Дец"],today:"Данас",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-rs",function(){}),function(e){e.fn.datepicker.dates["rs-latin"]={days:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota","Nedelja"],daysShort:["Ned","Pon","Uto","Sre","Čet","Pet","Sub","Ned"],daysMin:["N","Po","U","Sr","Č","Pe","Su","N"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,format:"dd.mm.yyyy"}}(jQuery),define("datepicker-rs-latin",function(){}),function(e){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",format:"dd.mm.yyyy",weekStart:1}}(jQuery),define("datepicker-ru",function(){}),function(e){e.fn.datepicker.dates.sk={days:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota","Nedeľa"],daysShort:["Ned","Pon","Uto","Str","Štv","Pia","Sob","Ned"],daysMin:["Ne","Po","Ut","St","Št","Pia","So","Ne"],months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],today:"Dnes"}}(jQuery),define("datepicker-sk",function(){}),function(e){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}(jQuery),define("datepicker-sl",function(){}),function(e){e.fn.datepicker.dates.sq={days:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë","E Diel"],daysShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu","Die"],daysMin:["Di","Hë","Ma","Më","En","Pr","Sht","Di"],months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],monthsShort:["Jan","Shk","Mar","Pri","Maj","Qer","Korr","Gu","Sht","Tet","Nën","Dhjet"],today:"Sot"}}(jQuery),define("datepicker-sq",function(){}),function(e){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Idag",format:"yyyy-mm-dd",weekStart:1,clear:"Rensa"}}(jQuery),define("datepicker-sv",function(){}),function(e){e.fn.datepicker.dates.sw={days:["Jumapili","Jumatatu","Jumanne","Jumatano","Alhamisi","Ijumaa","Jumamosi","Jumapili"],daysShort:["J2","J3","J4","J5","Alh","Ij","J1","J2"],daysMin:["2","3","4","5","A","I","1","2"],months:["Januari","Februari","Machi","Aprili","Mei","Juni","Julai","Agosti","Septemba","Oktoba","Novemba","Desemba"],monthsShort:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ago","Sep","Okt","Nov","Des"],today:"Leo"}}(jQuery),define("datepicker-sw",function(){}),function(e){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}(jQuery),define("datepicker-th",function(){}),function(e){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}(jQuery),define("datepicker-tr",function(){}),function(e){e.fn.datepicker.dates.vi={days:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy","Chủ nhật"],daysShort:["CN","Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7","CN"],daysMin:["CN","T2","T3","T4","T5","T6","T7","CN"],months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],monthsShort:["Th1","Th2","Th3","Th4","Th5","Th6","Th7","Th8","Th9","Th10","Th11","Th12"],today:"Hôm nay",clear:"Xóa",format:"dd/mm/yyyy"}}(jQuery),define("datepicker-vi",function(){}),function(e){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1,clear:"清空"}}(jQuery),define("datepicker-zh-CN",function(){}),function(e){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}(jQuery),define("datepicker-zh-TW",function(){}),function(){"use strict";require.config({paths:{"bootstrap-datepicker":"bower_components/bootstrap-datepicker/bootstrap-datepicker","datepicker-az":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.az","datepicker-bg":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.bg","datepicker-ar":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ar","datepicker-ca":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ca","datepicker-cs":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.cs","datepicker-cy":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.cy","datepicker-da":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.da","datepicker-de":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.de","datepicker-el":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.el","datepicker-es":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.es","datepicker-et":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.et","datepicker-sq":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sq","datepicker-fa":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.fa","datepicker-fi":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.fi","datepicker-fr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.fr","datepicker-gl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.gl","datepicker-he":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.he","datepicker-hr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.hr","datepicker-hu":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.hu","datepicker-id":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.id","datepicker-is":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.is","datepicker-it":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.it","datepicker-ja":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ja","datepicker-ka":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ka","datepicker-kk":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.kk","datepicker-kr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.kr","datepicker-lt":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.lt","datepicker-lv":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.lv","datepicker-mk":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.mk","datepicker-ms":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ms","datepicker-nb":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.nb","datepicker-nl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.nl","datepicker-nl-BE":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE","datepicker-no":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.no","datepicker-pl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.pl","datepicker-pt":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.pt","datepicker-pt-BR":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR","datepicker-ro":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ro","datepicker-rs":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.rs","datepicker-rs-latin":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin","datepicker-ru":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.ru","datepicker-sk":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sk","datepicker-sl":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sl","datepicker-sv":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sv","datepicker-sw":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.sw","datepicker-th":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.th","datepicker-tr":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.tr","datepicker-vi":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.vi","datepicker-zh-CN":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN","datepicker-zh-TW":"bower_components/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW"},shim:{"datepicker-az":{deps:["bootstrap-datepicker"]},"datepicker-bg":{deps:["bootstrap-datepicker"]},"datepicker-ar":{deps:["bootstrap-datepicker"]},"datepicker-ca":{deps:["bootstrap-datepicker"]},"datepicker-cs":{deps:["bootstrap-datepicker"]},"datepicker-cy":{deps:["bootstrap-datepicker"]},"datepicker-da":{deps:["bootstrap-datepicker"]},"datepicker-de":{deps:["bootstrap-datepicker"]},"datepicker-el":{deps:["bootstrap-datepicker"]},"datepicker-es":{deps:["bootstrap-datepicker"]},"datepicker-et":{deps:["bootstrap-datepicker"]},"datepicker-sq":{deps:["bootstrap-datepicker"]},"datepicker-fa":{deps:["bootstrap-datepicker"]},"datepicker-fi":{deps:["bootstrap-datepicker"]},"datepicker-fr":{deps:["bootstrap-datepicker"]},"datepicker-gl":{deps:["bootstrap-datepicker"]},"datepicker-he":{deps:["bootstrap-datepicker"]},"datepicker-hr":{deps:["bootstrap-datepicker"]},"datepicker-hu":{deps:["bootstrap-datepicker"]},"datepicker-id":{deps:["bootstrap-datepicker"]},"datepicker-is":{deps:["bootstrap-datepicker"]},"datepicker-it":{deps:["bootstrap-datepicker"]},"datepicker-ja":{deps:["bootstrap-datepicker"]},"datepicker-ka":{deps:["bootstrap-datepicker"]},"datepicker-kk":{deps:["bootstrap-datepicker"]},"datepicker-kr":{deps:["bootstrap-datepicker"]},"datepicker-lt":{deps:["bootstrap-datepicker"]},"datepicker-lv":{deps:["bootstrap-datepicker"]},"datepicker-mk":{deps:["bootstrap-datepicker"]},"datepicker-ms":{deps:["bootstrap-datepicker"]},"datepicker-nb":{deps:["bootstrap-datepicker"]},"datepicker-nl":{deps:["bootstrap-datepicker"]},"datepicker-nl-BE":{deps:["bootstrap-datepicker"]},"datepicker-no":{deps:["bootstrap-datepicker"]},"datepicker-pl":{deps:["bootstrap-datepicker"]},"datepicker-pt":{deps:["bootstrap-datepicker"]},"datepicker-pt-BR":{deps:["bootstrap-datepicker"]},"datepicker-ro":{deps:["bootstrap-datepicker"]},"datepicker-rs":{deps:["bootstrap-datepicker"]},"datepicker-rs-latin":{deps:["bootstrap-datepicker"]},"datepicker-ru":{deps:["bootstrap-datepicker"]},"datepicker-sk":{deps:["bootstrap-datepicker"]},"datepicker-sl":{deps:["bootstrap-datepicker"]},"datepicker-sv":{deps:["bootstrap-datepicker"]},"datepicker-sw":{deps:["bootstrap-datepicker"]},"datepicker-th":{deps:["bootstrap-datepicker"]},"datepicker-tr":{deps:["bootstrap-datepicker"]},"datepicker-vi":{deps:["bootstrap-datepicker"]},"datepicker-zh-CN":{deps:["bootstrap-datepicker"]},"datepicker-zh-TW":{deps:["bootstrap-datepicker"]}}}),define("husky_extensions/datepicker",["bootstrap-datepicker","datepicker-ar","datepicker-az","datepicker-bg","datepicker-ca","datepicker-cs","datepicker-cy","datepicker-da","datepicker-de","datepicker-el","datepicker-es","datepicker-et","datepicker-fa","datepicker-fi","datepicker-fr","datepicker-gl","datepicker-he","datepicker-hr","datepicker-hu","datepicker-id","datepicker-is","datepicker-it","datepicker-ja","datepicker-ka","datepicker-kk","datepicker-kr","datepicker-lt","datepicker-lv","datepicker-mk","datepicker-ms","datepicker-nb","datepicker-nl","datepicker-nl-BE","datepicker-no","datepicker-pl","datepicker-pt","datepicker-pt-BR","datepicker-ro","datepicker-rs","datepicker-rs-latin","datepicker-ru","datepicker-sk","datepicker-sl","datepicker-sq","datepicker-sv","datepicker-sw","datepicker-th","datepicker-tr","datepicker-vi","datepicker-zh-CN","datepicker-zh-TW"],{name:"bootstrap-datepicker",initialize:function(e){e.sandbox.datepicker={init:function(t,n){var r={format:e.sandbox.globalize.getDatePattern().toLowerCase(),language:e.sandbox.globalize.getLocale(),autoclose:!0};return r=e.sandbox.util.extend(!0,{},r,n),e.core.dom.$(t).datepicker(r)},setValue:function(t,n){return e.core.dom.$(t).datepicker("update",n)},getUTCDate:function(t){return e.core.dom.$(t).datepicker("getUTCDate")},getDate:function(t){return e.core.dom.$(t).datepicker("getDate")},setUTCDate:function(t,n){return e.core.dom.$(t).datepicker("setUTCDate",n)},setDate:function(t,n){return e.core.dom.$(t).datepicker("setDate",n)}}}})}(),function(){"use strict";require.config({paths:{dropzone:"bower_components/dropzone/dropzone"},shim:{dropzone:{exports:"Dropzone",deps:["jquery"]}}}),define("husky_extensions/dropzone",["dropzone"],function(e){return{name:"dropzone",initialize:function(t){e.confirm=function(e,t){t()},t.sandbox.dropzone={initialize:function(e,n){return t.core.dom.$(e).dropzone(n)}}}}})}(),function(){"use strict";require.config({paths:{globalize_lib:"bower_components/globalize/lib/globalize",cultures:"bower_components/globalize/lib/cultures"}}),define("husky_extensions/globalize",["globalize_lib"],function(){var e=function(e){return e=e.replace("_","-"),e.indexOf("-")>-1&&(e=e.substring(0,e.indexOf("-"))+e.substring(e.indexOf("-"),e.length).toUpperCase()),e},t=function(e){!e.config.culture||(e.config.culture.messages||(e.config.culture.messages={}),e.loadLanguage(e.config.culture.name).then(function(){e.setLanguage(e.config.culture.name,e.config.culture.messages,e.config.culture.defaultMessages)})),e.sandbox.globalize.setCurrency("")};return{name:"husky-validation",initialize:function(n){n.sandbox.globalize={addCultureInfo:function(t,n){t=e(t),Globalize.addCultureInfo(t,{messages:n})},getLocale:function(){return Globalize.culture().name},getDatePattern:function(){return Globalize.culture().calendar.patterns.d},getTimePatter:function(){return Globalize.culture().calendar.patterns.t},setCurrency:function(e){Globalize.culture().numberFormat.currency.symbol=e}},n.sandbox.translate=function(e){var t;if(!n.config.culture||!Globalize.culture().name)return e;try{t=Globalize.localize(e,Globalize.culture().name)}catch(r){return n.logger.warn('Globalize threw an error when translating key "'+e+'", failling back to key. Error: '+r),e}return!t&&t!==""?e:t},n.sandbox.date={format:function(e,t){var n,r;return typeof e=="string"&&(e=this.parse(e)),n=Globalize.format(e,Globalize.culture().calendar.patterns.d),t===!0&&(r=Globalize.format(e,Globalize.culture().calendar.patterns.t)),(n?n:"")+(!n||!r?"":" ")+(r?r:"")},parse:function(e){var t=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})([0-9]{2}))?/,n=t.exec(e),r,i,s;return n?(i=Date.UTC(parseInt(n[1]),parseInt(n[2])-1,parseInt(n[3]),parseInt(n[4]),parseInt(n[5]),n[6]&&parseInt(n[6])||0,n[7]&&parseFloat(n[7])*1e3||0),n[9]&&n[10]&&(s=parseInt(n[9])*60+parseInt(n[10]),i+=(n[8]==="+"?-1:1)*s*6e4),r=new Date(i)):r=null,r}},n.sandbox.translateArray=function(e){var t=[];return n.sandbox.util.foreach(e,function(e){t.push(n.sandbox.translate(e))}.bind(this)),t},n.sandbox.numberFormat=function(e,t){return Globalize.format(e,t)},n.sandbox.parseFloat=function(e,t,n){return Globalize.parseFloat(e,t,n)},n.setLanguage=function(t,r,i){t=e(t),Globalize.culture(t),n.sandbox.globalize.addCultureInfo(t,r),n.sandbox.globalize.addCultureInfo("default",i)},n.loadLanguage=function(t){var n=$.Deferred();return t=e(t),t!=="en"?require(["cultures/globalize.culture."+t],function(){n.resolve()}):n.resolve(),n.promise()},t(n)}}})}(),function(){"use strict";require.config({paths:{jquery:"bower_components/jquery/jquery","html.sortable":"bower_components/html.sortable/html.sortable"},shim:{jquery:{exports:"$"},html5sortable:{deps:["jquery"],exports:"jQuery.fn.sortable"}}}),define("husky_extensions/html.sortable",["html.sortable"],function(){return{name:"html.sortable",initialize:function(e){e.core.dom.sortable=function(e,t){return $(e).sortable(t)}}}})}(),function(){"use strict";require.config({paths:{form:"bower_components/husky-validation/dist/validation"}}),define("husky_extensions/husky-validation",["form"],function(e){return{name:"husky-validation",initialize:function(t){t.sandbox.form={create:function(t,n){return new e($(t),n)},getObject:function(e){return $(e).data("form-object")},validate:function(e,n){return $(e).length===0?!1:(n||(n=!1),t.sandbox.form.getObject(e).validation.validate(n))},isValid:function(e){return t.sandbox.form.getObject(e).validation.isValid()},addField:function(e,n){return t.sandbox.form.getObject(e).addField(n)},removeField:function(e,n){return t.sandbox.form.getObject(e).removeField(n)},addConstraint:function(e,n,r,i){t.sandbox.form.getObject(e).validation.addConstraint(n,r,i)},updateConstraint:function(e,n,r,i){t.sandbox.form.getObject(e).validation.updateConstraint(n,r,i)},deleteConstraint:function(e,n,r){t.sandbox.form.getObject(e).validation.deleteConstraint(n,r)},setData:function(e,n){return t.sandbox.form.getObject(e).mapper.setData(n)},getData:function(e,n,r){return t.sandbox.form.getObject(e).mapper.getData(r,n)},addToCollection:function(e,n,r,i){return t.sandbox.form.getObject(e).mapper.addToCollection(n,r,i)},editInCollection:function(e,n,r){return t.sandbox.form.getObject(e).mapper.editInCollection(n,r)},removeFromCollection:function(e,n){return t.sandbox.form.getObject(e).mapper.removeFromCollection(n)},addCollectionFilter:function(e,n,r){t.sandbox.form.getObject(e).mapper.addCollectionFilter(n,r)},removeCollectionFilter:function(e,n){t.sandbox.form.getObject(e).mapper.removeCollectionFilter(n)},element:{getObject:function(e){return $(e).data("element")},validate:function(e,n){return t.sandbox.form.element.getObject(e).validate(n)},addConstraint:function(e,n,r){t.sandbox.form.element.getObject(e).addConstraint(n,r)},updateConstraint:function(e,n,r){t.sandbox.form.element.getObject(e).updateConstraint(n,r)},deleteConstraint:function(e,n){t.sandbox.form.element.getObject(e).deleteConstraint(n)},hasConstraint:function(e,n){return t.sandbox.form.element.getObject(e).hasConstraint(n)},getConstraint:function(e,n){return t.sandbox.form.element.getObject(e).getConstraint(n)},setValue:function(e,n){t.sandbox.form.element.getObject(e).setValue(n)},getValue:function(e){return t.sandbox.form.element.getObject(e).getValue()}}}}}})}(),function(){"use strict";define("husky_extensions/infinite-scroll",[],function(){var e=null,t=function(t,r,i){$(t).data("blocked")||(!e||clearTimeout(e),e=setTimeout(n.bind(this,t,r,i),50))},n=function(e,t,n){var r=$(e),i=r[0].clientHeight,s=r[0].scrollHeight,o=r.scrollTop(),u=isNaN(t)?0:t;if(i+o+u-s>=0){r.data("blocked",!0);var a=n();!a||!a.then?$(e).removeData("blocked"):a.then(function(){$(e).removeData("blocked")})}};return{name:"infinite-scroll",initialize:function(e){e.sandbox.infiniteScroll={initialize:function(n,r,i){e.sandbox.dom.on(n,"scroll.infinite",function(){t(n,i,r)})},destroy:function(t){e.sandbox.dom.off(t,"scroll.infinite")}}}}})}(),define("husky_extensions/itembox",[],function(){"use strict";var e={instanceName:null,url:null,eventNamespace:"husky.itembox",idsParameter:"ids",resultKey:null,idKey:"id",dataAttribute:"",dataDefault:{},sortable:!0,removable:!0,hideAddButton:!1,hidePositionElement:!1,hideConfigButton:!1,hideSelectedCounter:!1,defaultDisplayOption:"top",actionIcon:"fa-plus-circle",displayOptions:{leftTop:!0,top:!0,rightTop:!0,left:!0,middle:!0,right:!0,leftBottom:!0,bottom:!0,rightBottom:!0},translations:{noContentSelected:"listbox.nocontent-selected",viewLess:"public.view-less",of:"public.of",visible:"public.visible",elementsSelected:"public.elements-selected"}},t={displayOptionSelectedClass:"selected",itemInvisibleClass:"invisible-item",noContentClass:"no-content",isLoadingClass:"is-loading"},n=function(e){return[this.options.eventNamespace,".",this.options.instanceName?this.options.instanceName+".":"",e].join("")},r={skeleton:function(){return['<div class="white-box form-element" id="',this.ids.container,'">','    <div class="header">','        <span class="',this.options.actionIcon," icon left action",this.options.hideAddButton?" hidden":"",'" id="',this.ids.addButton,'"></span>','        <span class="selected-counter',this.options.hideSelectedCounter?" hidden":"",'">','            <span class="num">0</span><span> ',this.sandbox.translate(this.options.translations.elementsSelected),"</span>","        </span>",'        <span class="fa-cog icon right border',this.options.hideConfigButton?" hidden":"",'" id="',this.ids.configButton,'"></span>','        <span class="no-content-message">',this.sandbox.translate(this.options.translations.noContentSelected),"</span>",'        <div class="position',this.options.hidePositionElement?" hidden":"",'">','            <div class="husky-position" id="',this.ids.displayOption,'">','                <div class="top left ',this.options.displayOptions.leftTop?"":"inactive",'" data-position="leftTop"></div>','                <div class="top middle ',this.options.displayOptions.top?"":"inactive",'" data-position="top"></div>','                <div class="top right ',this.options.displayOptions.rightTop?"":"inactive",'" data-position="rightTop"></div>','                <div class="middle left ',this.options.displayOptions.left?"":"inactive",'" data-position="left"></div>','                <div class="middle middle ',this.options.displayOptions.middle?"":"inactive",'" data-position="middle"></div>','                <div class="middle right ',this.options.displayOptions.right?"":"inactive",'" data-position="right"></div>','                <div class="bottom left ',this.options.displayOptions.leftBottom?"":"inactive",'" data-position="leftBottom"></div>','                <div class="bottom middle ',this.options.displayOptions.bottom?"":"inactive",'" data-position="bottom"></div>','                <div class="bottom right ',this.options.displayOptions.rightBottom?"":"inactive",'" data-position="rightBottom"></div>',"            </div>","        </div>","    </div>",'    <div class="content" id="',this.ids.content,'"></div>',"</div>"].join("")},item:function(e,t){return['<li data-id="',e,'">',this.options.sortable?'    <span class="fa-ellipsis-v icon move"></span>':"",'    <span class="num"></span>','    <div class="item-content">'+t+"</div>",this.options.removable?'    <span class="fa-times remove"></span>':"","</li>"].join("")}},i=function(){this.sandbox.on(this.DATA_CHANGED(),this.changeData.bind(this)),this.sandbox.on(this.DATA_RETRIEVED(),this.renderContent.bind(this))},s=function(){this.sandbox.dom.on(this.getId("displayOption")+" > div:not(.inactive)","click",this.changeDisplayOption.bind(this)),this.sandbox.dom.on(this.$addButton,"click",function(){this.sandbox.emit(this.ADD_BUTTON_CLICKED())}.bind(this)),this.sandbox.dom.on(this.$configButton,"click",function(){this.sandbox.emit(this.CONFIG_BUTTON_CLICKED())}.bind(this)),this.sandbox.dom.on(this.getId("content"),"click",this.removeItem.bind(this),"li .remove")},o=function(){var e=this.sandbox.dom.find(".sortable",this.$el),t;this.sandbox.dom.sortable(e,"destroy"),t=this.sandbox.dom.sortable(".sortable",{handle:".move",forcePlaceholderSize:!0}),this.sandbox.dom.unbind(t,"unbind"),t.bind("sortupdate",function(){var e=this.updateOrder();this.sortHandler(e)}.bind(this))},u=function(){return this.sandbox.dom.createElement('<ul class="items-list sortable"/>')},a={DATA_CHANGED:function(){return n.call(this,"data-changed")},DATA_RETRIEVED:function(){return n.call(this,"data-retrieved")},DISPLAY_OPTION_CHANGED:function(){return n.call(this,"display-position-changed")},ADD_BUTTON_CLICKED:function(){return n.call(this,"add-button-clicked")},CONFIG_BUTTON_CLICKED:function(){return n.call(this,"config-button-clicked")},render:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),!this.options.defaultDisplayOption||(this.options.dataDefault.displayOption=this.options.defaultDisplayOption);var t=this.getData();this.ids={container:"listbox-"+this.options.instanceName+"-container",addButton:"listbox-"+this.options.instanceName+"-add",configButton:"listbox-"+this.options.instanceName+"-config",displayOption:"listbox-"+this.options.instanceName+"-display-option",content:"listbox-"+this.options.instanceName+"-content"},this.sandbox.dom.html(this.$el,r.skeleton.call(this)),this.$container=this.sandbox.dom.find(this.getId("container"),this.$el),this.$addButton=this.sandbox.dom.find(this.getId("addButton"),this.$el),this.$configButton=this.sandbox.dom.find(this.getId("configButton"),this.$el),this.$content=this.sandbox.dom.find(this.getId("content"),this.$el),this.$list=null,this.addNoContentClass(),this.isDataEmpty(t)?this.sandbox.dom.data(this.$el,this.options.dataAttribute,this.options.dataDefault):this.loadContent(t),this.setDisplayOption(this.options.defaultDisplayOption),this.startLoader(),i.call(this),s.call(this)},addNoContentClass:function(){this.$list=null,this.sandbox.dom.addClass(this.$container,t.noContentClass)},removeNoContentClass:function(){this.sandbox.dom.removeClass(this.$container,t.noContentClass)},getData:function(){return this.sandbox.util.deepCopy(this.sandbox.dom.data(this.$el,this.options.dataAttribute))},setData:function(e,t){var n=this.sandbox.dom.data(this.$el,this.options.dataAttribute);t=typeof t=="undefined"?!0:t,this.sandbox.util.isEqual(n,e)||this.sandbox.emit(this.DATA_CHANGED(),e,this.$el,t)},changeData:function(e,t,n){this.sandbox.dom.data(this.$el,this.options.dataAttribute,e),!n||this.loadContent(e)},updateVisibility:function(){!this.$list||!this.$list.find("li").length?this.addNoContentClass():this.removeNoContentClass()},loadContent:function(e){this.$container.addClass(t.isLoadingClass),!!e&&(!e.length||e.length>0)?this.sandbox.util.load(this.getUrl(e)).then(function(e){this.$container.removeClass(t.isLoadingClass),this.sandbox.emit(this.DATA_RETRIEVED(),e._embedded[this.options.resultKey])}.bind(this)).fail(function(e){this.sandbox.logger.error(e)}.bind(this)):(this.$container.removeClass(t.isLoadingClass),this.sandbox.emit(this.DATA_RETRIEVED(),[]))},renderContent:function(e){if(e.length>0){var t=e.length;this.$list=u.call(this);for(var n=-1;++n<t;)this.addItem(e[n],!1,!1);this.sandbox.dom.html(this.$content,this.$list),o.call(this),this.updateOrder(),this.updateSelectedCounter(),this.updateVisibility()}else this.$list&&this.$list.children().remove(),this.addNoContentClass()},startLoader:function(){var e=this.sandbox.dom.createElement('<div class="loader"/>');this.sandbox.dom.append(this.$container.find(".header"),e),this.sandbox.start([{name:"loader@husky",options:{el:e,size:"20px",color:"#999999"}}])},setDisplayOption:function(e){var n=this.sandbox.dom.find('[data-position="'+e+'"]',this.$container);this.sandbox.dom.removeClass(this.sandbox.dom.find("."+t.displayOptionSelectedClass,this.getId("displayOption")),t.displayOptionSelectedClass),this.sandbox.dom.addClass(n,t.displayOptionSelectedClass)},changeDisplayOption:function(e){var t=this.sandbox.dom.data(e.currentTarget,"position");this.setDisplayOption(t),this.sandbox.emit(this.DISPLAY_OPTION_CHANGED(),t)},updateOrder:function(){var e=this.sandbox.dom.find("li",this.$content),t=[];return this.sandbox.util.foreach(e,function(e,n){var r=this.sandbox.dom.find(".num",e);r.html(n+1),t.push(this.sandbox.dom.data(e,"id"))}.bind(this)),t},updateSelectedCounter:function(){var e=this.$content.find("li").length;this.$find(".selected-counter .num").html(e)},addItem:function(e,t,n){typeof t=="undefined"&&(t=!0),typeof n=="undefined"&&(n=!0),this.$list||(this.$list=u.call(this),this.sandbox.dom.html(this.$content,this.$list));var i=this.sandbox.dom.createElement(r.item.call(this,e[this.options.idKey],this.getItemContent(e)));this.sandbox.dom.append(this.$list,i),!t||(this.options.sortable&&o.call(this),this.updateOrder(),this.updateVisibility(),this.updateSelectedCounter()),!n||this.sandbox.dom.scrollAnimate(this.$content.get(0).scrollHeight,this.$content)},removeItemById:function(e){var t=this.sandbox.dom.find("li[data-id="+e+"]",this.$el);this.sandbox.dom.remove(t),this.removeHandler(e),this.updateOrder(),this.updateVisibility(),this.updateSelectedCounter()},removeItem:function(e){var t=this.sandbox.dom.parents(e.currentTarget,"li"),n=this.sandbox.dom.data(t,"id");this.sandbox.dom.remove(t),this.removeHandler(n),this.updateOrder(),this.updateVisibility(),this.updateSelectedCounter()},isDataEmpty:function(e){return this.sandbox.util.isEmpty(e)},getId:function(e){return["#",this.ids[e]].join("")},getUrl:function(e){throw new Error('"getUrl" not implemented')},getItemContent:function(e){throw new Error('"getItemContent" not implemented')},sortHandler:function(e){throw new Error('"sortHandler" not implemented')},removeHandler:function(e){throw new Error('"removeHandler" not implemented')}};return{name:"itembox",initialize:function(e){e.components.addType("itembox",a)}}}),define("husky_extensions/itemgrid",[],function(){"use strict";var e={instanceName:null,url:null,eventNamespace:"husky.itemgrid",idsParameter:"ids",resultKey:null,idKey:"id",dataAttribute:"",dataDefault:{},sortable:!1,removable:!0,translations:{noContentSelected:"listbox.nocontent-selected",viewAll:"public.view-all",viewLess:"public.view-less",of:"public.of",visible:"public.visible",elementsSelected:"public.elements-selected"}},t={noContentClass:"no-content",addIcon:"fa-plus-circle",deleteIcon:"fa-trash-o"},n=function(e){return[this.options.eventNamespace,".",this.options.instanceName?this.options.instanceName+".":"",e].join("")},r={skeleton:function(){return['<div class="listgrid" id="',this.ids.container,'">','    <div class="header">','        <span class="',t.addIcon,' icon left action add-button" id="',this.ids.addButton,'"></span>','        <span class="',t.deleteIcon,' icon left action delete-button" id="',this.ids.deleteButton,'"></span>',"    </div>",'    <div class="content" id="',this.ids.content,'"></div>',"</div>"].join("")}},i=function(){this.sandbox.on(this.DATA_CHANGED(),this.changeData.bind(this)),this.sandbox.on(this.DELETE_BUTTON_CLICKED(),function(){this.sandbox.emit("husky.datagrid."+this.options.instanceName+".items.get-selected",function(e){a.call(this,e)}.bind(this))}.bind(this)),this.sandbox.on(this.ITEM_ADD(),function(e){o.call(this,e)}.bind(this)),this.sandbox.on(this.ITEM_SAVE(),function(e){u.call(this,e)}.bind(this))},s=function(){this.sandbox.dom.on(this.$addButton,"click",function(){this.sandbox.emit(this.ADD_BUTTON_CLICKED())}.bind(this)),this.sandbox.dom.on(this.$deleteButton,"click",function(){this.sandbox.emit(this.DELETE_BUTTON_CLICKED())}.bind(this))},o=function(e){var t=this.getData();if(this.sandbox.util.typeOf(t)!=="array"||this.sandbox.util.typeOf(t[0])!=="object")t=[];t.push(e),this.setData(t)},u=function(e){var t=[],n=this.getData();n.forEach(function(n){n.id===e.id?t.push(e):t.push(n)}.bind(this)),this.setData(t)},a=function(e){this.sandbox.sulu.showDeleteDialog(function(t){if(t){var n=[],r=this.getData();r.forEach(function(t){e.indexOf(t.id)>-1?(this.sandbox.emit("husky.datagrid."+this.options.instanceName+".record.remove",t.id),this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1)):n.push(t)}.bind(this)),this.setData(n)}}.bind(this))},f={DATA_CHANGED:function(){return n.call(this,"data-changed")},ADD_BUTTON_CLICKED:function(){return n.call(this,"add-button-clicked")},DELETE_BUTTON_CLICKED:function(){return n.call(this,"delete-button-clicked")},ITEM_ADD:function(){return n.call(this,"add-item")},ITEM_SAVE:function(){return n.call(this,"save-item")},render:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options);var t=this.getData();this.viewAll=!0,this.ids={container:"listbox-"+this.options.instanceName+"-container",addButton:"listbox-"+this.options.instanceName+"-add",deleteButton:"listbox-"+this.options.instanceName+"-delete",content:"listbox-"+this.options.instanceName+"-content"},this.sandbox.dom.html(this.$el,r.skeleton.call(this)),this.$container=this.sandbox.dom.find(this.getId("container"),this.$el),this.$addButton=this.sandbox.dom.find(this.getId("addButton"),this.$el),this.$deleteButton=this.sandbox.dom.find(this.getId("deleteButton"),this.$el),this.$content=this.sandbox.dom.find(this.getId("content"),this.$el),i.call(this),s.call(this),this.renderContent(t)},getData:function(){return this.sandbox.util.deepCopy(this.sandbox.dom.data(this.$el,this.options.dataAttribute))},setData:function(e,t){this.sandbox.emit(this.DATA_CHANGED(),e,this.$el,t)},changeData:function(e){this.updateOrder(e),this.sandbox.emit("husky.datagrid."+this.options.instanceName+".data.set",e),this.sandbox.dom.data(this.$el,this.options.dataAttribute,e),this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1)},updateOrder:function(e){throw new Error('"updateOrder" not implemented')},editItem:function(e,t){throw new Error('"editItem" not implemented')},getId:function(e){return["#",this.ids[e]].join("")},renderContent:function(e){var t=['<div id="',this.options.instanceName,'-list-toolbar-container"></div>','<div id="itemgrid-list-',this.options.instanceName,'"></div>'].join("");this.sandbox.dom.html(this.$content,t),this.sandbox.start([{name:"datagrid@husky",options:{el:"#itemgrid-list-"+this.options.instanceName,instanceName:this.options.instanceName,view:"table",data:e,matchings:this.options.fieldList,viewOptions:{table:{noItemsText:"public.empty-list"}},actionCallback:function(e,t){this.editItem.call(this,e,t)}.bind(this)}}])}};return{name:"itemgrid",initialize:function(e){e.components.addType("itemgrid",f)}}}),function(){"use strict";window.jQuery?define("jquery",[],function(){return window.jQuery}):require.config({paths:{backbone:"bower_components/jquery/jquery"},shim:{backbone:{exports:"$"}}});var e=function(){var e=new $.Event("remove"),t=$.fn.remove;$.fn.remove=function(){return $(this).trigger(e),t.apply(this,arguments)}};define("husky_extensions/jquery",["jquery"],{name:"jQuery",initialize:function(t){e(),t.core.dom.window=window,t.core.dom.$window=$(window),t.core.dom.document=document,t.core.dom.$document=$(document),t.core.dom.$=$,t.core.dom.createElement=function(e,t){return t=t||{},$(e,t)},t.core.dom.html=function(e,t){return typeof t!="undefined"?$(e).html(t):$(e).html()},t.core.dom.outerHTML=function(e){return $(e).wrapAll("<div></div>").parent().html()},t.core.dom.parseHTML=function(e){return $.parseHTML(e)},t.core.dom.each=function(e,t){$(e).each(t)},t.core.dom.append=function(e,t){return $(e).append(t)},t.core.dom.prepend=function(e,t){return $(e).prepend(t)},t.core.dom.before=function(e,t){return $(e).before(t)},t.core.dom.after=function(e,t){return $(e).after(t)},t.core.dom.css=function(e,t,n){return typeof n!="undefined"?$(e).css(t,n):$(e).css(t)},t.core.dom.addClass=function(e,t){return $(e).addClass(t)},t.core.dom.removeClass=function(e,t){return t?$(e).removeClass(t):$(e).removeClass()},t.core.dom.toggleClass=function(e,t){return $(e).toggleClass(t)},t.core.dom.hasClass=function(e,t){return $(e).hasClass(t)},t.core.dom.prependClass=function(e,t){var n=$(e),r=n.attr("class");t=t+" "+r,n.attr("class",t)},t.core.dom.parent=function(e,t){return $(e).parent(t)},t.core.dom.width=function(e,t){return typeof t!="undefined"?$(e).width(t):$(e).width()},t.core.dom.outerWidth=function(e){return $(e).outerWidth()},t.core.dom.height=function(e,t){return typeof t=="undefined"?$(e).height():$(e).height(t)},t.core.dom.outerHeight=function(e,t){return typeof t=="undefined"?$(e).outerHeight():$(e).outerHeight(t)},t.core.dom.outerWidth=function(e,t){return typeof t=="undefined"?$(e).outerWidth():$(e).outerWidth(t)},t.core.dom.offset=function(e,t){return t?$(e).offset(t):$(e).offset()},t.core.dom.position=function(e){return $(e).position()},t.core.dom.remove=function(e,t){return $(e).remove(t)},t.core.dom.detach=function(e,t){return $(e).detach(t)},t.core.dom.attr=function(e,t,n){return typeof n=="undefined"?(t=t||{},$(e).attr(t)):$(e).attr(t,n)},t.core.dom.removeAttr=function(e,t){return $(e).removeAttr(t)},t.core.dom.is=function(e,t){return $(e).is(t)},t.core.dom.filter=function(e,t){return $(e).filter(t)},t.core.dom.isArray=function(e){return $.isArray(e)},t.core.dom.isNumeric=function(e){return $.isNumeric(e)},t.core.dom.data=function(e,t,n){return!n&&n!==""?$(e).data(t):$(e).data(t,n)},t.core.dom.onReady=function(e){$(window).on("load",e)},t.core.dom.val=function(e,t){return!t&&t!==""?$(e).val():$(e).val(t)},t.core.dom.clearVal=function(e){return $(e).val("")},t.core.dom.blur=function(e){return $(e).blur()},t.core.dom.on=function(e,t,n,r){r?$(e).on(t,r,n):$(e).on(t,n)},t.core.dom.one=function(e,t,n,r){r?$(e).one(t,r,n):$(e).one(t,n)},t.core.dom.off=function(e,t,n,r){r?$(e).off(t,r,n):$(e).off(t,n)},t.core.dom.trigger=function(e,t,n){$(e).trigger(t,n)},t.core.dom.select=function(e,t){return t?$(e).select(t):$(e).select()},t.core.dom.toggleClass=function(e,t){$(e).toggleClass(t)},t.core.dom.parent=function(e,t){return $(e).parent(t)},t.core.dom.parents=function(e,t){return $(e).parents(t)},t.core.dom.children=function(e,t){return $(e).children(t)},t.core.dom.next=function(e,t){return $(e).next(t)},t.core.dom.prev=function(e,t){return $(e).prev(t)},t.core.dom.closest=function(e,t){return $(e).closest(t)},t.core.dom.clone=function(e){return $(e).clone()},t.core.dom.text=function(e,t){return!t&&t!==""?$(e).text():$(e).text(t)},t.core.dom.prop=function(e,t,n){return n!==undefined?$(e).prop(t,n):$(e).prop(t)},t.core.dom.mouseleave=function(e,t){$(e).mouseleave(t)},t.core.dom.stopPropagation=function(e){e.stopPropagation()},t.core.dom.stop=function(e){$(e).stop()},t.core.dom.preventDefault=function(e){e.preventDefault()},t.core.dom.hide=function(e){return $(e).hide()},t.core.dom.show=function(e){return $(e).show()},t.core.dom.trim=function(e){return $.trim(e)},t.core.dom.map=function(e,t){return $(e).map(t)},t.core.dom.get=function(e,t){return $(e).get(t)},t.core.dom.toggle=function(e){return $(e).toggle()},t.core.dom.index=function(e,t){return t?$(e).index(t):$(e).index()},t.core.dom.keypress=function(e,t){$(e).keypress(t)},t.core.dom.insertAt=function(e,n,r,i){if(e===0)t.core.dom.prepend(r,i);else{var s=t.core.dom.find(n+":nth-child("+e+")",r);t.core.dom.after(s,i)}},t.core.dom.scrollToTop=function(e){$(window).scrollTop($(e).offset().top)},t.core.dom.scrollTop=function(e,t){return typeof t!="undefined"?$(e).scrollTop(t):$(e).scrollTop()},t.core.dom.scrollLeft=function(e,t){return typeof t!="undefined"?$(e).scrollLeft(t):$(e).scrollLeft()},t.core.dom.scrollAnimate=function(e,t){t?$(t).animate({scrollTop:e},500):$("html, body").animate({scrollTop:e},500)},t.core.dom.slideUp=function(e,t,n){$(e).slideUp(t,n)},t.core.dom.slideDown=function(e,t,n){$(e).slideDown(t,n)},t.core.dom.last=function(e){return $(e).last()},t.core.dom.fadeIn=function(e,t,n){$(e).fadeIn(t,n)},t.core.dom.fadeTo=function(e,t,n,r){$(e).fadeTo(t,n,r)},t.core.dom.fadeOut=function(e,t,n){$(e).fadeOut(t,n)},t.core.dom.when=function(e){return $.when(e)},t.core.dom.unbind=function(e,t){$(e).unbind(t)},t.core.dom.focus=function(e){$(e).focus()},t.core.dom.click=function(e){$(e).click()},t.core.dom.submit=function(e){$(e).submit()},t.core.dom.animate=function(e,t,n){$(e).animate(t,n)},t.core.dom.empty=function(e){$(e).empty()},t.core.dom.replaceWith=function(e,t){$(e).replaceWith(t)},t.core.dom.inArray=function(e,t){return $.inArray(e,t)},t.core.dom.wrapAll=function(e,t){return $(e).wrapAll(t)},t.core.dom.first=function(e){return $(e).first()},t.core.dom.visible=function(e,n,r,i){if(this.length<1)return;i=i?i:"both",r=typeof r=="undefined"?!0:r;var s=$(e),o=s.length>1?s.eq(0):s,u=o.get(0),a=t.sandbox.dom.$window.width(),f=t.sandbox.dom.$window.height(),l=r===!0?u.offsetWidth*u.offsetHeight:!0,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O;if(typeof u.getBoundingClientRect=="function"){c=u.getBoundingClientRect(),h=c.top>=0&&c.top<f,p=c.bottom>0&&c.bottom<=f,d=c.left>=0&&c.left<a,v=c.right>0&&c.right<=a,m=n?h||p:h&&p,g=n?d||d:d&&v;if(i==="both")return l&&m&&g;if(i==="vertical")return l&&m;if(i==="horizontal")return l&&g}else{y=t.sandbox.dom.$window.scrollTop(),b=y+f,w=t.sandbox.dom.$window.scrollLeft(),E=w+a,S=o.offset(),x=S.top,T=x+o.height(),N=S.left,C=N+o.width(),k=n===!0?T:x,L=n===!0?x:T,A=n===!0?C:N,O=n===!0?N:C;if(i==="both")return!!l&&L<=b&&k>=y&&O<=E&&A>=w;if(i==="vertical")return!!l&&L<=b&&k>=y;if(i==="horizontal")return!!l&&O<=E&&A>=w}},t.core.util.ajax=$.ajax,t.core.util.ajaxError=function(e){$(document).ajaxError(e)},t.core.util.when=function(e){return $.when(e)}}})}(),define("husky_extensions/model",[],function(){"use strict";var e={get:function(e){return this[e]},set:function(e,t){return!!t&&(this[e]=t),this}};return{name:"Model",initialize:function(t){t.sandbox.data.Model=e}}}),function(){"use strict";window.TagsManager?define("tagsManager",[],function(){return window.TagsManager}):require.config({paths:{tagsManager:"bower_components/tagmanager/tagmanager"},shim:{backbone:{deps:["jquery"]}}}),define("husky_extensions/tagmanager",["tagsManager"],{name:"tagsManager",initialize:function(e){e.sandbox.autocompleteList={init:function(t,n){return e.core.dom.$(t).tagsManager(n)}}}})}(),define("husky_extensions/template",["underscore","jquery"],function(e,t){"use strict";function n(t){this.options=e.defaults(t||{},{type:"html",compiler:e.template,lookup:[],components:"aura_components"}),this.cache={},this.options.lookup.push(this.cache)}return n.prototype={load:function(n,r){n=e.isString(n)?[n]:n;var i={},s=[],o,u;return e.each(n,function(e){var t=this.find(r+"/"+e);t?i[e]=t:s.push(e)},this),o=new t.Deferred,s.length?(u=e.map(s,function(e){var t=e+"."+this.options.type;return e.indexOf("/")!==0,"text!"+t},this),require(u,e.bind(function(){e.each(Array.prototype.slice.call(arguments),function(e,t){i[s[t]]=this.options.compiler(e),this.cache[r+"/"+name]=this.options.compiler(e)},this),o.resolve(i)},this),function(e){o.reject(e)})):o.resolve(i),o.promise()},find:function(n,r){r=r||"aura";var i=t("script[data-"+r+'-template="'+n+'"]').html(),s;return i?this.options.compiler(i):(s=e.find(this.options.lookup,function(e){return!!e[n]})||{},s[n])}},function(t){var r=new n(t.config.template);t.core.Components.Base.prototype.renderTemplate=function(e,t){if(typeof this.loadedTemplates[e]=="function"){var n=this.loadedTemplates[e],r={translate:this.sandbox.translate};return t=this.sandbox.util.extend({},r,t),n(t)}return"Template "+e+" not found."},t.components.before("initialize",function(){this.loadedTemplates={};if(!this.templates||!this.templates.length)return;var t=r.load(this.templates,this.options.name);return t.done(e.bind(function(e){this.loadedTemplates=e},this)),t.promise()})}}),function(){"use strict";window.Typeahead?define("typeahead",[],function(){return window.Typeahead}):require.config({paths:{typeahead:"bower_components/typeahead.js/typeahead.bundle"},shim:{backbone:{deps:["jquery"]}}}),define("husky_extensions/typeahead",["typeahead"],{name:"typeahead",initialize:function(e){e.sandbox.autocomplete={init:function(t,n){var r=this.createEngine(n);return r.initialize(),e.core.dom.$(t).typeahead({highlight:!0},{templates:n.templates,displayKey:n.displayKey,source:r.ttAdapter()})},createEngine:function(t){return t=e.sandbox.util.extend(!0,{datumTokenizer:function(e){return Bloodhound.tokenizers.whitespace(e[t.displayKey])},queryTokenizer:Bloodhound.tokenizers.whitespace},t),new Bloodhound(t)},setValue:function(t,n){return e.core.dom.$(t).typeahead("val",n)}}}})}(),function(){"use strict";require.config({paths:{"uri-template":"bower_components/massiveart-uritemplate/uritemplate"}}),define("husky_extensions/uri-template",["uri-template"],function(e){return{name:"uri-template",initialize:function(t){t.sandbox.uritemplate={parse:function(t){return e.parse(t)},expand:function(e,t){return e.expand(t)}}}}})}(),define("husky_extensions/util",["services/husky/util"],function(e){"use strict";return{name:"Util",initialize:function(t){for(var n in e)t.core.util[n]=e[n]}}});
        <link rel="stylesheet" href="/bundles/suluadmin/dist/app.min.1634826923308.css">
        <script data-main="/bundles/suluadmin/dist/app.min.1634826923308" src="/bundles/suluadmin/js/vendor/husky/husky.min.js?v=1634826923308"></script>
    <link rel="stylesheet" href="/bundles/suluadmin/dist/login.min.1634826923308.css">
    <script data-main="/bundles/suluadmin/dist/login.min.1634826923308" src="/bundles/suluadmin/js/vendor/husky/husky.min.js?v=1634826923308"></script>