<NME> MenuTraitTest.php
<BEF> <?php

namespace Bolt\Tests\Extension;

use Bolt\AccessControl\Permissions;
use Bolt\AccessControl\Token\Token;
use Bolt\Menu\MenuEntry;
use Bolt\Storage\Entity\Authtoken;
use Bolt\Storage\Entity\Users;
use Bolt\Tests\BoltUnitTest;
use Bolt\Tests\Extension\Mock\MenuExtension;
use Bolt\Tests\Extension\Mock\NormalExtension;

/**
 * Class to test Bolt\Extension\MenuTrait.
 *
 * @author Gawain Lynch <gawain.lynch@gmail.com>
 */
class MenuTraitTest extends BoltUnitTest
{
    public function testEmptyMenus()
    {
        $app = $this->getApp();

        $ext = new NormalExtension();
        $baseDir = $app['filesystem']->getDir('extensions://local/bolt/menu');
        $ext->setBaseDirectory($baseDir);
        $ext->setContainer($app);
        $ext->register($app);

        /** @var MenuEntry $extendMenu */
        $extendMenu = $app['menu.admin']->get('extensions');
        $this->assertSame('extensions', $extendMenu->getName());
        $this->assertSame('Extensions Overview', $extendMenu->getLabel());
        $this->assertSame([], $extendMenu->children());
    }

    /**
     * @group legacy
     */
    public function testLegacyMenuAdds()
    {
        $app = $this->getApp();

        $ext = new MenuExtension();
        $baseDir = $app['filesystem']->getDir('extensions://local/bolt/menu');
        $ext->setBaseDirectory($baseDir);
        $ext->setContainer($app);
        $ext->register($app);
        /** @var MenuEntry $extendMenu */
        $extendMenu = $app['menu.admin']->get('custom');
        $children = $extendMenu->children();

        $this->assertSame('koala', $children['koala']->getName());
        $this->assertSame('Koalas', $children['koala']->getLabel());
        $this->assertSame('/bolt/extensions/koalas-are-us', $children['koala']->getUri());
        $this->assertSame('fa-thumbs-o-up', $children['koala']->getIcon());
        $this->assertSame('config', $children['koala']->getPermission());

        $this->assertSame('Drop Bear', $children['Drop Bear']->getName());
        $this->assertSame('Drop Bear', $children['Drop Bear']->getLabel());
        $this->assertSame('/bolt/extensions/look-up-live', $children['Drop Bear']->getUri());
        $this->assertSame('fa-thumbs-o-down', $children['Drop Bear']->getIcon());
    protected function getApp($boot = true)
    {
        $app = parent::getApp();
        $token = new Token(New Users([]), new Authtoken([]));
        $app['session']->set('authentication', $token);
        $permissions = $this->getMockBuilder(Permissions::class)
            ->disableOriginalConstructor()
        $app['session']->set('authentication', $token);
        $permissions = $this->getMockBuilder(Permissions::class)
            ->disableOriginalConstructor()
            ->setMethods(['isAllowed'])
            ->getMock()
        ;
        $permissions
            ->expects($this->any())
            ->method('isAllowed')
            ->willReturn(true)
        ;
        $app['permissions'] = $permissions;

        return $app;
    }
}

<MSG> Merge branch '3.4' into 3.x

<DFF> @@ -64,7 +64,7 @@ class MenuTraitTest extends BoltUnitTest
     protected function getApp($boot = true)
     {
         $app = parent::getApp();
-        $token = new Token(New Users([]), new Authtoken([]));
+        $token = new Token(new Users([]), new Authtoken([]));
         $app['session']->set('authentication', $token);
         $permissions = $this->getMockBuilder(Permissions::class)
             ->disableOriginalConstructor()

{'commit': 'diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md\nnew file mode 100644\nindex 000000000..7e8bea589\n--- /dev/null\n+++ b/.github/SUPPORT.md\n@@ -0,0 +1,11 @@\n+Getting Support\n+===============\n+\n+If you need information about installing, configuring and extending Bolt, a\n+good place to start is the [Documentation Site][docs].\n+\n+Alternatively, you can connect directly with Bolt\'s global community. Details\n+and URLs are on the [Community][community] page of the main site.\n+\n+[community]: https://bolt.cm/community\n+[docs]: https://docs.bolt.cm\ndiff --git a/app/resources/translations/nl_NL/messages.nl_NL.yml b/app/resources/translations/nl_NL/messages.nl_NL.yml\nindex 09cf8313e..006bf7c91 100644\n--- a/app/resources/translations/nl_NL/messages.nl_NL.yml\n+++ b/app/resources/translations/nl_NL/messages.nl_NL.yml\n@@ -8,38 +8,10 @@\n #          re-map your translations.\n \n #   0 Unused messages\n-#   1 Legacy untranslated messages\n-#  15 Untranslated messages\n-#  39 Legacy translation messages\n-# 543 Translation messages\n-\n-#--- Legacy untranslated messages ---------------------------------------------\n-\n-"Added records to the ContentType <tt>%CONTENTYPE%</tt> titled": #\n-\n-#--- Untranslated messages ----------------------------------------------------\n-\n-field.block.label.add-new: # "Add new..."\n-field.block.label.add-set: # "Add new %label% set"\n-\n-field.repeater.label.add-set: # "Add new %label% set"\n-\n-general.phrase.upload-progress: # "Current uploads"\n-\n-menu.configuration.checks: # "Set-up checks"\n-\n-page.checks.php-pass: # "All PHP configuration checks pass!"\n-page.checks.php-problem: # "PHP configuration check found problems!"\n-page.checks.show-all: # "Show all checks"\n-page.checks.show-failed: # "Show only failed checks"\n-page.checks.system-pass: # "All system configuration checks pass!"\n-page.checks.system-problem: # "System configuration check found problems!"\n-\n-page.edit-users.error.email-invalid: # "This email address is not valid."\n-page.edit-users.error.password-different-email: # "Password must not match the email address."\n-page.edit-users.error.password-long: # "This value is too long. It should have 128 characters or less."\n-\n-page.file-management.actions-for-files: # "Actions for files"\n+#   0 Legacy untranslated messages\n+#   0 Untranslated messages\n+#  40 Legacy translation messages\n+# 559 Translation messages\n \n #--- Legacy translation messages ----------------------------------------------\n \n@@ -48,12 +20,13 @@ page.file-management.actions-for-files: # "Actions for files"\n "(no group)": "(geen groep)"\n "(none)": "(geen)"\n "Add some sample <a href=\'%url%\' class=\'btn btn-default\'>Records with Loripsum text</a>": "Voeg een aantal <a href=\'%url%\' class=\'btn btn-default\'>Records met Loripsum tekst toe</a>"\n+"Added records to the ContentType <tt>%CONTENTYPE%</tt> titled": "Toegevoegde records aan het ContentType <tt>%CONTENTYPE%</tt>"\n "Added to <tt>%key%</tt> \'%title%\'": "Toegevoegd aan <tt>%key%</tt> \'%title%\'"\n "An error occured while updating `%TABLE%`. The error is %ERROR%": "Er is een fout opgetreden tijdens het bijwerken van de \'%TABLE%\'. De fout is %ERROR%"\n "Current (saved) status:": "Huidige (opgeslagen) status"\n "Dependencies": "Afhankelijkheden"\n "Detected Bolt version change to <b>%VERSION%</b>, and the cache has been cleared. Please <a href=\\"%URI%\\">check the database</a>, if you haven\'t done so already.": "Bolt versie <b>%VERSION%</b> gedetecteerd en de cache is gewist. <a href=\\\\\\"%URI%\\\\\\">Controleer de database</a>, als je dat nog niet gedaan hebt.\\""\n-"Do you really want to delete %FOLDERNAME%?": "Weet u zeker dat u %FOLDERNAME% wil verwijderen?"\n+"Do you really want to delete %FOLDERNAME%?": "Weet je zeker dat je %FOLDERNAME% wil verwijderen?"\n "Error reading extensions/composer.json file: %ERROR%": "Fout bij het lezen van extensions/composer.json bestand: %ERROR%"\n "Everybody": "Iedereen"\n "Excerpt": "Samenvatting"\n@@ -124,6 +97,9 @@ contenttypes.generic.wrong-use-field: "In het contenttype voor \'%contenttype%\',\n \n contenttypes.record.comment-add-colon: "Voeg een opmerking toe:"\n \n+field.block.label.add-new: "Voeg toe…"\n+field.block.label.add-set: "Voeg nieuwe set %label% toe"\n+\n field.general.allowed-filetypes: "Toegestane bestandtypes:"\n field.general.select-from-server: "Kies vanaf de server"\n field.general.stack: "Stapel"\n@@ -141,6 +117,8 @@ field.image.label.alt: "Alt."\n field.markdown.label.markedview: "Markdown"\n field.markdown.label.preview: "Voorvertoning"\n \n+field.repeater.label.add-set: "Voeg nieuwe set %label% toe"\n+\n field.slug.button.edit: "Bewerk"\n field.slug.button.generate: "Genereer van:"\n field.slug.button.lock: "Vergrendelen"\n@@ -161,7 +139,7 @@ general.about: "Over"\n \n general.about-bolt: "Over Bolt"\n \n-general.access-control.reset-failed: "Resetten van het wachtwoord is mislukt! Is het token correct? Wellicht heeft u te lang gewacht of geprobeerd het wachtwoord te resetten vanaf een ander ip-adres."\n+general.access-control.reset-failed: "Resetten van het wachtwoord is mislukt! Is het token correct? Wellicht heb je te lang gewacht of geprobeerd het wachtwoord te resetten vanaf een ander ip-adres."\n general.access-control.reset-successful: "Gelukt! Je kunt nu inloggen met het wachtwoord dat per e-mail is verzonden."\n \n general.access-denied.content-not-modified: "Inhoud \'%title%\' kon niet worden aangepast."\n@@ -187,7 +165,7 @@ general.phrase.access-denied-permissions-edit-file: "Je hebt niet de juiste rech\n general.phrase.access-denied-permissions-view-file-directory: "Je hebt niet de juiste rechten om het bestand of directory \'%s\' weer te geven."\n general.phrase.access-denied-privilege-edit-user: "Je beschikt niet over de juiste rechten om deze gebruiker te bewerken."\n general.phrase.access-denied-privilege-view-page: "Je bent niet gerechtigd om die pagina te bekijken."\n-general.phrase.access-denied-self-action: "Je kan jezelf niet %s."\n+general.phrase.access-denied-self-action: "Je kunt jezelf niet %s."\n general.phrase.action-plural: "Acties"\n general.phrase.add-selected: "Selectie toevoegen"\n general.phrase.author: "Schrijver"\n@@ -197,7 +175,7 @@ general.phrase.by: "door"\n general.phrase.cancel: "Annuleer"\n general.phrase.change-current-status: "Klik om de huidige status aan te passen."\n general.phrase.change-log: "Changelog"\n-general.phrase.changelog-not-enabled: "De changelog is niet ingeschakeld. Als je deze aanzet kan je op deze pagina alle wijzigingen aan alle ContentTypes teruglezen. Pas de code onder <code>changelog:</code> aan in je <code>config.yml</code> om de changelog in- of uit te schakelen."\n+general.phrase.changelog-not-enabled: "De changelog is niet ingeschakeld. Als je deze aanzet kun je op deze pagina alle wijzigingen aan alle ContentTypes teruglezen. Pas de code onder <code>changelog:</code> aan in je <code>config.yml</code> om de changelog in- of uit te schakelen."\n general.phrase.changelog-note: "Let op: De databasetabel blijft groeien als editors wijzigingen aanbrengen in de content. Als je deze functie inschakelt op een live-omgeving kan deze uiteindelijk veel ruimte in beslag nemen."\n general.phrase.changelog-what-changed: "Plaats optioneel een korte opmerking om de aanpassingen te beschrijven."\n general.phrase.check-again: "Controleer nogmaals"\n@@ -223,7 +201,7 @@ general.phrase.confirm-remove-file: "Weet je zeker dat je dit bestand wil verwij\n general.phrase.confirm-remove-files: "Weet je zeker dat je deze bestanden wil verwijderen?"\n general.phrase.confirm-remove-image: "Weet je zeker dat je deze afbeelding wil verwijderen?"\n general.phrase.confirm-remove-images: "Weet je zeker dat je deze afbeeldingen wil verwijderen?"\n-general.phrase.confirm-remove-record: "Weet je zeker dat je dit gegeven wil verwijderen? Dit kan je niet ongedaan maken."\n+general.phrase.confirm-remove-record: "Weet je zeker dat je dit gegeven wil verwijderen? Dit kun je niet ongedaan maken."\n general.phrase.content: "Content"\n general.phrase.content-type-permissions: "Content type permissies"\n general.phrase.content-types: "Contenttypen"\n@@ -246,7 +224,7 @@ general.phrase.delete-set: "Set verwijderen"\n general.phrase.delete-user-name: "Verwijder %username%"\n general.phrase.depublication-date-colon: "Depublicatiedatum:"\n general.phrase.depublish: "Publicatie opheffen"\n-general.phrase.depublish-date-past: "De datum van het opheffen van de publicatie ligt in het verleden. Wijzig de status als je de publicatie nu wilt opheffen."\n+general.phrase.depublish-date-past: "De datum van het opheffen van de publicatie ligt in het verleden. Wijzig de status als je de publicatie nu ongedaan wilt maken."\n general.phrase.depublish-explanation: "Als hier iets is ingevoerd, wordt deze record automatisch gedepubliceerd op deze datum."\n general.phrase.deselect-all: "Deselecteer alles"\n general.phrase.details: "Details"\n@@ -317,8 +295,8 @@ general.phrase.missing-root-jackpot: "Er moet altijd minstens één \'root\'-gebru\n general.phrase.modifications-database-colon: "Aanpassingen gedaan aan de database:"\n general.phrase.modifications-needed-colon: "Vereiste aanpassingen:"\n general.phrase.modified: "Aangepast"\n-general.phrase.move-down: "Omlaag Verplaatsen"\n-general.phrase.move-up: "Omhoog Verplaatsen"\n+general.phrase.move-down: "Omlaag"\n+general.phrase.move-up: "Omhoog"\n general.phrase.no-content: "geen content …"\n general.phrase.no-content-found: "Geen content gevonden."\n general.phrase.no-files-in-list: "De lijst bevat nog geen bestanden."\n@@ -421,6 +399,7 @@ general.phrase.upload-file: "Upload bestand"\n general.phrase.upload-file-to-directory: "Upload een bestand naar deze map"\n general.phrase.upload-image: "Upload afbeelding"\n general.phrase.upload-not-allowed: "Deze upload is niet toegestaan"\n+general.phrase.upload-progress: "Huidige uploads"\n general.phrase.used-libraries: "Gebruikte Libraries / Componenten"\n general.phrase.user-deleted: "Gebruiker \'%s\' is verwijderd."\n general.phrase.user-disabled: "Gebruiker \'%s\' is uitgeschakeld."\n@@ -463,12 +442,20 @@ logs.system-log: "Systeemlog"\n logs.system-log.cleared: "De systeemlog is gewist."\n logs.system-log.trimmed: "De systeemlog is verkleind."\n \n+menu.configuration.checks: "Installatie-checks"\n menu.configuration.routing: "Route instellingen"\n \n nut.greeting: "Welkom bij Bolt!"\n \n nut.version: "versie"\n \n+page.checks.php-pass: "Alle PHP-configuratie checks zijn doorlopen."\n+page.checks.php-problem: "PHP-configuratie check heeft een probleem gevonden!"\n+page.checks.show-all: "Toon alle checks"\n+page.checks.show-failed: "Toon alleen de mislukte checks"\n+page.checks.system-pass: "Alle systeem-configuratie checks zijn doorlopen."\n+page.checks.system-problem: "Systeem-configuratie check heeft een probleem gevonden!"\n+\n page.ckeditor-browse-server.files: "Bestanden"\n page.ckeditor-browse-server.modified: "Aangepast"\n page.ckeditor-browse-server.size: "Bestandsgrootte"\n@@ -493,9 +480,12 @@ page.edit-users.activated.no: "Gebruiker gedeactiveerd"\n page.edit-users.activated.yes: "Gebruiker geactiveerd"\n page.edit-users.button.save: "Gebruiker opslaan"\n page.edit-users.error.displayname-used: "Deze schermnaam is al in gebruik. Kies een andere schermnaam."\n+page.edit-users.error.email-invalid: "Dit e-mail adres is niet valide."\n page.edit-users.error.email-used: "Dit e-mailadres is al in gebruik"\n page.edit-users.error.password-different-displayname: "Jouw wachtwoord mag geen deel uitmaken van jouw weergavenaam."\n+page.edit-users.error.password-different-email: "Wacthwoord mag niet gelijk zijn aan e-mail adres"\n page.edit-users.error.password-different-username: "Het wachtwoord mag niet gelijk zijn aan de gebruikersnaam."\n+page.edit-users.error.password-long: "De waarde is te lang. Deze moet 128 karakters of minder zijn."\n page.edit-users.error.password-mismatch: "Wachtwoord komt niet overeen"\n page.edit-users.error.password-short: "Het wachtwoord is te kort"\n page.edit-users.error.username-used: "Gebruikersnaam al in gebruik"\n@@ -581,7 +571,7 @@ page.extend.message.compatible-unstable-versions: "De hieronder opgesomde versie\n page.extend.message.confirm-remove: "Bevestig dat je deze extensie wilt verwijderen?"\n page.extend.message.copying: "Thema-bestanden kopiëren …"\n page.extend.message.discover-by-visiting: "Ontdek nieuwe extensies"\n-page.extend.message.ext-dir-missing: "De maplocatie van de extensie (<code>%DIRECTORY%</code>) bestaat niet of is niet schrijfbaar. Daarom kan u Bolt extensies niet bewerken vanuit de backend. Probeer de extensies handmatig te bewerken of verander de bestandsrechten om Bolt een schrijfrecht te verlenen voor (<code>%DIRECTORY%</code>)."\n+page.extend.message.ext-dir-missing: "De maplocatie van de extensie (<code>%DIRECTORY%</code>) bestaat niet of is niet schrijfbaar. Daarom kun je Bolt extensies niet bewerken vanuit de backend. Probeer de extensies handmatig te bewerken of verander de bestandsrechten om Bolt een schrijfrecht te verlenen voor (<code>%DIRECTORY%</code>)."\n page.extend.message.install-all: "Bezig met de installatie van alle packages …"\n page.extend.message.installation-running: "Installatie loopt"\n page.extend.message.installing: "Package installatie aan het voorbereiden …"\n@@ -589,8 +579,8 @@ page.extend.message.installing-selected-package: "Geselecteerde packages worden\n page.extend.message.installs-all-listed-packages: "Dit zorgt ervoor dat alle opgesomde pakketten worden geïnstalleerd. Gebruik dit als je een nieuwe server in gebruik hebt genomen of als je handmatig een nieuwe extensie hebt geïnstalleerd."\n page.extend.message.installs-updates: "Dit zal alle updates installeren."\n page.extend.message.invalid-theme-source-dir: "Ongeldige theme source directory: %SOURCE%"\n-page.extend.message.latest-version: "De hieronder vermelde versie is de laatste stabiele versie zoals aangegeven door de ontwikkelaar, die compatibel is met de versie van Bolt die u momenteel gebruikt."\n-page.extend.message.loading-disabled: "Extensies laden is uitgeschakeld door een beheerder in het bestand %CONFIG%. Je kan extensies installeren, bijwerken en verwijderen, maar deze zullen niet laden totdat deze instelling is gewijzigd."\n+page.extend.message.latest-version: "De hieronder vermelde versie is de laatste stabiele versie zoals aangegeven door de ontwikkelaar, die compatibel is met de versie van Bolt die je momenteel gebruikt."\n+page.extend.message.loading-disabled: "Extensies laden is uitgeschakeld door een beheerder in het bestand %CONFIG%. Je kunt extensies installeren, bijwerken en verwijderen, maar deze zullen niet laden totdat deze instelling is gewijzigd."\n page.extend.message.maintenance: "Onderhoud"\n page.extend.message.marked-as-stable: "De hieronder opgesomde versies zijn als stabiel aangemerkt door de ontwikkelaar en zijn compatibel met de Bolt-versie die je momenteel gebruikt."\n page.extend.message.no-bolt-extensions-installed: "Geen Bolt extensies geinstalleerd."\n@@ -614,6 +604,7 @@ page.extend.theme.generation.failure: "Het thema kon niet worden aangemaakt. Het\n page.extend.theme.generation.missing.name: "Geen themanaam gevonden. Het thema is niet gegenereerd."\n page.extend.theme.generation.success: "Thema aangemaakt! Je kunt de bestanden bewerken in de thema-map."\n \n+page.file-management.actions-for-files: "Handelingen voor bestanden"\n page.file-management.label.create-file: "Maak bestand aan"\n page.file-management.label.create-folder: "Maak map aan"\n page.file-management.message.access-denied: "Uploaden naar deze map is niet toegestaan."\n@@ -639,8 +630,8 @@ page.login.label.username: "Gebruikersnaam / e-mail"\n page.login.password-hide: "Verberg"\n page.login.password-reset-link-sent: "Een link om het wachtwoord te resetten is verstuurd aan \'%user%\'."\n page.login.password-show: "Toon"\n-page.login.placeholder.userame: "Je inlognaam"\n page.login.placeholder.password: "Je wachtwoord"\n+page.login.placeholder.username: "Je inlognaam"\n page.login.title: "Inloggen"\n \n page.prefill.connection-timeout: "Timeout bij het verbinden met de \'Lorem Ipsum\' generator. Het is op dit moment niet mogelijk om dummy inhoud toe te voegen."\n@@ -669,5 +660,3 @@ permissions.roles.label.anonymous: "Anoniem"\n permissions.roles.label.owner: "Eigenaar"\n \n users.actions-for-users: "Handelingen voor Gebruikers"\n-\n-users.your-password: "Je wachtwoord"\ndiff --git a/app/src/js/modules/editcontent.js b/app/src/js/modules/editcontent.js\nindex 40f23f927..27590aa69 100644\n--- a/app/src/js/modules/editcontent.js\n+++ b/app/src/js/modules/editcontent.js\n@@ -1,5 +1,5 @@\n /**\n- * Setp up editcontent stuff\n+ * Set up editcontent stuff\n  *\n  * @mixin\n  * @namespace Bolt.editcontent\n@@ -121,6 +121,17 @@\n         };\n     }\n \n+    /**\n+     * Forget current state of content, because we\'re going to save and leave this page.\n+     *\n+     * @static\n+     * @function unWatchChanges\n+     * @memberof Bolt.editcontent\n+     */\n+    function unWatchChanges() {\n+        window.onbeforeunload = null;\n+    }\n+\n     /**\n      * Disable the "save" buttons, to indicate stuff is being done in the background.\n      *\n@@ -267,6 +278,25 @@\n         });\n     }\n \n+    /**\n+     * Initialize "save and return to overview" button handlers.\n+     *\n+     * @static\n+     * @function initSaveReturnToOverview\n+     * @memberof Bolt.editcontent\n+     */\n+    function initSaveReturnToOverview() {\n+        $(\'#sidebar_save_return\').bind(\'click\', function () {\n+            $(\'#content_edit_save_return\').trigger(\'click\');\n+        });\n+\n+        $(\'#content_edit_save_return\').bind(\'click\', function () {\n+            indicateSavingAction();\n+            unWatchChanges();\n+            // Note, no \'actions.submit\' here, because we\'re using a plain "submit" in the form.\n+        });\n+    }\n+\n     /**\n      * Initialize "save and create new" button handlers.\n      *\n@@ -281,7 +311,7 @@\n \n         $(\'#content_edit_save_create\').bind(\'click\', function () {\n             indicateSavingAction();\n-            watchChanges();\n+            unWatchChanges();\n             bolt.actions.submit($(\'form[name="content_edit"]\'), this);\n         });\n     }\n@@ -494,6 +524,7 @@\n     editcontent.init = function (data) {\n         initValidation();\n         initSave(data);\n+        initSaveReturnToOverview();\n         initSaveCreateNew();\n         initPreview();\n         initLiveEditor();\ndiff --git a/app/view/js/bolt.js b/app/view/js/bolt.js\nindex 29ff7db67..f50d25fe4 100644\n--- a/app/view/js/bolt.js\n+++ b/app/view/js/bolt.js\n@@ -6,4 +6,4 @@\n  * get these files. See: https://docs.bolt.cm/core-development/install-git-clone, \n  * as well as the `README.md` file in the `app/src/` folder.\n  */\n-String.prototype.subst=function(e){"use strict";return this.replace(/%[A-Z][A-Z0-9_]+%/g,function(t){return t in e?e[t]:t})};var init={depublishTracking:function(){"use strict";var e=$("#datedepublish").data("notice");$("#datedepublish, #statusselect").on("change",function(){var t=$("#statusselect").val(),i=$("#datedepublish").val();$(".dateDepublishNotice").remove(),""!==i&&"published"===t&&moment(i+Bolt.conf("timezone.offset"))<moment()&&$(\'<div class="dateDepublishNotice alert alert-warning alert-dismissible"><button type="button" class="close" data-dismiss="alert">×</button>\'+e+"</div>").hide().insertAfter(".depublish-group").slideDown("fast")}),$("#datedepublish").trigger("change")},bindEditFile:function(e){"use strict";var t;if("undefined"!=typeof CodeMirror){t=CodeMirror.fromTextArea(document.getElementById("file_edit_contents"),{lineNumbers:!0,autofocus:!0,foldGutter:{rangeFinder:CodeMirror.fold.indent},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Ctrl-Q":function(e){e.foldCode(e.getCursor(),{rangeFinder:CodeMirror.fold.indent,minFoldSize:3})},Tab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(e.getOption("indentWithTabs")?"\\t":Array(e.getOption("indentUnit")+1).join(" "),"end","+input")},"Ctrl-S":function(){$("#file_edit_save").click()},"Ctrl-H":"replaceAll"},tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:e.readonly});var i=$(window).height()-312;i<200&&(i=200),t.setSize(null,i)}$("#file_edit_save").on("click",function(e){Bolt.events.fire("Bolt.File.Save.Start"),e.preventDefault(),t&&t.save();$("#file_edit_save").addClass("disabled"),$("#file_edit_save i").addClass("fa-spin fa-spinner"),$("p.lastsaved").text(Bolt.data("editcontent.msg.saving"));var i=$(e.target),n=$(\'form[name="file_edit"]\').serialize()+"&"+encodeURI(i.attr("name"))+"="+encodeURI(i.attr("value"));$.post("?returnto=ajax",n).done(function(e){e.ok?Bolt.events.fire("Bolt.File.Save.Done",e):(alert(e.msg),Bolt.events.fire("Bolt.File.Save.Fail",e)),$("p.lastsaved").html(e.msg)}).fail(function(){Bolt.events.fire("Bolt.File.Save.Fail"),alert("Not saved")}).always(function(){Bolt.events.fire("Bolt.File.Save.Always"),window.setTimeout(function(){$("#file_edit_save").removeClass("disabled").blur(),$("#file_edit_save i").removeClass("fa-spin fa-spinner")},300)})})},bindEditLocale:function(e){"use strict";CodeMirror.fromTextArea(document.getElementById("file_edit_contents"),{lineNumbers:!0,autofocus:!0,tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:e.readonly}).setSize(null,$(window).height()-276)},bindFileBrowser:function(){"use strict";$("#myTab a").click(function(e){e.preventDefault(),$(this).tab("show")});var e=function(e){var t=new RegExp("(?:[?&]|&)"+e+"=([^&]+)","i"),i=window.location.search.match(t);return i&&i.length>1?i[1]:null}("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(t){t.preventDefault();var i=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(e,i),window.close()}),$("a.filebrowserCloseLink").bind("click",function(){window.close()})},bindCkFileSelect:function(){"use strict";var e=function(e){var t=new RegExp("(?:[?&]|&)"+e+"=([^&]+)","i"),i=window.location.search.match(t);return i&&i.length>1?i[1]:null}("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(t){t.preventDefault();var i=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(e,i),window.close()})},bindPrefill:function(){"use strict";var e=$("#form_contenttypes").find(":checkbox");$("#prefill_check_all").on("click",function(){e.removeAttr("checked").trigger("click")}),$("#prefill_uncheck_all").on("click",function(){e.removeAttr("checked")})},confirmationDialogs:function(){"use strict";$(".confirm").on("click",function(){return confirm($(this).data("confirm"))})},dropDowns:function(){"use strict";$(\'[data-toggle="dropdown"]\').each(function(e,t){var i;"undefined"==typeof event?$(t).parent().click(function(e){i=e}):i=event,$(t).parent().on("show.bs.dropdown",function(){if(void 0!==i&&null!==i){var e=$(this).find(\'[data-toggle="dropdown"]\').next(".dropdown-menu"),t=i.pageY+20,n=e.height(),a=$(window).height()-t+n;t-n>20&&a<37&&e.css({top:"auto",bottom:"100%"})}})})},dropZone:function(){"use strict";$(document).bind("dragover",function(e){var t=$(".elm-dropzone"),i=window.dropZoneTimeout;i?clearTimeout(i):t.addClass("in"),e.target===t[0]?t.addClass("hover"):t.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,t.removeClass("in hover")},100)})},magnificPopup:function(){"use strict";$(".magnific, .fancybox").magnificPopup({type:"image",gallery:{enabled:!0},disableOn:400,closeBtnInside:!0,enableEscapeKey:!0,mainClass:"mfp-with-zoom",zoom:{enabled:!0,duration:300,easing:"ease-in-out",opener:function(e){return e.parent().parent().find("img")}}})},focusStatusSelect:function(){"use strict";$("#lastsavedstatus").click(function(e){e.preventDefault(),$(\'a[href="#tab-meta"]\').click(),$("#statusselect").focus()})},passwordInput:function(){"use strict";$(".togglepass").on("click",function(){$(this).hasClass("show-password")?($(\'input[name="password"]\').attr("type","text"),$(".togglepass.show-password").hide(),$(".togglepass.hide-password").show()):($(\'input[name="password"]\').attr("type","password"),$(".togglepass.show-password").show(),$(".togglepass.hide-password").hide())}),$(".login-forgot").bind("click",function(){$(".login-group, .password-group").hide(),$(".reset-group").show()}),$(".login-remembered").bind("click",function(){$(".login-group, .password-group").show(),$(".reset-group").hide()})},popOvers:function(){"use strict";$(".info-pop").popover({trigger:"hover",delay:{show:500,hide:200}})},sortables:function(){"use strict";$("tbody.sortable").sortable({items:"tr",opacity:"0.5",axis:"y",handle:".sorthandle",update:function(){var e=$(this).sortable("serialize");$.ajax({url:$("#baseurl").attr("value")+"content/sortcontent/"+$(this).parent("table").data("contenttype"),type:"POST",data:e,success:function(){}})}})}},Bolt={};!function(bolt,$){"use strict";var actions={};actions.init=function(){$("button, input[type=button], a").off("click.action"),$("[data-action]").on("click.action",function(e){var action=$(this).attr("data-action");void 0!==action&&""!==action&&(e.preventDefault(),eval(action),e.stopPropagation())}).on("click.popover",".popover",function(e){e.stopPropagation()}),$(".clickspinner").on("click.spinner",function(){$(this).addClass("disabled").blur(),$(this).find("i").addClass("fa-spin fa-spinner"),window.setTimeout(function(e){$(e).removeClass("disabled"),$(e).find("i").removeClass("fa-spin fa-spinner")},1e4,this)}),$(".submitspinner").on("submit.spinner",function(){$(this).find("button[type=submit]").addClass("disabled").blur(),$(this).find("button[type=submit] i").addClass("fa-spin fa-spinner"),window.setTimeout(function(e){$(e).removeClass("disabled"),$(e).find("i").removeClass("fa-spin fa-spinner")},1e4,$(this).find("button[type=submit]"))})},actions.submit=function(e,t){$(\'<input type="hidden" />\').attr("name",t.name).val(1).appendTo(e),e.submit()},bolt.actions=actions}(Bolt||{},jQuery),function(e,t,i,n){"use strict";function a(){n.confirmationDialogs(),n.magnificPopup(),n.dropZone(),n.popOvers(),n.dropDowns(),n.passwordInput(),n.sortables(),n.focusStatusSelect(),n.depublishTracking(),t("[data-bind]").each(function(){var i=t(this).data("bind");switch(i.bind){case"editcontent":e.editcontent.init(i);break;case"editfile":n.bindEditFile(i);break;case"editlocale":n.bindEditLocale(i);break;case"filebrowser":n.bindFileBrowser();break;case"ckfileselect":n.bindCkFileSelect();break;case"prefill":n.bindPrefill()}})}function o(){e.events.on("Bolt.GoogleMapsAPI.Load.Request",function(){if(void 0===l){l=!1;var i="https://maps.google.com/maps/api/js?sensor=false&callback=Bolt.app.gMapsApiReady";Bolt.conf.get("google_api_key")&&(i=i+"&key="+Bolt.conf.get("google_api_key")),t.getScript(i).fail(function(){l=void 0,e.events.fire("Bolt.GoogleMapsAPI.Load.Fail")})}else!0===l&&e.events.fire("Bolt.GoogleMapsAPI.Load.Done")})}function s(){var n=e.conf("locale.long");t.fn.select2.defaults.set("language",n.replace("_","-")),i.locale(n),t.datepicker.setDefaults(t.datepicker.regional[n])}var l,r={},d=1e4;r.gMapsApiReady=function(){l=!0,e.events.fire("Bolt.GoogleMapsAPI.Load.Done")},r.run=function(){e.conf.init(),e.data.init(),d=e.conf("buid").match(/(\\d+)$/)[1],s(),o(),e.actions.init(),e.secmenu.init(),e.stack.init(),e.omnisearch.init(),e.extend.init(),e.filemanager.init(),e.ckeditor.init(),e.datetime.init(),a(),e.app.initWidgets()},r.buid=function(){return"buid-"+d++},r.initWidgets=function(e){void 0===e&&(e=t(document.documentElement)),t("[data-bolt-widget]",e).each(function(){var e=t(this),i=e.data("bolt-widget"),n={};"string"==typeof i?n[i]={}:n=i,t.each(n,function(t,i){e[t](i).removeAttr("data-bolt-widget").removeData("bolt-widget")})})},t(document).ready(r.run),e.app=r}(Bolt||{},jQuery,moment,init),function(e,t,i){"use strict";function n(){var e=[];for(var t in arguments)if(1===arguments[t].length||arguments[t][0]){var i=arguments[t][arguments[t].length-1];"string"==typeof i&&"|"===i.substr(0,1)&&(i=i.substr(1),e=e.concat("-")),e=e.concat(i)}return e}var a={};a.init=function(){i&&(i=a.initcke(i))},a.update=function(){if(i)for(var e in i.instances)i.instances.hasOwnProperty(e)&&i.instances[e].updateElement()},a.add=function(e){i&&i.replace(e)},a.initcke=function(i){return i.editorConfig=function(i){var a,o=t(this.element.$).data("param")||{},s=e.conf("ckeditor");i.language=e.conf("ckeditor.lang"),i.skin="boltcke",i.resize_enabled=!0,i.entities=!1,i.fillEmptyBlocks=!1,i.extraPlugins+=(i.extraPlugins?",":"")+"codemirror",i.baseFloatZIndex=100015,i.toolbar=n([{name:"styles",items:n(["Format"],[s.styles,"Styles"])}],[{name:"basicstyles",items:n(["Bold"],["Italic"],[s.underline,"Underline"],[s.strike,"Strike"])}],[{name:"paragraph",items:n(["NumberedList"],["BulletedList"],["Indent"],["Outdent"],[s.blockquote,"|Blockquote"])}],[{name:"links",items:n(["Link"],["Unlink"],[s.anchor,"|Anchor"])}],[s.subsuper,{name:"subsuper",items:n(["Subscript"],["Superscript"])}],[s.images,{name:"image",items:n(["Image"])}],[s.embed,{name:"embed",items:n(["oembed"])}],[s.tables,{name:"table",items:n(["Table"])}],[s.ruler,{name:"ruler",items:n(["HorizontalRule"])}],[s.align,{name:"align",items:n(["JustifyLeft"],["JustifyCenter"],["JustifyRight"],["JustifyBlock"])}],[s.fontcolor,{name:"colors",items:n(["TextColor"],["BGColor"])}],[s.codesnippet,{name:"code",items:n(["|CodeSnippet"])}],[{name:"tools",items:n(["RemoveFormat"],["Maximize"],["|Source"],[s.specialchar,"|SpecialChar"])}]),s.embed&&(i.extraPlugins+=",oembed,widget",i.oembed_maxWidth="853",i.oembed_maxHeight="480"),i.height=250,i.autoGrow_onStartup=!0,i.autoGrow_minHeight=150,i.autoGrow_maxHeight=400,i.autoGrow_bottomSpace=24,i.removePlugins="elementspath",i.resize_dir="vertical",s.filebrowser?(s.filebrowser.browseUrl&&(i.filebrowserBrowseUrl=s.filebrowser.browseUrl),s.filebrowser.imageBrowseUrl&&(i.filebrowserImageBrowseUrl=s.filebrowser.imageBrowseUrl),s.filebrowser.uploadUrl&&(i.filebrowserUploadUrl=s.filebrowser.uploadUrl),s.filebrowser.imageUploadUrl&&(i.filebrowserImageUploadUrl=s.filebrowser.imageUploadUrl)):(i.filebrowserBrowseUrl="",i.filebrowserImageBrowseUrl="",i.filebrowserUploadUrl="",i.filebrowserImageUploadUrl=""),i.codemirror={theme:"default",lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseTags:!0,autoCloseBrackets:!0,enableSearchTools:!0,enableCodeFolding:!0,enableCodeFormatting:!0,autoFormatOnStart:!1,autoFormatOnUncomment:!1,autoFormatOnModeChange:!1,highlightActiveLine:!0,highlightMatches:!0,showFormatButton:!1,showCommentButton:!1,showUncommentButton:!1};for(a in s.ck)s.ck.hasOwnProperty(a)&&(i[a]=s.ck[a]);o.height&&(i.height=parseInt(o.height),i.autoGrow_minHeight=Math.max(i.autoGrow_minHeight,i.height),i.autoGrow_maxHeight=Math.max(i.autoGrow_maxHeight,i.height));for(a in o.ckeditor)o.ckeditor.hasOwnProperty(a)&&(i[a]=o.ckeditor[a])},e.conf("ckeditor").ck.allowNbsp&&i.on("instanceReady",function(e){e.editor.on("paste",function(e){e.data.dataValue=e.data.dataValue.replace(/&nbsp;/g," "),e.data.dataValue=e.data.dataValue.replace(/<p> <\\/p>/g,"")},null,null,9)}),i},e.ckeditor=a}(Bolt||{},jQuery,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t,i){"use strict";var n={},a=function(e){var t,i=e.split("."),a=n;for(t=0;t<i.length;t++){if(void 0===a[i[t]])return;a=a[i[t]]}return a};a.get=a,a.init=function(){n=t("script[data-config]").first().data("config")},e.conf=a}(Bolt||{},jQuery),function(e,t,i){"use strict";var n={},a=function(e,t){var i,a=e.split("."),o=n;for(i=0;i<a.length;i++){if(void 0===o[a[i]])return;o=o[a[i]]}return t&&"string"==typeof o?o.subst(t):o};a.get=a,a.init=function(){n=t("script[data-jsdata]").first().data("jsdata")||{}},e.data=a}(Bolt||{},jQuery),function(e,t,i){"use strict";function n(e){var t=e.closest(".datetime-container"),i={};return i.data=e,i.date=t.find("input.datepicker"),i.time=t.find("input.timepicker"),i.show=t.find("button.btn-tertiary"),i.clear=t.find("button.btn-default"),i.time.exists=i.time.length>0,i}function a(e){var i,n,a,o,s="",r="";"datedepublish"===e.data.attr("id")&&"1900-01-01 00:00:00"===e.data.val()&&e.data.val(""),(n=e.data.val().match(/^(\\d{4}-\\d{2}-\\d{2})(?: (\\d{2}:\\d{2}:\\d{2}))?$/))&&(s=n[1],r=n[2]||""),a=""===s||"0000-00-00"===s?"":t.datepicker.parseDate("yy-mm-dd",s),e.date.datepicker("setDate",a),e.time.exists&&"0000-00-00"!==s&&(""===r?r=""!==s?"00:00":"":l?r=e.data.val().slice(11,16):(o=(i=parseInt(r.slice(0,2)))<12?" AM":" PM",r=(i%12||12)+r.slice(2,5)+o),e.time.val(r)),e.data.trigger("change")}function o(e){var t,n,a,o=i(e.date.datepicker("getDate")),s=i([2001,11,24]),l=!1;if(e.time.exists){var r=new RegExp("^(?:(?:([01]?[0-9]|2[0-3]))[:,.]([0-5]?[0-9])|(1[012]|0?[1-9])[:,.]([0-5]?[0-9])(?:\\\\s*([AP])[. ]?M\\\\.?))$");(a=e.time.val().trim().toUpperCase().match(r))&&(t=parseInt(a[1]?a[1]:a[3]),n=parseInt(a[2]?a[2]:a[4]),"P"===a[5]&&12!==t?t+=12:"A"===a[5]&&12===t&&(t-=12),s=i([2001,11,24,t,n]),l=!0)}if(o.isValid()){var d=e.time.exists?" "+s.format("HH:mm:00"):"";e.data.val(o.format("YYYY-MM-DD")+d)}else l?e.data.val(i().format("YYYY-MM-DD")+" "+s.format("HH:mm:00")):e.data.val("")}function s(e){var t=e.date.data("field-options"),i={showOn:"none"};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);e.date.datepicker(i),e.show.click(function(){e.date.datepicker("show")}),e.clear.click(function(){e.data.val(""),a(e)})}var l,r={},d=[];r.update=function(){for(var e in d)d.hasOwnProperty(e)&&a(d[e])},r.init=function(){l=!i.localeData()._longDateFormat.LT.replace(/\\[.+?\\]/gi,"").match(/A/),t("input.datetime").each(function(){var e=n(t(this));d.push(e),s(e),a(e),e.date.change(function(){o(e),a(e)}),e.time.change(function(){o(e),a(e)})})},e.datetime=r}(Bolt||{},jQuery,moment),function(e,t,i,n,a,o){"use strict";function s(e){var i;return e.name&&(i=t(e).val(),"select-multiple"===e.type&&(i=JSON.stringify(i))),i}function l(){var e=0;return t(\'form[name="content_edit"]\').find("input, textarea, select").each(function(){if("content_edit[save]"!==t(this).attr("name"))if("textarea"===this.type&&t(this).hasClass("ckeditor"))o.instances[this.id].checkDirty()&&e++;else{var i=s(this);void 0!==i&&t(this).data("watch")!==i&&e++}}),e>0}function r(){t(\'form[name="content_edit"]\').find("input, textarea, select").each(function(){if("textarea"===this.type&&t(this).hasClass("ckeditor"))o.instances[this.id].checkDirty()&&(o.instances[this.id].updateElement(),o.instances[this.id].resetDirty());else{var e=s(this);void 0!==e&&t(this).data("watch",e)}}),i.onbeforeunload=function(){if(l()||e.liveEditor.active)return e.data("editcontent.msg.change_quit")}}function d(){t("#sidebar_save, #content_edit_save, #live_editor_save").addClass("disabled"),t("#sidebar_save i, #content_edit_save i").addClass("fa-spin fa-spinner"),t("p.lastsaved").text(e.data("editcontent.msg.saving"))}function c(){var i=t(\'form[name="content_edit"]\');i.attr("novalidate","novalidate").on("submit",function(i){var n=e.validation.run(this);if(t(this).data("valid",n),!n)return i.preventDefault(),!1}),i.on("boltvalidate",function(){var i=e.validation.run(this);return t(this).data("valid",i),i})}function u(){var e=i.location.hash,n=t("#filtertabs");e&&n.find(\'a[href="#tab-\'+e.replace(/^#/,"")+\'"]\').tab("show"),n.find("a").click(function(){var e;t(this).tab("show"),e=t("body").scrollTop(),i.location.hash=this.hash.replace(/^#tab-/,""),t("html,body").scrollTop(e)})}function f(){var e=t(\'form[name="content_edit"]\');e.find("#sidebar_preview").attr("disabled",!1),e.find("#content_edit_preview").attr("disabled",!1),t("#sidebar_preview").bind("click",function(){t("#content_edit_preview").trigger("click")}),t("#content_edit_preview").bind("click",function(i){var n=t(i.target).data("url");i.preventDefault(),e.attr("action",n).attr("target","_blank").submit(),e.attr("action","").attr("target","_self")})}function p(){}function h(){t("#sidebar_delete").bind("click",function(){t("#content_edit_delete").trigger("click")}),t("#content_edit_delete").bind("click",function(n){n.preventDefault();var o=this;a.confirm(e.data("editcontent.delete"),function(n){if(t(".alert").alert(),!0===n){var a=t(\'form[name="content_edit"]\');i.onbeforeunload=null,e.actions.submit(a,o)}})})}function m(){t("#sidebar_save_create").bind("click",function(){t("#content_edit_save_create").trigger("click")}),t("#content_edit_save_create").bind("click",function(){d(),r(),e.actions.submit(t(\'form[name="content_edit"]\'),this)})}function g(a){t("#sidebar_save").bind("click",function(){t("#content_edit_save").trigger("click")}),t("#content_edit_save").bind("click",function(s){s.preventDefault();var l=t(\'form[name="content_edit"]\');if(l.trigger("boltvalidate"),!l.data("valid"))return!1;var c=a.newRecord,u=a.savedon,f=a.msgNotSaved;if(d(),c)r(),e.liveEditor.active&&e.liveEditor.stop(),a.duplicate&&(i.onbeforeunload=null),e.actions.submit(l,this);else{r(),e.events.fire("Bolt.Content.Save.Start");var p=t(s.target),h=l.serialize()+"&"+encodeURI(p.attr("name"))+"="+encodeURI(p.attr("value"));t.post("",h).done(function(a){e.events.fire("Bolt.Content.Save.Done",{form:a}),i.onbeforeunload=null,t("p.lastsaved").removeClass("alert alert-danger").html(u).find("strong").text(n(a.datechanged).format("MMM D, HH:mm")).end().find(".buic-moment").buicMoment().buicMoment("set",a.datechanged);var s=t("#statusselect").find("option:selected");t("a#lastsavedstatus strong").html(\'<i class="fa fa-circle status-\'+s.val()+\'"></i> \'+s.text()),t("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner fa-exclamation-triangle").addClass("fa-check"),"object"===t.type(a)&&t.each(a,function(e,i){if("object"===t.type(i))t.each(i,function(i,n){t(\':input[name="\'+e+"["+i+\']"]\').val(n)});else if("array"===t.type(i));else{var n=t(l.name).find("[name="+e+"]");"checkbox"===n.attr("type")?n.prop("checked","1"===i):n.val(i),o&&o.instances[e]&&o.instances[e].setData(i,{callback:function(){this.resetDirty()}})}}),e.datetime.update(),r()}).fail(function(i){e.events.fire("Bolt.Content.Save.Fail");var n=t.parseJSON(i.responseText),a="<b>"+f+"</b><br><small>"+n.error.message+"</small>";t("p.lastsaved").html(a).addClass("alert alert-danger"),t("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner").addClass("fa-exclamation-triangle")}).always(function(){e.events.fire("Bolt.Content.Save.Always"),i.setTimeout(function(){t("#sidebar_save, #content_edit_save, #live_editor_save").removeClass("disabled").blur()},1e3),i.setTimeout(function(){t("#sidebar_save i, #content_edit_save i").addClass("fa-flag")},5e3)})}})}function v(){t("#content_edit_save").is("*")&&(t("body, input").bind("keydown.ctrl_s keydown.meta_s",function(e){e.preventDefault(),r(),t("#content_edit_save").trigger("click")}),i.setTimeout(function(){r()},1e3))}var b={};b.init=function(t){c(),g(t),m(),f(),p(),h(),u(),e.liveEditor.init(t),i.setTimeout(function(){v()},1e3)},e.editcontent=b}(Bolt||{},jQuery,window,moment,bootbox,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";function i(e){return t(".extend-bolt-container").find(e)}function n(i){var n="",a="",o="";try{n=t.parseJSON(i.responseText)}catch(e){t(".modal").modal("hide"),bootbox.alert("<p>An unknown error occurred. This was the error message:</p>\\n\\n<pre>"+e.message+"</pre>")}"Bolt\\\\Exception\\\\PackageManagerException"===n.error.type?(o=n.error.message.replace(/(<http)/g,\'<a href="http\').replace(/(\\w+>)/g,\'">this link</a>\'),a=e.data("extend.packages.error",{"%ERROR_TYPE%":"Composer Error","%ERROR_MESSAGE%":o,"%ERROR_LOCATION%":""})):"Bolt\\\\Exception\\\\ExtensionsInfoServiceException"===n.error.type?(o=n.error.message,a=e.data("extend.packages.error",{"%ERROR_TYPE%":"Extension Site Error","%ERROR_MESSAGE%":o,"%ERROR_LOCATION%":""})):a=e.data("extend.packages.error",{"%ERROR_TYPE%":"PHP Error","%ERROR_MESSAGE%":n.error.message,"%ERROR_LOCATION%":"File: "+n.error.file+"::"+n.error.line}),t(".modal").modal("hide"),bootbox.alert(a)}function a(t){var i="";for(var n in t)if(t.hasOwnProperty(n)){var a=t[n],o=e.data("extend.packages"),s=[],l=[],r=0;if(a.authors&&a.authors.length>0)for(r=0;r<a.authors.length;r++)s.push(o.author.subst({"%AUTHOR%":a.authors[r].name}));if(s=s.length?o.authors.subst({"%AUTHORS%":s.join(", ")}):"",a.keywords&&a.keywords.length>0)for(r=0;r<a.keywords.length;r++)l.push(o.keyword.subst({"%KEYWORD%":a.keywords[r]}));l=l.length?o.keywords.subst({"%KEYWORDS%":l.join(" ")}):"","wikimedia/composer-merge-plugin"===a.name&&(a.title="Local Extension Helper");var d="",c={"%NAME%":a.name,"%VERSION%":a.version,"%BASEURL%":e.data("extend.baseurl"),"%MARKETPLACE_URL%":"https://market.bolt.cm/view/"+a.name,"%REPOSITORY_URL%":a.repositoryLink};d="installed"===a.status&&"composer-plugin"!==a.type?o.manage_dropdown_installed.subst(c):o.manage_dropdown_uninstalled.subst(c);var u=o.left_buttons.subst({"%README%":null!==a.readmeLink?o.readme_button.subst({"%README%":a.readmeLink}):"","%CONFIG%":null!==a.configLink?o.config_button.subst({"%CONFIG%":a.configLink}):"","%THEME%":"bolt-theme"===a.type?o.theme_button.subst({"%NAME%":a.name}):""});i+=o.item.subst({"%TITLE%":a.title?a.title:a.name,"%NAME%":a.name,"%VERSION%":a.version,"%AUTHORS%":s,"%TYPE%":a.type,"%MANAGE%":d,"%DETAILS%":u,"%BASEURL%":e.data("extend.baseurl"),"%DESCRIPTION%":a.description?o.description.subst({"%DESCRIPTION%":a.description}):"","%KEYWORDS%":l,"%STATUS%":!1===a.valid?" — [INVALID] ":"","%ENABLED%":!1===a.enabled?" — [DISABLED] ":"","%CONSTRAINT%":null!==a.constraint?\'<i class="fa fa-cog fa-fw"></i> Requires Bolt \'+a.constraint:""})}return i}function o(){i(".installed-container").each(function(){var o=t(this).find(".installed-list");R=i(".installed-container .console"),t.get(e.data("extend.baseurl")+"installed",function(t){var n="";if("object"==typeof t){o.show(),o.find(".installed-list-items").html(""),i(".installed-container .console").hide();var s=!0;"object"==typeof t&&(n+=a(t),s=!1),s&&(n=e.data("extend.packages.empty"),R.hide()),o.find(".installed-list-items").append(n)}else R.html(e.data("extend.text.bad-json"))}).fail(function(e){n(e)})})}function s(){t("#installModal").on("hide.bs.modal",function(){i(".latest-version-container .installed-version-item").html(\'<tr><td colspan="3"><strong>\'+e.data("extend.text.no-stable")+"</strong></td></tr>"),i(".stable-version-container .installed-version-item").html(\'<tr><td colspan="3"><strong>\'+e.data("extend.text.no-stable")+"</strong></td></tr>"),i(".dev-version-container .installed-version-item").html(\'<tr><td colspan="3"><strong>\'+e.data("extend.text.no-test")+"</strong></td></tr>"),i(".install-response-container .console").html(e.data("extend.text.installing")),i(".theme-postinstall").hide(),i(".theme-generate-response").hide(),i(".extension-postinstall").hide(),i(".install-response-container").hide(),i(".install-latest-container").hide(),i(".install-version-container").hide(),i(".postinstall-footer").hide(),i("#installModal .loader").show()})}function l(){var a,o;i(".update-container").show(),o=i(".update-output-console").html(),i(".update-output-notice").html(o),i(".update-output-notice").find(".update-output-element").removeClass("update-output-element").addClass("update-output").show(),i(".update-list").hide(),(a=i(".update-list-items")).html(""),(R=i(".update-output")).html(e.data("extend.text.updating")),t.get(e.data("extend.baseurl")+"check",function(t){if(t.updates.length>0||t.installs.length>0){var n,o;for(n in t.installs)t.installs.hasOwnProperty(n)&&(o=t.installs[n],a.append(e.data("extend.packages.install_new",{"%PACKAGE%":o.name,"%VERSION%":o.version,"%PRETTYVERSION%":o.prettyversion})));for(n in t.updates)t.updates.hasOwnProperty(n)&&(o=t.updates[n],a.append(e.data("extend.packages.install_update",{"%PACKAGE%":o.name,"%VERSION%":o.version,"%PRETTYVERSION%":o.prettyversion})));R.hide(),i(".update-list").show()}else R.html(e.data("extend.text.updated"))}).fail(function(e){n(e)})}function r(e,t,n){var a=i(".update-container");e&&a.find(".update-output-title").html(e),t&&(a.find(".update-output-console").find(".console").html(t),a.find(".update-output-console").show()),n&&a.find(".update-output-notice").html(n).show(),a.show()}function d(e,t){var n=i(".update-container");e&&n.find(".update-output-console").find(".console").html(e).show(),t&&n.find(".update-output-notice").html(t).show()}function c(){r(e.data("extend.text.running-update-all"),e.data("extend.text.running-update"),!1),t.get(e.data("extend.baseurl")+"update",function(e){setTimeout(function(){i(".update-container").hide()},7e3),d(e),o()}).fail(function(e){n(e)})}function u(a){var s=i(".update-output").html(e.data("extend.text.updating")),l=t(a.target).data("package");s.show(),R=s,t.get(e.data("extend.baseurl")+"update?package="+l).success(function(e){i(".update-output").html(e),i(\'.update-list-items tr[data-package="\'+l+\'"]\').remove(),B(function(){R.hide()},4e3),i(".update-list-items tbody tr").length<1&&i(".update-container").hide(),o()}).fail(function(e){n(e)}),a.preventDefault()}function f(a){r(e.data("extend.text.install-running"),e.data("extend.text.install-all"),!1),t.get(e.data("extend.baseurl")+"installAll",function(e){B(function(){i(".update-container").hide()},7e3),d(e),o()}).fail(function(e){n(e)}),a.stopPropagation(),a.preventDefault()}function p(a){r(e.data("extend.text.autoloader-update"),e.data("extend.text.autoloader-start")+" …",!1),t.get(e.data("extend.baseurl")+"dumpAutoload",function(e){B(function(){i(".update-container").hide()},7e3),d(e)}).fail(function(e){n(e)}),a.stopPropagation(),a.preventDefault()}function h(t){var i,n,a="";for(var o in t)t.hasOwnProperty(o)&&void 0!==(i=t[o])&&(n="approved"===i.buildStatus?" label-success":"",a+=e.data("extend.packages.versions",{"%NAME%":i.name,"%VERSION%":i.version,"%CLASS%%":n,"%BUILDSTATUS%":i.buildStatus}));return a}function m(a){R=i(".update-output"),t.get(e.data("extend.baseurl")+"installInfo?package="+a,function(e){var t=e.dev,n=e.beta,a=e.RC,o=e.stable;i(".dev-version-container .installed-version-item").html(""),o.length>0?(i(".stable-version-container .installed-version-item").html(""),i(".stable-version-container .installed-version-item").append(h(o)),i(".latest-version-container .installed-version-item").html(""),i(".latest-version-container .installed-version-item").append(h([e.stable[0]])),i(".install-latest-container").show()):i(".install-version-container").show(),a.length>0&&i(".dev-version-container .installed-version-item").append(h(a)),n.length>0&&i(".dev-version-container .installed-version-item").append(h(n)),t.length>0&&i(".dev-version-container .installed-version-item").append(h(t)),i("#installModal .loader").hide()}).fail(function(e){n(e)})}function g(e){var t=i(\'input[name="check-package"]\').val(),n=i(\'input[name="check-package"]\').data("packagename");n&&(t=n),m(t),e.preventDefault()}function v(){i(".install-latest-container").hide(),i(".install-version-container").show()}function b(e){i(".extension-postinstall").show(),i(".extension-postinstall .modal-success").show(),i(".postinstall-footer .ext-link").attr("href",e.source),i(".postinstall-footer").show()}function _(e){var t=e.name.split(/\\/+/).pop();i(".install-response-container").hide(),i(".theme-postinstall").show(),i(".theme-generation-container").show(),i(".theme-postinstall .theme-generator").data("theme",e.name),i(".theme-postinstall #theme-name").val(t),i(".postinstall-footer").show()}function k(i,a){t.get(e.data("extend.baseurl")+"packageInfo",{package:i,version:a}).done(function(e){"bolt-extension"===e.type&&b(e),"bolt-theme"===e.type&&_(e)}).fail(function(e){n(e)})}function w(a){var s=t(a.target).data("package"),l=t(a.target).data("version");i(".install-response-container").show(),i(".install-latest-container").hide(),i(".install-version-container").hide(),(R=i(".install-response-container .console")).html(e.data("extend.text.installing")),i("#installModal .loader .message").html(e.data("extend.text.installing")),t.get(e.data("extend.baseurl")+"install",{package:s,version:l}).done(function(){k(s,l),i(".install-response-container").hide(),i(".check-package").show(),i(\'input[name="check-package"]\').val(""),o()}).fail(function(e){n(e)}),a.preventDefault()}function y(a){var o=t(a.target).data("theme"),s=i("#theme-name").val();t.get(e.data("extend.baseurl")+"generateTheme",{theme:o,name:s}).done(function(e){i(".theme-generate-response").html("<p>"+e+"</p>").show(),i(".theme-generation-container").hide()}).fail(function(e){n(e)}),a.preventDefault()}function x(a){var o=t(a.target).data("theme"),s=i("#theme-name").val();if(confirm(e.data("extend.text.overwrite"))){var l=i(".installed-container .console").html(e.data("extend.text.copying"));l.show(),R=l,t.get(e.data("extend.baseurl")+"generateTheme",{theme:o,name:s}).done(function(e){R.html(e),B(function(){l.hide()},5e3)}).fail(function(e){n(e)})}a.preventDefault()}function C(e){t.get(t(e.target).data("readme")).done(function(e){bootbox.dialog({message:e||"Readme is empty."})}).fail(function(e){n(e)}),e.preventDefault()}function E(a){var o=t(a.target).data("needle"),s=t(a.target).data("constraint");i(".dependency-response-container").show(),i(".install-latest-container").hide(),i(".install-version-container").hide(),(R=i(".dependency-response-container .console")).html(""),t.get(e.data("extend.baseurl")+"depends",{needle:o,constraint:s}).done(function(e){i(".loader").hide(),i(".dependency-response-container").hide(),i(".check-package").show(),i(\'input[name="check-package"]\').val("");var t=i("#installModal .extension-dependencies-list");t.html(""),e.forEach(function(e){t.append("<li>"+e.link+"</li>")}),t.show(),i(".extension-dependencies").show(),i(".postinstall-footer").show()}).fail(function(e){n(e)}),a.preventDefault()}function S(e){m(t(e.target).data("available"))}function T(a){var s=i(".installed-container .console").html(e.data("extend.text.removing"));if(!1===confirm(e.data("extend.text.confirm-remove")))return a.stopPropagation(),a.preventDefault(),!1;s.show(),R=s,t.get(t(a.target).attr("href")).done(function(e){i(".installed-container .console").html(e),o(),B(function(){R.hide()},2e3)}).fail(function(e){n(e)}),a.preventDefault()}function I(){var n=i(\'input[name="check-package"]\');n.on("keyup",function(){var i=t(this).val();i.length<3||B(function(){t.ajax({url:e.data("extend.siteurl")+"list.json",dataType:"jsonp",data:{name:i,bolt:e.data("extend.sitever")}}).success(function(e){if(e.packages.length){var t=n.parent().find(".auto-search");t.html("").show();for(var i in e.packages)if(e.packages.hasOwnProperty(i)){var a=e.packages[i],o=\'data-request="prefill-package" data-packagename="\'+a.name+\'"\';t.append(\'<a class="btn btn-block btn-default prefill-package" \'+o+\'style="text-align: left;">\'+a.title+" <small "+o+">("+a.authors+" - "+a.name+")</small></a>")}n.on("blur",function(){t.fadeOut()})}})},500)})}function A(e){var n=t(e.target);i(\'input[name="check-package"]\').val(n.closest("a").text()),i(\'input[name="check-package"]\').data("packagename",n.data("packagename")),i(".auto-search").hide()}var R,D,$={},B=function(){var e=0;return function(t,i){clearTimeout(e),e=setTimeout(t,i)}}(),O={click:function(e){switch(t(e.target).data("request")){case"update-check":l();break;case"update-run":c();break;case"update-package":u(e.originalEvent);break;case"check-package":g(e.originalEvent);break;case"uninstall-package":T(e.originalEvent);break;case"install-package":w(e.originalEvent);break;case"prefill-package":A(e.originalEvent);break;case"install-run":f(e.originalEvent);break;case"autoload-dump":p(e.originalEvent);break;case"generate-theme":y(e.originalEvent);break;case"package-available":S(e.originalEvent);break;case"package-copy":x(e.originalEvent);break;case"package-readme":C(e.originalEvent);break;case"package-depends":E(e.originalEvent);break;case"show-all":v(e.originalEvent)}}};$.init=function(){var e=t(".extend-bolt-container");e.length&&(e.on("click",O.click),t(document).ajaxStart(function(){D=setInterval(function(){R&&R.append(".")},1e3)}).ajaxSuccess(function(){clearInterval(D)}).ajaxError(function(){clearInterval(D)}),o(),I(),s())},e.extend=$}(Bolt||{},jQuery),function(e,t){"use strict";var i={},n={},a=/^([a-zA-Z0-9_-]+)(?:\\.([a-zA-Z0-9_-]+))?(?:\\.([a-zA-Z0-9_-]+))?(?:\\.([a-zA-Z0-9_-]+))?$/;i.fire=function(e,t){var i=a.exec(e);if(i&&void 0!==i[4])for(;e;)n[e]&&n[e].fire({namespace:i[1],domain:i[2],event:i[3],status:i[4]},t),e=e.replace(/\\.?[a-zA-Z0-9_-]+$/,"")},i.on=function(e,i){a.exec(e)&&(n[e]||(n[e]=t.Callbacks("unique")),n[e].add(i))},i.off=function(e,t){a.exec(e)&&n[e]&&n[e].remove(t)},e.events=i}(Bolt||{},jQuery),function(e,t){"use strict";function i(e,i,n,a){var o={url:e,type:"POST",data:i,success:function(){document.location.reload()},error:function(e){alert(e.responseText),console.error(n)}};a&&(o.success=a),t.ajax(o)}var n={};n.createFile=function(t,n){var a=window.prompt(e.data("files.msg.create_file"));a.length&&i(e.data("url.file.create"),{filename:a,parentPath:n,namespace:t},"Something went wrong creating this file!")},n.renameFile=function(t,n,a){var o=window.prompt(e.data("files.msg.rename_file"),a);o.length&&o!==a&&i(e.data("url.file.rename"),{namespace:t,parent:n,oldname:a,newname:o},"Something went wrong renaming this file!")},n.deleteFile=function(n,a,o){confirm(e.data("files.msg.delete_file",{"%FILENAME%":a}))&&i(e.data("url.file.delete"),{namespace:n,filename:a},"Failed to delete the file from the server",function(){null!==o&&t(o).closest("tr").slideUp()})},n.duplicateFile=function(t,n){i(e.data("url.file.duplicate"),{namespace:t,filename:n},"Something went wrong duplicating this file!")},n.createFolder=function(t,n){var a=window.prompt(e.data("files.msg.create_folder"));a.length&&i(e.data("url.folder.create"),{parent:n,foldername:a,namespace:t},"Something went wrong renaming this folder!")},n.renameFolder=function(t,n,a){var o=window.prompt(e.data("files.msg.rename_folder"),a);o.length&&o!==a&&i(e.data("url.folder.rename"),{namespace:t,parent:n,oldname:a,newname:o},"Something went wrong renaming this folder!")},n.deleteFolder=function(t,n,a){window.confirm(e.data("files.msg.delete_folder",{"%FOLDERNAME%":a}))&&i(e.data("url.folder.delete"),{namespace:t,parent:n,foldername:a},"Something went wrong renaming this folder!")},e.files=n}(Bolt||{},jQuery),function(e,t,i){"use strict";function n(e){return e.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g,"\\\\$1")}function a(e,t){var i="<mark>"+t+"</mark>";return e.replace(new RegExp(n(t),"g"),i)}function o(){var e=t(this).val();t(".dashboardlisting").find("[data-bolt-browse-name]").each(function(){var i=t(this).data("bolt-browse-name"),n=i.search(e)<0;t(this).toggleClass("hidden",n),n||t(this).find(".name").each(function(){t(this).html(a(i,e)),0===e.length&&t(this).html(i)})})}function s(){for(var e=document.querySelectorAll("img[data-src]"),t=0;t<e.length;t++)e[t].getAttribute("data-src")&&(e[t].setAttribute("src",e[t].getAttribute("data-src")),e[t].removeAttribute("data-src"))}function l(){document.getElementById("file-manager-search").addEventListener("keyup",o),t("#file_upload_select").addClass("btn-secondary").bootstrapFileInput(),document.getElementById("file_upload_select").addEventListener("change",function(){document.getElementById("file_upload_upload").removeAttribute("disabled")}),window.addEventListener("load",s)}function r(e){var i=t("body"),n=0;i.bind({dragenter:function(e){e.preventDefault(),n++,t(this).addClass("dropzone-active")},dragleave:function(){0===--n&&t(this).removeClass("dropzone-active")}}),e.on("drop",function(){i.removeClass("dropzone-active")})}function d(){var n=t(\'form[name="file_upload"]\').find("#file_upload__token").val(),a=new i(document.body,{url:e.conf("uploadConfig.url"),previewsContainer:"#dropzone-preview",acceptedFiles:"."+e.conf("uploadConfig.acceptFilesTypes").join(",."),uploadMultiple:"true",enqueueForUpload:"true",hiddenInputContainer:".form-horizontal",paramName:"file_upload[select]",clickable:!1,autoProcessQueue:!0,params:{"file_upload[_token]":n},init:function(){r(this)}});a.on("sending",function(){t(".panel-uploadprogress").removeClass("hidden")}),a.on("complete",function(e){a.removeFile(e)}),a.on("totaluploadprogress",function(e){100===e&&window.setTimeout(function(){location.reload()},200)})}var c={};c.init=function(){i.autoDiscover=!1,null!==document.querySelector(".file-manager")&&(d(),l())},e.filemanager=c}(Bolt||{},jQuery,Dropzone),function(e,t,i,n){"use strict";var a={},o=["text","html","textarea"],s=null;a.init=function(e){a.previewUrl=e.previewUrl,Modernizr.contenteditable?(t("#sidebar_live_edit, #content_edit_live_edit").bind("click",a.start),t(".close-live-editor").bind("click",a.stop),t(".save-live-editor").bind("click",a.save)):t(".live-editor, #sidebar_live_editor, #content_edit_live_edit").remove()},a.start=function(){var i=t(\'form[name="content_edit"]\');if(e.validation.run(i[0])){var n=i.find("*[name=_live-editor-preview]"),l=t("#navpage-primary").find(".navbar-header a"),r=t("#live-editor-iframe"),d=function(e){e.preventDefault()},c=function(){var n=r[0],s=n.contentWindow||n,l=s.document,c=t(l);c.on("click","a",d);var u=e.ckeditor.initcke(s.CKEDITOR),f=u.editorConfig;u.editorConfig=function(e){f.bind(this)(e);for(var t in e.toolbar)if("tools"===e.toolbar[t].name){var i=e.toolbar[t].items.indexOf("Source");i>-1&&delete e.toolbar[t].items[i]}},u.disableAutoInline=!1,c.find("[data-bolt-field]").each(function(){var n=i.find("*[name="+a.escapejQuery(t(this).data("bolt-field"))+"]").closest("[data-bolt-fieldset]").data("bolt-fieldset");if(t(this).addClass("bolt-editable"),!t(this).data("no-edit")&&-1!==o.indexOf(n))if(t(this).attr("contenteditable",!0),"html"===n){var r=u.inline(this,{allowedContent:""}),d=e.utils.debounce(function(){r.element.data("src",r.getData())},500);r.on("instanceReady",d),r.on("change",d)}else t(this).on("paste",function(e){var t;e.preventDefault(),e.originalEvent.clipboardData?(t=e.originalEvent.clipboardData.getData("text/plain"),l.execCommand("insertText",!1,t)):s.clipboardData&&(t=s.clipboardData.getData("Text"),s.getSelection&&s.getSelection().getRangeAt(0).insertNode(l.createTextNode(t)))}),"textarea"===n?t(this).on("keypress",function(e){13===e.which&&(e.preventDefault(),l.execCommand("insertHTML",!1,"<br><br>"))}):t(this).on("keypress",function(e){return 13!==e.which}).on("focus blur",function(){t(this).html(t(this).text())})})};r.on("load",c),e.liveEditor.active=!0,t("body").addClass("live-editor-active"),l.on("click",d),n.val("yes"),i.attr("action",a.previewUrl).attr("target","live-editor-iframe").submit(),i.attr("action","").attr("target","_self"),n.val(""),s=function(){r.off("load",c),l.off("click",d)}}},a.save=function(){a.extractText(),t("#content_edit_save").trigger("click")},a.stop=function(){var i=t("#live-editor-iframe")[0];a.extractText(),t(i).attr("src",""),e.liveEditor.active=!1,t("body").removeClass("live-editor-active"),s()},a.extractText=function(){var e=t("#live-editor-iframe")[0],i=(e.contentWindow||e).document;t(i).find("[data-bolt-field]").each(function(){var e=t(\'form[name="content_edit"]\'),i=t(this).data("bolt-field"),o=e.find("[name="+a.escapejQuery(i)+"]"),s=o.closest("[data-bolt-fieldset]").data("bolt-fieldset");if("html"===s){var l=o.attr("id");n.instances.hasOwnProperty(l)&&n.instances[l].setData(t(this).data("src"))}else o.val(a.cleanText(t(this),s))})},a.cleanText=function(e,t){return"textarea"===t&&e.html(e.html().replace(/&nbsp;/g," ").replace(/\\s?<br.*?>\\s?/g,"\\n")),e.text()},a.escapejQuery=function(e){return e.replace(/[:\\.\\[\\],]/g,"\\\\$1")},a.active=!1,a.previewUrl=null,e.liveEditor=a}(Bolt||{},jQuery,window,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t,i){"use strict";var n={};n.init=function(){var n=t(".omnisearch select");n.select2({width:"100%",placeholder:e.data("omnisearch.placeholder"),minimumInputLength:3,multiple:!0,ajax:{delay:600,url:n.data("omnisearchUrl"),dataType:"json",data:function(e){return{q:e.term}},processResults:function(e){var i=[];return t.each(e,function(e,t){i.push({id:t.path,path:t.path,text:t.label})}),{results:i}}},templateResult:function(e){var t=e.path?"<small>"+e.path+"</small>":"";return"<div>"+(e.loading?\'<i class="fa fa-spinner fa-spin"></i> \':"")+e.text+"</div>"+t},templateSelection:function(e){return i.location.href=e.path,null},escapeMarkup:function(e){return e}})},e.omnisearch=n}(Bolt||{},jQuery,window),function(e,t,i){"use strict";function n(){t(".navbar-toggle").on("click",function(){var e=t("#navpage-wrapper");e.hasClass("nav-secondary-opened")?e.removeClass("nav-secondary-opened nav-secondary-collapsed"):e.removeClass("nav-secondary-collapsed").addClass("nav-secondary-opened")})}function a(){t(".nav-secondary-collapse a").on("click",function(){return t("#navpage-wrapper").removeClass("nav-secondary-opened").addClass("nav-secondary-collapsed"),setTimeout(function(){t("#navpage-wrapper").addClass("nav-secondary-collapsed-hoverable")},300),t.cookie("sidebar","collapsed",{expires:21,path:"/"}),t("#bolt-footer").addClass("bolt-footer-hidden"),!1})}function o(){t(".nav-secondary-expand a").on("click",function(){return t("#navpage-wrapper").removeClass("nav-secondary-collapsed nav-secondary-opened nav-secondary-collapsed-hoverable"),t.removeCookie("sidebar",{path:"/"}),t("#bolt-footer").removeClass("bolt-footer-hidden"),!1})}function s(){var e=t("#navpage-content").outerHeight(),n=t("#navpage-secondary"),a=n.outerHeight(),o=t(document).height()-n.position().top,l=Math.max(e,o),r=5e3;a!==l&&(n.outerHeight(l),r=500),i.setTimeout(s,r)}function l(){t("#navpage-secondary").find("a.menu-pop").each(function(){var e=t(this),n="";e.nextAll(".submenu").children().each(function(){t(this).hasClass("subdivider")&&(n+="<hr>"),n+=t(this).html().trim().replace(/[ \\n]+/g," ").replace(/(>) | (<)/g,"$1$2")}),e.popover({trigger:"manual",content:n,html:!0}),e.on("mouseover focus click dblclick",function(e){var n=this,a=300;"click"!==e.type||t(n).next().hasClass("popover")||(e.preventDefault(),a=0),i.clearTimeout(c),c=i.setTimeout(function(){t("#navpage-secondary a.menu-pop").not(n).popover("hide"),t(n).popover("show")},a)})}).end().on("mouseenter focus",".popover",function(){i.clearTimeout(c)}).on("mouseleave blur","a.menu-pop, .popover",function(){i.clearTimeout(c),c=i.setTimeout(function(){t("#navpage-secondary a.menu-pop").popover("hide")},300)})}function r(){t("#navpage-secondary a.menu-pop").on("click",function(e){var i=t(this).nextAll(".submenu");e.preventDefault(),i.hasClass("show")?i.removeClass("show"):(t("#navpage-secondary .submenu").removeClass("show"),i.addClass("show"))})}var d={},c=0;d.init=function(){var e=!t(".navbar-toggle").is(":visible");n(),a(),o(),t("#navpage-secondary").length&&s(),e?l():r()},e.secmenu=d}(Bolt||{},jQuery,window),function(e,t){"use strict";var i={};i.init=function(){t("a[data-bolt-addtostack]").each(function(){t(this).on("click",function(e){var n=t(e.currentTarget),a=n.data("bolt-addtostack");e.preventDefault(),i.addToStack(a,n)})})},i.addToStack=function(i,n){t.post(e.conf("stackAddUrl"),{filename:i}).done(function(e){n&&t(n).addClass("disabled"),t(":bolt-buicStack").buicStack("prepend",e.panel,e.removed),e.removed&&t(".select-from-stack [data-file]").each(function(){t(this).data("file").fullPath===e.removed&&t(this).remove()}),t(".select-from-stack").each(function(){var i=t(this).data("type");i&&e.type!==i||t(this).prepend(e.list)})}).fail(function(){console.error("Failed to add file to stack")})},e.stack=i}(Bolt||{},jQuery),function(e){"use strict";var t={};t.humanBytes=function(t){for(var i=-1;++i<8&&Math.abs(t)>=1e3;)t/=1e3;return(t="object"==typeof Intl&&Intl&&"function"==typeof Intl.NumberFormat?t.toLocaleString(e.conf("locale.long").replace(/_/g,"-"),{maximumSignificantDigits:3}):t.toFixed(2))+" "+" kMGTPEZY"[i].trim()+"B"},t.filterInt=function(e,t){return/^(\\-|\\+)?([0-9]+|Infinity)$/.test(e)?Number(e):t||NaN},t.debounce=function(e,t,i){var n;return function(){var a=this,o=arguments,s=i&&!n;clearTimeout(n),n=setTimeout(function(){n=null,i||e.apply(a,o)},t),s&&e.apply(a,o)}},e.utils=t}(Bolt||{}),function(e){"use strict";jQuery.widget("bolt.baseField",{_create:function(){}})}(),function(e){"use strict";var t={};e.widget("bolt.baseInterval",{options:{delay:1e4},_create:function(){var i=this,n=this.widgetName;if(!t[n]){var a=e.Callbacks(),o=setInterval(a.fire,this.options.delay);t[n]={id:o,delay:this.options.delay,callbacks:a}}this._fncUpdate=function(){i._update()},t[n].callbacks.add(this._fncUpdate)},_destroy:function(){var e=this.widgetName;t[e].callbacks.remove(this._fncUpdate),t[e].callbacks.has()||(clearInterval(t[e].id),delete t[e])}})}(jQuery),function(e){"use strict";e.widget("bolt.buicBrowser",{options:{url:"",multiselect:!1},_create:function(){this._url=this.options.url,this._on({click:function(){this._browse()}})},_browse:function(){var t=this,i={multiselect:this.options.multiselect},n=[],a=!1;e("body").buicModal({size:"large",remote:{url:t._url,data:i},loaded:function(i,o){var s=o.footer.find("[data-fbrowser-add-checked]");o.header.on("click.bolt","[data-fbrowser-chdir]",function(i){i.preventDefault(),t._url=e(this).data("fbrowser-chdir"),t._browse()}),o.body.on("click.bolt","[data-fbrowser-chdir]",function(i){i.preventDefault(),t._url=e(this).data("fbrowser-chdir"),t._browse()}).on("click.bolt","[data-file] a",function(i){i.preventDefault();var n=e(this).closest("[data-file]").data("file");t._trigger("selected",null,n),o.close()}).on("click.bolt","[aria-pressed]",function(t){var i="false"===e(this).attr("aria-pressed"),n=this.className.replace("toogle-","");e(this).attr("aria-pressed",i?"true":"false"),o.body.find("tbody."+n).toggleClass("hidden",!i),t.clientX>0&&this.blur()}).on("change",\'select[name="ext"]\',function(){t._filter(o)}).keyup(\'input[name="filter"]\',function(){t._filter(o)}).on("change","[data-fbrowser-check]",function(){var t=e(this).closest("[data-file]").data("file"),i=n.indexOf(t.fullPath);i>-1?(n.splice(i,1),a=!1,0===n.length&&s.addClass("disabled")):(n.push(t.fullPath),s.removeClass("disabled"))}),o.footer.on("click.bolt",".toggle-all",function(t){t.preventDefault(),a?(o.body.find("[data-fbrowser-check]").each(function(){e(this).prop("checked",!1)}),n.length=0,a=!1,s.addClass("disabled")):(o.body.find("[data-fbrowser-check]").each(function(){e(this).prop("checked",!0);var t=e(this).closest("[data-file]").data("file");n.push(t.fullPath)}),a=!0,s.removeClass("disabled"))}).on("click.bolt","[data-fbrowser-add-checked]:not(.disabled)",function(i){i.preventDefault(),o.body.find("[data-fbrowser-check]").each(function(){if(e(this).prop("checked")){var i=e(this).closest("[data-file]").data("file");t._trigger("selected",null,i)}}),o.close()})}})},_filter:function(t){var i,n,a=t.body.find(\'input[name="filter"]\').val(),o=t.body.find(\'select[name="ext"]\').val();t.body.find("[data-file],[data-folder]").each(function(){i=e(this).data("file")||e(this).data("folder"),n=""!==o&&i.extension!==o||""!==a&&i.filename.search(a)<0,e(this).toggleClass("hidden",n),n||e(this).find("a, span").each(function(){e(this).html(i.filename.replace(a,"<mark>"+a+"</mark>"))})})}})}(jQuery),function(e){"use strict";jQuery.widget("bolt.buicCheckbox",{_create:function(){var e=this.element.find("button"),t=this.element.find("input");this._on(e,{click:function(){t.prop("checked",!t.prop("checked"))}})}})}(),function(e,t){"use strict";e.widget("bolt.buicListing",{_create:function(){this.csrfToken=this.element.data("bolt_csrf_token"),this.contentType=this.element.data("contenttype"),this.contentTypeName=this.element.data("contenttype-name"),this.element.find("table.listing tbody").buicListingPart()},modifyRecords:function(i,n,a){var o,s=this,l={},r={delete:{safe:!1,name:t.data("recordlisting.action.delete",{"%CTNAME%":this.contentTypeName}),cmd:{delete:null}},publish:{safe:!0,name:t.data("recordlisting.action.publish",{"%CTNAME%":this.contentTypeName}),cmd:{modify:{status:"published"}}},depublish:{safe:!0,name:t.data("recordlisting.action.depublish"),cmd:{modify:{status:"held"}}},draft:{safe:!0,name:t.data("recordlisting.action.draft"),cmd:{modify:{status:"draft"}}}};l[s.contentType]={},e(n).each(function(){l[s.contentType][this]=r[i].cmd}),o=(o=1===n.length?t.data("recordlisting.confirm.one"):t.data("recordlisting.confirm.multi",{"%NUMBER%":"<b>"+n.length+"</b>"}))+"<br><br><b>"+t.data("recordlisting.confirm.no-undo")+"</b>",r[i].safe?s._sendModifyRecordsQuery(l):bootbox.dialog({message:o,title:r[i].name,buttons:{cancel:{label:t.data("recordlisting.action.cancel"),className:"btn-default"},ok:{label:a,className:"btn-danger",callback:function(){s._sendModifyRecordsQuery(l)}}}})},_sendModifyRecordsQuery:function(i){var n=this;e.ajax({url:t.conf("contentActionUrl"),type:"POST",data:{bolt_csrf_token:n.csrfToken,contenttype:n.contentType,actions:i},success:function(e){n.element.html(e),n.element.find("table.listing tbody").buicListingPart()},error:function(e,t,i){console.error(e.status+" ("+i+"):"),console.error(JSON.parse(e.responseText))},dataType:"html"})}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.buicListingPart",{_create:function(){var t=this;this.listing=this.element.closest(":bolt-buicListing"),this.toolbar=this.element.find("tr.selectiontoolbar"),this.toolbarCount=this.toolbar.find("div.count"),this.menu=this.element.find("tr.header th.menu"),this.menuOnlyOnSelection=this.menu.find("li:not(.select-all)"),this.menuSelectionCount=this.menu.find("li.dropdown-header"),this.menuSelectionCountTemplate=this.menuSelectionCount.text(),this.selectedIds=[],this.menu.find("li.select-all, li.select-none").on("click",function(){var i=e(this).hasClass("select-all");t.element.find(\'td input:checkbox[name="checkRow"]\').each(function(){this.checked=i,t._update(this)})}),this.element.find(\'td input:checkbox[name="checkRow"]\').on("click",function(){t._update(this)}),this.toolbar.find(\'button[data-stb-cmd^="record:"]\').on("click",function(){t._modifyRecords(e(this).data("stb-cmd"),t.selectedIds,e(this).html())}),this.element.find(\'a[data-listing-cmd^="record:"]\').on("click",function(){t._modifyRecords(e(this).data("listing-cmd"),[e(this).parents("tr").attr("id").substr(5)],e(this).html())})},_modifyRecords:function(e,t,i){t.length>0&&this.listing.buicListing("modifyRecords",e.replace(/^record:/,""),t,i)},_update:function(t){var i,n=e(t).closest("tr"),a=n.attr("id").substr(5);t.checked?(-1===this.selectedIds.indexOf(a)&&this.selectedIds.push(a),n.addClass("row-selected")):(this.selectedIds.splice(this.selectedIds.indexOf(a),1),n.removeClass("row-selected")),(i=this.selectedIds.length)?(this.toolbar.removeClass("hidden"),this.menuOnlyOnSelection.removeClass("hidden")):(this.toolbar.addClass("hidden"),this.menuOnlyOnSelection.addClass("hidden")),this.toolbarCount.text(i),this.menuSelectionCount.text(this.menuSelectionCountTemplate.replace("(#)","("+i+")"))}})}(jQuery),function(e){"use strict";e.widget("bolt.buicModal",{options:{size:void 0,closer:!1,classname:void 0,headline:void 0,header:void 0,body:void 0,footer:void 0,remote:void 0,loaded:void 0},_create:function(){var t=this,i=e(\'<div class="modal-header hidden"/>\'),n=e("<div class=modal-body/>"),a=e(\'<div class="modal-footer hidden"/>\'),o=e("<div class=modal-content/>").append(i,n,a),s=e("<div class=modal-dialog role=document/>").append(o),l=e(\'<div tabindex=-1 role=dialog class="modal fade buic-modal"/>\').append(s);this._ui={header:i,body:n,footer:a,content:o,dialog:s,modal:l},this._on(this.element,{"click .modal-retry":function(){t._load()}}),t.element.prepend(t._ui.modal),t._ui.modal.on("show.bs.modal",function(){t._fire("show")}).on("shown.bs.modal",function(){t._fire("shown")}).on("hide.bs.modal",function(){t._fire("hide")}).on("hidden.bs.modal",function(){t._fire("hidden"),t.destroy()}).modal("show")},_destroy:function(){this._ui.modal.data("modal",null).remove()},_fire:function(e){var t=this;t._trigger(e,null,{close:function(){t._ui.modal.modal("hide")},header:t._ui.header,body:t._ui.body,footer:t._ui.footer})},_init:function(){this._ui.dialog.toggleClass("modal-sm","small"===this.options.size).toggleClass("modal-lg","large"===this.options.size),this.options.remote?this._load():this._update()},_load:function(){var t=this;t._ui.content.addClass("modal-loading"),e.get(t.options.remote.url,t.options.remote.data||{}).done(function(i){t.options.classname=e(i)[0].className,e.each(["header","body","footer"],function(n,a){var o=e(i).children(a.replace("body","main"))[0];t.options[a]=o?o.innerHTML:void 0}),t._update(),t._fire("loaded")}).fail(function(){t.options.header=void 0,t.options.body=\'<button type=button class="btn btn-default modal-retry"><i class="fa fa-refresh"></i></button>\',t.options.footer=void 0,t._update()}).always(function(){t._ui.content.removeClass("modal-loading")})},_update:function(){var t,i=this;void 0!==this.options.headline&&(this.options.header=e(),this.options.closer&&(this.options.header=this.options.header.add(\'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>\')),this.options.header=this.options.header.add(e(\'<h4 class="modal-title"/>\').append(this.options.headline))),this._ui.content.attr("class","modal-content").addClass(this.options.classname),e.each(["header","body","footer"],function(n,a){t=e("<div>").append(i.options[a]).html()||"",i._ui[a].off().toggleClass("hidden",!t.length).html(t)}),this._ui.modal.modal("handleUpdate")}})}(jQuery),function(e,t){"use strict";e.widget("bolt.buicMoment",e.bolt.baseInterval,{options:{delay:15e3,titleFormat:"YYYY-MM-DD HH:mm:ss ZZ"},_create:function(){this.set(),this._super()},_update:function(){this.element.html(t(this.element.attr("datetime")).fromNow())},set:function(e){e?this.element.attr("datetime",t(e).format()):e=this.element.attr("datetime"),this.element.attr("title",t(e).format(this.options.titleFormat)),this._update()}})}(jQuery,moment),function(e){"use strict";e.widget("bolt.buicProgress",{_create:function(){this.bars={},this.element.addClass("buic-progress")},_set:function(e,t){t=parseFloat(t),t=isNaN(t)?0:Math.min(100,Math.max(0,Math.round(100*t))),this.bars[e]&&this.bars[e].find(".progress-bar").attr("aria-valuenow",t).css("width",t+"%")},add:function(t,i,n){this.bars[t]||(this.bars[t]=e(\'<div class="progress"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div></div>\'),this.bars[t].attr("data-label",n||t).find(".progress-bar").text(n||t),this._set(t,i),this.element.append(this.bars[t]).show(),this.bars[t].show(300))},remove:function(e){if(this.bars[e]){var t=this,i=this.bars[e];delete this.bars[e],i.hide(300,function(){i.remove(),0===Object.keys(t.bars).length&&t.element.hide()})}},set:function(e,t){this._set(e,t)}})}(jQuery),function(e){"use strict";jQuery.widget("bolt.buicSelect",{_create:function(){this.select=this.element.find("select"),this.buttonAll=this.element.find(".select-all"),this.buttonNone=this.element.find(".select-none"),this.buttonAll.prop("title",this.buttonAll.text().trim()),this._on(this.buttonAll,{click:function(){this.all()}}),this.buttonNone.prop("title",this.buttonNone.text().trim()),this._on(this.buttonNone,{click:function(){this.none()}}),this._update(),this._on(this.select,{change:function(){this._update()}})},_update:function(){var e=this.select.find("option"),t=e.length,i=e.filter(":selected").length,n=this.select.prop("multiple")?0===i:""===this.select.val();this.buttonAll.prop("disabled",i===t),this.buttonNone.prop("disabled",n)},all:function(){this.select.find("option").prop("selected",!0).trigger("change")},none:function(){this.select.val(null).trigger("change")}})}(),function(e,t){"use strict";e.widget("bolt.buicStack",{_addPath:function(e,i){t.stack.addToStack(i.path)},_create:function(){var e=this,i=this.element;this._ui={holder:i.find(".stackholder")},e._on({buicbrowserselected:e._addPath,buicuploaduploaded:e._addPath}),i.on("inserted.bs.popover",".stackitem",function(){t.app.initWidgets()}),i.buicUpload()},prepend:function(t,i){i&&this._ui.holder.find("[data-file]").each(function(){e(this).data("file").fullPath===i&&e(this).remove()}),this._ui.holder.find(".empty").remove(),this._ui.holder.prepend(t),this._ui.holder.find(".info-pop").popover({trigger:"hover",delay:{show:500,hide:200}})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.buicUpload",{_create:function(){var i=this.element,n=e("input[type=file]",i),a=e(".elm-dropzone",i),o=e(n).attr("accept"),s=o?o.replace(/^\\./,"").split(/,\\./):[],l=new RegExp("(\\\\.|\\\\/)("+s.join("|")+")$","i");if(null===this.options.maxSize){var r=Math.floor(t.conf("uploadConfig.maxSize"));this.options.maxSize=t.utils.filterInt(r,2e6)}this._ui={progress:null},n.fileupload({dataType:"json",dropZone:a,pasteZone:null,maxFileSize:this.options.maxSize>0?this.options.maxSize:void 0,minFileSize:void 0,acceptFileTypes:o?l:void 0,maxNumberOfFiles:void 0,messages:{maxFileSize:">:"+t.utils.humanBytes(this.options.maxSize),minFileSize:"<",acceptFileTypes:"T:."+s.join(", ."),maxNumberOfFiles:"#"}}),this._on({fileuploadprocessfail:this._onProcessFail,fileuploadsubmit:this._onUploadSubmit,fileuploadprogress:this._onUploadProgress,fileuploadalways:this._onUploadAlways,fileuploaddone:this._onUploadDone})},_onProcessFail:function(e,i){var n,a=i.files[i.index],o=a.error.substr(0,1),s={"%FILENAME%":a.name,"%FILESIZE%":t.utils.humanBytes(a.size),"%FILETYPE%":a.type,"%ALLOWED%":a.error.substr(2)};switch(o){case">":n=t.data("field.uploads.template.large-file",s);break;case"T":n=t.data("field.uploads.template.wrong-type",s);break;default:n="<p>"+a.error+"</p>"}bootbox.alert(n)},_onUploadSubmit:function(e,t){this._progress("add",t.files)},_onUploadProgress:function(e,t){this._progress("set",t.files,t.loaded/t.total)},_onUploadAlways:function(e,t){this._progress("remove",t.files)},_onUploadDone:function(i,n){var a=this;e.each(n.result,function(e,n){n.error?bootbox.alert(t.data("field.uploads.template.error",{"%ERROR%":n.error})):a._trigger("uploaded",i,n)})},_progress:function(t,i,n){var a=this;null===a._ui.progress&&(a._ui.progress=e(":bolt-buicProgress",a.element)),e.each(i,function(){a._ui.progress.buicProgress(t,this.name,n)})},options:{maxSize:null}})}(jQuery,Bolt),function(e,t,i){"use strict";e.widget("bolt.fieldBlock",e.bolt.baseField,{options:{name:""},_create:function(){var t=this;this._ui={add:t.element.find(".block-add .add-button"),slot:t.element.find(".block-slot")},this._templates=t.element.find(\'script[type="text/template"]\'),t._ui.add.on("click",function(e){t._append(e)}),t.element.on("click",".delete-button",function(){e(this).closest(".block-group").remove(),t._renumber()}),t.element.on("click",".move-up",function(){var i=e(this).closest(".block-group");i.insertBefore(i.prev(".block-group")),t._renumber(),t._resetEditors(i)}),t.element.on("click",".move-down",function(){var i=e(this).closest(".block-group");i.insertAfter(i.next(".block-group")),t._renumber(),t._resetEditors(i)})},_append:function(i){var n,a=this,o=e(i.target).data("block-type");e.each(a._templates,function(t,i){e(i).data("block-type")===o&&(n=e(i).html())});var s=this._clone(n);s.data("block-type",o),this._ui.slot.append(s),this._renumber(),t.datetime.init(),t.ckeditor.init(),init.popOvers()},_clone:function(i){var n=e(i).clone();return n.find("[id]").each(function(){var i=e(this).attr("id"),a=t.app.buid();e(this).attr("id",a),n.find(\'[for="\'+i+\'"]\').each(function(){e(this).attr("for",a)})}),t.app.initWidgets(n),n},_renumber:function(){var t=new RegExp("^([^\\\\[]+\\\\[)([#|\\\\d]+)(\\\\].*)$","gi");this._ui.slot.find("div.block-group").each(function(i,n){e(n).find("[name]").each(function(){this.name=this.name.replace(t,"$1"+i+"$3")}),e(n).is(":first-of-type")?e(n).find(".move-up").addClass("disabled"):e(n).find(".move-up").removeClass("disabled"),e(n).is(":last-of-type")?e(n).find(".move-down").addClass("disabled"):e(n).find(".move-down").removeClass("disabled")})},_resetEditors:function(e){e.find(".ckeditor").each(function(e,t){i.instances[t.id]&&i.instances[t.id].destroy(),i.replace(t.id)})}})}(jQuery,Bolt,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";e.widget("bolt.fieldCategories",e.bolt.baseField,{_create:function(){this.element.find("select").select2({width:"100%",allowClear:!0,placeholder:{id:"",text:t.data("field.categories.text.placeholder")}})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldFile",e.bolt.baseField,{_create:function(){var t=this,i=this.element,n=e("input.path",i);n.data("selected",{path:n.val()}),n.autocomplete({source:i.find("[data-autocomplete-url]").data("autocompleteUrl"),minLength:2,focus:function(e,i){return t._onPreview(e,i.item),!1},select:function(e,i){return t._onSelect(e,i.item),!1},close:function(){t._onClose()}}).autocomplete("instance")._renderItem=function(t,i){return e("<li>").append(i.path).appendTo(t)},n.on("change",function(){e(this).data("changeWithoutSelection",!0)}),n.on("blur",function(){e(this).data("changeWithoutSelection")&&(""===e(this).val()?t._onClear():t._onClose())}),t._on({"click.select-from-stack a":t._onSelectFromStack,buicbrowserselected:t._onSelect,buicuploaduploaded:t._onSelect}),i.buicUpload()},_onPreview:function(t,i){e("input.path",this.element).val(i.path)},_onSelectFromStack:function(t){var i=e(t.target),n=i.parent("[data-file]");i.closest(".btn-group").removeClass("open"),this._onSelect(t,n.data("file")),t.preventDefault()},_onSelect:function(i,n){e("input.path",this.element).data("changeWithoutSelection",!1).data("selected",n).val(n.path).trigger("change"),"click"!==i.type&&t.stack.addToStack(n.path)},_onClose:function(){var t=e("input.path",this.element);t.val(t.data("selected").path)},_onClear:function(){var t=e("input.path",this.element);t.val(""),t.data("selected",{})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldFilelist",e.bolt.baseField,{_create:function(){var t=this,i=this.element;this._ui={data:i.find("textarea"),list:i.find(".list")},this._lastClickIndex=0,t.options.isImage=this.options.isImage||!1,t._ui.list.sortable({helper:function(t,i){return i.addClass("selected"),e("<div/>")},start:function(t,n){var a=e(".selected",i).not(".ui-sortable-placeholder"),o=a.length,s=n.placeholder,l=s.outerHeight(!0),r=s.height(),d=parseInt(s.css("margin-top"))+parseInt(s.css("margin-bottom"));a.hide(),s.height(r+(o-1)*l-d),n.item.data("items",a)},beforeStop:function(e,t){t.item.before(t.item.data("items"))},stop:function(){e(".selected",i).show(),t._serialize()},axis:"y",delay:100,distance:5}),t._on(t._ui.list,{"click.item":t._onSelect,"click.remove":t._onRemove,"change input":t._serialize}),e("input.title",t._ui.list).on("keyup",t._updateTitle),t._on({"click.select-from-stack a":t._onSelectFromStack,buicbrowserselected:t._onAddPath,buicuploaduploaded:t._onAddPath}),i.buicUpload()},_onAddPath:function(t,i){e(">p",this._ui.list).remove(),this._ui.list.append(e(Bolt.data(this.options.isImage?"field.imagelist.template.item":"field.filelist.template.item",{"%TITLE_A%":i.path.replace(/\\.[a-z0-9]+$/,""),"%FILEPATH_E%":e("<div>").text(i.path).html(),"%FILEPATH_A%":i.path,"%EXT_E%":i.extension.toUpperCase(),"%PREVIEW_A%":i.previewListUrl,"%URL_A%":i.url}))),this._serialize()},_onRemove:function(i){var n=e(i.target).closest(".item"),a=n.hasClass("selected")?e(".selected",this._ui.list):n,o=this.options.isImage?"field.imagelist.message.remove":"field.filelist.message.remove",s=this.options.isImage?"field.imagelist.message.removeMulti":"field.filelist.message.removeMulti";a.addClass("zombie"),confirm(t.data(a.length>1?s:o))?(e(i.target).closest(".item").remove(),this._serialize()):a.removeClass("zombie"),i.preventDefault(),i.stopPropagation()},_onSelect:function(t){var i=e(t.target);if(i.hasClass("item"))if(t.shiftKey){var n=Math.min(this._lastClickIndex,i.index()),a=Math.max(this._lastClickIndex,i.index());this._ui.list.children().each(function(t,i){e(i).toggleClass("selected",t>=n&&t<=a)})}else if(t.ctrlKey||t.metaKey)i.toggleClass("selected"),this._lastClickIndex=i.index();else{var o=this._ui.list.children(".selected").not(i);o.removeClass("selected"),i.toggleClass("selected",o.length>0||null),this._lastClickIndex=i.index()}},_onSelectFromStack:function(t){var i=e(t.target),n=i.closest("[data-file]");i.closest(".btn-group").removeClass("open"),this._onAddPath(t,n.data("file")),t.preventDefault()},_serialize:function(){var i=this.options.isImage?"field.imagelist.template.empty":"field.filelist.template.empty",n=[];e(".item",this._ui.list).each(function(){n.push({filename:e("input.filename",this).val(),title:e("input.title",this).val()})}),this._ui.data.val(JSON.stringify(n)),0===n.length&&this._ui.list.html(t.data(i))},_updateTitle:function(t){var i=e(t.target).closest(".item");e("a",i).attr("title",e(".title",i).val())}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldGeolocation",e.bolt.baseField,{options:{latitude:"",longitude:""},_create:function(){var e=this,i=e.element;this._ui={address:i.find(".address"),matched:i.find(".matched"),mapholder:i.find(".mapholder"),spinner:i.find(".mapholder i"),latitude:i.find(".latitude"),longitude:i.find(".longitude"),snap:i.find(".snap")},this._map=null,this._marker=null,this._timeout=0,e._on({"click.expand":e._onExpand,"click.compress":e._onExpand});var n=function(){t.events.off("Bolt.GoogleMapsAPI.Load.Done",n),e._initGoogleMap(e.options.latitude,e.options.longitude)};t.events.on("Bolt.GoogleMapsAPI.Load.Done",n),t.events.on("Bolt.GoogleMapsAPI.Load.Fail",function(){e._ui.spinner.removeClass("fa-spinner fa-spin").addClass("fa-refresh").one("click",function(){e._ui.spinner.removeClass("fa-refresh").addClass("fa-spinner fa-spin"),t.events.fire("Bolt.GoogleMapsAPI.Load.Request")})}),t.events.fire("Bolt.GoogleMapsAPI.Load.Request")},_geoCode:function(e){var t=this;e&&(new google.maps.Geocoder).geocode(e,function(i,n){if(n===google.maps.GeocoderStatus.OK){var a;a=e.latLng&&!t._ui.snap.is(":checked")?e.latLng:i[0].geometry.location,t._display(i[0].formatted_address,a.lat(),a.lng()),t._marker.setPosition(a),t._map.setCenter(a)}}),t._display()},_display:function(e,t,i){this._ui.matched.val(e||""),this._ui.latitude.val(t||""),this._ui.longitude.val(i||"")},_initGoogleMap:function(i,n){var a=this,o={zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,center:new google.maps.LatLng(i,n),streetViewControl:!1};a._map=new google.maps.Map(a._ui.mapholder[0],o),a._marker=new google.maps.Marker({map:a._map,position:o.center,title:t.data("field.geolocation.marker"),draggable:!0,animation:google.maps.Animation.DROP,icon:a.element.data("pin-icon")}),google.maps.event.addListener(a._marker,"mouseup",function(){a._geoCode({latLng:a._marker.getPosition()})}),a._ui.address.on("propertychange input",function(){clearTimeout(a._timeout),a._timeout=setTimeout(function(){var e=a._ui.address.val();a._geoCode(e.length>2?{address:e}:void 0)},800)}),e(\'a[data-toggle="tab"]\').on("shown.bs.tab",function(){a._ui.mapholder.closest("div.tab-pane").hasClass("active")&&google.maps.event.trigger(a._map,"resize")})},_onExpand:function(){var e=this._marker.getPosition();this._ui.mapholder.parent().toggleClass("expanded"),google.maps.event.trigger(this._map,"resize"),this._map.setCenter(e)}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldHtml",e.bolt.baseField,{_create:function(){t.ckeditor.add(this.element.find(".ckeditor")[0])}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.fieldImage",e.bolt.fieldFile,{_create:function(){this._super(),e("input.path",this.element).data("selected").previewUrl=this.element.find("img").attr("src")},_onPreview:function(e,t){this._super(e,t),this.element.find("img").attr("src",t.previewUrl)},_onSelect:function(e,t){this._super(e,t),this.element.find("img").attr("src",t.previewUrl)},_onClose:function(){this._super();var t=e("input.path",this.element);this.element.find("img").attr("src",t.data("selected").previewUrl)},_onClear:function(){this._super();var e=this.element.find("img");e.attr("src",e.data("defaultUrl"))}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldImagelist",e.bolt.fieldFilelist,{_create:function(){this.options.isImage=!0,this._super()}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldMarkdown",e.bolt.baseField,{_create:function(){t.$("textarea[data-uk-htmleditor]",this.element).each(function(){var e=t.$(this);e.data("htmleditor")||t.htmleditor(e,t.Utils.options(e.attr("data-uk-htmleditor")))})}})}(jQuery,"undefined"!=typeof UIkit?UIkit:void 0),function(e){"use strict";e.widget("bolt.fieldMeta",e.bolt.baseField,{_create:function(){var e=this.element.find("#statusselect"),t=this.element.find("#ownerid");e.select2({width:"50%",minimumResultsForSearch:1/0}),t.select2({width:"50%",minimumResultsForSearch:1/0})}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldRelationship",e.bolt.baseField,{_create:function(){this.element.find("select").select2({width:"100%",placeholder:{id:"",text:t.data("field.relationship.text.placeholder")},allowClear:!0,templateSelection:function(t){var i=e(t.element).parent().attr("label");return(i?i+": ":"")+t.text}})}})}(jQuery,Bolt),function(e,t,i){"use strict";e.widget("bolt.fieldRepeater",e.bolt.baseField,{options:{minimum:1,maximum:1,name:""},_create:function(){var t=this;for(this._ui={add:t.element.find(".add-button"),slot:t.element.find(".repeater-slot")},this._template=e(t.element.find(\'script[type="text/template"]\').html()),this._count=t._ui.slot.find("div.repeater-group").length,0===t.options.maximum&&(t.options.maximum=1/0),t._setCount(),t._ui.add.on("click",function(){t._append()}),t.element.on("click",".duplicate-button",function(){var i=e(this).closest(".repeater-group"),n=t._clone(t._template);e(i).find(":input").each(function(t){var i=e(this).val();i&&e(n).find(":input").eq(t).val(i)}),i.after(n),t._setCount(1),t._renumber()}),t.element.on("click",".delete-button",function(){e(this).closest(".repeater-group").remove(),t._setCount(-1),t._renumber()}),t.element.on("click",".move-up",function(){var i=e(this).closest(".repeater-group");i.insertBefore(i.prev(".repeater-group")),t._renumber(),t._resetEditors(i)}),t.element.on("click",".move-down",function(){var i=e(this).closest(".repeater-group");i.insertAfter(i.next(".repeater-group")),t._renumber(),t._resetEditors(i)});t._count<t.options.minimum;)t._append()},_append:function(){var e=this._clone(this._template);this._ui.slot.append(e),this._setCount(1),this._renumber(),t.datetime.init(),t.ckeditor.init(),init.popOvers()},_clone:function(i){var n=e(i).clone();return n.find("[id]").each(function(){var i=e(this).attr("id"),a=t.app.buid();e(this).attr("id",a),n.find(\'[for="\'+i+\'"]\').each(function(){e(this).attr("for",a)})}),t.app.initWidgets(n),n},_renumber:function(){var t=this.options.name,i=t.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&"),n=new RegExp("^"+i+"\\\\[(#|\\\\d+)\\\\]");this._ui.slot.find("div.repeater-group").each(function(i,a){e(a).find("[name]").each(function(){this.name=this.name.replace(n,t+"["+i+"]")}),e(a).is(":first-of-type")?e(a).find(".move-up").addClass("disabled"):e(a).find(".move-up").removeClass("disabled"),e(a).is(":last-of-type")?e(a).find(".move-down").addClass("disabled"):e(a).find(".move-down").removeClass("disabled")})},_resetEditors:function(e){e.find(".ckeditor").each(function(e,t){i.instances[t.id]&&i.instances[t.id].destroy(),i.replace(t.id)})},_setCount:function(e){this._count+=e||0,this._count>=this.options.maximum?(this._ui.add.addClass("disabled"),this._ui.add.prop("disabled","disabled"),this.element.find(".duplicate-button").addClass("disabled"),this.element.find(".duplicate-button").prop("disabled","disabled")):(this._ui.add.removeClass("disabled"),this._ui.add.prop("disabled",!1),this.element.find(".duplicate-button").removeClass("disabled"),this.element.find(".duplicate-button").prop("disabled",!1)),this._count<=this.options.minimum?(this.element.find(".delete-button").addClass("disabled"),this.element.find(".delete-button").prop("disabled","disabled")):(this.element.find(".delete-button").removeClass("disabled"),this.element.find(".delete-button").prop("disabled",!1))}})}(jQuery,Bolt,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";e.widget("bolt.fieldSelect",e.bolt.baseField,{options:{autocomplete:!1},_create:function(){var e=this.element.find("select"),i={width:"100%",placeholder:{id:"",text:t.data("field.select.text.placeholder")},allowClear:!0,minimumResultsForSearch:this.options.autocomplete?0:1/0};this.options.sortable?e.select2Sortable(i):e.select2(i)}})}(jQuery,Bolt),function(e){"use strict";var t={lock:1,link:2,edit:3};e.widget("bolt.fieldSlug",e.bolt.baseField,{options:{contentId:null,key:"",slug:"",uses:[]},_create:function(){var i=this,n=this.element;this._ui={form:this.element.closest("form"),group:n.find(".input-group"),data:n.find("input"),uses:e()},e("[name]",i._ui.form).each(function(){i.options.uses.indexOf(this.name.replace(/\\[\\]$/,""))>=0&&(i._ui.uses=i._ui.uses.add(e(this)))}),this._timeout=0,this._mode=t.lock,this._ui.group.hasClass("linked")?this._setMode(t.link):this._ui.group.hasClass("editable")&&(this._mode=t.edit),this._on({"click li.lock":function(e){e.preventDefault(),this._setMode(t.lock)},"click li.link":function(e){e.preventDefault(),this._setMode(t.link)},"click li.edit":function(e){e.preventDefault(),this._setMode(t.edit),this.element.find("input").focus()},"focusout input":function(){this._mode===t.edit&&this._setMode(t.lock)}})},_destroy:function(){clearTimeout(this._timeout)},_setMode:function(i){var n=i===t.lock,a=i===t.link,o=i===t.edit;e("li.lock",this.element).toggleClass("disabled",n),e("li.link",this.element).toggleClass("disabled",a),e("li.edit",this.element).toggleClass("disabled",o),this._ui.group.toggleClass("locked",n).toggleClass("linked",a).toggleClass("edititable",o),e(".warning",this.element).toggleClass("hidden",!o),this._ui.data.prop("readonly",!o),a?(this._buildSlug(),this._on(this._ui.uses,{change:function(){this._buildSlug()},input:function(){this._buildSlug()}})):this._timeout>0&&(clearTimeout(this._timeout),this._timeout=0,this._off(this._ui.uses,"change"),this._off(this._ui.uses,"input")),this._mode=i},_buildSlug:function(){var t,i=this,n="";e.each(i.options.uses,function(i,a){(t=e("#"+a).val())&&(n+=("object"==typeof t?t.join(" "):t)+" ")}),clearTimeout(i._timeout),i._timeout=setTimeout(function(){i._getUri(n.trim())},200)},_getUri:function(i){var n=this,a={title:i,contenttypeslug:n.options.slug,id:n.options.contentId,slugfield:n.options.key,fulluri:!1};n._ui.group.addClass("loading"),e.get(n._ui.data.data("createSlugUrl"),a).done(function(e){n._mode===t.link&&n._ui.data.val(e)}).fail(function(){console.error("Failed to get URI for "+n.options.slug+"/"+n.options.contentId)}).always(function(){n._ui.group.removeClass("loading")})}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldTags",e.bolt.baseField,{options:{allowSpaces:!1},_create:function(){var t=this.element.find("select"),i=this.element.find(".tagcloud"),n=[","],a={};this.options.allowSpaces||n.push(" "),t.select2({width:"100%",tags:a,minimumInputLength:1,tokenSeparators:n}),e.ajax({url:this.element.data("tagsUrl"),dataType:"json",success:function(i){for(var n=t.val()||[],a=i.length,o="",s=0;s<a;s++)n.indexOf(i[s].name)<0&&(n.push(i[s].name),o+=\'<option value="\'+i[s].name+\'">\'+i[s].name+"</option>");t.append(e(o)).trigger("change")}}),i&&e.ajax({url:this.element.data("popularTagsUrl"),dataType:"json",data:{limit:40},success:function(n){n.length>0&&(e.each(n,function(t,n){i.append(e("<button/>",{type:"button",text:n.name,rel:n.count})).append("")}),i.find("button").on("click",function(){var i=e(this).text(),n=t.find(\'option[value="\'+i+\'"]\');n.length>0?n=n.not(":selected").attr("selected",!0).trigger("change"):t.append(e("<option/>",{value:i,text:i,selected:!0})).trigger("change")}),e.fn.tagcloud.defaults={size:{start:10,end:20,unit:"px"},color:{start:"#888",end:"#194770"}},i.find("button").tagcloud(),i.css("display","block"))}})}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldTemplateselect",e.bolt.baseField,{options:{currentHas:!1,current:"",fieldTemplates:[]},_create:function(){var i=this,n=i.element.find("select"),a=i.element.find("p"),o=a.parent();n.select2({width:"100%",allowClear:!0,placeholder:{id:"",text:t.data("field.templateselect.text.default")},minimumResultsForSearch:1/0}),n.on("change",function(){if(o.addClass("hidden"),a.html("").removeClass("text-danger"),n.val()!==i.options.current)if(i.options.currentHas){a.html(t.data("field.templateselect.template.warning",{"%STATUS%":t.data("field.templateselect.message.status"),"%MESSAGE%":t.data("field.templateselect.message.warning")}));var s=!0;e(\'[name^="templatefields"]\').each(function(){"checkbox"!==e(this).attr("type")&&"SELECT"!==e(this).prop("tagName")&&""!==e(this).val()&&(s=!1),"checkbox"===e(this).attr("type")&&e(this).prop("checked")&&(s=!1)}),s?e("#tabindicator-tab-template").hide():(a.addClass("text-danger"),o.removeClass("hidden"))}else i.options.fieldTemplates.indexOf(n.val())>-1&&(a.html(t.data("field.templateselect.message.change")),o.removeClass("hidden"),e("#tabindicator-tab-template").show())})}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.fieldText",e.bolt.baseField,{_create:function(){}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldTextarea",e.bolt.baseField,{_create:function(){}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldVideo",e.bolt.baseField,{_create:function(){var t=this,i=this.element,n=0;this._ui={url:i.find("input.url"),width:i.find("input.width"),height:i.find("input.height"),html:i.find("input.html"),ratio:i.find("input.ratio"),authorName:i.find("input.authorname"),authorUrl:i.find("input.authorurl"),title:i.find("input.title"),thumbnailUrl:i.find("input.thumbnailurl"),preview:i.find("img"),play:i.find(".imageholder button"),refresh:i.find("button.refresh"),spinner:i.find("button.refresh i")},t._ui.url.on("propertychange input",function(){clearTimeout(n),n=setTimeout(function(){t._update()},1e3)}),t._ui.width.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.height.val(Math.round(t._ui.width.val()/t._ui.ratio.val()))}),t._ui.height.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.width.val(Math.round(t._ui.height.val()*t._ui.ratio.val()))}),t._ui.refresh.on("click",function(){t._update()}),t._ui.play.on("click",function(){e("body").buicModal({size:"large",closer:!0,headline:t._ui.title.val(),body:t._ui.html.val()})})},_update:function(){var i=this,n=t.data("endpoint.embed"),a=e("#id").closest("form").find(\'input[name="content_edit[_token]"]\').val(),o={format:"json",url:i._ui.url.val(),_token:a,provider:"oembed"};o.url.length<2?i._set({}):(this._ui.refresh.prop("disabled",!0),i._ui.spinner.addClass("fa-spin"),e.post(n,o).done(function(e){i._set(e)}).fail(function(){i._set({})}).always(function(){i._ui.spinner.removeClass("fa-spin")}))},_set:function(e){var t=e.thumbnail_url||this._ui.preview.data("defaultUrl");this._ui.html.val(e.html||""),this._ui.width.val(e.width||""),this._ui.height.val(e.height||""),this._ui.ratio.val(e.width&&e.height?e.width/e.height:""),this._ui.authorName.val(e.author_name||""),this._ui.authorUrl.val(e.author_url||""),this._ui.title.val(e.title||""),this._ui.thumbnailUrl.val(e.thumbnail_url||""),this._ui.preview.attr("src",t),e.html?this._ui.play.removeClass("hidden"):this._ui.play.addClass("hidden"),this._ui.refresh.prop("disabled",this._ui.url.val().length<=2||this._ui.html.val().length>0)}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.panelActivity",e.bolt.baseInterval,{options:{delay:3e4},_create:function(){this._super()},_update:function(){var i=this;e.get(i.element.data("url")).done(function(n){var a=e(n);t.app.initWidgets(a),i.element.html(a)})}})}(jQuery,Bolt),Bolt.validation=function(){"use strict";function e(e){var t=!0,i=e.value,n=e.getAttribute("type"),a="checkbox"===n||"radio"===n,o=e.getAttribute("required"),s=e.getAttribute("minlength"),l=e.getAttribute("maxlength"),r=e.getAttribute("pattern");return e.disabled?t:(t=t&&(!o||a&&e.checked||!a&&""!==i),(t=t&&(a||(!s||i.length>=s)&&(!l||i.length<=l)))&&r&&(t=(r=new RegExp("^(?:"+r+")$")).test(i)),t)}function t(e,t){$(e).addClass("error"),t&&$("#cke_"+e.id).addClass("cke_error")}function i(e,t){$(e).removeClass("error"),t&&$("#cke_"+e.id).removeClass("cke_error")}function n(e,t,i){var n,a=$(\'label[for="\'+t.id+\'"]\').contents().first().text().trim()||t.name;a=a.replace(/(.*):+$/g,"$1"),n=Bolt.data("validation.alertbox",{"%NOTICE_ID%":e,"%FIELD_ID%":t.id,"%FIELD_NAME%":a,"%MESSAGE%":i||$(t).data("errortext")||Bolt.data("validation.generic_msg")}),$(n).hide().insertAfter(".page-header").slideDown("fast")}function a(e){return""===e||e.match(/^[-+]?[0-9]*[,.]?[0-9]+([eE][-+]?[0-9]+)?$/)?"":Bolt.data("validation.float")}function o(e,t){return!0===t&&""===e?Bolt.data("validation.required"):""}function s(e,t){return""!==e&&Number(e.replace(",","."))<t?Bolt.data("validation.min",{"%MINVAL%":t}):""}function l(e,t){return""!==e&&Number(e.replace(",","."))>t?Bolt.data("validation.max",{"%MAXVAL%":t}):""}function r(e,t){void 0!==e.willValidate?e.setCustomValidity(t):e.validity.valid=""===t}function d(d){var c,u,f,p=void 0!==d.willValidate,h=d.value,m="",g=$(d).data("validate");if(g){for(u in g)if(g.hasOwnProperty(u)){switch(f=g[u],u){case"float":m=a(h);break;case"required":m=o(h,f);break;case"min":m=s(h,f);break;case"max":m=l(h,f);break;default:console.error("UNKNOWN VALIDATION"+u+" -> "+f)}if(m)break}r(d,m)}else if(p?("INPUT"===d.nodeName&&d.type!==d.getAttribute("type")&&d.setCustomValidity(e(d)?"":"error"),d.checkValidity()):(d.validity=d.validity||{},d.validity.valid=e(d)),c="TEXTAREA"===d.nodeName&&$(d).hasClass("ckeditor")){var v=CKEDITOR.instances[d.id];v&&r(d,!0===v._.required&&""===v.getData().trim()?"Required":"")}var b="notice--"+d.id;return $("#"+b).remove(),d.validity.valid?(i(d,c),!0):(t(d,c),n(b,d,m),!1)}return{run:function(e){var t,i,n=e.elements.length,a=!0;for(t=0;t<n;t++)"INPUT"!==(i=e.elements[t]).nodeName&&"TEXTAREA"!==i.nodeName&&"SELECT"!==i.nodeName||("INPUT"===i.nodeName&&(i.value=i.value.trim()),!1===d(i)&&(a=!1));return a}}}();\n\\ No newline at end of file\n+String.prototype.subst=function(e){"use strict";return this.replace(/%[A-Z][A-Z0-9_]+%/g,function(t){return t in e?e[t]:t})};var init={depublishTracking:function(){"use strict";var e=$("#datedepublish").data("notice");$("#datedepublish, #statusselect").on("change",function(){var t=$("#statusselect").val(),i=$("#datedepublish").val();$(".dateDepublishNotice").remove(),""!==i&&"published"===t&&moment(i+Bolt.conf("timezone.offset"))<moment()&&$(\'<div class="dateDepublishNotice alert alert-warning alert-dismissible"><button type="button" class="close" data-dismiss="alert">×</button>\'+e+"</div>").hide().insertAfter(".depublish-group").slideDown("fast")}),$("#datedepublish").trigger("change")},bindEditFile:function(e){"use strict";var t;if("undefined"!=typeof CodeMirror){t=CodeMirror.fromTextArea(document.getElementById("file_edit_contents"),{lineNumbers:!0,autofocus:!0,foldGutter:{rangeFinder:CodeMirror.fold.indent},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Ctrl-Q":function(e){e.foldCode(e.getCursor(),{rangeFinder:CodeMirror.fold.indent,minFoldSize:3})},Tab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(e.getOption("indentWithTabs")?"\\t":Array(e.getOption("indentUnit")+1).join(" "),"end","+input")},"Ctrl-S":function(){$("#file_edit_save").click()},"Ctrl-H":"replaceAll"},tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:e.readonly});var i=$(window).height()-312;i<200&&(i=200),t.setSize(null,i)}$("#file_edit_save").on("click",function(e){Bolt.events.fire("Bolt.File.Save.Start"),e.preventDefault(),t&&t.save();$("#file_edit_save").addClass("disabled"),$("#file_edit_save i").addClass("fa-spin fa-spinner"),$("p.lastsaved").text(Bolt.data("editcontent.msg.saving"));var i=$(e.target),n=$(\'form[name="file_edit"]\').serialize()+"&"+encodeURI(i.attr("name"))+"="+encodeURI(i.attr("value"));$.post("?returnto=ajax",n).done(function(e){e.ok?Bolt.events.fire("Bolt.File.Save.Done",e):(alert(e.msg),Bolt.events.fire("Bolt.File.Save.Fail",e)),$("p.lastsaved").html(e.msg)}).fail(function(){Bolt.events.fire("Bolt.File.Save.Fail"),alert("Not saved")}).always(function(){Bolt.events.fire("Bolt.File.Save.Always"),window.setTimeout(function(){$("#file_edit_save").removeClass("disabled").blur(),$("#file_edit_save i").removeClass("fa-spin fa-spinner")},300)})})},bindEditLocale:function(e){"use strict";CodeMirror.fromTextArea(document.getElementById("file_edit_contents"),{lineNumbers:!0,autofocus:!0,tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:e.readonly}).setSize(null,$(window).height()-276)},bindFileBrowser:function(){"use strict";$("#myTab a").click(function(e){e.preventDefault(),$(this).tab("show")});var e=function(e){var t=new RegExp("(?:[?&]|&)"+e+"=([^&]+)","i"),i=window.location.search.match(t);return i&&i.length>1?i[1]:null}("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(t){t.preventDefault();var i=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(e,i),window.close()}),$("a.filebrowserCloseLink").bind("click",function(){window.close()})},bindCkFileSelect:function(){"use strict";var e=function(e){var t=new RegExp("(?:[?&]|&)"+e+"=([^&]+)","i"),i=window.location.search.match(t);return i&&i.length>1?i[1]:null}("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(t){t.preventDefault();var i=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(e,i),window.close()})},bindPrefill:function(){"use strict";var e=$("#form_contenttypes").find(":checkbox");$("#prefill_check_all").on("click",function(){e.removeAttr("checked").trigger("click")}),$("#prefill_uncheck_all").on("click",function(){e.removeAttr("checked")})},confirmationDialogs:function(){"use strict";$(".confirm").on("click",function(){return confirm($(this).data("confirm"))})},dropDowns:function(){"use strict";$(\'[data-toggle="dropdown"]\').each(function(e,t){var i;"undefined"==typeof event?$(t).parent().click(function(e){i=e}):i=event,$(t).parent().on("show.bs.dropdown",function(){if(void 0!==i&&null!==i){var e=$(this).find(\'[data-toggle="dropdown"]\').next(".dropdown-menu"),t=i.pageY+20,n=e.height(),a=$(window).height()-t+n;t-n>20&&a<37&&e.css({top:"auto",bottom:"100%"})}})})},dropZone:function(){"use strict";$(document).bind("dragover",function(e){var t=$(".elm-dropzone"),i=window.dropZoneTimeout;i?clearTimeout(i):t.addClass("in"),e.target===t[0]?t.addClass("hover"):t.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,t.removeClass("in hover")},100)})},magnificPopup:function(){"use strict";$(".magnific, .fancybox").magnificPopup({type:"image",gallery:{enabled:!0},disableOn:400,closeBtnInside:!0,enableEscapeKey:!0,mainClass:"mfp-with-zoom",zoom:{enabled:!0,duration:300,easing:"ease-in-out",opener:function(e){return e.parent().parent().find("img")}}})},focusStatusSelect:function(){"use strict";$("#lastsavedstatus").click(function(e){e.preventDefault(),$(\'a[href="#tab-meta"]\').click(),$("#statusselect").focus()})},passwordInput:function(){"use strict";$(".togglepass").on("click",function(){$(this).hasClass("show-password")?($(\'input[name="password"]\').attr("type","text"),$(".togglepass.show-password").hide(),$(".togglepass.hide-password").show()):($(\'input[name="password"]\').attr("type","password"),$(".togglepass.show-password").show(),$(".togglepass.hide-password").hide())}),$(".login-forgot").bind("click",function(){$(".login-group, .password-group").hide(),$(".reset-group").show()}),$(".login-remembered").bind("click",function(){$(".login-group, .password-group").show(),$(".reset-group").hide()})},popOvers:function(){"use strict";$(".info-pop").popover({trigger:"hover",delay:{show:500,hide:200}})},sortables:function(){"use strict";$("tbody.sortable").sortable({items:"tr",opacity:"0.5",axis:"y",handle:".sorthandle",update:function(){var e=$(this).sortable("serialize");$.ajax({url:$("#baseurl").attr("value")+"content/sortcontent/"+$(this).parent("table").data("contenttype"),type:"POST",data:e,success:function(){}})}})}},Bolt={};!function(bolt,$){"use strict";var actions={};actions.init=function(){$("button, input[type=button], a").off("click.action"),$("[data-action]").on("click.action",function(e){var action=$(this).attr("data-action");void 0!==action&&""!==action&&(e.preventDefault(),eval(action),e.stopPropagation())}).on("click.popover",".popover",function(e){e.stopPropagation()}),$(".clickspinner").on("click.spinner",function(){$(this).addClass("disabled").blur(),$(this).find("i").addClass("fa-spin fa-spinner"),window.setTimeout(function(e){$(e).removeClass("disabled"),$(e).find("i").removeClass("fa-spin fa-spinner")},1e4,this)}),$(".submitspinner").on("submit.spinner",function(){$(this).find("button[type=submit]").addClass("disabled").blur(),$(this).find("button[type=submit] i").addClass("fa-spin fa-spinner"),window.setTimeout(function(e){$(e).removeClass("disabled"),$(e).find("i").removeClass("fa-spin fa-spinner")},1e4,$(this).find("button[type=submit]"))})},actions.submit=function(e,t){$(\'<input type="hidden" />\').attr("name",t.name).val(1).appendTo(e),e.submit()},bolt.actions=actions}(Bolt||{},jQuery),function(e,t,i,n){"use strict";function a(){n.confirmationDialogs(),n.magnificPopup(),n.dropZone(),n.popOvers(),n.dropDowns(),n.passwordInput(),n.sortables(),n.focusStatusSelect(),n.depublishTracking(),t("[data-bind]").each(function(){var i=t(this).data("bind");switch(i.bind){case"editcontent":e.editcontent.init(i);break;case"editfile":n.bindEditFile(i);break;case"editlocale":n.bindEditLocale(i);break;case"filebrowser":n.bindFileBrowser();break;case"ckfileselect":n.bindCkFileSelect();break;case"prefill":n.bindPrefill()}})}function o(){e.events.on("Bolt.GoogleMapsAPI.Load.Request",function(){if(void 0===l){l=!1;var i="https://maps.google.com/maps/api/js?sensor=false&callback=Bolt.app.gMapsApiReady";Bolt.conf.get("google_api_key")&&(i=i+"&key="+Bolt.conf.get("google_api_key")),t.getScript(i).fail(function(){l=void 0,e.events.fire("Bolt.GoogleMapsAPI.Load.Fail")})}else!0===l&&e.events.fire("Bolt.GoogleMapsAPI.Load.Done")})}function s(){var n=e.conf("locale.long");t.fn.select2.defaults.set("language",n.replace("_","-")),i.locale(n),t.datepicker.setDefaults(t.datepicker.regional[n])}var l,r={},d=1e4;r.gMapsApiReady=function(){l=!0,e.events.fire("Bolt.GoogleMapsAPI.Load.Done")},r.run=function(){e.conf.init(),e.data.init(),d=e.conf("buid").match(/(\\d+)$/)[1],s(),o(),e.actions.init(),e.secmenu.init(),e.stack.init(),e.omnisearch.init(),e.extend.init(),e.filemanager.init(),e.ckeditor.init(),e.datetime.init(),a(),e.app.initWidgets()},r.buid=function(){return"buid-"+d++},r.initWidgets=function(e){void 0===e&&(e=t(document.documentElement)),t("[data-bolt-widget]",e).each(function(){var e=t(this),i=e.data("bolt-widget"),n={};"string"==typeof i?n[i]={}:n=i,t.each(n,function(t,i){e[t](i).removeAttr("data-bolt-widget").removeData("bolt-widget")})})},t(document).ready(r.run),e.app=r}(Bolt||{},jQuery,moment,init),function(e,t,i){"use strict";function n(){var e=[];for(var t in arguments)if(1===arguments[t].length||arguments[t][0]){var i=arguments[t][arguments[t].length-1];"string"==typeof i&&"|"===i.substr(0,1)&&(i=i.substr(1),e=e.concat("-")),e=e.concat(i)}return e}var a={};a.init=function(){i&&(i=a.initcke(i))},a.update=function(){if(i)for(var e in i.instances)i.instances.hasOwnProperty(e)&&i.instances[e].updateElement()},a.add=function(e){i&&i.replace(e)},a.initcke=function(i){return i.editorConfig=function(i){var a,o=t(this.element.$).data("param")||{},s=e.conf("ckeditor");i.language=e.conf("ckeditor.lang"),i.skin="boltcke",i.resize_enabled=!0,i.entities=!1,i.fillEmptyBlocks=!1,i.extraPlugins+=(i.extraPlugins?",":"")+"codemirror",i.baseFloatZIndex=100015,i.toolbar=n([{name:"styles",items:n(["Format"],[s.styles,"Styles"])}],[{name:"basicstyles",items:n(["Bold"],["Italic"],[s.underline,"Underline"],[s.strike,"Strike"])}],[{name:"paragraph",items:n(["NumberedList"],["BulletedList"],["Indent"],["Outdent"],[s.blockquote,"|Blockquote"])}],[{name:"links",items:n(["Link"],["Unlink"],[s.anchor,"|Anchor"])}],[s.subsuper,{name:"subsuper",items:n(["Subscript"],["Superscript"])}],[s.images,{name:"image",items:n(["Image"])}],[s.embed,{name:"embed",items:n(["oembed"])}],[s.tables,{name:"table",items:n(["Table"])}],[s.ruler,{name:"ruler",items:n(["HorizontalRule"])}],[s.align,{name:"align",items:n(["JustifyLeft"],["JustifyCenter"],["JustifyRight"],["JustifyBlock"])}],[s.fontcolor,{name:"colors",items:n(["TextColor"],["BGColor"])}],[s.codesnippet,{name:"code",items:n(["|CodeSnippet"])}],[{name:"tools",items:n(["RemoveFormat"],["Maximize"],["|Source"],[s.specialchar,"|SpecialChar"])}]),s.embed&&(i.extraPlugins+=",oembed,widget",i.oembed_maxWidth="853",i.oembed_maxHeight="480"),i.height=250,i.autoGrow_onStartup=!0,i.autoGrow_minHeight=150,i.autoGrow_maxHeight=400,i.autoGrow_bottomSpace=24,i.removePlugins="elementspath",i.resize_dir="vertical",s.filebrowser?(s.filebrowser.browseUrl&&(i.filebrowserBrowseUrl=s.filebrowser.browseUrl),s.filebrowser.imageBrowseUrl&&(i.filebrowserImageBrowseUrl=s.filebrowser.imageBrowseUrl),s.filebrowser.uploadUrl&&(i.filebrowserUploadUrl=s.filebrowser.uploadUrl),s.filebrowser.imageUploadUrl&&(i.filebrowserImageUploadUrl=s.filebrowser.imageUploadUrl)):(i.filebrowserBrowseUrl="",i.filebrowserImageBrowseUrl="",i.filebrowserUploadUrl="",i.filebrowserImageUploadUrl=""),i.codemirror={theme:"default",lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseTags:!0,autoCloseBrackets:!0,enableSearchTools:!0,enableCodeFolding:!0,enableCodeFormatting:!0,autoFormatOnStart:!1,autoFormatOnUncomment:!1,autoFormatOnModeChange:!1,highlightActiveLine:!0,highlightMatches:!0,showFormatButton:!1,showCommentButton:!1,showUncommentButton:!1};for(a in s.ck)s.ck.hasOwnProperty(a)&&(i[a]=s.ck[a]);o.height&&(i.height=parseInt(o.height),i.autoGrow_minHeight=Math.max(i.autoGrow_minHeight,i.height),i.autoGrow_maxHeight=Math.max(i.autoGrow_maxHeight,i.height));for(a in o.ckeditor)o.ckeditor.hasOwnProperty(a)&&(i[a]=o.ckeditor[a])},e.conf("ckeditor").ck.allowNbsp&&i.on("instanceReady",function(e){e.editor.on("paste",function(e){e.data.dataValue=e.data.dataValue.replace(/&nbsp;/g," "),e.data.dataValue=e.data.dataValue.replace(/<p> <\\/p>/g,"")},null,null,9)}),i},e.ckeditor=a}(Bolt||{},jQuery,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t,i){"use strict";var n={},a=function(e){var t,i=e.split("."),a=n;for(t=0;t<i.length;t++){if(void 0===a[i[t]])return;a=a[i[t]]}return a};a.get=a,a.init=function(){n=t("script[data-config]").first().data("config")},e.conf=a}(Bolt||{},jQuery),function(e,t,i){"use strict";var n={},a=function(e,t){var i,a=e.split("."),o=n;for(i=0;i<a.length;i++){if(void 0===o[a[i]])return;o=o[a[i]]}return t&&"string"==typeof o?o.subst(t):o};a.get=a,a.init=function(){n=t("script[data-jsdata]").first().data("jsdata")||{}},e.data=a}(Bolt||{},jQuery),function(e,t,i){"use strict";function n(e){var t=e.closest(".datetime-container"),i={};return i.data=e,i.date=t.find("input.datepicker"),i.time=t.find("input.timepicker"),i.show=t.find("button.btn-tertiary"),i.clear=t.find("button.btn-default"),i.time.exists=i.time.length>0,i}function a(e){var i,n,a,o,s="",r="";"datedepublish"===e.data.attr("id")&&"1900-01-01 00:00:00"===e.data.val()&&e.data.val(""),(n=e.data.val().match(/^(\\d{4}-\\d{2}-\\d{2})(?: (\\d{2}:\\d{2}:\\d{2}))?$/))&&(s=n[1],r=n[2]||""),a=""===s||"0000-00-00"===s?"":t.datepicker.parseDate("yy-mm-dd",s),e.date.datepicker("setDate",a),e.time.exists&&"0000-00-00"!==s&&(""===r?r=""!==s?"00:00":"":l?r=e.data.val().slice(11,16):(o=(i=parseInt(r.slice(0,2)))<12?" AM":" PM",r=(i%12||12)+r.slice(2,5)+o),e.time.val(r)),e.data.trigger("change")}function o(e){var t,n,a,o=i(e.date.datepicker("getDate")),s=i([2001,11,24]),l=!1;if(e.time.exists){var r=new RegExp("^(?:(?:([01]?[0-9]|2[0-3]))[:,.]([0-5]?[0-9])|(1[012]|0?[1-9])[:,.]([0-5]?[0-9])(?:\\\\s*([AP])[. ]?M\\\\.?))$");(a=e.time.val().trim().toUpperCase().match(r))&&(t=parseInt(a[1]?a[1]:a[3]),n=parseInt(a[2]?a[2]:a[4]),"P"===a[5]&&12!==t?t+=12:"A"===a[5]&&12===t&&(t-=12),s=i([2001,11,24,t,n]),l=!0)}if(o.isValid()){var d=e.time.exists?" "+s.format("HH:mm:00"):"";e.data.val(o.format("YYYY-MM-DD")+d)}else l?e.data.val(i().format("YYYY-MM-DD")+" "+s.format("HH:mm:00")):e.data.val("")}function s(e){var t=e.date.data("field-options"),i={showOn:"none"};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);e.date.datepicker(i),e.show.click(function(){e.date.datepicker("show")}),e.clear.click(function(){e.data.val(""),a(e)})}var l,r={},d=[];r.update=function(){for(var e in d)d.hasOwnProperty(e)&&a(d[e])},r.init=function(){l=!i.localeData()._longDateFormat.LT.replace(/\\[.+?\\]/gi,"").match(/A/),t("input.datetime").each(function(){var e=n(t(this));d.push(e),s(e),a(e),e.date.change(function(){o(e),a(e)}),e.time.change(function(){o(e),a(e)})})},e.datetime=r}(Bolt||{},jQuery,moment),function(e,t,i,n,a,o){"use strict";function s(e){var i;return e.name&&(i=t(e).val(),"select-multiple"===e.type&&(i=JSON.stringify(i))),i}function l(){var e=0;return t(\'form[name="content_edit"]\').find("input, textarea, select").each(function(){if("content_edit[save]"!==t(this).attr("name"))if("textarea"===this.type&&t(this).hasClass("ckeditor"))o.instances[this.id].checkDirty()&&e++;else{var i=s(this);void 0!==i&&t(this).data("watch")!==i&&e++}}),e>0}function r(){t(\'form[name="content_edit"]\').find("input, textarea, select").each(function(){if("textarea"===this.type&&t(this).hasClass("ckeditor"))o.instances[this.id].checkDirty()&&(o.instances[this.id].updateElement(),o.instances[this.id].resetDirty());else{var e=s(this);void 0!==e&&t(this).data("watch",e)}}),i.onbeforeunload=function(){if(l()||e.liveEditor.active)return e.data("editcontent.msg.change_quit")}}function d(){i.onbeforeunload=null}function c(){t("#sidebar_save, #content_edit_save, #live_editor_save").addClass("disabled"),t("#sidebar_save i, #content_edit_save i").addClass("fa-spin fa-spinner"),t("p.lastsaved").text(e.data("editcontent.msg.saving"))}function u(){var i=t(\'form[name="content_edit"]\');i.attr("novalidate","novalidate").on("submit",function(i){var n=e.validation.run(this);if(t(this).data("valid",n),!n)return i.preventDefault(),!1}),i.on("boltvalidate",function(){var i=e.validation.run(this);return t(this).data("valid",i),i})}function f(){var e=i.location.hash,n=t("#filtertabs");e&&n.find(\'a[href="#tab-\'+e.replace(/^#/,"")+\'"]\').tab("show"),n.find("a").click(function(){var e;t(this).tab("show"),e=t("body").scrollTop(),i.location.hash=this.hash.replace(/^#tab-/,""),t("html,body").scrollTop(e)})}function p(){var e=t(\'form[name="content_edit"]\');e.find("#sidebar_preview").attr("disabled",!1),e.find("#content_edit_preview").attr("disabled",!1),t("#sidebar_preview").bind("click",function(){t("#content_edit_preview").trigger("click")}),t("#content_edit_preview").bind("click",function(i){var n=t(i.target).data("url");i.preventDefault(),e.attr("action",n).attr("target","_blank").submit(),e.attr("action","").attr("target","_self")})}function h(){}function m(){t("#sidebar_delete").bind("click",function(){t("#content_edit_delete").trigger("click")}),t("#content_edit_delete").bind("click",function(n){n.preventDefault();var o=this;a.confirm(e.data("editcontent.delete"),function(n){if(t(".alert").alert(),!0===n){var a=t(\'form[name="content_edit"]\');i.onbeforeunload=null,e.actions.submit(a,o)}})})}function v(){t("#sidebar_save_return").bind("click",function(){t("#content_edit_save_return").trigger("click")}),t("#content_edit_save_return").bind("click",function(){c(),d()})}function g(){t("#sidebar_save_create").bind("click",function(){t("#content_edit_save_create").trigger("click")}),t("#content_edit_save_create").bind("click",function(){c(),d(),e.actions.submit(t(\'form[name="content_edit"]\'),this)})}function b(a){t("#sidebar_save").bind("click",function(){t("#content_edit_save").trigger("click")}),t("#content_edit_save").bind("click",function(s){s.preventDefault();var l=t(\'form[name="content_edit"]\');if(l.trigger("boltvalidate"),!l.data("valid"))return!1;var d=a.newRecord,u=a.savedon,f=a.msgNotSaved;if(c(),d)r(),e.liveEditor.active&&e.liveEditor.stop(),a.duplicate&&(i.onbeforeunload=null),e.actions.submit(l,this);else{r(),e.events.fire("Bolt.Content.Save.Start");var p=t(s.target),h=l.serialize()+"&"+encodeURI(p.attr("name"))+"="+encodeURI(p.attr("value"));t.post("",h).done(function(a){e.events.fire("Bolt.Content.Save.Done",{form:a}),i.onbeforeunload=null,t("p.lastsaved").removeClass("alert alert-danger").html(u).find("strong").text(n(a.datechanged).format("MMM D, HH:mm")).end().find(".buic-moment").buicMoment().buicMoment("set",a.datechanged);var s=t("#statusselect").find("option:selected");t("a#lastsavedstatus strong").html(\'<i class="fa fa-circle status-\'+s.val()+\'"></i> \'+s.text()),t("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner fa-exclamation-triangle").addClass("fa-check"),"object"===t.type(a)&&t.each(a,function(e,i){if("object"===t.type(i))t.each(i,function(i,n){t(\':input[name="\'+e+"["+i+\']"]\').val(n)});else if("array"===t.type(i));else{var n=t(l.name).find("[name="+e+"]");"checkbox"===n.attr("type")?n.prop("checked","1"===i):n.val(i),o&&o.instances[e]&&o.instances[e].setData(i,{callback:function(){this.resetDirty()}})}}),e.datetime.update(),r()}).fail(function(i){e.events.fire("Bolt.Content.Save.Fail");var n=t.parseJSON(i.responseText),a="<b>"+f+"</b><br><small>"+n.error.message+"</small>";t("p.lastsaved").html(a).addClass("alert alert-danger"),t("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner").addClass("fa-exclamation-triangle")}).always(function(){e.events.fire("Bolt.Content.Save.Always"),i.setTimeout(function(){t("#sidebar_save, #content_edit_save, #live_editor_save").removeClass("disabled").blur()},1e3),i.setTimeout(function(){t("#sidebar_save i, #content_edit_save i").addClass("fa-flag")},5e3)})}})}function _(){t("#content_edit_save").is("*")&&(t("body, input").bind("keydown.ctrl_s keydown.meta_s",function(e){e.preventDefault(),r(),t("#content_edit_save").trigger("click")}),i.setTimeout(function(){r()},1e3))}var k={};k.init=function(t){u(),b(t),v(),g(),p(),h(),m(),f(),e.liveEditor.init(t),i.setTimeout(function(){_()},1e3)},e.editcontent=k}(Bolt||{},jQuery,window,moment,bootbox,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";function i(e){return t(".extend-bolt-container").find(e)}function n(i){var n="",a="",o="";try{n=t.parseJSON(i.responseText)}catch(e){t(".modal").modal("hide"),bootbox.alert("<p>An unknown error occurred. This was the error message:</p>\\n\\n<pre>"+e.message+"</pre>")}"Bolt\\\\Exception\\\\PackageManagerException"===n.error.type?(o=n.error.message.replace(/(<http)/g,\'<a href="http\').replace(/(\\w+>)/g,\'">this link</a>\'),a=e.data("extend.packages.error",{"%ERROR_TYPE%":"Composer Error","%ERROR_MESSAGE%":o,"%ERROR_LOCATION%":""})):"Bolt\\\\Exception\\\\ExtensionsInfoServiceException"===n.error.type?(o=n.error.message,a=e.data("extend.packages.error",{"%ERROR_TYPE%":"Extension Site Error","%ERROR_MESSAGE%":o,"%ERROR_LOCATION%":""})):a=e.data("extend.packages.error",{"%ERROR_TYPE%":"PHP Error","%ERROR_MESSAGE%":n.error.message,"%ERROR_LOCATION%":"File: "+n.error.file+"::"+n.error.line}),t(".modal").modal("hide"),bootbox.alert(a)}function a(t){var i="";for(var n in t)if(t.hasOwnProperty(n)){var a=t[n],o=e.data("extend.packages"),s=[],l=[],r=0;if(a.authors&&a.authors.length>0)for(r=0;r<a.authors.length;r++)s.push(o.author.subst({"%AUTHOR%":a.authors[r].name}));if(s=s.length?o.authors.subst({"%AUTHORS%":s.join(", ")}):"",a.keywords&&a.keywords.length>0)for(r=0;r<a.keywords.length;r++)l.push(o.keyword.subst({"%KEYWORD%":a.keywords[r]}));l=l.length?o.keywords.subst({"%KEYWORDS%":l.join(" ")}):"","wikimedia/composer-merge-plugin"===a.name&&(a.title="Local Extension Helper");var d="",c={"%NAME%":a.name,"%VERSION%":a.version,"%BASEURL%":e.data("extend.baseurl"),"%MARKETPLACE_URL%":"https://market.bolt.cm/view/"+a.name,"%REPOSITORY_URL%":a.repositoryLink};d="installed"===a.status&&"composer-plugin"!==a.type?o.manage_dropdown_installed.subst(c):o.manage_dropdown_uninstalled.subst(c);var u=o.left_buttons.subst({"%README%":null!==a.readmeLink?o.readme_button.subst({"%README%":a.readmeLink}):"","%CONFIG%":null!==a.configLink?o.config_button.subst({"%CONFIG%":a.configLink}):"","%THEME%":"bolt-theme"===a.type?o.theme_button.subst({"%NAME%":a.name}):""});i+=o.item.subst({"%TITLE%":a.title?a.title:a.name,"%NAME%":a.name,"%VERSION%":a.version,"%AUTHORS%":s,"%TYPE%":a.type,"%MANAGE%":d,"%DETAILS%":u,"%BASEURL%":e.data("extend.baseurl"),"%DESCRIPTION%":a.description?o.description.subst({"%DESCRIPTION%":a.description}):"","%KEYWORDS%":l,"%STATUS%":!1===a.valid?" — [INVALID] ":"","%ENABLED%":!1===a.enabled?" — [DISABLED] ":"","%CONSTRAINT%":null!==a.constraint?\'<i class="fa fa-cog fa-fw"></i> Requires Bolt \'+a.constraint:""})}return i}function o(){i(".installed-container").each(function(){var o=t(this).find(".installed-list");R=i(".installed-container .console"),t.get(e.data("extend.baseurl")+"installed",function(t){var n="";if("object"==typeof t){o.show(),o.find(".installed-list-items").html(""),i(".installed-container .console").hide();var s=!0;"object"==typeof t&&(n+=a(t),s=!1),s&&(n=e.data("extend.packages.empty"),R.hide()),o.find(".installed-list-items").append(n)}else R.html(e.data("extend.text.bad-json"))}).fail(function(e){n(e)})})}function s(){t("#installModal").on("hide.bs.modal",function(){i(".latest-version-container .installed-version-item").html(\'<tr><td colspan="3"><strong>\'+e.data("extend.text.no-stable")+"</strong></td></tr>"),i(".stable-version-container .installed-version-item").html(\'<tr><td colspan="3"><strong>\'+e.data("extend.text.no-stable")+"</strong></td></tr>"),i(".dev-version-container .installed-version-item").html(\'<tr><td colspan="3"><strong>\'+e.data("extend.text.no-test")+"</strong></td></tr>"),i(".install-response-container .console").html(e.data("extend.text.installing")),i(".theme-postinstall").hide(),i(".theme-generate-response").hide(),i(".extension-postinstall").hide(),i(".install-response-container").hide(),i(".install-latest-container").hide(),i(".install-version-container").hide(),i(".postinstall-footer").hide(),i("#installModal .loader").show()})}function l(){var a,o;i(".update-container").show(),o=i(".update-output-console").html(),i(".update-output-notice").html(o),i(".update-output-notice").find(".update-output-element").removeClass("update-output-element").addClass("update-output").show(),i(".update-list").hide(),(a=i(".update-list-items")).html(""),(R=i(".update-output")).html(e.data("extend.text.updating")),t.get(e.data("extend.baseurl")+"check",function(t){if(t.updates.length>0||t.installs.length>0){var n,o;for(n in t.installs)t.installs.hasOwnProperty(n)&&(o=t.installs[n],a.append(e.data("extend.packages.install_new",{"%PACKAGE%":o.name,"%VERSION%":o.version,"%PRETTYVERSION%":o.prettyversion})));for(n in t.updates)t.updates.hasOwnProperty(n)&&(o=t.updates[n],a.append(e.data("extend.packages.install_update",{"%PACKAGE%":o.name,"%VERSION%":o.version,"%PRETTYVERSION%":o.prettyversion})));R.hide(),i(".update-list").show()}else R.html(e.data("extend.text.updated"))}).fail(function(e){n(e)})}function r(e,t,n){var a=i(".update-container");e&&a.find(".update-output-title").html(e),t&&(a.find(".update-output-console").find(".console").html(t),a.find(".update-output-console").show()),n&&a.find(".update-output-notice").html(n).show(),a.show()}function d(e,t){var n=i(".update-container");e&&n.find(".update-output-console").find(".console").html(e).show(),t&&n.find(".update-output-notice").html(t).show()}function c(){r(e.data("extend.text.running-update-all"),e.data("extend.text.running-update"),!1),t.get(e.data("extend.baseurl")+"update",function(e){setTimeout(function(){i(".update-container").hide()},7e3),d(e),o()}).fail(function(e){n(e)})}function u(a){var s=i(".update-output").html(e.data("extend.text.updating")),l=t(a.target).data("package");s.show(),R=s,t.get(e.data("extend.baseurl")+"update?package="+l).success(function(e){i(".update-output").html(e),i(\'.update-list-items tr[data-package="\'+l+\'"]\').remove(),B(function(){R.hide()},4e3),i(".update-list-items tbody tr").length<1&&i(".update-container").hide(),o()}).fail(function(e){n(e)}),a.preventDefault()}function f(a){r(e.data("extend.text.install-running"),e.data("extend.text.install-all"),!1),t.get(e.data("extend.baseurl")+"installAll",function(e){B(function(){i(".update-container").hide()},7e3),d(e),o()}).fail(function(e){n(e)}),a.stopPropagation(),a.preventDefault()}function p(a){r(e.data("extend.text.autoloader-update"),e.data("extend.text.autoloader-start")+" …",!1),t.get(e.data("extend.baseurl")+"dumpAutoload",function(e){B(function(){i(".update-container").hide()},7e3),d(e)}).fail(function(e){n(e)}),a.stopPropagation(),a.preventDefault()}function h(t){var i,n,a="";for(var o in t)t.hasOwnProperty(o)&&void 0!==(i=t[o])&&(n="approved"===i.buildStatus?" label-success":"",a+=e.data("extend.packages.versions",{"%NAME%":i.name,"%VERSION%":i.version,"%CLASS%%":n,"%BUILDSTATUS%":i.buildStatus}));return a}function m(a){R=i(".update-output"),t.get(e.data("extend.baseurl")+"installInfo?package="+a,function(e){var t=e.dev,n=e.beta,a=e.RC,o=e.stable;i(".dev-version-container .installed-version-item").html(""),o.length>0?(i(".stable-version-container .installed-version-item").html(""),i(".stable-version-container .installed-version-item").append(h(o)),i(".latest-version-container .installed-version-item").html(""),i(".latest-version-container .installed-version-item").append(h([e.stable[0]])),i(".install-latest-container").show()):i(".install-version-container").show(),a.length>0&&i(".dev-version-container .installed-version-item").append(h(a)),n.length>0&&i(".dev-version-container .installed-version-item").append(h(n)),t.length>0&&i(".dev-version-container .installed-version-item").append(h(t)),i("#installModal .loader").hide()}).fail(function(e){n(e)})}function v(e){var t=i(\'input[name="check-package"]\').val(),n=i(\'input[name="check-package"]\').data("packagename");n&&(t=n),m(t),e.preventDefault()}function g(){i(".install-latest-container").hide(),i(".install-version-container").show()}function b(e){i(".extension-postinstall").show(),i(".extension-postinstall .modal-success").show(),i(".postinstall-footer .ext-link").attr("href",e.source),i(".postinstall-footer").show()}function _(e){var t=e.name.split(/\\/+/).pop();i(".install-response-container").hide(),i(".theme-postinstall").show(),i(".theme-generation-container").show(),i(".theme-postinstall .theme-generator").data("theme",e.name),i(".theme-postinstall #theme-name").val(t),i(".postinstall-footer").show()}function k(i,a){t.get(e.data("extend.baseurl")+"packageInfo",{package:i,version:a}).done(function(e){"bolt-extension"===e.type&&b(e),"bolt-theme"===e.type&&_(e)}).fail(function(e){n(e)})}function w(a){var s=t(a.target).data("package"),l=t(a.target).data("version");i(".install-response-container").show(),i(".install-latest-container").hide(),i(".install-version-container").hide(),(R=i(".install-response-container .console")).html(e.data("extend.text.installing")),i("#installModal .loader .message").html(e.data("extend.text.installing")),t.get(e.data("extend.baseurl")+"install",{package:s,version:l}).done(function(){k(s,l),i(".install-response-container").hide(),i(".check-package").show(),i(\'input[name="check-package"]\').val(""),o()}).fail(function(e){n(e)}),a.preventDefault()}function y(a){var o=t(a.target).data("theme"),s=i("#theme-name").val();t.get(e.data("extend.baseurl")+"generateTheme",{theme:o,name:s}).done(function(e){i(".theme-generate-response").html("<p>"+e+"</p>").show(),i(".theme-generation-container").hide()}).fail(function(e){n(e)}),a.preventDefault()}function x(a){var o=t(a.target).data("theme"),s=i("#theme-name").val();if(confirm(e.data("extend.text.overwrite"))){var l=i(".installed-container .console").html(e.data("extend.text.copying"));l.show(),R=l,t.get(e.data("extend.baseurl")+"generateTheme",{theme:o,name:s}).done(function(e){R.html(e),B(function(){l.hide()},5e3)}).fail(function(e){n(e)})}a.preventDefault()}function C(e){t.get(t(e.target).data("readme")).done(function(e){bootbox.dialog({message:e||"Readme is empty."})}).fail(function(e){n(e)}),e.preventDefault()}function E(a){var o=t(a.target).data("needle"),s=t(a.target).data("constraint");i(".dependency-response-container").show(),i(".install-latest-container").hide(),i(".install-version-container").hide(),(R=i(".dependency-response-container .console")).html(""),t.get(e.data("extend.baseurl")+"depends",{needle:o,constraint:s}).done(function(e){i(".loader").hide(),i(".dependency-response-container").hide(),i(".check-package").show(),i(\'input[name="check-package"]\').val("");var t=i("#installModal .extension-dependencies-list");t.html(""),e.forEach(function(e){t.append("<li>"+e.link+"</li>")}),t.show(),i(".extension-dependencies").show(),i(".postinstall-footer").show()}).fail(function(e){n(e)}),a.preventDefault()}function S(e){m(t(e.target).data("available"))}function T(a){var s=i(".installed-container .console").html(e.data("extend.text.removing"));if(!1===confirm(e.data("extend.text.confirm-remove")))return a.stopPropagation(),a.preventDefault(),!1;s.show(),R=s,t.get(t(a.target).attr("href")).done(function(e){i(".installed-container .console").html(e),o(),B(function(){R.hide()},2e3)}).fail(function(e){n(e)}),a.preventDefault()}function I(){var n=i(\'input[name="check-package"]\');n.on("keyup",function(){var i=t(this).val();i.length<3||B(function(){t.ajax({url:e.data("extend.siteurl")+"list.json",dataType:"jsonp",data:{name:i,bolt:e.data("extend.sitever")}}).success(function(e){if(e.packages.length){var t=n.parent().find(".auto-search");t.html("").show();for(var i in e.packages)if(e.packages.hasOwnProperty(i)){var a=e.packages[i],o=\'data-request="prefill-package" data-packagename="\'+a.name+\'"\';t.append(\'<a class="btn btn-block btn-default prefill-package" \'+o+\'style="text-align: left;">\'+a.title+" <small "+o+">("+a.authors+" - "+a.name+")</small></a>")}n.on("blur",function(){t.fadeOut()})}})},500)})}function A(e){var n=t(e.target);i(\'input[name="check-package"]\').val(n.closest("a").text()),i(\'input[name="check-package"]\').data("packagename",n.data("packagename")),i(".auto-search").hide()}var R,D,$={},B=function(){var e=0;return function(t,i){clearTimeout(e),e=setTimeout(t,i)}}(),O={click:function(e){switch(t(e.target).data("request")){case"update-check":l();break;case"update-run":c();break;case"update-package":u(e.originalEvent);break;case"check-package":v(e.originalEvent);break;case"uninstall-package":T(e.originalEvent);break;case"install-package":w(e.originalEvent);break;case"prefill-package":A(e.originalEvent);break;case"install-run":f(e.originalEvent);break;case"autoload-dump":p(e.originalEvent);break;case"generate-theme":y(e.originalEvent);break;case"package-available":S(e.originalEvent);break;case"package-copy":x(e.originalEvent);break;case"package-readme":C(e.originalEvent);break;case"package-depends":E(e.originalEvent);break;case"show-all":g(e.originalEvent)}}};$.init=function(){var e=t(".extend-bolt-container");e.length&&(e.on("click",O.click),t(document).ajaxStart(function(){D=setInterval(function(){R&&R.append(".")},1e3)}).ajaxSuccess(function(){clearInterval(D)}).ajaxError(function(){clearInterval(D)}),o(),I(),s())},e.extend=$}(Bolt||{},jQuery),function(e,t){"use strict";var i={},n={},a=/^([a-zA-Z0-9_-]+)(?:\\.([a-zA-Z0-9_-]+))?(?:\\.([a-zA-Z0-9_-]+))?(?:\\.([a-zA-Z0-9_-]+))?$/;i.fire=function(e,t){var i=a.exec(e);if(i&&void 0!==i[4])for(;e;)n[e]&&n[e].fire({namespace:i[1],domain:i[2],event:i[3],status:i[4]},t),e=e.replace(/\\.?[a-zA-Z0-9_-]+$/,"")},i.on=function(e,i){a.exec(e)&&(n[e]||(n[e]=t.Callbacks("unique")),n[e].add(i))},i.off=function(e,t){a.exec(e)&&n[e]&&n[e].remove(t)},e.events=i}(Bolt||{},jQuery),function(e,t){"use strict";function i(e,i,n,a){var o={url:e,type:"POST",data:i,success:function(){document.location.reload()},error:function(e){alert(e.responseText),console.error(n)}};a&&(o.success=a),t.ajax(o)}var n={};n.createFile=function(t,n){var a=window.prompt(e.data("files.msg.create_file"));a.length&&i(e.data("url.file.create"),{filename:a,parentPath:n,namespace:t},"Something went wrong creating this file!")},n.renameFile=function(t,n,a){var o=window.prompt(e.data("files.msg.rename_file"),a);o.length&&o!==a&&i(e.data("url.file.rename"),{namespace:t,parent:n,oldname:a,newname:o},"Something went wrong renaming this file!")},n.deleteFile=function(n,a,o){confirm(e.data("files.msg.delete_file",{"%FILENAME%":a}))&&i(e.data("url.file.delete"),{namespace:n,filename:a},"Failed to delete the file from the server",function(){null!==o&&t(o).closest("tr").slideUp()})},n.duplicateFile=function(t,n){i(e.data("url.file.duplicate"),{namespace:t,filename:n},"Something went wrong duplicating this file!")},n.createFolder=function(t,n){var a=window.prompt(e.data("files.msg.create_folder"));a.length&&i(e.data("url.folder.create"),{parent:n,foldername:a,namespace:t},"Something went wrong renaming this folder!")},n.renameFolder=function(t,n,a){var o=window.prompt(e.data("files.msg.rename_folder"),a);o.length&&o!==a&&i(e.data("url.folder.rename"),{namespace:t,parent:n,oldname:a,newname:o},"Something went wrong renaming this folder!")},n.deleteFolder=function(t,n,a){window.confirm(e.data("files.msg.delete_folder",{"%FOLDERNAME%":a}))&&i(e.data("url.folder.delete"),{namespace:t,parent:n,foldername:a},"Something went wrong renaming this folder!")},e.files=n}(Bolt||{},jQuery),function(e,t,i){"use strict";function n(e){return e.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g,"\\\\$1")}function a(e,t){var i="<mark>"+t+"</mark>";return e.replace(new RegExp(n(t),"g"),i)}function o(){var e=t(this).val();t(".dashboardlisting").find("[data-bolt-browse-name]").each(function(){var i=t(this).data("bolt-browse-name"),n=i.search(e)<0;t(this).toggleClass("hidden",n),n||t(this).find(".name").each(function(){t(this).html(a(i,e)),0===e.length&&t(this).html(i)})})}function s(){for(var e=document.querySelectorAll("img[data-src]"),t=0;t<e.length;t++)e[t].getAttribute("data-src")&&(e[t].setAttribute("src",e[t].getAttribute("data-src")),e[t].removeAttribute("data-src"))}function l(){document.getElementById("file-manager-search").addEventListener("keyup",o),t("#file_upload_select").addClass("btn-secondary").bootstrapFileInput(),document.getElementById("file_upload_select").addEventListener("change",function(){document.getElementById("file_upload_upload").removeAttribute("disabled")}),window.addEventListener("load",s)}function r(e){var i=t("body"),n=0;i.bind({dragenter:function(e){e.preventDefault(),n++,t(this).addClass("dropzone-active")},dragleave:function(){0===--n&&t(this).removeClass("dropzone-active")}}),e.on("drop",function(){i.removeClass("dropzone-active")})}function d(){var n=t(\'form[name="file_upload"]\').find("#file_upload__token").val(),a=new i(document.body,{url:e.conf("uploadConfig.url"),previewsContainer:"#dropzone-preview",acceptedFiles:"."+e.conf("uploadConfig.acceptFilesTypes").join(",."),uploadMultiple:"true",enqueueForUpload:"true",hiddenInputContainer:".form-horizontal",paramName:"file_upload[select]",clickable:!1,autoProcessQueue:!0,params:{"file_upload[_token]":n},init:function(){r(this)}});a.on("sending",function(){t(".panel-uploadprogress").removeClass("hidden")}),a.on("complete",function(e){a.removeFile(e)}),a.on("totaluploadprogress",function(e){100===e&&window.setTimeout(function(){location.reload()},200)})}var c={};c.init=function(){i.autoDiscover=!1,null!==document.querySelector(".file-manager")&&(d(),l())},e.filemanager=c}(Bolt||{},jQuery,Dropzone),function(e,t,i,n){"use strict";var a={},o=["text","html","textarea"],s=null;a.init=function(e){a.previewUrl=e.previewUrl,Modernizr.contenteditable?(t("#sidebar_live_edit, #content_edit_live_edit").bind("click",a.start),t(".close-live-editor").bind("click",a.stop),t(".save-live-editor").bind("click",a.save)):t(".live-editor, #sidebar_live_editor, #content_edit_live_edit").remove()},a.start=function(){var i=t(\'form[name="content_edit"]\');if(e.validation.run(i[0])){var n=i.find("*[name=_live-editor-preview]"),l=t("#navpage-primary").find(".navbar-header a"),r=t("#live-editor-iframe"),d=function(e){e.preventDefault()},c=function(){var n=r[0],s=n.contentWindow||n,l=s.document,c=t(l);c.on("click","a",d);var u=e.ckeditor.initcke(s.CKEDITOR),f=u.editorConfig;u.editorConfig=function(e){f.bind(this)(e);for(var t in e.toolbar)if("tools"===e.toolbar[t].name){var i=e.toolbar[t].items.indexOf("Source");i>-1&&delete e.toolbar[t].items[i]}},u.disableAutoInline=!1,c.find("[data-bolt-field]").each(function(){var n=i.find("*[name="+a.escapejQuery(t(this).data("bolt-field"))+"]").closest("[data-bolt-fieldset]").data("bolt-fieldset");if(t(this).addClass("bolt-editable"),!t(this).data("no-edit")&&-1!==o.indexOf(n))if(t(this).attr("contenteditable",!0),"html"===n){var r=u.inline(this,{allowedContent:""}),d=e.utils.debounce(function(){r.element.data("src",r.getData())},500);r.on("instanceReady",d),r.on("change",d)}else t(this).on("paste",function(e){var t;e.preventDefault(),e.originalEvent.clipboardData?(t=e.originalEvent.clipboardData.getData("text/plain"),l.execCommand("insertText",!1,t)):s.clipboardData&&(t=s.clipboardData.getData("Text"),s.getSelection&&s.getSelection().getRangeAt(0).insertNode(l.createTextNode(t)))}),"textarea"===n?t(this).on("keypress",function(e){13===e.which&&(e.preventDefault(),l.execCommand("insertHTML",!1,"<br><br>"))}):t(this).on("keypress",function(e){return 13!==e.which}).on("focus blur",function(){t(this).html(t(this).text())})})};r.on("load",c),e.liveEditor.active=!0,t("body").addClass("live-editor-active"),l.on("click",d),n.val("yes"),i.attr("action",a.previewUrl).attr("target","live-editor-iframe").submit(),i.attr("action","").attr("target","_self"),n.val(""),s=function(){r.off("load",c),l.off("click",d)}}},a.save=function(){a.extractText(),t("#content_edit_save").trigger("click")},a.stop=function(){var i=t("#live-editor-iframe")[0];a.extractText(),t(i).attr("src",""),e.liveEditor.active=!1,t("body").removeClass("live-editor-active"),s()},a.extractText=function(){var e=t("#live-editor-iframe")[0],i=(e.contentWindow||e).document;t(i).find("[data-bolt-field]").each(function(){var e=t(\'form[name="content_edit"]\'),i=t(this).data("bolt-field"),o=e.find("[name="+a.escapejQuery(i)+"]"),s=o.closest("[data-bolt-fieldset]").data("bolt-fieldset");if("html"===s){var l=o.attr("id");n.instances.hasOwnProperty(l)&&n.instances[l].setData(t(this).data("src"))}else o.val(a.cleanText(t(this),s))})},a.cleanText=function(e,t){return"textarea"===t&&e.html(e.html().replace(/&nbsp;/g," ").replace(/\\s?<br.*?>\\s?/g,"\\n")),e.text()},a.escapejQuery=function(e){return e.replace(/[:\\.\\[\\],]/g,"\\\\$1")},a.active=!1,a.previewUrl=null,e.liveEditor=a}(Bolt||{},jQuery,window,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t,i){"use strict";var n={};n.init=function(){var n=t(".omnisearch select");n.select2({width:"100%",placeholder:e.data("omnisearch.placeholder"),minimumInputLength:3,multiple:!0,ajax:{delay:600,url:n.data("omnisearchUrl"),dataType:"json",data:function(e){return{q:e.term}},processResults:function(e){var i=[];return t.each(e,function(e,t){i.push({id:t.path,path:t.path,text:t.label})}),{results:i}}},templateResult:function(e){var t=e.path?"<small>"+e.path+"</small>":"";return"<div>"+(e.loading?\'<i class="fa fa-spinner fa-spin"></i> \':"")+e.text+"</div>"+t},templateSelection:function(e){return i.location.href=e.path,null},escapeMarkup:function(e){return e}})},e.omnisearch=n}(Bolt||{},jQuery,window),function(e,t,i){"use strict";function n(){t(".navbar-toggle").on("click",function(){var e=t("#navpage-wrapper");e.hasClass("nav-secondary-opened")?e.removeClass("nav-secondary-opened nav-secondary-collapsed"):e.removeClass("nav-secondary-collapsed").addClass("nav-secondary-opened")})}function a(){t(".nav-secondary-collapse a").on("click",function(){return t("#navpage-wrapper").removeClass("nav-secondary-opened").addClass("nav-secondary-collapsed"),setTimeout(function(){t("#navpage-wrapper").addClass("nav-secondary-collapsed-hoverable")},300),t.cookie("sidebar","collapsed",{expires:21,path:"/"}),t("#bolt-footer").addClass("bolt-footer-hidden"),!1})}function o(){t(".nav-secondary-expand a").on("click",function(){return t("#navpage-wrapper").removeClass("nav-secondary-collapsed nav-secondary-opened nav-secondary-collapsed-hoverable"),t.removeCookie("sidebar",{path:"/"}),t("#bolt-footer").removeClass("bolt-footer-hidden"),!1})}function s(){var e=t("#navpage-content").outerHeight(),n=t("#navpage-secondary"),a=n.outerHeight(),o=t(document).height()-n.position().top,l=Math.max(e,o),r=5e3;a!==l&&(n.outerHeight(l),r=500),i.setTimeout(s,r)}function l(){t("#navpage-secondary").find("a.menu-pop").each(function(){var e=t(this),n="";e.nextAll(".submenu").children().each(function(){t(this).hasClass("subdivider")&&(n+="<hr>"),n+=t(this).html().trim().replace(/[ \\n]+/g," ").replace(/(>) | (<)/g,"$1$2")}),e.popover({trigger:"manual",content:n,html:!0}),e.on("mouseover focus click dblclick",function(e){var n=this,a=300;"click"!==e.type||t(n).next().hasClass("popover")||(e.preventDefault(),a=0),i.clearTimeout(c),c=i.setTimeout(function(){t("#navpage-secondary a.menu-pop").not(n).popover("hide"),t(n).popover("show")},a)})}).end().on("mouseenter focus",".popover",function(){i.clearTimeout(c)}).on("mouseleave blur","a.menu-pop, .popover",function(){i.clearTimeout(c),c=i.setTimeout(function(){t("#navpage-secondary a.menu-pop").popover("hide")},300)})}function r(){t("#navpage-secondary a.menu-pop").on("click",function(e){var i=t(this).nextAll(".submenu");e.preventDefault(),i.hasClass("show")?i.removeClass("show"):(t("#navpage-secondary .submenu").removeClass("show"),i.addClass("show"))})}var d={},c=0;d.init=function(){var e=!t(".navbar-toggle").is(":visible");n(),a(),o(),t("#navpage-secondary").length&&s(),e?l():r()},e.secmenu=d}(Bolt||{},jQuery,window),function(e,t){"use strict";var i={};i.init=function(){t("a[data-bolt-addtostack]").each(function(){t(this).on("click",function(e){var n=t(e.currentTarget),a=n.data("bolt-addtostack");e.preventDefault(),i.addToStack(a,n)})})},i.addToStack=function(i,n){t.post(e.conf("stackAddUrl"),{filename:i}).done(function(e){n&&t(n).addClass("disabled"),t(":bolt-buicStack").buicStack("prepend",e.panel,e.removed),e.removed&&t(".select-from-stack [data-file]").each(function(){t(this).data("file").fullPath===e.removed&&t(this).remove()}),t(".select-from-stack").each(function(){var i=t(this).data("type");i&&e.type!==i||t(this).prepend(e.list)})}).fail(function(){console.error("Failed to add file to stack")})},e.stack=i}(Bolt||{},jQuery),function(e){"use strict";var t={};t.humanBytes=function(t){for(var i=-1;++i<8&&Math.abs(t)>=1e3;)t/=1e3;return(t="object"==typeof Intl&&Intl&&"function"==typeof Intl.NumberFormat?t.toLocaleString(e.conf("locale.long").replace(/_/g,"-"),{maximumSignificantDigits:3}):t.toFixed(2))+" "+" kMGTPEZY"[i].trim()+"B"},t.filterInt=function(e,t){return/^(\\-|\\+)?([0-9]+|Infinity)$/.test(e)?Number(e):t||NaN},t.debounce=function(e,t,i){var n;return function(){var a=this,o=arguments,s=i&&!n;clearTimeout(n),n=setTimeout(function(){n=null,i||e.apply(a,o)},t),s&&e.apply(a,o)}},e.utils=t}(Bolt||{}),function(e){"use strict";jQuery.widget("bolt.baseField",{_create:function(){}})}(),function(e){"use strict";var t={};e.widget("bolt.baseInterval",{options:{delay:1e4},_create:function(){var i=this,n=this.widgetName;if(!t[n]){var a=e.Callbacks(),o=setInterval(a.fire,this.options.delay);t[n]={id:o,delay:this.options.delay,callbacks:a}}this._fncUpdate=function(){i._update()},t[n].callbacks.add(this._fncUpdate)},_destroy:function(){var e=this.widgetName;t[e].callbacks.remove(this._fncUpdate),t[e].callbacks.has()||(clearInterval(t[e].id),delete t[e])}})}(jQuery),function(e){"use strict";e.widget("bolt.buicBrowser",{options:{url:"",multiselect:!1},_create:function(){this._url=this.options.url,this._on({click:function(){this._browse()}})},_browse:function(){var t=this,i={multiselect:this.options.multiselect},n=[],a=!1;e("body").buicModal({size:"large",remote:{url:t._url,data:i},loaded:function(i,o){var s=o.footer.find("[data-fbrowser-add-checked]");o.header.on("click.bolt","[data-fbrowser-chdir]",function(i){i.preventDefault(),t._url=e(this).data("fbrowser-chdir"),t._browse()}),o.body.on("click.bolt","[data-fbrowser-chdir]",function(i){i.preventDefault(),t._url=e(this).data("fbrowser-chdir"),t._browse()}).on("click.bolt","[data-file] a",function(i){i.preventDefault();var n=e(this).closest("[data-file]").data("file");t._trigger("selected",null,n),o.close()}).on("click.bolt","[aria-pressed]",function(t){var i="false"===e(this).attr("aria-pressed"),n=this.className.replace("toogle-","");e(this).attr("aria-pressed",i?"true":"false"),o.body.find("tbody."+n).toggleClass("hidden",!i),t.clientX>0&&this.blur()}).on("change",\'select[name="ext"]\',function(){t._filter(o)}).keyup(\'input[name="filter"]\',function(){t._filter(o)}).on("change","[data-fbrowser-check]",function(){var t=e(this).closest("[data-file]").data("file"),i=n.indexOf(t.fullPath);i>-1?(n.splice(i,1),a=!1,0===n.length&&s.addClass("disabled")):(n.push(t.fullPath),s.removeClass("disabled"))}),o.footer.on("click.bolt",".toggle-all",function(t){t.preventDefault(),a?(o.body.find("[data-fbrowser-check]").each(function(){e(this).prop("checked",!1)}),n.length=0,a=!1,s.addClass("disabled")):(o.body.find("[data-fbrowser-check]").each(function(){e(this).prop("checked",!0);var t=e(this).closest("[data-file]").data("file");n.push(t.fullPath)}),a=!0,s.removeClass("disabled"))}).on("click.bolt","[data-fbrowser-add-checked]:not(.disabled)",function(i){i.preventDefault(),o.body.find("[data-fbrowser-check]").each(function(){if(e(this).prop("checked")){var i=e(this).closest("[data-file]").data("file");t._trigger("selected",null,i)}}),o.close()})}})},_filter:function(t){var i,n,a=t.body.find(\'input[name="filter"]\').val(),o=t.body.find(\'select[name="ext"]\').val();t.body.find("[data-file],[data-folder]").each(function(){i=e(this).data("file")||e(this).data("folder"),n=""!==o&&i.extension!==o||""!==a&&i.filename.search(a)<0,e(this).toggleClass("hidden",n),n||e(this).find("a, span").each(function(){e(this).html(i.filename.replace(a,"<mark>"+a+"</mark>"))})})}})}(jQuery),function(e){"use strict";jQuery.widget("bolt.buicCheckbox",{_create:function(){var e=this.element.find("button"),t=this.element.find("input");this._on(e,{click:function(){t.prop("checked",!t.prop("checked"))}})}})}(),function(e,t){"use strict";e.widget("bolt.buicListing",{_create:function(){this.csrfToken=this.element.data("bolt_csrf_token"),this.contentType=this.element.data("contenttype"),this.contentTypeName=this.element.data("contenttype-name"),this.element.find("table.listing tbody").buicListingPart()},modifyRecords:function(i,n,a){var o,s=this,l={},r={delete:{safe:!1,name:t.data("recordlisting.action.delete",{"%CTNAME%":this.contentTypeName}),cmd:{delete:null}},publish:{safe:!0,name:t.data("recordlisting.action.publish",{"%CTNAME%":this.contentTypeName}),cmd:{modify:{status:"published"}}},depublish:{safe:!0,name:t.data("recordlisting.action.depublish"),cmd:{modify:{status:"held"}}},draft:{safe:!0,name:t.data("recordlisting.action.draft"),cmd:{modify:{status:"draft"}}}};l[s.contentType]={},e(n).each(function(){l[s.contentType][this]=r[i].cmd}),o=(o=1===n.length?t.data("recordlisting.confirm.one"):t.data("recordlisting.confirm.multi",{"%NUMBER%":"<b>"+n.length+"</b>"}))+"<br><br><b>"+t.data("recordlisting.confirm.no-undo")+"</b>",r[i].safe?s._sendModifyRecordsQuery(l):bootbox.dialog({message:o,title:r[i].name,buttons:{cancel:{label:t.data("recordlisting.action.cancel"),className:"btn-default"},ok:{label:a,className:"btn-danger",callback:function(){s._sendModifyRecordsQuery(l)}}}})},_sendModifyRecordsQuery:function(i){var n=this;e.ajax({url:t.conf("contentActionUrl"),type:"POST",data:{bolt_csrf_token:n.csrfToken,contenttype:n.contentType,actions:i},success:function(e){n.element.html(e),n.element.find("table.listing tbody").buicListingPart()},error:function(e,t,i){console.error(e.status+" ("+i+"):"),console.error(JSON.parse(e.responseText))},dataType:"html"})}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.buicListingPart",{_create:function(){var t=this;this.listing=this.element.closest(":bolt-buicListing"),this.toolbar=this.element.find("tr.selectiontoolbar"),this.toolbarCount=this.toolbar.find("div.count"),this.menu=this.element.find("tr.header th.menu"),this.menuOnlyOnSelection=this.menu.find("li:not(.select-all)"),this.menuSelectionCount=this.menu.find("li.dropdown-header"),this.menuSelectionCountTemplate=this.menuSelectionCount.text(),this.selectedIds=[],this.menu.find("li.select-all, li.select-none").on("click",function(){var i=e(this).hasClass("select-all");t.element.find(\'td input:checkbox[name="checkRow"]\').each(function(){this.checked=i,t._update(this)})}),this.element.find(\'td input:checkbox[name="checkRow"]\').on("click",function(){t._update(this)}),this.toolbar.find(\'button[data-stb-cmd^="record:"]\').on("click",function(){t._modifyRecords(e(this).data("stb-cmd"),t.selectedIds,e(this).html())}),this.element.find(\'a[data-listing-cmd^="record:"]\').on("click",function(){t._modifyRecords(e(this).data("listing-cmd"),[e(this).parents("tr").attr("id").substr(5)],e(this).html())})},_modifyRecords:function(e,t,i){t.length>0&&this.listing.buicListing("modifyRecords",e.replace(/^record:/,""),t,i)},_update:function(t){var i,n=e(t).closest("tr"),a=n.attr("id").substr(5);t.checked?(-1===this.selectedIds.indexOf(a)&&this.selectedIds.push(a),n.addClass("row-selected")):(this.selectedIds.splice(this.selectedIds.indexOf(a),1),n.removeClass("row-selected")),(i=this.selectedIds.length)?(this.toolbar.removeClass("hidden"),this.menuOnlyOnSelection.removeClass("hidden")):(this.toolbar.addClass("hidden"),this.menuOnlyOnSelection.addClass("hidden")),this.toolbarCount.text(i),this.menuSelectionCount.text(this.menuSelectionCountTemplate.replace("(#)","("+i+")"))}})}(jQuery),function(e){"use strict";e.widget("bolt.buicModal",{options:{size:void 0,closer:!1,classname:void 0,headline:void 0,header:void 0,body:void 0,footer:void 0,remote:void 0,loaded:void 0},_create:function(){var t=this,i=e(\'<div class="modal-header hidden"/>\'),n=e("<div class=modal-body/>"),a=e(\'<div class="modal-footer hidden"/>\'),o=e("<div class=modal-content/>").append(i,n,a),s=e("<div class=modal-dialog role=document/>").append(o),l=e(\'<div tabindex=-1 role=dialog class="modal fade buic-modal"/>\').append(s);this._ui={header:i,body:n,footer:a,content:o,dialog:s,modal:l},this._on(this.element,{"click .modal-retry":function(){t._load()}}),t.element.prepend(t._ui.modal),t._ui.modal.on("show.bs.modal",function(){t._fire("show")}).on("shown.bs.modal",function(){t._fire("shown")}).on("hide.bs.modal",function(){t._fire("hide")}).on("hidden.bs.modal",function(){t._fire("hidden"),t.destroy()}).modal("show")},_destroy:function(){this._ui.modal.data("modal",null).remove()},_fire:function(e){var t=this;t._trigger(e,null,{close:function(){t._ui.modal.modal("hide")},header:t._ui.header,body:t._ui.body,footer:t._ui.footer})},_init:function(){this._ui.dialog.toggleClass("modal-sm","small"===this.options.size).toggleClass("modal-lg","large"===this.options.size),this.options.remote?this._load():this._update()},_load:function(){var t=this;t._ui.content.addClass("modal-loading"),e.get(t.options.remote.url,t.options.remote.data||{}).done(function(i){t.options.classname=e(i)[0].className,e.each(["header","body","footer"],function(n,a){var o=e(i).children(a.replace("body","main"))[0];t.options[a]=o?o.innerHTML:void 0}),t._update(),t._fire("loaded")}).fail(function(){t.options.header=void 0,t.options.body=\'<button type=button class="btn btn-default modal-retry"><i class="fa fa-refresh"></i></button>\',t.options.footer=void 0,t._update()}).always(function(){t._ui.content.removeClass("modal-loading")})},_update:function(){var t,i=this;void 0!==this.options.headline&&(this.options.header=e(),this.options.closer&&(this.options.header=this.options.header.add(\'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>\')),this.options.header=this.options.header.add(e(\'<h4 class="modal-title"/>\').append(this.options.headline))),this._ui.content.attr("class","modal-content").addClass(this.options.classname),e.each(["header","body","footer"],function(n,a){t=e("<div>").append(i.options[a]).html()||"",i._ui[a].off().toggleClass("hidden",!t.length).html(t)}),this._ui.modal.modal("handleUpdate")}})}(jQuery),function(e,t){"use strict";e.widget("bolt.buicMoment",e.bolt.baseInterval,{options:{delay:15e3,titleFormat:"YYYY-MM-DD HH:mm:ss ZZ"},_create:function(){this.set(),this._super()},_update:function(){this.element.html(t(this.element.attr("datetime")).fromNow())},set:function(e){e?this.element.attr("datetime",t(e).format()):e=this.element.attr("datetime"),this.element.attr("title",t(e).format(this.options.titleFormat)),this._update()}})}(jQuery,moment),function(e){"use strict";e.widget("bolt.buicProgress",{_create:function(){this.bars={},this.element.addClass("buic-progress")},_set:function(e,t){t=parseFloat(t),t=isNaN(t)?0:Math.min(100,Math.max(0,Math.round(100*t))),this.bars[e]&&this.bars[e].find(".progress-bar").attr("aria-valuenow",t).css("width",t+"%")},add:function(t,i,n){this.bars[t]||(this.bars[t]=e(\'<div class="progress"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div></div>\'),this.bars[t].attr("data-label",n||t).find(".progress-bar").text(n||t),this._set(t,i),this.element.append(this.bars[t]).show(),this.bars[t].show(300))},remove:function(e){if(this.bars[e]){var t=this,i=this.bars[e];delete this.bars[e],i.hide(300,function(){i.remove(),0===Object.keys(t.bars).length&&t.element.hide()})}},set:function(e,t){this._set(e,t)}})}(jQuery),function(e){"use strict";jQuery.widget("bolt.buicSelect",{_create:function(){this.select=this.element.find("select"),this.buttonAll=this.element.find(".select-all"),this.buttonNone=this.element.find(".select-none"),this.buttonAll.prop("title",this.buttonAll.text().trim()),this._on(this.buttonAll,{click:function(){this.all()}}),this.buttonNone.prop("title",this.buttonNone.text().trim()),this._on(this.buttonNone,{click:function(){this.none()}}),this._update(),this._on(this.select,{change:function(){this._update()}})},_update:function(){var e=this.select.find("option"),t=e.length,i=e.filter(":selected").length,n=this.select.prop("multiple")?0===i:""===this.select.val();this.buttonAll.prop("disabled",i===t),this.buttonNone.prop("disabled",n)},all:function(){this.select.find("option").prop("selected",!0).trigger("change")},none:function(){this.select.val(null).trigger("change")}})}(),function(e,t){"use strict";e.widget("bolt.buicStack",{_addPath:function(e,i){t.stack.addToStack(i.path)},_create:function(){var e=this,i=this.element;this._ui={holder:i.find(".stackholder")},e._on({buicbrowserselected:e._addPath,buicuploaduploaded:e._addPath}),i.on("inserted.bs.popover",".stackitem",function(){t.app.initWidgets()}),i.buicUpload()},prepend:function(t,i){i&&this._ui.holder.find("[data-file]").each(function(){e(this).data("file").fullPath===i&&e(this).remove()}),this._ui.holder.find(".empty").remove(),this._ui.holder.prepend(t),this._ui.holder.find(".info-pop").popover({trigger:"hover",delay:{show:500,hide:200}})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.buicUpload",{_create:function(){var i=this.element,n=e("input[type=file]",i),a=e(".elm-dropzone",i),o=e(n).attr("accept"),s=o?o.replace(/^\\./,"").split(/,\\./):[],l=new RegExp("(\\\\.|\\\\/)("+s.join("|")+")$","i");if(null===this.options.maxSize){var r=Math.floor(t.conf("uploadConfig.maxSize"));this.options.maxSize=t.utils.filterInt(r,2e6)}this._ui={progress:null},n.fileupload({dataType:"json",dropZone:a,pasteZone:null,maxFileSize:this.options.maxSize>0?this.options.maxSize:void 0,minFileSize:void 0,acceptFileTypes:o?l:void 0,maxNumberOfFiles:void 0,messages:{maxFileSize:">:"+t.utils.humanBytes(this.options.maxSize),minFileSize:"<",acceptFileTypes:"T:."+s.join(", ."),maxNumberOfFiles:"#"}}),this._on({fileuploadprocessfail:this._onProcessFail,fileuploadsubmit:this._onUploadSubmit,fileuploadprogress:this._onUploadProgress,fileuploadalways:this._onUploadAlways,fileuploaddone:this._onUploadDone})},_onProcessFail:function(e,i){var n,a=i.files[i.index],o=a.error.substr(0,1),s={"%FILENAME%":a.name,"%FILESIZE%":t.utils.humanBytes(a.size),"%FILETYPE%":a.type,"%ALLOWED%":a.error.substr(2)};switch(o){case">":n=t.data("field.uploads.template.large-file",s);break;case"T":n=t.data("field.uploads.template.wrong-type",s);break;default:n="<p>"+a.error+"</p>"}bootbox.alert(n)},_onUploadSubmit:function(e,t){this._progress("add",t.files)},_onUploadProgress:function(e,t){this._progress("set",t.files,t.loaded/t.total)},_onUploadAlways:function(e,t){this._progress("remove",t.files)},_onUploadDone:function(i,n){var a=this;e.each(n.result,function(e,n){n.error?bootbox.alert(t.data("field.uploads.template.error",{"%ERROR%":n.error})):a._trigger("uploaded",i,n)})},_progress:function(t,i,n){var a=this;null===a._ui.progress&&(a._ui.progress=e(":bolt-buicProgress",a.element)),e.each(i,function(){a._ui.progress.buicProgress(t,this.name,n)})},options:{maxSize:null}})}(jQuery,Bolt),function(e,t,i){"use strict";e.widget("bolt.fieldBlock",e.bolt.baseField,{options:{name:""},_create:function(){var t=this;this._ui={add:t.element.find(".block-add .add-button"),slot:t.element.find(".block-slot")},this._templates=t.element.find(\'script[type="text/template"]\'),t._ui.add.on("click",function(e){t._append(e)}),t.element.on("click",".delete-button",function(){e(this).closest(".block-group").remove(),t._renumber()}),t.element.on("click",".move-up",function(){var i=e(this).closest(".block-group");i.insertBefore(i.prev(".block-group")),t._renumber(),t._resetEditors(i)}),t.element.on("click",".move-down",function(){var i=e(this).closest(".block-group");i.insertAfter(i.next(".block-group")),t._renumber(),t._resetEditors(i)})},_append:function(i){var n,a=this,o=e(i.target).data("block-type");e.each(a._templates,function(t,i){e(i).data("block-type")===o&&(n=e(i).html())});var s=this._clone(n);s.data("block-type",o),this._ui.slot.append(s),this._renumber(),t.datetime.init(),t.ckeditor.init(),init.popOvers()},_clone:function(i){var n=e(i).clone();return n.find("[id]").each(function(){var i=e(this).attr("id"),a=t.app.buid();e(this).attr("id",a),n.find(\'[for="\'+i+\'"]\').each(function(){e(this).attr("for",a)})}),t.app.initWidgets(n),n},_renumber:function(){var t=new RegExp("^([^\\\\[]+\\\\[)([#|\\\\d]+)(\\\\].*)$","gi");this._ui.slot.find("div.block-group").each(function(i,n){e(n).find("[name]").each(function(){this.name=this.name.replace(t,"$1"+i+"$3")}),e(n).is(":first-of-type")?e(n).find(".move-up").addClass("disabled"):e(n).find(".move-up").removeClass("disabled"),e(n).is(":last-of-type")?e(n).find(".move-down").addClass("disabled"):e(n).find(".move-down").removeClass("disabled")})},_resetEditors:function(e){e.find(".ckeditor").each(function(e,t){i.instances[t.id]&&i.instances[t.id].destroy(),i.replace(t.id)})}})}(jQuery,Bolt,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";e.widget("bolt.fieldCategories",e.bolt.baseField,{_create:function(){this.element.find("select").select2({width:"100%",allowClear:!0,placeholder:{id:"",text:t.data("field.categories.text.placeholder")}})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldFile",e.bolt.baseField,{_create:function(){var t=this,i=this.element,n=e("input.path",i);n.data("selected",{path:n.val()}),n.autocomplete({source:i.find("[data-autocomplete-url]").data("autocompleteUrl"),minLength:2,focus:function(e,i){return t._onPreview(e,i.item),!1},select:function(e,i){return t._onSelect(e,i.item),!1},close:function(){t._onClose()}}).autocomplete("instance")._renderItem=function(t,i){return e("<li>").append(i.path).appendTo(t)},n.on("change",function(){e(this).data("changeWithoutSelection",!0)}),n.on("blur",function(){e(this).data("changeWithoutSelection")&&(""===e(this).val()?t._onClear():t._onClose())}),t._on({"click.select-from-stack a":t._onSelectFromStack,buicbrowserselected:t._onSelect,buicuploaduploaded:t._onSelect}),i.buicUpload()},_onPreview:function(t,i){e("input.path",this.element).val(i.path)},_onSelectFromStack:function(t){var i=e(t.target),n=i.parent("[data-file]");i.closest(".btn-group").removeClass("open"),this._onSelect(t,n.data("file")),t.preventDefault()},_onSelect:function(i,n){e("input.path",this.element).data("changeWithoutSelection",!1).data("selected",n).val(n.path).trigger("change"),"click"!==i.type&&t.stack.addToStack(n.path)},_onClose:function(){var t=e("input.path",this.element);t.val(t.data("selected").path)},_onClear:function(){var t=e("input.path",this.element);t.val(""),t.data("selected",{})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldFilelist",e.bolt.baseField,{_create:function(){var t=this,i=this.element;this._ui={data:i.find("textarea"),list:i.find(".list")},this._lastClickIndex=0,t.options.isImage=this.options.isImage||!1,t._ui.list.sortable({helper:function(t,i){return i.addClass("selected"),e("<div/>")},start:function(t,n){var a=e(".selected",i).not(".ui-sortable-placeholder"),o=a.length,s=n.placeholder,l=s.outerHeight(!0),r=s.height(),d=parseInt(s.css("margin-top"))+parseInt(s.css("margin-bottom"));a.hide(),s.height(r+(o-1)*l-d),n.item.data("items",a)},beforeStop:function(e,t){t.item.before(t.item.data("items"))},stop:function(){e(".selected",i).show(),t._serialize()},axis:"y",delay:100,distance:5}),t._on(t._ui.list,{"click.item":t._onSelect,"click.remove":t._onRemove,"change input":t._serialize}),e("input.title",t._ui.list).on("keyup",t._updateTitle),t._on({"click.select-from-stack a":t._onSelectFromStack,buicbrowserselected:t._onAddPath,buicuploaduploaded:t._onAddPath}),i.buicUpload()},_onAddPath:function(t,i){e(">p",this._ui.list).remove(),this._ui.list.append(e(Bolt.data(this.options.isImage?"field.imagelist.template.item":"field.filelist.template.item",{"%TITLE_A%":i.path.replace(/\\.[a-z0-9]+$/,""),"%FILEPATH_E%":e("<div>").text(i.path).html(),"%FILEPATH_A%":i.path,"%EXT_E%":i.extension.toUpperCase(),"%PREVIEW_A%":i.previewListUrl,"%URL_A%":i.url}))),this._serialize()},_onRemove:function(i){var n=e(i.target).closest(".item"),a=n.hasClass("selected")?e(".selected",this._ui.list):n,o=this.options.isImage?"field.imagelist.message.remove":"field.filelist.message.remove",s=this.options.isImage?"field.imagelist.message.removeMulti":"field.filelist.message.removeMulti";a.addClass("zombie"),confirm(t.data(a.length>1?s:o))?(e(i.target).closest(".item").remove(),this._serialize()):a.removeClass("zombie"),i.preventDefault(),i.stopPropagation()},_onSelect:function(t){var i=e(t.target);if(i.hasClass("item"))if(t.shiftKey){var n=Math.min(this._lastClickIndex,i.index()),a=Math.max(this._lastClickIndex,i.index());this._ui.list.children().each(function(t,i){e(i).toggleClass("selected",t>=n&&t<=a)})}else if(t.ctrlKey||t.metaKey)i.toggleClass("selected"),this._lastClickIndex=i.index();else{var o=this._ui.list.children(".selected").not(i);o.removeClass("selected"),i.toggleClass("selected",o.length>0||null),this._lastClickIndex=i.index()}},_onSelectFromStack:function(t){var i=e(t.target),n=i.closest("[data-file]");i.closest(".btn-group").removeClass("open"),this._onAddPath(t,n.data("file")),t.preventDefault()},_serialize:function(){var i=this.options.isImage?"field.imagelist.template.empty":"field.filelist.template.empty",n=[];e(".item",this._ui.list).each(function(){n.push({filename:e("input.filename",this).val(),title:e("input.title",this).val()})}),this._ui.data.val(JSON.stringify(n)),0===n.length&&this._ui.list.html(t.data(i))},_updateTitle:function(t){var i=e(t.target).closest(".item");e("a",i).attr("title",e(".title",i).val())}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldGeolocation",e.bolt.baseField,{options:{latitude:"",longitude:""},_create:function(){var e=this,i=e.element;this._ui={address:i.find(".address"),matched:i.find(".matched"),mapholder:i.find(".mapholder"),spinner:i.find(".mapholder i"),latitude:i.find(".latitude"),longitude:i.find(".longitude"),snap:i.find(".snap")},this._map=null,this._marker=null,this._timeout=0,e._on({"click.expand":e._onExpand,"click.compress":e._onExpand});var n=function(){t.events.off("Bolt.GoogleMapsAPI.Load.Done",n),e._initGoogleMap(e.options.latitude,e.options.longitude)};t.events.on("Bolt.GoogleMapsAPI.Load.Done",n),t.events.on("Bolt.GoogleMapsAPI.Load.Fail",function(){e._ui.spinner.removeClass("fa-spinner fa-spin").addClass("fa-refresh").one("click",function(){e._ui.spinner.removeClass("fa-refresh").addClass("fa-spinner fa-spin"),t.events.fire("Bolt.GoogleMapsAPI.Load.Request")})}),t.events.fire("Bolt.GoogleMapsAPI.Load.Request")},_geoCode:function(e){var t=this;e&&(new google.maps.Geocoder).geocode(e,function(i,n){if(n===google.maps.GeocoderStatus.OK){var a;a=e.latLng&&!t._ui.snap.is(":checked")?e.latLng:i[0].geometry.location,t._display(i[0].formatted_address,a.lat(),a.lng()),t._marker.setPosition(a),t._map.setCenter(a)}}),t._display()},_display:function(e,t,i){this._ui.matched.val(e||""),this._ui.latitude.val(t||""),this._ui.longitude.val(i||"")},_initGoogleMap:function(i,n){var a=this,o={zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,center:new google.maps.LatLng(i,n),streetViewControl:!1};a._map=new google.maps.Map(a._ui.mapholder[0],o),a._marker=new google.maps.Marker({map:a._map,position:o.center,title:t.data("field.geolocation.marker"),draggable:!0,animation:google.maps.Animation.DROP,icon:a.element.data("pin-icon")}),google.maps.event.addListener(a._marker,"mouseup",function(){a._geoCode({latLng:a._marker.getPosition()})}),a._ui.address.on("propertychange input",function(){clearTimeout(a._timeout),a._timeout=setTimeout(function(){var e=a._ui.address.val();a._geoCode(e.length>2?{address:e}:void 0)},800)}),e(\'a[data-toggle="tab"]\').on("shown.bs.tab",function(){a._ui.mapholder.closest("div.tab-pane").hasClass("active")&&google.maps.event.trigger(a._map,"resize")})},_onExpand:function(){var e=this._marker.getPosition();this._ui.mapholder.parent().toggleClass("expanded"),google.maps.event.trigger(this._map,"resize"),this._map.setCenter(e)}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldHtml",e.bolt.baseField,{_create:function(){t.ckeditor.add(this.element.find(".ckeditor")[0])}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.fieldImage",e.bolt.fieldFile,{_create:function(){this._super(),e("input.path",this.element).data("selected").previewUrl=this.element.find("img").attr("src")},_onPreview:function(e,t){this._super(e,t),this.element.find("img").attr("src",t.previewUrl)},_onSelect:function(e,t){this._super(e,t),this.element.find("img").attr("src",t.previewUrl)},_onClose:function(){this._super();var t=e("input.path",this.element);this.element.find("img").attr("src",t.data("selected").previewUrl)},_onClear:function(){this._super();var e=this.element.find("img");e.attr("src",e.data("defaultUrl"))}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldImagelist",e.bolt.fieldFilelist,{_create:function(){this.options.isImage=!0,this._super()}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldMarkdown",e.bolt.baseField,{_create:function(){t.$("textarea[data-uk-htmleditor]",this.element).each(function(){var e=t.$(this);e.data("htmleditor")||t.htmleditor(e,t.Utils.options(e.attr("data-uk-htmleditor")))})}})}(jQuery,"undefined"!=typeof UIkit?UIkit:void 0),function(e){"use strict";e.widget("bolt.fieldMeta",e.bolt.baseField,{_create:function(){var e=this.element.find("#statusselect"),t=this.element.find("#ownerid");e.select2({width:"50%",minimumResultsForSearch:1/0}),t.select2({width:"50%",minimumResultsForSearch:1/0})}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldRelationship",e.bolt.baseField,{_create:function(){this.element.find("select").select2({width:"100%",placeholder:{id:"",text:t.data("field.relationship.text.placeholder")},allowClear:!0,templateSelection:function(t){var i=e(t.element).parent().attr("label");return(i?i+": ":"")+t.text}})}})}(jQuery,Bolt),function(e,t,i){"use strict";e.widget("bolt.fieldRepeater",e.bolt.baseField,{options:{minimum:1,maximum:1,name:""},_create:function(){var t=this;for(this._ui={add:t.element.find(".add-button"),slot:t.element.find(".repeater-slot")},this._template=e(t.element.find(\'script[type="text/template"]\').html()),this._count=t._ui.slot.find("div.repeater-group").length,0===t.options.maximum&&(t.options.maximum=1/0),t._setCount(),t._ui.add.on("click",function(){t._append()}),t.element.on("click",".duplicate-button",function(){var i=e(this).closest(".repeater-group"),n=t._clone(t._template);e(i).find(":input").each(function(t){var i=e(this).val();i&&e(n).find(":input").eq(t).val(i)}),i.after(n),t._setCount(1),t._renumber()}),t.element.on("click",".delete-button",function(){e(this).closest(".repeater-group").remove(),t._setCount(-1),t._renumber()}),t.element.on("click",".move-up",function(){var i=e(this).closest(".repeater-group");i.insertBefore(i.prev(".repeater-group")),t._renumber(),t._resetEditors(i)}),t.element.on("click",".move-down",function(){var i=e(this).closest(".repeater-group");i.insertAfter(i.next(".repeater-group")),t._renumber(),t._resetEditors(i)});t._count<t.options.minimum;)t._append()},_append:function(){var e=this._clone(this._template);this._ui.slot.append(e),this._setCount(1),this._renumber(),t.datetime.init(),t.ckeditor.init(),init.popOvers()},_clone:function(i){var n=e(i).clone();return n.find("[id]").each(function(){var i=e(this).attr("id"),a=t.app.buid();e(this).attr("id",a),n.find(\'[for="\'+i+\'"]\').each(function(){e(this).attr("for",a)})}),t.app.initWidgets(n),n},_renumber:function(){var t=this.options.name,i=t.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&"),n=new RegExp("^"+i+"\\\\[(#|\\\\d+)\\\\]");this._ui.slot.find("div.repeater-group").each(function(i,a){e(a).find("[name]").each(function(){this.name=this.name.replace(n,t+"["+i+"]")}),e(a).is(":first-of-type")?e(a).find(".move-up").addClass("disabled"):e(a).find(".move-up").removeClass("disabled"),e(a).is(":last-of-type")?e(a).find(".move-down").addClass("disabled"):e(a).find(".move-down").removeClass("disabled")})},_resetEditors:function(e){e.find(".ckeditor").each(function(e,t){i.instances[t.id]&&i.instances[t.id].destroy(),i.replace(t.id)})},_setCount:function(e){this._count+=e||0,this._count>=this.options.maximum?(this._ui.add.addClass("disabled"),this._ui.add.prop("disabled","disabled"),this.element.find(".duplicate-button").addClass("disabled"),this.element.find(".duplicate-button").prop("disabled","disabled")):(this._ui.add.removeClass("disabled"),this._ui.add.prop("disabled",!1),this.element.find(".duplicate-button").removeClass("disabled"),this.element.find(".duplicate-button").prop("disabled",!1)),this._count<=this.options.minimum?(this.element.find(".delete-button").addClass("disabled"),this.element.find(".delete-button").prop("disabled","disabled")):(this.element.find(".delete-button").removeClass("disabled"),this.element.find(".delete-button").prop("disabled",!1))}})}(jQuery,Bolt,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";e.widget("bolt.fieldSelect",e.bolt.baseField,{options:{autocomplete:!1},_create:function(){var e=this.element.find("select"),i={width:"100%",placeholder:{id:"",text:t.data("field.select.text.placeholder")},allowClear:!0,minimumResultsForSearch:this.options.autocomplete?0:1/0};this.options.sortable?e.select2Sortable(i):e.select2(i)}})}(jQuery,Bolt),function(e){"use strict";var t={lock:1,link:2,edit:3};e.widget("bolt.fieldSlug",e.bolt.baseField,{options:{contentId:null,key:"",slug:"",uses:[]},_create:function(){var i=this,n=this.element;this._ui={form:this.element.closest("form"),group:n.find(".input-group"),data:n.find("input"),uses:e()},e("[name]",i._ui.form).each(function(){i.options.uses.indexOf(this.name.replace(/\\[\\]$/,""))>=0&&(i._ui.uses=i._ui.uses.add(e(this)))}),this._timeout=0,this._mode=t.lock,this._ui.group.hasClass("linked")?this._setMode(t.link):this._ui.group.hasClass("editable")&&(this._mode=t.edit),this._on({"click li.lock":function(e){e.preventDefault(),this._setMode(t.lock)},"click li.link":function(e){e.preventDefault(),this._setMode(t.link)},"click li.edit":function(e){e.preventDefault(),this._setMode(t.edit),this.element.find("input").focus()},"focusout input":function(){this._mode===t.edit&&this._setMode(t.lock)}})},_destroy:function(){clearTimeout(this._timeout)},_setMode:function(i){var n=i===t.lock,a=i===t.link,o=i===t.edit;e("li.lock",this.element).toggleClass("disabled",n),e("li.link",this.element).toggleClass("disabled",a),e("li.edit",this.element).toggleClass("disabled",o),this._ui.group.toggleClass("locked",n).toggleClass("linked",a).toggleClass("edititable",o),e(".warning",this.element).toggleClass("hidden",!o),this._ui.data.prop("readonly",!o),a?(this._buildSlug(),this._on(this._ui.uses,{change:function(){this._buildSlug()},input:function(){this._buildSlug()}})):this._timeout>0&&(clearTimeout(this._timeout),this._timeout=0,this._off(this._ui.uses,"change"),this._off(this._ui.uses,"input")),this._mode=i},_buildSlug:function(){var t,i=this,n="";e.each(i.options.uses,function(i,a){(t=e("#"+a).val())&&(n+=("object"==typeof t?t.join(" "):t)+" ")}),clearTimeout(i._timeout),i._timeout=setTimeout(function(){i._getUri(n.trim())},200)},_getUri:function(i){var n=this,a={title:i,contenttypeslug:n.options.slug,id:n.options.contentId,slugfield:n.options.key,fulluri:!1};n._ui.group.addClass("loading"),e.get(n._ui.data.data("createSlugUrl"),a).done(function(e){n._mode===t.link&&n._ui.data.val(e)}).fail(function(){console.error("Failed to get URI for "+n.options.slug+"/"+n.options.contentId)}).always(function(){n._ui.group.removeClass("loading")})}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldTags",e.bolt.baseField,{options:{allowSpaces:!1},_create:function(){var t=this.element.find("select"),i=this.element.find(".tagcloud"),n=[","],a={};this.options.allowSpaces||n.push(" "),t.select2({width:"100%",tags:a,minimumInputLength:1,tokenSeparators:n}),e.ajax({url:this.element.data("tagsUrl"),dataType:"json",success:function(i){for(var n=t.val()||[],a=i.length,o="",s=0;s<a;s++)n.indexOf(i[s].name)<0&&(n.push(i[s].name),o+=\'<option value="\'+i[s].name+\'">\'+i[s].name+"</option>");t.append(e(o)).trigger("change")}}),i&&e.ajax({url:this.element.data("popularTagsUrl"),dataType:"json",data:{limit:40},success:function(n){n.length>0&&(e.each(n,function(t,n){i.append(e("<button/>",{type:"button",text:n.name,rel:n.count})).append("")}),i.find("button").on("click",function(){var i=e(this).text(),n=t.find(\'option[value="\'+i+\'"]\');n.length>0?n=n.not(":selected").attr("selected",!0).trigger("change"):t.append(e("<option/>",{value:i,text:i,selected:!0})).trigger("change")}),e.fn.tagcloud.defaults={size:{start:10,end:20,unit:"px"},color:{start:"#888",end:"#194770"}},i.find("button").tagcloud(),i.css("display","block"))}})}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldTemplateselect",e.bolt.baseField,{options:{currentHas:!1,current:"",fieldTemplates:[]},_create:function(){var i=this,n=i.element.find("select"),a=i.element.find("p"),o=a.parent();n.select2({width:"100%",allowClear:!0,placeholder:{id:"",text:t.data("field.templateselect.text.default")},minimumResultsForSearch:1/0}),n.on("change",function(){if(o.addClass("hidden"),a.html("").removeClass("text-danger"),n.val()!==i.options.current)if(i.options.currentHas){a.html(t.data("field.templateselect.template.warning",{"%STATUS%":t.data("field.templateselect.message.status"),"%MESSAGE%":t.data("field.templateselect.message.warning")}));var s=!0;e(\'[name^="templatefields"]\').each(function(){"checkbox"!==e(this).attr("type")&&"SELECT"!==e(this).prop("tagName")&&""!==e(this).val()&&(s=!1),"checkbox"===e(this).attr("type")&&e(this).prop("checked")&&(s=!1)}),s?e("#tabindicator-tab-template").hide():(a.addClass("text-danger"),o.removeClass("hidden"))}else i.options.fieldTemplates.indexOf(n.val())>-1&&(a.html(t.data("field.templateselect.message.change")),o.removeClass("hidden"),e("#tabindicator-tab-template").show())})}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.fieldText",e.bolt.baseField,{_create:function(){}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldTextarea",e.bolt.baseField,{_create:function(){}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldVideo",e.bolt.baseField,{_create:function(){var t=this,i=this.element,n=0;this._ui={url:i.find("input.url"),width:i.find("input.width"),height:i.find("input.height"),html:i.find("input.html"),ratio:i.find("input.ratio"),authorName:i.find("input.authorname"),authorUrl:i.find("input.authorurl"),title:i.find("input.title"),thumbnailUrl:i.find("input.thumbnailurl"),preview:i.find("img"),play:i.find(".imageholder button"),refresh:i.find("button.refresh"),spinner:i.find("button.refresh i")},t._ui.url.on("propertychange input",function(){clearTimeout(n),n=setTimeout(function(){t._update()},1e3)}),t._ui.width.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.height.val(Math.round(t._ui.width.val()/t._ui.ratio.val()))}),t._ui.height.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.width.val(Math.round(t._ui.height.val()*t._ui.ratio.val()))}),t._ui.refresh.on("click",function(){t._update()}),t._ui.play.on("click",function(){e("body").buicModal({size:"large",closer:!0,headline:t._ui.title.val(),body:t._ui.html.val()})})},_update:function(){var i=this,n=t.data("endpoint.embed"),a=e("#id").closest("form").find(\'input[name="content_edit[_token]"]\').val(),o={format:"json",url:i._ui.url.val(),_token:a,provider:"oembed"};o.url.length<2?i._set({}):(this._ui.refresh.prop("disabled",!0),i._ui.spinner.addClass("fa-spin"),e.post(n,o).done(function(e){i._set(e)}).fail(function(){i._set({})}).always(function(){i._ui.spinner.removeClass("fa-spin")}))},_set:function(e){var t=e.thumbnail_url||this._ui.preview.data("defaultUrl");this._ui.html.val(e.html||""),this._ui.width.val(e.width||""),this._ui.height.val(e.height||""),this._ui.ratio.val(e.width&&e.height?e.width/e.height:""),this._ui.authorName.val(e.author_name||""),this._ui.authorUrl.val(e.author_url||""),this._ui.title.val(e.title||""),this._ui.thumbnailUrl.val(e.thumbnail_url||""),this._ui.preview.attr("src",t),e.html?this._ui.play.removeClass("hidden"):this._ui.play.addClass("hidden"),this._ui.refresh.prop("disabled",this._ui.url.val().length<=2||this._ui.html.val().length>0)}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.panelActivity",e.bolt.baseInterval,{options:{delay:3e4},_create:function(){this._super()},_update:function(){var i=this;e.get(i.element.data("url")).done(function(n){var a=e(n);t.app.initWidgets(a),i.element.html(a)})}})}(jQuery,Bolt),Bolt.validation=function(){"use strict";function e(e){var t=!0,i=e.value,n=e.getAttribute("type"),a="checkbox"===n||"radio"===n,o=e.getAttribute("required"),s=e.getAttribute("minlength"),l=e.getAttribute("maxlength"),r=e.getAttribute("pattern");return e.disabled?t:(t=t&&(!o||a&&e.checked||!a&&""!==i),(t=t&&(a||(!s||i.length>=s)&&(!l||i.length<=l)))&&r&&(t=(r=new RegExp("^(?:"+r+")$")).test(i)),t)}function t(e,t){$(e).addClass("error"),t&&$("#cke_"+e.id).addClass("cke_error")}function i(e,t){$(e).removeClass("error"),t&&$("#cke_"+e.id).removeClass("cke_error")}function n(e,t,i){var n,a=$(\'label[for="\'+t.id+\'"]\').contents().first().text().trim()||t.name;a=a.replace(/(.*):+$/g,"$1"),n=Bolt.data("validation.alertbox",{"%NOTICE_ID%":e,"%FIELD_ID%":t.id,"%FIELD_NAME%":a,"%MESSAGE%":i||$(t).data("errortext")||Bolt.data("validation.generic_msg")}),$(n).hide().insertAfter(".page-header").slideDown("fast")}function a(e){return""===e||e.match(/^[-+]?[0-9]*[,.]?[0-9]+([eE][-+]?[0-9]+)?$/)?"":Bolt.data("validation.float")}function o(e,t){return!0===t&&""===e?Bolt.data("validation.required"):""}function s(e,t){return""!==e&&Number(e.replace(",","."))<t?Bolt.data("validation.min",{"%MINVAL%":t}):""}function l(e,t){return""!==e&&Number(e.replace(",","."))>t?Bolt.data("validation.max",{"%MAXVAL%":t}):""}function r(e,t){void 0!==e.willValidate?e.setCustomValidity(t):e.validity.valid=""===t}function d(d){var c,u,f,p=void 0!==d.willValidate,h=d.value,m="",v=$(d).data("validate");if(v){for(u in v)if(v.hasOwnProperty(u)){switch(f=v[u],u){case"float":m=a(h);break;case"required":m=o(h,f);break;case"min":m=s(h,f);break;case"max":m=l(h,f);break;default:console.error("UNKNOWN VALIDATION"+u+" -> "+f)}if(m)break}r(d,m)}else if(p?("INPUT"===d.nodeName&&d.type!==d.getAttribute("type")&&d.setCustomValidity(e(d)?"":"error"),d.checkValidity()):(d.validity=d.validity||{},d.validity.valid=e(d)),c="TEXTAREA"===d.nodeName&&$(d).hasClass("ckeditor")){var g=CKEDITOR.instances[d.id];g&&r(d,!0===g._.required&&""===g.getData().trim()?"Required":"")}var b="notice--"+d.id;return $("#"+b).remove(),d.validity.valid?(i(d,c),!0):(t(d,c),n(b,d,m),!1)}return{run:function(e){var t,i,n=e.elements.length,a=!0;for(t=0;t<n;t++)"INPUT"!==(i=e.elements[t]).nodeName&&"TEXTAREA"!==i.nodeName&&"SELECT"!==i.nodeName||("INPUT"===i.nodeName&&(i.value=i.value.trim()),!1===d(i)&&(a=!1));return a}}}();\n\\ No newline at end of file\ndiff --git a/app/view/twig/dashboard/_recently_edited.twig b/app/view/twig/dashboard/_recently_edited.twig\nindex 7212c1ac6..a41cd86d4 100644\n--- a/app/view/twig/dashboard/_recently_edited.twig\n+++ b/app/view/twig/dashboard/_recently_edited.twig\n@@ -17,7 +17,7 @@\n                 \'compact\':       true,\n                 \'content\':       content,\n                 \'excerptlength\': 280,\n-                \'permissions\':   context.permissions[contenttype.slug],\n+                \'permissions\':   context.permissions[contenttype_key],\n                 \'thumbsize\':     54,\n             } %}\n             {{ include([\'@bolt/custom/listing/\' ~ content.contenttype.slug ~ \'.twig\', \'@bolt/_sub/_listing.twig\'],  listing_vars) }}\ndiff --git a/app/view/twig/dashboard/dashboard.twig b/app/view/twig/dashboard/dashboard.twig\nindex 0f7eacf32..648f1d3ef 100644\n--- a/app/view/twig/dashboard/dashboard.twig\n+++ b/app/view/twig/dashboard/dashboard.twig\n@@ -30,9 +30,9 @@\n                 {% endif %}\n             </div>\n \n-            {% for contenttype, multiplecontent in context.latest %}\n+            {% for contenttype_key, multiplecontent in context.latest %}\n                 {% if multiplecontent %}\n-                    {% set contenttype = config.get(\'contenttypes/\' ~ contenttype) %}\n+                    {% set contenttype = config.get(\'contenttypes/\' ~ contenttype_key) %}\n                     {{ include(\'@bolt/dashboard/_recently_edited.twig\') }}\n                 {% endif %}\n             {% endfor %}\ndiff --git a/app/view/twig/editcontent/_aside-save.twig b/app/view/twig/editcontent/_aside-save.twig\nindex 9ed4ac963..bcabb3106 100644\n--- a/app/view/twig/editcontent/_aside-save.twig\n+++ b/app/view/twig/editcontent/_aside-save.twig\n@@ -11,7 +11,7 @@\n \n     <ul class="dropdown-menu" role="menu">\n         <li>\n-            <button type="submit" class="btn btn-link" id="save_return">\n+            <button type="submit" class="btn btn-link" id="sidebar_save_return">\n                 <i class="fa fa-fw fa-flag"></i> {{ __(\'general.phrase.save-and-return-overview\') }}\n             </button>\n         </li>\ndiff --git a/app/view/twig/editcontent/_relations.twig b/app/view/twig/editcontent/_relations.twig\nindex 01c116b70..baa5b8148 100644\n--- a/app/view/twig/editcontent/_relations.twig\n+++ b/app/view/twig/editcontent/_relations.twig\n@@ -28,10 +28,10 @@\n                     \'excerptlength\': 280,\n                     \'permissions\':   {\n                         \'edit\':      isallowed(\'edit\', record),\n-                        \'create\':    isallowed(\'create\', record),\n-                        \'publish\':   isallowed(\'publish\', record),\n-                        \'delete\':    isallowed(\'delete\', record),\n-                        \'depublish\': isallowed(\'depublish\', record)\n+                        \'create\':    false,\n+                        \'publish\':   false,\n+                        \'delete\':    false,\n+                        \'depublish\': false\n                     },\n                     \'thumbsize\':     54,\n                 } %}\ndiff --git a/app/view/twig/editcontent/fields/_block-group.twig b/app/view/twig/editcontent/fields/_block-group.twig\nindex 20d0b5896..34232f6c1 100644\n--- a/app/view/twig/editcontent/fields/_block-group.twig\n+++ b/app/view/twig/editcontent/fields/_block-group.twig\n@@ -1,10 +1,10 @@\n <div class="repeater-group block-group row panel panel-default">\n     <div class="panel-heading">\n         <div class="row">\n-            <div class="col-xs-3">\n+            <div class="col-xs-5">\n                 <label class="main">{{ field.fields[block].label }}</label>\n             </div>\n-            <div class="col-xs-9 text-right">\n+            <div class="col-xs-7 text-right">\n                 <div class="btn-group">\n                     <button type="button" class="btn btn-sm btn-default move-up">\n                         <i class="fa fa-arrow-up"></i> {{ __(\'general.phrase.move-up\') }}\ndiff --git a/app/view/twig/exception/_request.twig b/app/view/twig/exception/_request.twig\nindex 38d135fb3..b9cdf8d19 100644\n--- a/app/view/twig/exception/_request.twig\n+++ b/app/view/twig/exception/_request.twig\n@@ -39,7 +39,7 @@\n         {% endfor %}\n     </table>\n \n-    {% for bag in bags %}\n+    {% for bag in bags if attribute(request_data, bag)|default(false) %}\n         <h2>{{ bag|capitalize }}</h2>\n \n         <table class="table table-striped table-hover table-condensed">\ndiff --git a/changelog.md b/changelog.md\nindex 7b8b2cbb3..e0ad10ae8 100644\n--- a/changelog.md\n+++ b/changelog.md\n@@ -6,6 +6,22 @@ Bolt 3.5-dev\n \n -\n \n+Bolt 3.4 beta 6\n+---------------\n+\n+Released: 2017-11-03. Notable changes:\n+\n+ - Cleanup: CS clean-up [#7143](https://github.com/bolt/bolt/pull/7143)\n+ - Cleanup: More Twig namespaces [#7134](https://github.com/bolt/bolt/pull/7134)\n+ - Cleanup: Updating a few dutch labels and a column width for Block type. [#7142](https://github.com/bolt/bolt/pull/7142)\n+ - Fixed: Ensure hyphens in urls are replaced with underscores before going into the Query Engine [#7140](https://github.com/bolt/bolt/pull/7140)\n+ - Fixed: Fix grouping support in backend overview. [#7131](https://github.com/bolt/bolt/pull/7131)\n+ - Fixed: Fix taxonomy grouping queries with commas. [#7130](https://github.com/bolt/bolt/pull/7130)\n+ - Fixed: Make the `type: blocks` field work with `{{ block() }}`. [#8](https://github.com/bolt/themes/pull/8)\n+ - Fixed: Move build logic out of loop, and account for first ContentType being a singleton in menu. [#7135](https://github.com/bolt/bolt/pull/7135)\n+ - Fixed: On Dashboard listings, use \'key\' instead of \'slug\' [#7141](https://github.com/bolt/bolt/pull/7141)\n+ - Fixed: Remove permissions in incoming relationships. [#7144](https://github.com/bolt/bolt/pull/7144)\n+\n Bolt 3.4 beta 5\n ---------------\n \ndiff --git a/composer.json b/composer.json\nindex 7b0117b65..3d5d960b0 100644\n--- a/composer.json\n+++ b/composer.json\n@@ -74,7 +74,7 @@\n         "symfony/web-profiler-bundle": "^2.8",\n         "symfony/yaml": "^2.8",\n         "tdammers/htmlmaid": "~0.7",\n-        "twig/twig": "^1.34.2",\n+        "twig/twig": "^1.35",\n         "ua-parser/uap-php": "^3.4"\n     },\n     "require-dev": {\ndiff --git a/src/Composer/Script/BundleConfigurator.php b/src/Composer/Script/BundleConfigurator.php\nindex 7d9d00772..5a90271f8 100644\n--- a/src/Composer/Script/BundleConfigurator.php\n+++ b/src/Composer/Script/BundleConfigurator.php\n@@ -2,10 +2,10 @@\n \n namespace Bolt\\Composer\\Script;\n \n-use Bolt\\Bundle\\Site\\SiteBundleLoader;\n use Bolt\\Collection\\MutableBag;\n use Bolt\\Nut\\Output\\NutStyleInterface;\n use Bolt\\Nut\\Style\\NutStyle;\n+use Bundle\\Site\\CustomisationExtension;\n use Composer\\Script\\Event;\n use Symfony\\Component\\Filesystem\\Exception\\IOException;\n use Symfony\\Component\\Filesystem\\Filesystem;\n@@ -60,7 +60,7 @@ final class BundleConfigurator\n      */\n     public function run()\n     {\n-        if (!class_exists(SiteBundleLoader::class)) {\n+        if (!class_exists(CustomisationExtension::class)) {\n             return;\n         }\n         $contents = $this->load();\n@@ -114,13 +114,13 @@ final class BundleConfigurator\n \n         $extensions = MutableBag::from($contents->get(\'extensions\', []));\n         foreach ($extensions as $extension) {\n-            if (is_a($extension, SiteBundleLoader::class, true)) {\n+            if (is_a($extension, CustomisationExtension::class, true)) {\n                 // If there is already a valid entry, exit\n                 return;\n             }\n         }\n         // Add the extension to the bag\n-        $extensions->add(SiteBundleLoader::class);\n+        $extensions->add(CustomisationExtension::class);\n         $contents->set(\'extensions\', $extensions);\n     }\n }\ndiff --git a/src/Controller/Backend/Authentication.php b/src/Controller/Backend/Authentication.php\nindex 53cb9215c..415697874 100644\n--- a/src/Controller/Backend/Authentication.php\n+++ b/src/Controller/Backend/Authentication.php\n@@ -94,7 +94,7 @@ class Authentication extends BackendBase\n         }\n         $context = [\n             \'form\'        => $form->createView(),\n-            \'randomquote\' => true\n+            \'randomquote\' => true,\n         ];\n \n         return $this->render(\'@bolt/login/login.twig\', $context);\ndiff --git a/src/Controller/Backend/FileManager.php b/src/Controller/Backend/FileManager.php\nindex e8184d401..309d49186 100644\n--- a/src/Controller/Backend/FileManager.php\n+++ b/src/Controller/Backend/FileManager.php\n@@ -379,6 +379,7 @@ class FileManager extends BackendBase\n             default:\n                 $plugins = [];\n         }\n+\n         return array_merge($plugins, [\'fold/foldcode\', \'fold/foldgutter\', \'fold/indent-fold\']);\n     }\n }\ndiff --git a/src/Controller/Backend/Records.php b/src/Controller/Backend/Records.php\nindex e4e90526f..f1e94e1cf 100644\n--- a/src/Controller/Backend/Records.php\n+++ b/src/Controller/Backend/Records.php\n@@ -147,7 +147,7 @@ class Records extends BackendBase\n             return \'test\';\n         }\n         if ($name === \'save\') {\n-            return $isAjax ? \'ajax\': $name;\n+            return $isAjax ? \'ajax\' : $name;\n         }\n \n         return $name;\n@@ -183,6 +183,7 @@ class Records extends BackendBase\n             ->setPage($request->query->get(\'page_\' . $contenttypeslug))\n             ->setFilter($request->query->get(\'filter\'))\n             ->setTaxonomies($taxonomy)\n+            ->setGroupSort(true)\n         ;\n \n         $context = [\ndiff --git a/src/EventListener/NotFoundListener.php b/src/EventListener/NotFoundListener.php\nindex 6d256a338..554b5834d 100644\n--- a/src/EventListener/NotFoundListener.php\n+++ b/src/EventListener/NotFoundListener.php\n@@ -38,7 +38,7 @@ class NotFoundListener implements EventSubscriberInterface\n      * @param string          $notFoundPage\n      * @param Storage         $storage\n      * @param TemplateChooser $templateChooser\n-     * @param Environment $twig\n+     * @param Environment     $twig\n      */\n     public function __construct($notFoundPage, Storage $storage, TemplateChooser $templateChooser, Environment $twig)\n     {\n@@ -55,13 +55,18 @@ class NotFoundListener implements EventSubscriberInterface\n      */\n     public function onKernelException(GetResponseForExceptionEvent $event)\n     {\n+        $request = $event->getRequest();\n         $exception = $event->getException();\n-        if (!$exception instanceof HttpExceptionInterface || Zone::isBackend($event->getRequest())) {\n+        if (!$exception instanceof HttpExceptionInterface || Zone::isBackend($request)) {\n             return;\n         }\n         if ($exception->getStatusCode() !== Response::HTTP_NOT_FOUND) {\n             return;\n         }\n+        // If no zone is set, assume front-end as SELECT queries can leak unpublished records\n+        if (Zone::get($request) === null) {\n+            Zone::set($request, Zone::FRONTEND);\n+        }\n \n         try {\n             $this->renderNotFound($event, $this->notFoundPage);\ndiff --git a/src/Form/FormType/ContentEditType.php b/src/Form/FormType/ContentEditType.php\nindex fc52710b1..21ad3f61d 100644\n--- a/src/Form/FormType/ContentEditType.php\n+++ b/src/Form/FormType/ContentEditType.php\n@@ -26,7 +26,7 @@ class ContentEditType extends AbstractType\n                 \'save\',\n                 SubmitType::class,\n                 [\n-                    \'label\' => Trans::__(\'contenttypes.generic.save\', [\'%contenttype%\' => $options[\'contenttype_name\']])\n+                    \'label\' => Trans::__(\'contenttypes.generic.save\', [\'%contenttype%\' => $options[\'contenttype_name\']]),\n                 ]\n             )\n             ->add(\n@@ -63,7 +63,7 @@ class ContentEditType extends AbstractType\n                 [\n                     \'label\' => Trans::__(\'contenttypes.generic.delete\', [\'%contenttype%\' => $options[\'contenttype_name\']]),\n                     \'attr\'  => [\n-                        \'style\' => \'visibility: hidden;\'\n+                        \'style\' => \'visibility: hidden;\',\n                     ],\n                 ]\n             )\ndiff --git a/src/Nut/Init.php b/src/Nut/Init.php\nindex e88e046f9..5dd1b0dfe 100644\n--- a/src/Nut/Init.php\n+++ b/src/Nut/Init.php\n@@ -61,7 +61,7 @@ class Init extends BaseCommand\n             \'.bolt.yml\',\n             \'composer.json\',\n             \'composer.lock\',\n-            \'src/Site/CustomisationExtension.php\'\n+            \'src/Site/CustomisationExtension.php\',\n         ];\n         foreach ($files as $file) {\n             $dist = $fs->getFile($file . \'.dist\');\ndiff --git a/src/Provider/FormServiceProvider.php b/src/Provider/FormServiceProvider.php\nindex 65b78e6bb..0594d1ff1 100644\n--- a/src/Provider/FormServiceProvider.php\n+++ b/src/Provider/FormServiceProvider.php\n@@ -48,10 +48,9 @@ class FormServiceProvider implements ServiceProviderInterface\n         );\n \n         $app[\'validator.validator_service_ids\'] += [\n-            ExistingEntityValidator::class => \'form.validator.existing_entity\'\n+            ExistingEntityValidator::class => \'form.validator.existing_entity\',\n         ];\n \n-\n         $app[\'csrf\'] = $app->share(\n             function ($app) {\n                 return new CsrfTokenManager($app[\'csrf.generator\'], $app[\'csrf.storage\']);\ndiff --git a/src/Provider/PrefillServiceProvider.php b/src/Provider/PrefillServiceProvider.php\nindex c7d614e75..5357f7f25 100644\n--- a/src/Provider/PrefillServiceProvider.php\n+++ b/src/Provider/PrefillServiceProvider.php\n@@ -34,7 +34,7 @@ class PrefillServiceProvider implements ServiceProviderInterface\n             function () {\n                 return new Bag([\n                     \'blocks\' => [\n-                        \'title\' => \'About Us\', \'Address\', \'Search Teaser\', \'404 Not Found\'\n+                        \'title\' => \'About Us\', \'Address\', \'Search Teaser\', \'404 Not Found\',\n                     ],\n                 ]);\n             }\ndiff --git a/src/Provider/ValidatorServiceProvider.php b/src/Provider/ValidatorServiceProvider.php\nindex 4006183e3..052494ab7 100644\n--- a/src/Provider/ValidatorServiceProvider.php\n+++ b/src/Provider/ValidatorServiceProvider.php\n@@ -20,7 +20,6 @@ class ValidatorServiceProvider extends Provider\\ValidatorServiceProvider\n      */\n     public function register(Application $app)\n     {\n-\n         parent::register($app);\n \n         $app[\'validator.mapping.class_metadata_factory\'] = $app->share(function ($app) {\ndiff --git a/src/Storage/Collection/Taxonomy.php b/src/Storage/Collection/Taxonomy.php\nindex 6ea69da38..ff757ad7e 100644\n--- a/src/Storage/Collection/Taxonomy.php\n+++ b/src/Storage/Collection/Taxonomy.php\n@@ -251,4 +251,17 @@ class Taxonomy extends ArrayCollection\n         return $output;\n     }\n \n+    /**\n+     * @return null|string\n+     */\n+    public function getGroupingTaxonomy()\n+    {\n+        foreach ($this->config->getData() as $taxKey => $taxonomy) {\n+            if ($taxonomy[\'behaves_like\'] === \'grouping\') {\n+                return $taxKey;\n+            }\n+        }\n+\n+        return null;\n+    }\n }\ndiff --git a/src/Storage/ContentRequest/Edit.php b/src/Storage/ContentRequest/Edit.php\nindex 436a98fa5..7cbdba4db 100644\n--- a/src/Storage/ContentRequest/Edit.php\n+++ b/src/Storage/ContentRequest/Edit.php\n@@ -428,5 +428,4 @@ class Edit\n \n         return array_keys($fieldtypes);\n     }\n-\n }\ndiff --git a/src/Storage/ContentRequest/Listing.php b/src/Storage/ContentRequest/Listing.php\nindex 315f6c532..0d0e41b1d 100644\n--- a/src/Storage/ContentRequest/Listing.php\n+++ b/src/Storage/ContentRequest/Listing.php\n@@ -29,9 +29,9 @@ class Listing\n      * Constructor.\n      *\n      * @param EntityManager $em\n-     * @param Query $query\n-     * @param Config $config\n-     * @param PagerManager $pager\n+     * @param Query         $query\n+     * @param Config        $config\n+     * @param PagerManager  $pager\n      */\n     public function __construct(EntityManager $em, Query $query, Config $config, PagerManager $pager = null)\n     {\n@@ -99,6 +99,9 @@ class Listing\n             $records = $this->query->getContent($contentTypeSlug, $contentParameters);\n         }\n         $this->runPagerQueries($records);\n+        if ($options->getGroupSort()) {\n+            $records = $this->runGroupSort($records);\n+        }\n \n         return $records;\n     }\n@@ -130,4 +133,34 @@ class Listing\n                 ->setShowingTo($start + $results->count());\n         }\n     }\n+\n+    /**\n+     * @param $results\n+     *\n+     * @return array\n+     */\n+    protected function runGroupSort($results)\n+    {\n+        if (!$results instanceof QueryResultset) {\n+            return $results;\n+        }\n+        $grouped = [];\n+        foreach ($results as $result) {\n+            $taxGroup = null;\n+            foreach ($result->getTaxonomy() as $taxonomy) {\n+                if ($taxonomy->getTaxonomytype() == $result->getTaxonomy()->getGroupingTaxonomy()) {\n+                    $taxGroup = $taxonomy->getSlug();\n+                }\n+            }\n+            if ($taxGroup !== null) {\n+                $grouped[$taxGroup][] = $result;\n+            }\n+        }\n+\n+        if (!count($grouped)) {\n+            return $results;\n+        }\n+\n+        return call_user_func_array(\'array_merge\', $grouped);\n+    }\n }\ndiff --git a/src/Storage/ContentRequest/ListingOptions.php b/src/Storage/ContentRequest/ListingOptions.php\nindex 2d1954c8e..077feb853 100644\n--- a/src/Storage/ContentRequest/ListingOptions.php\n+++ b/src/Storage/ContentRequest/ListingOptions.php\n@@ -17,6 +17,8 @@ class ListingOptions\n     protected $taxonomies;\n     /** @var string */\n     protected $filter;\n+    /** @var bool */\n+    protected $groupSort;\n \n     /**\n      * Set the order.\n@@ -125,4 +127,24 @@ class ListingOptions\n     {\n         return $this->filter;\n     }\n+\n+    /**\n+     * @return mixed\n+     */\n+    public function getGroupSort()\n+    {\n+        return $this->groupSort;\n+    }\n+\n+    /**\n+     * @param mixed $groupSort\n+     *\n+     * @return ListingOptions\n+     */\n+    public function setGroupSort($groupSort)\n+    {\n+        $this->groupSort = $groupSort;\n+\n+        return $this;\n+    }\n }\ndiff --git a/src/Storage/Database/Prefill/Builder.php b/src/Storage/Database/Prefill/Builder.php\nindex 9b5778ce8..b7594bc94 100644\n--- a/src/Storage/Database/Prefill/Builder.php\n+++ b/src/Storage/Database/Prefill/Builder.php\n@@ -57,56 +57,53 @@ class Builder\n             try {\n                 $existingCount = $this->storage->getRepository($contentTypeName)->count();\n             } catch (TableNotFoundException $e) {\n-                $response->setPath(\'errors/\' . $contentTypeName, Trans::__(\n-                    \'page.prefill.database-update-required\',\n-                    [\'%CONTENTTYPE%\' => $contentTypeName]\n-                ));\n+                $msg = Trans::__(\'page.prefill.database-update-required\', [\'%CONTENTTYPE%\' => $contentTypeName]);\n+                $response->setPath(\'errors/\' . $contentTypeName, $msg);\n \n                 continue;\n             }\n \n             // If we\'re over \'max\' and we\'re not skipping "non empty" ContentTypes, show a notice and move on.\n             if ($existingCount >= $this->maxCount && !$canExceedMax) {\n-                $response->setPath(\'warnings/\' . $contentTypeName, Trans::__(\n-                    \'page.prefill.skipped-existing\',\n-                    [\'%key%\' => $contentTypeName]\n-                ));\n+                $msg = Trans::__(\'page.prefill.skipped-existing\', [\'%key%\' => $contentTypeName]);\n+                $response->setPath(\'warnings/\' . $contentTypeName, $msg);\n \n                 continue;\n             }\n \n             // Singletons are always limited to 1 item max.\n             if ($this->contentTypes->getPath($contentTypeName . \'/singleton\')) {\n-                $count = 1;\n                 if ($existingCount > 0) {\n-                    $response->setPath(\'warnings/\' . $contentTypeName, Trans::__(\n-                        \'page.prefill.skipped-singleton\',\n-                        [\'%key%\' => $contentTypeName]\n-                    ));\n-\n-                    continue;\n+                    $msg = Trans::__(\'page.prefill.skipped-singleton\', [\'%key%\' => $contentTypeName]);\n+                    $response->setPath(\'warnings/\' . $contentTypeName, $msg);\n+                } else {\n+                    $this->doBuild($contentTypeName, 1, $response);\n                 }\n-            }\n-\n-            // Take the current amount of items into consideration, when adding more.\n-            $createCount = $canExceedMax ? $count : $count - $existingCount;\n-            if ($createCount < 1) {\n                 continue;\n             }\n \n-            $recordContentGenerator = $this->createRecordContentGenerator($contentTypeName);\n-            try {\n-                $response->setPath(\'created/\' . $contentTypeName, $recordContentGenerator->generate($createCount));\n-            } catch (RequestException $e) {\n-                $response->setPath(\'errors/\' . $contentTypeName, Trans::__(\'page.prefill.connection-timeout\'));\n-\n-                return $response;\n-            }\n+            $createCount = $canExceedMax ? $this->maxCount : $this->maxCount - $existingCount;\n+            $this->doBuild($contentTypeName, $createCount, $response);\n         }\n \n         return $response;\n     }\n \n+    /**\n+     * @param string     $contentTypeName\n+     * @param int        $createCount\n+     * @param MutableBag $response\n+     */\n+    private function doBuild($contentTypeName, $createCount, MutableBag $response)\n+    {\n+        try {\n+            $recordContentGenerator = $this->createRecordContentGenerator($contentTypeName);\n+            $response->setPath(\'created/\' . $contentTypeName, $recordContentGenerator->generate($createCount));\n+        } catch (RequestException $e) {\n+            $response->setPath(\'errors/\' . $contentTypeName, Trans::__(\'page.prefill.connection-timeout\'));\n+        }\n+    }\n+\n     /**\n      * Return the maximum number of records allowed to exists before we stop\n      * generating, or refuse to generate more records,\ndiff --git a/src/Storage/Entity/TemplateFields.php b/src/Storage/Entity/TemplateFields.php\nindex b77943773..938663045 100644\n--- a/src/Storage/Entity/TemplateFields.php\n+++ b/src/Storage/Entity/TemplateFields.php\n@@ -28,8 +28,8 @@ class TemplateFields extends Entity\n         foreach ($fields as $field) {\n             $fieldName = $field[\'fieldname\'];\n             $val = $this->$fieldName;\n-            if (in_array($field[\'type\'], [\'date\',\'datetime\'])) {\n-                $val = (string)$this->$fieldName;\n+            if (in_array($field[\'type\'], [\'date\', \'datetime\'])) {\n+                $val = (string) $this->$fieldName;\n             }\n             if (is_callable([$val, \'serialize\'])) {\n                 $val = $val->serialize();\ndiff --git a/src/Storage/Field/Manager.php b/src/Storage/Field/Manager.php\nindex 8d130f371..22e9ecf04 100644\n--- a/src/Storage/Field/Manager.php\n+++ b/src/Storage/Field/Manager.php\n@@ -16,7 +16,7 @@ class Manager\n     protected $defaults = [\n         \'text\', \'integer\', \'float\', \'geolocation\', \'imagelist\', \'image\', \'file\', \'filelist\', \'video\', \'hidden\', \'html\',\n         \'textarea\', \'datetime\', \'date\', \'select\', \'templateselect\', \'templatefields\', \'markdown\', \'checkbox\', \'slug\',\n-        \'repeater\', \'block\'\n+        \'repeater\', \'block\',\n     ];\n \n     protected $dummyFields = [\'repeater\', \'block\'];\ndiff --git a/src/Storage/Field/Type/JoinTypeBase.php b/src/Storage/Field/Type/JoinTypeBase.php\nindex 21c25e1eb..8fa6fb889 100644\n--- a/src/Storage/Field/Type/JoinTypeBase.php\n+++ b/src/Storage/Field/Type/JoinTypeBase.php\n@@ -28,10 +28,11 @@ abstract class JoinTypeBase extends FieldTypeBase\n      *\n      * @param Traversable $data\n      * @param string      $field\n+     * @param string      $separator\n      *\n      * @return array\n      */\n-    protected function normalizeData($data, $field)\n+    protected function normalizeData($data, $field, $separator = \',\')\n     {\n         $normalized = [];\n \n@@ -48,7 +49,7 @@ abstract class JoinTypeBase extends FieldTypeBase\n             if ($value === null) {\n                 continue;\n             }\n-            foreach (explode(\',\', $value) as $i => $val) {\n+            foreach (explode($separator, $value) as $i => $val) {\n                 $compiled[$i][$key] = $val;\n             }\n         }\ndiff --git a/src/Storage/Field/Type/TaxonomyType.php b/src/Storage/Field/Type/TaxonomyType.php\nindex 178dbeb2e..626a33898 100644\n--- a/src/Storage/Field/Type/TaxonomyType.php\n+++ b/src/Storage/Field/Type/TaxonomyType.php\n@@ -103,7 +103,7 @@ class TaxonomyType extends JoinTypeBase\n     {\n         $taxName = $this->mapping[\'fieldname\'];\n \n-        $data = $this->normalizeData($data, $taxName);\n+        $data = $this->normalizeData($data, $taxName, \'|\');\n         /** @var Entity\\Content $entity */\n         if (!count($entity->getTaxonomy())) {\n             $entity->setTaxonomy($this->em->createCollection(Entity\\Taxonomy::class));\n@@ -185,11 +185,11 @@ class TaxonomyType extends JoinTypeBase\n \n         switch ($platform) {\n             case \'mysql\':\n-                return "GROUP_CONCAT($column ORDER BY $order ASC) as $alias";\n+                return "GROUP_CONCAT($column ORDER BY $order ASC SEPARATOR \'|\') as $alias";\n             case \'sqlite\':\n-                return "GROUP_CONCAT($column) as $alias";\n+                return "GROUP_CONCAT($column, \'|\') as $alias";\n             case \'postgresql\':\n-                return "string_agg($column" . "::character varying, \',\' ORDER BY $order) as $alias";\n+                return "string_agg($column" . "::character varying, \'|\' ORDER BY $order) as $alias";\n         }\n \n         throw new StorageException(sprintf(\'Unsupported platform: %s\', $platform));\ndiff --git a/src/Storage/Mapping/MetadataDriver.php b/src/Storage/Mapping/MetadataDriver.php\nindex 4c04fe39f..d5e982d0b 100644\n--- a/src/Storage/Mapping/MetadataDriver.php\n+++ b/src/Storage/Mapping/MetadataDriver.php\n@@ -113,8 +113,8 @@ class MetadataDriver implements MappingDriver\n             if ($tableName = $table->getName()) {\n                 $mainAlias = $this->getContentTypeFromAlias($table->getOption(\'alias\'));\n                 $this->aliases[$mainAlias] = $tableName;\n-                $slugAlias = $this->getContentTypeFromAlias($table->getOption(\'alias\'), true);\n-                $singularAlias = $this->getContentTypeFromAlias($table->getOption(\'alias\'), \'singular\');\n+                $slugAlias = $this->normalizeClassName($this->getContentTypeFromAlias($table->getOption(\'alias\'), true));\n+                $singularAlias = $this->normalizeClassName($this->getContentTypeFromAlias($table->getOption(\'alias\'), \'singular\'));\n \n                 if ($mainAlias !== $slugAlias) {\n                     $this->aliases[$slugAlias] = $tableName;\n@@ -124,7 +124,6 @@ class MetadataDriver implements MappingDriver\n                 }\n             }\n         }\n-\n     }\n \n     /**\ndiff --git a/src/Storage/Query/Handler/SelectQueryHandler.php b/src/Storage/Query/Handler/SelectQueryHandler.php\nindex ee9ba2fe9..471015492 100644\n--- a/src/Storage/Query/Handler/SelectQueryHandler.php\n+++ b/src/Storage/Query/Handler/SelectQueryHandler.php\n@@ -25,6 +25,7 @@ class SelectQueryHandler\n         $query = $contentQuery->getService(\'select\');\n \n         foreach ($contentQuery->getContentTypes() as $contentType) {\n+            $contentType = str_replace(\'-\', \'_\', $contentType);\n             $repo = $contentQuery->getEntityManager()->getRepository($contentType);\n             $query->setQueryBuilder($repo->createQueryBuilder(\'_\' . $contentType));\n             $query->setContentType($contentType);\ndiff --git a/src/Storage/Query/QueryResultset.php b/src/Storage/Query/QueryResultset.php\nindex 2f2861a3e..81129d8a4 100644\n--- a/src/Storage/Query/QueryResultset.php\n+++ b/src/Storage/Query/QueryResultset.php\n@@ -83,6 +83,7 @@ class QueryResultset extends AppendIterator implements Countable\n \n     /**\n      * @param null $type\n+     *\n      * @return QueryBuilder\n      */\n     public function getOriginalQuery($type = null)\ndiff --git a/src/Twig/Runtime/RecordRuntime.php b/src/Twig/Runtime/RecordRuntime.php\nindex 681e2ccfd..6b5561584 100644\n--- a/src/Twig/Runtime/RecordRuntime.php\n+++ b/src/Twig/Runtime/RecordRuntime.php\n@@ -7,10 +7,10 @@ use Bolt\\Common\\Str;\n use Bolt\\Filesystem\\Handler\\DirectoryInterface;\n use Bolt\\Filesystem\\Handler\\FileInterface;\n use Bolt\\Helpers\\Excerpt;\n-use Bolt\\Storage\\Entity;\n use Bolt\\Legacy;\n use Bolt\\Pager\\PagerManager;\n use Bolt\\Storage\\Collection\\Taxonomy;\n+use Bolt\\Storage\\Entity;\n use Symfony\\Component\\Finder\\Finder;\n use Symfony\\Component\\Finder\\Glob;\n use Symfony\\Component\\HttpFoundation\\Request;\n@@ -234,11 +234,11 @@ class RecordRuntime\n     /**\n      * Output a simple pager, for paginated listing pages.\n      *\n-     * @param Environment       $env\n-     * @param string            $pagerName\n-     * @param integer           $surr\n-     * @param string            $template  The template to apply\n-     * @param string            $class\n+     * @param Environment $env\n+     * @param string      $pagerName\n+     * @param integer     $surr\n+     * @param string      $template  The template to apply\n+     * @param string      $class\n      *\n      * @return string The rendered pager HTML\n      */\n@@ -252,10 +252,10 @@ class RecordRuntime\n         $thisPager = $this->pagerManager->getPager($pagerName);\n \n         $context = [\n-            \'pager\' => $thisPager,\n-            \'surr\'  => $surr, // @deprecated\n+            \'pager\'    => $thisPager,\n+            \'surr\'     => $surr, // @deprecated\n             \'surround\' => $surr,\n-            \'class\' => $class,\n+            \'class\'    => $class,\n         ];\n \n         /* Little hack to avoid doubling this function and having context without breaking frontend */\n@@ -306,12 +306,13 @@ class RecordRuntime\n                     }\n                 }\n                 $retval[$element] = $row;\n-            } else if ($fieldName === \'contenttype\') {\n+            } elseif ($fieldName === \'contenttype\') {\n                 $retval[$element] = $c->contenttype[\'singular_name\'];\n             } elseif (isset($c->values[$fieldName])) {\n                 $retval[$element] = $c->values[$fieldName];\n             }\n         }\n+\n         return $retval;\n     }\n \ndiff --git a/src/Twig/SafeEnvironment.php b/src/Twig/SafeEnvironment.php\nindex f7af715d1..baa2cf3cc 100644\n--- a/src/Twig/SafeEnvironment.php\n+++ b/src/Twig/SafeEnvironment.php\n@@ -4,8 +4,8 @@ namespace Bolt\\Twig;\n \n use Bolt\\Common\\Deprecated;\n use Twig\\Environment;\n+use Twig\\Extension\\ExtensionInterface;\n use Twig\\Extension\\SandboxExtension;\n-use Twig_ExtensionInterface as ExtensionInterface;\n \n /**\n  * Wraps real Twig environment:\ndiff --git a/src/Twig/SecurityPolicy.php b/src/Twig/SecurityPolicy.php\nindex 39e19de74..430b50c28 100644\n--- a/src/Twig/SecurityPolicy.php\n+++ b/src/Twig/SecurityPolicy.php\n@@ -3,7 +3,7 @@\n namespace Bolt\\Twig;\n \n use Twig\\Markup;\n-use Twig\\Sandbox\\SecurityError as SecurityError;\n+use Twig\\Sandbox\\SecurityError;\n use Twig\\Sandbox\\SecurityNotAllowedFilterError;\n use Twig\\Sandbox\\SecurityNotAllowedFunctionError;\n use Twig\\Sandbox\\SecurityNotAllowedTagError;\ndiff --git a/src/Twig/SetcontentNode.php b/src/Twig/SetcontentNode.php\nindex 49f16526d..80133f0a2 100644\n--- a/src/Twig/SetcontentNode.php\n+++ b/src/Twig/SetcontentNode.php\n@@ -5,9 +5,9 @@ namespace Bolt\\Twig;\n use Bolt\\Common\\Deprecated;\n use Bolt\\Twig\\Extension\\BoltExtension;\n use Bolt\\Twig\\Runtime\\BoltRuntime;\n+use Twig\\Compiler;\n use Twig\\Node\\Expression\\ArrayExpression;\n use Twig\\Node\\Node;\n-use Twig_Compiler as Compiler;\n \n /**\n  * Twig setcontent node.\ndiff --git a/src/Twig/SetcontentTokenParser.php b/src/Twig/SetcontentTokenParser.php\nindex 7eeb467ee..b7f30aca1 100644\n--- a/src/Twig/SetcontentTokenParser.php\n+++ b/src/Twig/SetcontentTokenParser.php\n@@ -4,8 +4,8 @@ namespace Bolt\\Twig;\n \n use Twig\\Node\\Expression\\ArrayExpression;\n use Twig\\Node\\Expression\\ConstantExpression;\n+use Twig\\Token;\n use Twig\\TokenParser\\AbstractTokenParser;\n-use Twig_Token as Token;\n \n /**\n  * Twig {{ setcontent }} token parser.\ndiff --git a/src/Twig/SwitchNode.php b/src/Twig/SwitchNode.php\nindex 6d87dfa90..4d2c90bda 100644\n--- a/src/Twig/SwitchNode.php\n+++ b/src/Twig/SwitchNode.php\n@@ -2,8 +2,8 @@\n \n namespace Bolt\\Twig;\n \n+use Twig\\Compiler;\n use Twig\\Node\\Node;\n-use Twig_Compiler as Compiler;\n \n /**\n  * Represents a switch node.\ndiff --git a/src/Twig/SwitchTokenParser.php b/src/Twig/SwitchTokenParser.php\nindex 2df20837a..5f3e68df8 100644\n--- a/src/Twig/SwitchTokenParser.php\n+++ b/src/Twig/SwitchTokenParser.php\n@@ -4,8 +4,8 @@ namespace Bolt\\Twig;\n \n use Twig\\Error\\SyntaxError;\n use Twig\\Node\\Node;\n+use Twig\\Token;\n use Twig\\TokenParser\\AbstractTokenParser;\n-use Twig_Token as Token;\n \n /**\n  * Adapted from code originally in Twig/extensions.\ndiff --git a/src/Twig/TwigEnvironmentWrapper.php b/src/Twig/TwigEnvironmentWrapper.php\nindex f76a726a6..c090a2c81 100644\n--- a/src/Twig/TwigEnvironmentWrapper.php\n+++ b/src/Twig/TwigEnvironmentWrapper.php\n@@ -3,16 +3,16 @@\n namespace Bolt\\Twig;\n \n use Twig\\Environment;\n+use Twig\\Extension\\ExtensionInterface;\n+use Twig\\Loader\\LoaderInterface;\n+use Twig\\NodeVisitor\\NodeVisitorInterface;\n+use Twig\\RuntimeLoader\\RuntimeLoaderInterface;\n+use Twig\\TokenParser\\TokenParserInterface;\n+use Twig\\TokenStream;\n use Twig_CompilerInterface as CompilerInterface;\n-use Twig_ExtensionInterface as ExtensionInterface;\n use Twig_LexerInterface as LexerInterface;\n-use Twig_LoaderInterface as LoaderInterface;\n use Twig_NodeInterface as NodeInterface;\n-use Twig_NodeVisitorInterface as NodeVisitorInterface;\n use Twig_ParserInterface as ParserInterface;\n-use Twig_RuntimeLoaderInterface as RuntimeLoaderInterface;\n-use Twig_TokenParserInterface as TokenParserInterface;\n-use Twig_TokenStream as TokenStream;\n \n /**\n  * Base class for wrapping twig environment.\ndiff --git a/tests/codeception/_support/YamlHelper.php b/tests/codeception/_support/YamlHelper.php\nindex 421667330..7a8e47ec6 100644\n--- a/tests/codeception/_support/YamlHelper.php\n+++ b/tests/codeception/_support/YamlHelper.php\n@@ -341,6 +341,7 @@ class YamlHelper extends \\Codeception\\Module\n             /**\n              * Disabled as currently unsupported due to problems in extension\n              * fields, and in test due to |first filter in base-2016:\n+             *\n              * @see https://github.com/bolt/bolt/blob/v3.2.16/theme/base-2016/partials/_sub_fields.twig#L104\n              */\n             //\'repeater\' => [\ndiff --git a/tests/phpunit/unit/Controller/Backend/AuthenticationTest.php b/tests/phpunit/unit/Controller/Backend/AuthenticationTest.php\nindex e8272f000..451e0b0a0 100644\n--- a/tests/phpunit/unit/Controller/Backend/AuthenticationTest.php\n+++ b/tests/phpunit/unit/Controller/Backend/AuthenticationTest.php\n@@ -3,12 +3,10 @@\n namespace Bolt\\Tests\\Controller\\Backend;\n \n use Bolt\\AccessControl\\Password;\n-use Bolt\\Logger\\FlashLogger;\n use Bolt\\Response\\TemplateResponse;\n use Bolt\\Storage\\Entity;\n use Bolt\\Tests\\Controller\\ControllerUnitTest;\n use PHPUnit_Framework_MockObject_MockObject as MockObject;\n-use Prophecy\\Prophecy\\ObjectProphecy;\n use Symfony\\Component\\HttpFoundation\\Request;\n \n /**\n@@ -27,7 +25,7 @@ class AuthenticationTest extends ControllerUnitTest\n                 \'username\' => \'test\',\n                 \'password\' => \'pass\',\n                 \'_token\'   => \'xyz\',\n-            ]\n+            ],\n         ]));\n \n         $app = $this->getApp();\n@@ -54,7 +52,7 @@ class AuthenticationTest extends ControllerUnitTest\n                 \'username\' => \'test@example.com\',\n                 \'password\' => \'pass\',\n                 \'_token\'   => \'xyz\',\n-            ]\n+            ],\n         ]));\n \n         $app = $this->getApp();\n@@ -81,7 +79,7 @@ class AuthenticationTest extends ControllerUnitTest\n                 \'username\' => \'test\',\n                 \'password\' => \'pass\',\n                 \'_token\'   => \'xyz\',\n-            ]\n+            ],\n         ]));\n \n         $app = $this->getApp();\n@@ -105,7 +103,7 @@ class AuthenticationTest extends ControllerUnitTest\n                 \'username\' => \'test\',\n                 \'password\' => \'pass\',\n                 \'_token\'   => \'xyz\',\n-            ]\n+            ],\n         ]));\n \n         $app = $this->getApp();\n@@ -129,7 +127,7 @@ class AuthenticationTest extends ControllerUnitTest\n                 \'reset\'    => \'\',\n                 \'username\' => \'admin\',\n                 \'_token\'   => \'xyz\',\n-            ]\n+            ],\n         ]));\n \n         $app = $this->getApp();\ndiff --git a/tests/phpunit/unit/Extension/MenuTraitTest.php b/tests/phpunit/unit/Extension/MenuTraitTest.php\nindex ef863c875..32b676731 100644\n--- a/tests/phpunit/unit/Extension/MenuTraitTest.php\n+++ b/tests/phpunit/unit/Extension/MenuTraitTest.php\n@@ -64,7 +64,7 @@ class MenuTraitTest extends BoltUnitTest\n     protected function getApp($boot = true)\n     {\n         $app = parent::getApp();\n-        $token = new Token(New Users([]), new Authtoken([]));\n+        $token = new Token(new Users([]), new Authtoken([]));\n         $app[\'session\']->set(\'authentication\', $token);\n         $permissions = $this->getMockBuilder(Permissions::class)\n             ->disableOriginalConstructor()\n', 'commit_subject': "Merge branch '3.4' into 3.x", 'repo_name': 'bolt/bolt', 'committer': {'name': 'Gawain Lynch', 'email': 'f745ec5336bcd096400627fc09f6ec7139408726@gmail.com', 'time_sec': '1509953675', 'tz_offset': '60', 'date': {'seconds': '1509953675'}}, 'commit_tree': '6cfd212d3ad80e617cab43fd65570219746ac959', 'commit_message': "Merge branch '3.4' into 3.x\n", 'language_name': 'Shell', 'license': 'mit', 'hunks': "@@ -64,7 +64,7 @@ class MenuTraitTest extends BoltUnitTest\n     protected function getApp($boot = true)\n     {\n         $app = parent::getApp();\n-        $token = new Token(New Users([]), new Authtoken([]));\n+        $token = new Token(new Users([]), new Authtoken([]));\n         $app['session']->set('authentication', $token);\n         $permissions = $this->getMockBuilder(Permissions::class)\n             ->disableOriginalConstructor()\n", 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/tests/phpunit/unit/Extension/MenuTraitTest.php', 'tgt_file': 'b/tests/phpunit/unit/Extension/MenuTraitTest.php', 'file_extension': '.php', 'before_file': "<?php\n\nnamespace Bolt\\Tests\\Extension;\n\nuse Bolt\\AccessControl\\Permissions;\nuse Bolt\\AccessControl\\Token\\Token;\nuse Bolt\\Menu\\MenuEntry;\nuse Bolt\\Storage\\Entity\\Authtoken;\nuse Bolt\\Storage\\Entity\\Users;\nuse Bolt\\Tests\\BoltUnitTest;\nuse Bolt\\Tests\\Extension\\Mock\\MenuExtension;\nuse Bolt\\Tests\\Extension\\Mock\\NormalExtension;\n\n/**\n * Class to test Bolt\\Extension\\MenuTrait.\n *\n * @author Gawain Lynch <gawain.lynch@gmail.com>\n */\nclass MenuTraitTest extends BoltUnitTest\n{\n    public function testEmptyMenus()\n    {\n        $app = $this->getApp();\n\n        $ext = new NormalExtension();\n        $baseDir = $app['filesystem']->getDir('extensions://local/bolt/menu');\n        $ext->setBaseDirectory($baseDir);\n        $ext->setContainer($app);\n        $ext->register($app);\n\n        /** @var MenuEntry $extendMenu */\n        $extendMenu = $app['menu.admin']->get('extensions');\n        $this->assertSame('extensions', $extendMenu->getName());\n        $this->assertSame('Extensions Overview', $extendMenu->getLabel());\n        $this->assertSame([], $extendMenu->children());\n    }\n\n    /**\n     * @group legacy\n     */\n    public function testLegacyMenuAdds()\n    {\n        $app = $this->getApp();\n\n        $ext = new MenuExtension();\n        $baseDir = $app['filesystem']->getDir('extensions://local/bolt/menu');\n        $ext->setBaseDirectory($baseDir);\n        $ext->setContainer($app);\n        $ext->register($app);\n        /** @var MenuEntry $extendMenu */\n        $extendMenu = $app['menu.admin']->get('custom');\n        $children = $extendMenu->children();\n\n        $this->assertSame('koala', $children['koala']->getName());\n        $this->assertSame('Koalas', $children['koala']->getLabel());\n        $this->assertSame('/bolt/extensions/koalas-are-us', $children['koala']->getUri());\n        $this->assertSame('fa-thumbs-o-up', $children['koala']->getIcon());\n        $this->assertSame('config', $children['koala']->getPermission());\n\n        $this->assertSame('Drop Bear', $children['Drop Bear']->getName());\n        $this->assertSame('Drop Bear', $children['Drop Bear']->getLabel());\n        $this->assertSame('/bolt/extensions/look-up-live', $children['Drop Bear']->getUri());\n        $this->assertSame('fa-thumbs-o-down', $children['Drop Bear']->getIcon());\n    protected function getApp($boot = true)\n    {\n        $app = parent::getApp();\n        $token = new Token(New Users([]), new Authtoken([]));\n        $app['session']->set('authentication', $token);\n        $permissions = $this->getMockBuilder(Permissions::class)\n            ->disableOriginalConstructor()\n        $app['session']->set('authentication', $token);\n        $permissions = $this->getMockBuilder(Permissions::class)\n            ->disableOriginalConstructor()\n            ->setMethods(['isAllowed'])\n            ->getMock()\n        ;\n        $permissions\n            ->expects($this->any())\n            ->method('isAllowed')\n            ->willReturn(true)\n        ;\n        $app['permissions'] = $permissions;\n\n        return $app;\n    }\n}\n", 'message': "Merge branch '3.4' into 3.x\n", 'author_name': 'Gawain Lynch', 'lang': 'php'}