text: 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/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","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/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/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","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@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=1464790854312"}),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/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"),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]?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/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,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.loadUserSetting=function(t,n,r){e.sandbox.sulu.userSettings[t]?r(e.sandbox.sulu.userSettings[t]):e.sandbox.util.load(n).then(function(n){e.sandbox.sulu.userSettings[t]=n,r(n)}.bind(this)).fail(function(t){e.sandbox.logger.log("data could not be loaded:",t)}.bind(this))},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.showDeleteDialog=function(t,n,r){if(!!t&&typeof t!="function")throw"callback is not a function";typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.emit("sulu.overlay.show-warning",n,r,function(){t(!1)}.bind(this),function(){t(!0)}.bind(this),{okDefaultText:"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,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))}}})}(),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){var r=e("matches-selector");t.exports=function(e,t,n){var i=n?e:e.parentNode;while(i&&i!==document){if(r(i,t))return i;i=i.parentNode}}},{"matches-selector":5}],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,!0),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 s(e,t){if(i)return i.call(e,t);var n=e.parentNode.querySelectorAll(t);for(var r=0;r<n.length;++r)if(n[r]==e)return!0;return!1}var r=Element.prototype,i=r.matchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector;t.exports=s},{}],6:[function(e,t,n){function r(e){var t;if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA")e.focus(),e.setSelectionRange(0,e.value.length),t=e.value;else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}t.exports=r},{}],7:[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},{}],8:[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?"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 e.prototype.resolveOptions=function(){var t=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""},e.prototype.initSelection=function(){this.text?this.selectFake():this.target&&this.selectTarget()},e.prototype.selectFake=function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandler=document.body.addEventListener("click",function(){return t.removeFake()}),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="fixed",this.fakeElem.style[r?"right":"left"]="-9999px",this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()},e.prototype.removeFake=function(){this.fakeHandler&&(document.body.removeEventListener("click"),this.fakeHandler=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},e.prototype.selectTarget=function(){this.selectedText=(0,n.default)(this.target),this.copyText()},e.prototype.copyText=function(){var t=undefined;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)},e.prototype.handleResult=function(t){t?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},e.prototype.clearSelection=function(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()},e.prototype.destroy=function(){this.removeFake()},o(e,[{key:"action",set:function(){var t=arguments.length<=0||arguments[0]===undefined?"copy":arguments[0];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:6}],9:[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 a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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 l(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 h(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),c=function(e){function t(n,r){a(this,t);var i=f(this,e.call(this));return i.resolveOptions(r),i.listenClick(n),i}return l(t,e),t.prototype.resolveOptions=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},t.prototype.listenClick=function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})},t.prototype.onClick=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),trigger:n,emitter:this})},t.prototype.defaultAction=function(t){return h("action",t)},t.prototype.defaultTarget=function(t){var n=h("target",t);if(n)return document.querySelector(n)},t.prototype.defaultText=function(t){return h("text",t)},t.prototype.destroy=function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},t}(s.default);e.exports=c})},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)}),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("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||(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},!0)}.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,!1),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,!1)}.bind(this)),this.sandbox.on("husky.data-navigation.selected",function(e){!!e&&!!e._links&&!!e._links.admin&&this.sandbox.emit("sulu.router.navigate",e._links.admin.href,!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e,!0)}.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),this.sandbox.emit("husky.navigation.select-item","contacts/contacts")},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e,t){t===!0&&this.selectNavigationItem(e.action),!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",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsClass:"tabs",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",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="tabs-row">','    <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+'">','   <h2 class="content-title <% if(!!underline){ %>underlined<% } %>"><%= title %></h2>',"</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,"tab-changed")},a=function(){return r.call(this,"set-title")},f=function(){return r.call(this,"saved")},l=function(){return r.call(this,"set-toolbar")},c=function(){return r.call(this,"tabs.activate")},h=function(){return r.call(this,"tabs.deactivate")},p=function(){return r.call(this,"toolbar.button.set")},d=function(){return r.call(this,"toolbar.item.loading")},v=function(){return r.call(this,"toolbar.item.change")},m=function(){return r.call(this,"toolbar.item.mark")},g=function(){return r.call(this,"toolbar.item.show")},y=function(){return r.call(this,"toolbar.item.hide")},b=function(){return r.call(this,"toolbar.item.enable")},w=function(){return r.call(this,"toolbar.item.disable")},E=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.$tabs=null,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.options.underline;this.removeTitle(),!e||$(".page").prepend(this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.translate(e),underline:t})))},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.user.locale})),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(l.call(this),this.setToolbar.bind(this)),this.sandbox.on(a.call(this),this.setTitle.bind(this)),this.sandbox.on(f.call(this),this.saved.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(u.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.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e.title),this.sandbox.emit(o.call(this),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(p.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(d.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(m.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(c.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(h.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.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)}}}),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};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,n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t,n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t,n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e,t){e.el=this.createLabelContainer(t),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)}}});