From 381ee5af0c8242cc78701f3e19005a47b0f3d98b Mon Sep 17 00:00:00 2001 From: Karsten Frohwein Date: Mon, 3 Aug 2020 20:32:36 +0200 Subject: [PATCH 1/7] Store values from image crop as integers (#5418) * Make sure formatKey is set $fileVersion->addFormatOptions($formatOptions); relies on that $formatOptions->setFormatKey($formatKey); is already called or the array key will be NULL No clue how this ever could have been able to run but probably the array of format options is never used. * Added type casts and return types to the entity. * Updated coding style for casts. * Removed type hints and added rounding. * Add test for decimal format options * Add changelog line Co-authored-by: Alexander Schranz Co-authored-by: Daniel Rotter --- CHANGELOG.md | 3 ++ .../MediaBundle/Entity/FormatOptions.php | 8 ++-- .../FormatOptions/FormatOptionsManager.php | 2 +- .../Controller/FormatControllerTest.php | 46 +++++++++++++++++++ 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5861b0b8d55..1e523dba349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ CHANGELOG for Sulu ================== +* release/1.6 + * BUGFIX #5418 [MediaBundle] Store values from image crop as integers + * 1.6.35 (2020-07-30) * BUGFIX #5435 [ContactBundle] Fix type of tag names for serialization of contacts diff --git a/src/Sulu/Bundle/MediaBundle/Entity/FormatOptions.php b/src/Sulu/Bundle/MediaBundle/Entity/FormatOptions.php index 8bd035486d5..8f9a1804fa9 100644 --- a/src/Sulu/Bundle/MediaBundle/Entity/FormatOptions.php +++ b/src/Sulu/Bundle/MediaBundle/Entity/FormatOptions.php @@ -55,7 +55,7 @@ class FormatOptions */ public function setCropX($cropX) { - $this->cropX = $cropX; + $this->cropX = (int) \round($cropX); return $this; } @@ -79,7 +79,7 @@ public function getCropX() */ public function setCropY($cropY) { - $this->cropY = $cropY; + $this->cropY = (int) \round($cropY); return $this; } @@ -103,7 +103,7 @@ public function getCropY() */ public function setCropWidth($cropWidth) { - $this->cropWidth = $cropWidth; + $this->cropWidth = (int) \round($cropWidth); return $this; } @@ -127,7 +127,7 @@ public function getCropWidth() */ public function setCropHeight($cropHeight) { - $this->cropHeight = $cropHeight; + $this->cropHeight = (int) \round($cropHeight); return $this; } diff --git a/src/Sulu/Bundle/MediaBundle/Media/FormatOptions/FormatOptionsManager.php b/src/Sulu/Bundle/MediaBundle/Media/FormatOptions/FormatOptionsManager.php index f6563a82469..65a3410cbfe 100644 --- a/src/Sulu/Bundle/MediaBundle/Media/FormatOptions/FormatOptionsManager.php +++ b/src/Sulu/Bundle/MediaBundle/Media/FormatOptions/FormatOptionsManager.php @@ -121,8 +121,8 @@ public function save($mediaId, $formatKey, array $data) if (!isset($formatOptions)) { $formatOptions = new FormatOptions(); $formatOptions->setFileVersion($fileVersion); - $fileVersion->addFormatOptions($formatOptions); $formatOptions->setFormatKey($formatKey); + $fileVersion->addFormatOptions($formatOptions); } $formatOptions = $this->setDataOnEntity($formatOptions, $data); diff --git a/src/Sulu/Bundle/MediaBundle/Tests/Functional/Controller/FormatControllerTest.php b/src/Sulu/Bundle/MediaBundle/Tests/Functional/Controller/FormatControllerTest.php index 40b1de12cd0..4339aa2af88 100644 --- a/src/Sulu/Bundle/MediaBundle/Tests/Functional/Controller/FormatControllerTest.php +++ b/src/Sulu/Bundle/MediaBundle/Tests/Functional/Controller/FormatControllerTest.php @@ -212,6 +212,52 @@ public function testPutWithFormatOptions() $this->assertEquals(100, $response->{'small-inset'}->options->cropHeight); } + public function testPutWithFormatOptionsAsDecimal() + { + $client = $this->createAuthenticatedClient(); + + $client->request( + 'PUT', + \sprintf('/api/media/%d/formats/small-inset', $this->media->getId()), + [ + 'locale' => 'de', + 'options' => [ + 'cropX' => 10.05, + 'cropY' => 14.75, + 'cropWidth' => 100.1, + 'cropHeight' => 99.6, + ], + ] + ); + + $response = \json_decode($client->getResponse()->getContent()); + $this->assertHttpStatusCode(200, $client->getResponse()); + + $this->assertEquals(10, $response->options->cropX); + $this->assertEquals(15, $response->options->cropY); + $this->assertEquals(100, $response->options->cropWidth); + $this->assertEquals(100, $response->options->cropHeight); + + // Test if the options have really been persisted + + $client->request( + 'GET', + \sprintf('/api/media/%d/formats', $this->media->getId()), + [ + 'locale' => 'de', + ] + ); + + $response = \json_decode($client->getResponse()->getContent()); + $this->assertHttpStatusCode(200, $client->getResponse()); + + $this->assertNotNull($response->{'small-inset'}); + $this->assertEquals(10, $response->{'small-inset'}->options->cropX); + $this->assertEquals(15, $response->{'small-inset'}->options->cropY); + $this->assertEquals(100, $response->{'small-inset'}->options->cropWidth); + $this->assertEquals(100, $response->{'small-inset'}->options->cropHeight); + } + public function testPutWithEmptyFormatOptions() { $client = $this->createAuthenticatedClient(); From 9161e6b9004ba8e02aae5937f0c8bee0cc9c2ae6 Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Tue, 4 Aug 2020 11:04:19 +0200 Subject: [PATCH 2/7] Fix export data function of audience-target selection (#5442) --- .../Content/Types/AudienceTargetingGroups.php | 2 +- .../Types/AudienceTargetingGroupsTest.php | 35 +++++++++++++++++++ .../Functional/Export/WebspaceExportTest.php | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/Sulu/Bundle/AudienceTargetingBundle/Content/Types/AudienceTargetingGroups.php b/src/Sulu/Bundle/AudienceTargetingBundle/Content/Types/AudienceTargetingGroups.php index ff3088ef46c..c2560bc6927 100644 --- a/src/Sulu/Bundle/AudienceTargetingBundle/Content/Types/AudienceTargetingGroups.php +++ b/src/Sulu/Bundle/AudienceTargetingBundle/Content/Types/AudienceTargetingGroups.php @@ -96,7 +96,7 @@ public function exportData($propertyValue) return \json_encode($propertyValue); } - return []; + return \json_encode([]); } public function importData( diff --git a/src/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/AudienceTargetingGroupsTest.php b/src/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/AudienceTargetingGroupsTest.php index ee4d62dd1ac..268ebb09839 100644 --- a/src/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/AudienceTargetingGroupsTest.php +++ b/src/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/Sulu/Bundle/AudienceTargetingBundle/Tests/Unit/Content/Types/AudienceTargetingGroupsTest.php @@ -118,4 +118,39 @@ public function testRemoveNotExisting() $this->audienceTargetingGroups->remove($node->reveal(), $property->reveal(), 'sulu_io', 'en', null); } + + public function testExportData() + { + $this->assertEquals('[]', $this->audienceTargetingGroups->exportData(null)); + $this->assertEquals('[]', $this->audienceTargetingGroups->exportData([])); + $this->assertEquals('[1]', $this->audienceTargetingGroups->exportData([1])); + } + + public function testImportDataEmpty() + { + $node = $this->prophesize(NodeInterface::class); + $property = $this->prophesize(PropertyInterface::class); + + $property->getName()->willReturn('test'); + + $property->setValue([])->shouldBeCalled(); + $property->getValue()->willReturn([]); + $node->setProperty('test', [])->shouldBeCalled(); + + $this->audienceTargetingGroups->importData($node->reveal(), $property->reveal(), '[]', 1, 'sulu_io', 'en'); + } + + public function testImportData() + { + $node = $this->prophesize(NodeInterface::class); + $property = $this->prophesize(PropertyInterface::class); + + $property->getName()->willReturn('test'); + + $property->setValue([1, 2])->shouldBeCalled(); + $property->getValue()->willReturn([1, 2]); + $node->setProperty('test', [1, 2])->shouldBeCalled(); + + $this->audienceTargetingGroups->importData($node->reveal(), $property->reveal(), '[1, 2]', 1, 'sulu_io', 'en'); + } } diff --git a/src/Sulu/Bundle/ContentBundle/Tests/Functional/Export/WebspaceExportTest.php b/src/Sulu/Bundle/ContentBundle/Tests/Functional/Export/WebspaceExportTest.php index bc62c308c86..44253bcabca 100644 --- a/src/Sulu/Bundle/ContentBundle/Tests/Functional/Export/WebspaceExportTest.php +++ b/src/Sulu/Bundle/ContentBundle/Tests/Functional/Export/WebspaceExportTest.php @@ -465,7 +465,7 @@ private function getExportResultData($documents) 'audience_targeting_groups', 'audience_targeting_groups', false, - $extensionData['excerpt']['audience_targeting_groups'] + \json_encode($extensionData['excerpt']['audience_targeting_groups']) ), ], ]; From 9de2dcfa1b744badc70109404eedecf74d3ce52e Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Fri, 21 Aug 2020 11:22:21 +0200 Subject: [PATCH 3/7] Fix scheme for url generation with webspace manager (#5456) --- .../Webspace/Manager/WebspaceManager.php | 5 +++-- .../Tests/Unit/Manager/WebspaceManagerTest.php | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Sulu/Component/Webspace/Manager/WebspaceManager.php b/src/Sulu/Component/Webspace/Manager/WebspaceManager.php index e576cdc1343..babebcff755 100644 --- a/src/Sulu/Component/Webspace/Manager/WebspaceManager.php +++ b/src/Sulu/Component/Webspace/Manager/WebspaceManager.php @@ -467,8 +467,10 @@ protected function matchUrl($url, $portalUrl) */ private function createResourceLocatorUrl($portalUrl, $resourceLocator, $scheme = null) { + $currentRequest = $this->requestStack->getCurrentRequest(); + if (!$scheme) { - $scheme = $this->defaultScheme; + $scheme = $currentRequest ? $currentRequest->getScheme() : $this->defaultScheme; } if (false !== \strpos($portalUrl, '/')) { @@ -479,7 +481,6 @@ private function createResourceLocatorUrl($portalUrl, $resourceLocator, $scheme $url = \rtrim(\sprintf('%s://%s', $scheme, $portalUrl), '/') . $resourceLocator; // add port if url points to host of current request and current request uses a custom port - $currentRequest = $this->requestStack->getCurrentRequest(); if ($currentRequest) { $host = $currentRequest->getHost(); $port = $currentRequest->getPort(); diff --git a/src/Sulu/Component/Webspace/Tests/Unit/Manager/WebspaceManagerTest.php b/src/Sulu/Component/Webspace/Tests/Unit/Manager/WebspaceManagerTest.php index 3ecbbc24019..1f01e1ac87a 100644 --- a/src/Sulu/Component/Webspace/Tests/Unit/Manager/WebspaceManagerTest.php +++ b/src/Sulu/Component/Webspace/Tests/Unit/Manager/WebspaceManagerTest.php @@ -700,6 +700,24 @@ public function testFindUrlsByResourceLocatorWithSchemeNull() $this->assertEquals(['http://sulu.lo/test'], $result); } + public function testFindUrlsByResourceLocatorWithSchemeFromRequest() + { + $request = $this->prophesize(Request::class); + $request->getHost()->willReturn('massiveart.lo'); + $request->getPort()->willReturn(8080); + $request->getScheme()->willReturn('https'); + $this->requestStack->getCurrentRequest()->willReturn($request->reveal()); + + $result = $this->webspaceManager->findUrlsByResourceLocator('/test', 'dev', 'en_us', 'massiveart'); + + $this->assertCount(2, $result); + $this->assertContains('https://massiveart.lo:8080/en-us/w/test', $result); + $this->assertContains('https://massiveart.lo:8080/en-us/s/test', $result); + + $result = $this->webspaceManager->findUrlsByResourceLocator('/test', 'dev', 'de_at', 'sulu_io'); + $this->assertEquals(['https://sulu.lo/test'], $result); + } + public function testFindUrlsByResourceLocatorRoot() { $result = $this->webspaceManager->findUrlsByResourceLocator('/', 'dev', 'en_us', 'massiveart'); From ad9130e87ee127dcabf8c8486e4684de03ecae73 Mon Sep 17 00:00:00 2001 From: Daniel Rotter Date: Tue, 25 Aug 2020 14:21:10 +0200 Subject: [PATCH 4/7] Fix serialization regression for TargetGroups (#5414) --- composer.json | 2 +- .../config/doctrine/TargetGroup.orm.xml | 25 ++++++++------ .../JmsObjectConstructorCompilerPass.php | 33 +++++++++++++++++++ src/Sulu/Bundle/CoreBundle/SuluCoreBundle.php | 2 ++ 4 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 src/Sulu/Bundle/CoreBundle/DependencyInjection/Compiler/JmsObjectConstructorCompilerPass.php diff --git a/composer.json b/composer.json index 8aa4e2a041b..2d2f2308b62 100644 --- a/composer.json +++ b/composer.json @@ -63,6 +63,7 @@ "piwik/device-detector": "^3.7", "ramsey/uuid": "^3.1", "stof/doctrine-extensions-bundle": "^1.2.2", + "swiftmailer/swiftmailer": "^6.1.3", "symfony-cmf/routing-bundle": "^2.1", "symfony-cmf/slugifier-api": "^2.0", "symfony/asset": "^4.3", @@ -93,7 +94,6 @@ "symfony/security-bundle": "^4.3", "symfony/string": "^5.0", "symfony/swiftmailer-bundle": "^3.1.4", - "swiftmailer/swiftmailer": "^6.1.3", "symfony/translation": "^4.3", "symfony/twig-bundle": "^4.3", "symfony/validator": "^4.3", diff --git a/src/Sulu/Bundle/AudienceTargetingBundle/Resources/config/doctrine/TargetGroup.orm.xml b/src/Sulu/Bundle/AudienceTargetingBundle/Resources/config/doctrine/TargetGroup.orm.xml index df2f972fde2..b0b14135490 100644 --- a/src/Sulu/Bundle/AudienceTargetingBundle/Resources/config/doctrine/TargetGroup.orm.xml +++ b/src/Sulu/Bundle/AudienceTargetingBundle/Resources/config/doctrine/TargetGroup.orm.xml @@ -2,10 +2,11 @@ - - + @@ -16,16 +17,20 @@ - + - + diff --git a/src/Sulu/Bundle/CoreBundle/DependencyInjection/Compiler/JmsObjectConstructorCompilerPass.php b/src/Sulu/Bundle/CoreBundle/DependencyInjection/Compiler/JmsObjectConstructorCompilerPass.php new file mode 100644 index 00000000000..a1c2d228bbf --- /dev/null +++ b/src/Sulu/Bundle/CoreBundle/DependencyInjection/Compiler/JmsObjectConstructorCompilerPass.php @@ -0,0 +1,33 @@ +getDefinition('jms_serializer.doctrine_object_constructor')->getDecoratedService()) { + return; + } + + $container->removeDefinition('jms_serializer.object_constructor'); + $container->setAlias('jms_serializer.doctrine_object_constructor', DoctrineObjectConstructor::class); + $container->setAlias('jms_serializer.object_constructor', 'jms_serializer.unserialize_object_constructor'); + } +} diff --git a/src/Sulu/Bundle/CoreBundle/SuluCoreBundle.php b/src/Sulu/Bundle/CoreBundle/SuluCoreBundle.php index 5ced4131509..f73eed5e8d5 100644 --- a/src/Sulu/Bundle/CoreBundle/SuluCoreBundle.php +++ b/src/Sulu/Bundle/CoreBundle/SuluCoreBundle.php @@ -13,6 +13,7 @@ use Sulu\Bundle\CoreBundle\DependencyInjection\Compiler\CsvHandlerCompilerPass; use Sulu\Bundle\CoreBundle\DependencyInjection\Compiler\ExceptionHandlerCompilerPass; +use Sulu\Bundle\CoreBundle\DependencyInjection\Compiler\JmsObjectConstructorCompilerPass; use Sulu\Bundle\CoreBundle\DependencyInjection\Compiler\ListBuilderMetadataProviderCompilerPass; use Sulu\Bundle\CoreBundle\DependencyInjection\Compiler\RegisterContentTypesCompilerPass; use Sulu\Bundle\CoreBundle\DependencyInjection\Compiler\RegisterLocalizationProvidersPass; @@ -51,5 +52,6 @@ public function build(ContainerBuilder $container) ); $container->addCompilerPass(new ExceptionHandlerCompilerPass()); + $container->addCompilerPass(new JmsObjectConstructorCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1024); } } From f9be7519da565cddb71080956053bd04c5cb276a Mon Sep 17 00:00:00 2001 From: Daniel Rotter Date: Tue, 25 Aug 2020 16:40:42 +0200 Subject: [PATCH 5/7] Throw proper error message when invalid form XML is loaded (#5436) --- .../Exception/InvalidRootTagException.php | 45 +++++++++++++++++++ .../FormMetadata/FormXmlLoader.php | 5 +++ .../Unit/FormMetadata/FormXmlLoaderTest.php | 11 +++++ .../data/form_invalid_root_tag.xml | 7 +++ 4 files changed, 68 insertions(+) create mode 100644 src/Sulu/Bundle/AdminBundle/Exception/InvalidRootTagException.php create mode 100644 src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/data/form_invalid_root_tag.xml diff --git a/src/Sulu/Bundle/AdminBundle/Exception/InvalidRootTagException.php b/src/Sulu/Bundle/AdminBundle/Exception/InvalidRootTagException.php new file mode 100644 index 00000000000..4f1b9500db8 --- /dev/null +++ b/src/Sulu/Bundle/AdminBundle/Exception/InvalidRootTagException.php @@ -0,0 +1,45 @@ +resource = $resource; + $this->rootTag = $rootTag; + } + + public function getResource() + { + return $this->resource; + } + + public function getRootTag() + { + return $this->rootTag; + } +} diff --git a/src/Sulu/Bundle/AdminBundle/FormMetadata/FormXmlLoader.php b/src/Sulu/Bundle/AdminBundle/FormMetadata/FormXmlLoader.php index 479f22b3bce..ce1df6b3ca0 100644 --- a/src/Sulu/Bundle/AdminBundle/FormMetadata/FormXmlLoader.php +++ b/src/Sulu/Bundle/AdminBundle/FormMetadata/FormXmlLoader.php @@ -11,6 +11,7 @@ namespace Sulu\Bundle\AdminBundle\FormMetadata; +use Sulu\Bundle\AdminBundle\Exception\InvalidRootTagException; use Sulu\Bundle\AdminBundle\FormMetadata\FormMetadata as ExternalFormMetadata; use Sulu\Bundle\AdminBundle\Metadata\FormMetadata\FormMetadata; use Sulu\Bundle\AdminBundle\Metadata\FormMetadata\LocalizedFormMetadataCollection; @@ -69,6 +70,10 @@ protected function parse($resource, \DOMXPath $xpath, $type): LocalizedFormMetad // init running vars $tags = []; + if (0 === $xpath->query('/x:form')->count()) { + throw new InvalidRootTagException($resource, 'form'); + } + $form = new ExternalFormMetadata(); $form->setResource($resource); $form->setKey($xpath->query('/x:form/x:key')->item(0)->nodeValue); diff --git a/src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/FormXmlLoaderTest.php b/src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/FormXmlLoaderTest.php index a289c5255b1..d7422c10573 100644 --- a/src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/FormXmlLoaderTest.php +++ b/src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/FormXmlLoaderTest.php @@ -12,6 +12,7 @@ namespace Sulu\Bundle\AdminBundle\Tests\Unit\FormMetadata; use PHPUnit\Framework\TestCase; +use Sulu\Bundle\AdminBundle\Exception\InvalidRootTagException; use Sulu\Bundle\AdminBundle\FormMetadata\FormMetadataMapper; use Sulu\Bundle\AdminBundle\FormMetadata\FormXmlLoader; use Sulu\Bundle\AdminBundle\Metadata\FormMetadata\FormMetadata; @@ -377,6 +378,16 @@ public function testLoadFormWithSizedSections() $this->assertCount(1, $formMetadata->getItems()['name']->getItems()); } + public function testLoadFormInvalidRootTag() + { + $this->expectException(InvalidRootTagException::class); + $this->expectExceptionMessageRegExp('/"form"/'); + + $this->loader->load( + __DIR__ . \DIRECTORY_SEPARATOR . 'data' . \DIRECTORY_SEPARATOR . 'form_invalid_root_tag.xml' + ); + } + public function testLoadFormInvalid() { $this->expectException(\InvalidArgumentException::class); diff --git a/src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/data/form_invalid_root_tag.xml b/src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/data/form_invalid_root_tag.xml new file mode 100644 index 00000000000..29f06deea2b --- /dev/null +++ b/src/Sulu/Bundle/AdminBundle/Tests/Unit/FormMetadata/data/form_invalid_root_tag.xml @@ -0,0 +1,7 @@ + + + + From 15df3fa1bb1d8b76a80893ffb41420f70bb510b6 Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Tue, 25 Aug 2020 17:34:05 +0200 Subject: [PATCH 6/7] fix teaser-selection deselecting (#5415) --- .../public/dist/components/teaser-selection/main.js | 2 +- .../public/js/components/teaser-selection/main.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Sulu/Bundle/ContentBundle/Resources/public/dist/components/teaser-selection/main.js b/src/Sulu/Bundle/ContentBundle/Resources/public/dist/components/teaser-selection/main.js index 19fb51596e2..0e1e3c381d8 100644 --- a/src/Sulu/Bundle/ContentBundle/Resources/public/dist/components/teaser-selection/main.js +++ b/src/Sulu/Bundle/ContentBundle/Resources/public/dist/components/teaser-selection/main.js @@ -1 +1 @@ -define(["underscore","config","services/suluwebsite/reference-store","text!./item.html"],function(a,b,c,d){"use strict";var e={options:{eventNamespace:"sulu.teaser-selection",resultKey:"teasers",dataAttribute:"teaser-selection",dataDefault:{},hidePositionElement:!0,hideConfigButton:!0,webspaceKey:null,locale:null,navigateEvent:"sulu.router.navigate",idKey:"teaserId",types:{},presentAs:[],translations:{noContentSelected:"sulu-content.teaser.no-teaser",add:"sulu-content.teaser.add-teaser"}},templates:{url:'/admin/api/teasers?ids=<%= ids.join(",") %>&locale=<%= locale %>',item:d,presentAsButton:''},translations:{edit:"sulu-content.teaser.edit",edited:"sulu-content.teaser.edited",reset:"sulu-content.teaser.reset",apply:"sulu-content.teaser.apply",cancel:"sulu-content.teaser.cancel"}},f="sulu_content.teaser-selection.",g=function(){return i.call(this,"ok-button.clicked")},h=function(){return i.call(this,"cancel-button.clicked")},i=function(a){return f+(this.options.instanceName?this.options.instanceName+".":"")+a},j=function(){var b=$("
");this.$addButton.parent().append(b),this.$addButton.append(''),this.sandbox.start([{name:"dropdown@husky",options:{el:b,data:a.map(this.options.types,function(b,c){return a.extend({id:c,name:c},b)}),valueName:"title",trigger:this.$addButton,triggerOutside:!0,clickCallback:l.bind(this)}}])},k=function(){var b=$(this.templates.presentAsButton()),c=b.find(".selected-text"),d=$("
"),e=this.getData().presentAs||"";b.insertAfter(this.$addButton),this.$addButton.parent().append(d),a.each(this.options.presentAs,function(a){return a.id===e?(c.text(a.name),!1):void 0}),this.sandbox.start([{name:"dropdown@husky",options:{el:d,instanceName:this.options.instanceName,data:this.options.presentAs,alignment:"right",trigger:b,triggerOutside:!0,clickCallback:function(b){c.text(b.name),this.setData(a.extend(this.getData(),{presentAs:b.id}))}.bind(this)}}])},l=function(b){var c=$('
'),d=$("
"),e=this.getData().items||[],f=a.map(b.additionalSlides,function(a){return a.okCallback=function(){return this.sandbox.emit(g.call(this),a),!1}.bind(this),a.cancelCallback=function(){return this.sandbox.emit(h.call(this),a),!1}.bind(this),a}.bind(this));this.$el.append(c),this.sandbox.start([{name:"overlay@husky",options:{el:c,instanceName:this.options.instanceName,openOnStart:!0,removeOnClose:!0,cssClass:"type-"+b.name,skin:"large",slides:[{title:this.sandbox.translate(b.title),data:d,okCallback:function(){var a=this.getData();a.items=e,this.setData(a),this.sandbox.stop(d)}.bind(this)}].concat(f)}}]),this.sandbox.once("husky.overlay."+this.options.instanceName+".initialized",function(){this.sandbox.start([{name:b.component,options:a.extend({el:d,locale:this.options.locale,webspaceKey:this.options.webspaceKey,instanceName:this.options.instanceName,type:b.name,data:a.filter(e,function(a){return a.type===b.name}),selectCallback:function(a){e.push(a)},deselectCallback:function(b){e=a.without(e,a.findWhere(e,b))}},b.componentOptions)}])}.bind(this))},m=function(){this.$el.on("click",".edit-teaser",function(a){return n.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".cancel-teaser-edit",function(a){return o.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".reset-teaser-edit",function(a){return q.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".apply-teaser-edit",function(a){return p.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".edit .image",function(a){r.call(this,$(a.currentTarget).parents("li"))}.bind(this))},n=function(a){var b=a.find(".view"),c=a.find(".edit"),d=this.getItem(a.data("id")),e=this.getApiItem(a.data("id")),f=c.find(".description-container"),g=$(''),h=d.mediaId||e.mediaId;a.find(".move").hide(),f.children().remove(),f.append(g),b.addClass("hidden"),c.removeClass("hidden"),c.find(".title").val(d.title||""),c.find(".description").val(d.description||""),c.find(".moreText").val(d.moreText||""),c.find(".image-content").remove(),h?c.find(".image").prepend('
'):c.find(".image").prepend('
'),this.sandbox.start([{name:"ckeditor@husky",options:{el:g,placeholder:this.cleanupText(e.description||""),autoStart:!1}}])},o=function(a){a.find(".view").removeClass("hidden"),a.find(".edit").addClass("hidden"),a.find(".move").show(),s.call(this,a)},p=function(b){var c=b.find(".view"),d=b.find(".edit"),e={title:d.find(".title").val()||null,description:d.find(".description").val()||null,moreText:d.find(".moreText").val()||null,mediaId:d.find(".mediaId").data("id")||null},f=this.isEdited(e);o.call(this,b),e=this.mergeItem(b.data("id"),e),e=a.defaults(e,this.getApiItem(b.data("id"))),c.find(".title").text(e.title),c.find(".description").text(this.cropAndCleanupText(e.description||"")),c.find(".image").remove(),e.mediaId&&c.find(".value").prepend(''),c.find(".edited").removeClass("hidden"),f||c.find(".edited").addClass("hidden")},q=function(b){var c=b.find(".view"),d=b.data("id"),e=this.getApiItem(d),f=this.getItem(d);o.call(this,b),f=a.omit(f,["title","description","moreText","mediaId"]),this.setItem(d,f),c.find(".title").text(e.title),c.find(".description").text(this.cropAndCleanupText(e.description||"")),c.find(".image").remove(),e.mediaId&&c.find(".value").prepend(''),c.find(".edited").addClass("hidden")},r=function(a){var b=$("
"),c=a.data("id"),d=this.getApiItem(c);this.$el.append(b),this.sandbox.start([{name:"media-selection/overlay@sulumedia",options:{el:b,preselected:[d.mediaId],instanceName:"teaser-"+d.type+"-"+d.id,removeOnClose:!0,openOnStart:!0,singleSelect:!0,locale:this.options.locale,saveCallback:function(b){var c=b[0],d=a.find(".image-content");d.removeClass("fa-picture-o"),d.html('')},removeCallback:function(){var b=a.find(".image-content");b.addClass("fa-picture-o"),b.html("")}}}])},s=function(a){this.sandbox.stop(a.find(".component"))};return{type:"itembox",defaults:e,apiItems:{},initialize:function(){this.$el.addClass("teaser-selection"),this.prefillReferenceStore(),this.render(),j.call(this),0").html("
"+a+"
").text()},cropAndCleanupText:function(a,b){return b=b?b:50,this.sandbox.util.cropTail(this.cleanupText(a),b)},isEdited:function(b){return!a.isEqual(a.keys(b).sort(),["id","type"])},getItemContent:function(b){var c=this.getItem(b.teaserId),d=this.isEdited(c);return this.apiItems[b.teaserId]=b,b=a.defaults(c,b),this.templates.item(a.defaults(b,{apiItem:this.apiItems[b.teaserId],translations:this.translations,descriptionText:this.cropAndCleanupText(b.description||""),types:this.options.types,translate:this.sandbox.translate,locale:this.options.locale,mediaId:null,edited:d}))},sortHandler:function(b){var c=this.getData();c.items=a.map(b,this.getItem.bind(this)),this.setData(c,!1)},removeHandler:function(a){for(var b=this.getData(),c=b.items||[],d=a.split(";"),e=-1,f=c.length;++e&locale=<%= locale %>',item:d,presentAsButton:''},translations:{edit:"sulu-content.teaser.edit",edited:"sulu-content.teaser.edited",reset:"sulu-content.teaser.reset",apply:"sulu-content.teaser.apply",cancel:"sulu-content.teaser.cancel"}},f="sulu_content.teaser-selection.",g=function(){return i.call(this,"ok-button.clicked")},h=function(){return i.call(this,"cancel-button.clicked")},i=function(a){return f+(this.options.instanceName?this.options.instanceName+".":"")+a},j=function(){var b=$("
");this.$addButton.parent().append(b),this.$addButton.append(''),this.sandbox.start([{name:"dropdown@husky",options:{el:b,data:a.map(this.options.types,function(b,c){return a.extend({id:c,name:c},b)}),valueName:"title",trigger:this.$addButton,triggerOutside:!0,clickCallback:l.bind(this)}}])},k=function(){var b=$(this.templates.presentAsButton()),c=b.find(".selected-text"),d=$("
"),e=this.getData().presentAs||"";b.insertAfter(this.$addButton),this.$addButton.parent().append(d),a.each(this.options.presentAs,function(a){return a.id===e?(c.text(a.name),!1):void 0}),this.sandbox.start([{name:"dropdown@husky",options:{el:d,instanceName:this.options.instanceName,data:this.options.presentAs,alignment:"right",trigger:b,triggerOutside:!0,clickCallback:function(b){c.text(b.name),this.setData(a.extend(this.getData(),{presentAs:b.id}))}.bind(this)}}])},l=function(b){var c=$('
'),d=$("
"),e=this.getData().items||[],f=a.map(b.additionalSlides,function(a){return a.okCallback=function(){return this.sandbox.emit(g.call(this),a),!1}.bind(this),a.cancelCallback=function(){return this.sandbox.emit(h.call(this),a),!1}.bind(this),a}.bind(this));this.$el.append(c),this.sandbox.start([{name:"overlay@husky",options:{el:c,instanceName:this.options.instanceName,openOnStart:!0,removeOnClose:!0,cssClass:"type-"+b.name,skin:"large",slides:[{title:this.sandbox.translate(b.title),data:d,okCallback:function(){var a=this.getData();a.items=e,this.setData(a),this.sandbox.stop(d)}.bind(this)}].concat(f)}}]),this.sandbox.once("husky.overlay."+this.options.instanceName+".initialized",function(){this.sandbox.start([{name:b.component,options:a.extend({el:d,locale:this.options.locale,webspaceKey:this.options.webspaceKey,instanceName:this.options.instanceName,type:b.name,data:a.filter(e,function(a){return a.type===b.name}),selectCallback:function(b){var c=a.filter(e,function(a){return a.id===b.id&&a.type===b.type});0===c.length?e.push(b):e=a.without(e,a.findWhere(e,b))}},b.componentOptions)}])}.bind(this))},m=function(){this.$el.on("click",".edit-teaser",function(a){return n.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".cancel-teaser-edit",function(a){return o.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".reset-teaser-edit",function(a){return q.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".apply-teaser-edit",function(a){return p.call(this,$(a.currentTarget).parents("li")),!1}.bind(this)),this.$el.on("click",".edit .image",function(a){r.call(this,$(a.currentTarget).parents("li"))}.bind(this))},n=function(a){var b=a.find(".view"),c=a.find(".edit"),d=this.getItem(a.data("id")),e=this.getApiItem(a.data("id")),f=c.find(".description-container"),g=$(''),h=d.mediaId||e.mediaId;a.find(".move").hide(),f.children().remove(),f.append(g),b.addClass("hidden"),c.removeClass("hidden"),c.find(".title").val(d.title||""),c.find(".description").val(d.description||""),c.find(".moreText").val(d.moreText||""),c.find(".image-content").remove(),h?c.find(".image").prepend('
'):c.find(".image").prepend('
'),this.sandbox.start([{name:"ckeditor@husky",options:{el:g,placeholder:this.cleanupText(e.description||""),autoStart:!1}}])},o=function(a){a.find(".view").removeClass("hidden"),a.find(".edit").addClass("hidden"),a.find(".move").show(),s.call(this,a)},p=function(b){var c=b.find(".view"),d=b.find(".edit"),e={title:d.find(".title").val()||null,description:d.find(".description").val()||null,moreText:d.find(".moreText").val()||null,mediaId:d.find(".mediaId").data("id")||null},f=this.isEdited(e);o.call(this,b),e=this.mergeItem(b.data("id"),e),e=a.defaults(e,this.getApiItem(b.data("id"))),c.find(".title").text(e.title),c.find(".description").text(this.cropAndCleanupText(e.description||"")),c.find(".image").remove(),e.mediaId&&c.find(".value").prepend(''),c.find(".edited").removeClass("hidden"),f||c.find(".edited").addClass("hidden")},q=function(b){var c=b.find(".view"),d=b.data("id"),e=this.getApiItem(d),f=this.getItem(d);o.call(this,b),f=a.omit(f,["title","description","moreText","mediaId"]),this.setItem(d,f),c.find(".title").text(e.title),c.find(".description").text(this.cropAndCleanupText(e.description||"")),c.find(".image").remove(),e.mediaId&&c.find(".value").prepend(''),c.find(".edited").addClass("hidden")},r=function(a){var b=$("
"),c=a.data("id"),d=this.getApiItem(c);this.$el.append(b),this.sandbox.start([{name:"media-selection/overlay@sulumedia",options:{el:b,preselected:[d.mediaId],instanceName:"teaser-"+d.type+"-"+d.id,removeOnClose:!0,openOnStart:!0,singleSelect:!0,locale:this.options.locale,saveCallback:function(b){var c=b[0],d=a.find(".image-content");d.removeClass("fa-picture-o"),d.html('')},removeCallback:function(){var b=a.find(".image-content");b.addClass("fa-picture-o"),b.html("")}}}])},s=function(a){this.sandbox.stop(a.find(".component"))};return{type:"itembox",defaults:e,apiItems:{},initialize:function(){this.$el.addClass("teaser-selection"),this.prefillReferenceStore(),this.render(),j.call(this),0").html("
"+a+"
").text()},cropAndCleanupText:function(a,b){return b=b?b:50,this.sandbox.util.cropTail(this.cleanupText(a),b)},isEdited:function(b){return!a.isEqual(a.keys(b).sort(),["id","type"])},getItemContent:function(b){var c=this.getItem(b.teaserId),d=this.isEdited(c);return this.apiItems[b.teaserId]=b,b=a.defaults(c,b),this.templates.item(a.defaults(b,{apiItem:this.apiItems[b.teaserId],translations:this.translations,descriptionText:this.cropAndCleanupText(b.description||""),types:this.options.types,translate:this.sandbox.translate,locale:this.options.locale,mediaId:null,edited:d}))},sortHandler:function(b){var c=this.getData();c.items=a.map(b,this.getItem.bind(this)),this.setData(c,!1)},removeHandler:function(a){for(var b=this.getData(),c=b.items||[],d=a.split(";"),e=-1,f=c.length;++e Date: Wed, 26 Aug 2020 08:36:11 +0200 Subject: [PATCH 7/7] Bump version --- CHANGELOG.md | 4 +++- .../{app.min.1596097643307.css => app.min.1598423107728.css} | 0 .../{app.min.1596097643307.js => app.min.1598423107728.js} | 2 +- src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.js | 2 +- ...ogin.min.1596097643307.css => login.min.1598423107728.css} | 0 ...{login.min.1596097643307.js => login.min.1598423107728.js} | 2 +- .../Bundle/AdminBundle/Resources/public/dist/login.min.js | 2 +- .../AdminBundle/Resources/views/Admin/index.html.dist.twig | 4 ++-- .../AdminBundle/Resources/views/Security/login.html.dist.twig | 4 ++-- 9 files changed, 11 insertions(+), 9 deletions(-) rename src/Sulu/Bundle/AdminBundle/Resources/public/dist/{app.min.1596097643307.css => app.min.1598423107728.css} (100%) rename src/Sulu/Bundle/AdminBundle/Resources/public/dist/{app.min.1596097643307.js => app.min.1598423107728.js} (99%) rename src/Sulu/Bundle/AdminBundle/Resources/public/dist/{login.min.1596097643307.css => login.min.1598423107728.css} (100%) rename src/Sulu/Bundle/AdminBundle/Resources/public/dist/{login.min.1596097643307.js => login.min.1598423107728.js} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e523dba349..2d7b0d7ea94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ CHANGELOG for Sulu ================== -* release/1.6 +* 1.6.36 (2020-08-26) + * BUGFIX #5415 [ContentBundle] Fix teaser-selection deselecting + * BUGFIX #5442 [AudienceTargetingBundle] Fix export data function of audience-target selection * BUGFIX #5418 [MediaBundle] Store values from image crop as integers * 1.6.35 (2020-07-30) diff --git a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1596097643307.css b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1598423107728.css similarity index 100% rename from src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1596097643307.css rename to src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1598423107728.css diff --git a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1596097643307.js b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1598423107728.js similarity index 99% rename from src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1596097643307.js rename to src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1598423107728.js index c1e87daa730..458c1a35163 100644 --- a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1596097643307.js +++ b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.1598423107728.js @@ -1 +1 @@ -define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1596097643307"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("
"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('
'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s");$("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:'
'}},{name:"toggler-on",template:{title:"",content:'
'}},{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 .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;o0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'
'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("
"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['
','
','
',' ',"
",'
','
',"
",'
',"
","
"].join(""),tabsRow:['
','
',"
"].join(""),languageChanger:['
',' <%= title %>',' ',"
"].join(""),titleElement:['
','
',"

<%= title %>

","
","
"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('
'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("
"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('
');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('
');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['','<% if (!!icon) { %><% } %><%= title %>',""].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'
'),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"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("
"),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('
');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:['
','','
',"
"].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)}}}); \ No newline at end of file +define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1598423107728"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("
"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('
'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s");$("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:'
'}},{name:"toggler-on",template:{title:"",content:'
'}},{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 .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;o0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'
'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("
"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['
','
','
',' ',"
",'
','
',"
",'
',"
","
"].join(""),tabsRow:['
','
',"
"].join(""),languageChanger:['
',' <%= title %>',' ',"
"].join(""),titleElement:['
','
',"

<%= title %>

","
","
"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('
'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("
"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('
');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('
');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['','<% if (!!icon) { %><% } %><%= title %>',""].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'
'),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"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("
"),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('
');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:['
','','
',"
"].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)}}}); \ No newline at end of file diff --git a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.js b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.js index c1e87daa730..458c1a35163 100644 --- a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.js +++ b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/app.min.js @@ -1 +1 @@ -define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1596097643307"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("
"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('
'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s");$("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:'
'}},{name:"toggler-on",template:{title:"",content:'
'}},{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 .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;o0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'
'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("
"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['
','
','
',' ',"
",'
','
',"
",'
',"
","
"].join(""),tabsRow:['
','
',"
"].join(""),languageChanger:['
',' <%= title %>',' ',"
"].join(""),titleElement:['
','
',"

<%= title %>

","
","
"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('
'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("
"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('
');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('
');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['','<% if (!!icon) { %><% } %><%= title %>',""].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'
'),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"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("
"),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('
');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:['
','','
',"
"].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)}}}); \ No newline at end of file +define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSection:function(t){return e.sections[t]?e.sections[t]:null},getDebug:function(){return e.debug}}}),require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"main","app-config":"components/app-config/main",config:"components/config/main","widget-groups":"components/sidebar/widget-groups",cultures:"vendor/globalize/cultures",husky:"vendor/husky/husky","aura_extensions/backbone-relational":"aura_extensions/backbone-relational","aura_extensions/csv-export":"aura_extensions/csv-export","aura_extensions/sulu-content":"aura_extensions/sulu-content","aura_extensions/sulu-extension":"aura_extensions/sulu-extension","aura_extensions/sulu-buttons":"aura_extensions/sulu-buttons","aura_extensions/url-manager":"aura_extensions/url-manager","aura_extensions/default-extension":"aura_extensions/default-extension","aura_extensions/event-extension":"aura_extensions/event-extension","aura_extensions/sticky-toolbar":"aura_extensions/sticky-toolbar","aura_extensions/clipboard":"aura_extensions/clipboard","aura_extensions/form-tab":"aura_extensions/form-tab","__component__$app@suluadmin":"components/app/main","__component__$overlay@suluadmin":"components/overlay/main","__component__$header@suluadmin":"components/header/main","__component__$breadcrumbs@suluadmin":"components/breadcrumbs/main","__component__$list-toolbar@suluadmin":"components/list-toolbar/main","__component__$labels@suluadmin":"components/labels/main","__component__$sidebar@suluadmin":"components/sidebar/main","__component__$data-overlay@suluadmin":"components/data-overlay/main"},include:["vendor/require-css/css","app-config","config","aura_extensions/backbone-relational","aura_extensions/csv-export","aura_extensions/sulu-content","aura_extensions/sulu-extension","aura_extensions/sulu-buttons","aura_extensions/url-manager","aura_extensions/default-extension","aura_extensions/event-extension","aura_extensions/sticky-toolbar","aura_extensions/clipboard","aura_extensions/form-tab","widget-groups","__component__$app@suluadmin","__component__$overlay@suluadmin","__component__$header@suluadmin","__component__$breadcrumbs@suluadmin","__component__$list-toolbar@suluadmin","__component__$labels@suluadmin","__component__$sidebar@suluadmin","__component__$data-overlay@suluadmin"],exclude:["husky"],map:{"*":{css:"vendor/require-css/css"}},urlArgs:"v=1598423107728"}),define("underscore",[],function(){return window._}),require(["husky","app-config"],function(e,t){"use strict";var n=t.getUser().locale,r=t.getTranslations(),i=t.getFallbackLocale(),s;r.indexOf(n)===-1&&(n=i),require(["text!/admin/bundles","text!/admin/translations/sulu."+n+".json","text!/admin/translations/sulu."+i+".json"],function(n,r,i){var o=JSON.parse(n),u=JSON.parse(r),a=JSON.parse(i);s=new e({debug:{enable:t.getDebug()},culture:{name:t.getUser().locale,messages:u,defaultMessages:a}}),s.use("aura_extensions/default-extension"),s.use("aura_extensions/url-manager"),s.use("aura_extensions/backbone-relational"),s.use("aura_extensions/csv-export"),s.use("aura_extensions/sulu-content"),s.use("aura_extensions/sulu-extension"),s.use("aura_extensions/sulu-buttons"),s.use("aura_extensions/event-extension"),s.use("aura_extensions/sticky-toolbar"),s.use("aura_extensions/clipboard"),s.use("aura_extensions/form-tab"),o.forEach(function(e){s.use("/bundles/"+e+"/dist/main.js")}.bind(this)),s.components.addSource("suluadmin","/bundles/suluadmin/js/components"),s.use(function(e){window.App=e.sandboxes.create("app-sandbox")}),s.start(),window.app=s})}),define("main",function(){}),define("vendor/require-css/css",[],function(){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]||"WebkitAppearance"in document.documentElement.style?r=!1:t[4]&&(n=parseInt(t[4])<18);var i={};i.pluginBuilder="./css-builder";var s,o,u=function(){s=document.createElement("style"),e.appendChild(s),o=s.styleSheet||s.sheet},a=0,f=[],l,c=function(e){o.addImport(e),s.onload=function(){h()},a++,a==31&&(u(),a=0)},h=function(){l();var e=f.shift();if(!e){l=null;return}l=e[1],c(e[0])},p=function(e,t){(!o||!o.addImport)&&u();if(o&&o.addImport)l?f.push([e,t]):(c(e),l=t);else{s.textContent='@import "'+e+'";';var n=setInterval(function(){try{s.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},d=function(t,n){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet";if(r)i.onload=function(){i.onload=function(){},setTimeout(n,7)};else var s=setInterval(function(){for(var e=0;e=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("aura_extensions/csv-export",["jquery","underscore"],function(e,t){"use strict";var n={options:{url:null,urlParameter:{}},translations:{"export":"public.export",exportTitle:"csv_export.export-title",delimiter:"csv_export.delimiter",delimiterInfo:"csv_export.delimiter-info",enclosure:"csv_export.enclosure",enclosureInfo:"csv_export.enclosure-info",escape:"csv_export.escape",escapeInfo:"csv_export.escape-info",newLine:"csv_export.new-line",newLineInfo:"csv_export.new-line-info"}},r={defaults:n,initialize:function(){this.options=this.sandbox.util.extend(!0,{},n,this.options),this.render(),this.startOverlay(),this.bindCustomEvents()},"export":function(){var n=this.sandbox.form.getData(this.$form),r=e.extend(!0,{},this.options.urlParameter,n),i=t.map(r,function(e,t){return t+"="+e}).join("&");window.location=this.options.url+"?"+i},render:function(){this.$container=e("
"),this.$form=e(t.template(this.getFormTemplate(),{translations:this.translations})),this.$el.append(this.$container)},startOverlay:function(){this.sandbox.start([{name:"overlay@husky",options:{el:this.$container,openOnStart:!0,removeOnClose:!0,container:this.$el,instanceName:"csv-export",slides:[{title:this.translations.exportTitle,data:this.$form,buttons:[{type:"cancel",align:"left"},{type:"ok",align:"right",text:this.translations.export}],okCallback:this.export.bind(this)}]}}])},bindCustomEvents:function(){this.sandbox.once("husky.overlay.csv-export.opened",function(){this.sandbox.form.create(this.$form),this.sandbox.start(this.$form)}.bind(this)),this.sandbox.once("husky.overlay.csv-export.closed",function(){this.sandbox.stop()}.bind(this))},getFormTemplate:function(){throw new Error('"getFormTemplate" not implemented')}};return{name:"csv-export",initialize:function(e){e.components.addType("csv-export",r)}}}),define("aura_extensions/sulu-content",[],function(){"use strict";var e={layout:{navigation:{collapsed:!1,hidden:!1},content:{width:"fixed",leftSpace:!0,rightSpace:!0,topSpace:!0},sidebar:!1}},t=function(e,t){var r,i,s,o=this.sandbox.mvc.history.fragment;try{r=JSON.parse(e)}catch(u){r=e}var a=[];return this.sandbox.util.foreach(r,function(e){i=e.display.indexOf("new")>=0,s=e.display.indexOf("edit")>=0;if(!t&&i||t&&s)e.action=n(e.action,o,t),e.action===o&&(e.selected=!0),a.push(e)}.bind(this)),a},n=function(e,t,n){if(e.substr(0,1)==="/")return e.substr(1,e.length);if(!!n){var r=new RegExp("\\w*:"+n),i=r.exec(t),s=i[0];t=t.substr(0,t.indexOf(s)+s.length)}return t+"/"+e},r=function(t){typeof t=="function"&&(t=t.call(this)),t.extendExisting||(t=this.sandbox.util.extend(!0,{},e.layout,t)),typeof t.navigation!="undefined"&&i.call(this,t.navigation,!t.extendExisting),typeof t.content!="undefined"&&s.call(this,t.content,!t.extendExisting),typeof t.sidebar!="undefined"&&o.call(this,t.sidebar,!t.extendExisting)},i=function(e,t){e.collapsed===!0?this.sandbox.emit("husky.navigation.collapse",!0):t===!0&&this.sandbox.emit("husky.navigation.uncollapse"),e.hidden===!0?this.sandbox.emit("husky.navigation.hide"):t===!0&&this.sandbox.emit("husky.navigation.show")},s=function(e,t){var n=e.width,r=t?!!e.leftSpace:e.leftSpace,i=t?!!e.rightSpace:e.rightSpace,s=t?!!e.topSpace:e.topSpace;(t===!0||!!n)&&this.sandbox.emit("sulu.app.change-width",n,t),this.sandbox.emit("sulu.app.change-spacing",r,i,s)},o=function(e,t){!e||!e.url?t===!0&&this.sandbox.emit("sulu.sidebar.empty"):this.sandbox.emit("sulu.sidebar.set-widget",e.url);if(!e)t===!0&&this.sandbox.emit("sulu.sidebar.hide");else{var n=e.width||"max";this.sandbox.emit("sulu.sidebar.change-width",n)}t===!0&&this.sandbox.emit("sulu.sidebar.reset-classes"),!!e&&!!e.cssClasses&&this.sandbox.emit("sulu.sidebar.add-classes",e.cssClasses)},u=function(e){typeof e=="function"&&(e=e.call(this)),e.then?e.then(function(e){a.call(this,e)}.bind(this)):a.call(this,e)},a=function(e){if(!e)return!1;f.call(this,e).then(function(t){var n=this.sandbox.dom.createElement('
'),r=$(".sulu-header");!r.length||(Husky.stop(".sulu-header"),r.remove()),this.sandbox.dom.prepend(".content-column",n),this.sandbox.start([{name:"header@suluadmin",options:{el:n,noBack:typeof e.noBack!="undefined"?e.noBack:!1,title:e.title?e.title:!1,breadcrumb:e.breadcrumb?e.breadcrumb:!1,underline:e.hasOwnProperty("underline")?e.underline:!0,toolbarOptions:!e.toolbar||!e.toolbar.options?{}:e.toolbar.options,toolbarLanguageChanger:!e.toolbar||!e.toolbar.languageChanger?!1:e.toolbar.languageChanger,toolbarDisabled:!e.toolbar,toolbarButtons:!e.toolbar||!e.toolbar.buttons?[]:e.toolbar.buttons,tabsData:t,tabsContainer:!e.tabs||!e.tabs.container?this.options.el:e.tabs.container,tabsParentOption:this.options,tabsOption:!e.tabs||!e.tabs.options?{}:e.tabs.options,tabsComponentOptions:!e.tabs||!e.tabs.componentOptions?{}:e.tabs.componentOptions}}])}.bind(this))},f=function(e){var n=this.sandbox.data.deferred();return!e.tabs||!e.tabs.url?(n.resolve(e.tabs?e.tabs.data:null),n):(this.sandbox.util.load(e.tabs.url).then(function(e){var r=t.call(this,e,this.options.id);n.resolve(r)}.bind(this)),n)},l=function(){!!this.view&&!this.layout&&r.call(this,{}),!this.layout||r.call(this,this.layout)},c=function(){var e=$.Deferred();return this.header?(u.call(this,this.header),this.sandbox.once("sulu.header.initialized",function(){e.resolve()}.bind(this))):e.resolve(),e};return function(e){e.components.before("initialize",function(){var e=$.Deferred(),t=$.Deferred(),n=function(e){!e||(this.data=e),c.call(this).then(function(){t.resolve()}.bind(this))};return l.call(this),!this.loadComponentData||typeof this.loadComponentData!="function"?e.resolve():e=this.loadComponentData.call(this),e.then?e.then(n.bind(this)):n.call(this,e),$.when(e,t)})}}),function(){"use strict";define("aura_extensions/sulu-extension",[],{initialize:function(e){e.sandbox.sulu={},e.sandbox.sulu.user=e.sandbox.util.extend(!1,{},SULU.user),e.sandbox.sulu.locales=SULU.locales,e.sandbox.sulu.user=e.sandbox.util.extend(!0,{},SULU.user),e.sandbox.sulu.userSettings=e.sandbox.util.extend(!0,{},SULU.user.settings);var t=function(e,t){var n=t?{}:[],r;for(r=0;r=0){c=f[h];for(var n in a[t])i.indexOf(n)<0&&(c[n]=a[t][n]);l.push(c),p=v.indexOf(e),v.splice(p,1)}}.bind(this)),this.sandbox.util.foreach(v,function(e){l.push(f[g[e]])}.bind(this))):l=f,e.sandbox.sulu.userSettings[r]=l,e.sandbox.emit(n,s),o(l)}.bind(this))},e.sandbox.sulu.getUserSetting=function(t){return typeof e.sandbox.sulu.userSettings[t]!="undefined"?e.sandbox.sulu.userSettings[t]:null},e.sandbox.sulu.saveUserSetting=function(t,n){e.sandbox.sulu.userSettings[t]=n;var r={key:t,value:n};e.sandbox.util.ajax({type:"PUT",url:"/admin/security/profile/settings",data:r})},e.sandbox.sulu.deleteUserSetting=function(t){delete e.sandbox.sulu.userSettings[t];var n={key:t};e.sandbox.util.ajax({type:"DELETE",url:"/admin/security/profile/settings",data:n})},e.sandbox.sulu.getDefaultContentLocale=function(){if(!!SULU.user.locale&&_.contains(SULU.locales,SULU.user.locale))return SULU.user.locale;var t=e.sandbox.sulu.getUserSetting("contentLanguage");return t?t:SULU.locales[0]},e.sandbox.sulu.showConfirmationDialog=function(t){if(!t.callback||typeof t.callback!="function")throw"callback must be a function";e.sandbox.emit("sulu.overlay.show-warning",t.title,t.description,function(){return t.callback(!1)},function(){return t.callback(!0)},{okDefaultText:t.buttonTitle||"public.ok"})},e.sandbox.sulu.showDeleteDialog=function(t,n,r){typeof n!="string"&&(n=e.sandbox.util.capitalizeFirstLetter(e.sandbox.translate("public.delete"))+"?"),r=typeof r=="string"?r:"sulu.overlay.delete-desc",e.sandbox.sulu.showConfirmationDialog({callback:t,title:n,description:r,buttonTitle:"public.delete"})};var r,i=function(e,t){return r?r=!1:e+=t,e},s=function(e,t){if(!!t){var n=e.indexOf("sortBy"),r=e.indexOf("sortOrder"),i="&";if(n===-1&&r===-1)return e.indexOf("?")===-1&&(i="?"),e+i+"sortBy="+t.attribute+"&sortOrder="+t.direction;if(n>-1&&r>-1)return e=e.replace(/(sortBy=(\w)+)/,"sortBy="+t.attribute),e=e.replace(/(sortOrder=(\w)+)/,"sortOrder="+t.direction),e;this.sandbox.logger.error("Invalid list url! Either sortBy or sortOrder or both are missing!")}return e},o=function(e,t){var n=e.dom.trim(e.dom.text(t));n=n.replace(/\s{2,}/g," "),e.dom.attr(t,"title",n),e.dom.html(t,e.util.cropMiddle(n,20))};e.sandbox.sulu.cropAllLabels=function(t,n){var r=e.sandbox;n||(n="crop");var i=r.dom.find("label."+n,t),s,u;for(s=-1,u=i.length;++s");$("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:'
'}},{name:"toggler-on",template:{title:"",content:'
'}},{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 .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;o0&&arguments[0]!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,r=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[r?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(n){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=t;if(this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(t!==undefined){if(!t||(typeof t=="undefined"?"undefined":i(t))!=="object"||t.nodeType!==1)throw new Error('Invalid "target" value, use a valid Element');if(this.action==="copy"&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();e.exports=u})},{select:5}],8:[function(t,n,r){(function(i,s){if(typeof e=="function"&&e.amd)e(["module","./clipboard-action","tiny-emitter","good-listener"],s);else if(typeof r!="undefined")s(n,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};s(o,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=o.exports}})(this,function(e,t,n,r){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?e:t}function h(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e,t){var n="data-clipboard-"+e;if(!t.hasAttribute(n))return;return t.getAttribute(n)}var i=u(t),s=u(n),o=u(r),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof t.action=="function"?t.action:this.defaultAction,this.target=typeof t.target=="function"?t.target:this.defaultTarget,this.text=typeof t.text=="function"?t.text:this.defaultText,this.container=a(t.container)==="object"?t.container:document.body}},{key:"listenClick",value:function(t){var n=this;this.listener=(0,o.default)(t,"click",function(e){return n.onClick(e)})}},{key:"onClick",value:function(t){var n=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var n=d("target",t);if(n)return document.querySelector(n)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],n=typeof t=="string"?[t]:t,r=!!document.queryCommandSupported;return n.forEach(function(e){r=r&&!!document.queryCommandSupported(e)}),r}}]),t}(s.default);e.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),define("aura_extensions/clipboard",["jquery","vendor/clipboard/clipboard"],function(e,t){"use strict";function n(e,n){this.clipboard=new t(e,n||{})}return n.prototype.destroy=function(){this.clipboard.destroy()},{name:"clipboard",initialize:function(e){e.sandbox.clipboard={initialize:function(e,t){return new n(e,t)}},e.components.before("destroy",function(){!this.clipboard||this.clipboard.destroy()})}}}),define("aura_extensions/form-tab",["underscore","jquery"],function(e,t){"use strict";var n={name:"form-tab",layout:{extendExisting:!0,content:{width:"fixed",rightSpace:!0,leftSpace:!0}},initialize:function(){this.formId=this.getFormId(),this.tabInitialize(),this.render(this.data),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on("sulu.tab.save",this.submit.bind(this))},validate:function(){return this.sandbox.form.validate(this.formId)?!0:!1},submit:function(){if(!this.validate()){this.sandbox.emit("sulu.header.toolbar.item.enable","save",!1);return}var t=this.sandbox.form.getData(this.formId);e.each(t,function(e,t){this.data[t]=e}.bind(this)),this.save(this.data)},render:function(e){this.data=e,this.$el.html(this.getTemplate()),this.createForm(e),this.rendered()},createForm:function(e){this.sandbox.form.create(this.formId).initialized.then(function(){this.sandbox.form.setData(this.formId,e).then(function(){this.sandbox.start(this.formId).then(this.listenForChange.bind(this))}.bind(this))}.bind(this))},listenForChange:function(){this.sandbox.dom.on(this.formId,"change keyup",this.setDirty.bind(this)),this.sandbox.on("husky.ckeditor.changed",this.setDirty.bind(this))},loadComponentData:function(){var e=t.Deferred();return e.resolve(this.parseData(this.options.data())),e},tabInitialize:function(){this.sandbox.emit("sulu.tab.initialize",this.name)},rendered:function(){this.sandbox.emit("sulu.tab.rendered",this.name)},setDirty:function(){this.sandbox.emit("sulu.tab.dirty")},saved:function(e){this.sandbox.emit("sulu.tab.saved",e)},parseData:function(e){throw new Error('"parseData" not implemented')},save:function(e){throw new Error('"save" not implemented')},getTemplate:function(){throw new Error('"getTemplate" not implemented')},getFormId:function(){throw new Error('"getFormId" not implemented')}};return{name:n.name,initialize:function(e){e.components.addType(n.name,n)}}}),define("widget-groups",["config"],function(e){"use strict";var t=e.get("sulu_admin.widget_groups");return{exists:function(e){return e=e.replace("-","_"),!!t[e]&&!!t[e].mappings&&t[e].mappings.length>0}}}),define("__component__$app@suluadmin",[],function(){"use strict";var e,t={suluNavigateAMark:'[data-sulu-navigate="true"]',fixedWidthClass:"fixed",navigationCollapsedClass:"navigation-collapsed",smallFixedClass:"small-fixed",initialLoaderClass:"initial-loader",maxWidthClass:"max",columnSelector:".content-column",noLeftSpaceClass:"no-left-space",noRightSpaceClass:"no-right-space",noTopSpaceClass:"no-top-space",noTransitionsClass:"no-transitions",versionHistoryUrl:"https://github.com/sulu-cmf/sulu-standard/releases",changeLanguageUrl:"/admin/security/profile/language"},n="sulu.app.",r=function(){return l("initialized")},i=function(){return l("before-navigate")},s=function(){return l("has-started")},o=function(){return l("change-user-locale")},u=function(){return l("change-width")},a=function(){return l("change-spacing")},f=function(){return l("toggle-column")},l=function(e){return n+e};return{name:"Sulu App",initialize:function(){this.title=document.title,this.initializeRouter(),this.bindCustomEvents(),this.bindDomEvents(),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment),this.sandbox.emit(r.call(this)),this.sandbox.util.ajaxError(function(e,t){switch(t.status){case 401:window.location.replace("/admin/login");break;case 403:this.sandbox.emit("sulu.labels.error.show","public.forbidden","public.forbidden.description","")}}.bind(this))},extractErrorMessage:function(e){var t=[e.status];if(e.responseJSON!==undefined){var n=e.responseJSON;this.sandbox.util.each(n,function(e){var r=n[e];r.message!==undefined&&t.push(r.message)})}return t.join(", ")},initializeRouter:function(){var t=this.sandbox.mvc.Router();e=new t,this.sandbox.mvc.routes.push({route:"",callback:function(){return'
'}}),this.sandbox.util._.each(this.sandbox.mvc.routes,function(t){e.route(t.route,function(){this.routeCallback.call(this,t,arguments)}.bind(this))}.bind(this))},routeCallback:function(e,t){this.sandbox.mvc.Store.reset(),this.beforeNavigateCleanup(e);var n=e.callback.apply(this,t);!n||(this.selectNavigationItem(this.sandbox.mvc.history.fragment),n=this.sandbox.dom.createElement(n),this.sandbox.dom.html("#content",n),this.sandbox.start("#content",{reset:!0}))},selectNavigationItem:function(e){this.sandbox.emit("husky.navigation.select-item",e)},bindDomEvents:function(){this.sandbox.dom.on(this.sandbox.dom.$document,"click",function(e){this.sandbox.dom.preventDefault(e);var t=this.sandbox.dom.attr(e.currentTarget,"data-sulu-event"),n=this.sandbox.dom.data(e.currentTarget,"eventArgs");!!t&&typeof t=="string"&&this.sandbox.emit(t,n),!!e.currentTarget.attributes.href&&!!e.currentTarget.attributes.href.value&&e.currentTarget.attributes.href.value!=="#"&&this.emitNavigationEvent({action:e.currentTarget.attributes.href.value})}.bind(this),"a"+t.suluNavigateAMark)},navigate:function(t,n,r){this.sandbox.emit(i.call(this)),n=typeof n!="undefined"?n:!0,r=r===!0,r&&(this.sandbox.mvc.history.fragment=null),e.navigate(t,{trigger:n}),this.sandbox.dom.scrollTop(this.sandbox.dom.$window,0)},beforeNavigateCleanup:function(){this.sandbox.stop(".sulu-header"),this.sandbox.stop("#content > *"),this.sandbox.stop("#sidebar > *"),app.cleanUp()},bindCustomEvents:function(){this.sandbox.on("sulu.router.navigate",this.navigate.bind(this)),this.sandbox.on("husky.navigation.item.select",function(e){this.emitNavigationEvent(e),e.parentTitle?this.setTitlePostfix(this.sandbox.translate(e.parentTitle)):!e.title||this.setTitlePostfix(this.sandbox.translate(e.title))}.bind(this)),this.sandbox.on("husky.navigation.collapsed",function(){this.$find(".navigation-container").addClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.uncollapsed",function(){this.$find(".navigation-container").removeClass(t.navigationCollapsedClass)}.bind(this)),this.sandbox.on("husky.navigation.header.clicked",function(){this.navigate("",!0,!1)}.bind(this)),this.sandbox.on("husky.tabs.header.item.select",function(e){this.emitNavigationEvent(e)}.bind(this)),this.sandbox.on(s.call(this),function(e){e(!0)}.bind(this)),this.sandbox.on("husky.navigation.initialized",function(){this.sandbox.dom.remove("."+t.initialLoaderClass),!!this.sandbox.mvc.history.fragment&&this.sandbox.mvc.history.fragment.length>0&&this.selectNavigationItem(this.sandbox.mvc.history.fragment)}.bind(this)),this.sandbox.on("husky.navigation.version-history.clicked",function(){window.open(t.versionHistoryUrl,"_blank")}.bind(this)),this.sandbox.on("husky.navigation.user-locale.changed",this.changeUserLocale.bind(this)),this.sandbox.on("husky.navigation.username.clicked",this.routeToUserForm.bind(this)),this.sandbox.on(o.call(this),this.changeUserLocale.bind(this)),this.sandbox.on(u.call(this),this.changeWidth.bind(this)),this.sandbox.on(a.call(this),this.changeSpacing.bind(this)),this.sandbox.on(f.call(this),this.toggleColumn.bind(this))},toggleColumn:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(n,t.noTransitionsClass),this.sandbox.dom.on(n,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")}.bind(this)),e?(this.sandbox.emit("husky.navigation.hide"),this.sandbox.dom.addClass(n,t.smallFixedClass)):(this.sandbox.emit("husky.navigation.show"),this.sandbox.dom.removeClass(n,t.smallFixedClass))},changeSpacing:function(e,n,r){var i=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.addClass(i,t.noTransitionsClass),e===!1?this.sandbox.dom.addClass(i,t.noLeftSpaceClass):e===!0&&this.sandbox.dom.removeClass(i,t.noLeftSpaceClass),n===!1?this.sandbox.dom.addClass(i,t.noRightSpaceClass):n===!0&&this.sandbox.dom.removeClass(i,t.noRightSpaceClass),r===!1?this.sandbox.dom.addClass(i,t.noTopSpaceClass):r===!0&&this.sandbox.dom.removeClass(i,t.noTopSpaceClass)},changeWidth:function(e,n){var r=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.removeClass(r,t.noTransitionsClass),n===!0&&this.sandbox.dom.removeClass(r,t.smallFixedClass),e==="fixed"?this.changeToFixedWidth(!1):e==="max"?this.changeToMaxWidth():e==="fixed-small"&&this.changeToFixedWidth(!0),this.sandbox.dom.trigger(this.sandbox.dom.window,"resize")},changeToFixedWidth:function(e){var n=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(n,t.fixedWidthClass)||(this.sandbox.dom.removeClass(n,t.maxWidthClass),this.sandbox.dom.addClass(n,t.fixedWidthClass)),e===!0&&this.sandbox.dom.addClass(n,t.smallFixedClass)},changeToMaxWidth:function(){var e=this.sandbox.dom.find(t.columnSelector);this.sandbox.dom.hasClass(e,t.maxWidthClass)||(this.sandbox.dom.removeClass(e,t.fixedWidthClass),this.sandbox.dom.addClass(e,t.maxWidthClass))},changeUserLocale:function(e){this.sandbox.util.ajax({type:"PUT",url:t.changeLanguageUrl,contentType:"application/json",dataType:"json",data:JSON.stringify({locale:e}),success:function(){this.sandbox.dom.window.location.reload()}.bind(this)})},routeToUserForm:function(){this.navigate("contacts/contacts/edit:"+this.sandbox.sulu.user.contact.id+"/details",!0,!1,!1)},setTitlePostfix:function(e){document.title=this.title+" - "+e},emitNavigationEvent:function(e){!e.action||this.sandbox.emit("sulu.router.navigate",e.action,e.forceReload)}}}),define("__component__$overlay@suluadmin",[],function(){"use strict";var e=function(e){return"sulu.overlay."+e},t=function(){return e.call(this,"initialized")},n=function(){return e.call(this,"canceled")},r=function(){return e.call(this,"confirmed")},i=function(){return e.call(this,"show-error")},s=function(){return e.call(this,"show-warning")};return{initialize:function(){this.bindCustomEvents(),this.sandbox.emit(t.call(this))},bindCustomEvents:function(){this.sandbox.on(i.call(this),this.showError.bind(this)),this.sandbox.on(s.call(this),this.showWarning.bind(this))},showError:function(e,t,n,r){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,type:"alert"},r))},showWarning:function(e,t,n,r,i){this.startOverlay(this.sandbox.util.extend(!0,{},{title:this.sandbox.translate(e),message:this.sandbox.translate(t),closeCallback:n,okCallback:r,type:"alert"},i))},startOverlay:function(e){var t=this.sandbox.dom.createElement("
"),i;this.sandbox.dom.append(this.$el,t),i={el:t,cancelCallback:function(){this.sandbox.emit(n.call(this))}.bind(this),okCallback:function(){this.sandbox.emit(r.call(this))}.bind(this)},e=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"overlay@husky",options:e}])}}}),define("__component__$header@suluadmin",[],function(){"use strict";var e={instanceName:"",tabsData:null,tabsParentOptions:{},tabsOption:{},tabsComponentOptions:{},toolbarOptions:{},tabsContainer:null,toolbarLanguageChanger:!1,toolbarButtons:[],toolbarDisabled:!1,noBack:!1,scrollContainerSelector:".content-column > .wrapper .page",scrollDelta:50},t={componentClass:"sulu-header",hasTabsClass:"has-tabs",hasLabelClass:"has-label",backClass:"back",backIcon:"chevron-left",toolbarClass:"toolbar",tabsRowClass:"tabs-row",tabsClass:"tabs",tabsLabelContainer:"tabs-label",tabsSelector:".tabs-container",toolbarSelector:".toolbar-container",rightSelector:".right-container",languageChangerTitleSelector:".language-changer .title",hideTabsClass:"tabs-hidden",tabsContentClass:"tabs-content",contentTitleClass:"sulu-title",breadcrumbContainerClass:"sulu-breadcrumb",toolbarDefaults:{groups:[{id:"left",align:"left"}]},languageChangerDefaults:{instanceName:"header-language",alignment:"right",valueName:"title"}},n={toolbarRow:['
','
','
',' ',"
",'
','
',"
",'
',"
","
"].join(""),tabsRow:['
','
',"
"].join(""),languageChanger:['
',' <%= title %>',' ',"
"].join(""),titleElement:['
','
',"

<%= title %>

","
","
"].join("")},r=function(e){return"sulu.header."+(this.options.instanceName?this.options.instanceName+".":"")+e},i=function(){return r.call(this,"initialized")},s=function(){return r.call(this,"back")},o=function(){return r.call(this,"language-changed")},u=function(){return r.call(this,"breadcrumb-clicked")},a=function(){return r.call(this,"change-language")},f=function(){return r.call(this,"tab-changed")},l=function(){return r.call(this,"set-title")},c=function(){return r.call(this,"saved")},h=function(){return r.call(this,"set-toolbar")},p=function(){return r.call(this,"tabs.activate")},d=function(){return r.call(this,"tabs.deactivate")},v=function(){return r.call(this,"tabs.label.show")},m=function(){return r.call(this,"tabs.label.hide")},g=function(){return r.call(this,"toolbar.button.set")},y=function(){return r.call(this,"toolbar.item.loading")},b=function(){return r.call(this,"toolbar.item.change")},w=function(){return r.call(this,"toolbar.item.mark")},E=function(){return r.call(this,"toolbar.item.show")},S=function(){return r.call(this,"toolbar.item.hide")},x=function(){return r.call(this,"toolbar.item.enable")},T=function(){return r.call(this,"toolbar.item.disable")},N=function(){return r.call(this,"toolbar.items.set")};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.toolbarInstanceName="header"+this.options.instanceName,this.oldScrollPosition=0,this.tabsAction=null,this.bindCustomEvents(),this.render(),this.bindDomEvents();var t,n;t=this.startToolbar(),this.startLanguageChanger(),n=this.startTabs(),this.sandbox.data.when(t,n).then(function(){this.sandbox.emit(i.call(this)),this.oldScrollPosition=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector)}.bind(this))},destroy:function(){this.removeTitle()},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.toolbarRow)()),this.sandbox.dom.append(this.$el,this.sandbox.util.template(n.tabsRow)()),this.options.tabsData||this.renderTitle(),this.options.noBack===!0?this.sandbox.dom.hide(this.$find("."+t.backClass)):this.sandbox.dom.show(this.$find("."+t.backClass))},renderTitle:function(){var e=typeof this.options.title=="function"?this.options.title():this.options.title,t;this.removeTitle(),!e||(t=this.sandbox.dom.createElement(this.sandbox.util.template(n.titleElement,{title:this.sandbox.util.escapeHtml(this.sandbox.translate(e)),underline:this.options.underline})),$(".page").prepend(t),this.renderBreadcrumb(t.children().first()))},renderBreadcrumb:function(e){var n=this.options.breadcrumb,r;n=typeof n=="function"?n():n;if(!n)return;r=$('
'),e.append(r),this.sandbox.start([{name:"breadcrumbs@suluadmin",options:{el:r,instanceName:"header",breadcrumbs:n}}])},setTitle:function(e){this.options.title=e,this.renderTitle()},removeTitle:function(){$(".page").find("."+t.contentTitleClass).remove()},startTabs:function(){var e=this.sandbox.data.deferred();return this.options.tabsData?this.options.tabsData.length>0?this.startTabsComponent(e):e.resolve():e.resolve(),e},startTabsComponent:function(e){if(!!this.options.tabsData){var n=this.sandbox.dom.createElement("
"),r={el:n,data:this.options.tabsData,instanceName:"header"+this.options.instanceName,forceReload:!1,forceSelect:!0,fragment:this.sandbox.mvc.history.fragment};this.sandbox.once("husky.tabs.header.initialized",function(n,r){r>1&&this.sandbox.dom.addClass(this.$el,t.hasTabsClass),e.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.tabsClass),n),r=this.sandbox.util.extend(!0,{},r,this.options.tabsComponentOptions),this.sandbox.start([{name:"tabs@husky",options:r}])}},startToolbar:function(){var e=this.sandbox.data.deferred();if(this.options.toolbarDisabled!==!0){var n=this.options.toolbarOptions;n=this.sandbox.util.extend(!0,{},t.toolbarDefaults,n,{buttons:this.sandbox.sulu.buttons.get.call(this,this.options.toolbarButtons)}),this.startToolbarComponent(n,e)}else e.resolve();return e},startLanguageChanger:function(){if(!this.options.toolbarLanguageChanger)this.sandbox.dom.hide(this.$find(t.rightSelector));else{var e=this.sandbox.dom.createElement(this.sandbox.util.template(n.languageChanger)({title:this.options.toolbarLanguageChanger.preSelected||this.sandbox.sulu.getDefaultContentLocale()})),r=t.languageChangerDefaults;this.sandbox.dom.show(this.$find(t.rightSelector)),this.sandbox.dom.append(this.$find(t.rightSelector),e),r.el=e,r.data=this.options.toolbarLanguageChanger.data||this.getDefaultLanguages(),this.sandbox.start([{name:"dropdown@husky",options:r}])}},getDefaultLanguages:function(){var e=[],t,n;for(t=-1,n=this.sandbox.sulu.locales.length;++t"),i={el:r,skin:"big",instanceName:this.toolbarInstanceName,responsive:!0};!n||this.sandbox.once("husky.toolbar."+this.toolbarInstanceName+".initialized",function(){n.resolve()}.bind(this)),this.sandbox.dom.html(this.$find("."+t.toolbarClass),r),i=this.sandbox.util.extend(!0,{},i,e),this.sandbox.start([{name:"toolbar@husky",options:i}])},bindCustomEvents:function(){this.sandbox.on("husky.dropdown.header-language.item.click",this.languageChanged.bind(this)),this.sandbox.on("husky.tabs.header.initialized",this.tabChangedHandler.bind(this)),this.sandbox.on("husky.tabs.header.item.select",this.tabChangedHandler.bind(this)),this.sandbox.on("sulu.breadcrumbs.header.breadcrumb-clicked",function(e){this.sandbox.emit(u.call(this),e)}.bind(this)),this.sandbox.on(h.call(this),this.setToolbar.bind(this)),this.sandbox.on(l.call(this),this.setTitle.bind(this)),this.sandbox.on(c.call(this),this.saved.bind(this)),this.sandbox.on(a.call(this),this.setLanguageChanger.bind(this)),this.bindAbstractToolbarEvents(),this.bindAbstractTabsEvents()},saved:function(e){this.sandbox.once("husky.tabs.header.updated",function(e){e>1?this.sandbox.dom.addClass(this.$el,t.hasTabsClass):this.sandbox.dom.removeClass(this.$el,t.hasTabsClass)}.bind(this)),this.sandbox.emit("husky.tabs.header.update",e)},setToolbar:function(e){typeof e.languageChanger!="undefined"&&(this.options.toolbarLanguageChanger=e.languageChanger),this.options.toolbarDisabled=!1,this.options.toolbarOptions=e.options||this.options.toolbarOptions,this.options.toolbarButtons=e.buttons||this.options.toolbarButtons,this.sandbox.stop(this.$find("."+t.toolbarClass+" *")),this.sandbox.stop(this.$find(t.rightSelector+" *")),this.startToolbar(),this.startLanguageChanger()},tabChangedHandler:function(e){if(!e.component)this.renderTitle(),this.sandbox.emit(f.call(this),e);else{var n;if(!e.forceReload&&e.action===this.tabsAction)return!1;this.tabsAction=e.action,!e.resetStore||this.sandbox.mvc.Store.reset(),this.stopTabContent();var r=this.sandbox.dom.createElement('
');this.sandbox.dom.append(this.options.tabsContainer,r),n=this.sandbox.util.extend(!0,{},this.options.tabsParentOption,this.options.tabsOption,{el:r},e.componentOptions),this.sandbox.start([{name:e.component,options:n}]).then(function(e){!e.tabOptions||!e.tabOptions.noTitle?this.renderTitle():this.removeTitle()}.bind(this))}},stopTabContent:function(){App.stop("."+t.tabsContentClass+" *"),App.stop("."+t.tabsContentClass)},languageChanged:function(e){this.setLanguageChanger(e.title),this.sandbox.emit(o.call(this),e)},setLanguageChanger:function(e){this.sandbox.dom.html(this.$find(t.languageChangerTitleSelector),e)},bindAbstractToolbarEvents:function(){this.sandbox.on(N.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".items.set",e,t)}.bind(this)),this.sandbox.on(g.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".button.set",e,t)}.bind(this)),this.sandbox.on(y.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.loading",e)}.bind(this)),this.sandbox.on(b.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.change",e,t)}.bind(this)),this.sandbox.on(E.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.show",e,t)}.bind(this)),this.sandbox.on(S.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.hide",e,t)}.bind(this)),this.sandbox.on(x.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.enable",e,t)}.bind(this)),this.sandbox.on(T.call(this),function(e,t){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.disable",e,t)}.bind(this)),this.sandbox.on(w.call(this),function(e){this.sandbox.emit("husky.toolbar."+this.toolbarInstanceName+".item.mark",e)}.bind(this))},bindAbstractTabsEvents:function(){this.sandbox.on(p.call(this),function(){this.sandbox.emit("husky.tabs.header.deactivate")}.bind(this)),this.sandbox.on(d.call(this),function(){this.sandbox.emit("husky.tabs.header.activate")}.bind(this)),this.sandbox.on(v.call(this),function(e,t){this.showTabsLabel(e,t)}.bind(this)),this.sandbox.on(m.call(this),function(){this.hideTabsLabel()}.bind(this))},bindDomEvents:function(){this.sandbox.dom.on(this.$el,"click",function(){this.sandbox.emit(s.call(this))}.bind(this),"."+t.backClass),!this.options.tabsData||this.sandbox.dom.on(this.options.scrollContainerSelector,"scroll",this.scrollHandler.bind(this))},scrollHandler:function(){var e=this.sandbox.dom.scrollTop(this.options.scrollContainerSelector);e<=this.oldScrollPosition-this.options.scrollDelta||e=this.oldScrollPosition+this.options.scrollDelta&&(this.hideTabs(),this.oldScrollPosition=e)},hideTabs:function(){this.sandbox.dom.addClass(this.$el,t.hideTabsClass)},showTabs:function(){this.sandbox.dom.removeClass(this.$el,t.hideTabsClass)},showTabsLabel:function(e,n){var r=$('
');this.$find("."+t.tabsRowClass).append(r),this.sandbox.emit("sulu.labels.label.show",{instanceName:"header",el:r,type:"WARNING",description:e,title:"",autoVanish:!1,hasClose:!1,additionalLabelClasses:"small",buttons:n||[]}),this.sandbox.dom.addClass(this.$el,t.hasLabelClass)},hideTabsLabel:function(){this.sandbox.stop("."+t.tabsLabelContainer),this.$el.removeClass(t.hasLabelClass)}}}),define("__component__$breadcrumbs@suluadmin",[],function(){"use strict";var e={breadcrumbs:[]},t={breadcrumb:['','<% if (!!icon) { %><% } %><%= title %>',""].join("")};return{events:{names:{breadcrumbClicked:{postFix:"breadcrumb-clicked"}},namespace:"sulu.breadcrumbs."},initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.options.breadcrumbs.forEach(function(e){var n=$(this.sandbox.util.template(t.breadcrumb,{title:this.sandbox.translate(e.title),icon:e.icon}));n.on("click",function(){this.events.breadcrumbClicked(e)}.bind(this)),this.$el.append(n)}.bind(this))}}}),define("__component__$list-toolbar@suluadmin",[],function(){"use strict";var e={heading:"",template:"default",parentTemplate:null,listener:"default",parentListener:null,instanceName:"content",showTitleAsTooltip:!0,groups:[{id:1,align:"left"},{id:2,align:"right"}],columnOptions:{disabled:!1,data:[],key:null}},t={"default":function(){return this.sandbox.sulu.buttons.get({settings:{options:{dropdownItems:[{type:"columnOptions"}]}}})},defaultEditable:function(){return t.default.call(this).concat(this.sandbox.sulu.buttons.get({editSelected:{options:{callback:function(){this.sandbox.emit("sulu.list-toolbar.edit")}.bind(this)}}}))},defaultNoSettings:function(){var e=t.default.call(this);return e.splice(2,1),e},onlyAdd:function(){var e=t.default.call(this);return e.splice(1,2),e},changeable:function(){return this.sandbox.sulu.buttons.get({layout:{}})}},n={"default":function(){var e=this.options.instanceName?this.options.instanceName+".":"",t;this.sandbox.on("husky.datagrid.number.selections",function(n){t=n>0?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"delete.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"deleteSelected",!1)}.bind(this)),this.sandbox.on("sulu.list-toolbar."+e+"edit.state-change",function(n){t=n?"enable":"disable",this.sandbox.emit("husky.toolbar."+e+"item."+t,"editSelected",!1)}.bind(this))}},r=function(){return{title:this.sandbox.translate("list-toolbar.column-options"),disabled:!1,callback:function(){var e;this.sandbox.dom.append("body",'
'),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"),this.html(r),a.el=r,u.call(this,a)}}}),define("__component__$labels@suluadmin",[],function(){"use strict";var e={navigationLabelsSelector:".sulu-navigation-labels"},t="sulu.labels.",n=function(){return a.call(this,"error.show")},r=function(){return a.call(this,"warning.show")},i=function(){return a.call(this,"success.show")},s=function(){return a.call(this,"label.show")},o=function(){return a.call(this,"remove")},u=function(){return a.call(this,"label.remove")},a=function(e){return t+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.labelId=0,this.labels={},this.labels.SUCCESS={},this.labels.SUCCESS_ICON={},this.labels.WARNING={},this.labels.ERROR={},this.labelsById={},this.$navigationLabels=$(this.options.navigationLabelsSelector),this.bindCustomEvents()},bindCustomEvents:function(){this.sandbox.on(n.call(this),function(e,t,n,r){this.showLabel("ERROR",e,t||"labels.error",n,!1,r)}.bind(this)),this.sandbox.on(r.call(this),function(e,t,n,r){this.showLabel("WARNING",e,t||"labels.warning",n,!1,r)}.bind(this)),this.sandbox.on(i.call(this),function(e,t,n,r){this.showLabel("SUCCESS_ICON",e,t||"labels.success",n,!0,r)}.bind(this)),this.sandbox.on(s.call(this),function(e){this.startLabelComponent(e)}.bind(this)),this.sandbox.on(o.call(this),function(){this.removeLabels()}.bind(this)),this.sandbox.on(u.call(this),function(e){this.removeLabelWithId(e)}.bind(this))},removeLabels:function(){this.sandbox.dom.html(this.$el,"")},createLabelContainer:function(e,t){var n=this.sandbox.dom.createElement("
"),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('
');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:['
','','
',"
"].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)}}}); \ No newline at end of file diff --git a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1596097643307.css b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1598423107728.css similarity index 100% rename from src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1596097643307.css rename to src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1598423107728.css diff --git a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1596097643307.js b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1598423107728.js similarity index 99% rename from src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1596097643307.js rename to src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1598423107728.js index 66d316c6653..1b7b6767a96 100644 --- a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1596097643307.js +++ b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.1598423107728.js @@ -1 +1 @@ -require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1596097643307"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['
',' ','
','
',"
","
"].join(""),contentContainer:['
','
',' ','
',"
",' ",'
','
',"
","
"].join(""),loginFrame:function(){return['"].join("")},forgotPasswordFrame:['
','
',' ','
',' ',"
","
",' ","
"].join(""),resendMailFrame:['
','
',' <%= sentMessage %>',' ',"
",' ","
"].join(""),resetPasswordFrame:['
','
','
',' ',"
",'
',' ',"
","
",' ","
"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('
'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}}); \ No newline at end of file +require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1598423107728"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['
',' ','
','
',"
","
"].join(""),contentContainer:['
','
',' ','
',"
",' ",'
','
',"
","
"].join(""),loginFrame:function(){return['"].join("")},forgotPasswordFrame:['
','
',' ','
',' ',"
","
",' ","
"].join(""),resendMailFrame:['
','
',' <%= sentMessage %>',' ',"
",' ","
"].join(""),resetPasswordFrame:['
','
','
',' ',"
",'
',' ',"
","
",' ","
"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('
'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}}); \ No newline at end of file diff --git a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.js b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.js index 66d316c6653..1b7b6767a96 100644 --- a/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.js +++ b/src/Sulu/Bundle/AdminBundle/Resources/public/dist/login.min.js @@ -1 +1 @@ -require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1596097643307"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['
',' ','
','
',"
","
"].join(""),contentContainer:['
','
',' ','
',"
",' ",'
','
',"
","
"].join(""),loginFrame:function(){return['"].join("")},forgotPasswordFrame:['
','
',' ','
',' ',"
","
",' ","
"].join(""),resendMailFrame:['
','
',' <%= sentMessage %>',' ',"
",' ","
"].join(""),resetPasswordFrame:['
','
','
',' ',"
",'
',' ',"
","
",' ","
"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('
'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}}); \ No newline at end of file +require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions/backbone-relational","__component__$login@suluadmin"],exclude:["husky"],urlArgs:"v=1598423107728"}),define("underscore",[],function(){return window._}),require(["husky"],function(e){"use strict";var t,n=SULU.translations,r=SULU.fallbackLocale;t=window.navigator.languages?window.navigator.languages[0]:null,t=t||window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage,t=t.slice(0,2).toLowerCase(),n.indexOf(t)===-1&&(t=r),require(["text!/admin/translations/sulu."+t+".json","text!/admin/translations/sulu."+r+".json"],function(n,r){var i=JSON.parse(n),s=JSON.parse(r),o=new e({debug:{enable:!!SULU.debug},culture:{name:t,messages:i,defaultMessages:s}});o.use("aura_extensions/backbone-relational"),o.components.addSource("suluadmin","/bundles/suluadmin/js/components"),o.start(),window.app=o})}),define("main",function(){}),function(e,t){typeof define=="function"&&define.amd?define("vendor/backbone-relational/backbone-relational",["exports","backbone","underscore"],t):typeof exports!="undefined"?t(exports,require("backbone"),require("underscore")):t(e,e.Backbone,e._)}(this,function(e,t,n){"use strict";t.Relational={showWarnings:!0},t.Semaphore={_permitsAvailable:null,_permitsUsed:0,acquire:function(){if(this._permitsAvailable&&this._permitsUsed>=this._permitsAvailable)throw new Error("Max permits acquired");this._permitsUsed++},release:function(){if(this._permitsUsed===0)throw new Error("All permits released");this._permitsUsed--},isLocked:function(){return this._permitsUsed>0},setAvailablePermits:function(e){if(this._permitsUsed>e)throw new Error("Available permits cannot be less than used permits");this._permitsAvailable=e}},t.BlockingQueue=function(){this._queue=[]},n.extend(t.BlockingQueue.prototype,t.Semaphore,{_queue:null,add:function(e){this.isBlocked()?this._queue.push(e):e()},process:function(){var e=this._queue;this._queue=[];while(e&&e.length)e.shift()()},block:function(){this.acquire()},unblock:function(){this.release(),this.isBlocked()||this.process()},isBlocked:function(){return this.isLocked()}}),t.Relational.eventQueue=new t.BlockingQueue,t.Store=function(){this._collections=[],this._reverseRelations=[],this._orphanRelations=[],this._subModels=[],this._modelScopes=[e]},n.extend(t.Store.prototype,t.Events,{initializeRelation:function(e,r,i){var s=n.isString(r.type)?t[r.type]||this.getObjectByName(r.type):r.type;s&&s.prototype instanceof t.Relation?new s(e,r,i):t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; missing or invalid relation type!",r)},addModelScope:function(e){this._modelScopes.push(e)},removeModelScope:function(e){this._modelScopes=n.without(this._modelScopes,e)},addSubModels:function(e,t){this._subModels.push({superModelType:t,subModels:e})},setupSuperModel:function(e){n.find(this._subModels,function(t){return n.filter(t.subModels||[],function(n,r){var i=this.getObjectByName(n);if(e===i)return t.superModelType._subModels[r]=e,e._superModel=t.superModelType,e._subModelTypeValue=r,e._subModelTypeAttribute=t.superModelType.prototype.subModelTypeAttribute,!0},this).length},this)},addReverseRelation:function(e){var t=n.any(this._reverseRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&(this._reverseRelations.push(e),this._addRelation(e.model,e),this.retroFitRelation(e))},addOrphanRelation:function(e){var t=n.any(this._orphanRelations,function(t){return n.all(e||[],function(e,n){return e===t[n]})});!t&&e.model&&e.type&&this._orphanRelations.push(e)},processOrphanRelations:function(){n.each(this._orphanRelations.slice(0),function(e){var r=t.Relational.store.getObjectByName(e.relatedModel);r&&(this.initializeRelation(null,e),this._orphanRelations=n.without(this._orphanRelations,e))},this)},_addRelation:function(e,t){e.prototype.relations||(e.prototype.relations=[]),e.prototype.relations.push(t),n.each(e._subModels||[],function(e){this._addRelation(e,t)},this)},retroFitRelation:function(e){var t=this.getCollection(e.model,!1);t&&t.each(function(t){if(!(t instanceof e.model))return;new e.type(t,e)},this)},getCollection:function(e,r){e instanceof t.RelationalModel&&(e=e.constructor);var i=e;while(i._superModel)i=i._superModel;var s=n.find(this._collections,function(e){return e.model===i});return!s&&r!==!1&&(s=this._createCollection(i)),s},getObjectByName:function(e){var t=e.split("."),r=null;return n.find(this._modelScopes,function(e){r=n.reduce(t||[],function(e,t){return e?e[t]:undefined},e);if(r&&r!==e)return!0},this),r},_createCollection:function(e){var n;return e instanceof t.RelationalModel&&(e=e.constructor),e.prototype instanceof t.RelationalModel&&(n=new t.Collection,n.model=e,this._collections.push(n)),n},resolveIdForItem:function(e,r){var i=n.isString(r)||n.isNumber(r)?r:null;return i===null&&(r instanceof t.RelationalModel?i=r.id:n.isObject(r)&&(i=r[e.prototype.idAttribute])),!i&&i!==0&&(i=null),i},find:function(e,t){var n=this.resolveIdForItem(e,t),r=this.getCollection(e);if(r){var i=r.get(n);if(i instanceof e)return i}return null},register:function(e){var t=this.getCollection(e);if(t){var n=e.collection;t.add(e),e.collection=n}},checkId:function(e,n){var r=this.getCollection(e),i=r&&r.get(n);if(i&&e!==i)throw t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Duplicate id! Old RelationalModel=%o, new RelationalModel=%o",i,e),new Error("Cannot instantiate more than one Backbone.RelationalModel with the same id per type!")},update:function(e){var t=this.getCollection(e);t.contains(e)||this.register(e),t._onModelEvent("change:"+e.idAttribute,e,t),e.trigger("relational:change:id",e,t)},unregister:function(e){var r,i;e instanceof t.Model?(r=this.getCollection(e),i=[e]):e instanceof t.Collection?(r=this.getCollection(e.model),i=n.clone(e.models)):(r=this.getCollection(e),i=n.clone(r.models)),n.each(i,function(e){this.stopListening(e),n.invoke(e.getRelations(),"stopListening")},this),n.contains(this._collections,e)?r.reset([]):n.each(i,function(e){r.get(e)?r.remove(e):r.trigger("relational:remove",e,r)},this)},reset:function(){this.stopListening(),n.each(this._collections,function(e){this.unregister(e)},this),this._collections=[],this._subModels=[],this._modelScopes=[e]}}),t.Relational.store=new t.Store,t.Relation=function(e,r,i){this.instance=e,r=n.isObject(r)?r:{},this.reverseRelation=n.defaults(r.reverseRelation||{},this.options.reverseRelation),this.options=n.defaults(r,this.options,t.Relation.prototype.options),this.reverseRelation.type=n.isString(this.reverseRelation.type)?t[this.reverseRelation.type]||t.Relational.store.getObjectByName(this.reverseRelation.type):this.reverseRelation.type,this.key=this.options.key,this.keySource=this.options.keySource||this.key,this.keyDestination=this.options.keyDestination||this.keySource||this.key,this.model=this.options.model||this.instance.constructor,this.relatedModel=this.options.relatedModel,n.isFunction(this.relatedModel)&&!(this.relatedModel.prototype instanceof t.RelationalModel)&&(this.relatedModel=n.result(this,"relatedModel")),n.isString(this.relatedModel)&&(this.relatedModel=t.Relational.store.getObjectByName(this.relatedModel));if(!this.checkPreconditions())return;!this.options.isAutoRelation&&this.reverseRelation.type&&this.reverseRelation.key&&t.Relational.store.addReverseRelation(n.defaults({isAutoRelation:!0,model:this.relatedModel,relatedModel:this.model,reverseRelation:this.options},this.reverseRelation));if(e){var s=this.keySource;s!==this.key&&typeof this.instance.get(this.key)=="object"&&(s=this.key),this.setKeyContents(this.instance.get(s)),this.relatedCollection=t.Relational.store.getCollection(this.relatedModel),this.keySource!==this.key&&delete this.instance.attributes[this.keySource],this.instance._relations[this.key]=this,this.initialize(i),this.options.autoFetch&&this.instance.fetchRelated(this.key,n.isObject(this.options.autoFetch)?this.options.autoFetch:{}),this.listenTo(this.instance,"destroy",this.destroy).listenTo(this.relatedCollection,"relational:add relational:change:id",this.tryAddRelated).listenTo(this.relatedCollection,"relational:remove",this.removeRelated)}},t.Relation.extend=t.Model.extend,n.extend(t.Relation.prototype,t.Events,t.Semaphore,{options:{createModels:!0,includeInJSON:!0,isAutoRelation:!1,autoFetch:!1,parse:!1},instance:null,key:null,keyContents:null,relatedModel:null,relatedCollection:null,reverseRelation:null,related:null,checkPreconditions:function(){var e=this.instance,r=this.key,i=this.model,s=this.relatedModel,o=t.Relational.showWarnings&&typeof console!="undefined";if(!i||!r||!s)return o&&console.warn("Relation=%o: missing model, key or relatedModel (%o, %o, %o).",this,i,r,s),!1;if(i.prototype instanceof t.RelationalModel){if(s.prototype instanceof t.RelationalModel){if(this instanceof t.HasMany&&this.reverseRelation.type===t.HasMany)return o&&console.warn("Relation=%o: relation is a HasMany, and the reverseRelation is HasMany as well.",this),!1;if(e&&n.keys(e._relations).length){var u=n.find(e._relations,function(e){return e.key===r},this);if(u)return o&&console.warn("Cannot create relation=%o on %o for model=%o: already taken by relation=%o.",this,r,e,u),!1}return!0}return o&&console.warn("Relation=%o: relatedModel does not inherit from Backbone.RelationalModel (%o).",this,s),!1}return o&&console.warn("Relation=%o: model does not inherit from Backbone.RelationalModel (%o).",this,e),!1},setRelated:function(e){this.related=e,this.instance.attributes[this.key]=e},_isReverseRelation:function(e){return e.instance instanceof this.relatedModel&&this.reverseRelation.key===e.key&&this.key===e.reverseRelation.key},getReverseRelations:function(e){var t=[],r=n.isUndefined(e)?this.related&&(this.related.models||[this.related]):[e];return n.each(r||[],function(e){n.each(e.getRelations()||[],function(e){this._isReverseRelation(e)&&t.push(e)},this)},this),t},destroy:function(){this.stopListening(),this instanceof t.HasOne?this.setRelated(null):this instanceof t.HasMany&&this.setRelated(this._prepareCollection()),n.each(this.getReverseRelations(),function(e){e.removeRelated(this.instance)},this)}}),t.HasOne=t.Relation.extend({options:{reverseRelation:{type:"HasMany"}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange);var t=this.findRelated(e);this.setRelated(t),n.each(this.getReverseRelations(),function(t){t.addRelated(this.instance,e)},this)},findRelated:function(e){var t=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof this.relatedModel)t=this.keyContents;else if(this.keyContents||this.keyContents===0){var r=n.defaults({create:this.options.createModels},e);t=this.relatedModel.findOrCreate(this.keyContents,r)}return t&&(this.keyId=null),t},setKeyContents:function(e){this.keyContents=e,this.keyId=t.Relational.store.resolveIdForItem(this.relatedModel,this.keyContents)},onChange:function(e,r,i){if(this.isLocked())return;this.acquire(),i=i?n.clone(i):{};var s=n.isUndefined(i.__related),o=s?this.related:i.__related;if(s){this.setKeyContents(r);var u=this.findRelated(i);this.setRelated(u)}o&&this.related!==o&&n.each(this.getReverseRelations(o),function(e){e.removeRelated(this.instance,null,i)},this),n.each(this.getReverseRelations(),function(e){e.addRelated(this.instance,i)},this);if(!i.silent&&this.related!==o){var a=this;this.changed=!0,t.Relational.eventQueue.add(function(){a.instance.trigger("change:"+a.key,a.instance,a.related,i,!0),a.changed=!1})}this.release()},tryAddRelated:function(e,t,n){(this.keyId||this.keyId===0)&&e.id===this.keyId&&(this.addRelated(e,n),this.keyId=null)},addRelated:function(e,t){var r=this;e.queue(function(){if(e!==r.related){var i=r.related||null;r.setRelated(e),r.onChange(r.instance,e,n.defaults({__related:i},t))}})},removeRelated:function(e,t,r){if(!this.related)return;if(e===this.related){var i=this.related||null;this.setRelated(null),this.onChange(this.instance,e,n.defaults({__related:i},r))}}}),t.HasMany=t.Relation.extend({collectionType:null,options:{reverseRelation:{type:"HasOne"},collectionType:t.Collection,collectionKey:!0,collectionOptions:{}},initialize:function(e){this.listenTo(this.instance,"relational:change:"+this.key,this.onChange),this.collectionType=this.options.collectionType,n.isFunction(this.collectionType)&&this.collectionType!==t.Collection&&!(this.collectionType.prototype instanceof t.Collection)&&(this.collectionType=n.result(this,"collectionType")),n.isString(this.collectionType)&&(this.collectionType=t.Relational.store.getObjectByName(this.collectionType));if(!(this.collectionType===t.Collection||this.collectionType.prototype instanceof t.Collection))throw new Error("`collectionType` must inherit from Backbone.Collection");var r=this.findRelated(e);this.setRelated(r)},_prepareCollection:function(e){this.related&&this.stopListening(this.related);if(!e||!(e instanceof t.Collection)){var r=n.isFunction(this.options.collectionOptions)?this.options.collectionOptions(this.instance):this.options.collectionOptions;e=new this.collectionType(null,r)}e.model=this.relatedModel;if(this.options.collectionKey){var i=this.options.collectionKey===!0?this.options.reverseRelation.key:this.options.collectionKey;e[i]&&e[i]!==this.instance?t.Relational.showWarnings&&typeof console!="undefined"&&console.warn("Relation=%o; collectionKey=%s already exists on collection=%o",this,i,this.options.collectionKey):i&&(e[i]=this.instance)}return this.listenTo(e,"relational:add",this.handleAddition).listenTo(e,"relational:remove",this.handleRemoval).listenTo(e,"relational:reset",this.handleReset),e},findRelated:function(e){var r=null;e=n.defaults({parse:this.options.parse},e);if(this.keyContents instanceof t.Collection)this._prepareCollection(this.keyContents),r=this.keyContents;else{var i=[];n.each(this.keyContents,function(t){if(t instanceof this.relatedModel)var r=t;else r=this.relatedModel.findOrCreate(t,n.extend({merge:!0},e,{create:this.options.createModels}));r&&i.push(r)},this),this.related instanceof t.Collection?r=this.related:r=this._prepareCollection(),r.set(i,n.defaults({merge:!1,parse:!1},e))}return this.keyIds=n.difference(this.keyIds,n.pluck(r.models,"id")),r},setKeyContents:function(e){this.keyContents=e instanceof t.Collection?e:null,this.keyIds=[],!this.keyContents&&(e||e===0)&&(this.keyContents=n.isArray(e)?e:[e],n.each(this.keyContents,function(e){var n=t.Relational.store.resolveIdForItem(this.relatedModel,e);(n||n===0)&&this.keyIds.push(n)},this))},onChange:function(e,r,i){i=i?n.clone(i):{},this.setKeyContents(r),this.changed=!1;var s=this.findRelated(i);this.setRelated(s);if(!i.silent){var o=this;t.Relational.eventQueue.add(function(){o.changed&&(o.instance.trigger("change:"+o.key,o.instance,o.related,i,!0),o.changed=!1)})}},handleAddition:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.addRelated(this.instance,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("add:"+s.key,e,s.related,i)})},handleRemoval:function(e,r,i){i=i?n.clone(i):{},this.changed=!0,n.each(this.getReverseRelations(e),function(e){e.removeRelated(this.instance,null,i)},this);var s=this;!i.silent&&t.Relational.eventQueue.add(function(){s.instance.trigger("remove:"+s.key,e,s.related,i)})},handleReset:function(e,r){var i=this;r=r?n.clone(r):{},!r.silent&&t.Relational.eventQueue.add(function(){i.instance.trigger("reset:"+i.key,i.related,r)})},tryAddRelated:function(e,t,r){var i=n.contains(this.keyIds,e.id);i&&(this.addRelated(e,r),this.keyIds=n.without(this.keyIds,e.id))},addRelated:function(e,t){var r=this;e.queue(function(){r.related&&!r.related.get(e)&&r.related.add(e,n.defaults({parse:!1},t))})},removeRelated:function(e,t,n){this.related.get(e)&&this.related.remove(e,n)}}),t.RelationalModel=t.Model.extend({relations:null,_relations:null,_isInitialized:!1,_deferProcessing:!1,_queue:null,_attributeChangeFired:!1,subModelTypeAttribute:"type",subModelTypes:null,constructor:function(e,r){if(r&&r.collection){var i=this,s=this.collection=r.collection;delete r.collection,this._deferProcessing=!0;var o=function(e){e===i&&(i._deferProcessing=!1,i.processQueue(),s.off("relational:add",o))};s.on("relational:add",o),n.defer(function(){o(i)})}t.Relational.store.processOrphanRelations(),t.Relational.store.listenTo(this,"relational:unregister",t.Relational.store.unregister),this._queue=new t.BlockingQueue,this._queue.block(),t.Relational.eventQueue.block();try{t.Model.apply(this,arguments)}finally{t.Relational.eventQueue.unblock()}},trigger:function(e){if(e.length>5&&e.indexOf("change")===0){var n=this,r=arguments;t.Relational.eventQueue.isLocked()?t.Relational.eventQueue.add(function(){var i=!0;if(e==="change")i=n.hasChanged()||n._attributeChangeFired,n._attributeChangeFired=!1;else{var s=e.slice(7),o=n.getRelation(s);o?(i=r[4]===!0,i?n.changed[s]=r[2]:o.changed||delete n.changed[s]):i&&(n._attributeChangeFired=!0)}i&&t.Model.prototype.trigger.apply(n,r)}):t.Model.prototype.trigger.apply(n,r)}else e==="destroy"?(t.Model.prototype.trigger.apply(this,arguments),t.Relational.store.unregister(this)):t.Model.prototype.trigger.apply(this,arguments);return this},initializeRelations:function(e){this.acquire(),this._relations={},n.each(this.relations||[],function(n){t.Relational.store.initializeRelation(this,n,e)},this),this._isInitialized=!0,this.release(),this.processQueue()},updateRelations:function(e,t){this._isInitialized&&!this.isLocked()&&n.each(this._relations,function(n){if(!e||n.keySource in e||n.key in e){var r=this.attributes[n.keySource]||this.attributes[n.key],i=e&&(e[n.keySource]||e[n.key]);(n.related!==r||r===null&&i===null)&&this.trigger("relational:change:"+n.key,this,r,t||{})}n.keySource!==n.key&&delete this.attributes[n.keySource]},this)},queue:function(e){this._queue.add(e)},processQueue:function(){this._isInitialized&&!this._deferProcessing&&this._queue.isBlocked()&&this._queue.unblock()},getRelation:function(e){return this._relations[e]},getRelations:function(){return n.values(this._relations)},fetchRelated:function(e,r,i){r=n.extend({update:!0,remove:!1},r);var s,o,u=[],a=this.getRelation(e),f=a&&(a.keyIds&&a.keyIds.slice(0)||(a.keyId||a.keyId===0?[a.keyId]:[]));i&&(s=a.related instanceof t.Collection?a.related.models:[a.related],n.each(s,function(e){(e.id||e.id===0)&&f.push(e.id)}));if(f&&f.length){var l=[];s=n.map(f,function(e){var t=a.relatedModel.findModel(e);if(!t){var n={};n[a.relatedModel.prototype.idAttribute]=e,t=a.relatedModel.findOrCreate(n,r),l.push(t)}return t},this),a.related instanceof t.Collection&&n.isFunction(a.related.url)&&(o=a.related.url(s));if(o&&o!==a.related.url()){var c=n.defaults({error:function(){var e=arguments;n.each(l,function(t){t.trigger("destroy",t,t.collection,r),r.error&&r.error.apply(t,e)})},url:o},r);u=[a.related.fetch(c)]}else u=n.map(s,function(e){var t=n.defaults({error:function(){n.contains(l,e)&&(e.trigger("destroy",e,e.collection,r),r.error&&r.error.apply(e,arguments))}},r);return e.fetch(t)},this)}return u},get:function(e){var r=t.Model.prototype.get.call(this,e);if(!this.dotNotation||e.indexOf(".")===-1)return r;var i=e.split("."),s=n.reduce(i,function(e,r){if(n.isNull(e)||n.isUndefined(e))return undefined;if(e instanceof t.Model)return t.Model.prototype.get.call(e,r);if(e instanceof t.Collection)return t.Collection.prototype.at.call(e,r);throw new Error("Attribute must be an instanceof Backbone.Model or Backbone.Collection. Is: "+e+", currentSplit: "+r)},this);if(r!==undefined&&s!==undefined)throw new Error("Ambiguous result for '"+e+"'. direct result: "+r+", dotNotation: "+s);return r||s},set:function(e,r,i){t.Relational.eventQueue.block();var s;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r);try{var o=this.id,u=s&&this.idAttribute in s&&s[this.idAttribute];t.Relational.store.checkId(this,u);var a=t.Model.prototype.set.apply(this,arguments);!this._isInitialized&&!this.isLocked()?(this.constructor.initializeModelHierarchy(),(u||u===0)&&t.Relational.store.register(this),this.initializeRelations(i)):u&&u!==o&&t.Relational.store.update(this),s&&this.updateRelations(s,i)}finally{t.Relational.eventQueue.unblock()}return a},clone:function(){var e=n.clone(this.attributes);return n.isUndefined(e[this.idAttribute])||(e[this.idAttribute]=null),n.each(this.getRelations(),function(t){delete e[t.key]}),new this.constructor(e)},toJSON:function(e){if(this.isLocked())return this.id;this.acquire();var r=t.Model.prototype.toJSON.call(this,e);return this.constructor._superModel&&!(this.constructor._subModelTypeAttribute in r)&&(r[this.constructor._subModelTypeAttribute]=this.constructor._subModelTypeValue),n.each(this._relations,function(i){var s=r[i.key],o=i.options.includeInJSON,u=null;o===!0?s&&n.isFunction(s.toJSON)&&(u=s.toJSON(e)):n.isString(o)?(s instanceof t.Collection?u=s.pluck(o):s instanceof t.Model&&(u=s.get(o)),o===i.relatedModel.prototype.idAttribute&&(i instanceof t.HasMany?u=u.concat(i.keyIds):i instanceof t.HasOne&&(u=u||i.keyId,!u&&!n.isObject(i.keyContents)&&(u=i.keyContents||null)))):n.isArray(o)?s instanceof t.Collection?(u=[],s.each(function(e){var t={};n.each(o,function(n){t[n]=e.get(n)}),u.push(t)})):s instanceof t.Model&&(u={},n.each(o,function(e){u[e]=s.get(e)})):delete r[i.key],o&&(r[i.keyDestination]=u),i.keyDestination!==i.key&&delete r[i.key]}),this.release(),r}},{setup:function(e){return this.prototype.relations=(this.prototype.relations||[]).slice(0),this._subModels={},this._superModel=null,this.prototype.hasOwnProperty("subModelTypes")?t.Relational.store.addSubModels(this.prototype.subModelTypes,this):this.prototype.subModelTypes=null,n.each(this.prototype.relations||[],function(e){e.model||(e.model=this);if(e.reverseRelation&&e.model===this){var r=!0;if(n.isString(e.relatedModel)){var i=t.Relational.store.getObjectByName(e.relatedModel);r=i&&i.prototype instanceof t.RelationalModel}r?t.Relational.store.initializeRelation(null,e):n.isString(e.relatedModel)&&t.Relational.store.addOrphanRelation(e)}},this),this},build:function(e,t){this.initializeModelHierarchy();var n=this._findSubModelType(this,e)||this;return new n(e,t)},_findSubModelType:function(e,t){if(e._subModels&&e.prototype.subModelTypeAttribute in t){var n=t[e.prototype.subModelTypeAttribute],r=e._subModels[n];if(r)return r;for(n in e._subModels){r=this._findSubModelType(e._subModels[n],t);if(r)return r}}return null},initializeModelHierarchy:function(){this.inheritRelations();if(this.prototype.subModelTypes){var e=n.keys(this._subModels),r=n.omit(this.prototype.subModelTypes,e);n.each(r,function(e){var n=t.Relational.store.getObjectByName(e);n&&n.initializeModelHierarchy()})}},inheritRelations:function(){if(!n.isUndefined(this._superModel)&&!n.isNull(this._superModel))return;t.Relational.store.setupSuperModel(this);if(this._superModel){this._superModel.inheritRelations();if(this._superModel.prototype.relations){var e=n.filter(this._superModel.prototype.relations||[],function(e){return!n.any(this.prototype.relations||[],function(t){return e.relatedModel===t.relatedModel&&e.key===t.key},this)},this);this.prototype.relations=e.concat(this.prototype.relations)}}else this._superModel=!1},findOrCreate:function(e,t){t||(t={});var r=n.isObject(e)&&t.parse&&this.prototype.parse?this.prototype.parse(n.clone(e)):e,i=this.findModel(r);return n.isObject(e)&&(i&&t.merge!==!1?(delete t.collection,delete t.url,i.set(r,t)):!i&&t.create!==!1&&(i=this.build(r,n.defaults({parse:!1},t)))),i},find:function(e,t){return t||(t={}),t.create=!1,this.findOrCreate(e,t)},findModel:function(e){return t.Relational.store.find(this,e)}}),n.extend(t.RelationalModel.prototype,t.Semaphore),t.Collection.prototype.__prepareModel=t.Collection.prototype._prepareModel,t.Collection.prototype._prepareModel=function(e,r){var i;return e instanceof t.Model?(e.collection||(e.collection=this),i=e):(r=r?n.clone(r):{},r.collection=this,typeof this.model.findOrCreate!="undefined"?i=this.model.findOrCreate(e,r):i=new this.model(e,r),i&&i.validationError&&(this.trigger("invalid",this,e,r),i=!1)),i};var r=t.Collection.prototype.__set=t.Collection.prototype.set;t.Collection.prototype.set=function(e,i){if(this.model.prototype instanceof t.RelationalModel){i&&i.parse&&(e=this.parse(e,i));var s=!n.isArray(e),o=[],u=[];e=s?e?[e]:[]:n.clone(e),n.each(e,function(e){e instanceof t.Model||(e=t.Collection.prototype._prepareModel.call(this,e,i)),e&&(u.push(e),!this.get(e)&&!this.get(e.cid)?o.push(e):e.id!=null&&(this._byId[e.id]=e))},this),u=s?u.length?u[0]:null:u;var a=r.call(this,u,n.defaults({parse:!1},i));return n.each(o,function(e){(this.get(e)||this.get(e.cid))&&this.trigger("relational:add",e,this,i)},this),a}return r.apply(this,arguments)};var i=t.Collection.prototype.__remove=t.Collection.prototype.remove;t.Collection.prototype.remove=function(e,r){if(this.model.prototype instanceof t.RelationalModel){var s=!n.isArray(e),o=[];e=s?e?[e]:[]:n.clone(e),r||(r={}),n.each(e,function(e){e=this.get(e)||e&&this.get(e.cid),e&&o.push(e)},this);var u=i.call(this,s?o.length?o[0]:null:o,r);return n.each(o,function(e){this.trigger("relational:remove",e,this,r)},this),u}return i.apply(this,arguments)};var s=t.Collection.prototype.__reset=t.Collection.prototype.reset;t.Collection.prototype.reset=function(e,r){r=n.extend({merge:!0},r);var i=s.call(this,e,r);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,r),i};var o=t.Collection.prototype.__sort=t.Collection.prototype.sort;t.Collection.prototype.sort=function(e){var n=o.call(this,e);return this.model.prototype instanceof t.RelationalModel&&this.trigger("relational:reset",this,e),n};var u=t.Collection.prototype.__trigger=t.Collection.prototype.trigger;t.Collection.prototype.trigger=function(e){if(this.model.prototype instanceof t.RelationalModel){if(e==="add"||e==="remove"||e==="reset"||e==="sort"){var r=this,i=arguments;n.isObject(i[3])&&(i=n.toArray(i),i[3]=n.clone(i[3])),t.Relational.eventQueue.add(function(){u.apply(r,i)})}else u.apply(this,arguments);return this}return u.apply(this,arguments)},t.RelationalModel.extend=function(e,n){var r=t.Model.extend.apply(this,arguments);return r.setup(this),r}}),function(){"use strict";define("aura_extensions/backbone-relational",["vendor/backbone-relational/backbone-relational"],function(){return{name:"relationalmodel",initialize:function(e){var t=e.core,n=e.sandbox;t.mvc.relationalModel=Backbone.RelationalModel,n.mvc.relationalModel=function(e){return t.mvc.relationalModel.extend(e)},define("mvc/relationalmodel",function(){return n.mvc.relationalModel}),n.mvc.HasMany=Backbone.HasMany,n.mvc.HasOne=Backbone.HasOne,define("mvc/hasmany",function(){return n.mvc.HasMany}),define("mvc/hasone",function(){return n.mvc.HasOne}),n.mvc.Store=Backbone.Relational.store,define("mvc/relationalstore",function(){return n.mvc.Store})}}})}(),define("__component__$login@suluadmin",[],function(){"use strict";var e={instanceName:"",backgroundImg:"/bundles/suluadmin/img/background.jpg",loginUrl:"",loginCheck:"",resetMailUrl:"",resendUrl:"",resetUrl:"",resetToken:"",csrfToken:"",resetMode:!1,translations:{resetPassword:"sulu.login.reset-password",reset:"public.reset",backLogin:"sulu.login.back-login",resendResetMail:"sulu.login.resend-email",emailSent:"sulu.login.email-sent-message",backWebsite:"sulu.login.back-website",login:"public.login",errorMessage:"sulu.login.error-message",forgotPassword:"sulu.login.forgot-password",emailUser:"sulu.login.email-username",password:"public.password",emailSentSuccess:"sulu.login.email-sent-success",enterNewPassword:"sulu.login.enter-new-password",repeatPassword:"sulu.login.repeat-password"},errorTranslations:{0:"sulu.login.mail.user-not-found",1003:"sulu.login.mail.already-sent",1005:"sulu.login.token-does-not-exist",1007:"sulu.login.mail.limit-reached",1009:"sulu.login.mail.user-not-found"}},t={componentClass:"sulu-login",mediaLogoClass:"media-logo",mediaBackgroundClass:"media-background",mediaLoadingClass:"media-loading",contentLoadingClass:"content-loading",successClass:"content-success",contentBoxClass:"content-box",websiteSwitchClass:"website-switch",successOverlayClass:"success-overlay",frameSliderClass:"frame-slider",frameClass:"box-frame",forgotPasswordSwitchClass:"forgot-password-switch",loginSwitchClass:"login-switch-span",loginButtonId:"login-button",requestResetMailButtonId:"request-mail-button",resendResetMailButtonId:"resend-mail-button",resetPasswordButtonId:"reset-password-button",loginRouteClass:"login-route-span",errorMessageClass:"error-message",errorClass:"login-error",loaderClass:"login-loader"},n={mediaContainer:['
',' ','
','
',"
","
"].join(""),contentContainer:['
','
',' ','
',"
",' ",'
','
',"
","
"].join(""),loginFrame:function(){return['"].join("")},forgotPasswordFrame:['
','
',' ','
',' ',"
","
",' ","
"].join(""),resendMailFrame:['
','
',' <%= sentMessage %>',' ',"
",' ","
"].join(""),resetPasswordFrame:['
','
','
',' ',"
",'
',' ',"
","
",' ","
"].join("")},r=function(){return i.call(this,"initialized")},i=function(e){return"sulu.login."+(this.options.instanceName?this.options.instanceName+".":"")+e};return{initialize:function(){this.options=this.sandbox.util.extend(!0,{},e,this.options),this.initProperties(),this.render(),this.bindDomEvents(),this.sandbox.emit(r.call(this))},initProperties:function(){this.dom={$mediaContainer:null,$contentContainer:null,$successOverlay:null,$loader:null,$mediaBackground:null,$contentBox:null,$frameSlider:null,$loginFrame:null,$forgotPasswordFrame:null,$resendMailFrame:null,$resetPasswordFrame:null,$loginButton:null,$loginForm:null,$forgotPasswordSwitch:null,$requestResetMailButton:null,$resendResetMailButton:null,$resetPasswordButton:null},this.resetMailUser=null},render:function(){this.sandbox.dom.addClass(this.$el,t.componentClass),this.renderMediaContainer(),this.renderContentContainer(),this.moveFrameSliderTo(this.sandbox.dom.find("."+t.frameClass,this.dom.$frameSlider)[0])},renderMediaContainer:function(){var e=this.sandbox.dom.createElement("");this.sandbox.dom.one(e,"load",this.showMediaBackground.bind(this)),this.sandbox.dom.attr(e,"src",this.options.backgroundImg),this.dom.$mediaContainer=this.sandbox.dom.createElement(n.mediaContainer),this.dom.$mediaBackground=this.sandbox.dom.find("."+t.mediaBackgroundClass,this.dom.$mediaContainer),this.sandbox.dom.css(this.dom.$mediaBackground,"background-image",'url("'+this.options.backgroundImg+'")'),this.sandbox.dom.append(this.$el,this.dom.$mediaContainer)},showMediaBackground:function(){this.sandbox.dom.removeClass(this.dom.$mediaContainer,t.mediaLoadingClass)},renderContentContainer:function(){this.dom.$contentContainer=this.sandbox.dom.createElement(this.sandbox.util.template(n.contentContainer)({backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite)})),this.dom.$contentBox=this.sandbox.dom.find("."+t.contentBoxClass,this.dom.$contentContainer),this.dom.$frameSlider=this.sandbox.dom.find("."+t.frameSliderClass,this.dom.$contentContainer),this.dom.$successOverlay=this.sandbox.dom.find("."+t.successOverlayClass,this.dom.$contentContainer),this.options.resetMode===!1?(this.renderLoginFrame(),this.renderForgotPasswordFrame(),this.renderResendMailFrame()):this.renderResetPasswordFrame(),this.renderLoader(),this.sandbox.dom.append(this.$el,this.dom.$contentContainer)},renderLoginFrame:function(){this.dom.$loginFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.loginFrame.call(this))({emailUser:this.sandbox.translate(this.options.translations.emailUser),password:this.sandbox.translate(this.options.translations.password),forgotPasswordMessage:this.sandbox.translate(this.options.translations.forgotPassword),errorMessage:this.sandbox.translate(this.options.translations.errorMessage),login:this.sandbox.translate(this.options.translations.login)})),this.dom.$forgotPasswordSwitch=this.sandbox.dom.find("."+t.forgotPasswordSwitchClass,this.dom.$loginFrame),this.dom.$loginButton=this.sandbox.dom.find("#"+t.loginButtonId,this.dom.$loginFrame),this.dom.$loginForm=this.sandbox.dom.find("form",this.dom.$loginFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$loginFrame)},renderForgotPasswordFrame:function(){this.dom.$forgotPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.forgotPasswordFrame)({label:this.sandbox.translate(this.options.translations.resetPassword),reset:this.sandbox.translate(this.options.translations.reset),emailUser:this.sandbox.translate(this.options.translations.emailUser),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$requestResetMailButton=this.sandbox.dom.find("#"+t.requestResetMailButtonId,this.dom.$forgotPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$forgotPasswordFrame)},renderResendMailFrame:function(){this.dom.$resendMailFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resendMailFrame)({resend:this.sandbox.translate(this.options.translations.resendResetMail),sentMessage:this.sandbox.translate(this.options.translations.emailSent),backLoginMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resendResetMailButton=this.sandbox.dom.find("#"+t.resendResetMailButtonId,this.dom.$resendMailFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resendMailFrame)},renderResetPasswordFrame:function(){this.dom.$resetPasswordFrame=this.sandbox.dom.createElement(this.sandbox.util.template(n.resetPasswordFrame)({password1Label:this.sandbox.translate(this.options.translations.enterNewPassword),password2Label:this.sandbox.translate(this.options.translations.repeatPassword),password:this.sandbox.translate(this.options.translations.password),login:this.sandbox.translate(this.options.translations.login),backWebsiteMessage:this.sandbox.translate(this.options.translations.backWebsite),loginRouteMessage:this.sandbox.translate(this.options.translations.backLogin)})),this.dom.$resetPasswordButton=this.sandbox.dom.find("#"+t.resetPasswordButtonId,this.dom.$resetPasswordFrame),this.sandbox.dom.append(this.dom.$frameSlider,this.dom.$resetPasswordFrame)},renderLoader:function(){this.dom.$loader=this.sandbox.dom.createElement('
'),this.sandbox.dom.append(this.dom.$contentContainer,this.dom.$loader),this.sandbox.start([{name:"loader@husky",options:{el:this.dom.$loader,size:"40px",color:"#fff"}}])},bindDomEvents:function(){this.bindGeneralDomEvents(),this.options.resetMode===!1?(this.bindLoginDomEvents(),this.bindForgotPasswordDomEvents(),this.bindResendMailDomEvents(),this.sandbox.dom.on(this.dom.$contentBox,"click",this.moveToLoginFrame.bind(this),"."+t.loginSwitchClass)):this.bindResetPasswordDomEvents()},bindGeneralDomEvents:function(){this.sandbox.dom.on(this.dom.$contentContainer,"click",this.redirectTo.bind(this,this.sandbox.dom.window.location.origin),"."+t.websiteSwitchClass)},bindLoginDomEvents:function(){this.sandbox.dom.on(this.dom.$loginForm,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$loginForm)),this.sandbox.dom.on(this.dom.$forgotPasswordSwitch,"click",this.moveToForgotPasswordFrame.bind(this)),this.sandbox.dom.on(this.dom.$loginButton,"click",this.loginButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$loginFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$loginFrame),".husky-validate")},bindForgotPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.$forgotPasswordFrame)),this.sandbox.dom.on(this.dom.$requestResetMailButton,"click",this.requestResetMailButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$forgotPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$forgotPasswordFrame),".husky-validate")},bindResendMailDomEvents:function(){this.sandbox.dom.on(this.dom.$resendResetMailButton,"click",this.resendResetMailButtonClickHandler.bind(this))},bindResetPasswordDomEvents:function(){this.sandbox.dom.on(this.dom.$resetPasswordButton,"click",this.resetPasswordButtonClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keydown",this.inputFormKeyHandler.bind(this,this.dom.resetPasswordFrame)),this.sandbox.dom.on(this.sandbox.dom.find("."+t.loginRouteClass),"click",this.loginRouteClickHandler.bind(this)),this.sandbox.dom.on(this.dom.$resetPasswordFrame,"keyup change",this.validationInputChangeHandler.bind(this,this.dom.$resetPasswordFrame),".husky-validate")},loginButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#username",this.dom.$loginForm)),t=this.sandbox.dom.val(this.sandbox.dom.find("#password",this.dom.$loginForm)),n=$("#_csrf_token").val();return e.length===0||t.length===0?this.displayLoginError():this.login(e,t,n),!1},validationInputChangeHandler:function(e,n){if(n.type==="keyup"&&n.keyCode===13)return!1;this.sandbox.dom.hasClass(e,t.errorClass)&&this.sandbox.dom.removeClass(e,t.errorClass)},loginRouteClickHandler:function(){this.redirectTo(this.options.loginUrl)},requestResetMailButtonClickHandler:function(){var e=this.sandbox.dom.trim(this.sandbox.dom.val(this.sandbox.dom.find("#user",this.dom.$forgotPasswordFrame)));this.requestResetMail(e)},resetPasswordButtonClickHandler:function(){var e=this.sandbox.dom.val(this.sandbox.dom.find("#password1",this.dom.$resetPasswordFrame)),n=this.sandbox.dom.val(this.sandbox.dom.find("#password2",this.dom.$resetPasswordFrame));if(e!==n||e.length===0)return this.sandbox.dom.addClass(this.dom.$resetPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$resetPasswordFrame),!1;this.resetPassword(e)},resendResetMailButtonClickHandler:function(){if(this.sandbox.dom.hasClass(this.dom.$resendResetMailButton,"inactive"))return!1;this.resendResetMail()},inputFormKeyHandler:function(e,t){if(t.keyCode===13){var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.click(n)}},login:function(e,t,n){this.showLoader(this.dom.$loginFrame),this.sandbox.util.save(this.options.loginCheck,"POST",{_username:e,_password:t,_csrf_token:n}).then(function(e){this.displaySuccessAndRedirect(e.url+this.sandbox.dom.window.location.hash)}.bind(this)).fail(function(){this.hideLoader(this.dom.$loginFrame),this.displayLoginError()}.bind(this))},displaySuccessAndRedirect:function(e){this.sandbox.dom.css(this.dom.$loader,"opacity","0"),this.sandbox.dom.css(this.dom.$successOverlay,"z-index","20"),this.sandbox.dom.addClass(this.$el,t.successClass),this.sandbox.util.delay(this.redirectTo.bind(this,e),800)},requestResetMail:function(e){this.showLoader(this.dom.$forgotPasswordFrame),this.sandbox.util.save(this.options.resetMailUrl,"POST",{user:e}).then(function(t){this.resetMailUser=e,this.hideLoader(this.dom.$forgotPasswordFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$forgotPasswordFrame),this.displayRequestResetMailError(e.responseJSON.code)}.bind(this))},resetPassword:function(e){this.showLoader(this.dom.$resetPasswordFrame),this.sandbox.util.save(this.options.resetUrl,"POST",{password:e,token:this.options.resetToken}).then(function(e){this.displaySuccessAndRedirect(e.url)}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resetPasswordFrame),this.displayResetPasswordError(e.responseJSON.code)}.bind(this))},resendResetMail:function(){this.showLoader(this.dom.$resendMailFrame),this.sandbox.util.save(this.options.resendUrl,"POST",{user:this.resetMailUser}).then(function(){this.hideLoader(this.dom.$resendMailFrame),this.showEmailSentLabel()}.bind(this)).fail(function(e){this.hideLoader(this.dom.$resendMailFrame),this.displayResendResetMailError(e.responseJSON.code)}.bind(this))},showLoader:function(e){if(this.sandbox.dom.hasClass(e,t.contentLoadingClass))return!1;var n=this.sandbox.dom.find(".btn",e);this.sandbox.dom.after(n,this.dom.$loader),this.sandbox.dom.css(this.dom.$loader,"width",this.sandbox.dom.css(n,"width")),this.sandbox.dom.addClass(e,t.contentLoadingClass)},hideLoader:function(e){this.sandbox.dom.removeClass(e,t.contentLoadingClass)},showEmailSentLabel:function(){this.sandbox.emit("sulu.labels.success.show",this.options.translations.emailSentSuccess,"labels.success")},displayLoginError:function(){this.sandbox.dom.addClass(this.dom.$loginFrame,t.errorClass),this.focusFirstInput(this.dom.$loginFrame)},displayRequestResetMailError:function(e){var n=this.options.errorTranslations[e]||"Error";this.sandbox.dom.html(this.sandbox.dom.find("."+t.errorMessageClass,this.dom.$forgotPasswordFrame),this.sandbox.translate(n)),this.sandbox.dom.addClass(this.dom.$forgotPasswordFrame,t.errorClass),this.focusFirstInput(this.dom.$forgotPasswordFrame)},displayResendResetMailError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.sandbox.dom.addClass(this.dom.$resendResetMailButton,"inactive")},displayResetPasswordError:function(e){var t=this.options.errorTranslations[e]||"Error";this.sandbox.emit("sulu.labels.error.show",this.sandbox.translate(t),"labels.error"),this.focusFirstInput(this.dom.$forgotPasswordFrame)},redirectTo:function(e){this.sandbox.dom.window.location=e},moveToForgotPasswordFrame:function(){this.moveFrameSliderTo(this.dom.$forgotPasswordFrame)},moveToResendMailFrame:function(e){this.sandbox.dom.html(this.sandbox.dom.find(".to-mail",this.dom.$resendMailFrame),e),this.moveFrameSliderTo(this.dom.$resendMailFrame)},moveToLoginFrame:function(){this.moveFrameSliderTo(this.dom.$loginFrame)},moveFrameSliderTo:function(e){this.sandbox.dom.one(this.$el,"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){this.focusFirstInput(e)}.bind(this)),this.sandbox.dom.css(this.dom.$frameSlider,"left",-this.sandbox.dom.position(e).left+"px")},focusFirstInput:function(e){if(this.sandbox.dom.find("input",e).length<1)return!1;var t=this.sandbox.dom.find("input",e)[0];this.sandbox.dom.select(t),t.setSelectionRange(this.sandbox.dom.val(t).length,this.sandbox.dom.val(t).length)}}}); \ No newline at end of file diff --git a/src/Sulu/Bundle/AdminBundle/Resources/views/Admin/index.html.dist.twig b/src/Sulu/Bundle/AdminBundle/Resources/views/Admin/index.html.dist.twig index 0e7a034c665..41093965c43 100644 --- a/src/Sulu/Bundle/AdminBundle/Resources/views/Admin/index.html.dist.twig +++ b/src/Sulu/Bundle/AdminBundle/Resources/views/Admin/index.html.dist.twig @@ -13,7 +13,7 @@ {% block stylesheets %} - + {% endblock stylesheets %} @@ -72,7 +72,7 @@ {% block javascripts %} - + {% endblock javascripts %} diff --git a/src/Sulu/Bundle/AdminBundle/Resources/views/Security/login.html.dist.twig b/src/Sulu/Bundle/AdminBundle/Resources/views/Security/login.html.dist.twig index 2a216c059e4..8d255637718 100644 --- a/src/Sulu/Bundle/AdminBundle/Resources/views/Security/login.html.dist.twig +++ b/src/Sulu/Bundle/AdminBundle/Resources/views/Security/login.html.dist.twig @@ -14,7 +14,7 @@ {% block stylesheets %} - + {% endblock stylesheets %} @@ -49,7 +49,7 @@ {% block javascripts %} - + {% endblock javascripts %}