vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 3b2b4d838261bf108b3f9234b1eb1eb4d2181709
parent 9116253ae5246da5897f7e9c06e404fe264c88f5
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Wed, 21 Mar 2018 01:05:13 +0100

Updated web vault

Diffstat:
Mweb-vault/app/accounts/views/accountsOrganizationAccept.html | 2+-
Mweb-vault/app/accounts/views/accountsRecoverDelete.html | 2+-
Mweb-vault/app/accounts/views/accountsVerifyRecoverDelete.html | 2+-
Mweb-vault/app/organization/views/organizationDashboard.html | 2+-
Mweb-vault/app/organization/views/organizationPeopleInvite.html | 4++--
Mweb-vault/app/organization/views/organizationVault.html | 97++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Mweb-vault/app/settings/views/settingsDomains.html | 2+-
Mweb-vault/app/settings/views/settingsTwoStep.html | 2+-
Mweb-vault/app/settings/views/settingsTwoStepDuo.html | 2+-
Mweb-vault/app/settings/views/settingsTwoStepU2f.html | 2+-
Mweb-vault/app/settings/views/settingsTwoStepYubi.html | 2+-
Mweb-vault/app/settings/views/settingsUpdateKey.html | 2+-
Mweb-vault/app/vault/views/vault.html | 266++++++++++++++++++++-----------------------------------------------------------
Mweb-vault/app/vault/views/vaultAddCipher.html | 72++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
Mweb-vault/app/vault/views/vaultEditCipher.html | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
Mweb-vault/app/vault/views/vaultShareCipher.html | 2+-
Dweb-vault/app/views/apps.html | 135-------------------------------------------------------------------------------
Mweb-vault/app/views/organizationLayout.html | 8--------
Mweb-vault/app/views/userLayout.html | 10+---------
Mweb-vault/css/vault.min.css | 4++--
Mweb-vault/index.html | 16++++++++--------
Mweb-vault/js/app.min.js | 4++--
Mweb-vault/js/fallback-styles.min.js | 4++--
Mweb-vault/js/lib.min.js | 4++--
Mweb-vault/u2f-connector.html | 2+-
25 files changed, 279 insertions(+), 445 deletions(-)

diff --git a/web-vault/app/accounts/views/accountsOrganizationAccept.html b/web-vault/app/accounts/views/accountsOrganizationAccept.html @@ -14,7 +14,7 @@ <p class="text-center"><strong>{{state.params.email}}</strong></p> <p> You've been invited to join the organization listed above. - To accept the invitation, you need to log in or create a new bitwarden account. + To accept the invitation, you need to log in or create a new Bitwarden account. </p> <hr /> <div class="row"> diff --git a/web-vault/app/accounts/views/accountsRecoverDelete.html b/web-vault/app/accounts/views/accountsRecoverDelete.html @@ -3,7 +3,7 @@ <i class="fa fa-shield"></i> <b>bit</b>warden </div> <div class="login-box-body"> - <p class="login-box-msg">Enter your email address below to recover &amp; delete your bitwarden account.</p> + <p class="login-box-msg">Enter your email address below to recover &amp; delete your Bitwarden account.</p> <div ng-show="success" class="text-center"> <div class="callout callout-success"> If your account exists ({{model.email}}) we've sent you an email with further instructions. diff --git a/web-vault/app/accounts/views/accountsVerifyRecoverDelete.html b/web-vault/app/accounts/views/accountsVerifyRecoverDelete.html @@ -12,7 +12,7 @@ This will permanently delete your account. This cannot be undone. </div> <p> - You have requested to delete your bitwarden account (<b>{{email}}</b>). + You have requested to delete your Bitwarden account (<b>{{email}}</b>). Click the button below to confirm and proceed. </p> <button ng-click="delete()" class="btn btn-danger btn-block btn-flat">Delete Account</button> diff --git a/web-vault/app/organization/views/organizationDashboard.html b/web-vault/app/organization/views/organizationDashboard.html @@ -22,7 +22,7 @@ <h3 class="box-title">Let's Get Started!</h3> </div> <div class="box-body"> - <p>Dashboard features are coming soon. Get started by inviting users and creating your collections.</p> + <p>Get started by inviting users and creating your collections.</p> <a class="btn btn-default btn-flat" ui-sref="backend.org.people({orgId: orgProfile.id})"> Invite Users </a> diff --git a/web-vault/app/organization/views/organizationPeopleInvite.html b/web-vault/app/organization/views/organizationPeopleInvite.html @@ -5,8 +5,8 @@ <form name="inviteForm" ng-submit="inviteForm.$valid && submit(model)" api-form="submitPromise" autocomplete="off"> <div class="modal-body"> <p> - Invite a new user to your organization by entering their bitwarden account email address below. If they do not have - a bitwarden account already, they will be prompted to create a new account. + Invite a new user to your organization by entering their Bitwarden account email address below. If they do not have + a Bitwarden account already, they will be prompted to create a new account. </p> <div class="callout callout-danger validation-errors" ng-show="inviteForm.$errors"> <h4>Errors have occurred</h4> diff --git a/web-vault/app/organization/views/organizationVault.html b/web-vault/app/organization/views/organizationVault.html @@ -10,31 +10,22 @@ </h1> </section> <section class="content"> - <p ng-show="loading && !collections.length">Loading...</p> - <div class="box" ng-class="{'collapsed-box': collection.collapsed}" ng-repeat="collection in collections | - orderBy: collectionSort track by collection.id" - ng-show="collections.length && (!main.searchVaultText || collectionCiphers.length)"> + <p ng-show="loading">Loading...</p> + <div class="box" ng-show="!loading"> <div class="box-header with-border"> <h3 class="box-title"> - <i class="fa" ng-class="{'fa-cube': collection.id, 'fa-sitemap': !collection.id}"></i> - {{collection.name}} - <small ng-pluralize count="collectionCiphers.length" when="{'1': '{} item', 'other': '{} items'}"></small> + <i class="fa {{selectedIcon}}"></i> + {{selectedCollection ? selectedCollection.name : selectedTitle}} + <small ng-pluralize count="filteredCiphers.length" when="{'1': '{} item', 'other': '{} items'}"></small> </h3> - <div class="box-tools"> - <button type="button" class="btn btn-box-tool" data-widget="collapse" title="Collapse/Expand" - ng-click="collapseExpand(collection)"> - <i class="fa" ng-class="{'fa-minus': !collection.collapsed, 'fa-plus': collection.collapsed}"></i> - </button> - </div> </div> - <div class="box-body" ng-class="{'no-padding': collectionCiphers.length}"> - <div ng-show="!collectionCiphers.length && collection.id">No items in this collection.</div> - <div ng-show="!collectionCiphers.length && !collection.id">No unassigned items.</div> - <div class="table-responsive" ng-show="collectionCiphers.length"> + <div class="box-body" ng-class="{'no-padding': filteredCiphers.length}"> + <div ng-show="!filteredCiphers.length">No items to list.</div> + <div class="table-responsive" ng-show="filteredCiphers.length"> <table class="table table-striped table-hover table-vmiddle"> <tbody> - <tr ng-repeat="cipher in collectionCiphers = (ciphers | filter: filterByCollection(collection) | - filter: (main.searchVaultText || '') | orderBy: ['name', 'subTitle']) track by cipher.id"> + <tr ng-repeat="cipher in filteredCiphers = (ciphers | filter: cipherFilter() | + filter: (searchVaultText || '') | orderBy: ['name', 'subTitle']) track by cipher.id"> <td style="width: 70px;"> <div class="btn-group" data-append-to="body"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> @@ -62,12 +53,6 @@ </a> </li> <li> - <a href="#" stop-click ng-click="removeCipher(cipher, collection)" class="text-red" - ng-if="collection.id"> - <i class="fa fa-fw fa-remove"></i> Remove - </a> - </li> - <li> <a href="#" stop-click ng-click="deleteCipher(cipher)" class="text-red"> <i class="fa fa-fw fa-trash"></i> Delete </a> @@ -93,3 +78,65 @@ </div> </div> </section> +<aside class="control-sidebar control-sidebar-light"> + <div class="tab-content"> + <form class="search-form"> + <label for="search" class="sr-only">Search</label> + <div class="form-group has-feedback"> + <input type="search" id="search" class="form-control" placeholder="Search org vault..." + ng-model="searchVaultText" /> + <span class="fa fa-search form-control-feedback" aria-hidden="true"></span> + </div> + </form> + <ul class="control-sidebar-menu"> + <li ng-class="{active: selectedAll}"> + <a href="#" stop-click ng-click="filterAll()"> + <i class="fa fa-th fa-fw"></i> All Items + </a> + </li> + </ul> + <h3 class="control-sidebar-heading">Types</h3> + <div class="control-sidebar-section"> + <ul class="control-sidebar-menu"> + <li ng-class="{active: constants.cipherType.login === selectedType}"> + <a href="#" stop-click ng-click="filterType(constants.cipherType.login)"> + <i class="fa fa-globe fa-fw"></i> Login + </a> + </li> + <li ng-class="{active: constants.cipherType.card === selectedType}"> + <a href="#" stop-click ng-click="filterType(constants.cipherType.card)"> + <i class="fa fa-credit-card fa-fw"></i> Card + </a> + </li> + <li ng-class="{active: constants.cipherType.identity === selectedType}"> + <a href="#" stop-click ng-click="filterType(constants.cipherType.identity)"> + <i class="fa fa-id-card-o fa-fw"></i> Identity + </a> + </li> + <li ng-class="{active: constants.cipherType.secureNote === selectedType}"> + <a href="#" stop-click ng-click="filterType(constants.cipherType.secureNote)"> + <i class="fa fa-sticky-note-o fa-fw"></i> Secure Note + </a> + </li> + </ul> + </div> + <h3 class="control-sidebar-heading">Collections</h3> + <div ng-show="loading && !collections.length"> + <p>Loading...</p> + </div> + <div ng-show="!loading && !collections.length"> + <p>No collections.</p> + </div> + <div class="control-sidebar-section" ng-show="!loading && collections.length"> + <ul class="control-sidebar-menu"> + <li ng-repeat="collection in collections | orderBy: [collectionSort] track by collection.id" + ng-class="{active: selectedCollection && collection.id === selectedCollection.id}"> + <a href="#" stop-click ng-click="filterCollection(collection)"> + <i class="fa fa-caret-right fa-fw"></i> + {{collection.name}} + </a> + </li> + </ul> + </div> + </div> +</aside> diff --git a/web-vault/app/settings/views/settingsDomains.html b/web-vault/app/settings/views/settingsDomains.html @@ -4,7 +4,7 @@ <section class="content"> <p> If you have the same login across multiple different website domains, you can mark the website as "equivalent". - "Global" domains are ones already created for you by bitwarden. + "Global" domains are ones already created for you by Bitwarden. </p> <form name="customForm" ng-submit="customForm.$valid && saveCustom()" api-form="customPromise" autocomplete="off"> <div class="box box-default"> diff --git a/web-vault/app/settings/views/settingsTwoStep.html b/web-vault/app/settings/views/settingsTwoStep.html @@ -8,7 +8,7 @@ </div> <div class="box-body"> The recovery code allows you to access your account in the event that you can no longer use your normal - two-step login provider (ex. you lose your device). bitwarden support will not be able to assist you if you lose + two-step login provider (ex. you lose your device). Bitwarden support will not be able to assist you if you lose access to your account. We recommend you write down or print the recovery code and keep it in a safe place. </div> <div class="box-footer"> diff --git a/web-vault/app/settings/views/settingsTwoStepDuo.html b/web-vault/app/settings/views/settingsTwoStepDuo.html @@ -48,7 +48,7 @@ <li ng-repeat="e in submitTwoStepForm.$errors">{{e}}</li> </ul> </div> - <p>Enter the bitwarden application information from your Duo Admin panel:</p> + <p>Enter the Bitwarden application information from your Duo Admin panel:</p> <div class="form-group" show-errors> <label for="ikey">Integration Key</label> <input type="text" id="ikey" name="IntegrationKey" ng-model="updateModel.ikey" class="form-control" diff --git a/web-vault/app/settings/views/settingsTwoStepU2f.html b/web-vault/app/settings/views/settingsTwoStepU2f.html @@ -33,7 +33,7 @@ <div class="callout callout-warning"> <h4><i class="fa fa-warning"></i> Warning <i class="fa fa-warning"></i></h4> <p> - Due to platform limitations, FIDO U2F cannot be used on all bitwarden applications. You should enable + Due to platform limitations, FIDO U2F cannot be used on all Bitwarden applications. You should enable another two-step login provider so that you can access your account when FIDO U2F cannot be used. </p> <p>Supported platforms:</p> diff --git a/web-vault/app/settings/views/settingsTwoStepYubi.html b/web-vault/app/settings/views/settingsTwoStepYubi.html @@ -33,7 +33,7 @@ <div class="callout callout-warning"> <h4><i class="fa fa-warning"></i> Warning <i class="fa fa-warning"></i></h4> <p> - Due to platform limitations, YubiKeys cannot be used on all bitwarden applications. You should enable + Due to platform limitations, YubiKeys cannot be used on all Bitwarden applications. You should enable another two-step login provider so that you can access your account when YubiKeys cannot be used. </p> <p>Supported platforms:</p> diff --git a/web-vault/app/settings/views/settingsUpdateKey.html b/web-vault/app/settings/views/settingsUpdateKey.html @@ -21,7 +21,7 @@ <hr /> <div class="callout callout-warning"> <h4><i class="fa fa-warning"></i> Warning</h4> - After updating your encryption key, you are required to log out and back in to all bitwarden applications that you + After updating your encryption key, you are required to log out and back in to all Bitwarden applications that you are currently using (such as the mobile app or browser extensions). Failure to log out and back in (which downloads your new encryption key) may result in data corruption. We will attempt to log you out automatically, however it may be delayed. diff --git a/web-vault/app/vault/views/vault.html b/web-vault/app/vault/views/vault.html @@ -17,18 +17,13 @@ </li> <li role="separator" class="divider"></li> <li> - <a href="#" stop-click ng-click="unselectAll()"> - <i class="fa fa-fw fa-minus-circle"></i> Unselect All - </a> - </li> - <li> - <a href="#" stop-click ng-click="collapseAll()"> - <i class="fa fa-fw fa-minus-square-o"></i> Collapse All + <a href="#" stop-click ng-click="selectAll()"> + <i class="fa fa-fw fa-check-square-o"></i> Select All </a> </li> <li> - <a href="#" stop-click ng-click="expandAll()"> - <i class="fa fa-fw fa-plus-square-o"></i> Expand All + <a href="#" stop-click ng-click="unselectAll()"> + <i class="fa fa-fw fa-minus-square-o"></i> Unselect All </a> </li> </ul> @@ -36,184 +31,57 @@ <h1> My Vault <small class="visible-md-inline visible-lg-inline"> - <span ng-pluralize count="folderCount" when="{'1': '{} folder', 'other': '{} folders'}"></span>, - <span ng-pluralize count="collectionCount" when="{'1': '{} collection', 'other': '{} collections'}"></span>, &amp; + <span ng-pluralize count="vaultFolders.length > 0 ? vaultFolders.length - 1 : 0" + when="{'1': '{} folder', 'other': '{} folders'}"></span>, + <span ng-pluralize count="vaultCollections.length" + when="{'1': '{} collection', 'other': '{} collections'}"></span>, &amp; <span ng-pluralize count="ciphers.length" when="{'1': '{} item', 'other': '{} items'}"></span> </small> </h1> </section> <section class="content"> - <div ng-show="loading && !vaultGroupings.length"> + <div ng-show="loadingCiphers"> <p>Loading...</p> </div> - <div class="box box-primary" ng-class="{'collapsed-box': favoriteCollapsed}" style="margin-bottom: 40px;" - ng-show="vaultGroupings.length && groupingIdFilter === undefined && (!main.searchVaultText || favoriteCiphers.length)"> + <div class="box" ng-show="!loadingCiphers"> <div class="box-header with-border"> <h3 class="box-title"> - <i class="fa fa-star"></i> - Favorites - <small ng-pluralize count="favoriteCiphers.length" when="{'1': '{} item', 'other': '{} items'}"></small> + <i class="fa {{selectedIcon}}"></i> + {{selectedFolder ? selectedFolder.name : selectedCollection ? selectedCollection.name : selectedTitle}} + <small ng-pluralize count="filteredCiphers.length" when="{'1': '{} item', 'other': '{} items'}"></small> </h3> - <div class="box-tools"> + <div class="box-tools" ng-if="selectedFolder && selectedFolder.id"> <div class="btn-group"> <button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-cog"></i> <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-right"> <li> - <a href="#" stop-click ng-click="addCipher(null, true)"> - <i class="fa fa-fw fa-plus-circle"></i> New Item - </a> - </li> - </ul> - </div> - <button type="button" class="btn btn-box-tool" data-widget="collapse" title="Collapse/Expand" - ng-click="collapseExpand(null, true)"> - <i class="fa" ng-class="{'fa-minus': !favoriteCollapsed, 'fa-plus': favoriteCollapsed}"></i> - </button> - </div> - </div> - <div class="box-body" ng-class="{'no-padding': favoriteCiphers.length}"> - <div ng-show="!favoriteCiphers.length"> - <p>No favorite items.</p> - <button type="button" ng-click="addCipher(null, true)" class="btn btn-default btn-flat">Add an Item</button> - </div> - <div class="table-responsive" ng-show="favoriteCiphers.length"> - <table class="table table-striped table-hover table-vmiddle"> - <tbody> - <tr ng-repeat="cipher in favoriteCiphers = (ciphers | filter: { favorite: true } | - filter: cipherFilter(null) | filter: (main.searchVaultText || '')) track by cipher.id"> - <td style="width: 70px;"> - <div class="btn-group" data-append-to="body"> - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> - <i class="fa fa-cog"></i> <span class="caret"></span> - </button> - <ul class="dropdown-menu"> - <li> - <a href="#" stop-click ng-click="editCipher(cipher)"> - <i class="fa fa-fw fa-pencil"></i> Edit - </a> - </li> - <li> - <a href="#" stop-click ng-click="attachments(cipher)"> - <i class="fa fa-fw fa-paperclip"></i> Attachments - </a> - </li> - <li ng-show="!cipher.organizationId"> - <a href="#" stop-click ng-click="share(cipher)"> - <i class="fa fa-fw fa-share-alt"></i> Share - </a> - </li> - <li ng-show="cipher.organizationId && cipher.edit"> - <a href="#" stop-click ng-click="editCollections(cipher)"> - <i class="fa fa-fw fa-cubes"></i> Collections - </a> - </li> - <li ng-show="cipher.meta.password"> - <a href="#" stop-click ngclipboard ngclipboard-error="clipboardError(e)" - data-clipboard-text="{{cipher.meta.password}}"> - <i class="fa fa-fw fa-clipboard"></i> Copy Password - </a> - </li> - <li ng-show="cipher.edit"> - <a href="#" stop-click ng-click="deleteCipher(cipher)" class="text-red"> - <i class="fa fa-fw fa-trash"></i> Delete - </a> - </li> - </ul> - </div> - </td> - <td class="action-select" ng-click="select($event)"> - <input type="checkbox" value="{{::cipher.id}}" name="cipherSelection" stop-prop /> - </td> - <td class="vault-icon" ng-click="select($event)"> - <i class="fa fa-fw fa-lg {{::cipher.icon}}" ng-if="!cipher.meta.image"></i> - <img alt="" ng-if="cipher.meta.image" ng-src="{{cipher.meta.image}}" - fallback-src="images/fa-globe.png" /> - </td> - <td ng-click="select($event)"> - <a href="#" stop-click ng-click="editCipher(cipher)" stop-prop>{{cipher.name}}</a> - <i class="fa fa-share-alt text-muted" title="Shared" ng-if="cipher.organizationId" - stop-prop></i> - <i class="fa fa-paperclip text-muted" title="Attachments" ng-if="cipher.hasAttachments" - stop-prop></i><br /> - <span class="text-sm text-muted" stop-prop>{{cipher.subTitle}}</span> - </td> - </tr> - </tbody> - </table> - </div> - </div> - </div> - <div class="box" ng-class="{'collapsed-box': grouping.collapsed}" - ng-repeat="grouping in filteredVaultGroupings = (vaultGroupings | filter: groupingFilter) track by grouping.id" - ng-show="vaultGroupings.length && (!main.searchVaultText || groupingCiphers.length)" - ng-style="firstCollectionId && grouping.id === firstCollectionId && - groupingIdFilter !== grouping.id && {'margin-top': '40px'}"> - <div class="box-header with-border"> - <h3 class="box-title"> - <i class="fa" ng-if="grouping.folder" - ng-class="{'fa-folder-open': grouping.id !== null, 'fa-folder-open-o': grouping.id === null}"></i> - <i class="fa fa-cube" ng-if="grouping.collection"></i> - {{grouping.name}} - <small ng-pluralize count="groupingCiphers.length" when="{'1': '{} item', 'other': '{} items'}"></small> - </h3> - <div class="box-tools"> - <div class="btn-group"> - <button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"> - <i class="fa fa-cog"></i> <span class="caret"></span> - </button> - <ul class="dropdown-menu dropdown-menu-right" ng-if="grouping.folder"> - <li> - <a href="#" stop-click ng-click="addCipher(grouping)"> - <i class="fa fa-fw fa-plus-circle"></i> New Item - </a> - </li> - <li ng-show="grouping.id"> - <a href="#" stop-click ng-click="editFolder(grouping)"> + <a href="#" stop-click ng-click="editFolder(selectedFolder)"> <i class="fa fa-fw fa-pencil"></i> Edit Folder </a> </li> - <li ng-show="canDeleteFolder(grouping)"> - <a href="#" stop-click ng-click="deleteFolder(grouping)" class="text-red"> - <i class="fa fa-fw fa-trash"></i> Delete Folder - </a> - </li> - <li> - <a href="#" stop-click ng-click="selectFolder(grouping, $event)"> - <i class="fa fa-fw fa-check-square-o"></i> Select All - </a> - </li> - </ul> - <ul class="dropdown-menu dropdown-menu-right" ng-if="grouping.collection"> <li> - <a href="#" stop-click ng-click="selectFolder(grouping, $event)"> - <i class="fa fa-fw fa-check-square-o"></i> Select All + <a href="#" stop-click ng-click="deleteFolder(selectedFolder)" class="text-red"> + <i class="fa fa-fw fa-trash"></i> Delete Folder </a> </li> </ul> </div> - <button type="button" class="btn btn-box-tool" data-widget="collapse" title="Collapse/Expand" - ng-click="collapseExpand(grouping)"> - <i class="fa" ng-class="{'fa-minus': !grouping.collapsed, 'fa-plus': grouping.collapsed}"></i> - </button> </div> </div> - <div class="box-body" ng-class="{'no-padding': groupingCiphers.length}"> - <div ng-show="!groupingCiphers.length"> - <div ng-if="grouping.folder"> - <p>No items in this folder.</p> - <button type="button" ng-click="addCipher(grouping)" class="btn btn-default btn-flat">Add an Item</button> - </div> - <div ng-if="!grouping.folder"> - <p>No items in this collection.</p> - </div> + <div class="box-body" ng-class="{'no-padding': filteredCiphers.length}"> + <div ng-show="!filteredCiphers.length"> + <p>No items to list.</p> + <button type="button" ng-click="addCipher()" class="btn btn-default btn-flat"> + Add an Item + </button> </div> - <div class="table-responsive" ng-show="groupingCiphers.length"> + <div class="table-responsive" ng-show="filteredCiphers.length"> <table class="table table-striped table-hover table-vmiddle"> <tbody> - <tr ng-repeat="cipher in groupingCiphers = (ciphers | filter: cipherFilter(grouping) | - filter: (main.searchVaultText || '')) track by cipher.id"> + <tr ng-repeat="cipher in filteredCiphers = (ciphers | filter: cipherFilter() | + filter: (searchVaultText || '')) track by cipher.id"> <td style="width: 70px;"> <div class="btn-group" data-append-to="body"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> @@ -281,80 +149,82 @@ </section> <aside class="control-sidebar control-sidebar-light"> <div class="tab-content"> + <form class="search-form"> + <label for="search" class="sr-only">Search</label> + <div class="form-group has-feedback"> + <input type="search" id="search" class="form-control" placeholder="Search my vault..." + ng-model="searchVaultText" /> + <span class="fa fa-search form-control-feedback" aria-hidden="true"></span> + </div> + </form> <ul class="control-sidebar-menu"> - <li> - <a href="#" stop-click ng-click="clearFilters()"> - Clear All Filters + <li ng-class="{active: selectedAll}"> + <a href="#" stop-click ng-click="filterAll()"> + <i class="fa fa-th fa-fw"></i> All Items + </a> + </li> + <li ng-class="{active: selectedFavorites}"> + <a href="#" stop-click ng-click="filterFavorites()"> + <i class="fa fa-star fa-fw"></i> Favorites </a> </li> </ul> - <h3 class="control-sidebar-heading"> - <i class="fa fa-tag fa-fw"></i> Types - </h3> + <h3 class="control-sidebar-heading">Types</h3> <div class="control-sidebar-section"> <ul class="control-sidebar-menu"> - <li> + <li ng-class="{active: constants.cipherType.login === selectedType}"> <a href="#" stop-click ng-click="filterType(constants.cipherType.login)"> - <i class="fa fa-check fa-fw" ng-if="constants.cipherType.login === typeFilter"></i> - <i class="fa fa-globe fa-fw" ng-if="constants.cipherType.login !== typeFilter"></i> Login + <i class="fa fa-globe fa-fw"></i> Login </a> </li> - <li> + <li ng-class="{active: constants.cipherType.card === selectedType}"> <a href="#" stop-click ng-click="filterType(constants.cipherType.card)"> - <i class="fa fa-check fa-fw" ng-if="constants.cipherType.card === typeFilter"></i> - <i class="fa fa-credit-card fa-fw" ng-if="constants.cipherType.card !== typeFilter"></i> Card + <i class="fa fa-credit-card fa-fw"></i> Card </a> </li> - <li> + <li ng-class="{active: constants.cipherType.identity === selectedType}"> <a href="#" stop-click ng-click="filterType(constants.cipherType.identity)"> - <i class="fa fa-check fa-fw" ng-if="constants.cipherType.identity === typeFilter"></i> - <i class="fa fa-id-card-o fa-fw" ng-if="constants.cipherType.identity !== typeFilter"></i> Identity + <i class="fa fa-id-card-o fa-fw"></i> Identity </a> </li> - <li> + <li ng-class="{active: constants.cipherType.secureNote === selectedType}"> <a href="#" stop-click ng-click="filterType(constants.cipherType.secureNote)"> - <i class="fa fa-check fa-fw" ng-if="constants.cipherType.secureNote === typeFilter"></i> - <i class="fa fa-sticky-note-o fa-fw" ng-if="constants.cipherType.secureNote !== typeFilter"></i> Secure Note + <i class="fa fa-sticky-note-o fa-fw"></i> Secure Note </a> </li> </ul> </div> - <h3 class="control-sidebar-heading"> - <i class="fa fa-folder fa-fw"></i> Folders - </h3> - <div ng-show="loading && !vaultGroupings.length"> + <h3 class="control-sidebar-heading">Folders</h3> + <div ng-show="loadingGroupings"> <p>Loading...</p> </div> - <div class="control-sidebar-section"> - <ul class="control-sidebar-menu" ng-show="!loading && folders.length"> - <li ng-repeat="folder in folders = (vaultGroupings | filter: {folder: true}) track by folder.id"> - <a href="#" stop-click ng-click="filterGrouping(folder)"> - <i class="fa fa-check fa-fw" ng-if="folder.id === groupingIdFilter"></i> - <i class="fa fa-caret-right fa-fw" ng-if="folder.id !== groupingIdFilter"></i> + <div class="control-sidebar-section" ng-show="!loadingGroupings"> + <ul class="control-sidebar-menu"> + <li ng-repeat="folder in vaultFolders | orderBy: [groupingSort] track by folder.id" + ng-class="{active: selectedFolder && folder.id === selectedFolder.id}"> + <a href="#" stop-click ng-click="filterFolder(folder)"> + <i class="fa fa-caret-right fa-fw"></i> {{folder.name}} </a> </li> </ul> </div> - <h3 class="control-sidebar-heading"> - <i class="fa fa-cubes fa-fw"></i> Collections - </h3> - <div ng-show="loading && !vaultGroupings.length"> + <h3 class="control-sidebar-heading">Collections</h3> + <div ng-show="loadingGroupings"> <p>Loading...</p> </div> - <div ng-show="!loading && !collections.length"> + <div ng-show="!loadingGroupings && !vaultCollections.length"> <p>No collections are being shared with you. <i class="fa fa-frown-o"></i></p> <a ui-sref="backend.user.settingsCreateOrg" class="btn btn-default btn-lint"> Create an Organization </a> </div> - <div class="control-sidebar-section"> - <ul class="control-sidebar-menu" ng-show="!loading && collections.length"> - <li ng-repeat="collection in collections = - (vaultGroupings | filter: {collection: true}) track by collection.id"> - <a href="#" stop-click ng-click="filterGrouping(collection)"> - <i class="fa fa-check fa-fw" ng-if="collection.id === groupingIdFilter"></i> - <i class="fa fa-caret-right fa-fw" ng-if="collection.id !== groupingIdFilter"></i> + <div class="control-sidebar-section" ng-show="!loadingGroupings && vaultCollections.length"> + <ul class="control-sidebar-menu"> + <li ng-repeat="collection in vaultCollections | orderBy: [groupingSort] track by collection.id" + ng-class="{active: selectedCollection && collection.id === selectedCollection.id}"> + <a href="#" stop-click ng-click="filterCollection(collection)"> + <i class="fa fa-caret-right fa-fw"></i> {{collection.name}} </a> </li> diff --git a/web-vault/app/vault/views/vaultAddCipher.html b/web-vault/app/vault/views/vaultAddCipher.html @@ -39,26 +39,7 @@ </div> </div> </div> - <div ng-if="cipher.type === constants.cipherType.login"> - <div class="form-group" show-errors> - <label for="uri">URI</label> - <div class="input-group"> - <input type="text" id="uri" name="Login.Uri" ng-model="cipher.login.uri" class="form-control" - placeholder="http://..." ng-readonly="readOnly" api-field /> - <span class="input-group-btn"> - <button class="btn btn-default btn-flat" type="button" uib-tooltip="Copy URI" - tooltip-placement="left" ngclipboard ngclipboard-error="clipboardError(e)" - data-clipboard-target="#uri"> - <i class="fa fa-clipboard"></i> - </button> - <a href="{{cipher.login.uri}}" target="_blank" class="btn btn-default btn-flat" - uib-tooltip="Go To Website" tooltip-placement="left"> - <i class="fa fa-share"></i> - </a> - </span> - </div> - </div> <div class="row"> <div class="col-sm-6"> <div class="form-group" show-errors> @@ -120,6 +101,58 @@ </div> </div> </div> + <div ng-repeat="u in cipher.login.uris" ng-if="cipher.login.uris && cipher.login.uris.length"> + <div class="row"> + <div class="col-sm-7"> + <div class="form-group" show-errors> + <label for="uri{{$index}}">URI {{$index + 1}}</label> + <div class="input-group"> + <input type="text" id="uri{{$index}}" name="Login.Uris[{{$index}}].Uri" + ng-model="u.uri" class="form-control" + placeholder="http://..." ng-readonly="readOnly" api-field /> + <span class="input-group-btn"> + <button class="btn btn-default btn-flat" type="button" uib-tooltip="Copy URI" + tooltip-placement="left" ngclipboard ngclipboard-error="clipboardError(e)" + data-clipboard-target="#uri{{$index}}"> + <i class="fa fa-clipboard"></i> + </button> + <a href="{{u.uri}}" target="_blank" class="btn btn-default btn-flat" + uib-tooltip="Go To Website" tooltip-placement="left"> + <i class="fa fa-share"></i> + </a> + </span> + </div> + </div> + </div> + <div class="col-sm-4"> + <div class="form-group"> + <label for="uri_match_{{$index}}">Match Detection</label> + <select id="uri_match_{{$index}}" name="Login.Uris[{{$index}}].Match" + class="form-control" ng-model="u.matchValue" ng-change="uriMatchChanged(u)"> + <option value="">Default</option> + <option value="0">Base domain</option> + <option value="1">Host</option> + <option value="2">Starts with</option> + <option value="4">Regular Expression</option> + <option value="3">Exact</option> + <option value="5">Never</option> + </select> + </div> + </div> + <div class="col-sm-1"> + <br class="hidden-xs" /> + <a href="#" ng-click="removeUri(u)" stop-click> + <i class="fa fa-window-close-o fa-lg"></i> + <span class="visible-xs-inline">Remove URI</span> + </a> + </div> + </div> + <hr class="visible-xs-block" /> + </div> + <a href="#" ng-click="addUri()" stop-click> + <i class="fa fa-plus-circle"></i> New URI + </a> + <br /><br /> </div> <div ng-if="cipher.type === constants.cipherType.card"> <div class="row"> @@ -505,7 +538,6 @@ <div ng-if="cipher.type === constants.cipherType.secureNote"> <!-- Nothing for now --> </div> - <div class="form-group" show-errors> <label for="notes">Notes</label> <textarea id="notes" name="Notes" class="form-control" ng-model="cipher.notes" api-field diff --git a/web-vault/app/vault/views/vaultEditCipher.html b/web-vault/app/vault/views/vaultEditCipher.html @@ -33,24 +33,6 @@ </div> <div ng-if="cipher.type === constants.cipherType.login"> - <div class="form-group" show-errors> - <label for="uri">URI</label> - <div class="input-group"> - <input type="text" id="uri" name="Login.Uri" ng-model="cipher.login.uri" class="form-control" - placeholder="http://..." ng-readonly="readOnly" api-field /> - <span class="input-group-btn"> - <button class="btn btn-default btn-flat" type="button" uib-tooltip="Copy URI" - tooltip-placement="left" ngclipboard ngclipboard-error="clipboardError(e)" - data-clipboard-target="#uri"> - <i class="fa fa-clipboard"></i> - </button> - <a href="{{cipher.login.uri}}" target="_blank" class="btn btn-default btn-flat" - uib-tooltip="Go To Website" tooltip-placement="left"> - <i class="fa fa-share"></i> - </a> - </span> - </div> - </div> <div class="row"> <div class="col-sm-6"> <div class="form-group" show-errors> @@ -112,6 +94,60 @@ </div> </div> </div> + <div ng-repeat="u in cipher.login.uris" ng-if="cipher.login.uris && cipher.login.uris.length"> + <div class="row"> + <div class="col-sm-7"> + <div class="form-group" show-errors> + <label for="uri{{$index}}">URI {{$index + 1}}</label> + <div class="input-group"> + <input type="text" id="uri{{$index}}" name="Login.Uris[{{$index}}].Uri" + ng-model="u.uri" class="form-control" + placeholder="http://..." ng-readonly="readOnly" api-field /> + <span class="input-group-btn"> + <button class="btn btn-default btn-flat" type="button" uib-tooltip="Copy URI" + tooltip-placement="left" ngclipboard ngclipboard-error="clipboardError(e)" + data-clipboard-target="#uri{{$index}}"> + <i class="fa fa-clipboard"></i> + </button> + <a href="{{u.uri}}" target="_blank" class="btn btn-default btn-flat" + uib-tooltip="Go To Website" tooltip-placement="left"> + <i class="fa fa-share"></i> + </a> + </span> + </div> + </div> + </div> + <div class="col-sm-4"> + <div class="form-group"> + <label for="uri_match_{{$index}}">Match Detection</label> + <select id="uri_match_{{$index}}" name="Login.Uris[{{$index}}].Match" ng-disabled="readOnly" + class="form-control" ng-model="u.matchValue" ng-change="uriMatchChanged(u)"> + <option value="">Default</option> + <option value="0">Base domain</option> + <option value="1">Host</option> + <option value="2">Starts with</option> + <option value="4">Regular Expression</option> + <option value="3">Exact</option> + <option value="5">Never</option> + </select> + </div> + </div> + <div class="col-sm-1" ng-if="!readOnly"> + <br class="hidden-xs" /> + <a href="#" ng-click="removeUri(u)" stop-click> + <i class="fa fa-window-close-o fa-lg"></i> + <span class="visible-xs-inline">Remove URI</span> + </a> + </div> + </div> + <hr class="visible-xs-block" /> + </div> + <div ng-if="!readOnly"> + <a href="#" ng-click="addUri()" stop-click> + <i class="fa fa-plus-circle"></i> New URI + </a> + <br /><br /> + </div> </div> <div ng-if="cipher.type === constants.cipherType.card"> <div class="row"> @@ -552,9 +588,9 @@ </div> </div> </div> - <div class="col-sm-1"> + <div class="col-sm-1" ng-if="!readOnly"> <br class="hidden-xs" /> - <a href="#" ng-click="removeField(field)" stop-click ng-if="!readOnly"> + <a href="#" ng-click="removeField(field)" stop-click> <i class="fa fa-window-close-o fa-lg"></i> <span class="visible-xs-inline">Remove Custom Field</span> </a> diff --git a/web-vault/app/vault/views/vaultShareCipher.html b/web-vault/app/vault/views/vaultShareCipher.html @@ -14,7 +14,7 @@ <p ng-show="loading">Loading...</p> <div ng-show="!loading && !organizations.length" class="callout callout-default"> <h4><i class="fa fa-info-circle"></i> No Organizations</h4> - <p>You do not belong to any organizations. Organizations allow you to share items with other bitwarden users.</p> + <p>You do not belong to any organizations. Organizations allow you to share items with other Bitwarden users.</p> <a ng-click="createOrg()" class="btn btn-default btn-flat"> Create an Organization </a> diff --git a/web-vault/app/views/apps.html b/web-vault/app/views/apps.html @@ -1,135 +0,0 @@ -<section class="content-header"> - <h1> - Apps - <small>for all of your devices</small> - </h1> -</section> -<section class="content"> - <div class="box box-default box-apps"> - <div class="box-header with-border"> - <h3 class="box-title">Desktop/Browser</h3> - </div> - <div class="box-body"> - <div class="row"> - <div class="col-sm-6"> - <ul class="fa-ul"> - <li> - <a href="https://chrome.google.com/webstore/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb" target="_blank"> - <i class="fa fa-chrome fa-lg fa-fw fa-li"></i> Google Chrome - </a> - </li> - <li> - <a href="https://addons.mozilla.org/firefox/addon/bitwarden-password-manager/" target="_blank"> - <i class="fa fa-firefox fa-lg fa-fw fa-li"></i> Mozilla Firefox - </a> - </li> - <li> - <a href="https://addons.opera.com/extensions/details/bitwarden-free-password-manager/" target="_blank"> - <i class="fa fa-opera fa-lg fa-fw fa-li"></i> Opera - </a> - </li> - <li> - <a href="https://www.microsoft.com/store/p/bitwarden-free-password-manager/9p6kxl0svnnl" target="_blank"> - <i class="fa fa-edge fa-lg fa-fw fa-li"></i> Microsoft Edge - </a> - </li> - </ul> - </div> - <div class="col-sm-6"> - Others: - <ul> - <li> - <a href="https://chrome.google.com/webstore/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb" target="_blank"> - Vivaldi - </a> - </li> - <li> - <a href="https://brave.com/" target="_blank"> - Brave - </a> - </li> - <li> - <a href="https://addons.mozilla.org/firefox/addon/bitwarden-password-manager/" target="_blank"> - Tor Browser - </a> - </li> - </ul> - </div> - </div> - </div> - </div> - <div class="box box-default box-apps"> - <div class="box-header with-border"> - <h3 class="box-title">Mobile</h3> - </div> - <div class="box-body"> - <div class="row"> - <div class="col-sm-6"> - <ul class="fa-ul"> - <li> - <a href="https://itunes.apple.com/app/bitwarden-free-password-manager/id1137397744?mt=8" target="_blank"> - <i class="fa fa-apple fa-lg fa-fw fa-li"></i> iOS - </a> - </li> - <li> - <a href="https://play.google.com/store/apps/details?id=com.x8bit.bitwarden" target="_blank"> - <i class="fa fa-android fa-lg fa-fw fa-li"></i> Android - </a> - </li> - </ul> - </div> - <div class="col-sm-6"> - <ul class="fa-ul"> - <li> - <a href="#" stop-click> - <i class="fa fa-windows fa-lg fa-fw fa-li"></i> Windows - <small class="text-muted">(coming soon)</small> - </a> - </li> - </ul> - </div> - </div> - </div> - </div> - <div class="box box-default box-apps"> - <div class="box-header with-border"> - <h3 class="box-title">Other</h3> - </div> - <div class="box-body"> - <div class="row"> - <div class="col-sm-6"> - <ul class="fa-ul"> - <li> - <a href="#" stop-click> - <i class="fa fa-windows fa-lg fa-fw fa-li"></i> Desktop Windows - <small class="text-muted">(coming soon)</small> - </a> - </li> - <li> - <a href="#" stop-click> - <i class="fa fa-apple fa-lg fa-fw fa-li"></i> Desktop macOS - <small class="text-muted">(coming soon)</small> - </a> - </li> - </ul> - </div> - <div class="col-sm-6"> - <ul class="fa-ul"> - <li> - <a href="#" stop-click> - <i class="fa fa-linux fa-lg fa-fw fa-li"></i> Desktop Linux - <small class="text-muted">(coming soon)</small> - </a> - </li> - <li> - <a href="#" stop-click> - <i class="fa fa-terminal fa-lg fa-fw fa-li"></i> CLI - <small class="text-muted">(coming soon)</small> - </a> - </li> - </ul> - </div> - </div> - </div> - </div> -</section> diff --git a/web-vault/app/views/organizationLayout.html b/web-vault/app/views/organizationLayout.html @@ -32,14 +32,6 @@ <a ui-sref="backend.user.vault"><i class="fa fa-arrow-left"></i> Return to my vault</a> </div> </div> - <form class="sidebar-form"> - <label for="search" class="sr-only">Search</label> - <div class="form-group has-feedback"> - <input type="text" id="search" class="form-control" placeholder="Search org. vault..." - ng-focus="searchOrganizationVault()" ng-model="main.searchVaultText" /> - <span class="fa fa-search form-control-feedback" aria-hidden="true"></span> - </div> - </form> <ul class="sidebar-menu"> <li class="header">MY ORGANIZATION</li> <li ng-class="{active: $state.is('backend.org.dashboard')}"> diff --git a/web-vault/app/views/userLayout.html b/web-vault/app/views/userLayout.html @@ -32,14 +32,6 @@ <a ui-sref="frontend.logout">Log Out</a> </div> </div> - <form class="sidebar-form"> - <label for="search" class="sr-only">Search</label> - <div class="form-group has-feedback"> - <input type="text" id="search" class="form-control" placeholder="Search my vault..." - ng-focus="searchVault()" ng-model="main.searchVaultText" /> - <span class="fa fa-search form-control-feedback" aria-hidden="true"></span> - </div> - </form> <ul class="sidebar-menu"> <li class="header">WEB VAULT</li> <li class="treeview" ng-class="{active: $state.includes('backend.user.vault')}"> @@ -104,7 +96,7 @@ </ul> </li> <li ng-class="{active: $state.is('backend.user.apps')}"> - <a ui-sref="backend.user.apps"> + <a href="https://bitwarden.com/#download" target="_blank"> <small class="label pull-right bg-green">FREE</small> <i class="fa fa-download fa-fw"></i> <span>Get the Apps</span> </a> diff --git a/web-vault/css/vault.min.css b/web-vault/css/vault.min.css @@ -1 +1 @@ -@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,300italic,400italic,600italic);.wrapper,body{overflow-x:hidden}.btn.uppercase,.description-block>.description-text,.info-box-text,.nav-stacked>li.header{text-transform:uppercase}.box-body:after,.box-comments .box-comment:after,.box-footer:after,.box-header:after,.chat .item:after,.chat .item>.attachment:after,.control-sidebar-menu>li>a:after,.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:after,.navbar-nav>.user-menu>.dropdown-menu>.user-body:after,.timeline>li:after,.user-block:after,.user-panel:after,.wrapper:after{clear:both}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#FFF}.toast-message a:hover{color:#CCC;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#FFF;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8}.toast-top-center,.toast-top-full-width{top:0;right:0;width:100%}.toast-close-button:focus,.toast-close-button:hover{color:#111;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{z-index:999999}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container .toast{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px;-webkit-border-radius:3px 3px 3px 3px;background-position:15px center;background-repeat:no-repeat;color:#FFF;opacity:.8}.ng-anchor,progress-bar{position:absolute}.wrapper,body{overflow-y:auto}#toast-container .toast:hover{-moz-box-shadow:0 0 12px #111;-webkit-box-shadow:0 0 12px #111;box-shadow:0 0 12px #111;opacity:1;cursor:pointer}#toast-container.toast-bottom-center .toast,#toast-container.toast-top-center .toast{width:300px;margin-left:auto;margin-right:auto}#toast-container.toast-bottom-full-width .toast,#toast-container.toast-top-full-width .toast{width:96%;margin-left:auto;margin-right:auto}.toast{background-color:#030303}.toast-success{background-color:#00a65a}.toast-error{background-color:#dd4b39}.toast-info{background-color:#0073b7}.toast-warning{background-color:#FF851B}progress-bar{left:0;bottom:0;height:4px;background-color:#111;opacity:.4}.layout-boxed body,.layout-boxed html,.wrapper,body,html{height:100%}div[toast]{opacity:1!important}div[toast].ng-enter{opacity:0!important;transition:opacity .3s linear}div[toast].ng-enter.ng-enter-active{opacity:1!important}div[toast].ng-leave{opacity:1;transition:opacity .3s linear}div[toast].ng-leave.ng-leave-active{opacity:0!important}@media all and (max-width:240px){#toast-container .toast.div{padding:8px 8px 8px 50px;width:11em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container .toast.div{padding:8px 8px 8px 50px;width:18em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container .toast.div{padding:15px 15px 15px 50px;width:25em}}.ng-cloak,.ng-hide:not(.ng-hide-animate),.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}ng\:form{display:block}.ng-animate-shim{visibility:hidden}body{font-weight:400}.wrapper{position:relative}.wrapper:after,.wrapper:before{content:" ";display:table}.layout-boxed .wrapper{max-width:1250px;margin:0 auto;min-height:100%;box-shadow:0 0 8px rgba(0,0,0,.5);position:relative}.layout-boxed{background:url(../images/boxed-bg.png) fixed}.content-wrapper,.main-footer,.right-side{-webkit-transition:-webkit-transform .3s ease-in-out,margin .3s ease-in-out;-moz-transition:-moz-transform .3s ease-in-out,margin .3s ease-in-out;-o-transition:-o-transform .3s ease-in-out,margin .3s ease-in-out;transition:transform .3s ease-in-out,margin .3s ease-in-out;margin-left:230px;z-index:820}.layout-top-nav .content-wrapper,.layout-top-nav .main-footer,.layout-top-nav .right-side{margin-left:0}@media (min-width:768px){.sidebar-collapse .content-wrapper,.sidebar-collapse .main-footer,.sidebar-collapse .right-side{margin-left:0}}.content-wrapper,.right-side{min-height:100%;background-color:#ecf0f5;z-index:800}.main-footer{background:#fff;padding:15px;color:#444;border-top:1px solid #d2d6de}.fixed .left-side,.fixed .main-header,.fixed .main-sidebar{position:fixed}.fixed .main-header{top:0;right:0;left:0}.fixed .content-wrapper,.fixed .right-side{padding-top:50px}@media (max-width:767px){.content-wrapper,.main-footer,.right-side{margin-left:0}.sidebar-open .content-wrapper,.sidebar-open .main-footer,.sidebar-open .right-side{-webkit-transform:translate(230px,0);-ms-transform:translate(230px,0);-o-transform:translate(230px,0);transform:translate(230px,0)}.fixed .content-wrapper,.fixed .right-side{padding-top:100px}}.fixed.layout-boxed .wrapper{max-width:100%}body.hold-transition .content-wrapper,body.hold-transition .left-side,body.hold-transition .main-footer,body.hold-transition .main-header .logo,body.hold-transition .main-header .navbar,body.hold-transition .main-sidebar,body.hold-transition .right-side{-webkit-transition:none;-o-transition:none;transition:none}.content{min-height:250px;padding:15px;margin-right:auto;margin-left:auto}a{color:#3c8dbc}a:active,a:focus,a:hover{outline:0;text-decoration:none;color:#72afd2}.page-header{margin:10px 0 20px;font-size:22px}.page-header>small{color:#666;display:block;margin-top:5px}.main-header{position:relative;max-height:100px;z-index:1030}.main-header .navbar{margin-bottom:0;margin-left:230px;border:none;min-height:50px;border-radius:0}.layout-top-nav .main-header .navbar{margin-left:0}.main-header #navbar-search-input.form-control{background:rgba(255,255,255,.2);border-color:transparent}.main-header #navbar-search-input.form-control:active,.main-header #navbar-search-input.form-control:focus{border-color:rgba(0,0,0,.1);background:rgba(255,255,255,.9)}.main-header #navbar-search-input.form-control::-moz-placeholder{color:#ccc;opacity:1}.main-header #navbar-search-input.form-control:-ms-input-placeholder{color:#ccc}.main-header #navbar-search-input.form-control::-webkit-input-placeholder{color:#ccc}.main-header .navbar-custom-menu,.main-header .navbar-right{float:right}@media (max-width:991px){.main-header .navbar-custom-menu a,.main-header .navbar-right a{color:inherit;background:0 0}}@media (max-width:767px){.main-header .navbar-right{float:none}.navbar-collapse .main-header .navbar-right{margin:7.5px -15px}.main-header .navbar-right>li{color:inherit;border:0}}.main-header .navbar-brand,.main-header .sidebar-toggle:hover{color:#fff}.main-header .sidebar-toggle{float:left;background-color:transparent;background-image:none;padding:15px;font-family:fontAwesome}.main-header .sidebar-toggle:before{content:"\f0c9"}.main-header .sidebar-toggle:active,.main-header .sidebar-toggle:focus{background:0 0}.main-header .sidebar-toggle .icon-bar{display:none}.main-header .navbar .nav>li.user>a>.fa,.main-header .navbar .nav>li.user>a>.glyphicon,.main-header .navbar .nav>li.user>a>.ion{margin-right:5px}.main-header .navbar .nav>li>a>.label{position:absolute;top:9px;right:7px;text-align:center;font-size:9px;padding:2px 3px;line-height:.9}.main-header .logo{display:block;float:left;height:50px;font-size:20px;line-height:50px;text-align:center;width:230px;padding:0 15px;font-weight:300;overflow:hidden}.main-header .logo .logo-lg{display:block}.main-header .logo .logo-mini{display:none}.content-header{position:relative;padding:15px 15px 0}.content-header>h1{margin:0;font-size:24px}.content-header>h1>small{font-size:15px;display:inline-block;padding-left:4px;font-weight:300}.content-header>.breadcrumb{float:right;background:0 0;margin-top:0;margin-bottom:0;font-size:12px;padding:7px 5px;position:absolute;top:15px;right:10px;border-radius:2px}.content-header>.breadcrumb>li>a{color:#444;text-decoration:none;display:inline-block}.content-header>.breadcrumb>li>a>.fa,.content-header>.breadcrumb>li>a>.glyphicon,.content-header>.breadcrumb>li>a>.ion{margin-right:5px}.content-header>.breadcrumb>li+li:before{content:'>\00a0'}@media (max-width:991px){.content-header>.breadcrumb{position:relative;margin-top:5px;top:0;right:0;float:none;background:#d2d6de;padding-left:10px}.content-header>.breadcrumb li:before{color:#97a0b3}.navbar-custom-menu .navbar-nav>li{float:left}.navbar-custom-menu .navbar-nav{margin:0;float:left}.navbar-custom-menu .navbar-nav>li>a{padding-top:15px;padding-bottom:15px;line-height:20px}}.navbar-toggle{color:#fff;border:0;margin:0;padding:15px}@media (max-width:767px){.main-header{position:relative}.main-header .logo,.main-header .navbar{width:100%;float:none}.main-header .navbar{margin:0}.main-header .navbar-custom-menu{float:right}}@media (max-width:991px){.navbar-collapse.pull-left{float:none!important}.navbar-collapse.pull-left+.navbar-custom-menu{display:block;position:absolute;top:0;right:40px}}.left-side,.main-sidebar{position:absolute;top:0;left:0;padding-top:50px;min-height:100%;width:230px;z-index:810;-webkit-transition:-webkit-transform .3s ease-in-out,width .3s ease-in-out;-moz-transition:-moz-transform .3s ease-in-out,width .3s ease-in-out;-o-transition:-o-transform .3s ease-in-out,width .3s ease-in-out;transition:transform .3s ease-in-out,width .3s ease-in-out}@media (max-width:767px){.left-side,.main-sidebar{padding-top:100px;-webkit-transform:translate(-230px,0);-ms-transform:translate(-230px,0);-o-transform:translate(-230px,0);transform:translate(-230px,0)}}@media (min-width:768px){.sidebar-collapse .left-side,.sidebar-collapse .main-sidebar{-webkit-transform:translate(-230px,0);-ms-transform:translate(-230px,0);-o-transform:translate(-230px,0);transform:translate(-230px,0)}}@media (max-width:767px){.sidebar-open .left-side,.sidebar-open .main-sidebar{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}}.sidebar{padding-bottom:10px}.sidebar-form input:focus{border-color:transparent}.user-panel{position:relative;width:100%;padding:10px;overflow:hidden}.user-panel:after,.user-panel:before{content:" ";display:table}.user-panel>.image>img{width:100%;max-width:45px;height:auto}.user-panel>.info{padding:5px 5px 5px 15px;line-height:1;position:absolute;left:55px}.user-panel>.info>p{font-weight:600;margin-bottom:9px}.user-panel>.info>a{text-decoration:none;padding-right:5px;margin-top:3px;font-size:11px}.user-panel>.info>a>.fa,.user-panel>.info>a>.glyphicon,.user-panel>.info>a>.ion{margin-right:3px}.sidebar-menu{list-style:none;margin:0;padding:0}.sidebar-menu>li{position:relative;margin:0;padding:0}.sidebar-menu>li>a{padding:12px 5px 12px 15px;display:block}.sidebar-menu>li>a>.fa,.sidebar-menu>li>a>.glyphicon,.sidebar-menu>li>a>.ion{width:20px}.sidebar-menu>li .badge,.sidebar-menu>li .label{margin-right:5px}.sidebar-menu>li .badge{margin-top:3px}.sidebar-menu li.header{padding:10px 25px 10px 15px;font-size:12px}.sidebar-menu li>a>.fa-angle-left,.sidebar-menu li>a>.pull-right-container>.fa-angle-left{width:auto;height:auto;padding:0;margin-right:10px}.sidebar-menu li>a>.fa-angle-left{position:absolute;top:50%;right:10px;margin-top:-8px}.sidebar-menu li.active>a>.fa-angle-left,.sidebar-menu li.active>a>.pull-right-container>.fa-angle-left{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.sidebar-menu li.active>.treeview-menu{display:block}.sidebar-menu .treeview-menu{display:none;list-style:none;padding:0 0 0 5px;margin:0}.sidebar-menu .treeview-menu .treeview-menu{padding-left:20px}.sidebar-menu .treeview-menu>li{margin:0}.sidebar-menu .treeview-menu>li>a{padding:5px 5px 5px 15px;display:block;font-size:14px}.sidebar-menu .treeview-menu>li>a>.fa,.sidebar-menu .treeview-menu>li>a>.glyphicon,.sidebar-menu .treeview-menu>li>a>.ion{width:20px}.sidebar-menu .treeview-menu>li>a>.fa-angle-down,.sidebar-menu .treeview-menu>li>a>.fa-angle-left,.sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-down,.sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-left{width:auto}@media (min-width:768px){.sidebar-mini.sidebar-collapse .content-wrapper,.sidebar-mini.sidebar-collapse .main-footer,.sidebar-mini.sidebar-collapse .right-side{margin-left:50px!important;z-index:840}.sidebar-mini.sidebar-collapse .main-sidebar{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0);width:50px!important;z-index:850}.sidebar-mini.sidebar-collapse .sidebar-menu>li{position:relative}.sidebar-mini.sidebar-collapse .sidebar-menu>li>a{margin-right:0}.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>span{border-top-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:not(.treeview)>a>span{border-bottom-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{padding-top:5px;padding-bottom:5px;border-bottom-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>.treeview-menu,.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>span:not(.pull-right){display:block!important;position:absolute;width:180px;left:50px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>span{top:0;margin-left:-3px;padding:12px 5px 12px 20px;background-color:inherit}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>.pull-right-container{position:relative!important;float:right;width:auto!important;left:180px!important;top:-22px!important;z-index:900}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>.pull-right-container>.label:not(:first-of-type){display:none}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>.treeview-menu{top:44px;margin-left:0}.sidebar-mini.sidebar-collapse .main-sidebar .user-panel>.info,.sidebar-mini.sidebar-collapse .sidebar-form,.sidebar-mini.sidebar-collapse .sidebar-menu li.header,.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu,.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>.pull-right,.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>span{display:none!important;-webkit-transform:translateZ(0)}.sidebar-mini.sidebar-collapse .main-header .logo{width:50px}.sidebar-mini.sidebar-collapse .main-header .logo>.logo-mini{display:block;margin-left:-15px;margin-right:-15px;font-size:18px}.sidebar-mini.sidebar-collapse .main-header .logo>.logo-lg{display:none}.sidebar-mini.sidebar-collapse .main-header .navbar{margin-left:50px}.control-sidebar-open .content-wrapper,.control-sidebar-open .main-footer,.control-sidebar-open .right-side{margin-right:230px}}.main-sidebar .user-panel,.sidebar-menu,.sidebar-menu>li.header{white-space:nowrap;overflow:hidden}.sidebar-menu:hover{overflow:visible}.sidebar-form,.sidebar-menu>li.header{overflow:hidden;text-overflow:clip}.sidebar-menu li>a{position:relative}.sidebar-menu li>a>.pull-right-container{position:absolute;right:10px;top:50%;margin-top:-7px}.control-sidebar-bg{z-index:1000;bottom:0}.control-sidebar,.control-sidebar-bg{top:0;right:-230px;width:230px;-webkit-transition:right .3s ease-in-out;-o-transition:right .3s ease-in-out;transition:right .3s ease-in-out}.control-sidebar{padding-top:50px;z-index:1010}@media (max-width:768px){.control-sidebar{padding-top:100px}.nav-tabs.control-sidebar-tabs{display:table}.nav-tabs.control-sidebar-tabs>li{display:table-cell}}.control-sidebar>.tab-content{padding:10px 15px}.control-sidebar-open .control-sidebar,.control-sidebar-open .control-sidebar-bg,.control-sidebar.control-sidebar-open,.control-sidebar.control-sidebar-open+.control-sidebar-bg{right:0}.nav-tabs.control-sidebar-tabs>li:first-of-type>a,.nav-tabs.control-sidebar-tabs>li:first-of-type>a:focus,.nav-tabs.control-sidebar-tabs>li:first-of-type>a:hover{border-left-width:0}.nav-tabs.control-sidebar-tabs>li>a{border-radius:0}.nav-tabs.control-sidebar-tabs>li>a,.nav-tabs.control-sidebar-tabs>li>a:hover{border-top:none;border-right:none;border-left:1px solid transparent;border-bottom:1px solid transparent}.nav-tabs.control-sidebar-tabs>li>a .icon{font-size:16px}.nav-tabs.control-sidebar-tabs>li.active>a,.nav-tabs.control-sidebar-tabs>li.active>a:active,.nav-tabs.control-sidebar-tabs>li.active>a:focus,.nav-tabs.control-sidebar-tabs>li.active>a:hover{border-top:none;border-right:none;border-bottom:none}.control-sidebar-heading{font-weight:400;font-size:16px;margin-bottom:10px}.control-sidebar-subheading{display:block;font-weight:400;font-size:14px}.control-sidebar-menu{list-style:none;padding:0;margin:0 -15px}.control-sidebar-menu>li>a{display:block;padding:10px 15px}.control-sidebar-menu>li>a:after,.control-sidebar-menu>li>a:before{content:" ";display:table}.control-sidebar-menu>li>a>.control-sidebar-subheading{margin-top:0}.control-sidebar-menu .menu-icon{float:left;width:35px;height:35px;border-radius:50%;text-align:center;line-height:35px}.control-sidebar-menu .menu-info{margin-left:45px;margin-top:3px}.control-sidebar-menu .menu-info>.control-sidebar-subheading,.control-sidebar-menu .progress{margin:0}.control-sidebar-menu .menu-info>p{margin:0;font-size:11px}.control-sidebar-dark{color:#b8c7ce}.control-sidebar-dark,.control-sidebar-dark+.control-sidebar-bg{background:#222d32}.control-sidebar-dark .nav-tabs.control-sidebar-tabs{border-bottom:#1c2529}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a{background:#181f23;color:#b8c7ce}.control-sidebar-dark .control-sidebar-heading,.control-sidebar-dark .control-sidebar-subheading,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover{color:#fff}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover{border-left-color:#141a1d;border-bottom-color:#141a1d}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:active,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover{background:#1c2529}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:active,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:hover{background:#222d32;color:#fff}.control-sidebar-dark .control-sidebar-menu>li>a:hover{background:#1e282c}.control-sidebar-dark .control-sidebar-menu>li>a .menu-info>p{color:#b8c7ce}.control-sidebar-light{color:#5e5e5e}.control-sidebar-light,.control-sidebar-light+.control-sidebar-bg{background:#f9fafc;border-left:1px solid #d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs{border-bottom:#d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a{background:#e8ecf4;color:#444}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:hover{border-left-color:#d2d6de;border-bottom-color:#d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:active,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:hover{background:#eff1f7}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:active,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:hover{background:#f9fafc;color:#111}.control-sidebar-light .control-sidebar-heading,.control-sidebar-light .control-sidebar-subheading{color:#111}.control-sidebar-light .control-sidebar-menu{margin-left:-14px}.control-sidebar-light .control-sidebar-menu>li>a:hover{background:#f4f4f5}.control-sidebar-light .control-sidebar-menu>li>a .menu-info>p{color:#5e5e5e}.dropdown-menu{box-shadow:none}.dropdown-menu>li>a>.fa,.dropdown-menu>li>a>.glyphicon,.dropdown-menu>li>a>.ion{margin-right:10px}.dropdown-menu>li>a:hover{background-color:#e1e3e9;color:#333}.dropdown-menu>.divider{background-color:#eee}.navbar-nav>.messages-menu>.dropdown-menu,.navbar-nav>.notifications-menu>.dropdown-menu,.navbar-nav>.tasks-menu>.dropdown-menu{width:280px;padding:0;margin:0;top:100%}.navbar-nav>.messages-menu>.dropdown-menu>li,.navbar-nav>.notifications-menu>.dropdown-menu>li,.navbar-nav>.tasks-menu>.dropdown-menu>li{position:relative}.navbar-nav>.messages-menu>.dropdown-menu>li.header,.navbar-nav>.notifications-menu>.dropdown-menu>li.header,.navbar-nav>.tasks-menu>.dropdown-menu>li.header{background-color:#fff;padding:7px 10px;border-bottom:1px solid #f4f4f4;color:#444;font-size:14px;border-radius:4px 4px 0 0}.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a{font-size:12px;background-color:#fff;padding:7px 10px;border-bottom:1px solid #eee;color:#444!important;text-align:center;border-radius:0 0 4px 4px}@media (max-width:991px){.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a{background:#fff!important;color:#444!important}}.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a:hover,.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a:hover,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a:hover{text-decoration:none;font-weight:400}.navbar-nav>.messages-menu>.dropdown-menu>li .menu,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu{max-height:200px;margin:0;padding:0;list-style:none;overflow-x:hidden}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a{display:block;white-space:nowrap;border-bottom:1px solid #f4f4f4}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:hover,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a:hover,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a:hover{background:#f4f4f4;text-decoration:none}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a{color:#444;overflow:hidden;text-overflow:ellipsis;padding:10px}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.fa,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.glyphicon,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.ion{width:20px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a{margin:0;padding:10px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>div>img{margin:auto 10px auto auto;width:40px;height:40px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>h4{padding:0;margin:0 0 0 45px;color:#444;font-size:15px;position:relative}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>h4>small{color:#999;font-size:10px;position:absolute;top:0;right:0}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>p{margin:0 0 0 45px;font-size:12px;color:#888}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:after,.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:before{content:" ";display:table}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a{padding:10px}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a>h3{font-size:14px;padding:0;margin:0 0 10px;color:#666}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a>.progress{padding:0;margin:0}.navbar-nav>.user-menu>.dropdown-menu{border-top-right-radius:0;border-top-left-radius:0;padding:1px 0 0;border-top-width:0;width:280px}.navbar-nav>.user-menu>.dropdown-menu,.navbar-nav>.user-menu>.dropdown-menu>.user-body{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.navbar-nav>.user-menu>.dropdown-menu>li.user-header{height:175px;padding:10px;text-align:center}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>img{z-index:5;height:90px;width:90px;border:3px solid transparent;border-color:rgba(255,255,255,.2)}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>p{z-index:5;color:#fff;color:rgba(255,255,255,.8);font-size:17px;margin-top:10px}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>p>small{display:block;font-size:12px}.navbar-nav>.user-menu>.dropdown-menu>.user-body:after,.navbar-nav>.user-menu>.dropdown-menu>.user-body:before,.navbar-nav>.user-menu>.dropdown-menu>.user-footer:after,.navbar-nav>.user-menu>.dropdown-menu>.user-footer:before{display:table;content:" "}.navbar-nav>.user-menu>.dropdown-menu>.user-body{padding:15px;border-bottom:1px solid #f4f4f4;border-top:1px solid #ddd}.navbar-nav>.user-menu>.dropdown-menu>.user-body a{color:#444!important}@media (max-width:991px){.navbar-nav>.user-menu>.dropdown-menu>.user-body a{background:#fff!important;color:#444!important}.navbar-nav>.user-menu>.dropdown-menu>.user-footer .btn-default:hover{background-color:#f9f9f9}}.navbar-nav>.user-menu>.dropdown-menu>.user-footer{background-color:#f9f9f9;padding:10px}.navbar-nav>.user-menu>.dropdown-menu>.user-footer:after{clear:both}.navbar-nav>.user-menu>.dropdown-menu>.user-footer .btn-default{color:#666}.navbar-nav>.user-menu .user-image{float:left;width:25px;height:25px;border-radius:50%;margin-right:10px;margin-top:-2px}@media (max-width:767px){.navbar-nav>.user-menu .user-image{float:none;margin-right:0;margin-top:-8px;line-height:10px}}.open:not(.dropup)>.animated-dropdown-menu{backface-visibility:visible!important;-webkit-animation:flipInX .7s both;-o-animation:flipInX .7s both;animation:flipInX .7s both}@keyframes flipInX{0%{transform:perspective(400px) rotate3d(1,0,0,90deg);transition-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotate3d(1,0,0,-20deg);transition-timing-function:ease-in}60%{transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{transform:perspective(400px)}}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);-webkit-transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);-webkit-transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{-webkit-transform:perspective(400px)}}.navbar-custom-menu>.navbar-nav>li{position:relative}.navbar-custom-menu>.navbar-nav>li>.dropdown-menu{position:absolute;right:0;left:auto}@media (max-width:991px){.navbar-custom-menu>.navbar-nav{float:right}.navbar-custom-menu>.navbar-nav>li{position:static}.navbar-custom-menu>.navbar-nav>li>.dropdown-menu{position:absolute;right:5%;left:auto;border:1px solid #ddd;background:#fff}}.progress-striped .progress-bar-green,.progress-striped .progress-bar-light-blue,.progress-striped .progress-bar-primary,.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.form-control{box-shadow:none;border-color:#d2d6de}.form-control:focus{border-color:#3c8dbc;box-shadow:none}.form-control:-ms-input-placeholder,.form-control::-moz-placeholder,.form-control::-webkit-input-placeholder{color:#bbb;opacity:1}.form-group.has-success .help-block,.form-group.has-success label{color:#00a65a}.form-control:not(select){-webkit-appearance:none;-moz-appearance:none;appearance:none}.form-group.has-success .form-control,.form-group.has-success .input-group-addon{border-color:#00a65a;box-shadow:none}.form-group.has-warning .help-block,.form-group.has-warning label{color:#bf7e16}.form-group.has-warning .form-control,.form-group.has-warning .input-group-addon{border-color:#bf7e16;box-shadow:none}.form-group.has-error .help-block,.form-group.has-error label{color:#dd4b39}.form-group.has-error .form-control,.form-group.has-error .input-group-addon{border-color:#dd4b39;box-shadow:none}.input-group .input-group-addon{border-radius:0;border-color:#d2d6de;background-color:#fff}.btn-group-vertical .btn.btn-flat:first-of-type,.btn-group-vertical .btn.btn-flat:last-of-type{border-radius:0}.progress,.progress .progress-bar,.progress-sm,.progress-sm .progress-bar,.progress-xs,.progress-xs .progress-bar,.progress-xxs,.progress-xxs .progress-bar,.progress.sm,.progress.sm .progress-bar,.progress.xs,.progress.xs .progress-bar,.progress.xxs,.progress.xxs .progress-bar,.progress>.progress-bar,.progress>.progress-bar .progress-bar{border-radius:1px}.icheck>label{padding-left:0}.form-control-feedback.fa{line-height:34px}.form-group-lg .form-control+.form-control-feedback.fa,.input-group-lg+.form-control-feedback.fa,.input-lg+.form-control-feedback.fa{line-height:46px}.form-group-sm .form-control+.form-control-feedback.fa,.input-group-sm+.form-control-feedback.fa,.input-sm+.form-control-feedback.fa{line-height:30px}.progress,.progress>.progress-bar{-webkit-box-shadow:none;box-shadow:none}.box,.small-box{box-shadow:0 1px 1px rgba(0,0,0,.1)}.progress-sm,.progress.sm{height:10px}.progress-xs,.progress.xs{height:7px}.progress-xxs,.progress.xxs{height:3px}.progress.vertical{position:relative;width:30px;height:200px;display:inline-block;margin-right:10px}.progress.vertical>.progress-bar{width:100%;position:absolute;bottom:0}.progress.vertical.progress-sm,.progress.vertical.sm{width:20px}.progress.vertical.progress-xs,.progress.vertical.xs{width:10px}.progress.vertical.progress-xxs,.progress.vertical.xxs{width:3px}.progress-group .progress-text{font-weight:600}.progress-group .progress-number{float:right}.table tr>td .progress{margin:0}.progress-bar-light-blue,.progress-bar-primary{background-color:#3c8dbc}.progress-striped .progress-bar-light-blue,.progress-striped .progress-bar-primary{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-green,.progress-bar-success{background-color:#00a65a}.progress-striped .progress-bar-green,.progress-striped .progress-bar-success{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-striped .progress-bar-aqua,.progress-striped .progress-bar-info,.progress-striped .progress-bar-warning,.progress-striped .progress-bar-yellow{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-aqua,.progress-bar-info{background-color:#00c0ef}.progress-striped .progress-bar-aqua,.progress-striped .progress-bar-info{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning,.progress-bar-yellow{background-color:#bf7e16}.progress-striped .progress-bar-warning,.progress-striped .progress-bar-yellow{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger,.progress-bar-red{background-color:#dd4b39}.progress-striped .progress-bar-danger,.progress-striped .progress-bar-red{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.small-box{border-radius:2px;position:relative;display:block;margin-bottom:20px}.small-box>.inner{padding:10px}.small-box>.small-box-footer{position:relative;text-align:center;padding:3px 0;color:#fff;color:rgba(255,255,255,.8);display:block;z-index:10;background:rgba(0,0,0,.1);text-decoration:none}.small-box>.small-box-footer:hover{color:#fff;background:rgba(0,0,0,.15)}.small-box h3{font-size:38px;font-weight:700;margin:0 0 10px;white-space:nowrap;padding:0}.small-box p{font-size:15px}.small-box p>small{display:block;color:#f9f9f9;font-size:13px;margin-top:5px}.small-box h3,.small-box p{z-index:5}.small-box .icon{-webkit-transition:all .3s linear;-o-transition:all .3s linear;transition:all .3s linear;position:absolute;top:-10px;right:10px;z-index:0;font-size:90px;color:rgba(0,0,0,.15)}.small-box:hover{text-decoration:none;color:#f9f9f9}.small-box:hover .icon{font-size:95px}@media (max-width:767px){.small-box{text-align:center}.small-box .icon{display:none}.small-box p{font-size:12px}}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%}.box.box-primary{border-top-color:#3c8dbc}.box.box-info{border-top-color:#00c0ef}.box.box-danger{border-top-color:#dd4b39}.box.box-warning{border-top-color:#bf7e16}.box.box-success{border-top-color:#00a65a}.box.box-default{border-top-color:#d2d6de}.box.collapsed-box .box-body,.box.collapsed-box .box-footer{display:none}.box .nav-stacked>li{border-bottom:1px solid #f4f4f4;margin:0}.box .nav-stacked>li:last-of-type{border-bottom:none}.box.height-control .box-body{max-height:300px;overflow:auto}.box .border-right{border-right:1px solid #f4f4f4}.box .border-left{border-left:1px solid #f4f4f4}.box.box-solid{border-top:0}.box.box-solid>.box-header .btn.btn-default{background:0 0}.box.box-solid>.box-header .btn:hover,.box.box-solid>.box-header a:hover{background:rgba(0,0,0,.1)}.box.box-solid.box-default{border:1px solid #d2d6de}.box.box-solid.box-default>.box-header{color:#444;background:#d2d6de}.box.box-solid.box-default>.box-header .btn,.box.box-solid.box-default>.box-header a{color:#444}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid.box-primary>.box-header{color:#fff;background:#3c8dbc}.box.box-solid.box-primary>.box-header .btn,.box.box-solid.box-primary>.box-header a{color:#fff}.box.box-solid.box-info{border:1px solid #00c0ef}.box.box-solid.box-info>.box-header{color:#fff;background:#00c0ef}.box.box-solid.box-info>.box-header .btn,.box.box-solid.box-info>.box-header a{color:#fff}.box.box-solid.box-danger{border:1px solid #dd4b39}.box.box-solid.box-danger>.box-header{color:#fff;background:#dd4b39}.box.box-solid.box-danger>.box-header .btn,.box.box-solid.box-danger>.box-header a{color:#fff}.box.box-solid.box-warning{border:1px solid #bf7e16}.box.box-solid.box-warning>.box-header{color:#fff;background:#bf7e16}.box.box-solid.box-warning>.box-header .btn,.box.box-solid.box-warning>.box-header a{color:#fff}.box.box-solid.box-success{border:1px solid #00a65a}.box.box-solid.box-success>.box-header{color:#fff;background:#00a65a}.box.box-solid.box-success>.box-header .btn,.box.box-solid.box-success>.box-header a{color:#fff}.box.box-solid>.box-header>.box-tools .btn{border:0;box-shadow:none}.box.box-solid[class*=bg]>.box-header{color:#fff}.box .box-group>.box{margin-bottom:5px}.box .knob-label{text-align:center;color:#333;font-weight:100;font-size:12px;margin-bottom:.3em}.box>.loading-img,.box>.overlay,.overlay-wrapper>.loading-img,.overlay-wrapper>.overlay{position:absolute;top:0;left:0;width:100%;height:100%}.box .overlay,.overlay-wrapper .overlay{z-index:50;background:rgba(255,255,255,.7);border-radius:3px}.box .overlay>.fa,.overlay-wrapper .overlay>.fa{position:absolute;top:50%;left:50%;margin-left:-15px;margin-top:-15px;color:#000;font-size:30px}.box .overlay.dark,.overlay-wrapper .overlay.dark{background:rgba(0,0,0,.5)}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box-header{color:#444;display:block;padding:10px;position:relative}.box-header.with-border{border-bottom:1px solid #f4f4f4}.collapsed-box .box-header.with-border{border-bottom:none}.box-header .box-title,.box-header>.fa,.box-header>.glyphicon,.box-header>.ion{display:inline-block;font-size:18px;margin:0;line-height:1}.box-header>.fa,.box-header>.glyphicon,.box-header>.ion{margin-right:5px}.box-header>.box-tools{position:absolute;right:10px;top:5px}.box-header>.box-tools [data-toggle=tooltip],.timeline{position:relative}.box-header>.box-tools.pull-right .dropdown-menu{right:0;left:auto}.box-header>.box-tools .dropdown-menu>li>a{color:#444!important}.btn-box-tool{padding:5px;font-size:12px;background:0 0;color:#97a0b3}.btn-box-tool:hover,.open .btn-box-tool{color:#606c84}.btn-box-tool.btn:active{box-shadow:none}.box-body{padding:10px;border-radius:0 0 3px 3px}.no-header .box-body{border-top-right-radius:3px;border-top-left-radius:3px}.box-body>.table{margin-bottom:0}.box-body .fc{margin-top:5px}.box-body .full-width-chart{margin:-19px}.box-body.no-padding .full-width-chart{margin:-9px}.box-body .box-pane{border-radius:0 0 0 3px}.box-body .box-pane-right{border-radius:0 0 3px}.box-footer{border-top:1px solid #f4f4f4;padding:10px;background-color:#fff;border-radius:0 0 3px 3px}@media (max-width:991px){.chart-legend>li{float:left;margin-right:10px}}.box-comments{background:#f7f7f7}.box-comments .box-comment{padding:8px 0;border-bottom:1px solid #eee}.box-comments .box-comment:after,.box-comments .box-comment:before{content:" ";display:table}.box-comments .box-comment:last-of-type{border-bottom:0}.box-comments .box-comment:first-of-type{padding-top:0}.box-comments .box-comment img{float:left}.box-comments .comment-text{margin-left:40px;color:#555}.box-comments .username{color:#444;display:block;font-weight:600}.box-comments .text-muted{font-weight:400;font-size:12px}.todo-list{margin:0;padding:0;list-style:none;overflow:auto}.todo-list>li{border-radius:2px;padding:10px;background:#f4f4f4;margin-bottom:2px;border-left:2px solid #e6e7e8;color:#444}.todo-list>li:last-of-type{margin-bottom:0}.todo-list>li>input[type=checkbox]{margin:0 10px 0 5px}.todo-list>li .text{display:inline-block;margin-left:5px;font-weight:600}.todo-list>li .label{margin-left:10px;font-size:9px}.todo-list>li .tools{display:none;float:right;color:#dd4b39}.todo-list .handle,.todo-list>li:hover .tools{display:inline-block}.todo-list>li .tools>.fa,.todo-list>li .tools>.glyphicon,.todo-list>li .tools>.ion{margin-right:5px;cursor:pointer}.todo-list>li.done{color:#999}.todo-list>li.done .text{text-decoration:line-through;font-weight:500}.todo-list>li.done .label{background:#d2d6de!important}.todo-list .danger{border-left-color:#dd4b39}.todo-list .warning{border-left-color:#bf7e16}.todo-list .info{border-left-color:#00c0ef}.todo-list .success{border-left-color:#00a65a}.todo-list .primary{border-left-color:#3c8dbc}.todo-list .handle{cursor:move;margin:0 5px}.chat{padding:5px 20px 5px 10px}.chat .item{margin-bottom:10px}.chat .item:after,.chat .item:before{content:" ";display:table}.chat .item>img{width:40px;height:40px;border:2px solid transparent;border-radius:50%}.chat .item>.online{border:2px solid #00a65a}.chat .item>.offline{border:2px solid #dd4b39}.chat .item>.message{margin-left:55px;margin-top:-40px}.chat .item>.message>.name{display:block;font-weight:600}.chat .item>.attachment{border-radius:3px;background:#f4f4f4;margin-left:65px;margin-right:15px;padding:10px}.chat .item>.attachment>h4{margin:0 0 5px;font-weight:600;font-size:14px}.chat .item>.attachment>.filename,.chat .item>.attachment>p{font-weight:600;font-size:13px;font-style:italic;margin:0}.chat .item>.attachment:after,.chat .item>.attachment:before{content:" ";display:table}.box-input{max-width:200px}.modal .panel-body{color:#444}.info-box{display:block;min-height:90px;background:#fff;width:100%;box-shadow:0 1px 1px rgba(0,0,0,.1);border-radius:2px;margin-bottom:15px}.info-box small{font-size:14px}.info-box .progress{background:rgba(0,0,0,.2);margin:5px -10px;height:2px}.info-box .progress,.info-box .progress .progress-bar{border-radius:0}.info-box .progress .progress-bar{background:#fff}.info-box-icon{display:block;float:left;height:90px;width:90px;text-align:center;font-size:45px;line-height:90px;background:rgba(0,0,0,.2);border-radius:2px 0 0 2px}.info-box-icon>img{max-width:100%}.info-box-content{padding:5px 10px;margin-left:90px}.info-box-number{display:block;font-weight:700;font-size:18px}.info-box-text,.progress-description{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.info-box-more{display:block}.progress-description{margin:0}.timeline{margin:0 0 30px;padding:0;list-style:none}.timeline:before{content:'';position:absolute;top:0;bottom:0;width:4px;background:#ddd;left:31px;margin:0;border-radius:2px}.timeline>li{position:relative;margin-right:10px;margin-bottom:15px}.timeline>li:after,.timeline>li:before{content:" ";display:table}.timeline>li>.timeline-item{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border-radius:3px;margin-top:0;background:#fff;color:#444;margin-left:60px;margin-right:15px;padding:0;position:relative}.timeline>li>.timeline-item>.time{color:#999;float:right;padding:10px;font-size:12px}.timeline>li>.timeline-item>.timeline-header{margin:0;color:#555;border-bottom:1px solid #f4f4f4;padding:10px;font-size:16px;line-height:1.1}.timeline>li>.timeline-item>.timeline-header>a{font-weight:600}.timeline>li>.timeline-item>.timeline-body,.timeline>li>.timeline-item>.timeline-footer{padding:10px}.timeline>li>.fa,.timeline>li>.glyphicon,.timeline>li>.ion{width:30px;height:30px;font-size:15px;line-height:30px;position:absolute;color:#666;background:#d2d6de;border-radius:50%;text-align:center;left:18px;top:0}.timeline>.time-label>span{font-weight:600;padding:5px;display:inline-block;background-color:#fff;border-radius:4px}.timeline-inverse>li>.timeline-item{background:#f0f0f0;border:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none}.btn,.btn-app{border-radius:3px}.timeline-inverse>li>.timeline-item>.timeline-header{border-bottom-color:#ddd}.btn{-webkit-box-shadow:none;box-shadow:none;border:1px solid transparent}.btn.btn-flat{border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;border-width:1px}.btn:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:focus{outline:0}.btn.btn-file{position:relative;overflow:hidden}.btn.btn-file>input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;opacity:0;filter:alpha(opacity=0);outline:0;background:#fff;cursor:inherit;display:block}.btn-app,table.text-center,table.text-center td,table.text-center th{text-align:center}.btn-default{background-color:#f4f4f4;color:#444;border-color:#ddd}.btn-default.hover,.btn-default:active,.btn-default:hover{background-color:#e7e7e7}.btn-primary,.skin-blue .main-header .navbar{background-color:#3c8dbc}.btn-primary{border-color:#367fa9}.btn-primary.hover,.btn-primary:active,.btn-primary:hover{background-color:#367fa9}.btn-success{background-color:#00a65a;border-color:#008d4c}.btn-success.hover,.btn-success:active,.btn-success:hover{background-color:#008d4c}.btn-info{background-color:#00c0ef;border-color:#00acd6}.btn-info.hover,.btn-info:active,.btn-info:hover{background-color:#00acd6}.btn-danger{background-color:#dd4b39;border-color:#d73925}.btn-danger.hover,.btn-danger:active,.btn-danger:hover{background-color:#d73925}.btn-warning{background-color:#bf7e16;border-color:#a86f13}.btn-warning.hover,.btn-warning:active,.btn-warning:hover{background-color:#a86f13}.btn-outline{border:1px solid #fff;background:0 0;color:#fff}.btn-outline:active,.btn-outline:focus,.btn-outline:hover{color:rgba(255,255,255,.7);border-color:rgba(255,255,255,.7)}.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn[class*=bg-]:hover{-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,.2);box-shadow:inset 0 0 100px rgba(0,0,0,.2)}.btn-app{position:relative;padding:15px 5px;margin:0 0 10px 10px;min-width:80px;height:60px;color:#666;border:1px solid #ddd;background-color:#f4f4f4;font-size:12px}.alert,.callout{border-radius:3px}.btn-app>.fa,.btn-app>.glyphicon,.btn-app>.ion{font-size:20px;display:block}.btn-app:hover{background:#f4f4f4;color:#444;border-color:#aaa}.btn-app:active,.btn-app:focus{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-app>.badge{position:absolute;top:-3px;right:-10px;font-size:10px;font-weight:400}.alert h4,.callout h4,.nav-pills>li.active>a{font-weight:600}.callout{margin:0 0 20px;padding:15px 30px 15px 15px;border-left:5px solid #eee}.callout a{color:#fff;text-decoration:underline}.callout a:hover{color:#eee}.callout h4{margin-top:0}.callout p:last-child{margin-bottom:0}.callout .highlight,.callout code{background-color:#fff}.callout.callout-danger{border-color:#c23321}.callout.callout-warning{border-color:#916011}.callout.callout-info{border-color:#0097bc}.callout.callout-success{border-color:#00733e}.alert .icon{margin-right:10px}.alert .close{color:#000;opacity:.2;filter:alpha(opacity=20)}.alert .close:hover{opacity:.5;filter:alpha(opacity=50)}.alert a{color:#fff;text-decoration:underline}.callout a.btn,.skin-blue .sidebar a:hover,.skin-blue-light .sidebar a:hover{text-decoration:none}.alert-success{border-color:#008d4c}.alert-danger,.alert-error{border-color:#d73925}.alert-warning{border-color:#a86f13}.alert-info{border-color:#00acd6}.nav>li>a:active,.nav>li>a:focus,.nav>li>a:hover{color:#444;background:#f7f7f7}.nav-pills>li>a{border-radius:0;border-top:3px solid transparent;color:#444}.nav-pills>li>a>.fa,.nav-pills>li>a>.glyphicon,.nav-pills>li>a>.ion{margin-right:5px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{border-top-color:#3c8dbc}.nav-stacked>li>a{border-radius:0;border-top:0;border-left:3px solid transparent;color:#444}.nav-stacked>li.active>a,.nav-stacked>li.active>a:hover{background:0 0;color:#444;border-top:0;border-left-color:#3c8dbc}.nav-stacked>li.header{border-bottom:1px solid #ddd;color:#777;margin-bottom:10px;padding:5px 10px}.nav-tabs-custom{margin-bottom:20px;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.1);border-radius:3px}.nav-tabs-custom>.nav-tabs{margin:0;border-bottom-color:#f4f4f4;border-top-right-radius:3px;border-top-left-radius:3px}.nav-tabs-custom>.nav-tabs>li{border-top:3px solid transparent;margin-bottom:-2px;margin-right:5px}.nav-tabs-custom>.nav-tabs>li>a{color:#444;border-radius:0}.nav-tabs-custom>.nav-tabs>li>a.text-muted,.nav-tabs-custom>.nav-tabs>li>a:hover{color:#999}.nav-tabs-custom>.nav-tabs>li>a,.nav-tabs-custom>.nav-tabs>li>a:hover{background:0 0;margin:0}.nav-tabs-custom>.nav-tabs>li:not(.active)>a:active,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:focus,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:hover{border-color:transparent}.nav-tabs-custom>.nav-tabs>li.active{border-top-color:#3c8dbc}.nav-tabs-custom>.nav-tabs>li.active:hover>a,.nav-tabs-custom>.nav-tabs>li.active>a{background-color:#fff;color:#444}.nav-tabs-custom>.nav-tabs>li.active>a{border-top-color:transparent;border-left-color:#f4f4f4;border-right-color:#f4f4f4}.nav-tabs-custom>.nav-tabs>li:first-of-type{margin-left:0}.nav-tabs-custom>.nav-tabs>li:first-of-type.active>a{border-left-color:transparent}.nav-tabs-custom>.nav-tabs.pull-right{float:none!important}.nav-tabs-custom>.nav-tabs.pull-right>li{float:right}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type{margin-right:0}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type>a{border-left-width:1px}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type.active>a{border-left-color:#f4f4f4;border-right-color:transparent}.nav-tabs-custom>.nav-tabs>li.header{line-height:35px;padding:0 10px;font-size:20px;color:#444}.nav-tabs-custom>.nav-tabs>li.header>.fa,.nav-tabs-custom>.nav-tabs>li.header>.glyphicon,.nav-tabs-custom>.nav-tabs>li.header>.ion{margin-right:5px}.nav-tabs-custom>.tab-content{background:#fff;padding:10px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.nav-tabs-custom .dropdown.open>a:active,.nav-tabs-custom .dropdown.open>a:focus{background:0 0;color:#999}.nav-tabs-custom.tab-primary>.nav-tabs>li.active{border-top-color:#3c8dbc}.nav-tabs-custom.tab-info>.nav-tabs>li.active{border-top-color:#00c0ef}.nav-tabs-custom.tab-danger>.nav-tabs>li.active{border-top-color:#dd4b39}.nav-tabs-custom.tab-warning>.nav-tabs>li.active{border-top-color:#bf7e16}.nav-tabs-custom.tab-success>.nav-tabs>li.active{border-top-color:#00a65a}.nav-tabs-custom.tab-default>.nav-tabs>li.active{border-top-color:#d2d6de}.pagination>li>a{background:#fafafa;color:#666}.pagination.pagination-flat>li>a{border-radius:0!important}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{border-top:1px solid #f4f4f4}.table>thead>tr>th{border-bottom:2px solid #f4f4f4}.table tr td .progress{margin-top:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #f4f4f4}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table.no-border,.table.no-border td,.table.no-border th{border:0}.table.align th{text-align:left}.table.align td{text-align:right}.label-default{background-color:#d2d6de;color:#444}.modal{background:rgba(0,0,0,.3)}.modal-content{border-radius:0;-webkit-box-shadow:0 2px 3px rgba(0,0,0,.125);box-shadow:0 2px 3px rgba(0,0,0,.125);border:0}@media (min-width:768px){.modal-content{-webkit-box-shadow:0 2px 3px rgba(0,0,0,.125);box-shadow:0 2px 3px rgba(0,0,0,.125)}}.modal-header{border-bottom-color:#f4f4f4}.modal-footer{border-top-color:#f4f4f4}.modal-primary .modal-footer,.modal-primary .modal-header{border-color:#307095}.modal-warning .modal-footer,.modal-warning .modal-header{border-color:#916011}.modal-info .modal-footer,.modal-info .modal-header{border-color:#0097bc}.modal-success .modal-footer,.modal-success .modal-header{border-color:#00733e}.modal-danger .modal-footer,.modal-danger .modal-header{border-color:#c23321}.login-logo,.register-logo{font-size:35px;text-align:center;font-weight:300}.login-logo a,.register-logo a{color:#444}.login-page,.register-page{background:#d2d6de}@media (max-width:768px){.login-box,.register-box{width:90%;margin-top:20px}}.login-box-body,.register-box-body{background:#fff;padding:20px;border-top:0;color:#666}.login-box-body .form-control-feedback,.register-box-body .form-control-feedback{color:#777}.login-box-msg,.register-box-msg{margin:0;text-align:center;padding:0 20px 20px}.social-auth-links{margin:10px 0}.error-page{width:600px;margin:20px auto 0}.error-page>.headline{float:left;font-size:100px;font-weight:300}.error-page>.error-content{margin-left:190px;display:block}.error-page>.error-content>h3{font-weight:300;font-size:25px}@media (max-width:991px){.error-page{width:100%}.error-page>.headline{float:none;text-align:center}.error-page>.error-content{margin-left:0}.error-page>.error-content>h3{text-align:center}}.pad{padding:10px}.margin{margin:10px}.margin-bottom{margin-bottom:20px}.margin-bottom-none{margin-bottom:0}.margin-r-5{margin-right:5px}.inline{display:inline}.description-block{display:block;margin:10px 0;text-align:center}.description-block.margin-bottom{margin-bottom:25px}.description-block>.description-header{margin:0;padding:0;font-weight:600;font-size:16px}.list-header,.text-bold,.text-bold.table td,.text-bold.table th{font-weight:700}#toast-container .toast.toast-danger,#toast-container .toast.toast-error,#toast-container .toast.toast-info,#toast-container .toast.toast-success,#toast-container .toast.toast-warning,.alert-danger,.alert-error,.alert-info,.alert-success,.alert-warning,.bg-aqua,.bg-aqua-active,.bg-black,.bg-black-active,.bg-blue,.bg-blue-active,.bg-fuchsia,.bg-fuchsia-active,.bg-green,.bg-green-active,.bg-light-blue,.bg-light-blue-active,.bg-lime,.bg-lime-active,.bg-maroon,.bg-maroon-active,.bg-navy,.bg-navy-active,.bg-olive,.bg-olive-active,.bg-orange,.bg-orange-active,.bg-purple,.bg-purple-active,.bg-red,.bg-red-active,.bg-teal,.bg-teal-active,.bg-yellow,.bg-yellow-active,.callout.callout-danger,.callout.callout-info,.callout.callout-success,.callout.callout-warning,.label-danger,.label-info,.label-primary,.label-success,.label-warning,.modal-danger .modal-body,.modal-danger .modal-footer,.modal-danger .modal-header,.modal-info .modal-body,.modal-info .modal-footer,.modal-info .modal-header,.modal-primary .modal-body,.modal-primary .modal-footer,.modal-primary .modal-header,.modal-success .modal-body,.modal-success .modal-footer,.modal-success .modal-header,.modal-warning .modal-body,.modal-warning .modal-footer,.modal-warning .modal-header{color:#fff!important}.bg-gray{color:#000;background-color:#d2d6de!important}.bg-gray-light,.box .callout.callout-default,.login-box-body .callout.callout-default,.modal .callout.callout-default,.register-box-body .callout.callout-default{background-color:#f7f7f7}.bg-black{background-color:#111!important}#toast-container .toast.toast-danger,#toast-container .toast.toast-error,.alert-danger,.alert-error,.bg-red,.callout.callout-danger,.label-danger,.modal-danger .modal-body{background-color:#dd4b39!important}#toast-container .toast.toast-warning,.alert-warning,.bg-yellow,.callout.callout-warning,.label-warning,.modal-warning .modal-body{background-color:#bf7e16!important}#toast-container .toast.toast-info,.alert-info,.bg-aqua,.callout.callout-info,.label-info,.modal-info .modal-body{background-color:#00c0ef!important}.bg-blue{background-color:#0073b7!important}.bg-light-blue,.label-primary,.modal-primary .modal-body{background-color:#3c8dbc!important}#toast-container .toast.toast-success,.alert-success,.bg-green,.callout.callout-success,.label-success,.modal-success .modal-body{background-color:#00a65a!important}.bg-navy{background-color:#001F3F!important}.bg-teal{background-color:#39CCCC!important}.bg-olive{background-color:#3D9970!important}.bg-lime{background-color:#01FF70!important}.bg-orange{background-color:#FF851B!important}.bg-fuchsia{background-color:#F012BE!important}.bg-purple{background-color:#605ca8!important}.bg-maroon{background-color:#D81B60!important}.bg-gray-active{color:#000;background-color:#b5bbc8!important}.bg-black-active{background-color:#000!important}.bg-red-active,.modal-danger .modal-footer,.modal-danger .modal-header{background-color:#d33724!important}.bg-yellow-active,.modal-warning .modal-footer,.modal-warning .modal-header{background-color:#a46c13!important}.bg-aqua-active,.modal-info .modal-footer,.modal-info .modal-header{background-color:#00a7d0!important}.bg-blue-active{background-color:#005384!important}.bg-light-blue-active,.modal-primary .modal-footer,.modal-primary .modal-header{background-color:#357ca5!important}.bg-green-active,.modal-success .modal-footer,.modal-success .modal-header{background-color:#008d4c!important}.bg-navy-active{background-color:#001a35!important}.bg-teal-active{background-color:#30bbbb!important}.bg-olive-active{background-color:#368763!important}.bg-lime-active{background-color:#00e765!important}.bg-orange-active{background-color:#ff7701!important}.bg-fuchsia-active{background-color:#db0ead!important}.bg-purple-active{background-color:#555299!important}.bg-maroon-active{background-color:#ca195a!important}[class^=bg-].disabled{opacity:.65;filter:alpha(opacity=65)}.text-red{color:#dd4b39!important}.text-yellow{color:#bf7e16!important}.text-aqua{color:#00c0ef!important}.text-blue{color:#0073b7!important}.text-black{color:#111!important}.text-light-blue{color:#3c8dbc!important}.text-green{color:#00a65a!important}.text-gray{color:#d2d6de!important}.text-navy{color:#001F3F!important}.text-teal{color:#39CCCC!important}.text-olive{color:#3D9970!important}.text-lime{color:#01FF70!important}.text-orange{color:#FF851B!important}.text-fuchsia{color:#F012BE!important}.text-purple{color:#605ca8!important}.text-maroon{color:#D81B60!important}.link-muted{color:#7a869d}.link-muted:focus,.link-muted:hover{color:#606c84}.link-black{color:#666}.link-black:focus,.link-black:hover{color:#999}.hide{display:none!important}.no-border{border:0!important}.no-padding{padding:0!important}.no-margin{margin:0!important}.no-shadow{box-shadow:none!important}.chart-legend,.list-unstyled{list-style:none;margin:0;padding:0}.list-group-unbordered>.list-group-item{border-left:0;border-right:0;border-radius:0;padding-left:0;padding-right:0}.flat{border-radius:0!important}.text-sm{font-size:12px}.jqstooltip{padding:5px!important;width:auto!important;height:auto!important}.bg-teal-gradient{background:#39CCCC!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#39CCCC),color-stop(1,#7adddd))!important;background:-ms-linear-gradient(bottom,#39CCCC,#7adddd)!important;background:-moz-linear-gradient(center bottom,#39CCCC 0,#7adddd 100%)!important;background:-o-linear-gradient(#7adddd,#39CCCC)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39CCCC', GradientType=0)!important;color:#fff}.bg-light-blue-gradient{background:#3c8dbc!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#3c8dbc),color-stop(1,#67a8ce))!important;background:-ms-linear-gradient(bottom,#3c8dbc,#67a8ce)!important;background:-moz-linear-gradient(center bottom,#3c8dbc 0,#67a8ce 100%)!important;background:-o-linear-gradient(#67a8ce,#3c8dbc)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#67a8ce', endColorstr='#3c8dbc', GradientType=0)!important;color:#fff}.bg-blue-gradient{background:#0073b7!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#0073b7),color-stop(1,#0089db))!important;background:-ms-linear-gradient(bottom,#0073b7,#0089db)!important;background:-moz-linear-gradient(center bottom,#0073b7 0,#0089db 100%)!important;background:-o-linear-gradient(#0089db,#0073b7)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0089db', endColorstr='#0073b7', GradientType=0)!important;color:#fff}.bg-aqua-gradient{background:#00c0ef!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#00c0ef),color-stop(1,#14d1ff))!important;background:-ms-linear-gradient(bottom,#00c0ef,#14d1ff)!important;background:-moz-linear-gradient(center bottom,#00c0ef 0,#14d1ff 100%)!important;background:-o-linear-gradient(#14d1ff,#00c0ef)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#14d1ff', endColorstr='#00c0ef', GradientType=0)!important;color:#fff}.bg-yellow-gradient{background:#bf7e16!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#bf7e16),color-stop(1,#e9a73e))!important;background:-ms-linear-gradient(bottom,#bf7e16,#e9a73e)!important;background:-moz-linear-gradient(center bottom,#bf7e16 0,#e9a73e 100%)!important;background:-o-linear-gradient(#e9a73e,#bf7e16)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9a73e', endColorstr='#bf7e16', GradientType=0)!important;color:#fff}.bg-purple-gradient{background:#605ca8!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#605ca8),color-stop(1,#9491c4))!important;background:-ms-linear-gradient(bottom,#605ca8,#9491c4)!important;background:-moz-linear-gradient(center bottom,#605ca8 0,#9491c4 100%)!important;background:-o-linear-gradient(#9491c4,#605ca8)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#9491c4', endColorstr='#605ca8', GradientType=0)!important;color:#fff}.bg-green-gradient{background:#00a65a!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#00a65a),color-stop(1,#00ca6d))!important;background:-ms-linear-gradient(bottom,#00a65a,#00ca6d)!important;background:-moz-linear-gradient(center bottom,#00a65a 0,#00ca6d 100%)!important;background:-o-linear-gradient(#00ca6d,#00a65a)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ca6d', endColorstr='#00a65a', GradientType=0)!important;color:#fff}.bg-red-gradient{background:#dd4b39!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#dd4b39),color-stop(1,#e47365))!important;background:-ms-linear-gradient(bottom,#dd4b39,#e47365)!important;background:-moz-linear-gradient(center bottom,#dd4b39 0,#e47365 100%)!important;background:-o-linear-gradient(#e47365,#dd4b39)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e47365', endColorstr='#dd4b39', GradientType=0)!important;color:#fff}.bg-black-gradient{background:#111!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#111),color-stop(1,#2b2b2b))!important;background:-ms-linear-gradient(bottom,#111,#2b2b2b)!important;background:-moz-linear-gradient(center bottom,#111 0,#2b2b2b 100%)!important;background:-o-linear-gradient(#2b2b2b,#111)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2b2b2b', endColorstr='#111', GradientType=0)!important;color:#fff}.bg-maroon-gradient{background:#D81B60!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#D81B60),color-stop(1,#e73f7c))!important;background:-ms-linear-gradient(bottom,#D81B60,#e73f7c)!important;background:-moz-linear-gradient(center bottom,#D81B60 0,#e73f7c 100%)!important;background:-o-linear-gradient(#e73f7c,#D81B60)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e73f7c', endColorstr='#D81B60', GradientType=0)!important;color:#fff}.description-block .description-icon{font-size:16px}.no-pad-top{padding-top:0}.position-static{position:static!important}.list-header{font-size:15px;padding:10px 4px;color:#666}.list-seperator{height:1px;background:#f4f4f4;margin:15px 0 9px}.list-link>a{padding:4px;color:#777}.list-link>a:hover{color:#222}.font-light{font-weight:300}.skin-blue-light .sidebar-menu>li.active>a,.skin-blue-light .treeview-menu>li.active>a,.user-block .username{font-weight:600}.user-block:after,.user-block:before{content:" ";display:table}.user-block img{width:40px;height:40px;float:left}.user-block .comment,.user-block .description,.user-block .username{display:block;margin-left:50px}.img-sm+.img-push,.user-block.user-block-sm .comment,.user-block.user-block-sm .description,.user-block.user-block-sm .username{margin-left:40px}.user-block .username{font-size:16px}.user-block .description{color:#999;font-size:13px}.box-tools .btn-box-tool,.user-block.user-block-sm .username{font-size:14px}.box-comments .box-comment img,.img-lg,.img-md,.img-sm,.user-block.user-block-sm img{float:left}.box-comments .box-comment img,.img-sm,.user-block.user-block-sm img{width:30px!important;height:30px!important}.img-md{width:60px;height:60px}.img-md+.img-push{margin-left:70px}.attachment-block .attachment-pushed,.img-lg+.img-push{margin-left:110px}.img-lg{width:100px;height:100px}.img-bordered{border:3px solid #d2d6de;padding:3px}.img-bordered-sm{border:2px solid #d2d6de;padding:2px}.attachment-block{border:1px solid #f4f4f4;padding:5px;margin-bottom:10px;background:#f7f7f7}.attachment-block .attachment-img{max-width:100px;max-height:100px;height:auto;float:left}.attachment-block .attachment-heading{margin:0}.attachment-block .attachment-text{color:#555}.connectedSortable{min-height:100px}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sort-highlight{background:#f4f4f4;border:1px dashed #ddd;margin-bottom:10px}.full-opacity-hover{opacity:.65;filter:alpha(opacity=65)}.full-opacity-hover:hover{opacity:1;filter:alpha(opacity=100)}.chart{position:relative;overflow:hidden;width:100%}.chart canvas,.chart svg{width:100%!important}@media print{.content-header,.left-side,.main-header,.main-sidebar,.no-print{display:none!important}.content-wrapper,.main-footer,.right-side{margin-left:0!important;min-height:0!important;-webkit-transform:translate(0,0)!important;-ms-transform:translate(0,0)!important;-o-transform:translate(0,0)!important;transform:translate(0,0)!important}.fixed .content-wrapper,.fixed .right-side{padding-top:0!important}.invoice{width:100%;border:0;margin:0;padding:0}.invoice-col{float:left;width:33.3333333%}.table-responsive{overflow:auto}.table-responsive>.table tr td,.table-responsive>.table tr th{white-space:normal!important}}.skin-blue .main-header .navbar .nav>li>a{color:#fff}.skin-blue .main-header .navbar .nav .open>a,.skin-blue .main-header .navbar .nav .open>a:focus,.skin-blue .main-header .navbar .nav .open>a:hover,.skin-blue .main-header .navbar .nav>.active>a,.skin-blue .main-header .navbar .nav>li>a:active,.skin-blue .main-header .navbar .nav>li>a:focus,.skin-blue .main-header .navbar .nav>li>a:hover{background:rgba(0,0,0,.1);color:#f6f6f6}.skin-blue .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,.1);background-color:#367fa9}.skin-blue .main-header .navbar .sidebar-toggle,.skin-blue .user-panel>.info,.skin-blue .user-panel>.info>a{color:#fff}@media (max-width:767px){.skin-blue .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,.1)}.skin-blue .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue .main-header .logo{background-color:#367fa9;color:#fff;border-bottom:0 solid transparent}.skin-blue .main-header .logo:hover{background-color:#357ca5}.skin-blue .main-header li.user-header{background-color:#3c8dbc}.skin-blue .content-header{background:0 0}.skin-blue .left-side,.skin-blue .main-sidebar,.skin-blue .wrapper{background-color:#222d32}.skin-blue .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-blue .sidebar-menu>li>a{border-left:3px solid transparent}.skin-blue .sidebar-menu>li.active>a,.skin-blue .sidebar-menu>li:hover>a{color:#fff;background:#1e282c;border-left-color:#3c8dbc}.skin-blue .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-blue .sidebar a{color:#b8c7ce}.skin-blue .treeview-menu>li>a{color:#8aa4af}.skin-blue .treeview-menu>li.active>a,.skin-blue .treeview-menu>li>a:hover{color:#fff}.skin-blue .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px}.skin-blue .sidebar-form .btn,.skin-blue .sidebar-form input[type=text]{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-blue .sidebar-form input[type=text]{color:#666;border-radius:2px 0 0 2px}.skin-blue .sidebar-form input[type=text]:focus,.skin-blue .sidebar-form input[type=text]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue .sidebar-form input[type=text]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue .sidebar-form .btn{color:#999;border-radius:0 2px 2px 0}.skin-blue-light .main-header .navbar{background-color:#3c8dbc}.skin-blue-light .main-header .navbar .nav>li>a{color:#fff}.skin-blue-light .main-header .navbar .nav .open>a,.skin-blue-light .main-header .navbar .nav .open>a:focus,.skin-blue-light .main-header .navbar .nav .open>a:hover,.skin-blue-light .main-header .navbar .nav>.active>a,.skin-blue-light .main-header .navbar .nav>li>a:active,.skin-blue-light .main-header .navbar .nav>li>a:focus,.skin-blue-light .main-header .navbar .nav>li>a:hover{background:rgba(0,0,0,.1);color:#f6f6f6}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,.1);background-color:#367fa9}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}@media (max-width:767px){.skin-blue-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,.1)}.skin-blue-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue-light .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue-light .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue-light .main-header .logo:hover{background-color:#3b8ab8}.skin-blue-light .main-header li.user-header{background-color:#3c8dbc}.skin-blue-light .content-header{background:0 0}.skin-blue-light .left-side,.skin-blue-light .main-sidebar,.skin-blue-light .wrapper{background-color:#f9fafc}.skin-blue-light .content-wrapper,.skin-blue-light .main-footer{border-left:1px solid #d2d6de}.skin-blue-light .user-panel>.info,.skin-blue-light .user-panel>.info>a{color:#444}.skin-blue-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-blue-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-blue-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-blue-light .sidebar-menu>li.active>a,.skin-blue-light .sidebar-menu>li:hover>a{color:#000;background:#f4f4f5}.skin-blue-light .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-blue-light .sidebar a{color:#444}.skin-blue-light .treeview-menu>li>a{color:#777}.skin-blue-light .treeview-menu>li.active>a,.skin-blue-light .treeview-menu>li>a:hover{color:#000}.skin-blue-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px}.skin-blue-light .sidebar-form .btn,.skin-blue-light .sidebar-form input[type=text]{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-blue-light .sidebar-form input[type=text]{color:#666;border-radius:2px 0 0 2px}.skin-blue-light .sidebar-form input[type=text]:focus,.skin-blue-light .sidebar-form input[type=text]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue-light .sidebar-form input[type=text]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue-light .sidebar-form .btn{color:#999;border-radius:0 2px 2px 0}@media (min-width:768px){.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-blue-light .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}body{background-color:#555;background-image:url(../images/boxed-bg.png)}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){body{background-image:url(../images/boxed-bg-2x.png);background-size:auto auto}}.h1,.h2,.h3,.h4,.h5,.h6,.main-header .logo,body,h1,h2,h3,h4,h5,h6{font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif}body.skin-blue-light .main-header .logo{background-color:#367fa9;color:#fff;border-bottom:0 solid transparent}body.skin-blue-light .main-header .logo:hover{background-color:#357ca5}body.skin-blue-light .sidebar-menu>li>a{font-weight:400}body.skin-blue-light .sidebar-menu>li.active>a,body.skin-blue-light .sidebar-menu>li:hover>a{border-left-color:#3c8dbc;font-weight:400}body.skin-blue-light .sidebar-menu>li.header{background:#ececed}body.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#fff}body.skin-blue .sidebar{color:#bbb}body.skin-blue .content-wrapper,body.skin-blue .main-footer{border-left:1px solid #222d32}body.skin-blue .sidebar-menu>li.header{color:#8aa4af}.login-box,.register-box{width:400px;margin:4% auto}@media screen and (max-width:767px){.login-box,.register-box{width:calc(100% - 20px);margin:20px auto}}.login-box .login-box-msg,.login-box .register-box-msg,.register-box .login-box-msg,.register-box .register-box-msg{padding:0 0 20px}.login-box .checkbox,.register-box .checkbox{margin:0}.login-logo,.register-logo{margin-bottom:20px}.box-body>.table-responsive>.table,.sidebar-form .form-group{margin-bottom:0}@media screen and (max-width:767px){.box-body>.table-responsive{border:none;margin-bottom:0}}.sidebar-menu li.header{padding-right:15px}.sidebar-menu li a{padding-left:12px}.sidebar-form .form-group .form-control-feedback,.sidebar-form .form-group input[type=text]{color:#999}.dropdown-menu>li>a,.sidebar a.btn{color:#333}.sidebar .subsection{padding:10px;text-align:center}.sidebar .subsection ul{text-align:left}.sidebar-collapse .sidebar .list-inline li{padding-right:0}.sidebar-collapse .hidden-collapsed{display:none}.control-sidebar{min-height:calc(100% - 51px);position:absolute}@media (max-width:768px){.control-sidebar{padding-top:50px}}@media (max-width:767px){.control-sidebar{padding-top:100px}}.control-sidebar-heading{padding:0;margin:10px 0}.login-box ul,.register-box ul,form div.validation-errors ul{margin-bottom:0;padding-left:20px}.control-sidebar-menu li a{padding-top:5px;padding-bottom:5px;white-space:nowrap}.control-sidebar-menu li.active a{background-color:#337ab7}.control-sidebar-section{max-height:350px;overflow-y:auto;padding-right:15px;margin-right:-15px}@media (min-width:768px){.control-sidebar-open .main-footer{margin-right:0}.modal-dialog{width:750px}.modal-sm{width:300px}}.control-sidebar-show{display:none!important}.using-control-sidebar .control-sidebar-show{display:block!important}.using-control-sidebar .control-sidebar-hidden{display:none!important}.control-sidebar-bg{min-height:100%;position:absolute}.content-wrapper,.control-sidebar,.main-footer,.main-header .logo,.main-header .navbar,.main-sidebar{-webkit-transition:initial;-o-transition:initial;transition:initial}.main-footer{height:51px}form div.validation-errors ul li{margin-left:0}.login-page,.register-page{background-color:#555;background-repeat:repeat;background-attachment:fixed;background-image:url(../images/boxed-bg.png)}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.login-page,.register-page{background-image:url(../images/boxed-bg-2x.png);background-size:auto auto}}#toast-container .toast.toast-danger,#toast-container .toast.toast-error,#toast-container .toast.toast-info,#toast-container .toast.toast-success,#toast-container .toast.toast-warning{background-image:none!important}.login-box-body,.register-box-body{-moz-box-shadow:0 0 8px rgba(0,0,0,.5);-webkit-box-shadow:0 0 8px rgba(0,0,0,.5);box-shadow:0 0 8px rgba(0,0,0,.5)}.login-box .checkbox,.register-box .checkbox{margin-top:0}.password-options{float:right}.password-options i{margin:0 5px;cursor:pointer}@media screen and (min-width:768px){.settings-photo{text-align:center}.settings-photo img{margin:0 auto}}.box-body p:last-child,.box>.list-group,.radio.radio-block:last-child{margin-bottom:0}.btn-table{padding:1px 5px;line-height:1}.box-tools .btn-group.open .dropdown-toggle{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}form .btn .loading-icon{margin-right:8px}.dropdown-menu{border-color:#ddd}.dropdown-menu>li>a>.fa{margin-right:0;margin-left:-5px}.btn-link:active{-webkit-box-shadow:none;box-shadow:none}@media (max-width:991px){.content-header .btn-group{display:none}}.form-control{border-radius:0!important}.has-feedback.form-group-sm input{padding-right:37.5px}.has-feedback.has-feedback-left input{padding-left:42.5px;padding-right:0}.has-feedback.has-feedback-left.form-group-sm input{padding-left:37.5px;padding-right:0}.has-feedback.has-feedback-left .form-control-feedback{right:initial;left:0}.radio.radio-block:first-child{margin-top:0}.radio.radio-block:last-child label{border-bottom:0}.radio.radio-block label{display:block;border-bottom:1px solid #f4f4f4;border-radius:3px;padding:10px 10px 10px 30px;font-weight:700}.radio.radio-block label input[type=radio]{margin-left:-20px}.radio.radio-block label>span{display:block;color:#777;font-size:90%;font-weight:400}.radio.radio-block label>span.bottom-line{font-size:100%;color:#333;margin-top:5px}.radio-boxed{border:1px solid #ddd;border-radius:3px;padding:10px 10px 10px 30px}@media (min-width:480px){.radio-boxed{padding:10px 20px 10px 30px}.radio-boxed+.radio-lg{margin-left:20px}.radio-lg{font-size:18px}}.modal-footer{text-align:left}@media (min-width:992px){.modal-lg{width:970px}}.table-selectable td:not(.actions){cursor:pointer}.table-selectable td:not(.actions) span{cursor:text}.table-vmiddle td{vertical-align:middle!important}.box-header.with-border+.box-body .table>tbody>tr:first-child>td{border-top:0}.table td.action-select{text-align:center;width:30px;max-width:30px}.table td.vault-icon{text-align:center;width:41px;max-width:41px;color:#777}.table td.vault-icon img{max-width:24px;max-height:24px;border-radius:3px}@media (max-width:991px){.table td.action-select,.table td.vault-icon{display:none}}.callout.callout-default{background-color:#fff;border-color:#3c3c3c}.callout.callout-default a{color:#3c8dbc}.callout.callout-default a:active,.callout.callout-default a:focus,.callout.callout-default a:hover{color:#72afd2}.box .callout.callout-default .btn-default:not(:hover),.login-box-body .callout.callout-default .btn-default:not(:hover),.modal .callout.callout-default .btn-default:not(:hover),.register-box-body .callout.callout-default .btn-default:not(:hover){background-color:#fff}.callout a.btn.btn-default{color:#333}.alert-notification{border-radius:0;border-left:none;border-right:none;margin-bottom:0;cursor:pointer}.box>.list-group .list-group-item{border-width:1px 0;border-radius:0;border-color:#f4f4f4}.box>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.box-header+.list-group .list-group-item:first-child,.list-group+.box-footer{border-top-width:0}.box-header .box-filters{position:absolute;left:10px;top:5px}.box-header .box-filters input{display:inline}.cc,.tooltip-wrapper{display:inline-block}.box-apps{font-size:20px}.box-apps ul.fa-ul li{margin-bottom:10px}.box-apps a .fa{color:#2c3b41}.box-breach img{max-height:200px;margin-bottom:20px;margin-left:auto;margin-right:auto}@media (min-width:768px){.box-breach img{margin-top:10px}}#toast-container{position:absolute}#toast-container.toast-top-right{top:65px;right:15px}#toast-container .toast{border-radius:0;-moz-box-shadow:0 0 8px rgba(0,0,0,.5);-webkit-box-shadow:0 0 8px rgba(0,0,0,.5);box-shadow:0 0 8px rgba(0,0,0,.5)}@media (max-width:767px){#toast-container.toast-top-right{top:initial;bottom:0;right:0;width:100%}#toast-container .toast{width:100%}}#toast-container .toast.toast-danger:before,#toast-container .toast.toast-error:before{content:"\f0e7"}#toast-container .toast.toast-warning:before{content:"\f071"}#toast-container .toast.toast-info:before{content:"\f005"}#toast-container .toast.toast-success:before{content:"\f00C"}#toast-container .toast:before{position:absolute;font-family:FontAwesome;font-size:24px;line-height:24px;float:left;color:#fff;padding-right:.5em;margin:auto .5em auto -1.5em}.monospaced,.totp .totp-code{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}h1,h2,h3,h4,h5,h6{margin-top:0}.strike{text-decoration:line-through;color:#777}.cc{background:url(../images/cards.png) no-repeat;overflow:hidden;text-indent:-9999px;text-align:left;width:73px;height:44px}.cc.amex{background-position:0 0}.cc.diners{background-position:-73px 0}.cc.discover{background-position:0 -44px}.cc.jcb{background-position:-73px -44px}.cc.maestro,.cc.mastercard{background-position:0 -88px}.cc.visa{background-position:-73px -88px}#duoFrameWrapper{margin:0 -36px 10px;background:url(../images/loading.svg) no-repeat}@media (min-width:360px){#duoFrameWrapper{margin:0 -10px 10px}}@media (min-width:768px){#duoFrameWrapper{margin:0 0 10px}}#duoFrameWrapper iframe{width:100%;min-width:304px;max-width:620px;height:500px;border:none}.braintree-placeholder,.braintree-sheet__header{display:none}.braintree-sheet__content--button{text-align:left;padding:0;min-height:0}.braintree-sheet__container{margin-bottom:0}.braintree-sheet{border:none}.clickable{cursor:pointer}.label-full{font-size:85%;font-weight:400}.totp-col{margin:-10px 0 10px}@media (min-width:992px){.totp-col{padding-top:26px;margin:0}}.totp-col img{margin-right:10px}.totp .totp-code{font-size:1.2em}.totp .totp-countdown{margin-right:11px;display:inline-block;vertical-align:-50%;user-select:none}.totp .totp-countdown .totp-sec{font-size:.85em;position:absolute;line-height:32px;width:32px;text-align:center}.totp .totp-countdown svg{width:32px;height:32px;transform:rotate(-90deg)}.totp .totp-countdown .totp-circle{stroke:#337ab7;fill:none}.totp .totp-countdown .totp-circle.inner{stroke-width:3;stroke-dasharray:78.6;stroke-dashoffset:0}.totp .totp-countdown .totp-circle.outer{stroke-width:2;stroke-dasharray:88;stroke-dashoffset:0}.totp.low .totp-code,.totp.low .totp-sec{color:#dd4b39}.totp.low .totp-circle{stroke:#dd4b39}.password-meter .progress{margin-bottom:10px}@media (min-width:768px){.password-meter .progress{margin-bottom:0}}textarea#notes{height:100px}textarea.big-textarea{height:200px!important} -\ No newline at end of file +@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,300italic,400italic,600italic);.btn.uppercase,.control-sidebar-heading,.description-block>.description-text,.info-box-text,.nav-stacked>li.header{text-transform:uppercase}.box-body:after,.box-comments .box-comment:after,.box-footer:after,.box-header:after,.chat .item:after,.chat .item>.attachment:after,.control-sidebar-menu>li>a:after,.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:after,.navbar-nav>.user-menu>.dropdown-menu>.user-body:after,.timeline>li:after,.user-block:after,.user-panel:after,.wrapper:after{clear:both}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#FFF}.toast-message a:hover{color:#CCC;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#FFF;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8}.toast-top-center,.toast-top-full-width{top:0;right:0;width:100%}.toast-close-button:focus,.toast-close-button:hover{color:#111;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{z-index:999999}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container .toast{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px;-webkit-border-radius:3px 3px 3px 3px;background-position:15px center;background-repeat:no-repeat;color:#FFF;opacity:.8}.ng-anchor,progress-bar{position:absolute}.wrapper,body{overflow-x:hidden;overflow-y:auto}#toast-container .toast:hover{-moz-box-shadow:0 0 12px #111;-webkit-box-shadow:0 0 12px #111;box-shadow:0 0 12px #111;opacity:1;cursor:pointer}#toast-container.toast-bottom-center .toast,#toast-container.toast-top-center .toast{width:300px;margin-left:auto;margin-right:auto}#toast-container.toast-bottom-full-width .toast,#toast-container.toast-top-full-width .toast{width:96%;margin-left:auto;margin-right:auto}.toast{background-color:#030303}.toast-success{background-color:#00a65a}.toast-error{background-color:#dd4b39}.toast-info{background-color:#0073b7}.toast-warning{background-color:#FF851B}progress-bar{left:0;bottom:0;height:4px;background-color:#111;opacity:.4}.layout-boxed body,.layout-boxed html,.wrapper,body,html{height:100%}div[toast]{opacity:1!important}div[toast].ng-enter{opacity:0!important;transition:opacity .3s linear}div[toast].ng-enter.ng-enter-active{opacity:1!important}div[toast].ng-leave{opacity:1;transition:opacity .3s linear}div[toast].ng-leave.ng-leave-active{opacity:0!important}@media all and (max-width:240px){#toast-container .toast.div{padding:8px 8px 8px 50px;width:11em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container .toast.div{padding:8px 8px 8px 50px;width:18em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container .toast.div{padding:15px 15px 15px 50px;width:25em}}.ng-cloak,.ng-hide:not(.ng-hide-animate),.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}ng\:form{display:block}.ng-animate-shim{visibility:hidden}body{font-weight:400}.wrapper{position:relative}.wrapper:after,.wrapper:before{content:" ";display:table}.layout-boxed .wrapper{max-width:1250px;margin:0 auto;min-height:100%;box-shadow:0 0 8px rgba(0,0,0,.5);position:relative}.layout-boxed{background:url(../images/boxed-bg.png) fixed}.content-wrapper,.main-footer,.right-side{-webkit-transition:-webkit-transform .3s ease-in-out,margin .3s ease-in-out;-moz-transition:-moz-transform .3s ease-in-out,margin .3s ease-in-out;-o-transition:-o-transform .3s ease-in-out,margin .3s ease-in-out;transition:transform .3s ease-in-out,margin .3s ease-in-out;margin-left:230px;z-index:820}.layout-top-nav .content-wrapper,.layout-top-nav .main-footer,.layout-top-nav .right-side{margin-left:0}@media (min-width:768px){.sidebar-collapse .content-wrapper,.sidebar-collapse .main-footer,.sidebar-collapse .right-side{margin-left:0}}.content-wrapper,.right-side{min-height:100%;background-color:#ecf0f5;z-index:800}.main-footer{background:#fff;padding:15px;color:#444;border-top:1px solid #d2d6de}.fixed .left-side,.fixed .main-header,.fixed .main-sidebar{position:fixed}.fixed .main-header{top:0;right:0;left:0}.fixed .content-wrapper,.fixed .right-side{padding-top:50px}@media (max-width:767px){.content-wrapper,.main-footer,.right-side{margin-left:0}.sidebar-open .content-wrapper,.sidebar-open .main-footer,.sidebar-open .right-side{-webkit-transform:translate(230px,0);-ms-transform:translate(230px,0);-o-transform:translate(230px,0);transform:translate(230px,0)}.fixed .content-wrapper,.fixed .right-side{padding-top:100px}}.fixed.layout-boxed .wrapper{max-width:100%}body.hold-transition .content-wrapper,body.hold-transition .left-side,body.hold-transition .main-footer,body.hold-transition .main-header .logo,body.hold-transition .main-header .navbar,body.hold-transition .main-sidebar,body.hold-transition .right-side{-webkit-transition:none;-o-transition:none;transition:none}.content{min-height:250px;padding:15px;margin-right:auto;margin-left:auto}a{color:#3c8dbc}a:active,a:focus,a:hover{outline:0;text-decoration:none;color:#72afd2}.page-header{margin:10px 0 20px;font-size:22px}.page-header>small{color:#666;display:block;margin-top:5px}.main-header{position:relative;max-height:100px;z-index:1030}.main-header .navbar{margin-bottom:0;margin-left:230px;border:none;min-height:50px;border-radius:0}.layout-top-nav .main-header .navbar{margin-left:0}.main-header #navbar-search-input.form-control{background:rgba(255,255,255,.2);border-color:transparent}.main-header #navbar-search-input.form-control:active,.main-header #navbar-search-input.form-control:focus{border-color:rgba(0,0,0,.1);background:rgba(255,255,255,.9)}.main-header #navbar-search-input.form-control::-moz-placeholder{color:#ccc;opacity:1}.main-header #navbar-search-input.form-control:-ms-input-placeholder{color:#ccc}.main-header #navbar-search-input.form-control::-webkit-input-placeholder{color:#ccc}.main-header .navbar-custom-menu,.main-header .navbar-right{float:right}@media (max-width:991px){.main-header .navbar-custom-menu a,.main-header .navbar-right a{color:inherit;background:0 0}}@media (max-width:767px){.main-header .navbar-right{float:none}.navbar-collapse .main-header .navbar-right{margin:7.5px -15px}.main-header .navbar-right>li{color:inherit;border:0}}.main-header .navbar-brand,.main-header .sidebar-toggle:hover{color:#fff}.main-header .sidebar-toggle{float:left;background-color:transparent;background-image:none;padding:15px;font-family:fontAwesome}.main-header .sidebar-toggle:before{content:"\f0c9"}.main-header .sidebar-toggle:active,.main-header .sidebar-toggle:focus{background:0 0}.main-header .sidebar-toggle .icon-bar{display:none}.main-header .navbar .nav>li.user>a>.fa,.main-header .navbar .nav>li.user>a>.glyphicon,.main-header .navbar .nav>li.user>a>.ion{margin-right:5px}.main-header .navbar .nav>li>a>.label{position:absolute;top:9px;right:7px;text-align:center;font-size:9px;padding:2px 3px;line-height:.9}.main-header .logo{display:block;float:left;height:50px;font-size:20px;line-height:50px;text-align:center;width:230px;padding:0 15px;font-weight:300;overflow:hidden}.main-header .logo .logo-lg{display:block}.main-header .logo .logo-mini{display:none}.content-header{position:relative;padding:15px 15px 0}.content-header>h1{margin:0;font-size:24px}.content-header>h1>small{font-size:15px;display:inline-block;padding-left:4px;font-weight:300}.content-header>.breadcrumb{float:right;background:0 0;margin-top:0;margin-bottom:0;font-size:12px;padding:7px 5px;position:absolute;top:15px;right:10px;border-radius:2px}.content-header>.breadcrumb>li>a{color:#444;text-decoration:none;display:inline-block}.content-header>.breadcrumb>li>a>.fa,.content-header>.breadcrumb>li>a>.glyphicon,.content-header>.breadcrumb>li>a>.ion{margin-right:5px}.content-header>.breadcrumb>li+li:before{content:'>\00a0'}@media (max-width:991px){.content-header>.breadcrumb{position:relative;margin-top:5px;top:0;right:0;float:none;background:#d2d6de;padding-left:10px}.content-header>.breadcrumb li:before{color:#97a0b3}.navbar-custom-menu .navbar-nav>li{float:left}.navbar-custom-menu .navbar-nav{margin:0;float:left}.navbar-custom-menu .navbar-nav>li>a{padding-top:15px;padding-bottom:15px;line-height:20px}}.navbar-toggle{color:#fff;border:0;margin:0;padding:15px}@media (max-width:767px){.main-header{position:relative}.main-header .logo,.main-header .navbar{width:100%;float:none}.main-header .navbar{margin:0}.main-header .navbar-custom-menu{float:right}}@media (max-width:991px){.navbar-collapse.pull-left{float:none!important}.navbar-collapse.pull-left+.navbar-custom-menu{display:block;position:absolute;top:0;right:40px}}.left-side,.main-sidebar{position:absolute;top:0;left:0;padding-top:50px;min-height:100%;width:230px;z-index:810;-webkit-transition:-webkit-transform .3s ease-in-out,width .3s ease-in-out;-moz-transition:-moz-transform .3s ease-in-out,width .3s ease-in-out;-o-transition:-o-transform .3s ease-in-out,width .3s ease-in-out;transition:transform .3s ease-in-out,width .3s ease-in-out}@media (max-width:767px){.left-side,.main-sidebar{padding-top:100px;-webkit-transform:translate(-230px,0);-ms-transform:translate(-230px,0);-o-transform:translate(-230px,0);transform:translate(-230px,0)}}@media (min-width:768px){.sidebar-collapse .left-side,.sidebar-collapse .main-sidebar{-webkit-transform:translate(-230px,0);-ms-transform:translate(-230px,0);-o-transform:translate(-230px,0);transform:translate(-230px,0)}}@media (max-width:767px){.sidebar-open .left-side,.sidebar-open .main-sidebar{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}}.sidebar{padding-bottom:10px}.sidebar-form input:focus{border-color:transparent}.user-panel{position:relative;width:100%;padding:10px;overflow:hidden}.user-panel:after,.user-panel:before{content:" ";display:table}.user-panel>.image>img{width:100%;max-width:45px;height:auto}.user-panel>.info{padding:5px 5px 5px 15px;line-height:1;position:absolute;left:55px}.user-panel>.info>p{font-weight:600;margin-bottom:9px}.user-panel>.info>a{text-decoration:none;padding-right:5px;margin-top:3px;font-size:11px}.user-panel>.info>a>.fa,.user-panel>.info>a>.glyphicon,.user-panel>.info>a>.ion{margin-right:3px}.sidebar-menu{list-style:none;margin:0;padding:0}.sidebar-menu>li{position:relative;margin:0;padding:0}.sidebar-menu>li>a{padding:12px 5px 12px 15px;display:block}.sidebar-menu>li>a>.fa,.sidebar-menu>li>a>.glyphicon,.sidebar-menu>li>a>.ion{width:20px}.sidebar-menu>li .badge,.sidebar-menu>li .label{margin-right:5px}.sidebar-menu>li .badge{margin-top:3px}.sidebar-menu li.header{padding:10px 25px 10px 15px;font-size:12px}.sidebar-menu li>a>.fa-angle-left,.sidebar-menu li>a>.pull-right-container>.fa-angle-left{width:auto;height:auto;padding:0;margin-right:10px}.sidebar-menu li>a>.fa-angle-left{position:absolute;top:50%;right:10px;margin-top:-8px}.sidebar-menu li.active>a>.fa-angle-left,.sidebar-menu li.active>a>.pull-right-container>.fa-angle-left{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.sidebar-menu li.active>.treeview-menu{display:block}.sidebar-menu .treeview-menu{display:none;list-style:none;padding:0 0 0 5px;margin:0}.sidebar-menu .treeview-menu .treeview-menu{padding-left:20px}.sidebar-menu .treeview-menu>li{margin:0}.sidebar-menu .treeview-menu>li>a{padding:5px 5px 5px 15px;display:block;font-size:14px}.sidebar-menu .treeview-menu>li>a>.fa,.sidebar-menu .treeview-menu>li>a>.glyphicon,.sidebar-menu .treeview-menu>li>a>.ion{width:20px}.sidebar-menu .treeview-menu>li>a>.fa-angle-down,.sidebar-menu .treeview-menu>li>a>.fa-angle-left,.sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-down,.sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-left{width:auto}@media (min-width:768px){.sidebar-mini.sidebar-collapse .content-wrapper,.sidebar-mini.sidebar-collapse .main-footer,.sidebar-mini.sidebar-collapse .right-side{margin-left:50px!important;z-index:840}.sidebar-mini.sidebar-collapse .main-sidebar{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0);width:50px!important;z-index:850}.sidebar-mini.sidebar-collapse .sidebar-menu>li{position:relative}.sidebar-mini.sidebar-collapse .sidebar-menu>li>a{margin-right:0}.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>span{border-top-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:not(.treeview)>a>span{border-bottom-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{padding-top:5px;padding-bottom:5px;border-bottom-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>.treeview-menu,.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>span:not(.pull-right){display:block!important;position:absolute;width:180px;left:50px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>span{top:0;margin-left:-3px;padding:12px 5px 12px 20px;background-color:inherit}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>.pull-right-container{position:relative!important;float:right;width:auto!important;left:180px!important;top:-22px!important;z-index:900}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>.pull-right-container>.label:not(:first-of-type){display:none}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>.treeview-menu{top:44px;margin-left:0}.sidebar-mini.sidebar-collapse .main-sidebar .user-panel>.info,.sidebar-mini.sidebar-collapse .sidebar-form,.sidebar-mini.sidebar-collapse .sidebar-menu li.header,.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu,.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>.pull-right,.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>span{display:none!important;-webkit-transform:translateZ(0)}.sidebar-mini.sidebar-collapse .main-header .logo{width:50px}.sidebar-mini.sidebar-collapse .main-header .logo>.logo-mini{display:block;margin-left:-15px;margin-right:-15px;font-size:18px}.sidebar-mini.sidebar-collapse .main-header .logo>.logo-lg{display:none}.sidebar-mini.sidebar-collapse .main-header .navbar{margin-left:50px}.control-sidebar-open .content-wrapper,.control-sidebar-open .main-footer,.control-sidebar-open .right-side{margin-right:230px}}.main-sidebar .user-panel,.sidebar-menu,.sidebar-menu>li.header{white-space:nowrap;overflow:hidden}.sidebar-menu:hover{overflow:visible}.sidebar-form,.sidebar-menu>li.header{overflow:hidden;text-overflow:clip}.sidebar-menu li>a{position:relative}.sidebar-menu li>a>.pull-right-container{position:absolute;right:10px;top:50%;margin-top:-7px}.control-sidebar-bg{z-index:1000;bottom:0}.control-sidebar,.control-sidebar-bg{top:0;right:-230px;width:230px;-webkit-transition:right .3s ease-in-out;-o-transition:right .3s ease-in-out;transition:right .3s ease-in-out}.control-sidebar{padding-top:50px;z-index:1010}@media (max-width:768px){.control-sidebar{padding-top:100px}.nav-tabs.control-sidebar-tabs{display:table}.nav-tabs.control-sidebar-tabs>li{display:table-cell}}.control-sidebar>.tab-content{padding:10px 15px}.control-sidebar-open .control-sidebar,.control-sidebar-open .control-sidebar-bg,.control-sidebar.control-sidebar-open,.control-sidebar.control-sidebar-open+.control-sidebar-bg{right:0}.nav-tabs.control-sidebar-tabs>li:first-of-type>a,.nav-tabs.control-sidebar-tabs>li:first-of-type>a:focus,.nav-tabs.control-sidebar-tabs>li:first-of-type>a:hover{border-left-width:0}.nav-tabs.control-sidebar-tabs>li>a{border-radius:0}.nav-tabs.control-sidebar-tabs>li>a,.nav-tabs.control-sidebar-tabs>li>a:hover{border-top:none;border-right:none;border-left:1px solid transparent;border-bottom:1px solid transparent}.nav-tabs.control-sidebar-tabs>li>a .icon{font-size:16px}.nav-tabs.control-sidebar-tabs>li.active>a,.nav-tabs.control-sidebar-tabs>li.active>a:active,.nav-tabs.control-sidebar-tabs>li.active>a:focus,.nav-tabs.control-sidebar-tabs>li.active>a:hover{border-top:none;border-right:none;border-bottom:none}.control-sidebar-heading{margin-bottom:10px}.control-sidebar-subheading{display:block;font-weight:400;font-size:14px}.control-sidebar-menu{list-style:none;padding:0;margin:0 -15px}.control-sidebar-menu>li>a{display:block;padding:10px 15px}.control-sidebar-menu>li>a:after,.control-sidebar-menu>li>a:before{content:" ";display:table}.control-sidebar-menu>li>a>.control-sidebar-subheading{margin-top:0}.control-sidebar-menu .menu-icon{float:left;width:35px;height:35px;border-radius:50%;text-align:center;line-height:35px}.control-sidebar-menu .menu-info{margin-left:45px;margin-top:3px}.control-sidebar-menu .menu-info>.control-sidebar-subheading,.control-sidebar-menu .progress{margin:0}.control-sidebar-menu .menu-info>p{margin:0;font-size:11px}.control-sidebar-dark{color:#b8c7ce}.control-sidebar-dark,.control-sidebar-dark+.control-sidebar-bg{background:#222d32}.control-sidebar-dark .nav-tabs.control-sidebar-tabs{border-bottom:#1c2529}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a{background:#181f23;color:#b8c7ce}.control-sidebar-dark .control-sidebar-heading,.control-sidebar-dark .control-sidebar-subheading,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover{color:#fff}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover{border-left-color:#141a1d;border-bottom-color:#141a1d}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:active,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover{background:#1c2529}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:active,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:hover{background:#222d32;color:#fff}.control-sidebar-dark .control-sidebar-menu>li>a:hover{background:#1e282c}.control-sidebar-dark .control-sidebar-menu>li>a .menu-info>p{color:#b8c7ce}.control-sidebar-light{color:#5e5e5e}.control-sidebar-light,.control-sidebar-light+.control-sidebar-bg{background:#f9fafc;border-left:1px solid #d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs{border-bottom:#d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a{background:#e8ecf4;color:#444}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:hover{border-left-color:#d2d6de;border-bottom-color:#d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:active,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:hover{background:#eff1f7}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:active,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:hover{background:#f9fafc;color:#111}.control-sidebar-light .control-sidebar-heading,.control-sidebar-light .control-sidebar-subheading{color:#111}.control-sidebar-light .control-sidebar-menu{margin-left:-14px}.control-sidebar-light .control-sidebar-menu>li>a:hover{background:#f4f4f5}.control-sidebar-light .control-sidebar-menu>li>a .menu-info>p{color:#5e5e5e}.dropdown-menu{box-shadow:none}.dropdown-menu>li>a>.fa,.dropdown-menu>li>a>.glyphicon,.dropdown-menu>li>a>.ion{margin-right:10px}.dropdown-menu>li>a:hover{background-color:#e1e3e9;color:#333}.dropdown-menu>.divider{background-color:#eee}.navbar-nav>.messages-menu>.dropdown-menu,.navbar-nav>.notifications-menu>.dropdown-menu,.navbar-nav>.tasks-menu>.dropdown-menu{width:280px;padding:0;margin:0;top:100%}.navbar-nav>.messages-menu>.dropdown-menu>li,.navbar-nav>.notifications-menu>.dropdown-menu>li,.navbar-nav>.tasks-menu>.dropdown-menu>li{position:relative}.navbar-nav>.messages-menu>.dropdown-menu>li.header,.navbar-nav>.notifications-menu>.dropdown-menu>li.header,.navbar-nav>.tasks-menu>.dropdown-menu>li.header{background-color:#fff;padding:7px 10px;border-bottom:1px solid #f4f4f4;color:#444;font-size:14px;border-radius:4px 4px 0 0}.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a{font-size:12px;background-color:#fff;padding:7px 10px;border-bottom:1px solid #eee;color:#444!important;text-align:center;border-radius:0 0 4px 4px}@media (max-width:991px){.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a{background:#fff!important;color:#444!important}}.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a:hover,.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a:hover,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a:hover{text-decoration:none;font-weight:400}.navbar-nav>.messages-menu>.dropdown-menu>li .menu,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu{max-height:200px;margin:0;padding:0;list-style:none;overflow-x:hidden}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a{display:block;white-space:nowrap;border-bottom:1px solid #f4f4f4}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:hover,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a:hover,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a:hover{background:#f4f4f4;text-decoration:none}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a{color:#444;overflow:hidden;text-overflow:ellipsis;padding:10px}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.fa,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.glyphicon,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.ion{width:20px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a{margin:0;padding:10px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>div>img{margin:auto 10px auto auto;width:40px;height:40px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>h4{padding:0;margin:0 0 0 45px;color:#444;font-size:15px;position:relative}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>h4>small{color:#999;font-size:10px;position:absolute;top:0;right:0}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>p{margin:0 0 0 45px;font-size:12px;color:#888}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:after,.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:before{content:" ";display:table}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a{padding:10px}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a>h3{font-size:14px;padding:0;margin:0 0 10px;color:#666}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a>.progress{padding:0;margin:0}.navbar-nav>.user-menu>.dropdown-menu{border-top-right-radius:0;border-top-left-radius:0;padding:1px 0 0;border-top-width:0;width:280px}.navbar-nav>.user-menu>.dropdown-menu,.navbar-nav>.user-menu>.dropdown-menu>.user-body{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.navbar-nav>.user-menu>.dropdown-menu>li.user-header{height:175px;padding:10px;text-align:center}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>img{z-index:5;height:90px;width:90px;border:3px solid transparent;border-color:rgba(255,255,255,.2)}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>p{z-index:5;color:#fff;color:rgba(255,255,255,.8);font-size:17px;margin-top:10px}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>p>small{display:block;font-size:12px}.navbar-nav>.user-menu>.dropdown-menu>.user-body:after,.navbar-nav>.user-menu>.dropdown-menu>.user-body:before,.navbar-nav>.user-menu>.dropdown-menu>.user-footer:after,.navbar-nav>.user-menu>.dropdown-menu>.user-footer:before{display:table;content:" "}.navbar-nav>.user-menu>.dropdown-menu>.user-body{padding:15px;border-bottom:1px solid #f4f4f4;border-top:1px solid #ddd}.navbar-nav>.user-menu>.dropdown-menu>.user-body a{color:#444!important}@media (max-width:991px){.navbar-nav>.user-menu>.dropdown-menu>.user-body a{background:#fff!important;color:#444!important}.navbar-nav>.user-menu>.dropdown-menu>.user-footer .btn-default:hover{background-color:#f9f9f9}}.navbar-nav>.user-menu>.dropdown-menu>.user-footer{background-color:#f9f9f9;padding:10px}.navbar-nav>.user-menu>.dropdown-menu>.user-footer:after{clear:both}.navbar-nav>.user-menu>.dropdown-menu>.user-footer .btn-default{color:#666}.navbar-nav>.user-menu .user-image{float:left;width:25px;height:25px;border-radius:50%;margin-right:10px;margin-top:-2px}@media (max-width:767px){.navbar-nav>.user-menu .user-image{float:none;margin-right:0;margin-top:-8px;line-height:10px}}.open:not(.dropup)>.animated-dropdown-menu{backface-visibility:visible!important;-webkit-animation:flipInX .7s both;-o-animation:flipInX .7s both;animation:flipInX .7s both}@keyframes flipInX{0%{transform:perspective(400px) rotate3d(1,0,0,90deg);transition-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotate3d(1,0,0,-20deg);transition-timing-function:ease-in}60%{transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{transform:perspective(400px)}}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);-webkit-transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);-webkit-transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{-webkit-transform:perspective(400px)}}.navbar-custom-menu>.navbar-nav>li{position:relative}.navbar-custom-menu>.navbar-nav>li>.dropdown-menu{position:absolute;right:0;left:auto}@media (max-width:991px){.navbar-custom-menu>.navbar-nav{float:right}.navbar-custom-menu>.navbar-nav>li{position:static}.navbar-custom-menu>.navbar-nav>li>.dropdown-menu{position:absolute;right:5%;left:auto;border:1px solid #ddd;background:#fff}}.progress-striped .progress-bar-green,.progress-striped .progress-bar-light-blue,.progress-striped .progress-bar-primary,.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.form-control{box-shadow:none;border-color:#d2d6de}.form-control:focus{border-color:#3c8dbc;box-shadow:none}.form-control:-ms-input-placeholder,.form-control::-moz-placeholder,.form-control::-webkit-input-placeholder{color:#bbb;opacity:1}.form-group.has-success .help-block,.form-group.has-success label{color:#00a65a}.form-control:not(select){-webkit-appearance:none;-moz-appearance:none;appearance:none}.form-group.has-success .form-control,.form-group.has-success .input-group-addon{border-color:#00a65a;box-shadow:none}.form-group.has-warning .help-block,.form-group.has-warning label{color:#bf7e16}.form-group.has-warning .form-control,.form-group.has-warning .input-group-addon{border-color:#bf7e16;box-shadow:none}.form-group.has-error .help-block,.form-group.has-error label{color:#dd4b39}.form-group.has-error .form-control,.form-group.has-error .input-group-addon{border-color:#dd4b39;box-shadow:none}.input-group .input-group-addon{border-radius:0;border-color:#d2d6de;background-color:#fff}.btn-group-vertical .btn.btn-flat:first-of-type,.btn-group-vertical .btn.btn-flat:last-of-type{border-radius:0}.progress,.progress .progress-bar,.progress-sm,.progress-sm .progress-bar,.progress-xs,.progress-xs .progress-bar,.progress-xxs,.progress-xxs .progress-bar,.progress.sm,.progress.sm .progress-bar,.progress.xs,.progress.xs .progress-bar,.progress.xxs,.progress.xxs .progress-bar,.progress>.progress-bar,.progress>.progress-bar .progress-bar{border-radius:1px}.icheck>label{padding-left:0}.form-control-feedback.fa{line-height:34px}.form-group-lg .form-control+.form-control-feedback.fa,.input-group-lg+.form-control-feedback.fa,.input-lg+.form-control-feedback.fa{line-height:46px}.form-group-sm .form-control+.form-control-feedback.fa,.input-group-sm+.form-control-feedback.fa,.input-sm+.form-control-feedback.fa{line-height:30px}.progress,.progress>.progress-bar{-webkit-box-shadow:none;box-shadow:none}.box,.small-box{box-shadow:0 1px 1px rgba(0,0,0,.1)}.progress-sm,.progress.sm{height:10px}.progress-xs,.progress.xs{height:7px}.progress-xxs,.progress.xxs{height:3px}.progress.vertical{position:relative;width:30px;height:200px;display:inline-block;margin-right:10px}.progress.vertical>.progress-bar{width:100%;position:absolute;bottom:0}.progress.vertical.progress-sm,.progress.vertical.sm{width:20px}.progress.vertical.progress-xs,.progress.vertical.xs{width:10px}.progress.vertical.progress-xxs,.progress.vertical.xxs{width:3px}.progress-group .progress-text{font-weight:600}.progress-group .progress-number{float:right}.table tr>td .progress{margin:0}.progress-bar-light-blue,.progress-bar-primary{background-color:#3c8dbc}.progress-striped .progress-bar-light-blue,.progress-striped .progress-bar-primary{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-green,.progress-bar-success{background-color:#00a65a}.progress-striped .progress-bar-green,.progress-striped .progress-bar-success{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-striped .progress-bar-aqua,.progress-striped .progress-bar-info,.progress-striped .progress-bar-warning,.progress-striped .progress-bar-yellow{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-aqua,.progress-bar-info{background-color:#00c0ef}.progress-striped .progress-bar-aqua,.progress-striped .progress-bar-info{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning,.progress-bar-yellow{background-color:#bf7e16}.progress-striped .progress-bar-warning,.progress-striped .progress-bar-yellow{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger,.progress-bar-red{background-color:#dd4b39}.progress-striped .progress-bar-danger,.progress-striped .progress-bar-red{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.small-box{border-radius:2px;position:relative;display:block;margin-bottom:20px}.small-box>.inner{padding:10px}.small-box>.small-box-footer{position:relative;text-align:center;padding:3px 0;color:#fff;color:rgba(255,255,255,.8);display:block;z-index:10;background:rgba(0,0,0,.1);text-decoration:none}.small-box>.small-box-footer:hover{color:#fff;background:rgba(0,0,0,.15)}.small-box h3{font-size:38px;font-weight:700;margin:0 0 10px;white-space:nowrap;padding:0}.small-box p{font-size:15px}.small-box p>small{display:block;color:#f9f9f9;font-size:13px;margin-top:5px}.small-box h3,.small-box p{z-index:5}.small-box .icon{-webkit-transition:all .3s linear;-o-transition:all .3s linear;transition:all .3s linear;position:absolute;top:-10px;right:10px;z-index:0;font-size:90px;color:rgba(0,0,0,.15)}.small-box:hover{text-decoration:none;color:#f9f9f9}.small-box:hover .icon{font-size:95px}@media (max-width:767px){.small-box{text-align:center}.small-box .icon{display:none}.small-box p{font-size:12px}}.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%}.box.box-primary{border-top-color:#3c8dbc}.box.box-info{border-top-color:#00c0ef}.box.box-danger{border-top-color:#dd4b39}.box.box-warning{border-top-color:#bf7e16}.box.box-success{border-top-color:#00a65a}.box.box-default{border-top-color:#d2d6de}.box.collapsed-box .box-body,.box.collapsed-box .box-footer{display:none}.box .nav-stacked>li{border-bottom:1px solid #f4f4f4;margin:0}.box .nav-stacked>li:last-of-type{border-bottom:none}.box.height-control .box-body{max-height:300px;overflow:auto}.box .border-right{border-right:1px solid #f4f4f4}.box .border-left{border-left:1px solid #f4f4f4}.box.box-solid{border-top:0}.box.box-solid>.box-header .btn.btn-default{background:0 0}.box.box-solid>.box-header .btn:hover,.box.box-solid>.box-header a:hover{background:rgba(0,0,0,.1)}.box.box-solid.box-default{border:1px solid #d2d6de}.box.box-solid.box-default>.box-header{color:#444;background:#d2d6de}.box.box-solid.box-default>.box-header .btn,.box.box-solid.box-default>.box-header a{color:#444}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid.box-primary>.box-header{color:#fff;background:#3c8dbc}.box.box-solid.box-primary>.box-header .btn,.box.box-solid.box-primary>.box-header a{color:#fff}.box.box-solid.box-info{border:1px solid #00c0ef}.box.box-solid.box-info>.box-header{color:#fff;background:#00c0ef}.box.box-solid.box-info>.box-header .btn,.box.box-solid.box-info>.box-header a{color:#fff}.box.box-solid.box-danger{border:1px solid #dd4b39}.box.box-solid.box-danger>.box-header{color:#fff;background:#dd4b39}.box.box-solid.box-danger>.box-header .btn,.box.box-solid.box-danger>.box-header a{color:#fff}.box.box-solid.box-warning{border:1px solid #bf7e16}.box.box-solid.box-warning>.box-header{color:#fff;background:#bf7e16}.box.box-solid.box-warning>.box-header .btn,.box.box-solid.box-warning>.box-header a{color:#fff}.box.box-solid.box-success{border:1px solid #00a65a}.box.box-solid.box-success>.box-header{color:#fff;background:#00a65a}.box.box-solid.box-success>.box-header .btn,.box.box-solid.box-success>.box-header a{color:#fff}.box.box-solid>.box-header>.box-tools .btn{border:0;box-shadow:none}.box.box-solid[class*=bg]>.box-header{color:#fff}.box .box-group>.box{margin-bottom:5px}.box .knob-label{text-align:center;color:#333;font-weight:100;font-size:12px;margin-bottom:.3em}.box>.loading-img,.box>.overlay,.overlay-wrapper>.loading-img,.overlay-wrapper>.overlay{position:absolute;top:0;left:0;width:100%;height:100%}.box .overlay,.overlay-wrapper .overlay{z-index:50;background:rgba(255,255,255,.7);border-radius:3px}.box .overlay>.fa,.overlay-wrapper .overlay>.fa{position:absolute;top:50%;left:50%;margin-left:-15px;margin-top:-15px;color:#000;font-size:30px}.box .overlay.dark,.overlay-wrapper .overlay.dark{background:rgba(0,0,0,.5)}.box-body:after,.box-body:before,.box-footer:after,.box-footer:before,.box-header:after,.box-header:before{content:" ";display:table}.box-header{color:#444;display:block;padding:10px;position:relative}.box-header.with-border{border-bottom:1px solid #f4f4f4}.collapsed-box .box-header.with-border{border-bottom:none}.box-header .box-title,.box-header>.fa,.box-header>.glyphicon,.box-header>.ion{display:inline-block;font-size:18px;margin:0;line-height:1}.box-header>.fa,.box-header>.glyphicon,.box-header>.ion{margin-right:5px}.box-header>.box-tools{position:absolute;right:10px;top:5px}.box-header>.box-tools [data-toggle=tooltip],.timeline{position:relative}.box-header>.box-tools.pull-right .dropdown-menu{right:0;left:auto}.box-header>.box-tools .dropdown-menu>li>a{color:#444!important}.btn-box-tool{padding:5px;font-size:12px;background:0 0;color:#97a0b3}.btn-box-tool:hover,.open .btn-box-tool{color:#606c84}.btn-box-tool.btn:active{box-shadow:none}.box-body{padding:10px;border-radius:0 0 3px 3px}.no-header .box-body{border-top-right-radius:3px;border-top-left-radius:3px}.box-body>.table{margin-bottom:0}.box-body .fc{margin-top:5px}.box-body .full-width-chart{margin:-19px}.box-body.no-padding .full-width-chart{margin:-9px}.box-body .box-pane{border-radius:0 0 0 3px}.box-body .box-pane-right{border-radius:0 0 3px}.box-footer{border-top:1px solid #f4f4f4;padding:10px;background-color:#fff;border-radius:0 0 3px 3px}@media (max-width:991px){.chart-legend>li{float:left;margin-right:10px}}.box-comments{background:#f7f7f7}.box-comments .box-comment{padding:8px 0;border-bottom:1px solid #eee}.box-comments .box-comment:after,.box-comments .box-comment:before{content:" ";display:table}.box-comments .box-comment:last-of-type{border-bottom:0}.box-comments .box-comment:first-of-type{padding-top:0}.box-comments .box-comment img{float:left}.box-comments .comment-text{margin-left:40px;color:#555}.box-comments .username{color:#444;display:block;font-weight:600}.box-comments .text-muted{font-weight:400;font-size:12px}.todo-list{margin:0;padding:0;list-style:none;overflow:auto}.todo-list>li{border-radius:2px;padding:10px;background:#f4f4f4;margin-bottom:2px;border-left:2px solid #e6e7e8;color:#444}.todo-list>li:last-of-type{margin-bottom:0}.todo-list>li>input[type=checkbox]{margin:0 10px 0 5px}.todo-list>li .text{display:inline-block;margin-left:5px;font-weight:600}.todo-list>li .label{margin-left:10px;font-size:9px}.todo-list>li .tools{display:none;float:right;color:#dd4b39}.todo-list .handle,.todo-list>li:hover .tools{display:inline-block}.todo-list>li .tools>.fa,.todo-list>li .tools>.glyphicon,.todo-list>li .tools>.ion{margin-right:5px;cursor:pointer}.todo-list>li.done{color:#999}.todo-list>li.done .text{text-decoration:line-through;font-weight:500}.todo-list>li.done .label{background:#d2d6de!important}.todo-list .danger{border-left-color:#dd4b39}.todo-list .warning{border-left-color:#bf7e16}.todo-list .info{border-left-color:#00c0ef}.todo-list .success{border-left-color:#00a65a}.todo-list .primary{border-left-color:#3c8dbc}.todo-list .handle{cursor:move;margin:0 5px}.chat{padding:5px 20px 5px 10px}.chat .item{margin-bottom:10px}.chat .item:after,.chat .item:before{content:" ";display:table}.chat .item>img{width:40px;height:40px;border:2px solid transparent;border-radius:50%}.chat .item>.online{border:2px solid #00a65a}.chat .item>.offline{border:2px solid #dd4b39}.chat .item>.message{margin-left:55px;margin-top:-40px}.chat .item>.message>.name{display:block;font-weight:600}.chat .item>.attachment{border-radius:3px;background:#f4f4f4;margin-left:65px;margin-right:15px;padding:10px}.chat .item>.attachment>h4{margin:0 0 5px;font-weight:600;font-size:14px}.chat .item>.attachment>.filename,.chat .item>.attachment>p{font-weight:600;font-size:13px;font-style:italic;margin:0}.chat .item>.attachment:after,.chat .item>.attachment:before{content:" ";display:table}.box-input{max-width:200px}.modal .panel-body{color:#444}.info-box{display:block;min-height:90px;background:#fff;width:100%;box-shadow:0 1px 1px rgba(0,0,0,.1);border-radius:2px;margin-bottom:15px}.info-box small{font-size:14px}.info-box .progress{background:rgba(0,0,0,.2);margin:5px -10px;height:2px}.info-box .progress,.info-box .progress .progress-bar{border-radius:0}.info-box .progress .progress-bar{background:#fff}.info-box-icon{display:block;float:left;height:90px;width:90px;text-align:center;font-size:45px;line-height:90px;background:rgba(0,0,0,.2);border-radius:2px 0 0 2px}.info-box-icon>img{max-width:100%}.info-box-content{padding:5px 10px;margin-left:90px}.info-box-number{display:block;font-weight:700;font-size:18px}.info-box-text,.progress-description{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.info-box-more{display:block}.progress-description{margin:0}.timeline{margin:0 0 30px;padding:0;list-style:none}.timeline:before{content:'';position:absolute;top:0;bottom:0;width:4px;background:#ddd;left:31px;margin:0;border-radius:2px}.timeline>li{position:relative;margin-right:10px;margin-bottom:15px}.timeline>li:after,.timeline>li:before{content:" ";display:table}.timeline>li>.timeline-item{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.1);box-shadow:0 1px 1px rgba(0,0,0,.1);border-radius:3px;margin-top:0;background:#fff;color:#444;margin-left:60px;margin-right:15px;padding:0;position:relative}.timeline>li>.timeline-item>.time{color:#999;float:right;padding:10px;font-size:12px}.timeline>li>.timeline-item>.timeline-header{margin:0;color:#555;border-bottom:1px solid #f4f4f4;padding:10px;font-size:16px;line-height:1.1}.timeline>li>.timeline-item>.timeline-header>a{font-weight:600}.timeline>li>.timeline-item>.timeline-body,.timeline>li>.timeline-item>.timeline-footer{padding:10px}.timeline>li>.fa,.timeline>li>.glyphicon,.timeline>li>.ion{width:30px;height:30px;font-size:15px;line-height:30px;position:absolute;color:#666;background:#d2d6de;border-radius:50%;text-align:center;left:18px;top:0}.timeline>.time-label>span{font-weight:600;padding:5px;display:inline-block;background-color:#fff;border-radius:4px}.timeline-inverse>li>.timeline-item{background:#f0f0f0;border:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none}.btn,.btn-app{border-radius:3px}.timeline-inverse>li>.timeline-item>.timeline-header{border-bottom-color:#ddd}.btn{-webkit-box-shadow:none;box-shadow:none;border:1px solid transparent}.btn.btn-flat{border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;border-width:1px}.btn:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:focus{outline:0}.btn.btn-file{position:relative;overflow:hidden}.btn.btn-file>input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;opacity:0;filter:alpha(opacity=0);outline:0;background:#fff;cursor:inherit;display:block}.btn-app,table.text-center,table.text-center td,table.text-center th{text-align:center}.btn-default{background-color:#f4f4f4;color:#444;border-color:#ddd}.btn-default.hover,.btn-default:active,.btn-default:hover{background-color:#e7e7e7}.btn-primary,.skin-blue .main-header .navbar{background-color:#3c8dbc}.btn-primary{border-color:#367fa9}.btn-primary.hover,.btn-primary:active,.btn-primary:hover{background-color:#367fa9}.btn-success{background-color:#00a65a;border-color:#008d4c}.btn-success.hover,.btn-success:active,.btn-success:hover{background-color:#008d4c}.btn-info{background-color:#00c0ef;border-color:#00acd6}.btn-info.hover,.btn-info:active,.btn-info:hover{background-color:#00acd6}.btn-danger{background-color:#dd4b39;border-color:#d73925}.btn-danger.hover,.btn-danger:active,.btn-danger:hover{background-color:#d73925}.btn-warning{background-color:#bf7e16;border-color:#a86f13}.btn-warning.hover,.btn-warning:active,.btn-warning:hover{background-color:#a86f13}.btn-outline{border:1px solid #fff;background:0 0;color:#fff}.btn-outline:active,.btn-outline:focus,.btn-outline:hover{color:rgba(255,255,255,.7);border-color:rgba(255,255,255,.7)}.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn[class*=bg-]:hover{-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,.2);box-shadow:inset 0 0 100px rgba(0,0,0,.2)}.btn-app{position:relative;padding:15px 5px;margin:0 0 10px 10px;min-width:80px;height:60px;color:#666;border:1px solid #ddd;background-color:#f4f4f4;font-size:12px}.alert,.callout{border-radius:3px}.btn-app>.fa,.btn-app>.glyphicon,.btn-app>.ion{font-size:20px;display:block}.btn-app:hover{background:#f4f4f4;color:#444;border-color:#aaa}.btn-app:active,.btn-app:focus{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-app>.badge{position:absolute;top:-3px;right:-10px;font-size:10px;font-weight:400}.alert h4,.callout h4,.nav-pills>li.active>a{font-weight:600}.callout{margin:0 0 20px;padding:15px 30px 15px 15px;border-left:5px solid #eee}.callout a{color:#fff;text-decoration:underline}.callout a:hover{color:#eee}.callout h4{margin-top:0}.callout p:last-child{margin-bottom:0}.callout .highlight,.callout code{background-color:#fff}.callout.callout-danger{border-color:#c23321}.callout.callout-warning{border-color:#916011}.callout.callout-info{border-color:#0097bc}.callout.callout-success{border-color:#00733e}.alert .icon{margin-right:10px}.alert .close{color:#000;opacity:.2;filter:alpha(opacity=20)}.alert .close:hover{opacity:.5;filter:alpha(opacity=50)}.alert a{color:#fff;text-decoration:underline}.callout a.btn,.skin-blue .sidebar a:hover,.skin-blue-light .sidebar a:hover{text-decoration:none}.alert-success{border-color:#008d4c}.alert-danger,.alert-error{border-color:#d73925}.alert-warning{border-color:#a86f13}.alert-info{border-color:#00acd6}.nav>li>a:active,.nav>li>a:focus,.nav>li>a:hover{color:#444;background:#f7f7f7}.nav-pills>li>a{border-radius:0;border-top:3px solid transparent;color:#444}.nav-pills>li>a>.fa,.nav-pills>li>a>.glyphicon,.nav-pills>li>a>.ion{margin-right:5px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{border-top-color:#3c8dbc}.nav-stacked>li>a{border-radius:0;border-top:0;border-left:3px solid transparent;color:#444}.nav-stacked>li.active>a,.nav-stacked>li.active>a:hover{background:0 0;color:#444;border-top:0;border-left-color:#3c8dbc}.nav-stacked>li.header{border-bottom:1px solid #ddd;color:#777;margin-bottom:10px;padding:5px 10px}.nav-tabs-custom{margin-bottom:20px;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.1);border-radius:3px}.nav-tabs-custom>.nav-tabs{margin:0;border-bottom-color:#f4f4f4;border-top-right-radius:3px;border-top-left-radius:3px}.nav-tabs-custom>.nav-tabs>li{border-top:3px solid transparent;margin-bottom:-2px;margin-right:5px}.nav-tabs-custom>.nav-tabs>li>a{color:#444;border-radius:0}.nav-tabs-custom>.nav-tabs>li>a.text-muted,.nav-tabs-custom>.nav-tabs>li>a:hover{color:#999}.nav-tabs-custom>.nav-tabs>li>a,.nav-tabs-custom>.nav-tabs>li>a:hover{background:0 0;margin:0}.nav-tabs-custom>.nav-tabs>li:not(.active)>a:active,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:focus,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:hover{border-color:transparent}.nav-tabs-custom>.nav-tabs>li.active{border-top-color:#3c8dbc}.nav-tabs-custom>.nav-tabs>li.active:hover>a,.nav-tabs-custom>.nav-tabs>li.active>a{background-color:#fff;color:#444}.nav-tabs-custom>.nav-tabs>li.active>a{border-top-color:transparent;border-left-color:#f4f4f4;border-right-color:#f4f4f4}.nav-tabs-custom>.nav-tabs>li:first-of-type{margin-left:0}.nav-tabs-custom>.nav-tabs>li:first-of-type.active>a{border-left-color:transparent}.nav-tabs-custom>.nav-tabs.pull-right{float:none!important}.nav-tabs-custom>.nav-tabs.pull-right>li{float:right}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type{margin-right:0}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type>a{border-left-width:1px}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type.active>a{border-left-color:#f4f4f4;border-right-color:transparent}.nav-tabs-custom>.nav-tabs>li.header{line-height:35px;padding:0 10px;font-size:20px;color:#444}.nav-tabs-custom>.nav-tabs>li.header>.fa,.nav-tabs-custom>.nav-tabs>li.header>.glyphicon,.nav-tabs-custom>.nav-tabs>li.header>.ion{margin-right:5px}.nav-tabs-custom>.tab-content{background:#fff;padding:10px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.nav-tabs-custom .dropdown.open>a:active,.nav-tabs-custom .dropdown.open>a:focus{background:0 0;color:#999}.nav-tabs-custom.tab-primary>.nav-tabs>li.active{border-top-color:#3c8dbc}.nav-tabs-custom.tab-info>.nav-tabs>li.active{border-top-color:#00c0ef}.nav-tabs-custom.tab-danger>.nav-tabs>li.active{border-top-color:#dd4b39}.nav-tabs-custom.tab-warning>.nav-tabs>li.active{border-top-color:#bf7e16}.nav-tabs-custom.tab-success>.nav-tabs>li.active{border-top-color:#00a65a}.nav-tabs-custom.tab-default>.nav-tabs>li.active{border-top-color:#d2d6de}.pagination>li>a{background:#fafafa;color:#666}.pagination.pagination-flat>li>a{border-radius:0!important}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{border-top:1px solid #f4f4f4}.table>thead>tr>th{border-bottom:2px solid #f4f4f4}.table tr td .progress{margin-top:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #f4f4f4}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table.no-border,.table.no-border td,.table.no-border th{border:0}.table.align th{text-align:left}.table.align td{text-align:right}.label-default{background-color:#d2d6de;color:#444}.modal{background:rgba(0,0,0,.3)}.modal-content{border-radius:0;-webkit-box-shadow:0 2px 3px rgba(0,0,0,.125);box-shadow:0 2px 3px rgba(0,0,0,.125);border:0}@media (min-width:768px){.modal-content{-webkit-box-shadow:0 2px 3px rgba(0,0,0,.125);box-shadow:0 2px 3px rgba(0,0,0,.125)}}.modal-header{border-bottom-color:#f4f4f4}.modal-footer{border-top-color:#f4f4f4}.modal-primary .modal-footer,.modal-primary .modal-header{border-color:#307095}.modal-warning .modal-footer,.modal-warning .modal-header{border-color:#916011}.modal-info .modal-footer,.modal-info .modal-header{border-color:#0097bc}.modal-success .modal-footer,.modal-success .modal-header{border-color:#00733e}.modal-danger .modal-footer,.modal-danger .modal-header{border-color:#c23321}.login-logo,.register-logo{font-size:35px;text-align:center;font-weight:300}.login-logo a,.register-logo a{color:#444}.login-page,.register-page{background:#d2d6de}@media (max-width:768px){.login-box,.register-box{width:90%;margin-top:20px}}.login-box-body,.register-box-body{background:#fff;padding:20px;border-top:0;color:#666}.login-box-body .form-control-feedback,.register-box-body .form-control-feedback{color:#777}.login-box-msg,.register-box-msg{margin:0;text-align:center;padding:0 20px 20px}.social-auth-links{margin:10px 0}.error-page{width:600px;margin:20px auto 0}.error-page>.headline{float:left;font-size:100px;font-weight:300}.error-page>.error-content{margin-left:190px;display:block}.error-page>.error-content>h3{font-weight:300;font-size:25px}@media (max-width:991px){.error-page{width:100%}.error-page>.headline{float:none;text-align:center}.error-page>.error-content{margin-left:0}.error-page>.error-content>h3{text-align:center}}.pad{padding:10px}.margin{margin:10px}.margin-bottom{margin-bottom:20px}.margin-bottom-none{margin-bottom:0}.margin-r-5{margin-right:5px}.inline{display:inline}.description-block{display:block;margin:10px 0;text-align:center}.description-block.margin-bottom{margin-bottom:25px}.description-block>.description-header{margin:0;padding:0;font-weight:600;font-size:16px}.list-header,.text-bold,.text-bold.table td,.text-bold.table th{font-weight:700}#toast-container .toast.toast-danger,#toast-container .toast.toast-error,#toast-container .toast.toast-info,#toast-container .toast.toast-success,#toast-container .toast.toast-warning,.alert-danger,.alert-error,.alert-info,.alert-success,.alert-warning,.bg-aqua,.bg-aqua-active,.bg-black,.bg-black-active,.bg-blue,.bg-blue-active,.bg-fuchsia,.bg-fuchsia-active,.bg-green,.bg-green-active,.bg-light-blue,.bg-light-blue-active,.bg-lime,.bg-lime-active,.bg-maroon,.bg-maroon-active,.bg-navy,.bg-navy-active,.bg-olive,.bg-olive-active,.bg-orange,.bg-orange-active,.bg-purple,.bg-purple-active,.bg-red,.bg-red-active,.bg-teal,.bg-teal-active,.bg-yellow,.bg-yellow-active,.callout.callout-danger,.callout.callout-info,.callout.callout-success,.callout.callout-warning,.label-danger,.label-info,.label-primary,.label-success,.label-warning,.modal-danger .modal-body,.modal-danger .modal-footer,.modal-danger .modal-header,.modal-info .modal-body,.modal-info .modal-footer,.modal-info .modal-header,.modal-primary .modal-body,.modal-primary .modal-footer,.modal-primary .modal-header,.modal-success .modal-body,.modal-success .modal-footer,.modal-success .modal-header,.modal-warning .modal-body,.modal-warning .modal-footer,.modal-warning .modal-header{color:#fff!important}.bg-gray{color:#000;background-color:#d2d6de!important}.bg-gray-light,.box .callout.callout-default,.login-box-body .callout.callout-default,.modal .callout.callout-default,.register-box-body .callout.callout-default{background-color:#f7f7f7}.bg-black{background-color:#111!important}#toast-container .toast.toast-danger,#toast-container .toast.toast-error,.alert-danger,.alert-error,.bg-red,.callout.callout-danger,.label-danger,.modal-danger .modal-body{background-color:#dd4b39!important}#toast-container .toast.toast-warning,.alert-warning,.bg-yellow,.callout.callout-warning,.label-warning,.modal-warning .modal-body{background-color:#bf7e16!important}#toast-container .toast.toast-info,.alert-info,.bg-aqua,.callout.callout-info,.label-info,.modal-info .modal-body{background-color:#00c0ef!important}.bg-blue{background-color:#0073b7!important}.bg-light-blue,.label-primary,.modal-primary .modal-body{background-color:#3c8dbc!important}#toast-container .toast.toast-success,.alert-success,.bg-green,.callout.callout-success,.label-success,.modal-success .modal-body{background-color:#00a65a!important}.bg-navy{background-color:#001F3F!important}.bg-teal{background-color:#39CCCC!important}.bg-olive{background-color:#3D9970!important}.bg-lime{background-color:#01FF70!important}.bg-orange{background-color:#FF851B!important}.bg-fuchsia{background-color:#F012BE!important}.bg-purple{background-color:#605ca8!important}.bg-maroon{background-color:#D81B60!important}.bg-gray-active{color:#000;background-color:#b5bbc8!important}.bg-black-active{background-color:#000!important}.bg-red-active,.modal-danger .modal-footer,.modal-danger .modal-header{background-color:#d33724!important}.bg-yellow-active,.modal-warning .modal-footer,.modal-warning .modal-header{background-color:#a46c13!important}.bg-aqua-active,.modal-info .modal-footer,.modal-info .modal-header{background-color:#00a7d0!important}.bg-blue-active{background-color:#005384!important}.bg-light-blue-active,.modal-primary .modal-footer,.modal-primary .modal-header{background-color:#357ca5!important}.bg-green-active,.modal-success .modal-footer,.modal-success .modal-header{background-color:#008d4c!important}.bg-navy-active{background-color:#001a35!important}.bg-teal-active{background-color:#30bbbb!important}.bg-olive-active{background-color:#368763!important}.bg-lime-active{background-color:#00e765!important}.bg-orange-active{background-color:#ff7701!important}.bg-fuchsia-active{background-color:#db0ead!important}.bg-purple-active{background-color:#555299!important}.bg-maroon-active{background-color:#ca195a!important}[class^=bg-].disabled{opacity:.65;filter:alpha(opacity=65)}.text-red{color:#dd4b39!important}.text-yellow{color:#bf7e16!important}.text-aqua{color:#00c0ef!important}.text-blue{color:#0073b7!important}.text-black{color:#111!important}.text-light-blue{color:#3c8dbc!important}.text-green{color:#00a65a!important}.text-gray{color:#d2d6de!important}.text-navy{color:#001F3F!important}.text-teal{color:#39CCCC!important}.text-olive{color:#3D9970!important}.text-lime{color:#01FF70!important}.text-orange{color:#FF851B!important}.text-fuchsia{color:#F012BE!important}.text-purple{color:#605ca8!important}.text-maroon{color:#D81B60!important}.link-muted{color:#7a869d}.link-muted:focus,.link-muted:hover{color:#606c84}.link-black{color:#666}.link-black:focus,.link-black:hover{color:#999}.hide{display:none!important}.no-border{border:0!important}.no-padding{padding:0!important}.no-margin{margin:0!important}.no-shadow{box-shadow:none!important}.chart-legend,.list-unstyled{list-style:none;margin:0;padding:0}.list-group-unbordered>.list-group-item{border-left:0;border-right:0;border-radius:0;padding-left:0;padding-right:0}.flat{border-radius:0!important}.text-sm{font-size:12px}.jqstooltip{padding:5px!important;width:auto!important;height:auto!important}.bg-teal-gradient{background:#39CCCC!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#39CCCC),color-stop(1,#7adddd))!important;background:-ms-linear-gradient(bottom,#39CCCC,#7adddd)!important;background:-moz-linear-gradient(center bottom,#39CCCC 0,#7adddd 100%)!important;background:-o-linear-gradient(#7adddd,#39CCCC)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39CCCC', GradientType=0)!important;color:#fff}.bg-light-blue-gradient{background:#3c8dbc!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#3c8dbc),color-stop(1,#67a8ce))!important;background:-ms-linear-gradient(bottom,#3c8dbc,#67a8ce)!important;background:-moz-linear-gradient(center bottom,#3c8dbc 0,#67a8ce 100%)!important;background:-o-linear-gradient(#67a8ce,#3c8dbc)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#67a8ce', endColorstr='#3c8dbc', GradientType=0)!important;color:#fff}.bg-blue-gradient{background:#0073b7!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#0073b7),color-stop(1,#0089db))!important;background:-ms-linear-gradient(bottom,#0073b7,#0089db)!important;background:-moz-linear-gradient(center bottom,#0073b7 0,#0089db 100%)!important;background:-o-linear-gradient(#0089db,#0073b7)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0089db', endColorstr='#0073b7', GradientType=0)!important;color:#fff}.bg-aqua-gradient{background:#00c0ef!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#00c0ef),color-stop(1,#14d1ff))!important;background:-ms-linear-gradient(bottom,#00c0ef,#14d1ff)!important;background:-moz-linear-gradient(center bottom,#00c0ef 0,#14d1ff 100%)!important;background:-o-linear-gradient(#14d1ff,#00c0ef)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#14d1ff', endColorstr='#00c0ef', GradientType=0)!important;color:#fff}.bg-yellow-gradient{background:#bf7e16!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#bf7e16),color-stop(1,#e9a73e))!important;background:-ms-linear-gradient(bottom,#bf7e16,#e9a73e)!important;background:-moz-linear-gradient(center bottom,#bf7e16 0,#e9a73e 100%)!important;background:-o-linear-gradient(#e9a73e,#bf7e16)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9a73e', endColorstr='#bf7e16', GradientType=0)!important;color:#fff}.bg-purple-gradient{background:#605ca8!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#605ca8),color-stop(1,#9491c4))!important;background:-ms-linear-gradient(bottom,#605ca8,#9491c4)!important;background:-moz-linear-gradient(center bottom,#605ca8 0,#9491c4 100%)!important;background:-o-linear-gradient(#9491c4,#605ca8)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#9491c4', endColorstr='#605ca8', GradientType=0)!important;color:#fff}.bg-green-gradient{background:#00a65a!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#00a65a),color-stop(1,#00ca6d))!important;background:-ms-linear-gradient(bottom,#00a65a,#00ca6d)!important;background:-moz-linear-gradient(center bottom,#00a65a 0,#00ca6d 100%)!important;background:-o-linear-gradient(#00ca6d,#00a65a)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ca6d', endColorstr='#00a65a', GradientType=0)!important;color:#fff}.bg-red-gradient{background:#dd4b39!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#dd4b39),color-stop(1,#e47365))!important;background:-ms-linear-gradient(bottom,#dd4b39,#e47365)!important;background:-moz-linear-gradient(center bottom,#dd4b39 0,#e47365 100%)!important;background:-o-linear-gradient(#e47365,#dd4b39)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e47365', endColorstr='#dd4b39', GradientType=0)!important;color:#fff}.bg-black-gradient{background:#111!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#111),color-stop(1,#2b2b2b))!important;background:-ms-linear-gradient(bottom,#111,#2b2b2b)!important;background:-moz-linear-gradient(center bottom,#111 0,#2b2b2b 100%)!important;background:-o-linear-gradient(#2b2b2b,#111)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2b2b2b', endColorstr='#111', GradientType=0)!important;color:#fff}.bg-maroon-gradient{background:#D81B60!important;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#D81B60),color-stop(1,#e73f7c))!important;background:-ms-linear-gradient(bottom,#D81B60,#e73f7c)!important;background:-moz-linear-gradient(center bottom,#D81B60 0,#e73f7c 100%)!important;background:-o-linear-gradient(#e73f7c,#D81B60)!important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e73f7c', endColorstr='#D81B60', GradientType=0)!important;color:#fff}.description-block .description-icon{font-size:16px}.no-pad-top{padding-top:0}.position-static{position:static!important}.list-header{font-size:15px;padding:10px 4px;color:#666}.list-seperator{height:1px;background:#f4f4f4;margin:15px 0 9px}.list-link>a{padding:4px;color:#777}.list-link>a:hover{color:#222}.font-light{font-weight:300}.skin-blue-light .sidebar-menu>li.active>a,.skin-blue-light .treeview-menu>li.active>a,.user-block .username{font-weight:600}.user-block:after,.user-block:before{content:" ";display:table}.user-block img{width:40px;height:40px;float:left}.user-block .comment,.user-block .description,.user-block .username{display:block;margin-left:50px}.img-sm+.img-push,.user-block.user-block-sm .comment,.user-block.user-block-sm .description,.user-block.user-block-sm .username{margin-left:40px}.user-block .username{font-size:16px}.user-block .description{color:#999;font-size:13px}.box-tools .btn-box-tool,.user-block.user-block-sm .username{font-size:14px}.box-comments .box-comment img,.img-lg,.img-md,.img-sm,.user-block.user-block-sm img{float:left}.box-comments .box-comment img,.img-sm,.user-block.user-block-sm img{width:30px!important;height:30px!important}.img-md{width:60px;height:60px}.img-md+.img-push{margin-left:70px}.attachment-block .attachment-pushed,.img-lg+.img-push{margin-left:110px}.img-lg{width:100px;height:100px}.img-bordered{border:3px solid #d2d6de;padding:3px}.img-bordered-sm{border:2px solid #d2d6de;padding:2px}.attachment-block{border:1px solid #f4f4f4;padding:5px;margin-bottom:10px;background:#f7f7f7}.attachment-block .attachment-img{max-width:100px;max-height:100px;height:auto;float:left}.attachment-block .attachment-heading{margin:0}.attachment-block .attachment-text{color:#555}.connectedSortable{min-height:100px}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sort-highlight{background:#f4f4f4;border:1px dashed #ddd;margin-bottom:10px}.full-opacity-hover{opacity:.65;filter:alpha(opacity=65)}.full-opacity-hover:hover{opacity:1;filter:alpha(opacity=100)}.chart{position:relative;overflow:hidden;width:100%}.chart canvas,.chart svg{width:100%!important}@media print{.content-header,.left-side,.main-header,.main-sidebar,.no-print{display:none!important}.content-wrapper,.main-footer,.right-side{margin-left:0!important;min-height:0!important;-webkit-transform:translate(0,0)!important;-ms-transform:translate(0,0)!important;-o-transform:translate(0,0)!important;transform:translate(0,0)!important}.fixed .content-wrapper,.fixed .right-side{padding-top:0!important}.invoice{width:100%;border:0;margin:0;padding:0}.invoice-col{float:left;width:33.3333333%}.table-responsive{overflow:auto}.table-responsive>.table tr td,.table-responsive>.table tr th{white-space:normal!important}}.skin-blue .main-header .navbar .nav>li>a{color:#fff}.skin-blue .main-header .navbar .nav .open>a,.skin-blue .main-header .navbar .nav .open>a:focus,.skin-blue .main-header .navbar .nav .open>a:hover,.skin-blue .main-header .navbar .nav>.active>a,.skin-blue .main-header .navbar .nav>li>a:active,.skin-blue .main-header .navbar .nav>li>a:focus,.skin-blue .main-header .navbar .nav>li>a:hover{background:rgba(0,0,0,.1);color:#f6f6f6}.skin-blue .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,.1);background-color:#367fa9}.skin-blue .main-header .navbar .sidebar-toggle,.skin-blue .user-panel>.info,.skin-blue .user-panel>.info>a{color:#fff}@media (max-width:767px){.skin-blue .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,.1)}.skin-blue .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue .main-header .logo{background-color:#367fa9;color:#fff;border-bottom:0 solid transparent}.skin-blue .main-header .logo:hover{background-color:#357ca5}.skin-blue .main-header li.user-header{background-color:#3c8dbc}.skin-blue .content-header{background:0 0}.skin-blue .left-side,.skin-blue .main-sidebar,.skin-blue .wrapper{background-color:#222d32}.skin-blue .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-blue .sidebar-menu>li>a{border-left:3px solid transparent}.skin-blue .sidebar-menu>li.active>a,.skin-blue .sidebar-menu>li:hover>a{color:#fff;background:#1e282c;border-left-color:#3c8dbc}.skin-blue .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-blue .sidebar a{color:#b8c7ce}.skin-blue .treeview-menu>li>a{color:#8aa4af}.skin-blue .treeview-menu>li.active>a,.skin-blue .treeview-menu>li>a:hover{color:#fff}.skin-blue .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px}.skin-blue .sidebar-form .btn,.skin-blue .sidebar-form input[type=text]{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-blue .sidebar-form input[type=text]{color:#666;border-radius:2px 0 0 2px}.skin-blue .sidebar-form input[type=text]:focus,.skin-blue .sidebar-form input[type=text]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue .sidebar-form input[type=text]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue .sidebar-form .btn{color:#999;border-radius:0 2px 2px 0}.skin-blue-light .main-header .navbar{background-color:#3c8dbc}.skin-blue-light .main-header .navbar .nav>li>a{color:#fff}.skin-blue-light .main-header .navbar .nav .open>a,.skin-blue-light .main-header .navbar .nav .open>a:focus,.skin-blue-light .main-header .navbar .nav .open>a:hover,.skin-blue-light .main-header .navbar .nav>.active>a,.skin-blue-light .main-header .navbar .nav>li>a:active,.skin-blue-light .main-header .navbar .nav>li>a:focus,.skin-blue-light .main-header .navbar .nav>li>a:hover{background:rgba(0,0,0,.1);color:#f6f6f6}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,.1);background-color:#367fa9}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}@media (max-width:767px){.skin-blue-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,.1)}.skin-blue-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue-light .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue-light .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue-light .main-header .logo:hover{background-color:#3b8ab8}.skin-blue-light .main-header li.user-header{background-color:#3c8dbc}.skin-blue-light .content-header{background:0 0}.skin-blue-light .left-side,.skin-blue-light .main-sidebar,.skin-blue-light .wrapper{background-color:#f9fafc}.skin-blue-light .content-wrapper,.skin-blue-light .main-footer{border-left:1px solid #d2d6de}.skin-blue-light .user-panel>.info,.skin-blue-light .user-panel>.info>a{color:#444}.skin-blue-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-blue-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-blue-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-blue-light .sidebar-menu>li.active>a,.skin-blue-light .sidebar-menu>li:hover>a{color:#000;background:#f4f4f5}.skin-blue-light .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-blue-light .sidebar a{color:#444}.skin-blue-light .treeview-menu>li>a{color:#777}.skin-blue-light .treeview-menu>li.active>a,.skin-blue-light .treeview-menu>li>a:hover{color:#000}.skin-blue-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px}.skin-blue-light .sidebar-form .btn,.skin-blue-light .sidebar-form input[type=text]{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-blue-light .sidebar-form input[type=text]{color:#666;border-radius:2px 0 0 2px}.skin-blue-light .sidebar-form input[type=text]:focus,.skin-blue-light .sidebar-form input[type=text]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue-light .sidebar-form input[type=text]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue-light .sidebar-form .btn{color:#999;border-radius:0 2px 2px 0}@media (min-width:768px){.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-blue-light .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}body{background-color:#555;background-image:url(../images/boxed-bg.png)}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){body{background-image:url(../images/boxed-bg-2x.png);background-size:auto auto}}.h1,.h2,.h3,.h4,.h5,.h6,.main-header .logo,body,h1,h2,h3,h4,h5,h6{font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif}body.skin-blue-light .main-header .logo{background-color:#367fa9;color:#fff;border-bottom:0 solid transparent}body.skin-blue-light .main-header .logo:hover{background-color:#357ca5}body.skin-blue-light .sidebar-menu>li>a{font-weight:400}body.skin-blue-light .sidebar-menu>li.active>a,body.skin-blue-light .sidebar-menu>li:hover>a{border-left-color:#3c8dbc;font-weight:400}body.skin-blue-light .sidebar-menu>li.header{background:#ececed}body.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#fff}body.skin-blue .sidebar{color:#bbb}body.skin-blue .content-wrapper,body.skin-blue .main-footer{border-left:1px solid #222d32}body.skin-blue .sidebar-menu>li.header{color:#8aa4af}.login-box,.register-box{width:400px;margin:4% auto}@media screen and (max-width:767px){.login-box,.register-box{width:calc(100% - 20px);margin:20px auto}}.login-box .login-box-msg,.login-box .register-box-msg,.register-box .login-box-msg,.register-box .register-box-msg{padding:0 0 20px}.login-box .checkbox,.register-box .checkbox{margin:0}.login-logo,.register-logo{margin-bottom:20px}.box-body>.table-responsive>.table,.sidebar-form .form-group{margin-bottom:0}@media screen and (max-width:767px){.box-body>.table-responsive{border:none;margin-bottom:0}}.sidebar-menu li.header{padding-right:15px}.sidebar-menu li a{padding-left:12px}.sidebar-form .form-group .form-control-feedback,.sidebar-form .form-group input[type=text]{color:#999}.sidebar a.btn{color:#333}.sidebar .subsection{padding:10px;text-align:center}.sidebar .subsection ul{text-align:left}.sidebar-collapse .sidebar .list-inline li{padding-right:0}.sidebar-collapse .hidden-collapsed{display:none}.control-sidebar{min-height:calc(100% - 51px);position:absolute}@media (max-width:768px){.control-sidebar{padding-top:50px}}@media (max-width:767px){.control-sidebar{padding-top:100px}}.control-sidebar-heading{padding:0;margin:15px 0 10px;font-size:14px;font-weight:400}.control-sidebar-light .control-sidebar-heading{color:#777}.control-sidebar-menu li a{padding-top:5px;padding-bottom:5px;white-space:nowrap;color:#333}.control-sidebar-menu li.active a,.control-sidebar-menu li.active a:hover{background-color:#e1e3e9}.control-sidebar-section{max-height:350px;overflow-y:auto;padding-right:15px;margin-right:-15px;padding-left:15px;margin-left:-15px}.login-box ul,.register-box ul,form div.validation-errors ul{margin-bottom:0;padding-left:20px}@media (min-width:768px){.control-sidebar-open .main-footer{margin-right:0}.modal-dialog{width:750px}.modal-sm{width:300px}}.control-sidebar-show{display:none!important}.using-control-sidebar .control-sidebar-show{display:block!important}.using-control-sidebar .control-sidebar-hidden{display:none!important}.control-sidebar-bg{min-height:100%;position:absolute}.content-wrapper,.control-sidebar,.main-footer,.main-header .logo,.main-header .navbar,.main-sidebar{-webkit-transition:initial;-o-transition:initial;transition:initial}.main-footer{height:51px}form div.validation-errors ul li{margin-left:0}.login-page,.register-page{background-color:#555;background-repeat:repeat;background-attachment:fixed;background-image:url(../images/boxed-bg.png)}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.login-page,.register-page{background-image:url(../images/boxed-bg-2x.png);background-size:auto auto}}#toast-container .toast.toast-danger,#toast-container .toast.toast-error,#toast-container .toast.toast-info,#toast-container .toast.toast-success,#toast-container .toast.toast-warning{background-image:none!important}.login-box-body,.register-box-body{-moz-box-shadow:0 0 8px rgba(0,0,0,.5);-webkit-box-shadow:0 0 8px rgba(0,0,0,.5);box-shadow:0 0 8px rgba(0,0,0,.5)}.login-box .checkbox,.register-box .checkbox{margin-top:0}.password-options{float:right}.password-options i{margin:0 5px;cursor:pointer}@media screen and (min-width:768px){.settings-photo{text-align:center}.settings-photo img{margin:0 auto}}.box-body p:last-child,.box>.list-group,.radio.radio-block:last-child{margin-bottom:0}.btn-table{padding:1px 5px;line-height:1}.box-tools .btn-group.open .dropdown-toggle{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}form .btn .loading-icon{margin-right:8px}.dropdown-menu{border-color:#ddd}.dropdown-menu>li>a{color:#333}.dropdown-menu>li>a>.fa{margin-right:0;margin-left:-5px}.btn-link:active{-webkit-box-shadow:none;box-shadow:none}@media (max-width:991px){.content-header .btn-group{display:none}}.form-control{border-radius:0!important}.has-feedback.form-group-sm input{padding-right:37.5px}.has-feedback.has-feedback-left input{padding-left:42.5px;padding-right:0}.has-feedback.has-feedback-left.form-group-sm input{padding-left:37.5px;padding-right:0}.has-feedback.has-feedback-left .form-control-feedback{right:initial;left:0}.radio.radio-block:first-child{margin-top:0}.radio.radio-block:last-child label{border-bottom:0}.radio.radio-block label{display:block;border-bottom:1px solid #f4f4f4;border-radius:3px;padding:10px 10px 10px 30px;font-weight:700}.radio.radio-block label input[type=radio]{margin-left:-20px}.radio.radio-block label>span{display:block;color:#777;font-size:90%;font-weight:400}.radio.radio-block label>span.bottom-line{font-size:100%;color:#333;margin-top:5px}.radio-boxed{border:1px solid #ddd;border-radius:3px;padding:10px 10px 10px 30px}@media (min-width:480px){.radio-boxed{padding:10px 20px 10px 30px}.radio-boxed+.radio-lg{margin-left:20px}.radio-lg{font-size:18px}}.modal-footer{text-align:left}@media (min-width:992px){.modal-lg{width:970px}}.table-selectable td:not(.actions){cursor:pointer}.table-selectable td:not(.actions) span{cursor:text}.table-vmiddle td{vertical-align:middle!important}.box-header.with-border+.box-body .table>tbody>tr:first-child>td{border-top:0}.table td.action-select{text-align:center;width:30px;max-width:30px}.table td.vault-icon{text-align:center;width:41px;max-width:41px;color:#777}.table td.vault-icon img{max-width:24px;max-height:24px;border-radius:3px}@media (max-width:991px){.table td.action-select,.table td.vault-icon{display:none}}.callout.callout-default{background-color:#fff;border-color:#3c3c3c}.callout.callout-default a{color:#3c8dbc}.callout.callout-default a:active,.callout.callout-default a:focus,.callout.callout-default a:hover{color:#72afd2}.box .callout.callout-default .btn-default:not(:hover),.login-box-body .callout.callout-default .btn-default:not(:hover),.modal .callout.callout-default .btn-default:not(:hover),.register-box-body .callout.callout-default .btn-default:not(:hover){background-color:#fff}.callout a.btn.btn-default{color:#333}.alert-notification{border-radius:0;border-left:none;border-right:none;margin-bottom:0;cursor:pointer}.box>.list-group .list-group-item{border-width:1px 0;border-radius:0;border-color:#f4f4f4}.box>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.box-header+.list-group .list-group-item:first-child,.list-group+.box-footer{border-top-width:0}.box-header .box-filters{position:absolute;left:10px;top:5px}.box-header .box-filters input{display:inline}.cc,.tooltip-wrapper{display:inline-block}.box-apps{font-size:20px}.box-apps ul.fa-ul li{margin-bottom:10px}.box-apps a .fa{color:#2c3b41}.box-breach img{max-height:200px;margin-bottom:20px;margin-left:auto;margin-right:auto}@media (min-width:768px){.box-breach img{margin-top:10px}}#toast-container{position:absolute}#toast-container.toast-top-right{top:65px;right:15px}#toast-container .toast{border-radius:0;-moz-box-shadow:0 0 8px rgba(0,0,0,.5);-webkit-box-shadow:0 0 8px rgba(0,0,0,.5);box-shadow:0 0 8px rgba(0,0,0,.5)}@media (max-width:767px){#toast-container.toast-top-right{top:initial;bottom:0;right:0;width:100%}#toast-container .toast{width:100%}}#toast-container .toast.toast-danger:before,#toast-container .toast.toast-error:before{content:"\f0e7"}#toast-container .toast.toast-warning:before{content:"\f071"}#toast-container .toast.toast-info:before{content:"\f005"}#toast-container .toast.toast-success:before{content:"\f00C"}#toast-container .toast:before{position:absolute;font-family:FontAwesome;font-size:24px;line-height:24px;float:left;color:#fff;padding-right:.5em;margin:auto .5em auto -1.5em}.monospaced,.totp .totp-code{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}h1,h2,h3,h4,h5,h6{margin-top:0}.strike{text-decoration:line-through;color:#777}.cc{background:url(../images/cards.png) no-repeat;overflow:hidden;text-indent:-9999px;text-align:left;width:73px;height:44px}.cc.amex{background-position:0 0}.cc.diners{background-position:-73px 0}.cc.discover{background-position:0 -44px}.cc.jcb{background-position:-73px -44px}.cc.maestro,.cc.mastercard{background-position:0 -88px}.cc.visa{background-position:-73px -88px}#duoFrameWrapper{margin:0 -36px 10px;background:url(../images/loading.svg) no-repeat}@media (min-width:360px){#duoFrameWrapper{margin:0 -10px 10px}}@media (min-width:768px){#duoFrameWrapper{margin:0 0 10px}}#duoFrameWrapper iframe{width:100%;min-width:304px;max-width:620px;height:500px;border:none}.braintree-placeholder,.braintree-sheet__header{display:none}.braintree-sheet__content--button{text-align:left;padding:0;min-height:0}.braintree-sheet__container{margin-bottom:0}.braintree-sheet{border:none}.clickable{cursor:pointer}.label-full{font-size:85%;font-weight:400}.totp-col{margin:-10px 0 10px}@media (min-width:768px){.totp-col{padding-top:26px;margin:0}}.totp-col img{margin-right:10px}.totp .totp-code{font-size:1.2em}.totp .totp-countdown{margin-right:11px;display:inline-block;vertical-align:-50%;user-select:none}.totp .totp-countdown .totp-sec{font-size:.85em;position:absolute;line-height:32px;width:32px;text-align:center}.totp .totp-countdown svg{width:32px;height:32px;transform:rotate(-90deg)}.totp .totp-countdown .totp-circle{stroke:#337ab7;fill:none}.totp .totp-countdown .totp-circle.inner{stroke-width:3;stroke-dasharray:78.6;stroke-dashoffset:0}.totp .totp-countdown .totp-circle.outer{stroke-width:2;stroke-dasharray:88;stroke-dashoffset:0}.totp.low .totp-code,.totp.low .totp-sec{color:#dd4b39}.totp.low .totp-circle{stroke:#dd4b39}.password-meter .progress{margin-bottom:10px}@media (min-width:768px){.password-meter .progress{margin-bottom:0}}textarea#notes{height:100px}textarea#notes.big-textarea{height:200px} +\ No newline at end of file diff --git a/web-vault/index.html b/web-vault/index.html @@ -29,12 +29,12 @@ <meta name="theme-color" content="#3c8dbc"> <base href="/" /> - <title page-title>bitwarden Web Vault</title> + <title page-title>Bitwarden Web Vault</title> <meta name="x-stylesheet-test" content="" class="fa invisible" /> - <script src="js/fallback-styles.min.js?v=twgcvb"></script> + <script src="js/fallback-styles.min.js?v=h5k6l8"></script> - <link rel="stylesheet" href="css/vault.min.css?v=twgcvb" /> + <link rel="stylesheet" href="css/vault.min.css?v=h5k6l8" /> <link rel="apple-touch-icon" sizes="180x180" href="images/icons/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="images/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="images/icons/favicon-16x16.png"> @@ -46,11 +46,11 @@ 'control-sidebar-open': main.usingControlSidebar && main.openControlSidebar}"> <div ui-view></div> - <script src="js/fallback-scripts.min.js?v=twgcvb"></script> - <script src="js/settings.js?v=twgcvb"></script> + <script src="js/fallback-scripts.min.js?v=h5k6l8"></script> + <script src="js/settings.js?v=h5k6l8"></script> - <script src="js/lib.min.js?v=twgcvb"></script> - <script src="js/bw.min.js?v=twgcvb"></script> - <script src="js/app.min.js?v=twgcvb"></script> + <script src="js/lib.min.js?v=h5k6l8"></script> + <script src="js/bw.min.js?v=h5k6l8"></script> + <script src="js/app.min.js?v=h5k6l8"></script> </body> </html> diff --git a/web-vault/js/app.min.js b/web-vault/js/app.min.js @@ -1 +1 @@ -angular.module("bit",["ui.router","ngMessages","angular-jwt","ui.bootstrap.showErrors","toastr","angulartics","angular-promise-polyfill","bit.directives","bit.filters","bit.services","bit.global","bit.accounts","bit.vault","bit.settings","bit.tools","bit.organization","bit.reports"]),angular.module("bit").constant("appSettings",{apiUri:"/api",identityUri:"/identity",iconsUri:"/icons",stripeKey:"",braintreeKey:"",selfHosted:!1,version:"1.22.0",environment:"Production"}),angular.module("bit.accounts",["ui.bootstrap","ngCookies"]),angular.module("bit.directives",[]),angular.module("bit.filters",[]),angular.module("bit.reports",["toastr","ngSanitize"]),angular.module("bit.global",[]),angular.module("bit.organization",["ui.bootstrap"]),angular.module("bit.services",["ngResource","ngStorage","angular-jwt"]),angular.module("bit.settings",["ui.bootstrap","toastr"]),angular.module("bit.vault",["ui.bootstrap","ngclipboard"]),angular.module("bit.tools",["ui.bootstrap","toastr"]),angular.module("bit").factory("apiInterceptor",["$injector","$q","toastr","appSettings","utilsService",function(e,t,n,o,r){return{request:function(e){return e.url.indexOf(o.apiUri+"/")>-1&&(e.headers["Device-Type"]=r.getDeviceType()),e},response:function(o){return 401!==o.status&&403!==o.status||(e.get("authService").logOut(),e.get("$state").go("frontend.login.info").then(function(){n.warning("Your login session has expired.","Logged out")})),o||t.when(o)},responseError:function(o){return 401!==o.status&&403!==o.status||(e.get("authService").logOut(),e.get("$state").go("frontend.login.info").then(function(){n.warning("Your login session has expired.","Logged out")})),t.reject(o)}}}]),angular.module("bit").config(["$stateProvider","$urlRouterProvider","$httpProvider","jwtInterceptorProvider","jwtOptionsProvider","$uibTooltipProvider","toastrConfig","$locationProvider","$qProvider","appSettings",function(e,t,n,o,r,a,i,s,l,c){var u;angular.extend(c,window.bitwardenAppSettings),l.errorOnUnhandledRejections(!1),s.hashPrefix(""),o.tokenGetter=["options","tokenService","authService",function(e,t,n){if(-1!==e.url.indexOf(c.apiUri+"/")){if(u)return u;var o=t.getToken();if(o){if(!t.tokenNeedsRefresh(o))return o;var r=n.refreshAccessToken();if(r)return u=r.then(function(e){return u=null,e||o})}}}],angular.extend(i,{closeButton:!0,progressBar:!0,showMethod:"slideDown",target:".toast-target"}),a.options({popupDelay:600,appendToBody:!0}),(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&(n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache"),n.interceptors.push("apiInterceptor"),n.interceptors.push("jwtInterceptor"),t.otherwise("/"),e.state("backend",{templateUrl:"app/views/backendLayout.html",abstract:!0,data:{authorize:!0}}).state("backend.user",{templateUrl:"app/views/userLayout.html",abstract:!0}).state("backend.user.vault",{url:"^/vault",templateUrl:"app/vault/views/vault.html",controller:"vaultController",data:{pageTitle:"My Vault",controlSidebar:!0},params:{refreshFromServer:!1}}).state("backend.user.settings",{url:"^/settings",templateUrl:"app/settings/views/settings.html",controller:"settingsController",data:{pageTitle:"Settings"}}).state("backend.user.settingsDomains",{url:"^/settings/domains",templateUrl:"app/settings/views/settingsDomains.html",controller:"settingsDomainsController",data:{pageTitle:"Domain Settings"}}).state("backend.user.settingsTwoStep",{url:"^/settings/two-step",templateUrl:"app/settings/views/settingsTwoStep.html",controller:"settingsTwoStepController",data:{pageTitle:"Two-step Login"}}).state("backend.user.settingsCreateOrg",{url:"^/settings/create-organization",templateUrl:"app/settings/views/settingsCreateOrganization.html",controller:"settingsCreateOrganizationController",data:{pageTitle:"Create Organization"}}).state("backend.user.settingsBilling",{url:"^/settings/billing",templateUrl:"app/settings/views/settingsBilling.html",controller:"settingsBillingController",data:{pageTitle:"Billing"}}).state("backend.user.settingsPremium",{url:"^/settings/premium",templateUrl:"app/settings/views/settingsPremium.html",controller:"settingsPremiumController",data:{pageTitle:"Go Premium"}}).state("backend.user.tools",{url:"^/tools",templateUrl:"app/tools/views/tools.html",controller:"toolsController",data:{pageTitle:"Tools"}}).state("backend.user.reportsBreach",{url:"^/reports/breach",templateUrl:"app/reports/views/reportsBreach.html",controller:"reportsBreachController",data:{pageTitle:"Data Breach Report"}}).state("backend.user.apps",{url:"^/apps",templateUrl:"app/views/apps.html",controller:"appsController",data:{pageTitle:"Get the Apps"}}).state("backend.org",{templateUrl:"app/views/organizationLayout.html",abstract:!0}).state("backend.org.dashboard",{url:"^/organization/:orgId",templateUrl:"app/organization/views/organizationDashboard.html",controller:"organizationDashboardController",data:{pageTitle:"Organization Dashboard"}}).state("backend.org.people",{url:"/organization/:orgId/people?viewEvents&search",templateUrl:"app/organization/views/organizationPeople.html",controller:"organizationPeopleController",data:{pageTitle:"Organization People"}}).state("backend.org.collections",{url:"/organization/:orgId/collections?search",templateUrl:"app/organization/views/organizationCollections.html",controller:"organizationCollectionsController",data:{pageTitle:"Organization Collections"}}).state("backend.org.settings",{url:"/organization/:orgId/settings",templateUrl:"app/organization/views/organizationSettings.html",controller:"organizationSettingsController",data:{pageTitle:"Organization Settings"}}).state("backend.org.billing",{url:"/organization/:orgId/billing",templateUrl:"app/organization/views/organizationBilling.html",controller:"organizationBillingController",data:{pageTitle:"Organization Billing"}}).state("backend.org.vault",{url:"/organization/:orgId/vault?viewEvents&search",templateUrl:"app/organization/views/organizationVault.html",controller:"organizationVaultController",data:{pageTitle:"Organization Vault"}}).state("backend.org.groups",{url:"/organization/:orgId/groups?search",templateUrl:"app/organization/views/organizationGroups.html",controller:"organizationGroupsController",data:{pageTitle:"Organization Groups"}}).state("backend.org.events",{url:"/organization/:orgId/events",templateUrl:"app/organization/views/organizationEvents.html",controller:"organizationEventsController",data:{pageTitle:"Organization Events"}}).state("frontend",{templateUrl:"app/views/frontendLayout.html",abstract:!0,data:{authorize:!1}}).state("frontend.login",{templateUrl:"app/accounts/views/accountsLogin.html",controller:"accountsLoginController",params:{returnState:null,email:null,premium:null,org:null},data:{bodyClass:"login-page"}}).state("frontend.login.info",{url:"^/?org&premium&email",templateUrl:"app/accounts/views/accountsLoginInfo.html",data:{pageTitle:"Log In"}}).state("frontend.login.twoFactor",{url:"^/two-step?org&premium&email",templateUrl:"app/accounts/views/accountsLoginTwoFactor.html",data:{pageTitle:"Log In (Two-step)"}}).state("frontend.logout",{url:"^/logout",controller:"accountsLogoutController",data:{authorize:!0}}).state("frontend.passwordHint",{url:"^/password-hint",templateUrl:"app/accounts/views/accountsPasswordHint.html",controller:"accountsPasswordHintController",data:{pageTitle:"Master Password Hint",bodyClass:"login-page"}}).state("frontend.recover",{url:"^/recover",templateUrl:"app/accounts/views/accountsRecover.html",controller:"accountsRecoverController",data:{pageTitle:"Recover Account",bodyClass:"login-page"}}).state("frontend.recover-delete",{url:"^/recover-delete",templateUrl:"app/accounts/views/accountsRecoverDelete.html",controller:"accountsRecoverDeleteController",data:{pageTitle:"Delete Account",bodyClass:"login-page"}}).state("frontend.verify-recover-delete",{url:"^/verify-recover-delete?userId&token&email",templateUrl:"app/accounts/views/accountsVerifyRecoverDelete.html",controller:"accountsVerifyRecoverDeleteController",data:{pageTitle:"Confirm Delete Account",bodyClass:"login-page"}}).state("frontend.register",{url:"^/register?org&premium",templateUrl:"app/accounts/views/accountsRegister.html",controller:"accountsRegisterController",params:{returnState:null,email:null,org:null,premium:null},data:{pageTitle:"Register",bodyClass:"register-page"}}).state("frontend.organizationAccept",{url:"^/accept-organization?organizationId&organizationUserId&token&email&organizationName",templateUrl:"app/accounts/views/accountsOrganizationAccept.html",controller:"accountsOrganizationAcceptController",data:{pageTitle:"Accept Organization Invite",bodyClass:"login-page",skipAuthorize:!0}}).state("frontend.verifyEmail",{url:"^/verify-email?userId&token",templateUrl:"app/accounts/views/accountsVerifyEmail.html",controller:"accountsVerifyEmailController",data:{pageTitle:"Verifying Email",bodyClass:"login-page",skipAuthorize:!0}})}]).run(["$rootScope","authService","$state",function(e,t,n){e.$on("$stateChangeSuccess",function(){$("html, body").animate({scrollTop:0},200)}),e.$on("$stateChangeStart",function(o,r,a){if(!r.data||!r.data.authorize){if(r.data&&r.data.skipAuthorize)return;if(!t.isAuthenticated())return;return o.preventDefault(),void n.go("backend.user.vault")}if(!t.isAuthenticated())return o.preventDefault(),t.logOut(),void n.go("frontend.login.info");r.name.indexOf("backend.org.")>-1&&a.orgId&&(e.vaultCiphers=e.vaultGroupings=null,t.getUserProfile().then(function(e){var t=e.organizations;t&&a.orgId in t&&2===t[a.orgId].status&&2!==t[a.orgId].type||(o.preventDefault(),n.go("backend.user.vault"))}))})}]),angular.module("bit").constant("constants",{rememberedEmailCookieName:"bit.rememberedEmail",encType:{AesCbc256_B64:0,AesCbc128_HmacSha256_B64:1,AesCbc256_HmacSha256_B64:2,Rsa2048_OaepSha256_B64:3,Rsa2048_OaepSha1_B64:4,Rsa2048_OaepSha256_HmacSha256_B64:5,Rsa2048_OaepSha1_HmacSha256_B64:6},orgUserType:{owner:0,admin:1,user:2},orgUserStatus:{invited:0,accepted:1,confirmed:2},twoFactorProvider:{u2f:4,yubikey:3,duo:2,authenticator:0,email:1,remember:5},cipherType:{login:1,secureNote:2,card:3,identity:4},fieldType:{text:0,hidden:1,boolean:2},deviceType:{android:0,ios:1,chromeExt:2,firefoxExt:3,operaExt:4,edgeExt:5,windowsDesktop:6,macOsDesktop:7,linuxDesktop:8,chrome:9,firefox:10,opera:11,edge:12,ie:13,unknown:14,uwp:16,safari:17,vivaldi:18,vivaldiExt:19},eventType:{User_LoggedIn:1e3,User_ChangedPassword:1001,User_Enabled2fa:1002,User_Disabled2fa:1003,User_Recovered2fa:1004,User_FailedLogIn:1005,User_FailedLogIn2fa:1006,Cipher_Created:1100,Cipher_Updated:1101,Cipher_Deleted:1102,Cipher_AttachmentCreated:1103,Cipher_AttachmentDeleted:1104,Cipher_Shared:1105,Cipher_UpdatedCollections:1106,Collection_Created:1300,Collection_Updated:1301,Collection_Deleted:1302,Group_Created:1400,Group_Updated:1401,Group_Deleted:1402,OrganizationUser_Invited:1500,OrganizationUser_Confirmed:1501,OrganizationUser_Updated:1502,OrganizationUser_Removed:1503,OrganizationUser_UpdatedGroups:1504,Organization_Updated:1600},twoFactorProviderInfo:[{type:0,name:"Authenticator App",description:"Use an authenticator app (such as Authy or Google Authenticator) to generate time-based verification codes.",enabled:!1,active:!0,free:!0,image:"authapp.png",displayOrder:0,priority:1,requiresUsb:!1},{type:3,name:"YubiKey OTP Security Key",description:"Use a YubiKey to access your account. Works with YubiKey 4, 4 Nano, 4C, and NEO devices.",enabled:!1,active:!0,image:"yubico.png",displayOrder:1,priority:3,requiresUsb:!0},{type:2,name:"Duo",description:"Verify with Duo Security using the Duo Mobile app, SMS, phone call, or U2F security key.",enabled:!1,active:!0,image:"duo.png",displayOrder:2,priority:2,requiresUsb:!1},{type:4,name:"FIDO U2F Security Key",description:"Use any FIDO U2F enabled security key to access your account.",enabled:!1,active:!0,image:"fido.png",displayOrder:3,priority:4,requiresUsb:!0},{type:1,name:"Email",description:"Verification codes will be emailed to you.",enabled:!1,active:!0,free:!0,image:"gmail.png",displayOrder:4,priority:0,requiresUsb:!1}],plans:{free:{basePrice:0,noAdditionalSeats:!0,noPayment:!0,upgradeSortOrder:-1},families:{basePrice:1,annualBasePrice:12,baseSeats:5,noAdditionalSeats:!0,annualPlanType:"familiesAnnually",upgradeSortOrder:1},teams:{basePrice:5,annualBasePrice:60,monthlyBasePrice:8,baseSeats:5,seatPrice:2,annualSeatPrice:24,monthlySeatPrice:2.5,monthPlanType:"teamsMonthly",annualPlanType:"teamsAnnually",upgradeSortOrder:2},enterprise:{seatPrice:3,annualSeatPrice:36,monthlySeatPrice:4,monthPlanType:"enterpriseMonthly",annualPlanType:"enterpriseAnnually",upgradeSortOrder:3}},storageGb:{price:.33,monthlyPrice:.5,yearlyPrice:4},premium:{price:10,yearlyPrice:10}}),angular.module("bit.accounts").controller("accountsLoginController",["$scope","$rootScope","$cookies","apiService","cryptoService","authService","$state","constants","$analytics","$uibModal","$timeout","$window","$filter","toastr",function(e,t,n,o,r,a,i,s,l,c,u,d,p,m){e.state=i,e.twoFactorProviderConstants=s.twoFactorProvider,e.rememberTwoFactor={checked:!1};var g=!0;e.returnState=i.params.returnState,e.stateEmail=i.params.email,!e.returnState&&i.params.org?e.returnState={name:"backend.user.settingsCreateOrg",params:{plan:i.params.org}}:!e.returnState&&i.params.premium&&(e.returnState={name:"backend.user.settingsPremium"}),!(i.current.name.indexOf("twoFactor")>-1)||e.twoFactorProviders&&e.twoFactorProviders.length||i.go("frontend.login.info",{returnState:e.returnState});var f,h,v=n.get(s.rememberedEmailCookieName);function y(){e.returnState?i.go(e.returnState.name,e.returnState.params):i.go("backend.user.vault")}function b(){var t;if(g=!0,e.twoFactorProvider===s.twoFactorProvider.duo)t=e.twoFactorProviders[s.twoFactorProvider.duo],d.Duo.init({host:t.Host,sig_request:t.Signature,submit_callback:function(t){var n=$(t).find('input[name="sig_response"]').val();e.twoFactor(n)}});else if(e.twoFactorProvider===s.twoFactorProvider.u2f){g=!1,t=e.twoFactorProviders[s.twoFactorProvider.u2f],function t(n){if(g)return;if(n.length<1||e.twoFactorProvider!==s.twoFactorProvider.u2f)return;console.log("listening for u2f key...");d.u2f.sign(n[0].appId,n[0].challenge,[{version:n[0].version,keyHandle:n[0].keyHandle}],function(o){if(e.twoFactorProvider===s.twoFactorProvider.u2f)return o.errorCode?(console.log(o.errorCode),void u(function(){t(n)},5===o.errorCode?0:1e3)):void e.twoFactor(JSON.stringify(o))},10)}(JSON.parse(t.Challenges))}else e.twoFactorProvider===s.twoFactorProvider.email&&(t=e.twoFactorProviders[s.twoFactorProvider.email],e.twoFactorEmail=t.Email,Object.keys(e.twoFactorProviders).length>1&&e.sendEmail(!1))}v||e.stateEmail?(e.model={email:e.stateEmail||v,rememberEmail:null!==v},u(function(){$("#masterPassword").focus()})):u(function(){$("#email").focus()}),e.twoFactorProviders=null,e.twoFactorProvider=null,e.login=function(t){e.loginPromise=a.logIn(t.email,t.masterPassword).then(function(o){if(t.rememberEmail){var r=new Date;r.setFullYear(r.getFullYear()+10),n.put(s.rememberedEmailCookieName,t.email,{expires:r})}else n.remove(s.rememberedEmailCookieName);o&&Object.keys(o).length>0?(f=t.email,h=t.masterPassword,e.twoFactorProviders=function(e){if(t=!1,n=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0,4)))&&(t=!0),!t&&!navigator.userAgent.match(/iPad/i))return e;var t,n;for(var o=Object.keys(e),r=0;r<o.length;r++){var a=p("filter")(s.twoFactorProviderInfo,{type:o[r],active:!0,requiresUsb:!1});a.length||delete e[o[r]]}return e}(o),e.twoFactorProvider=function(e){for(var t=Object.keys(e),n=null,o=-1,r=0;r<t.length;r++){var a=p("filter")(s.twoFactorProviderInfo,{type:t[r],active:!0});if(a.length&&a[0].priority>o){if(a[0].type===s.twoFactorProvider.u2f&&!u2f.isSupported)continue;n=a[0].type,o=a[0].priority}}if(null===n)return null;return parseInt(n)}(e.twoFactorProviders),l.eventTrack("Logged In To Two-step"),i.go("frontend.login.twoFactor",{returnState:e.returnState}).then(function(){u(function(){$("#code").focus(),b()})})):(l.eventTrack("Logged In"),y()),t.masterPassword=""})},e.twoFactor=function(t){e.twoFactorProvider!==s.twoFactorProvider.email&&e.twoFactorProvider!==s.twoFactorProvider.authenticator||(t=t.replace(" ","")),e.twoFactorPromise=a.logIn(f,h,t,e.twoFactorProvider,e.rememberTwoFactor.checked||!1),e.twoFactorPromise.then(function(){l.eventTrack("Logged In From Two-step"),y()},function(){e.twoFactorProvider===s.twoFactorProvider.u2f&&b()})},e.anotherMethod=function(){c.open({animation:!0,templateUrl:"app/accounts/views/accountsTwoFactorMethods.html",controller:"accountsTwoFactorMethodsController",resolve:{providers:function(){return e.twoFactorProviders}}}).result.then(function(t){e.twoFactorProvider=t,u(function(){$("#code").focus(),b()})})},e.sendEmail=function(t){if(e.twoFactorProvider===s.twoFactorProvider.email)return r.makeKeyAndHash(f,h).then(function(e){return o.twoFactor.sendEmailLogin({email:f,masterPasswordHash:e.hash}).$promise}).then(function(){t&&m.success("Verification email sent to "+e.twoFactorEmail+".")},function(){m.error("Could not send verification email.")})},e.$on("$destroy",function(){g=!0})}]),angular.module("bit.accounts").controller("accountsLogoutController",["$scope","authService","$state","$analytics",function(e,t,n,o){t.logOut(),o.eventTrack("Logged Out"),n.go("frontend.login.info")}]),angular.module("bit.accounts").controller("accountsOrganizationAcceptController",["$scope","$state","apiService","authService","toastr","$analytics",function(e,t,n,o,r,a){e.state={name:t.current.name,params:t.params},t.params.organizationId&&t.params.organizationUserId&&t.params.token&&t.params.email&&t.params.organizationName?e.$on("$viewContentLoaded",function(){o.isAuthenticated()?(e.accepting=!0,n.organizationUsers.accept({orgId:t.params.organizationId,id:t.params.organizationUserId},{token:t.params.token},function(){a.eventTrack("Accepted Invitation"),t.go("backend.user.vault",null,{location:"replace"}).then(function(){r.success("You can access this organization once an administrator confirms your membership. We'll send an email when that happens.","Invite Accepted",{timeOut:1e4})})},function(){a.eventTrack("Failed To Accept Invitation"),t.go("backend.user.vault",null,{location:"replace"}).then(function(){r.error("Unable to accept invitation.","Error")})})):e.loading=!1}):t.go("frontend.login.info").then(function(){r.error("Invalid parameters.")})}]),angular.module("bit.accounts").controller("accountsPasswordHintController",["$scope","$rootScope","apiService","$analytics",function(e,t,n,o){e.success=!1,e.submit=function(t){e.submitPromise=n.accounts.postPasswordHint({email:t.email},function(){o.eventTrack("Requested Password Hint"),e.success=!0}).$promise}}]),angular.module("bit.accounts").controller("accountsRecoverController",["$scope","apiService","cryptoService","$analytics",function(e,t,n,o){e.success=!1,e.submit=function(r){var a=r.email.toLowerCase();e.submitPromise=n.makeKeyAndHash(r.email,r.masterPassword).then(function(e){return t.twoFactor.recover({email:a,masterPasswordHash:e.hash,recoveryCode:r.code.replace(/\s/g,"").toLowerCase()}).$promise}).then(function(){o.eventTrack("Recovered 2FA"),e.success=!0})}}]),angular.module("bit.accounts").controller("accountsRecoverDeleteController",["$scope","$rootScope","apiService","$analytics",function(e,t,n,o){e.success=!1,e.submit=function(t){e.submitPromise=n.accounts.postDeleteRecover({email:t.email},function(){o.eventTrack("Started Delete Recovery"),e.success=!0}).$promise}}]),angular.module("bit.accounts").controller("accountsRegisterController",["$scope","$location","apiService","cryptoService","validationService","$analytics","$state","$timeout",function(e,t,n,o,r,a,i,s){var l=t.search(),c=i.params;e.createOrg=c.org,!c.returnState&&c.org?e.returnState={name:"backend.user.settingsCreateOrg",params:{plan:i.params.org}}:!c.returnState&&c.premium?e.returnState={name:"backend.user.settingsPremium",params:{plan:i.params.org}}:e.returnState=c.returnState,e.success=!1,e.model={email:l.email?l.email:c.email},e.readOnlyEmail=null!==c.email,s(function(){e.model.email?$("#name").focus():$("#email").focus()}),e.registerPromise=null,e.register=function(t){var i=!1;if(e.model.masterPassword.length<8&&(r.addError(t,"MasterPassword","Master password must be at least 8 characters long.",!0),i=!0),e.model.masterPassword!==e.model.confirmMasterPassword&&(r.addError(t,"ConfirmMasterPassword","Master password confirmation does not match.",!0),i=!0),!i){var s,l,c=e.model.email.toLowerCase();e.registerPromise=o.makeKeyAndHash(c,e.model.masterPassword).then(function(e){return s=e,l=o.makeEncKey(e.key),o.makeKeyPair(l.encKey)}).then(function(t){var o={name:e.model.name,email:c,masterPasswordHash:s.hash,masterPasswordHint:e.model.masterPasswordHint,key:l.encKeyEnc,keys:{publicKey:t.publicKey,encryptedPrivateKey:t.privateKeyEnc}};return n.accounts.register(o).$promise},function(e){return r.addError(t,null,"Problem generating keys.",!0),!1}).then(function(t){!1!==t&&(e.success=!0,a.eventTrack("Registered"))})}}}]),angular.module("bit.accounts").controller("accountsTwoFactorMethodsController",["$scope","$uibModalInstance","$analytics","providers","constants",function(e,t,n,o,r){function a(t){for(var n=0;n<r.twoFactorProviderInfo.length;n++)r.twoFactorProviderInfo[n].type===t&&e.providers.push(r.twoFactorProviderInfo[n])}n.eventTrack("accountsTwoFactorMethodsController",{category:"Modal"}),e.providers=[],o.hasOwnProperty(r.twoFactorProvider.authenticator)&&a(r.twoFactorProvider.authenticator),o.hasOwnProperty(r.twoFactorProvider.yubikey)&&a(r.twoFactorProvider.yubikey),o.hasOwnProperty(r.twoFactorProvider.email)&&a(r.twoFactorProvider.email),o.hasOwnProperty(r.twoFactorProvider.duo)&&a(r.twoFactorProvider.duo),o.hasOwnProperty(r.twoFactorProvider.u2f)&&u2f.isSupported&&a(r.twoFactorProvider.u2f),e.choose=function(e){t.close(e.type)},e.close=function(){t.dismiss("close")}}]),angular.module("bit.accounts").controller("accountsVerifyEmailController",["$scope","$state","apiService","toastr","$analytics",function(e,t,n,o,r){t.params.userId&&t.params.token?e.$on("$viewContentLoaded",function(){n.accounts.verifyEmailToken({},{token:t.params.token,userId:t.params.userId},function(){r.eventTrack("Verified Email"),t.go("frontend.login.info",null,{location:"replace"}).then(function(){o.success("Your email has been verified. Thank you.","Success")})},function(){t.go("frontend.login.info",null,{location:"replace"}).then(function(){o.error("Unable to verify email.","Error")})})}):t.go("frontend.login.info").then(function(){o.error("Invalid parameters.")})}]),angular.module("bit.accounts").controller("accountsVerifyRecoverDeleteController",["$scope","$state","apiService","toastr","$analytics",function(e,t,n,o,r){t.params.userId&&t.params.token&&t.params.email?(e.email=t.params.email,e.delete=function(){confirm("Are you sure you want to delete this account? This cannot be undone.")&&(e.deleting=!0,n.accounts.postDeleteRecoverToken({},{token:t.params.token,userId:t.params.userId},function(){r.eventTrack("Recovered Delete"),t.go("frontend.login.info",null,{location:"replace"}).then(function(){o.success("Your account has been deleted. You can register a new account again if you like.","Success")})},function(){t.go("frontend.login.info",null,{location:"replace"}).then(function(){o.error("Unable to delete account.","Error")})}))}):t.go("frontend.login.info").then(function(){o.error("Invalid parameters.")})}]),angular.module("bit.directives").directive("apiField",function(){var e=function(e,t,n,o){o.$registerApiError=function(){o.$setValidity("api",!1)},o.$validators.apiValidate=function(){return o.$setValidity("api",!0),!0}};return{require:"ngModel",restrict:"A",compile:function(t,n){if(!n.name||""===n.name)throw"api-field element does not have a valid name attribute";return e}}}),angular.module("bit.directives").directive("apiForm",["$rootScope","validationService","$timeout",function(e,t,n){return{require:"form",restrict:"A",link:function(e,o,r,a){var i=r.apiForm||null;void 0!==i&&e.$watch(i,function(e,o,r){if(!r||!r.then)return;e.$errors=null,e.$loading=!0,r.then(function(t){n(function(){e.$loading=!1})},function(r){n(function(){e.$loading=!1,"string"==typeof r?t.addError(e,null,r,!0):t.addErrors(e,r),o.$broadcast("show-errors-check-validity"),$("html, body").animate({scrollTop:0},200)})})}.bind(null,a,e))}}}]),angular.module("bit.directives").directive("fallbackSrc",function(){return function(e,t,n){var o=$(t);o.bind("error",function(e){o.attr("src",n.fallbackSrc)})}}),angular.module("bit.directives").directive("letterAvatar",function(){return{restrict:"AE",replace:!0,scope:{data:"@"},link:function(e,t,n){var o={charCount:n.charcount||2,data:n.data,textColor:n.textcolor||"#ffffff",bgColor:n.bgcolor,height:n.avheight||45,width:n.avwidth||45,fontSize:n.fontsize||20,fontWeight:n.fontweight||300,fontFamily:n.fontfamily||"Open Sans, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif",round:n.round||"true",dynamic:n.dynamic||"true",class:n.avclass||"",border:n.avborder||"false",borderStyle:n.borderstyle||"3px solid white"};function r(){var n=null,r=e.data.toUpperCase();o.charCount>1&&(n=function(e,t){var n=e.split(" ");if(n&&n.length>1){for(var o="",r=0;r<t;r++)o+=n[r].substr(0,1);return o}return null}(r,o.charCount)),n||(n=r.substr(0,o.charCount));var a,i,s,l,c,u,d,p,m=(a=n,i=o.textColor,s=o.fontFamily,l=o.fontWeight,c=o.fontSize,angular.element('<text text-anchor="middle"></text>').attr({y:"50%",x:"50%",dy:"0.35em","pointer-events":"auto",fill:i,"font-family":s}).text(a).css({"font-weight":l,"font-size":c+"px"})),g=o.bgColor?o.bgColor:function(e){var t=0,n=0;for(n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);var o="#";for(n=0;n<3;n++)o+=("00"+(t>>8*n&255).toString(16)).substr(-2);return o}(r),f=(u=o.width,d=o.height,p=g,angular.element("<svg></svg>").attr({xmlns:"http://www.w3.org/2000/svg","pointer-events":"none",width:u,height:d}).css({"background-color":p,width:u+"px",height:d+"px"}));f.append(m);var h=angular.element("<div>").append(f).html(),v="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(h))),y=angular.element("<img>").attr({src:v,title:e.data});"true"===o.round&&y.css("border-radius","50%"),"true"===o.border&&y.css("border",o.borderStyle),o.class&&y.addClass(o.class),"true"===o.dynamic?(t.empty(),t.append(y)):t.replaceWith(y)}"true"===o.dynamic?e.$watch("data",function(){r()}):r()}}}),angular.module("bit.directives").directive("masterPassword",["cryptoService","authService",function(e,t){return{require:"ngModel",restrict:"A",link:function(n,o,r,a){t.getUserProfile().then(function(t){a.$parsers.unshift(function(n){if(n)return e.makeKey(n,t.email).then(function(t){var o=t.keyB64===e.getKey().keyB64;return a.$setValidity("masterPassword",o),o?n:void 0})}),a.$formatters.unshift(function(n){if(n)return e.makeKey(n,t.email).then(function(t){var o=t.keyB64===e.getKey().keyB64;return a.$setValidity("masterPassword",o),n})})})}}}]),angular.module("bit.directives").directive("pageTitle",["$rootScope","$timeout","appSettings",function(e,t,n){return{link:function(n,o){e.$on("$stateChangeStart",function(e,n,r,a,i){var s="bitwarden Web Vault";n.data&&n.data.pageTitle&&(s=n.data.pageTitle+" - "+s),t(function(){o.text(s)})})}}}]),angular.module("bit.directives").directive("passwordMeter",function(){return{template:'<div class="progress {{outerClass}}"><div class="progress-bar progress-bar-{{valueClass}}" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="100" ng-style="{width : ( value + \'%\' ) }"><span class="sr-only">{{value}}%</span></div></div>',restrict:"A",scope:{password:"=passwordMeter",username:"=passwordMeterUsername",outerClass:"@?"},link:function(e){var t=function(e){e.value=function(e,t){if(!t||t===e)return 0;var n=t.length;return e&&""!==e&&(-1!==e.indexOf(t)&&(n-=15),-1!==t.indexOf(e)&&(n-=e.length)),t.length>0&&t.length<=4?n+=t.length:t.length>=5&&t.length<=7?n+=6:t.length>=8&&t.length<=15?n+=12:t.length>=16&&(n+=18),t.match(/[a-z]/)&&(n+=1),t.match(/[A-Z]/)&&(n+=5),t.match(/\d/)&&(n+=5),t.match(/.*\d.*\d.*\d/)&&(n+=5),t.match(/[!,@,#,$,%,^,&,*,?,_,~]/)&&(n+=5),t.match(/.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~]/)&&(n+=5),t.match(/(?=.*[a-z])(?=.*[A-Z])/)&&(n+=2),t.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/)&&(n+=2),t.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!,@,#,$,%,^,&,*,?,_,~])/)&&(n+=2),n=Math.round(2*n),Math.max(0,Math.min(100,n))}(e.username,e.password),e.valueClass=function(e){switch(Math.round(e/33)){case 0:case 1:return"danger";case 2:return"warning";case 3:return"success"}}(e.value)};e.$watch("password",function(){t(e)}),e.$watch("username",function(){t(e)})}}}),angular.module("bit.directives").directive("passwordViewer",function(){return{restrict:"A",link:function(e,t,n){var o=n.passwordViewer;o&&(t.onclick=function(e){},t.on("click",function(e){var n=$(o);n&&"password"===n.attr("type")?(t.removeClass("fa-eye").addClass("fa-eye-slash"),n.attr("type","text")):n&&"text"===n.attr("type")&&(t.removeClass("fa-eye-slash").addClass("fa-eye"),n.attr("type","password"))}))}}}),angular.module("bit.directives").directive("stopClick",function(){return function(e,t,n){$(t).click(function(e){e.preventDefault()})}}),angular.module("bit.directives").directive("stopProp",function(){return function(e,t,n){$(t).click(function(e){e.stopPropagation()})}}),angular.module("bit.directives").directive("totp",["$timeout","$q",function(e,t){return{template:'<div class="totp{{(low ? \' low\' : \'\')}}" ng-if="code"><span class="totp-countdown"><span class="totp-sec">{{sec}}</span><svg><g><circle class="totp-circle inner" r="12.6" cy="16" cx="16" style="stroke-dashoffset: {{dash}}px;"></circle><circle class="totp-circle outer" r="14" cy="16" cx="16"></circle></g></svg></span><span class="totp-code" id="totp-code">{{codeFormatted}}</span><a href="#" stop-click class="btn btn-link" ngclipboard ngclipboard-error="clipboardError(e)" data-clipboard-text="{{code}}" uib-tooltip="Copy Code" tooltip-placement="right"><i class="fa fa-clipboard"></i></a></div>',restrict:"A",scope:{key:"=totp"},link:function(n){var o=null,r=new function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",n=function(e,t,n){return t+1>=e.length&&(e=Array(t+1-e.length).join(n)+e),e},o=function(e){return parseInt(e,16)},r=function(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)t[n/2]=parseInt(e.substr(n,2),16);return t},a=function(t){return r(function(t){t=t.toUpperCase();var o,r="";for(o=0;o<t.length;o++)e.indexOf(t[o])<0||(r+=t[o]);t=r;var a="",i="";for(o=0;o<t.length;o++){var s=e.indexOf(t.charAt(o));s<0||(a+=n(s.toString(2),5,"0"))}for(o=0;o+4<=a.length;o+=4){var l=a.substr(o,4);i+=parseInt(l,2).toString(16)}return i}(t))},i=function(e,t){return window.crypto.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign"]).then(function(e){return window.crypto.subtle.sign({name:"HMAC",hash:{name:"SHA-1"}},e,t)}).then(function(e){return function(e){for(var t=new Uint8Array(e),n=[],o=0;o<t.length;o++)n.push((t[o]>>>4).toString(16)),n.push((15&t[o]).toString(16));return n.join("")}(e)}).catch(function(e){return null})};this.getCode=function(e){var s,l=Math.round((new Date).getTime()/1e3),c=n(((s=Math.floor(l/30))<15.5?"0":"")+Math.round(s).toString(16),16,"0"),u=r(c),d=a(e);return d.length&&u.length?i(d,u).then(function(e){if(!e)return null;var t=o(e.substring(e.length-1)),n=(o(e.substr(2*t,8))&o("7fffffff"))+"";return n=n.substr(n.length-6,6)}):t(function(e,t){e(null)})}},a=function(t){r.getCode(t.key).then(function(n){e(function(){n?(t.codeFormatted=n.substring(0,3)+" "+n.substring(3),t.code=n):(t.code=null,o&&clearInterval(o))})})},i=function(t){e(function(){var e=Math.round((new Date).getTime()/1e3)%30,n=30-e;t.sec=n,t.dash=(2.62*e).toFixed(2),t.low=n<=7,0===e&&a(t)})};n.$watch("key",function(){if(!n.key)return n.code=null,void(o&&clearInterval(o));a(n),i(n),o&&clearInterval(o),o=setInterval(function(){i(n)},1e3)}),n.$on("$destroy",function(){o&&clearInterval(o)}),n.clipboardError=function(e){alert("Your web browser does not support easy clipboard copying.")}}}}]),angular.module("bit.filters").filter("enumLabelClass",function(){return function(e,t){if("number"!=typeof e)return e.toString();var n;switch(t){case"OrgUserStatus":switch(e){case 0:n="label-default";break;case 1:n="label-warning";break;case 2:default:n="label-success"}break;default:n="label-default"}return n}}),angular.module("bit.filters").filter("enumName",function(){return function(e,t){if("number"!=typeof e)return e.toString();var n;switch(t){case"OrgUserStatus":switch(e){case 0:n="Invited";break;case 1:n="Accepted";break;case 2:default:n="Confirmed"}break;case"OrgUserType":switch(e){case 0:n="Owner";break;case 1:n="Admin";break;case 2:default:n="User"}break;default:n=e.toString()}return n}}),angular.module("bit.tools").controller("reportsBreachController",["$scope","apiService","toastr","authService",function(e,t,n,o){e.loading=!0,e.error=!1,e.breachAccounts=[],e.email=null,e.$on("$viewContentLoaded",function(){o.getUserProfile().then(function(n){return e.email=n.email,t.hibp.get({email:e.email}).$promise}).then(function(t){for(var n=[],o=0;o<t.length;o++){var r={id:t[o].Name,title:t[o].Title,domain:t[o].Domain,date:new Date(t[o].BreachDate),reportedDate:new Date(t[o].AddedDate),modifiedDate:new Date(t[o].ModifiedDate),count:t[o].PwnCount,description:t[o].Description,classes:t[o].DataClasses,image:"https://haveibeenpwned.com/Content/Images/PwnedLogos/"+t[o].Name+"."+t[o].LogoType};n.push(r)}e.breachAccounts=n,e.loading=!1},function(t){e.error=404!==t.status,e.loading=!1})})}]),angular.module("bit.global").controller("appsController",["$scope","$state",function(e,t){}]),angular.module("bit.global").controller("mainController",["$scope","$state","authService","appSettings","toastr","$window","$document","cryptoService","$uibModal","apiService",function(e,t,n,o,r,a,i,s,l,c){var u,d,p,m=this;m.skinClass=o.selfHosted?"skin-blue-light":"skin-blue",m.bodyClass="",m.usingControlSidebar=m.openControlSidebar=!1,m.searchVaultText=null,m.version=o.version,m.outdatedBrowser=-1!==a.navigator.userAgent.indexOf("MSIE")||-1!==a.navigator.userAgent.indexOf("SamsungBrowser"),e.currentYear=(new Date).getFullYear(),e.$on("$viewContentLoaded",function(){n.getUserProfile().then(function(e){m.userProfile=e}),$.AdminLTE&&($.AdminLTE.layout&&($.AdminLTE.layout.fix(),$.AdminLTE.layout.fixSidebar()),$.AdminLTE.pushMenu&&$.AdminLTE.pushMenu.expandOnHover(),i.off("click",".sidebar li a"))}),e.$on("$stateChangeSuccess",function(e,t,n,o,r){m.usingEncKey=!!s.getEncKey(),m.searchVaultText=null,t.data.bodyClass?m.bodyClass=t.data.bodyClass:(m.bodyClass="",m.usingControlSidebar=!!t.data.controlSidebar,m.openControlSidebar=m.usingControlSidebar&&i.width()>768)}),e.$on("setSearchVaultText",function(e,t){m.searchVaultText=t}),e.addCipher=function(){e.$broadcast("vaultAddCipher")},e.addFolder=function(){e.$broadcast("vaultAddFolder")},e.addOrganizationCipher=function(){e.$broadcast("organizationVaultAddCipher")},e.addOrganizationCollection=function(){e.$broadcast("organizationCollectionsAdd")},e.inviteOrganizationUser=function(){e.$broadcast("organizationPeopleInvite")},e.addOrganizationGroup=function(){e.$broadcast("organizationGroupsAdd")},e.updateKey=function(){l.open({animation:!0,templateUrl:"app/settings/views/settingsUpdateKey.html",controller:"settingsUpdateKeyController"})},e.verifyEmail=function(){e.sendingVerify||(e.sendingVerify=!0,c.accounts.verifyEmail({},null).$promise.then(function(){r.success("Verification email sent."),e.sendingVerify=!1,e.verifyEmailSent=!0}).catch(function(){r.success("Verification email failed."),e.sendingVerify=!1}))},e.updateBrowser=function(){a.open("https://browser-update.org/update.html","_blank")};var g={scrollbarWidth:function(){if(!u){var e=$("body");e.addClass("bit-position-body-scrollbar-measure"),u=a.innerWidth-e[0].clientWidth,u=isFinite(u)?u:0,e.removeClass("bit-position-body-scrollbar-measure")}return u},scrollbarInfo:function(){return{width:g.scrollbarWidth(),visible:i.height()>$(a).height()}}};$(window).on("show.bs.dropdown",function(e){var t=p=$(e.target),n=t.data("appendTo");if(!n)return!0;d=t.find(".dropdown-menu"),$(n).append(d.detach());var o=t.offset(),r={display:"block",top:o.top+t.outerHeight()-("body"!==n?$(window).scrollTop():0)};if(d.hasClass("dropdown-menu-right")){var i=g.scrollbarInfo(),s=0;i.visible&&i.width&&(s=i.width),r.right=a.innerWidth-s-(o.left+t.prop("offsetWidth"))+"px",r.left="auto"}else r.left=o.left+"px",r.right="auto";d.css(r)}),$(window).on("hide.bs.dropdown",function(e){if(!d)return!0;$(e.target).append(d.detach()),d.hide(),d=null,p=null}),e.$on("removeAppendedDropdownMenu",function(e,t){if(!d&&!p)return!0;p.append(d.detach()),d.hide(),d=null,p=null})}]),angular.module("bit.global").controller("paidOrgRequiredController",["$scope","$state","$uibModalInstance","$analytics","$uibModalStack","orgId","constants","authService",function(e,t,n,o,r,a,i,s){o.eventTrack("paidOrgRequiredController",{category:"Modal"}),s.getUserProfile().then(function(t){e.admin=t.organizations[a].type!==i.orgUserType.user}),e.go=function(){e.admin&&(o.eventTrack("Get Paid Org"),t.go("backend.org.billing",{orgId:a}).then(function(){r.dismissAll()}))},e.close=function(){n.dismiss("close")}}]),angular.module("bit.global").controller("premiumRequiredController",["$scope","$state","$uibModalInstance","$analytics","$uibModalStack",function(e,t,n,o,r){o.eventTrack("premiumRequiredController",{category:"Modal"}),e.go=function(){o.eventTrack("Get Premium"),t.go("backend.user.settingsPremium").then(function(){r.dismissAll()})},e.close=function(){n.dismiss("close")}}]),angular.module("bit.global").controller("sideNavController",["$scope","$state","authService","toastr","$analytics","constants","appSettings",function(e,t,n,o,r,a,i){e.$state=t,e.params=t.params,e.orgs=[],e.name="",i.selfHosted?(e.orgIconBgColor="#ffffff",e.orgIconBorder="3px solid #a0a0a0",e.orgIconTextColor="#333333"):(e.orgIconBgColor="#2c3b41",e.orgIconBorder="3px solid #1a2226",e.orgIconTextColor="#ffffff"),n.getUserProfile().then(function(n){if(e.name=n.extended&&n.extended.name?n.extended.name:n.email,n.organizations)if(t.includes("backend.org")&&t.params.orgId in n.organizations)e.orgProfile=n.organizations[t.params.orgId];else{var o=[];for(var r in n.organizations)n.organizations.hasOwnProperty(r)&&(n.organizations[r].enabled||n.organizations[r].type<2)&&o.push(n.organizations[r]);e.orgs=o}}),e.viewOrganization=function(e){e.type!==a.orgUserType.user?(r.eventTrack("View Organization From Side Nav"),t.go("backend.org.dashboard",{orgId:e.id})):o.error("You cannot manage this organization.")},e.searchVault=function(){t.go("backend.user.vault")},e.searchOrganizationVault=function(){t.go("backend.org.vault",{orgId:t.params.orgId})},e.isOrgOwner=function(e){return e&&e.type===a.orgUserType.owner}}]),angular.module("bit.global").controller("topNavController",["$scope",function(e){e.toggleControlSidebar=function(){var e=$("body");e.hasClass("control-sidebar-open")?e.removeClass("control-sidebar-open"):e.addClass("control-sidebar-open")}}]),angular.module("bit.organization").controller("organizationBillingAdjustSeatsController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","add",function(e,t,n,o,r,a,i){r.eventTrack("organizationBillingAdjustSeatsController",{category:"Modal"}),e.add=i,e.seatAdjustment=0,e.submit=function(){var s={seatAdjustment:e.seatAdjustment};i||(s.seatAdjustment*=-1),e.submitPromise=o.organizations.putSeat({id:t.params.orgId},s).$promise.then(function(t){i?(r.eventTrack("Added Seats"),a.success("You have added "+e.seatAdjustment+" seats.")):(r.eventTrack("Removed Seats"),a.success("You have removed "+e.seatAdjustment+" seats.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingAdjustStorageController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","add",function(e,t,n,o,r,a,i){r.eventTrack("organizationBillingAdjustStorageController",{category:"Modal"}),e.add=i,e.storageAdjustment=0,e.submit=function(){var s={storageGbAdjustment:e.storageAdjustment};i||(s.storageGbAdjustment*=-1),e.submitPromise=o.organizations.putStorage({id:t.params.orgId},s).$promise.then(function(t){i?(r.eventTrack("Added Organization Storage"),a.success("You have added "+e.storageAdjustment+" GB.")):(r.eventTrack("Removed Organization Storage"),a.success("You have removed "+e.storageAdjustment+" GB.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingChangePaymentController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","existingPaymentMethod",function(e,t,n,o,r,a,i){r.eventTrack("organizationBillingChangePaymentController",{category:"Modal"}),e.existingPaymentMethod=i,e.paymentMethod="card",e.showPaymentOptions=!0,e.hidePaypal=!0,e.card={},e.bank={},e.changePaymentMethod=function(t){e.paymentMethod=t},e.submit=function(){var s=null;if("card"===e.paymentMethod)s=stripe.card.createToken(e.card);else{if("bank"!==e.paymentMethod)return;e.bank.currency="USD",e.bank.country="US",s=stripe.bankAccount.createToken(e.bank)}e.submitPromise=s.then(function(e){var n={paymentToken:e.id};return o.organizations.putPayment({id:t.params.orgId},n).$promise},function(e){throw e.message}).then(function(t){e.card=null,i?(r.eventTrack("Changed Organization Payment Method"),a.success("You have changed your payment method.")):(r.eventTrack("Added Organization Payment Method"),a.success("You have added a payment method.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingChangePlanController",["$scope","$state","apiService","$uibModalInstance","toastr","$analytics",function(e,t,n,o,r,a){a.eventTrack("organizationBillingChangePlanController",{category:"Modal"}),e.submit=function(){},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingController",["$scope","apiService","$state","$uibModal","toastr","$analytics","appSettings","tokenService","$window",function(e,t,n,o,r,a,i,s,l){e.selfHosted=i.selfHosted,e.charges=[],e.paymentSource=null,e.plan=null,e.subscription=null,e.loading=!0;function c(){t.organizations.getBilling({id:n.params.orgId},function(t){e.loading=!1,e.noSubscription=0===t.PlanType,e.canAdjustSeats=t.PlanType>1;var n=0;if(e.expiration=t.Expiration,t.License,e.plan={name:t.Plan,type:t.PlanType,seats:t.Seats},e.storage=null,e&&t.MaxStorageGb&&(e.storage={currentGb:t.StorageGb||0,maxGb:t.MaxStorageGb,currentName:t.StorageName||"0 GB"},e.storage.percentage=+(e.storage.currentGb/e.storage.maxGb*100).toFixed(2)),e.subscription=null,t.Subscription&&(e.subscription={trialEndDate:t.Subscription.TrialEndDate,cancelledDate:t.Subscription.CancelledDate,status:t.Subscription.Status,cancelled:t.Subscription.Cancelled,markedForCancel:!t.Subscription.Cancelled&&t.Subscription.CancelAtEndDate}),e.nextInvoice=null,t.UpcomingInvoice&&(e.nextInvoice={date:t.UpcomingInvoice.Date,amount:t.UpcomingInvoice.Amount}),t.Subscription&&t.Subscription.Items)for(e.subscription.items=[],n=0;n<t.Subscription.Items.length;n++)e.subscription.items.push({amount:t.Subscription.Items[n].Amount,name:t.Subscription.Items[n].Name,interval:t.Subscription.Items[n].Interval,qty:t.Subscription.Items[n].Quantity});e.paymentSource=null,t.PaymentSource&&(e.paymentSource={type:t.PaymentSource.Type,description:t.PaymentSource.Description,cardBrand:t.PaymentSource.CardBrand,needsVerification:t.PaymentSource.NeedsVerification});var o=[];for(n=0;n<t.Charges.length;n++)o.push({date:t.Charges[n].CreatedDate,paymentSource:t.Charges[n].PaymentSource?t.Charges[n].PaymentSource.Description:"-",amount:t.Charges[n].Amount,status:t.Charges[n].Status,failureMessage:t.Charges[n].FailureMessage,refunded:t.Charges[n].Refunded,partiallyRefunded:t.Charges[n].PartiallyRefunded,refundedAmount:t.Charges[n].RefundedAmount,invoiceId:t.Charges[n].InvoiceId});e.charges=o})}e.expiration=null,e.$on("$viewContentLoaded",function(){c()}),e.changePayment=function(){e.selfHosted||o.open({animation:!0,templateUrl:"app/settings/views/settingsBillingChangePayment.html",controller:"organizationBillingChangePaymentController",resolve:{existingPaymentMethod:function(){return e.paymentSource?e.paymentSource.description:null}}}).result.then(function(){c()})},e.changePlan=function(){e.selfHosted||o.open({animation:!0,templateUrl:"app/organization/views/organizationBillingChangePlan.html",controller:"organizationBillingChangePlanController",resolve:{plan:function(){return e.plan}}}).result.then(function(){c()})},e.adjustSeats=function(t){!e.selfHosted&&e.canAdjustSeats&&o.open({animation:!0,templateUrl:"app/organization/views/organizationBillingAdjustSeats.html",controller:"organizationBillingAdjustSeatsController",resolve:{add:function(){return t}}}).result.then(function(){c()})},e.adjustStorage=function(t){e.selfHosted||o.open({animation:!0,templateUrl:"app/settings/views/settingsBillingAdjustStorage.html",controller:"organizationBillingAdjustStorageController",resolve:{add:function(){return t}}}).result.then(function(){c()})},e.verifyBank=function(){e.selfHosted||o.open({animation:!0,templateUrl:"app/organization/views/organizationBillingVerifyBank.html",controller:"organizationBillingVerifyBankController"}).result.then(function(){c()})},e.cancel=function(){e.selfHosted||confirm("Are you sure you want to cancel? All users will lose access to the organization at the end of this billing cycle.")&&t.organizations.putCancel({id:n.params.orgId},{}).$promise.then(function(e){a.eventTrack("Canceled Plan"),r.success("Organization subscription has been canceled."),c()})},e.reinstate=function(){e.selfHosted||confirm("Are you sure you want to remove the cancellation request and reinstate this organization?")&&t.organizations.putReinstate({id:n.params.orgId},{}).$promise.then(function(e){a.eventTrack("Reinstated Plan"),r.success("Organization cancellation request has been removed."),c()})},e.updateLicense=function(){e.selfHosted&&o.open({animation:!0,templateUrl:"app/settings/views/settingsBillingUpdateLicense.html",controller:"organizationBillingUpdateLicenseController"}).result.then(function(){c()})},e.license=function(){if(!e.selfHosted){var o=prompt("Enter your installation id");o&&""!==o&&t.organizations.getLicense({id:n.params.orgId,installationId:o},function(e){var t=JSON.stringify(e,null,2),n=new Blob([t]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(n,"bitwarden_organization_license.json");else{var o=window.document.createElement("a");o.href=window.URL.createObjectURL(n,{type:"text/plain"}),o.download="bitwarden_organization_license.json",document.body.appendChild(o),o.click(),document.body.removeChild(o)}},function(e){400===e.status?r.error("Invalid installation id."):r.error("Unable to generate license.")})}},e.viewInvoice=function(t){if(!e.selfHosted){var o=i.apiUri+"/organizations/"+n.params.orgId+"/billing-invoice/"+t.invoiceId+"?access_token="+s.getToken();l.open(o)}}}]),angular.module("bit.organization").controller("organizationBillingUpdateLicenseController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","validationService",function(e,t,n,o,r,a,i){r.eventTrack("organizationBillingUpdateLicenseController",{category:"Modal"}),e.submit=function(s){var l=document.getElementById("file").files;if(l&&l.length){var c=new FormData;c.append("license",l[0]),e.submitPromise=o.organizations.putLicense({id:t.params.orgId},c).$promise.then(function(e){r.eventTrack("Updated License"),a.success("You have updated your license."),n.close()})}else i.addError(s,"file","Select a license file.",!0)},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingVerifyBankController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr",function(e,t,n,o,r,a){r.eventTrack("organizationBillingVerifyBankController",{category:"Modal"}),e.submit=function(){var i={amount1:e.amount1,amount2:e.amount2};e.submitPromise=o.organizations.postVerifyBank({id:t.params.orgId},i).$promise.then(function(e){r.eventTrack("Verified Bank Account"),a.success("You have successfully verified your bank account."),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationCollectionsAddController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","authService",function(e,t,n,o,r,a,i){a.eventTrack("organizationCollectionsAddController",{category:"Modal"});var s=0;e.groups=[],e.selectedGroups={},e.loading=!0,e.useGroups=!1,n.opened.then(function(){return i.getUserProfile()}).then(function(n){if(n.organizations){var r=n.organizations[t.params.orgId];e.useGroups=!!r.useGroups}return e.useGroups?o.groups.listOrganization({orgId:t.params.orgId}).$promise:null}).then(function(t){if(t){for(var n=[],o=0;o<t.Data.length;o++)n.push({id:t.Data[o].Id,name:t.Data[o].Name,accessAll:t.Data[o].AccessAll}),t.Data[o].AccessAll||s++;e.groups=n,e.loading=!1}else e.loading=!1}),e.toggleGroupSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.groups.length;o++)n[e.groups[o].id]={id:e.groups[o].id,readOnly:e.groups[o].id in e.selectedGroups&&e.selectedGroups[e.groups[o].id].readOnly};e.selectedGroups=n},e.toggleGroupSelection=function(t){t in e.selectedGroups?delete e.selectedGroups[t]:e.selectedGroups[t]={id:t,readOnly:!1}},e.toggleGroupReadOnlySelection=function(t){t.id in e.selectedGroups&&(e.selectedGroups[t.id].readOnly=!t.accessAll&&!e.selectedGroups[t.id].readOnly)},e.groupSelected=function(t){return t.id in e.selectedGroups||t.accessAll},e.allSelected=function(){return Object.keys(e.selectedGroups).length>=s},e.submit=function(i){var s=r.encryptCollection(i,t.params.orgId);if(e.useGroups)for(var l in s.groups=[],e.selectedGroups)if(e.selectedGroups.hasOwnProperty(l))for(var c=0;c<e.groups.length;c++)if(e.groups[c].id===e.selectedGroups[l].id){e.groups[c].accessAll||s.groups.push(e.selectedGroups[l]);break}e.submitPromise=o.collections.post({orgId:t.params.orgId},s,function(e){a.eventTrack("Created Collection");var o=r.decryptCollection(e,t.params.orgId,!0);n.close(o)}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationCollectionsController",["$scope","$state","apiService","$uibModal","cipherService","$filter","toastr","$analytics","$uibModalStack",function(e,t,n,o,r,a,i,s,l){e.collections=[],e.loading=!0,e.$on("$viewContentLoaded",function(){n.collections.listOrganization({orgId:t.params.orgId},function(n){e.collections=r.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1,t.params.search&&(l.dismissAll(),e.filterSearch=t.params.search,$("#filterSearch").focus())})}),e.$on("organizationCollectionsAdd",function(t,n){e.add()}),e.add=function(){o.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsAdd.html",controller:"organizationCollectionsAddController"}).result.then(function(t){e.collections.push(t)})},e.edit=function(t){o.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsEdit.html",controller:"organizationCollectionsEditController",resolve:{id:function(){return t.id}}}).result.then(function(t){var n=a("filter")(e.collections,{id:t.id},!0);n&&n.length>0&&(n[0].name=t.name)})},e.users=function(e){o.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsUsers.html",controller:"organizationCollectionsUsersController",size:"lg",resolve:{collection:function(){return e}}}).result.then(function(){})},e.groups=function(e){o.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsGroups.html",controller:"organizationCollectionsGroupsController",resolve:{collection:function(){return e}}}).result.then(function(){})},e.delete=function(o){confirm("Are you sure you want to delete this collection ("+o.name+")?")&&n.collections.del({orgId:t.params.orgId,id:o.id},function(){var t=e.collections.indexOf(o);t>-1&&e.collections.splice(t,1),s.eventTrack("Deleted Collection"),i.success(o.name+" has been deleted.","Collection Deleted")},function(){i.error(o.name+" was not able to be deleted.","Error")})}}]),angular.module("bit.organization").controller("organizationCollectionsEditController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","id","authService",function(e,t,n,o,r,a,i,s){a.eventTrack("organizationCollectionsEditController",{category:"Modal"});var l=0;e.collection={},e.groups=[],e.selectedGroups={},e.loading=!0,e.useGroups=!1,n.opened.then(function(){return o.collections.getDetails({orgId:t.params.orgId,id:i}).$promise}).then(function(t){e.collection=r.decryptCollection(t);var n={};if(t.Groups)for(var o=0;o<t.Groups.length;o++)n[t.Groups[o].Id]={id:t.Groups[o].Id,readOnly:t.Groups[o].ReadOnly};return e.selectedGroups=n,s.getUserProfile()}).then(function(n){if(n.organizations){var r=n.organizations[t.params.orgId];e.useGroups=!!r.useGroups}return e.useGroups?o.groups.listOrganization({orgId:t.params.orgId}).$promise:null}).then(function(t){if(t){for(var n=[],o=0;o<t.Data.length;o++)n.push({id:t.Data[o].Id,name:t.Data[o].Name,accessAll:t.Data[o].AccessAll}),t.Data[o].AccessAll||l++;e.groups=n,e.loading=!1}else e.loading=!1}),e.toggleGroupSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.groups.length;o++)n[e.groups[o].id]={id:e.groups[o].id,readOnly:e.groups[o].id in e.selectedGroups&&e.selectedGroups[e.groups[o].id].readOnly};e.selectedGroups=n},e.toggleGroupSelection=function(t){t in e.selectedGroups?delete e.selectedGroups[t]:e.selectedGroups[t]={id:t,readOnly:!1}},e.toggleGroupReadOnlySelection=function(t){t.id in e.selectedGroups&&(e.selectedGroups[t.id].readOnly=!t.accessAll&&!e.selectedGroups[t.id].readOnly)},e.groupSelected=function(t){return t.id in e.selectedGroups||t.accessAll},e.allSelected=function(){return Object.keys(e.selectedGroups).length>=l},e.submit=function(s){var l=r.encryptCollection(s,t.params.orgId);if(e.useGroups)for(var c in l.groups=[],e.selectedGroups)if(e.selectedGroups.hasOwnProperty(c))for(var u=0;u<e.groups.length;u++)if(e.groups[u].id===e.selectedGroups[c].id){e.groups[u].accessAll||l.groups.push(e.selectedGroups[c]);break}e.submitPromise=o.collections.put({orgId:t.params.orgId,id:i},l,function(e){a.eventTrack("Edited Collection");var o=r.decryptCollection(e,t.params.orgId,!0);n.close(o)}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationCollectionsUsersController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","collection","toastr",function(e,t,n,o,r,a,i,s){a.eventTrack("organizationCollectionsUsersController",{category:"Modal"}),e.loading=!0,e.collection=i,e.users=[],n.opened.then(function(){e.loading=!1,o.collections.listUsers({orgId:t.params.orgId,id:i.id},function(t){if(t&&t.Data.length){for(var n=[],o=0;o<t.Data.length;o++)n.push({organizationUserId:t.Data[o].OrganizationUserId,name:t.Data[o].Name,email:t.Data[o].Email,type:t.Data[o].Type,status:t.Data[o].Status,readOnly:t.Data[o].ReadOnly,accessAll:t.Data[o].AccessAll});e.users=n}})}),e.remove=function(n){confirm("Are you sure you want to remove this user ("+n.email+") from this collection ("+i.name+")?")&&o.collections.delUser({orgId:t.params.orgId,id:i.id,orgUserId:n.organizationUserId},null,function(){s.success(n.email+" has been removed.","User Removed"),a.eventTrack("Removed User From Collection");var t=e.users.indexOf(n);t>-1&&e.users.splice(t,1)},function(){s.error("Unable to remove user.","Error")})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationDashboardController",["$scope","authService","$state","appSettings",function(e,t,n,o){e.selfHosted=o.selfHosted,e.$on("$viewContentLoaded",function(){t.getUserProfile().then(function(t){t.organizations&&(e.orgProfile=t.organizations[n.params.orgId])})}),e.goBilling=function(){n.go("backend.org.billing",{orgId:n.params.orgId})}}]),angular.module("bit.organization").controller("organizationDeleteController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics",function(e,t,n,o,r,a,i,s){s.eventTrack("organizationDeleteController",{category:"Modal"}),e.submit=function(){e.submitPromise=r.hashPassword(e.masterPassword).then(function(e){return n.organizations.del({id:t.params.orgId},{masterPasswordHash:e}).$promise}).then(function(){return o.dismiss("cancel"),a.removeProfileOrganization(t.params.orgId),s.eventTrack("Deleted Organization"),t.go("backend.user.vault")}).then(function(){i.success("This organization and all associated data has been deleted.","Organization Deleted")})},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationEventsController",["$scope","$state","apiService","$uibModal","$filter","toastr","$analytics","constants","eventService","$compile","$sce",function(e,t,n,o,r,a,i,s,l,c,u){e.events=[],e.orgUsers=[],e.loading=!0,e.continuationToken=null;var d=l.getDefaultDateFilters();e.filterStart=d.start,e.filterEnd=d.end,e.$on("$viewContentLoaded",function(){n.organizationUsers.list({orgId:t.params.orgId}).$promise.then(function(t){var n=[];for(p=0;p<t.Data.length;p++){var o={id:t.Data[p].Id,userId:t.Data[p].UserId,name:t.Data[p].Name,email:t.Data[p].Email};n.push(o);var r=o.name||o.email;m[o.userId]=r,g[o.id]=r}return e.orgUsers=n,f(!0)})}),e.refresh=function(){f(!0)},e.next=function(){f(!1)};var p=0,m={},g={};function f(o){var r=l.formatDateFilters(e.filterStart,e.filterEnd);if(!r.error)return o&&(e.continuationToken=null,e.events=[]),e.loading=!0,n.events.listOrganization({orgId:t.params.orgId,start:r.start,end:r.end,continuationToken:e.continuationToken}).$promise.then(function(t){e.continuationToken=t.ContinuationToken;var n=[];for(p=0;p<t.Data.length;p++){var o=t.Data[p].ActingUserId||t.Data[p].UserId,r=l.getEventInfo(t.Data[p]),a=c("<span>"+r.message+"</span>")(e);n.push({message:u.trustAsHtml(a[0].outerHTML),appIcon:r.appIcon,appName:r.appName,userId:o,userName:o&&m[o]||"-",date:t.Data[p].Date,ip:t.Data[p].IpAddress})}e.events&&e.events.length>0?e.events=e.events.concat(n):e.events=n,e.loading=!1});alert(r.error)}}]),angular.module("bit.organization").controller("organizationGroupsAddController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics",function(e,t,n,o,r,a){a.eventTrack("organizationGroupsAddController",{category:"Modal"}),e.collections=[],e.selectedCollections={},e.loading=!0,n.opened.then(function(){return o.collections.listOrganization({orgId:t.params.orgId}).$promise}).then(function(n){e.collections=r.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.collections.length;o++)n[e.collections[o].id]={id:e.collections[o].id,readOnly:e.collections[o].id in e.selectedCollections&&e.selectedCollections[e.collections[o].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(r){var i={name:r.name,accessAll:!!r.accessAll,externalId:r.externalId};if(!i.accessAll)for(var s in i.collections=[],e.selectedCollections)e.selectedCollections.hasOwnProperty(s)&&i.collections.push(e.selectedCollections[s]);e.submitPromise=o.groups.post({orgId:t.params.orgId},i,function(e){a.eventTrack("Created Group"),n.close({id:e.Id,name:e.Name})}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationGroupsController",["$scope","$state","apiService","$uibModal","$filter","toastr","$analytics","$uibModalStack",function(e,t,n,o,r,a,i,s){e.groups=[],e.loading=!0,e.$on("$viewContentLoaded",function(){n.groups.listOrganization({orgId:t.params.orgId},function(n){for(var o=[],r=0;r<n.Data.length;r++)o.push({id:n.Data[r].Id,name:n.Data[r].Name});e.groups=o,e.loading=!1,t.params.search&&(s.dismissAll(),e.filterSearch=t.params.search,$("#filterSearch").focus())})}),e.$on("organizationGroupsAdd",function(t,n){e.add()}),e.add=function(){o.open({animation:!0,templateUrl:"app/organization/views/organizationGroupsAdd.html",controller:"organizationGroupsAddController"}).result.then(function(t){e.groups.push(t)})},e.edit=function(t){o.open({animation:!0,templateUrl:"app/organization/views/organizationGroupsEdit.html",controller:"organizationGroupsEditController",resolve:{id:function(){return t.id}}}).result.then(function(t){var n=r("filter")(e.groups,{id:t.id},!0);n&&n.length>0&&(n[0].name=t.name)})},e.users=function(e){o.open({animation:!0,templateUrl:"app/organization/views/organizationGroupsUsers.html",controller:"organizationGroupsUsersController",size:"lg",resolve:{group:function(){return e}}}).result.then(function(){})},e.delete=function(o){confirm("Are you sure you want to delete this group ("+o.name+")?")&&n.groups.del({orgId:t.params.orgId,id:o.id},function(){var t=e.groups.indexOf(o);t>-1&&e.groups.splice(t,1),i.eventTrack("Deleted Group"),a.success(o.name+" has been deleted.","Group Deleted")},function(){a.error(o.name+" was not able to be deleted.","Error")})}}]),angular.module("bit.organization").controller("organizationGroupsEditController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","id",function(e,t,n,o,r,a,i){a.eventTrack("organizationGroupsEditController",{category:"Modal"}),e.collections=[],e.selectedCollections={},e.loading=!0,n.opened.then(function(){return o.groups.getDetails({orgId:t.params.orgId,id:i}).$promise}).then(function(n){e.group={id:i,name:n.Name,externalId:n.ExternalId,accessAll:n.AccessAll};var r={};if(n.Collections)for(var a=0;a<n.Collections.length;a++)r[n.Collections[a].Id]={id:n.Collections[a].Id,readOnly:n.Collections[a].ReadOnly};return e.selectedCollections=r,o.collections.listOrganization({orgId:t.params.orgId}).$promise}).then(function(n){e.collections=r.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.collections.length;o++)n[e.collections[o].id]={id:e.collections[o].id,readOnly:e.collections[o].id in e.selectedCollections&&e.selectedCollections[e.collections[o].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(){var r={name:e.group.name,accessAll:!!e.group.accessAll,externalId:e.group.externalId};if(!r.accessAll)for(var s in r.collections=[],e.selectedCollections)e.selectedCollections.hasOwnProperty(s)&&r.collections.push(e.selectedCollections[s]);e.submitPromise=o.groups.put({orgId:t.params.orgId,id:i},r,function(e){a.eventTrack("Edited Group"),n.close({id:e.Id,name:e.Name})}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationGroupsUsersController",["$scope","$state","$uibModalInstance","apiService","$analytics","group","toastr",function(e,t,n,o,r,a,i){r.eventTrack("organizationGroupUsersController",{category:"Modal"}),e.loading=!0,e.group=a,e.users=[],n.opened.then(function(){return o.groups.listUsers({orgId:t.params.orgId,id:a.id}).$promise}).then(function(t){var n=[];if(t&&t.Data.length)for(var o=0;o<t.Data.length;o++)n.push({organizationUserId:t.Data[o].OrganizationUserId,name:t.Data[o].Name,email:t.Data[o].Email,type:t.Data[o].Type,status:t.Data[o].Status,accessAll:t.Data[o].AccessAll});e.users=n,e.loading=!1}),e.remove=function(n){confirm("Are you sure you want to remove this user ("+n.email+") from this group ("+a.name+")?")&&o.groups.delUser({orgId:t.params.orgId,id:a.id,orgUserId:n.organizationUserId},null,function(){i.success(n.email+" has been removed.","User Removed"),r.eventTrack("Removed User From Group");var t=e.users.indexOf(n);t>-1&&e.users.splice(t,1)},function(){i.error("Unable to remove user.","Error")})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleController",["$scope","$state","$uibModal","cryptoService","apiService","authService","toastr","$analytics","$filter","$uibModalStack",function(e,t,n,o,r,a,i,s,l,c){function u(){r.organizationUsers.list({orgId:t.params.orgId},function(n){for(var o=[],r=0;r<n.Data.length;r++){var a={id:n.Data[r].Id,userId:n.Data[r].UserId,name:n.Data[r].Name,email:n.Data[r].Email,status:n.Data[r].Status,type:n.Data[r].Type,accessAll:n.Data[r].AccessAll};o.push(a)}if(e.users=o,t.params.search&&(c.dismissAll(),e.filterSearch=t.params.search,$("#filterSearch").focus()),t.params.viewEvents){c.dismissAll();var i=l("filter")(e.users,{id:t.params.viewEvents});i&&i.length&&e.events(i[0])}})}e.users=[],e.useGroups=!1,e.useEvents=!1,e.$on("$viewContentLoaded",function(){u(),a.getUserProfile().then(function(n){if(n.organizations){var o=n.organizations[t.params.orgId];e.useGroups=!!o.useGroups,e.useEvents=!!o.useEvents}})}),e.reinvite=function(e){r.organizationUsers.reinvite({orgId:t.params.orgId,id:e.id},null,function(){s.eventTrack("Reinvited User"),i.success(e.email+" has been invited again.","User Invited")},function(){i.error("Unable to invite user.","Error")})},e.delete=function(n){confirm("Are you sure you want to remove this user ("+n.email+")?")&&r.organizationUsers.del({orgId:t.params.orgId,id:n.id},null,function(){s.eventTrack("Deleted User"),i.success(n.email+" has been removed.","User Removed");var t=e.users.indexOf(n);t>-1&&e.users.splice(t,1)},function(){i.error("Unable to remove user.","Error")})},e.confirm=function(e){r.users.getPublicKey({id:e.userId},function(n){var a=o.getOrgKey(t.params.orgId);if(a){var l=o.rsaEncrypt(a.key,n.PublicKey);r.organizationUsers.confirm({orgId:t.params.orgId,id:e.id},{key:l},function(){e.status=2,s.eventTrack("Confirmed User"),i.success(e.email+" has been confirmed.","User Confirmed")},function(){i.error("Unable to confirm user.","Error")})}else i.error("Unable to confirm user.","Error")},function(){i.error("Unable to confirm user.","Error")})},e.$on("organizationPeopleInvite",function(t,n){e.invite()}),e.invite=function(){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleInvite.html",controller:"organizationPeopleInviteController"}).result.then(function(){u()})},e.edit=function(e){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleEdit.html",controller:"organizationPeopleEditController",resolve:{orgUser:function(){return e}}}).result.then(function(){u()})},e.groups=function(e){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleGroups.html",controller:"organizationPeopleGroupsController",resolve:{orgUser:function(){return e}}}).result.then(function(){})},e.events=function(e){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleEvents.html",controller:"organizationPeopleEventsController",resolve:{orgUser:function(){return e},orgId:function(){return t.params.orgId}}})}}]),angular.module("bit.organization").controller("organizationPeopleEditController",["$scope","$state","$uibModalInstance","apiService","cipherService","orgUser","$analytics",function(e,t,n,o,r,a,i){i.eventTrack("organizationPeopleEditController",{category:"Modal"}),e.loading=!0,e.collections=[],e.selectedCollections={},n.opened.then(function(){o.collections.listOrganization({orgId:t.params.orgId},function(n){e.collections=r.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1}),o.organizationUsers.get({orgId:t.params.orgId,id:a.id},function(t){var n={};if(t&&t.Collections)for(var o=0;o<t.Collections.length;o++)n[t.Collections[o].Id]={id:t.Collections[o].Id,readOnly:t.Collections[o].ReadOnly};e.email=a.email,e.type=t.Type,e.accessAll=t.AccessAll,e.selectedCollections=n})}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.collections.length;o++)n[e.collections[o].id]={id:e.collections[o].id,readOnly:e.collections[o].id in e.selectedCollections&&e.selectedCollections[e.collections[o].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submitPromise=null,e.submit=function(r){var s=[];if(!e.accessAll)for(var l in e.selectedCollections)e.selectedCollections.hasOwnProperty(l)&&s.push(e.selectedCollections[l]);e.submitPromise=o.organizationUsers.put({orgId:t.params.orgId,id:a.id},{type:e.type,collections:s,accessAll:e.accessAll},function(){i.eventTrack("Edited User"),n.close()}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleEventsController",["$scope","apiService","$uibModalInstance","orgUser","$analytics","eventService","orgId","$compile","$sce",function(e,t,n,o,r,a,i,s,l){r.eventTrack("organizationPeopleEventsController",{category:"Modal"}),e.email=o.email,e.events=[],e.loading=!0,e.continuationToken=null;var c=a.getDefaultDateFilters();function u(n){var r=a.formatDateFilters(e.filterStart,e.filterEnd);if(!r.error)return n&&(e.continuationToken=null,e.events=[]),e.loading=!0,t.events.listOrganizationUser({orgId:i,id:o.id,start:r.start,end:r.end,continuationToken:e.continuationToken}).$promise.then(function(t){e.continuationToken=t.ContinuationToken;for(var n=[],o=0;o<t.Data.length;o++){var r=a.getEventInfo(t.Data[o]),i=s("<span>"+r.message+"</span>")(e);n.push({message:l.trustAsHtml(i[0].outerHTML),appIcon:r.appIcon,appName:r.appName,date:t.Data[o].Date,ip:t.Data[o].IpAddress})}e.events&&e.events.length>0?e.events=e.events.concat(n):e.events=n,e.loading=!1});alert(r.error)}e.filterStart=c.start,e.filterEnd=c.end,n.opened.then(function(){u(!0)}),e.refresh=function(){u(!0)},e.next=function(){u(!1)},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleGroupsController",["$scope","$state","$uibModalInstance","apiService","orgUser","$analytics",function(e,t,n,o,r,a){a.eventTrack("organizationPeopleGroupsController",{category:"Modal"}),e.loading=!0,e.groups=[],e.selectedGroups={},e.orgUser=r,n.opened.then(function(){return o.groups.listOrganization({orgId:t.params.orgId}).$promise}).then(function(n){for(var a=[],i=0;i<n.Data.length;i++)a.push({id:n.Data[i].Id,name:n.Data[i].Name});return e.groups=a,o.organizationUsers.listGroups({orgId:t.params.orgId,id:r.id}).$promise}).then(function(t){var n={};if(t)for(var o=0;o<t.length;o++)n[t[o]]=!0;e.selectedGroups=n,e.loading=!1}),e.toggleGroupSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.groups.length;o++)n[e.groups[o].id]=!0;e.selectedGroups=n},e.toggleGroupSelection=function(t){t in e.selectedGroups?delete e.selectedGroups[t]:e.selectedGroups[t]=!0},e.groupSelected=function(t){return t.id in e.selectedGroups},e.allSelected=function(){return Object.keys(e.selectedGroups).length===e.groups.length},e.submitPromise=null,e.submit=function(i){var s=[];for(var l in e.selectedGroups)e.selectedGroups.hasOwnProperty(l)&&s.push(l);e.submitPromise=o.organizationUsers.putGroups({orgId:t.params.orgId,id:r.id},{groupIds:s},function(){a.eventTrack("Edited User Groups"),n.close()}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleInviteController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics",function(e,t,n,o,r,a){a.eventTrack("organizationPeopleInviteController",{category:"Modal"}),e.loading=!0,e.collections=[],e.selectedCollections={},e.model={type:"User"},n.opened.then(function(){o.collections.listOrganization({orgId:t.params.orgId},function(n){e.collections=r.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1})}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.collections.length;o++)n[e.collections[o].id]={id:e.collections[o].id,readOnly:e.collections[o].id in e.selectedCollections&&e.selectedCollections[e.collections[o].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submitPromise=null,e.submit=function(r){var i=[];if(!r.accessAll)for(var s in e.selectedCollections)e.selectedCollections.hasOwnProperty(s)&&i.push(e.selectedCollections[s]);var l=r.emails.trim().split(/\s*,\s*/);e.submitPromise=o.organizationUsers.invite({orgId:t.params.orgId},{emails:l,type:r.type,collections:i,accessAll:r.accessAll},function(){a.eventTrack("Invited User"),n.close()}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationSettingsController",["$scope","$state","apiService","toastr","authService","$uibModal","$analytics","appSettings",function(e,t,n,o,r,a,i,s){e.selfHosted=s.selfHosted,e.model={},e.$on("$viewContentLoaded",function(){n.organizations.get({id:t.params.orgId},function(t){e.model={name:t.Name,billingEmail:t.BillingEmail,businessName:t.BusinessName,businessAddress1:t.BusinessAddress1,businessAddress2:t.BusinessAddress2,businessAddress3:t.BusinessAddress3,businessCountry:t.BusinessCountry,businessTaxNumber:t.BusinessTaxNumber}})}),e.generalSave=function(){e.selfHosted||(e.generalPromise=n.organizations.put({id:t.params.orgId},e.model,function(e){r.updateProfileOrganization(e).then(function(e){i.eventTrack("Updated Organization Settings"),o.success("Organization has been updated.","Success!")})}).$promise)},e.import=function(){a.open({animation:!0,templateUrl:"app/tools/views/toolsImport.html",controller:"organizationSettingsImportController"})},e.export=function(){a.open({animation:!0,templateUrl:"app/tools/views/toolsExport.html",controller:"organizationSettingsExportController"})},e.delete=function(){a.open({animation:!0,templateUrl:"app/organization/views/organizationDelete.html",controller:"organizationDeleteController"})}}]),angular.module("bit.organization").controller("organizationSettingsExportController",["$scope","apiService","$uibModalInstance","cipherService","$q","toastr","$analytics","$state","constants",function(e,t,n,o,r,a,i,s,l){function c(){var e=new Date;return"bitwarden_org_export_"+(e.getFullYear()+""+u(e.getMonth()+1,2)+u(e.getDate(),2)+u(e.getHours(),2)+u(e.getMinutes(),2)+u(e.getSeconds(),2))+".csv"}function u(e,t,n){return n=n||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(n)+e}i.eventTrack("organizationSettingsExportController",{category:"Modal"}),e.export=function(n){e.startedExport=!0;var u=[],d=[],p=t.collections.listOrganization({orgId:s.params.orgId},function(e){d=o.decryptCollections(e.Data,s.params.orgId,!0)}).$promise,m=t.ciphers.listOrganizationDetails({organizationId:s.params.orgId},function(e){u=o.decryptCiphers(e.Data)}).$promise;r.all([p,m]).then(function(){if(!u.length)return a.error("Nothing to export.","Error!"),void e.close();for(var t={},n=0;n<d.length;n++)t[d[n].id]=d[n];try{var o=[];for(n=0;n<u.length;n++)if(u[n].type===l.cipherType.login||u[n].type===l.cipherType.secureNote){var r,s={collections:[],type:null,name:u[n].name,notes:u[n].notes,fields:null,login_uri:null,login_username:null,login_password:null,login_totp:null};if(u[n].collectionIds)for(r=0;r<u[n].collectionIds.length;r++)t.hasOwnProperty(u[n].collectionIds[r])&&s.collections.push(t[u[n].collectionIds[r]].name);if(u[n].fields)for(r=0;r<u[n].fields.length;r++)s.fields?s.fields+="\n":s.fields="",s.fields+=(u[n].fields[r].name||"")+": "+u[n].fields[r].value;switch(u[n].type){case l.cipherType.login:s.type="login",s.login_uri=u[n].login.uri,s.login_username=u[n].login.username,s.login_password=u[n].login.password,s.login_totp=u[n].login.totp;break;case l.cipherType.secureNote:s.type="note";break;default:continue}o.push(s)}var p=Papa.unparse(o),m=new Blob([p]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(m,c());else{var g=window.document.createElement("a");g.href=window.URL.createObjectURL(m,{type:"text/plain"}),g.download=c(),document.body.appendChild(g),g.click(),document.body.removeChild(g)}i.eventTrack("Exported Organization Data"),a.success("Your data has been exported. Check your browser's downloads folder.","Success!"),e.close()}catch(t){a.error("Something went wrong. Please try again.","Error!"),e.close()}},function(){a.error("Something went wrong. Please try again.","Error!"),e.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationSettingsImportController",["$scope","$state","apiService","$uibModalInstance","cipherService","toastr","importService","$analytics","$sce","validationService","cryptoService",function(e,t,n,o,r,a,i,s,l,c,u){function d(i,l,c){if(i.length||l.length){if(l.length){var d=Math.floor(l.length/2),g=l.length-1;if(p(l[0])&&p(l[d])&&p(l[g]))return void m("Data is not formatted correctly. Please check your import file and try again.")}n.ciphers.importOrg({orgId:t.params.orgId},{collections:r.encryptCollections(i,t.params.orgId),ciphers:r.encryptCiphers(l,u.getOrgKey(t.params.orgId)),collectionRelationships:c},function(){o.dismiss("cancel"),t.go("backend.org.vault",{orgId:t.params.orgId}).then(function(){s.eventTrack("Imported Org Data",{label:e.model.source}),a.success("Data has been successfully imported into your vault.","Import Success")})},m)}else m("Nothing was imported.")}function p(e){return(null===e.name||"--"===e.name)&&e.login&&(null===e.login.password||""===e.login.password)}function m(t){if(s.eventTrack("Import Org Data Failed",{label:e.model.source}),o.dismiss("cancel"),t){var n=t.data;if(!n||!n.ValidationErrors)return n&&n.Message?void a.error(n.Message):void a.error(t);var r="";for(var i in n.ValidationErrors)if(n.ValidationErrors.hasOwnProperty(i))for(var l=0;l<n.ValidationErrors[i].length;l++)r+=i+": "+n.ValidationErrors[i][l]+" ";if(""!==r)return void a.error(r)}a.error("Something went wrong. Try again.","Oh No!")}s.eventTrack("organizationSettingsImportController",{category:"Modal"}),e.model={source:""},e.source={},e.splitFeatured=!1,e.options=[{id:"bitwardencsv",name:"bitwarden (csv)",featured:!0,sort:1,instructions:l.trustAsHtml('Export using the web vault (vault.bitwarden.com). Log into the web vault and navigate to your organization\'s admin area. Then to go "Settings" > "Tools" > "Export".')},{id:"lastpass",name:"LastPass (csv)",featured:!0,sort:2,instructions:l.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-lastpass/">https://help.bitwarden.com/article/import-from-lastpass/</a>')}],e.setSource=function(){for(var t=0;t<e.options.length;t++)if(e.options[t].id===e.model.source){e.source=e.options[t];break}},e.setSource(),e.import=function(t,n){if(t.source&&""!==t.source){var o=document.getElementById("file").files[0];o||t.fileContents&&""!==t.fileContents?(e.processing=!0,i.importOrg(t.source,o||t.fileContents,d,m)):c.addError(n,"file","Select the import file or copy/paste the import file contents.",!0)}else c.addError(n,"source","Select the format of the import file.",!0)},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationVaultAddCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","$analytics","authService","orgId","$uibModal","constants",function(e,t,n,o,r,a,i,s,l,c,u){function d(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}i.eventTrack("organizationVaultAddCipherController",{category:"Modal"}),e.constants=u,e.selectedType=u.cipherType.login.toString(),e.cipher={type:u.cipherType.login,login:{},identity:{},card:{},secureNote:{type:"0"}},e.hideFolders=e.hideFavorite=e.fromOrg=!0,s.getUserProfile().then(function(t){var n=t.organizations[l];e.useTotp=n.useTotp}),e.typeChanged=function(){e.cipher.type=parseInt(e.selectedType)},e.savePromise=null,e.save=function(){e.cipher.organizationId=l;var o=r.encryptCipher(e.cipher);e.savePromise=t.ciphers.postAdmin(o,function(e){i.eventTrack("Created Organization Cipher");var t=r.decryptCipherPreview(e);n.close(t)}).$promise},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(i.eventTrack("Generated Password From Add"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addField=function(){e.cipher.fields||(e.cipher.fields=[]),e.cipher.fields.push({type:u.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.clipboardSuccess=function(e){e.clearSelection(),d(e)},e.clipboardError=function(e,t){t&&d(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.close=function(){n.dismiss("close")},e.showUpgrade=function(){c.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return l}}})}}]),angular.module("bit.organization").controller("organizationVaultAttachmentsController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","cipherId","$analytics","validationService","toastr","$timeout",function(e,t,n,o,r,a,i,s,l,c){i.eventTrack("organizationVaultAttachmentsController",{category:"Modal"}),e.cipher={},e.loading=!0,e.isPremium=!0,e.canUseAttachments=!0;var u=!1;t.ciphers.getAdmin({id:a},function(t){e.cipher=r.decryptCipher(t),e.loading=!1},function(){e.loading=!1}),e.save=function(c){var d=document.getElementById("file").files;if(d&&d.length){var p=o.getOrgKey(e.cipher.organizationId);e.savePromise=r.encryptAttachmentFile(p,d[0]).then(function(e){var n=new FormData,o=new Blob([e.data],{type:"application/octet-stream"});return n.append("data",o,e.fileName),t.ciphers.postAttachment({id:a},n).$promise}).then(function(e){i.eventTrack("Added Attachment"),l.success("The attachment has been added."),u=!0,n.close(!0)},function(e){var t=s.parseErrors(e);l.error(t.length?t[0]:"An error occurred.")})}else s.addError(c,"file","Select a file.",!0)},e.download=function(t){t.loading=!0;var n=o.getOrgKey(e.cipher.organizationId);r.downloadAndDecryptAttachment(n,t,!0).then(function(e){c(function(){t.loading=!1})},function(){c(function(){t.loading=!1})})},e.remove=function(n){confirm("Are you sure you want to delete this attachment ("+n.fileName+")?")&&(n.loading=!0,t.ciphers.delAttachment({id:a,attachmentId:n.id}).$promise.then(function(){n.loading=!1,i.eventTrack("Deleted Organization Attachment");var t=e.cipher.attachments.indexOf(n);t>-1&&e.cipher.attachments.splice(t,1)},function(){l.error("Cannot delete attachment."),n.loading=!1}))},e.close=function(){n.dismiss("cancel")},e.$on("modal.closing",function(t,o,r){u||(t.preventDefault(),u=!0,n.close(!!e.cipher.attachments&&e.cipher.attachments.length>0))})}]),angular.module("bit.organization").controller("organizationVaultCipherCollectionsController",["$scope","apiService","$uibModalInstance","cipherService","cipher","$analytics","collections",function(e,t,n,o,r,a,i){a.eventTrack("organizationVaultCipherCollectionsController",{category:"Modal"}),e.cipher={},e.collections=[],e.selectedCollections={},n.opened.then(function(){for(var t=[],n=0;n<i.length;n++)i[n].id&&t.push(i[n]);e.collections=t,e.cipher=r;var o={};if(e.cipher.collectionIds)for(n=0;n<e.cipher.collectionIds.length;n++)o[e.cipher.collectionIds[n]]=!0;e.selectedCollections=o}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.collections.length;o++)n[e.collections[o].id]=!0;e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]=!0},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(){var o={collectionIds:[]};for(var i in e.selectedCollections)e.selectedCollections.hasOwnProperty(i)&&o.collectionIds.push(i);e.submitPromise=t.ciphers.putCollectionsAdmin({id:r.id},o).$promise.then(function(e){a.eventTrack("Edited Cipher Collections"),n.close({action:"collectionsEdit",collectionIds:o.collectionIds})})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationVaultCipherEventsController",["$scope","apiService","$uibModalInstance","cipher","$analytics","eventService",function(e,t,n,o,r,a){r.eventTrack("organizationVaultCipherEventsController",{category:"Modal"}),e.cipher=o,e.events=[],e.loading=!0,e.continuationToken=null;var i=a.getDefaultDateFilters();e.filterStart=i.start,e.filterEnd=i.end,n.opened.then(function(){t.organizationUsers.list({orgId:o.organizationId}).$promise.then(function(t){var n=[];for(s=0;s<t.Data.length;s++){var o={id:t.Data[s].Id,userId:t.Data[s].UserId,name:t.Data[s].Name,email:t.Data[s].Email};n.push(o);var r=o.name||o.email;l[o.userId]=r,c[o.id]=r}return e.orgUsers=n,u(!0)})}),e.refresh=function(){u(!0)},e.next=function(){u(!1)};var s=0,l={},c={};function u(n){var r=a.formatDateFilters(e.filterStart,e.filterEnd);if(!r.error)return n&&(e.continuationToken=null,e.events=[]),e.loading=!0,t.events.listCipher({id:o.id,start:r.start,end:r.end,continuationToken:e.continuationToken}).$promise.then(function(t){e.continuationToken=t.ContinuationToken;var n=[];for(s=0;s<t.Data.length;s++){var o=t.Data[s].ActingUserId||t.Data[s].UserId,r=a.getEventInfo(t.Data[s],{cipherInfo:!1});n.push({message:r.message,appIcon:r.appIcon,appName:r.appName,userId:o,userName:o&&l[o]||"-",date:t.Data[s].Date,ip:t.Data[s].IpAddress})}e.events&&e.events.length>0?e.events=e.events.concat(n):e.events=n,e.loading=!1});alert(r.error)}e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationVaultController",["$scope","apiService","cipherService","$analytics","$q","$state","$localStorage","$uibModal","$filter","authService","$uibModalStack",function(e,t,n,o,r,a,i,s,l,c,u){e.ciphers=[],e.collections=[],e.loading=!0,e.useEvents=!1,e.$on("$viewContentLoaded",function(){c.getUserProfile().then(function(t){if(t.organizations){var n=t.organizations[a.params.orgId];e.useEvents=!!n.useEvents}});var o=t.collections.listOrganization({orgId:a.params.orgId},function(t){for(var o=([{id:null,name:"Unassigned",collapsed:i.collapsedOrgCollections&&"unassigned"in i.collapsedOrgCollections}]),r=0;r<t.Data.length;r++){var a=n.decryptCollection(t.Data[r],null,!0);a.collapsed=i.collapsedOrgCollections&&a.id in i.collapsedOrgCollections,o.push(a)}e.collections=o}).$promise,s=t.ciphers.listOrganizationDetails({organizationId:a.params.orgId},function(t){for(var o=[],r=0;r<t.Data.length;r++){var a=n.decryptCipherPreview(t.Data[r]);o.push(a)}e.ciphers=o}).$promise;r.all([o,s]).then(function(){if(e.loading=!1,$("#search").focus(),a.params.search&&(u.dismissAll(),e.$emit("setSearchVaultText",a.params.search)),a.params.viewEvents){u.dismissAll();var t=l("filter")(e.ciphers,{id:a.params.viewEvents});t&&t.length&&e.viewEvents(t[0])}})}),e.filterByCollection=function(e){return function(t){return t.collectionIds&&t.collectionIds.length?t.collectionIds.indexOf(e.id)>-1:null===e.id}},e.collectionSort=function(e){return e.id?e.name.toLowerCase():""},e.collapseExpand=function(e){i.collapsedOrgCollections||(i.collapsedOrgCollections={});var t=e.id||"unassigned";t in i.collapsedOrgCollections?delete i.collapsedOrgCollections[t]:i.collapsedOrgCollections[t]=!0},e.editCipher=function(t){s.open({animation:!0,templateUrl:"app/vault/views/vaultEditCipher.html",controller:"organizationVaultEditCipherController",resolve:{cipherId:function(){return t.id},orgId:function(){return a.params.orgId}}}).result.then(function(n){var o;"edit"===n.action?(o=e.ciphers.indexOf(t))>-1&&(n.data.collectionIds=e.ciphers[o].collectionIds,e.ciphers[o]=n.data):"delete"===n.action&&(o=e.ciphers.indexOf(t))>-1&&e.ciphers.splice(o,1)})},e.$on("organizationVaultAddCipher",function(t,n){e.addCipher()}),e.addCipher=function(){s.open({animation:!0,templateUrl:"app/vault/views/vaultAddCipher.html",controller:"organizationVaultAddCipherController",resolve:{orgId:function(){return a.params.orgId}}}).result.then(function(t){e.ciphers.push(t)})},e.editCollections=function(t){s.open({animation:!0,templateUrl:"app/organization/views/organizationVaultCipherCollections.html",controller:"organizationVaultCipherCollectionsController",resolve:{cipher:function(){return t},collections:function(){return e.collections}}}).result.then(function(e){e.collectionIds&&(t.collectionIds=e.collectionIds)})},e.viewEvents=function(e){s.open({animation:!0,templateUrl:"app/organization/views/organizationVaultCipherEvents.html",controller:"organizationVaultCipherEventsController",resolve:{cipher:function(){return e}}})},e.attachments=function(e){c.getUserProfile().then(function(t){return!!t.organizations[e.organizationId].maxStorageGb}).then(function(t){t?s.open({animation:!0,templateUrl:"app/vault/views/vaultAttachments.html",controller:"organizationVaultAttachmentsController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){e.hasAttachments=t}):s.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return e.organizationId}}})})},e.removeCipher=function(e,n){if(confirm("Are you sure you want to remove this item ("+e.name+") from the collection ("+n.name+") ?")){for(var r={collectionIds:[]},a=0;a<e.collectionIds.length;a++)e.collectionIds[a]!==n.id&&r.collectionIds.push(e.collectionIds[a]);t.ciphers.putCollections({id:e.id},r).$promise.then(function(t){o.eventTrack("Removed Cipher From Collection"),e.collectionIds=r.collectionIds})}},e.deleteCipher=function(n){confirm("Are you sure you want to delete this item ("+n.name+")?")&&t.ciphers.delAdmin({id:n.id},function(){o.eventTrack("Deleted Cipher");var t=e.ciphers.indexOf(n);t>-1&&e.ciphers.splice(t,1)})}}]),angular.module("bit.organization").controller("organizationVaultEditCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","cipherId","$analytics","orgId","$uibModal","constants",function(e,t,n,o,r,a,i,s,l,c,u){function d(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}s.eventTrack("organizationVaultEditCipherController",{category:"Modal"}),e.cipher={},e.hideFolders=e.hideFavorite=e.fromOrg=!0,e.constants=u,t.ciphers.getAdmin({id:i},function(t){e.cipher=r.decryptCipher(t),e.useTotp=e.cipher.organizationUseTotp}),e.save=function(o){var a=r.encryptCipher(o,e.cipher.type);e.savePromise=t.ciphers.putAdmin({id:i},a,function(e){s.eventTrack("Edited Organization Cipher");var t=r.decryptCipherPreview(e);n.close({action:"edit",data:t})}).$promise},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(s.eventTrack("Generated Password From Edit"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addField=function(){e.cipher.login.fields||(e.cipher.login.fields=[]),e.cipher.fields.push({type:u.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.clipboardSuccess=function(e){e.clearSelection(),d(e)},e.clipboardError=function(e,t){t&&d(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.delete=function(){confirm("Are you sure you want to delete this item ("+e.cipher.name+")?")&&t.ciphers.delAdmin({id:e.cipher.id},function(){s.eventTrack("Deleted Organization Cipher From Edit"),n.close({action:"delete",data:e.cipher.id})})},e.close=function(){n.dismiss("cancel")},e.showUpgrade=function(){c.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return l}}})}}]),angular.module("bit.services").factory("apiService",["$resource","tokenService","appSettings","$httpParamSerializer","utilsService",function(e,t,n,o,r){var a={},i=n.apiUri,s=n.identityUri;return a.folders=e(i+"/folders/:id",{},{get:{method:"GET",params:{id:"@id"}},list:{method:"GET",params:{}},post:{method:"POST",params:{}},put:{method:"POST",params:{id:"@id"}},del:{url:i+"/folders/:id/delete",method:"POST",params:{id:"@id"}}}),a.ciphers=e(i+"/ciphers/:id",{},{get:{method:"GET",params:{id:"@id"}},getAdmin:{url:i+"/ciphers/:id/admin",method:"GET",params:{id:"@id"}},getDetails:{url:i+"/ciphers/:id/details",method:"GET",params:{id:"@id"}},list:{method:"GET",params:{}},listDetails:{url:i+"/ciphers/details",method:"GET",params:{}},listOrganizationDetails:{url:i+"/ciphers/organization-details",method:"GET",params:{}},post:{method:"POST",params:{}},postAdmin:{url:i+"/ciphers/admin",method:"POST",params:{}},put:{method:"POST",params:{id:"@id"}},putAdmin:{url:i+"/ciphers/:id/admin",method:"POST",params:{id:"@id"}},import:{url:i+"/ciphers/import",method:"POST",params:{}},importOrg:{url:i+"/ciphers/import-organization?organizationId=:orgId",method:"POST",params:{orgId:"@orgId"}},putPartial:{url:i+"/ciphers/:id/partial",method:"POST",params:{id:"@id"}},putShare:{url:i+"/ciphers/:id/share",method:"POST",params:{id:"@id"}},putCollections:{url:i+"/ciphers/:id/collections",method:"POST",params:{id:"@id"}},putCollectionsAdmin:{url:i+"/ciphers/:id/collections-admin",method:"POST",params:{id:"@id"}},del:{url:i+"/ciphers/:id/delete",method:"POST",params:{id:"@id"}},delAdmin:{url:i+"/ciphers/:id/delete-admin",method:"POST",params:{id:"@id"}},delMany:{url:i+"/ciphers/delete",method:"POST"},moveMany:{url:i+"/ciphers/move",method:"POST"},purge:{url:i+"/ciphers/purge",method:"POST"},postAttachment:{url:i+"/ciphers/:id/attachment",method:"POST",headers:{"Content-Type":void 0},params:{id:"@id"}},postShareAttachment:{url:i+"/ciphers/:id/attachment/:attachmentId/share?organizationId=:orgId",method:"POST",headers:{"Content-Type":void 0},params:{id:"@id",attachmentId:"@attachmentId",orgId:"@orgId"}},delAttachment:{url:i+"/ciphers/:id/attachment/:attachmentId/delete",method:"POST",params:{id:"@id",attachmentId:"@attachmentId"}}}),a.organizations=e(i+"/organizations/:id",{},{get:{method:"GET",params:{id:"@id"}},getBilling:{url:i+"/organizations/:id/billing",method:"GET",params:{id:"@id"}},getLicense:{url:i+"/organizations/:id/license",method:"GET",params:{id:"@id"}},list:{method:"GET",params:{}},post:{method:"POST",params:{}},put:{method:"POST",params:{id:"@id"}},putPayment:{url:i+"/organizations/:id/payment",method:"POST",params:{id:"@id"}},putSeat:{url:i+"/organizations/:id/seat",method:"POST",params:{id:"@id"}},putStorage:{url:i+"/organizations/:id/storage",method:"POST",params:{id:"@id"}},putUpgrade:{url:i+"/organizations/:id/upgrade",method:"POST",params:{id:"@id"}},putCancel:{url:i+"/organizations/:id/cancel",method:"POST",params:{id:"@id"}},putReinstate:{url:i+"/organizations/:id/reinstate",method:"POST",params:{id:"@id"}},postLeave:{url:i+"/organizations/:id/leave",method:"POST",params:{id:"@id"}},postVerifyBank:{url:i+"/organizations/:id/verify-bank",method:"POST",params:{id:"@id"}},del:{url:i+"/organizations/:id/delete",method:"POST",params:{id:"@id"}},postLicense:{url:i+"/organizations/license",method:"POST",headers:{"Content-Type":void 0}},putLicense:{url:i+"/organizations/:id/license",method:"POST",headers:{"Content-Type":void 0}}}),a.organizationUsers=e(i+"/organizations/:orgId/users/:id",{},{get:{method:"GET",params:{id:"@id",orgId:"@orgId"}},list:{method:"GET",params:{orgId:"@orgId"}},listGroups:{url:i+"/organizations/:orgId/users/:id/groups",method:"GET",params:{id:"@id",orgId:"@orgId"},isArray:!0},invite:{url:i+"/organizations/:orgId/users/invite",method:"POST",params:{orgId:"@orgId"}},reinvite:{url:i+"/organizations/:orgId/users/:id/reinvite",method:"POST",params:{id:"@id",orgId:"@orgId"}},accept:{url:i+"/organizations/:orgId/users/:id/accept",method:"POST",params:{id:"@id",orgId:"@orgId"}},confirm:{url:i+"/organizations/:orgId/users/:id/confirm",method:"POST",params:{id:"@id",orgId:"@orgId"}},put:{method:"POST",params:{id:"@id",orgId:"@orgId"}},putGroups:{url:i+"/organizations/:orgId/users/:id/groups",method:"POST",params:{id:"@id",orgId:"@orgId"}},del:{url:i+"/organizations/:orgId/users/:id/delete",method:"POST",params:{id:"@id",orgId:"@orgId"}}}),a.collections=e(i+"/organizations/:orgId/collections/:id",{},{get:{method:"GET",params:{id:"@id",orgId:"@orgId"}},getDetails:{url:i+"/organizations/:orgId/collections/:id/details",method:"GET",params:{id:"@id",orgId:"@orgId"}},listMe:{url:i+"/collections?writeOnly=:writeOnly",method:"GET",params:{writeOnly:"@writeOnly"}},listOrganization:{method:"GET",params:{orgId:"@orgId"}},listUsers:{url:i+"/organizations/:orgId/collections/:id/users",method:"GET",params:{id:"@id",orgId:"@orgId"}},post:{method:"POST",params:{orgId:"@orgId"}},put:{method:"POST",params:{id:"@id",orgId:"@orgId"}},del:{url:i+"/organizations/:orgId/collections/:id/delete",method:"POST",params:{id:"@id",orgId:"@orgId"}},delUser:{url:i+"/organizations/:orgId/collections/:id/delete-user/:orgUserId",method:"POST",params:{id:"@id",orgId:"@orgId",orgUserId:"@orgUserId"}}}),a.groups=e(i+"/organizations/:orgId/groups/:id",{},{get:{method:"GET",params:{id:"@id",orgId:"@orgId"}},getDetails:{url:i+"/organizations/:orgId/groups/:id/details",method:"GET",params:{id:"@id",orgId:"@orgId"}},listOrganization:{method:"GET",params:{orgId:"@orgId"}},listUsers:{url:i+"/organizations/:orgId/groups/:id/users",method:"GET",params:{id:"@id",orgId:"@orgId"}},post:{method:"POST",params:{orgId:"@orgId"}},put:{method:"POST",params:{id:"@id",orgId:"@orgId"}},del:{url:i+"/organizations/:orgId/groups/:id/delete",method:"POST",params:{id:"@id",orgId:"@orgId"}},delUser:{url:i+"/organizations/:orgId/groups/:id/delete-user/:orgUserId",method:"POST",params:{id:"@id",orgId:"@orgId",orgUserId:"@orgUserId"}}}),a.accounts=e(i+"/accounts",{},{register:{url:i+"/accounts/register",method:"POST",params:{}},emailToken:{url:i+"/accounts/email-token",method:"POST",params:{}},email:{url:i+"/accounts/email",method:"POST",params:{}},verifyEmailToken:{url:i+"/accounts/verify-email-token",method:"POST",params:{}},verifyEmail:{url:i+"/accounts/verify-email",method:"POST",params:{}},postDeleteRecoverToken:{url:i+"/accounts/delete-recover-token",method:"POST",params:{}},postDeleteRecover:{url:i+"/accounts/delete-recover",method:"POST",params:{}},putPassword:{url:i+"/accounts/password",method:"POST",params:{}},getProfile:{url:i+"/accounts/profile",method:"GET",params:{}},putProfile:{url:i+"/accounts/profile",method:"POST",params:{}},getDomains:{url:i+"/accounts/domains",method:"GET",params:{}},putDomains:{url:i+"/accounts/domains",method:"POST",params:{}},postPasswordHint:{url:i+"/accounts/password-hint",method:"POST",params:{}},putSecurityStamp:{url:i+"/accounts/security-stamp",method:"POST",params:{}},putKeys:{url:i+"/accounts/keys",method:"POST",params:{}},putKey:{url:i+"/accounts/key",method:"POST",params:{}},import:{url:i+"/accounts/import",method:"POST",params:{}},postDelete:{url:i+"/accounts/delete",method:"POST",params:{}},putStorage:{url:i+"/accounts/storage",method:"POST",params:{}},putPayment:{url:i+"/accounts/payment",method:"POST",params:{}},putCancelPremium:{url:i+"/accounts/cancel-premium",method:"POST",params:{}},putReinstatePremium:{url:i+"/accounts/reinstate-premium",method:"POST",params:{}},getBilling:{url:i+"/accounts/billing",method:"GET",params:{}},postPremium:{url:i+"/accounts/premium",method:"POST",headers:{"Content-Type":void 0}},putLicense:{url:i+"/accounts/license",method:"POST",headers:{"Content-Type":void 0}}}),a.twoFactor=e(i+"/two-factor",{},{list:{method:"GET",params:{}},getEmail:{url:i+"/two-factor/get-email",method:"POST",params:{}},getU2f:{url:i+"/two-factor/get-u2f",method:"POST",params:{}},getDuo:{url:i+"/two-factor/get-duo",method:"POST",params:{}},getAuthenticator:{url:i+"/two-factor/get-authenticator",method:"POST",params:{}},getYubi:{url:i+"/two-factor/get-yubikey",method:"POST",params:{}},sendEmail:{url:i+"/two-factor/send-email",method:"POST",params:{}},sendEmailLogin:{url:i+"/two-factor/send-email-login",method:"POST",params:{}},putEmail:{url:i+"/two-factor/email",method:"POST",params:{}},putU2f:{url:i+"/two-factor/u2f",method:"POST",params:{}},putAuthenticator:{url:i+"/two-factor/authenticator",method:"POST",params:{}},putDuo:{url:i+"/two-factor/duo",method:"POST",params:{}},putYubi:{url:i+"/two-factor/yubikey",method:"POST",params:{}},disable:{url:i+"/two-factor/disable",method:"POST",params:{}},recover:{url:i+"/two-factor/recover",method:"POST",params:{}},getRecover:{url:i+"/two-factor/get-recover",method:"POST",params:{}}}),a.settings=e(i+"/settings",{},{getDomains:{url:i+"/settings/domains",method:"GET",params:{}},putDomains:{url:i+"/settings/domains",method:"POST",params:{}}}),a.users=e(i+"/users/:id",{},{getPublicKey:{url:i+"/users/:id/public-key",method:"GET",params:{id:"@id"}}}),a.events=e(i+"/events",{},{list:{method:"GET",params:{}},listOrganization:{url:i+"/organizations/:orgId/events",method:"GET",params:{id:"@orgId"}},listCipher:{url:i+"/ciphers/:id/events",method:"GET",params:{id:"@id"}},listOrganizationUser:{url:i+"/organizations/:orgId/users/:id/events",method:"GET",params:{orgId:"@orgId",id:"@id"}}}),a.identity=e(s+"/connect",{},{token:{url:s+"/connect/token",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Device-Type":r.getDeviceType()},transformRequest:function(e){return o(e)},skipAuthorization:!0,params:{}}}),a.hibp=e("https://haveibeenpwned.com/api/v2/breachedaccount/:email",{},{get:{method:"GET",params:{email:"@email"},isArray:!0}}),a}]),angular.module("bit.services").factory("authService",["cryptoService","apiService","tokenService","$q","jwtHelper","$rootScope","constants",function(e,t,n,o,r,a,i){var s={},l=null;s.logIn=function(r,a,l,c,u){r=r.toLowerCase();var d,p=o.defer();return e.makeKeyAndHash(r,a).then(function(e){d=e;var o={username:r,password:e.hash,grant_type:"password",scope:"api offline_access",client_id:"web"};return l&&null!=c?(u=u||!1!==u,o.twoFactorToken=l,o.twoFactorProvider=c,o.twoFactorRemember=u?"1":"0"):n.getTwoFactorToken(r)&&(o.twoFactorToken=n.getTwoFactorToken(r),o.twoFactorProvider=i.twoFactorProvider.remember,o.twoFactorRemember="0"),t.identity.token(o).$promise}).then(function(t){if(t&&t.access_token)return n.setToken(t.access_token),n.setRefreshToken(t.refresh_token),e.setKey(d.key),t.TwoFactorToken&&n.setTwoFactorToken(t.TwoFactorToken,r),t.Key&&e.setEncKey(t.Key,d.key),t.PrivateKey?(e.setPrivateKey(t.PrivateKey),!0):e.makeKeyPair()}).then(function(n){if(!0!==n)return e.setPrivateKey(n.privateKeyEnc),t.accounts.putKeys({publicKey:n.publicKey,encryptedPrivateKey:n.privateKeyEnc}).$promise}).then(function(){return s.setUserProfile()}).then(function(){p.resolve()},function(e){s.logOut(),400===e.status&&e.data.TwoFactorProviders2&&Object.keys(e.data.TwoFactorProviders2).length?(n.clearTwoFactorToken(r),p.resolve(e.data.TwoFactorProviders2)):p.reject(e)}),p.promise},s.logOut=function(){n.clearTokens(),e.clearKeys(),a.vaultGroupings=a.vaultCiphers=null,l=null},s.getUserProfile=function(){if(!l)return s.setUserProfile();var e=o.defer();return e.resolve(l),e.promise};var c=null;return s.setUserProfile=function(){return c&&0===c.promise.$$state.status?c.promise:(c=o.defer(),n.getToken()?(t.accounts.getProfile({},function(t){if(l={id:t.Id,email:t.Email,emailVerified:t.EmailVerified,premium:t.Premium,extended:{name:t.Name,twoFactorEnabled:t.TwoFactorEnabled,culture:t.Culture}},t.Organizations){for(var n={},o=0;o<t.Organizations.length;o++)n[t.Organizations[o].Id]={id:t.Organizations[o].Id,name:t.Organizations[o].Name,key:t.Organizations[o].Key,status:t.Organizations[o].Status,type:t.Organizations[o].Type,enabled:t.Organizations[o].Enabled,maxCollections:t.Organizations[o].MaxCollections,maxStorageGb:t.Organizations[o].MaxStorageGb,seats:t.Organizations[o].Seats,useGroups:t.Organizations[o].UseGroups,useDirectory:t.Organizations[o].UseDirectory,useEvents:t.Organizations[o].UseEvents,useTotp:t.Organizations[o].UseTotp};l.organizations=n,e.setOrgKeys(n),c.resolve(l)}},function(e){c.reject(e)}),c.promise):(c.reject(),c.promise))},s.addProfileOrganizationOwner=function(t,n){return s.getUserProfile().then(function(o){if(o){o.organizations||(o.organizations={});var r={id:t.Id,name:t.Name,key:n,status:2,type:0,enabled:!0,maxCollections:t.MaxCollections,maxStorageGb:t.MaxStorageGb,seats:t.Seats,useGroups:t.UseGroups,useDirectory:t.UseDirectory,useEvents:t.UseEvents,useTotp:t.UseTotp};o.organizations[r.id]=r,l=o,e.addOrgKey(r.id,r.key)}})},s.removeProfileOrganization=function(t){return s.getUserProfile().then(function(n){n&&(n.organizations&&n.organizations.hasOwnProperty(t)&&(delete n.organizations[t],l=n),e.clearOrgKey(t))})},s.updateProfileOrganization=function(e){return s.getUserProfile().then(function(t){t&&t.organizations&&e.Id in t.organizations&&(t.organizations[e.Id].name=e.Name,l=t)})},s.updateProfilePremium=function(e){return s.getUserProfile().then(function(t){t&&(t.premium=e,l=t)})},s.isAuthenticated=function(){return null!==n.getToken()},s.refreshAccessToken=function(){var e=n.getRefreshToken();return e?t.identity.token({grant_type:"refresh_token",client_id:"web",refresh_token:e}).$promise.then(function(e){return n.setToken(e.access_token),n.setRefreshToken(e.refresh_token),e.access_token},function(e){}):o(function(e,t){e(null)})},s}]),angular.module("bit.services").factory("cipherService",["cryptoService","apiService","$q","$window","constants","appSettings","$localStorage",function(e,t,n,o,r,a,i){var s={disableWebsiteIcons:i.disableWebsiteIcons};function l(t,n){return t&&""!==t?e.encrypt(t,n):null}return s.decryptCiphers=function(e){if(!e)throw"encryptedCiphers is undefined or null";for(var t=[],n=0;n<e.length;n++)t.push(s.decryptCipher(e[n]));return t},s.decryptCipher=function(t){if(!t)throw"encryptedCipher is undefined or null";var n=null;t.OrganizationId&&(n=e.getOrgKey(t.OrganizationId));var o={id:t.Id,organizationId:t.OrganizationId,collectionIds:t.CollectionIds||[],type:t.Type,folderId:t.FolderId,favorite:t.Favorite,edit:t.Edit,organizationUseTotp:t.OrganizationUseTotp,attachments:null,icon:null},a=t.Data;if(a){o.name=e.decrypt(a.Name,n),o.notes=s.decryptProperty(a.Notes,n,!0,!1),o.fields=s.decryptFields(n,a.Fields);var i={};switch(o.type){case r.cipherType.login:i.uri=s.decryptProperty(a.Uri,n,!0,!1),i.username=s.decryptProperty(a.Username,n,!0,!1),i.password=s.decryptProperty(a.Password,n,!0,!1),i.totp=s.decryptProperty(a.Totp,n,!0,!1),o.login=i,o.icon="fa-globe";break;case r.cipherType.secureNote:i.type=a.Type,o.secureNote=i,o.icon="fa-sticky-note-o";break;case r.cipherType.card:i.cardholderName=s.decryptProperty(a.CardholderName,n,!0,!1),i.number=s.decryptProperty(a.Number,n,!0,!1),i.brand=s.decryptProperty(a.Brand,n,!0,!1),i.expMonth=s.decryptProperty(a.ExpMonth,n,!0,!1),i.expYear=s.decryptProperty(a.ExpYear,n,!0,!1),i.code=s.decryptProperty(a.Code,n,!0,!1),o.card=i,o.icon="fa-credit-card";break;case r.cipherType.identity:i.title=s.decryptProperty(a.Title,n,!0,!1),i.firstName=s.decryptProperty(a.FirstName,n,!0,!1),i.middleName=s.decryptProperty(a.MiddleName,n,!0,!1),i.lastName=s.decryptProperty(a.LastName,n,!0,!1),i.address1=s.decryptProperty(a.Address1,n,!0,!1),i.address2=s.decryptProperty(a.Address2,n,!0,!1),i.address3=s.decryptProperty(a.Address3,n,!0,!1),i.city=s.decryptProperty(a.City,n,!0,!1),i.state=s.decryptProperty(a.State,n,!0,!1),i.postalCode=s.decryptProperty(a.PostalCode,n,!0,!1),i.country=s.decryptProperty(a.Country,n,!0,!1),i.company=s.decryptProperty(a.Company,n,!0,!1),i.email=s.decryptProperty(a.Email,n,!0,!1),i.phone=s.decryptProperty(a.Phone,n,!0,!1),i.ssn=s.decryptProperty(a.SSN,n,!0,!1),i.username=s.decryptProperty(a.Username,n,!0,!1),i.passportNumber=s.decryptProperty(a.PassportNumber,n,!0,!1),i.licenseNumber=s.decryptProperty(a.LicenseNumber,n,!0,!1),o.identity=i,o.icon="fa-id-card-o"}}if(!t.Attachments)return o;o.attachments=[];for(var l=0;l<t.Attachments.length;l++)o.attachments.push(s.decryptAttachment(n,t.Attachments[l]));return o},s.decryptCipherPreview=function(t){if(!t)throw"encryptedCipher is undefined or null";var n=null;t.OrganizationId&&(n=e.getOrgKey(t.OrganizationId));var o={id:t.Id,organizationId:t.OrganizationId,collectionIds:t.CollectionIds||[],type:t.Type,folderId:t.FolderId,favorite:t.Favorite,edit:t.Edit,organizationUseTotp:t.OrganizationUseTotp,hasAttachments:!!t.Attachments&&t.Attachments.length>0,meta:{},icon:null},i=t.Data;if(i){switch(o.name=s.decryptProperty(i.Name,n,!1,!0),o.type){case r.cipherType.login:o.subTitle=s.decryptProperty(i.Username,n,!0,!0),o.meta.password=s.decryptProperty(i.Password,n,!0,!0),o.meta.uri=s.decryptProperty(i.Uri,n,!0,!0),function(e,t,n){if(!s.disableWebsiteIcons&&t){var o=t,r=!1;if(0===o.indexOf("androidapp://")?e.icon="fa-android":0===o.indexOf("iosapp://")?e.icon="fa-apple":-1===o.indexOf("://")&&o.indexOf(".")>-1?(o="http://"+o,r=!0):r=0===o.indexOf("http")&&o.indexOf(".")>-1,n&&r)try{var i=new URL(o);e.meta.image=a.iconsUri+"/"+i.hostname+"/icon.png"}catch(e){}}e.icon||(e.icon="fa-globe")}(o,o.meta.uri,!0);break;case r.cipherType.secureNote:o.subTitle=null,o.icon="fa-sticky-note-o";break;case r.cipherType.card:o.subTitle="",o.meta.number=s.decryptProperty(i.Number,n,!0,!0);var l=s.decryptProperty(i.Brand,n,!0,!0);l&&(o.subTitle=l),o.meta.number&&o.meta.number.length>=4&&(""!==o.subTitle&&(o.subTitle+=", "),o.subTitle+="*"+o.meta.number.substr(o.meta.number.length-4)),o.icon="fa-credit-card";break;case r.cipherType.identity:var c=s.decryptProperty(i.FirstName,n,!0,!0),u=s.decryptProperty(i.LastName,n,!0,!0);o.subTitle="",c&&(o.subTitle=c),u&&(""!==o.subTitle&&(o.subTitle+=" "),o.subTitle+=u),o.icon="fa-id-card-o"}""===o.subTitle&&(o.subTitle=null)}return o},s.decryptAttachment=function(t,n){if(!n)throw"encryptedAttachment is undefined or null";return{id:n.Id,url:n.Url,fileName:e.decrypt(n.FileName,t),size:n.SizeName}},s.downloadAndDecryptAttachment=function(t,r,a){var i=n.defer(),s=new XMLHttpRequest;return s.open("GET",r.url,!0),s.responseType="arraybuffer",s.onload=function(n){s.response?e.decryptFromBytes(s.response,t).then(function(e){if(a){var t=new Blob([e]);if(o.navigator.msSaveOrOpenBlob)o.navigator.msSaveBlob(t,r.fileName);else{var n=o.document.createElement("a");n.href=o.URL.createObjectURL(t),n.download=r.fileName,o.document.body.appendChild(n),n.click(),o.document.body.removeChild(n)}}i.resolve(new Uint8Array(e))}):i.reject("No response")},s.send(null),i.promise},s.decryptFields=function(e,t){var n=[];if(t)for(var o=0;o<t.length;o++)n.push(s.decryptField(e,t[o]));return n},s.decryptField=function(t,n){if(!n)throw"encryptedField is undefined or null";return{type:n.Type.toString(),name:n.Name&&""!==n.Name?e.decrypt(n.Name,t):null,value:n.Value&&""!==n.Value?e.decrypt(n.Value,t):null}},s.decryptFolders=function(e){if(!e)throw"encryptedFolders is undefined or null";for(var t=[],n=0;n<e.length;n++)t.push(s.decryptFolder(e[n]));return t},s.decryptFolder=function(t){if(!t)throw"encryptedFolder is undefined or null";return{id:t.Id,name:e.decrypt(t.Name)}},s.decryptFolderPreview=function(e){if(!e)throw"encryptedFolder is undefined or null";return{id:e.Id,name:s.decryptProperty(e.Name,null,!1,!0)}},s.decryptCollections=function(e,t,n){if(!e)throw"encryptedCollections is undefined or null";for(var o=[],r=0;r<e.length;r++)o.push(s.decryptCollection(e[r],t,n));return o},s.decryptCollection=function(t,n,o){if(!t)throw"encryptedCollection is undefined or null";o=!0===o,n=n||t.OrganizationId;var r=e.getOrgKey(n);return{id:t.Id,name:o?s.decryptProperty(t.Name,r,!1,!0):e.decrypt(t.Name,r)}},s.decryptProperty=function(t,n,o,r){if(o&&(!t||""===t))return null;try{t=e.decrypt(t,n)}catch(e){t=null}return t||(r?"[error: cannot decrypt]":null)},s.encryptCiphers=function(e,t){if(!e)throw"unencryptedCiphers is undefined or null";for(var n=[],o=0;o<e.length;o++)n.push(s.encryptCipher(e[o],null,t));return n},s.encryptCipher=function(t,n,o,a){if(!t)throw"unencryptedCipher is undefined or null";t.organizationId&&(o=o||e.getOrgKey(t.organizationId));var i={id:t.id,type:n||t.type,organizationId:t.organizationId||null,folderId:""===t.folderId?null:t.folderId,favorite:null!==t.favorite&&t.favorite,name:e.encrypt(t.name,o),notes:l(t.notes,o),fields:s.encryptFields(t.fields,o)};switch(i.type){case r.cipherType.login:var c=t.login;i.login={uri:l(c.uri,o),username:l(c.username,o),password:l(c.password,o),totp:l(c.totp,o)};break;case r.cipherType.secureNote:i.secureNote={type:t.secureNote.type};break;case r.cipherType.card:var u=t.card;i.card={cardholderName:l(u.cardholderName,o),brand:l(u.brand,o),number:l(u.number,o),expMonth:l(u.expMonth,o),expYear:l(u.expYear,o),code:l(u.code,o)};break;case r.cipherType.identity:var d=t.identity;i.identity={title:l(d.title,o),firstName:l(d.firstName,o),middleName:l(d.middleName,o),lastName:l(d.lastName,o),address1:l(d.address1,o),address2:l(d.address2,o),address3:l(d.address3,o),city:l(d.city,o),state:l(d.state,o),postalCode:l(d.postalCode,o),country:l(d.country,o),company:l(d.company,o),email:l(d.email,o),phone:l(d.phone,o),ssn:l(d.ssn,o),username:l(d.username,o),passportNumber:l(d.passportNumber,o),licenseNumber:l(d.licenseNumber,o)}}if(t.attachments&&a){i.attachments={};for(var p=0;p<t.attachments.length;p++)i.attachments[t.attachments[p].id]=e.encrypt(t.attachments[p].fileName,o)}return i},s.encryptAttachmentFile=function(t,o){var r=n.defer();if(!(o.size>104857600)){var a=new FileReader;return a.readAsArrayBuffer(o),a.onload=function(n){e.encryptToBytes(n.target.result,t).then(function(n){r.resolve({fileName:e.encrypt(o.name,t),data:new Uint8Array(n),size:o.size})})},a.onerror=function(e){r.reject("Error reading file.")},r.promise}r.reject("Maximum file size is 100 MB.")},s.encryptFields=function(e,t){if(!e||!e.length)return null;for(var n=[],o=0;o<e.length;o++)e[o]&&n.push(s.encryptField(e[o],t));return n},s.encryptField=function(t,n){if(!t)throw"unencryptedField is undefined or null";return{type:parseInt(t.type),name:t.name?e.encrypt(t.name,n):null,value:t.value?e.encrypt(t.value.toString(),n):null}},s.encryptFolders=function(e,t){if(!e)throw"unencryptedFolders is undefined or null";for(var n=[],o=0;o<e.length;o++)n.push(s.encryptFolder(e[o],t));return n},s.encryptFolder=function(t,n){if(!t)throw"unencryptedFolder is undefined or null";return{id:t.id,name:e.encrypt(t.name,n)}},s.encryptCollections=function(e,t){if(!e)throw"unencryptedCollections is undefined or null";for(var n=[],o=0;o<e.length;o++)n.push(s.encryptCollection(e[o],t));return n},s.encryptCollection=function(t,n){if(!t)throw"unencryptedCollection is undefined or null";return{id:t.id,name:e.encrypt(t.name,e.getOrgKey(n))}},s}]),angular.module("bit.services").factory("cryptoService",["$sessionStorage","constants","$q","$window",function(e,t,n,o){var r,a,i,s,l,c,u={},d=void 0!==o.crypto?o.crypto:null,p=d&&void 0!==o.crypto.subtle?o.crypto.subtle:null;function m(e,t,n,o){return e="string"==typeof e?b(e):e,t="string"==typeof t?b(t):t,p.importKey("raw",e.buffer,{name:"PBKDF2"},!1,["deriveKey","deriveBits"]).then(function(e){return p.deriveKey({name:"PBKDF2",salt:t.buffer,iterations:n,hash:{name:"SHA-256"}},e,{name:"AES-CBC",length:o},!0,["encrypt","decrypt"])}).then(function(e){return p.exportKey("raw",e)})}function g(e,t,n){var o=forge.hmac.create();o.start("sha256",t),o.update(e);var r=o.digest();return n?forge.util.encode64(r.getBytes()):r.getBytes()}function f(e,t){return p.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]).then(function(t){return p.sign({name:"HMAC",hash:{name:"SHA-256"}},t,e)})}function h(e,t){var n=forge.hmac.create();return n.start("sha256",function(e){var t=new Uint32Array(e/4);d.getRandomValues(t);for(var n=forge.util.createBuffer(),o=0;o<t.length;o++)n.putInt32(t[o]);return n.getBytes()}(32)),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(t),e===(t=n.digest().getBytes())}function v(e,n,o){if(n&&(e=forge.util.decode64(e)),!e)throw"Must provide keyBytes";var r=forge.util.createBuffer(e);if(!r||0===r.length())throw"Couldn't make buffer";var a=r.length();if(null==o)if(32===a)o=t.encType.AesCbc256_B64;else{if(64!==a)throw"Unable to determine encType.";o=t.encType.AesCbc256_HmacSha256_B64}if(this.key=e,this.keyB64=forge.util.encode64(e),this.encType=o,o===t.encType.AesCbc256_B64&&32===a)this.encKey=e,this.macKey=null;else if(o===t.encType.AesCbc128_HmacSha256_B64&&32===a)this.encKey=r.getBytes(16),this.macKey=r.getBytes(16);else{if(o!==t.encType.AesCbc256_HmacSha256_B64||64!==a)throw"Unsupported encType/key length.";this.encKey=r.getBytes(32),this.macKey=r.getBytes(32)}}function y(e){for(var t="",n=new Uint8Array(e),r=0;r<n.byteLength;r++)t+=String.fromCharCode(n[r]);return o.btoa(t)}function b(e){for(var t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function w(e,t,n){if(e.slice)return e.slice(t,n);if(e=e.buffer,void 0===t&&(t=0),void 0===n&&(n=e.byteLength),t=Math.floor(t),n=Math.floor(n),t<0&&(t+=e.byteLength),n<0&&(n+=e.byteLength),t=Math.min(Math.max(0,t),e.byteLength),(n=Math.min(Math.max(0,n),e.byteLength))-t<=0)return new ArrayBuffer(0);var o=new ArrayBuffer(n-t),r=new Uint8Array(o),a=new Uint8Array(e,t,n-t);return r.set(a),new Uint8Array(o)}return u.setKey=function(t){r=t,e.key=r.keyB64},u.setEncKey=function(t,n,o){if(o)return a=t,void(e.encKey=a.keyB64);try{var r=u.decrypt(t,n,"raw");e.encKey=forge.util.encode64(r),a=new v(r)}catch(e){console.log("Cannot set enc key. Decryption failed.")}},u.setPrivateKey=function(t,n){try{var o=u.decrypt(t,n,"raw");e.privateKey=forge.util.encode64(o),l=forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(o))}catch(e){console.log("Cannot set private key. Decryption failed.")}},u.setOrgKeys=function(t,n){if(t&&0!==Object.keys(t).length){u.clearOrgKeys();var o={},r={},a=!1;for(var i in t)if(t.hasOwnProperty(i))try{var s=new v(u.rsaDecrypt(t[i].key,n));r[i]=s,o[i]=s.keyB64,a=!0}catch(e){console.log("Cannot set org key for "+i+". Decryption failed.")}a?e.orgKeys=o:r=null}},u.addOrgKey=function(t,n,o){(s=u.getOrgKeys())||(s={});var r=e.orgKeys;r||(r={});try{var a=new v(u.rsaDecrypt(n,o));s[t]=a,r[t]=a.keyB64}catch(e){s=null,console.log("Cannot set org key. Decryption failed.")}e.orgKeys=r},u.getKey=function(){if(!r&&e.key&&(r=new v(e.key,!0)),!r)throw"key unavailable";return r},u.getEncKey=function(){return!a&&e.encKey&&(a=new v(e.encKey,!0)),a},u.getPrivateKey=function(t){if(t=t||"native",l){if("raw"===t){var n=forge.pki.privateKeyToAsn1(l),o=forge.pki.wrapRsaPrivateKey(n);return forge.asn1.toDer(o).getBytes()}return l}if(e.privateKey){var r=forge.util.decode64(e.privateKey);if(l=forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(r)),"raw"===t)return r}return l},u.getPublicKey=function(){if(c)return c;var e=u.getPrivateKey();return e?c=forge.pki.setRsaPublicKey(e.n,e.e):null},u.getOrgKeys=function(){if(s)return s;if(e.orgKeys){var t={},n=!1;for(var o in e.orgKeys)e.orgKeys.hasOwnProperty(o)&&(t[o]=new v(e.orgKeys[o],!0),n=!0);n&&(s=t)}return s},u.getOrgKey=function(e){var t=u.getOrgKeys();return t&&e in t?t[e]:null},u.clearKey=function(){r=null,i=null,delete e.key},u.clearEncKey=function(){a=null,delete e.encKey},u.clearKeyPair=function(){l=null,c=null,delete e.privateKey},u.clearOrgKeys=function(){s=null,delete e.orgKeys},u.clearOrgKey=function(t){s.hasOwnProperty(t)&&delete s[t],e.orgKeys.hasOwnProperty(t)&&delete e.orgKeys[t]},u.clearKeys=function(){u.clearKey(),u.clearEncKey(),u.clearKeyPair(),u.clearOrgKeys()},u.makeKey=function(e,t){if(o.cryptoShimmed||-1!==o.navigator.userAgent.indexOf("Edge")){var r=n.defer(),a=forge.pbkdf2(forge.util.encodeUtf8(e),forge.util.encodeUtf8(t),5e3,32,"sha256");return r.resolve(new v(a)),r.promise}return m(e,t,5e3,256).then(function(e){return new v(y(e),!0)})},u.makeEncKey=function(e){var t=forge.random.getBytesSync(64),n=u.encrypt(t,e,"raw");return{encKey:new v(t),encKeyEnc:n}},u.makeKeyPair=function(e){var t=n.defer();return forge.pki.rsa.generateKeyPair({bits:2048,workers:2,workerScript:"/lib/forge/prime.worker.min.js"},function(n,o){if(n)t.reject(n);else{var r=forge.pki.privateKeyToAsn1(o.privateKey),a=forge.pki.wrapRsaPrivateKey(r),i=forge.asn1.toDer(a).getBytes(),s=u.encrypt(i,e,"raw"),l=forge.pki.publicKeyToAsn1(o.publicKey),c=forge.asn1.toDer(l).getBytes();t.resolve({publicKey:forge.util.encode64(c),privateKeyEnc:s})}}),t.promise},u.makeShareKey=function(){var e=forge.random.getBytesSync(64);return{key:new v(e),ct:u.rsaEncryptMe(e)}},u.hashPassword=function(e,t){if(t||(t=u.getKey()),!e||!t)throw"Invalid parameters.";if(o.cryptoShimmed||-1!==o.navigator.userAgent.indexOf("Edge")){var r=n.defer(),a=forge.pbkdf2(t.key,forge.util.encodeUtf8(e),1,32,"sha256");return r.resolve(forge.util.encode64(a)),r.promise}var i=t.getBuffers();return m(new Uint8Array(i.key),e,1,256).then(function(e){return y(e)})},u.makeKeyAndHash=function(e,t){var n;return e=e.toLowerCase(),u.makeKey(t,e).then(function(e){return n=e,u.hashPassword(t,e)}).then(function(e){return{key:n,hash:e}})},u.encrypt=function(e,t,n){var o=function(e,t,n){if(!(t=t||u.getEncKey()||u.getKey()))throw"Encryption key unavailable.";n=n||"utf8";var o=forge.util.createBuffer(e,n),r=forge.random.getBytesSync(16),a=forge.cipher.createCipher("AES-CBC",t.encKey);a.start({iv:r}),a.update(o),a.finish();var i=a.output.getBytes(),s=null;t.macKey&&(s=g(r+i,t.macKey,!1));return{iv:r,ct:i,mac:s,key:t,plainValueEncoding:n}}(e,t,n),r=forge.util.encode64(o.iv)+"|"+forge.util.encode64(o.ct);o.mac&&(r=r+"|"+forge.util.encode64(o.mac));return o.key.encType+"."+r},u.encryptToBytes=function(e,t){return function(e,t){if(!(t=t||u.getEncKey()||u.getKey()))throw"Encryption key unavailable.";var n={iv:new Uint8Array(16),ct:null,mac:null,key:t},o=t.getBuffers();return d.getRandomValues(n.iv),p.importKey("raw",o.encKey,{name:"AES-CBC"},!1,["encrypt"]).then(function(t){return p.encrypt({name:"AES-CBC",iv:n.iv},t,e)}).then(function(e){if(n.ct=new Uint8Array(e),!o.macKey)return null;var t=new Uint8Array(n.iv.length+n.ct.length);return t.set(n.iv,0),t.set(n.ct,n.iv.length),f(t.buffer,o.macKey)}).then(function(e){return e&&(n.mac=new Uint8Array(e)),n})}(e,t).then(function(e){var t=0;e.mac&&(t=e.mac.length);var n=new Uint8Array(1+e.iv.length+t+e.ct.length);return n.set([e.key.encType]),n.set(e.iv,1),e.mac&&n.set(e.mac,1+e.iv.length),n.set(e.ct,1+e.iv.length+t),n.buffer})},u.rsaEncrypt=function(e,n,o){if(!(n=n||u.getPublicKey()))throw"Public key unavailable.";if("string"==typeof n){var r=forge.util.decode64(n);n=forge.pki.publicKeyFromAsn1(forge.asn1.fromDer(r))}var a=n.encrypt(e,"RSA-OAEP",{md:forge.md.sha1.create()}),i=forge.util.encode64(a);if(o&&o.macKey){var s=g(a,o.macKey,!0);return t.encType.Rsa2048_OaepSha1_HmacSha256_B64+"."+i+"|"+s}return t.encType.Rsa2048_OaepSha1_B64+"."+i},u.rsaEncryptMe=function(e){return u.rsaEncrypt(e,u.getPublicKey(),u.getEncKey())},u.decrypt=function(e,n,o){try{n=n||u.getEncKey()||u.getKey();var r,a,s=e.split(".");if(2===s.length)try{r=parseInt(s[0]),a=s[1].split("|")}catch(e){return console.error("Cannot parse headerPieces."),null}else r=3===(a=e.split("|")).length?t.encType.AesCbc128_HmacSha256_B64:t.encType.AesCbc256_B64;if(r===t.encType.AesCbc128_HmacSha256_B64&&n.encType===t.encType.AesCbc256_B64&&(n=i=i||new v(n.key,!1,t.encType.AesCbc128_HmacSha256_B64)),r!==n.encType)throw"encType unavailable.";switch(r){case t.encType.AesCbc128_HmacSha256_B64:case t.encType.AesCbc256_HmacSha256_B64:if(3!==a.length)return console.error("Enc type ("+r+") not valid."),null;break;case t.encType.AesCbc256_B64:if(2!==a.length)return console.error("Enc type ("+r+") not valid."),null;break;default:return console.error("Enc type ("+r+") not supported."),null}var l=forge.util.decode64(a[0]),c=forge.util.decode64(a[1]);if(n.macKey&&a.length>2)if(!h(forge.util.decode64(a[2]),g(l+c,n.macKey,!1)))return console.error("MAC failed."),null;var d=forge.util.createBuffer(c),p=forge.cipher.createDecipher("AES-CBC",n.encKey);return p.start({iv:l}),p.update(d),p.finish(),"utf8"===(o=o||"utf8")?p.output.toString("utf8"):p.output.getBytes()}catch(e){throw console.error("Caught unhandled error in decrypt: "+e),e}},u.decryptFromBytes=function(e,n){try{if(!e)throw"no encBuf.";var o=new Uint8Array(e),r=o[0],a=null,i=null,s=null;switch(r){case t.encType.AesCbc128_HmacSha256_B64:case t.encType.AesCbc256_HmacSha256_B64:if(o.length<=49)return console.error("Enc type ("+r+") not valid."),null;i=w(o,1,17),s=w(o,17,49),a=w(o,49);break;case t.encType.AesCbc256_B64:if(o.length<=17)return console.error("Enc type ("+r+") not valid."),null;i=w(o,1,17),a=w(o,17);break;default:return console.error("Enc type ("+r+") not supported."),null}return function(e,t,n,o,r){if(!(r=r||u.getEncKey()||u.getKey()))throw"Encryption key unavailable.";if(r.macKey&&!o)throw"macBuf required for this type of key.";if(e!==r.encType)throw"encType unavailable.";var a=r.getBuffers(),i=null;return p.importKey("raw",a.encKey,{name:"AES-CBC"},!1,["decrypt"]).then(function(e){if(i=e,!r.macKey||!o)return null;var s=new Uint8Array(n.byteLength+t.byteLength);return s.set(new Uint8Array(n),0),s.set(new Uint8Array(t),n.byteLength),f(s.buffer,a.macKey)}).then(function(e){return null===e?null:(t=o,n=e,i=new Uint8Array(32),d.getRandomValues(i),window.crypto.subtle.importKey("raw",i.buffer,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]).then(function(e){return a=e,window.crypto.subtle.sign({name:"HMAC",hash:{name:"SHA-256"}},a,t)}).then(function(e){return r=e,window.crypto.subtle.sign({name:"HMAC",hash:{name:"SHA-256"}},a,n)}).then(function(e){if(r.byteLength!==e.byteLength)return!1;for(var t=new Uint8Array(r),n=new Uint8Array(e),o=0;o<n.length;o++)if(t[o]!==n[o])return!1;return!0}));var t,n,r,a,i}).then(function(e){return!1===e?(console.error("MAC failed."),null):p.decrypt({name:"AES-CBC",iv:n},i,t)})}(r,a.buffer,i.buffer,s?s.buffer:null,n)}catch(e){throw console.error("Caught unhandled error in decryptFromBytes: "+e),e}},u.rsaDecrypt=function(e,n,o){if(n=n||u.getPrivateKey(),o=o||u.getEncKey(),!n)throw"Private key unavailable.";var r,a,i=e.split(".");if(1===i.length)r=t.encType.Rsa2048_OaepSha256_B64,a=[i[0]];else if(2===i.length)try{r=parseInt(i[0]),a=i[1].split("|")}catch(e){return null}switch(r){case t.encType.Rsa2048_OaepSha256_B64:case t.encType.Rsa2048_OaepSha1_B64:if(1!==a.length)return null;break;case t.encType.Rsa2048_OaepSha256_HmacSha256_B64:case t.encType.Rsa2048_OaepSha1_HmacSha256_B64:if(2!==a.length)return null;break;default:return null}var s,l=forge.util.decode64(a[0]);if(o&&o.macKey&&a.length>1&&!h(forge.util.decode64(a[1]),g(l,o.macKey,!1)))return console.error("MAC failed."),null;if(r===t.encType.Rsa2048_OaepSha256_B64||r===t.encType.Rsa2048_OaepSha256_HmacSha256_B64)s=forge.md.sha256.create();else{if(r!==t.encType.Rsa2048_OaepSha1_B64&&r!==t.encType.Rsa2048_OaepSha1_HmacSha256_B64)throw"encType unavailable.";s=forge.md.sha1.create()}return n.decrypt(l,"RSA-OAEP",{md:s})},v.prototype.getBuffers=function(){if(this.keyBuf)return this.keyBuf;var e=function(e){for(var t=o.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}(this.keyB64),t={key:e.buffer};return this.macKey?(t.encKey=w(e,0,e.length/2).buffer,t.macKey=w(e,e.length/2).buffer):(t.encKey=e.buffer,t.macKey=null),this.keyBuf=t,this.keyBuf},u}]),angular.module("bit.services").factory("eventService",["constants","$filter",function(e,t){var n={};function o(e){var t=e.CipherId.substring(0,8);return e.OrganizationId?'<a title="View item '+e.CipherId+'" ui-sref="backend.org.vault({orgId:\''+e.OrganizationId+"',search:'"+t+"',viewEvents:'"+e.CipherId+"'})\"><code>"+t+"</code></a>":"<code>"+t+"</code>"}function r(e){var t=e.GroupId.substring(0,8);return'<a title="View group '+e.GroupId+'" ui-sref="backend.org.groups({orgId:\''+e.OrganizationId+"',search:'"+t+"'})\"><code>"+t+"</code></a>"}function a(e){var t=e.CollectionId.substring(0,8);return'<a title="View collection '+e.CollectionId+'" ui-sref="backend.org.collections({orgId:\''+e.OrganizationId+"',search:'"+t+"'})\"><code>"+t+"</code></a>"}function i(e){var t=e.OrganizationUserId.substring(0,8);return'<a title="View user '+e.OrganizationUserId+'" ui-sref="backend.org.people({orgId:\''+e.OrganizationId+"',search:'"+t+"'})\"><code>"+t+"</code></a>"}return n.getDefaultDateFilters=function(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59);return e.setDate(e.getDate()-30),{start:new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0),end:t}},n.formatDateFilters=function(e,n){var o={start:null,end:null,error:null};try{var r="yyyy-MM-ddTHH:mm";o.start=t("date")(e,r+"Z","UTC"),o.end=t("date")(n,r+":59.999Z","UTC")}catch(e){}return(!o.start||!o.end||o.end<o.start)&&(o.error="Invalid date range."),o},n.getEventInfo=function(t,n){n=n||{cipherInfo:!0};var s=function(t){var n={icon:"fa-globe",name:"Unknown"};switch(t.DeviceType){case e.deviceType.android:n.icon="fa-android",n.name="Mobile App - Android";break;case e.deviceType.ios:n.icon="fa-apple",n.name="Mobile App - iOS";break;case e.deviceType.uwp:n.icon="fa-windows",n.name="Mobile App - Windows";break;case e.deviceType.chromeExt:n.icon="fa-chrome",n.name="Extension - Chrome";break;case e.deviceType.firefoxExt:n.icon="fa-firefox",n.name="Extension - Firefox";break;case e.deviceType.operaExt:n.icon="fa-opera",n.name="Extension - Opera";break;case e.deviceType.edgeExt:n.icon="fa-edge",n.name="Extension - Edge";break;case e.deviceType.vivaldiExt:n.icon="fa-puzzle-piece",n.name="Extension - Vivaldi";break;case e.deviceType.windowsDesktop:n.icon="fa-windows",n.name="Desktop - Windows";break;case e.deviceType.macOsDesktop:n.icon="fa-apple",n.name="Desktop - macOS";break;case e.deviceType.linuxDesktop:n.icon="fa-linux",n.name="Desktop - Linux";break;case e.deviceType.chrome:n.icon="fa-globe",n.name="Web Vault - Chrome";break;case e.deviceType.firefox:n.icon="fa-globe",n.name="Web Vault - Firefox";break;case e.deviceType.opera:n.icon="fa-globe",n.name="Web Vault - Opera";break;case e.deviceType.safari:n.icon="fa-globe",n.name="Web Vault - Safari";break;case e.deviceType.vivaldi:n.icon="fa-globe",n.name="Web Vault - Vivaldi";break;case e.deviceType.edge:n.icon="fa-globe",n.name="Web Vault - Edge";break;case e.deviceType.ie:n.icon="fa-globe",n.name="Web Vault - IE";break;case e.deviceType.unknown:n.icon="fa-globe",n.name="Web Vault - Unknown"}return n}(t);return{message:function(t,n){var s="";switch(t.Type){case e.eventType.User_LoggedIn:s="Logged in.";break;case e.eventType.User_ChangedPassword:s="Changed account password.";break;case e.eventType.User_Enabled2fa:s="Enabled two-step login.";break;case e.eventType.User_Disabled2fa:s="Disabled two-step login.";break;case e.eventType.User_Recovered2fa:s="Recovered account from two-step login.";break;case e.eventType.User_FailedLogIn:s="Login attempt failed with incorrect password.";break;case e.eventType.User_FailedLogIn2fa:s="Login attempt failed with incorrect two-step login.";break;case e.eventType.Cipher_Created:s=n.cipherInfo?"Created item "+o(t)+".":"Created.";break;case e.eventType.Cipher_Updated:s=n.cipherInfo?"Edited item "+o(t)+".":"Edited.";break;case e.eventType.Cipher_Deleted:s=n.cipherInfo?"Deleted item "+o(t)+".":"Deleted";break;case e.eventType.Cipher_AttachmentCreated:s=n.cipherInfo?"Created attachment for item "+o(t)+".":"Created attachment.";break;case e.eventType.Cipher_AttachmentDeleted:s=n.cipherInfo?"Deleted attachment for item "+o(t)+".":"Deleted attachment.";break;case e.eventType.Cipher_Shared:s=n.cipherInfo?"Shared item "+o(t)+".":"Shared.";break;case e.eventType.Cipher_UpdatedCollections:s=n.cipherInfo?"Update collections for item "+o(t)+".":"Updated collections.";break;case e.eventType.Collection_Created:s="Created collection "+a(t)+".";break;case e.eventType.Collection_Updated:s="Edited collection "+a(t)+".";break;case e.eventType.Collection_Deleted:s="Deleted collection "+a(t)+".";break;case e.eventType.Group_Created:s="Created group "+r(t)+".";break;case e.eventType.Group_Updated:s="Edited group "+r(t)+".";break;case e.eventType.Group_Deleted:s="Deleted group "+r(t)+".";break;case e.eventType.OrganizationUser_Invited:s="Invited user "+i(t)+".";break;case e.eventType.OrganizationUser_Confirmed:s="Confirmed user "+i(t)+".";break;case e.eventType.OrganizationUser_Updated:s="Edited user "+i(t)+".";break;case e.eventType.OrganizationUser_Removed:s="Removed user "+i(t)+".";break;case e.eventType.OrganizationUser_UpdatedGroups:s="Edited groups for user "+i(t)+".";break;case e.eventType.Organization_Updated:s="Edited organization settings."}return""===s?null:s}(t,n),appIcon:s.icon,appName:s.name}},n}]),angular.module("bit.services").factory("importService",["constants",function(e){var t={};t.import=function(t,p,m,g){var f,h,v,y,b,w,C,S,k,T,P,I,E,z,O,A,U,x,D,F,M,G,N,B,K,_,L,R,H,V,j,q,Y;if(p)switch(t){case"bitwardencsv":q=p,Y=m,Papa.parse(q,{header:!0,encoding:"UTF-8",complete:function(t){l(t);var n=[],o=[],r=[],a=0;angular.forEach(t.data,function(t,i){var l=n.length,c=o.length,u=t.folder&&""!==t.folder,d=u;if(u)for(a=0;a<n.length;a++)if(n[a].name===t.folder){d=!1,l=a;break}var p={favorite:!(!t.favorite||""===t.favorite||"0"===t.favorite),notes:t.notes&&""!==t.notes?t.notes:null,name:t.name&&""!==t.name?t.name:"--",type:e.cipherType.login};if(t.fields&&""!==t.fields){var m=t.fields.split(/(?:\r\n|\r|\n)/);for(a=0;a<m.length;a++)if(m[a]&&""!==m[a]){var g=m[a].lastIndexOf(": ");if(-1!==g){p.fields||(p.fields=[]);var f={name:m[a].substr(0,g),value:null,type:e.fieldType.text};m[a].length>g+2&&(f.value=m[a].substr(g+2)),p.fields.push(f)}}}var h=t.type?t.type.toLowerCase():null;switch(h){case"login":case null:case void 0:p.type=e.cipherType.login;var v=t.login_totp||t.totp,y=t.login_uri||t.uri,b=t.login_username||t.username,w=t.login_password||t.password;p.login={totp:v&&""!==v?v:null,uri:y&&""!==y?s(y):null,username:b&&""!==b?b:null,password:w&&""!==w?w:null};break;case"note":p.type=e.cipherType.secureNote,p.secureNote={type:0}}if(o.push(p),d&&n.push({name:t.folder}),u){var C={key:c,value:l};r.push(C)}}),Y(n,o,r)}});break;case"lastpass":d(p,m,g,!1);break;case"safeincloudxml":!function(t,n,o){var r=[],a=[],i=[],l=[],c=0,d=0;u(t,function(t){var u=$(t).find("database");if(u.length){var p=u.find("> label");if(p.length)for(c=0;c<p.length;c++){var m=$(p[c]);l[m.attr("id")]=r.length,r.push({name:m.attr("name")})}var g=u.find("> card");if(g.length)for(c=0;c<g.length;c++){var f=$(g[c]);if("true"!==f.attr("template")){var h={favorite:!1,notes:"",name:f.attr("title"),fields:null};if(h.name&&""!==h.name||(h.name="--"),"note"===f.attr("type"))h.type=e.cipherType.secureNote,h.secureNote={type:0};else{h.type=e.cipherType.login,h.login={};var v=f.find("> field");for(d=0;d<v.length;d++){var y=$(v[d]),b=y.text(),w=y.attr("type"),C=y.attr("name");b&&""!==b&&("login"===w?h.login.username=b:"password"===w?h.login.password=b:"notes"===w?h.notes+=b+"\n":"weblogin"===w||"website"===w?h.login.uri=s(b):b.length>200?h.notes+=C+": "+b+"\n":(h.fields||(h.fields=[]),h.fields.push({name:C,value:b,type:e.fieldType.text})))}}var S=f.find("> notes");for(d=0;d<S.length;d++)h.notes+=$(S[d]).text()+"\n";if(""===h.notes&&(h.notes=null),a.push(h),(p=f.find("> label_id")).length){var k=$(p[0]).text(),T=l[k];null!==k&&""!==k&&null!==T&&i.push({key:a.length-1,value:T})}}}n(r,a,i)}else o()},o)}(p,m,g);break;case"keepass2xml":!function(t,n,o){var r=[],a=[],s=[];u(t,function(t){var l=$(t).find("Root");if(l.length){var c=l.find("> Group");c.length&&(!function t(n,o,l){var c=r.length;var u=l;o||(""!==u&&(u+=" > "),u+=n.find("> Name").text(),r.push({name:u}));var d=n.find("> Entry");if(d.length)for(var p=0;p<d.length;p++){for(var m=$(d[p]),g=a.length,f={favorite:!1,notes:null,name:null,type:e.cipherType.login,login:{uri:null,username:null,password:null},fields:null},h=m.find("> String"),v=0;v<h.length;v++){var y=$(h[v]),b=y.find("> Key").text(),w=y.find("> Value").text();if(""!==w)switch(b){case"URL":f.login.uri=i(w);break;case"UserName":f.login.username=w;break;case"Password":f.login.password=w;break;case"Title":f.name=w;break;case"Notes":f.notes=null===f.notes?w+"\n":f.notes+w+"\n";break;default:w.length>200||w.indexOf("\n")>-1?(f.notes||(f.notes=""),f.notes+=b+": "+w+"\n"):(f.fields||(f.fields=[]),f.fields.push({name:b,value:w,type:e.fieldType.text}))}}null===f.name&&(f.name="--"),a.push(f),o||s.push({key:g,value:c})}var C=n.find("> Group");if(C.length)for(var S=0;S<C.length;S++)t($(C[S]),!1,u)}($(c[0]),!0,""),n(r,a,s))}else o()},o)}(p,m,g);break;case"keepassxcsv":V=p,j=m,Papa.parse(V,{header:!0,encoding:"UTF-8",complete:function(t){l(t);var n=[],o=[],r=[];angular.forEach(t.data,function(t,a){t.Group=t.Group.startsWith("Root/")?t.Group.replace("Root/",""):t.Group;var s=t.Group&&""!==t.Group?t.Group.split("/").join(" > "):null,l=n.length,c=o.length,u=null!==s,d=u,p=0;if(u)for(p=0;p<n.length;p++)if(n[p].name===s){d=!1,l=p;break}var m={type:e.cipherType.login,favorite:!1,notes:t.Notes&&""!==t.Notes?t.Notes:null,name:t.Title&&""!==t.Title?t.Title:"--",login:{uri:t.URL&&""!==t.URL?i(t.URL):null,username:t.Username&&""!==t.Username?t.Username:null,password:t.Password&&""!==t.Password?t.Password:null}};if(t.Title&&o.push(m),d&&n.push({name:s}),u){var g={key:c,value:l};r.push(g)}}),j(n,o,r)}});break;case"padlockcsv":R=p,H=m,Papa.parse(R,{encoding:"UTF-8",complete:function(t){l(t);var n=[],o=[],r=[],a=[],i=0,c=0;for(i=0;i<t.data.length;i++){var u=t.data[i];if(0!==i){var d=n.length,p=o.length,m=u[1]&&""!==u[1],g=m;if(m)for(c=0;c<n.length;c++)if(n[c].name===u[1]){g=!1,d=c;break}var f={favorite:!1,type:e.cipherType.login,notes:null,name:u[0]&&""!==u[0]?u[0]:"--",login:{uri:null,username:u[2]&&""!==u[2]?u[2]:null,password:u[3]&&""!==u[3]?u[3]:null},fields:null};if(a.length)for(c=4;c<u.length;c++){var h=u[c];if(h&&""!==h){var v=a[c-4];"url"===v.toLowerCase()||"uri"===v.toLowerCase()?f.login.uri=s(h):(f.fields||(f.fields=[]),f.fields.push({name:v,value:h,type:e.fieldType.text}))}}o.push(f),g&&n.push({name:u[1]}),m&&r.push({key:p,value:d})}else for(c=4;c<u.length;c++)a.push(u[c])}H(n,o,r)}});break;case"1password1pif":!function(t,n,o){var r=[],a=[],s=0;function l(t,n,o,r,a){for(var i=0;i<t.length;i++){var s=t[i];if(s[r]&&""!==s[r]){var l=s[r].toString();if(n.type==e.cipherType.login&&!n.login.username&&s[o]&&"username"===s[o])n.login.username=l;else if(n.type==e.cipherType.login&&!n.login.password&&s[o]&&"password"===s[o])n.login.password=l;else if(n.type==e.cipherType.login&&!n.login.totp&&s[o]&&s[o].startsWith("TOTP_"))n.login.totp=l;else if(l){var c=s[a]||"no_name";l.indexOf("\\n")>-1||l.length>200?(null===n.notes?n.notes="":n.notes+="\n",n.notes+=c+": "+l.split("\\r\\n").join("\n").split("\\n").join("\n")):(n.fields||(n.fields=[]),n.fields.push({name:c,value:l,type:e.fieldType.text}))}}}}c(t,function(t){var o=t.split(/(?:\r\n|\r|\n)/);for(s=0;s<o.length;s++){var c=o[s];if(c.length&&"{"===c[0]){var u=JSON.parse(c),d={type:e.cipherType.login,favorite:!(!u.openContents||!u.openContents.faveIndex),notes:null,name:u.title&&""!==u.title?u.title:"--",fields:null};if("securenotes.SecureNote"===u.typeName?(d.type=e.cipherType.secureNote,d.secureNote={type:0}):(d.type=e.cipherType.login,d.login={uri:u.location&&""!==u.location?i(u.location):null,username:null,password:null,totp:null}),u.secureContents&&(u.secureContents.notesPlain&&""!==u.secureContents.notesPlain&&(d.notes=u.secureContents.notesPlain.split("\\r\\n").join("\n").split("\\n").join("\n")),u.secureContents.fields&&l(u.secureContents.fields,d,"designation","value","name"),u.secureContents.sections))for(var p=0;p<u.secureContents.sections.length;p++)u.secureContents.sections[p].fields&&l(u.secureContents.sections[p].fields,d,"n","v","t");a.push(d)}}n(r,a,[])},o)}(p,m,g);break;case"1password6wincsv":B=p,K=m,_=[],L=[],Papa.parse(B,{encoding:"UTF-8",header:!0,complete:function(t){l(t);for(var n=0;n<t.data.length;n++){var o=t.data[n];if(o.title){var r={type:e.cipherType.login,favorite:!1,notes:o.notesPlain&&""!==o.notesPlain?o.notesPlain:"",name:o.title&&""!==o.title?o.title:"--",login:{uri:null,username:null,password:null}};for(var a in o)if(o.hasOwnProperty(a)){if(null===o[a]||""===o[a])continue;if(r.login.password||"password"!==a)if(r.login.username||"username"!==a)if(r.login.uri||"urls"!==a)"ainfo"===a||"autosubmit"===a||"notesPlain"===a||"ps"===a||"scope"===a||"tags"===a||"title"===a||"uuid"===a||a.startsWith("section:")||(""!==r.notes&&(r.notes+="\n"),r.notes+=a+": "+o[a]);else{var s=o[a].split(/(?:\r\n|\r|\n)/);r.login.uri=i(s[0]);for(var c=1;c<s.length;c++)""!==r.notes&&(r.notes+="\n"),r.notes+="url "+(c+1)+": "+s[c]}else r.login.username=o[a];else r.login.password=o[a]}""===r.notes&&(r.notes=null),L.push(r)}}K(_,L,[])}});break;case"chromecsv":case"vivaldicsv":case"operacsv":G=p,N=m,Papa.parse(G,{header:!0,encoding:"UTF-8",complete:function(t){l(t);var n=[];angular.forEach(t.data,function(t,o){n.push({type:e.cipherType.login,favorite:!1,notes:null,name:t.name&&""!==t.name?t.name:"--",login:{uri:t.url&&""!==t.url?s(t.url):null,username:t.username&&""!==t.username?t.username:null,password:t.password&&""!==t.password?t.password:null}})}),N([],n,[])}});break;case"firefoxpasswordexportercsvxml":!function(t,n,o){var r=[],a=[];function i(e){var t="--";try{if(e&&""!==e){var n=document.createElement("a");n.href=e,n.hostname&&(t=n.hostname)}}catch(e){}return t}{if(!t.type||"text/xml"!==t.type)return void o("Only .xml exports are supported.");u(t,function(t){for(var o=$(t).find("entry"),l=0;l<o.length;l++){var c=$(o[l]);if(c){var u=c.attr("host"),d=c.attr("user"),p=c.attr("password");a.push({type:e.cipherType.login,favorite:!1,notes:null,name:i(u),login:{uri:u&&""!==u?s(u):null,username:d&&""!==d?d:null,password:p&&""!==p?p:null}})}}n(r,a,[])},o)}}(p,m,g);break;case"upmcsv":F=p,M=m,Papa.parse(F,{encoding:"UTF-8",complete:function(t){l(t);var n=[];angular.forEach(t.data,function(t,o){5===t.length&&n.push({type:e.cipherType.login,favorite:!1,notes:t[4]&&""!==t[4]?t[4]:null,name:t[0]&&""!==t[0]?t[0]:"--",login:{uri:t[3]&&""!==t[3]?s(t[3]):null,username:t[1]&&""!==t[1]?t[1]:null,password:t[2]&&""!==t[2]?t[2]:null}})}),M([],n,[])}});break;case"keepercsv":x=p,D=m,Papa.parse(x,{encoding:"UTF-8",complete:function(t){l(t);var n=[],o=[],r=[];angular.forEach(t.data,function(t,a){if(t.length>=6){var i=n.length,l=o.length,c=t[0]&&""!==t[0],u=c,d=0;if(c)for(d=0;d<n.length;d++)if(n[d].name===t[0]){u=!1,i=d;break}var p={type:e.cipherType.login,favorite:!1,notes:t[5]&&""!==t[5]?t[5]:null,name:t[1]&&""!==t[1]?t[1]:"--",login:{uri:t[4]&&""!==t[4]?s(t[4]):null,username:t[2]&&""!==t[2]?t[2]:null,password:t[3]&&""!==t[3]?t[3]:null},fields:null};if(t.length>6)for(d=6;d<t.length;d+=2)t[d+1]&&t[d+1].length>200?(p.notes||(p.notes=""),p.notes+=t[d]+": "+t[d+1]+"\n"):(p.fields||(p.fields=[]),p.fields.push({name:t[d],value:t[d+1],type:e.fieldType.text}));if(o.push(p),u&&n.push({name:t[0]}),c){var m={key:l,value:i};r.push(m)}}}),D(n,o,r)}});break;case"passworddragonxml":!function(t,n,o){var r=[],a=[],i=[],l=0;u(t,function(t){var c=$(t).find("PasswordManager");if(c.length){var u=c.find("> record");if(u.length)for(var d=0;d<u.length;d++){var p=$(u[d]),m=p.find("> Account-Name"),g=m.length?$(m):null,f=p.find("> User-Id"),h=f.length?$(f):null,v=p.find("> Password"),y=v.length?$(v):null,b=p.find("> URL"),w=b.length?$(b):null,C=p.find("> Notes"),S=C.length?$(C):null,k=p.find("> Category"),T=k.length?$(k):null,P=T?T.text():null,I=r.length,E=a.length,z=P&&""!==P&&"Unfiled"!==P,O=z;if(z)for(l=0;l<r.length;l++)if(r[l].name===P){O=!1,I=l;break}var A={type:e.cipherType.login,favorite:!1,notes:S&&""!==S.text()?S.text():null,name:g&&""!==g.text()?g.text():"--",login:{uri:w&&""!==w.text()?s(w.text()):null,username:h&&""!==h.text()?h.text():null,password:y&&""!==y.text()?y.text():null},fields:null},U="";for(l=1;l<=10;l++)U+="> Attribute-"+l,l<10&&(U+=", ");var x=p.find(U);if(x.length)for(l=0;l<x.length;l++){var D=$(x[l]),F=D.prop("tagName"),M=D.text();M&&""!==M&&"null"!==M&&(M.length>200?(A.notes||(A.notes=""),A.notes+=F+": "+M+"\n"):(A.fields||(A.fields=[]),A.fields.push({name:F,value:M,type:e.fieldType.text})))}if(a.push(A),O&&r.push({name:P}),z){var G={key:E,value:I};i.push(G)}}n(r,a,i)}else o()},o)}(p,m,g);break;case"enpasscsv":A=p,U=m,Papa.parse(A,{encoding:"UTF-8",complete:function(t){l(t);for(var n=[],o=0;o<t.data.length;o++){var r=t.data[o];if(!(r.length<2||0===o&&"Title"===r[0])){var a=r[r.length-1],i={type:e.cipherType.login,name:r[0],favorite:!1,notes:a&&""!==a?a:null,fields:null,login:{uri:null,password:null,username:null,totp:null}};if(r.length>2&&r.length%2==0)for(var c=0;c<r.length-2;c+=2){var u=r[c+2];if(u&&""!==u){var d=r[c+1],p=d.toLowerCase();"url"!==p||i.login.uri?"username"!==p&&"email"!==p||i.login.username?"password"!==p||i.login.password?"totp"!==p||i.login.totp?u.length>200?(i.notes||(i.notes=""),i.notes+=d+": "+u+"\n"):(i.fields||(i.fields=[]),i.fields.push({name:d,value:u,type:e.fieldType.text})):i.login.totp=u:i.login.password=u:i.login.username=u:i.login.uri=s(u)}}n.push(i)}}U([],n,[])}});break;case"pwsafexml":!function(t,n,o){var r=[],a=[],i=[],l=0;u(t,function(t){var c=$(t).find("passwordsafe");if(c.length){var u=c.attr("delimiter"),d=c.find("> entry");if(d.length)for(var p=0;p<d.length;p++){var m=$(d[p]),g=m.find("> title"),f=g.length?$(g):null,h=m.find("> username"),v=h.length?$(h):null,y=m.find("> email"),b=y.length?$(y):null,w=b?b.text():null,C=m.find("> password"),S=C.length?$(C):null,k=m.find("> url"),T=k.length?$(k):null,P=m.find("> notes"),I=P.length?$(P):null,E=I?I.text().split(u).join("\n"):null,z=m.find("> group"),O=z.length?$(z):null,A=O?O.text().split(".").join(" > "):null,U=r.length,x=a.length,D=A&&""!==A,F=D;if(D)for(l=0;l<r.length;l++)if(r[l].name===A){F=!1,U=l;break}var M={type:e.cipherType.login,favorite:!1,notes:I&&""!==E?E:null,name:f&&""!==f.text()?f.text():"--",login:{uri:T&&""!==T.text()?s(T.text()):null,username:v&&""!==v.text()?v.text():null,password:S&&""!==S.text()?S.text():null}};if(!M.login.username&&w&&""!==w?M.login.username=w:w&&""!==w&&(M.notes=null===M.notes?"Email: "+w:M.notes+"\nEmail: "+w),a.push(M),F&&r.push({name:A}),D){var G={key:x,value:U};i.push(G)}}n(r,a,i)}else o()},o)}(p,m,g);break;case"dashlanecsv":z=p,O=m,Papa.parse(z,{encoding:"UTF-8",complete:function(t){l(t);for(var n=[],o=0;o<t.data.length;o++){var r=!1,a=t.data[o];if(a.length&&1!==a.length){var s={type:e.cipherType.login,name:a[0]&&""!==a[0]?a[0]:"--",favorite:!1,notes:null,login:{uri:null,password:null,username:null}};if(2===a.length)s.login.uri=i(a[1]);else if(3===a.length)s.login.uri=i(a[1]),s.login.username=a[2];else if(4===a.length)""===a[2]&&""===a[3]?(s.login.username=a[1],s.notes=a[2]+"\n"+a[3]):(s.login.username=a[2],s.notes=a[1]+"\n"+a[3]);else if(5===a.length)s.login.uri=i(a[1]),s.login.username=a[2],s.login.password=a[3],s.notes=a[4];else if(6===a.length)""===a[2]?(s.login.username=a[3],s.login.password=a[4],s.notes=a[5]):(s.login.username=a[2],s.login.password=a[3],s.notes=a[4]+"\n"+a[5]),s.login.uri=i(a[1]);else if(7===a.length)""===a[2]?(s.login.username=a[3],s.notes=a[4]+"\n"+a[6]):(s.login.username=a[2],s.notes=a[3]+"\n"+a[4]+"\n"+a[6]),s.login.uri=i(a[1]),s.login.password=a[5];else{s.notes="";for(var c=1;c<a.length;c++)if(s.notes=s.notes+a[c]+"\n","NO_TYPE"===a[c]){r=!0;break}}r||(""===s.login.username&&(s.login.username=null),""===s.login.password&&(s.login.password=null),""===s.notes&&(s.notes=null),""===s.login.uri&&(s.login.uri=null),n.push(s))}}O([],n,[])}});break;case"stickypasswordxml":!function(t,n,o){var r=[],a=[],i=[],l=0;function c(e,t,n){var o=e.find('> Groups > Group[ID="'+t+'"]');if(o.length){n&&""!==n&&(n=" > "+n),n=o.attr("Name")+n;var r=o.attr("ParentID");return c(e,r,n)}return n}u(t,function(t){var u=$(t).find("root > Database");if(u.length){var d=u.find("> Logins > Login");if(d.length)for(var p=0;p<d.length;p++){var m=$(d[p]),g=m.attr("Name"),f=m.attr("Password"),h=m.attr("ID"),v=null,y=null,b=null,w=null,C=null;if(h&&""!==h){var S=u.find('> Accounts > Account > LoginLinks > Login[SourceLoginID="'+h+'"]');if(S.length){var k=S.parent().parent();k.length&&(v=k.attr("Name"),y=k.attr("Link"),w=k.attr("ParentID"),(b=k.attr("Comments"))&&(b=b.split("/n").join("\n")))}}w&&""!==w&&(C=c(u,w,""));var T=r.length,P=a.length,I=C&&""!==C,E=I;if(I)for(l=0;l<r.length;l++)if(r[l].name===C){E=!1,T=l;break}var z={type:e.cipherType.login,favorite:!1,notes:b&&""!==b?b:null,name:v&&""!==v?v:"--",login:{uri:y&&""!==y?s(y):null,username:g&&""!==g?g:null,password:f&&""!==f?f:null}};if(a.push(z),E&&r.push({name:C}),I){var O={key:P,value:T};i.push(O)}}n(r,a,i)}else o()},o)}(p,m,g);break;case"msecurecsv":I=p,E=m,Papa.parse(I,{encoding:"UTF-8",complete:function(t){l(t);var n=[],o=[],r=[];angular.forEach(t.data,function(t,a){if(t.length>=3){var i=n.length,l=o.length,c=t[0]&&""!==t[0]&&"Unassigned"!==t[0],u=c,d=0;if(c)for(d=0;d<n.length;d++)if(n[d].name===t[0]){u=!1,i=d;break}var p={type:e.cipherType.login,favorite:!1,notes:"",name:t[2]&&""!==t[2]?t[2]:null,login:{uri:null,username:null,password:null}};if("Web Logins"===t[1])p.login.uri=t[4]&&""!==t[4]?s(t[4]):null,p.login.username=t[5]&&""!==t[5]?t[5]:null,p.login.password=t[6]&&""!==t[6]?t[6]:null,p.notes=t[3]&&""!==t[3]?t[3].split("\\n").join("\n"):null;else if(t.length>3)for(var m=3;m<t.length;m++)t[m]&&""!==t[m]&&(""!==p.notes&&(p.notes=p.notes+"\n"),p.notes=p.notes+t[m]);if(t[1]&&""!==t[1]&&"Web Logins"!==t[1]&&(p.name=t[1]+": "+p.name),""===p.notes&&(p.notes=null),o.push(p),u&&n.push({name:t[0]}),c){var g={key:l,value:i};r.push(g)}}}),E(n,o,r)}});break;case"truekeycsv":C=p,S=m,k=[],T=[],P=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"],Papa.parse(C,{header:!0,encoding:"UTF-8",complete:function(t){l(t),angular.forEach(t.data,function(t,n){var o={type:e.cipherType.login,favorite:!(!t.favorite||"true"!==t.favorite.toLowerCase()),notes:t.memo&&""!==t.memo?t.memo:null,name:t.name&&""!==t.name?t.name:"--",login:{uri:t.url&&""!==t.url?s(t.url):null,username:t.login&&""!==t.login?t.login:null,password:t.password&&""!==t.password?t.password:null},fields:null};if("login"!==t.kind)for(var r in o.name=t.title&&""!==t.title?t.title:"--",o.notes=t.note&&""!==t.note?t.note:null,o.notes||(o.notes=t.document_content&&""!==t.document_content?t.document_content:null),t)t.hasOwnProperty(r)&&P.indexOf(r.toLowerCase())<0&&t[r]&&""!==t[r]&&(t[r].length>200?(o.notes||(o.notes=""),o.notes+=r+": "+t[r]+"\n"):(o.fields||(o.fields=[]),o.fields.push({name:r,value:t[r],type:e.fieldType.text})));T.push(o)}),S(k,T,[])}});break;case"clipperzhtml":!function(t,r,i){var l=[],u=[];c(t,function(t){var i=$(t).find("textarea"),c=i&&i.length?i.val():null,d=c?JSON.parse(c):null;if(d&&d.length)for(var p=0;p<d.length;p++){var m=d[p],g={type:e.cipherType.login,favorite:!1,notes:"",name:m.label&&""!==m.label?m.label.split(" ")[0]:"--",login:{uri:null,username:null,password:null},fields:null};if(m.data&&m.data.notes&&""!==m.data.notes&&(g.notes=m.data.notes.split("\\n").join("\n")),m.currentVersion&&m.currentVersion.fields)for(var f in m.currentVersion.fields)if(m.currentVersion.fields.hasOwnProperty(f)){var h=m.currentVersion.fields[f],v=h.actionType.toLowerCase();switch(v){case"password":g.login.password=h.value;break;case"email":case"username":case"user":case"name":g.login.username=h.value;break;case"url":g.login.uri=s(h.value);break;default:!g.login.username&&a(h.label,o)?g.login.username=h.value:!g.login.password&&a(h.label,n)?g.login.password=h.value:h.value.length>200?(g.notes||(g.notes=""),g.notes+=h.label+": "+h.value+"\n"):(g.fields||(g.fields=[]),g.fields.push({name:h.label,value:h.value,type:e.fieldType.text}))}}""===g.notes&&(g.notes=null),u.push(g)}r(l,u,[])},i)}(p,m,g);break;case"avirajson":!function(t,n,o){var r=[],a=[],s=0;c(t,function(t){var o=JSON.parse(t);if(o&&o.accounts)for(s=0;s<o.accounts.length;s++){var l=o.accounts[s],c={type:e.cipherType.login,favorite:l.is_favorite&&!0===l.is_favorite,notes:null,name:l.label&&""!==l.label?l.label:l.domain,login:{uri:l.domain&&""!==l.domain?i(l.domain):null,username:l.username&&""!==l.username?l.username:null,password:l.password&&""!==l.password?l.password:null}};l.email&&""!==l.email&&(c.login.username&&""!==c.login.username?c.notes=l.email:c.login.username=l.email),c.name&&""!==c.name||(c.name="--"),a.push(c)}n(r,a,[])},o)}(p,m,g);break;case"roboformhtml":!function(t,r,s){var l=[],u=[];c(t,function(t){var s=$(t.split("&shy;").join("").split("<WBR>").join("")).find("table.nobr");if(s.length)for(var c=0;c<s.length;c++){var d=$(s[c]),p={type:e.cipherType.login,favorite:!1,notes:"",name:d.find("span.caption").text(),login:{uri:null,username:null,password:null},fields:null},m=d.find(".subcaption").text();m&&""!==m&&(p.login.uri=i(m));var g=[];if($.each(d.find("table td:not(.subcaption)"),function(e,t){$(t).find("br").replaceWith("\n");var n=$(t).text();""!==n&&g.push(n.split("\\n").join("\n"))}),g.length&&g.length%2==0)for(var f=0;f<g.length;f+=2){var h=g[f],v=g[f+1];!p.login.password&&a(h.replace(":",""),n)?p.login.password=v:!p.login.username&&a(h.replace(":",""),o)?p.login.username=v:v.length>200?(p.notes||(p.notes=""),p.notes+=h+": "+v+"\n"):(p.fields||(p.fields=[]),p.fields.push({name:h,value:v,type:e.fieldType.text}))}p.notes&&""!==p.notes||(p.notes=null),p.name&&""!==p.name||(p.name="--"),u.push(p)}r(l,u,[])},s)}(p,m,g);break;case"saferpasscsv":!function(t,n,o){var r=[],a=[];Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(t){l(t),angular.forEach(t.data,function(t,n){var o,r;a.push({type:e.cipherType.login,favorite:!1,notes:t.notes&&""!==t.notes?t.notes:null,name:t.url&&""!==t.url?(o=t.url,r=document.createElement("a"),r.href=o,r.hostname.startsWith("www.")?r.hostname.replace("www.",""):r.hostname):"--",login:{uri:t.url&&""!==t.url?s(t.url):null,username:t.username&&""!==t.username?t.username:null,password:t.password&&""!==t.password?t.password:null}})}),n(r,a,[])}})}(p,m);break;case"ascendocsv":b=p,w=m,Papa.parse(b,{encoding:"UTF-8",complete:function(t){l(t);for(var s=[],c=0;c<t.data.length;c++){var u=t.data[c];if(!(u.length<2)){var d=u[u.length-1],p={type:e.cipherType.login,name:u[0],favorite:!1,notes:d&&""!==d?d:null,login:{uri:null,password:null,username:null},fields:null};if(u.length>2&&u.length%2==0)for(var m=0;m<u.length-2;m+=2){var g=u[m+2],f=u[m+1];f&&""!==f&&g&&""!==g&&(f.toLowerCase(),!p.login.uri&&a(f,r)?p.login.uri=i(g):!p.login.username&&a(f,o)?p.login.username=g:!p.login.password&&a(f,n)?p.login.password=g:g.length>200?(p.notes||(p.notes=""),p.notes+=f+": "+g+"\n"):(p.fields||(p.fields=[]),p.fields.push({name:f,value:g,type:e.fieldType.text})))}s.push(p)}}w([],s,[])}});break;case"passwordbossjson":!function(t,n,o){var r=[],a=[],s=0;c(t,function(t){var o=JSON.parse(t);if(o&&o.length)for(s=0;s<o.length;s++){var l=o[s],c={type:e.cipherType.login,favorite:!1,notes:"",name:l.name&&""!==l.name?l.name:"--",login:{uri:l.login_url&&""!==l.login_url?i(l.login_url):null,username:null,password:null},fields:null};if(l.identifiers){for(var u in l.identifiers.notes&&""!==l.identifiers.notes&&(c.notes=l.identifiers.notes.split("\\r\\n").join("\n").split("\\n").join("\n")),l.identifiers)if(l.identifiers.hasOwnProperty(u)){var d=l.identifiers[u];if("notes"===u||""===d||null===d)continue;"username"===u?c.login.username=d:"password"===u?c.login.password=d:d.length>200?(c.notes||(c.notes=""),c.notes+=u+": "+d+"\n"):(c.fields||(c.fields=[]),c.fields.push({name:u,value:d,type:e.fieldType.text}))}""===c.notes&&(c.notes=null),a.push(c)}}n(r,a,[])},o)}(p,m,g);break;case"zohovaultcsv":!function(t,n,o){function r(t,n){if(t&&""!==t)for(var o=t.split(/(?:\r\n|\r|\n)/),r=0;r<o.length;r++){var a=o[r],i=a.indexOf(":");if(!(i<0)){var s=a.substring(0,i),l=a.length>i?a.substring(i+1):null;if(s&&""!==s&&l&&""!==l&&"SecretType"!==s){var c=s.toLowerCase();"user name"===c?n.login.username=l:"password"===c?n.login.password=l:l.length>200?(n.notes||(n.notes=""),n.notes+=s+": "+l+"\n"):(n.fields||(n.fields=[]),n.fields.push({name:s,value:l,type:e.fieldType.text}))}}}}Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(t){l(t);var o=[],a=[],s=[];angular.forEach(t.data,function(t,n){var l=t.ChamberName,c=o.length,u=a.length,d=l&&""!==l,p=d,m=0;if(d)for(m=0;m<o.length;m++)if(o[m].name===l){p=!1,c=m;break}var g={type:e.cipherType.login,favorite:!(!t.Favorite||"1"!==t.Favorite),notes:t.Notes&&""!==t.Notes?t.Notes:"",name:t["Secret Name"]&&""!==t["Secret Name"]?t["Secret Name"]:"--",login:{uri:t["Secret URL"]&&""!==t["Secret URL"]?i(t["Secret URL"]):null,username:null,password:null},fields:null};if(r(t.SecretData,g),r(t.CustomData,g),""===g.notes&&(g.notes=null),t["Secret Name"]&&a.push(g),p&&o.push({name:l}),d){var f={key:u,value:c};s.push(f)}}),n(o,a,s)}})}(p,m);break;case"splashidcsv":v=p,y=m,Papa.parse(v,{encoding:"UTF-8",complete:function(t){l(t);var n=[],o=[],r=[];function a(e,t,n){for(var o=e;o<t.length-3;o++)t[o]&&""!==t[o]&&(n.notes?""!==n.notes&&(n.notes+="\n"):n.notes="",n.notes+=t[o])}for(var s=1;s<t.data.length;s++)if(!(t.data[s].length<3)){var c=t.data[s],u=c[t.data.length-1],d=c[t.data.length-2],p=c[0],m=n.length,g=o.length,f=u&&""!==u&&"Unfiled"!==u,h=f,v=0;if(f)for(v=0;v<n.length;v++)if(n[v].name===u){h=!1,m=v;break}var b={type:e.cipherType.login,favorite:!1,notes:d,name:c[1]&&""!==c[1]?c[1]:"--",fields:null,login:{uri:null,username:null,password:null}};if("Web Logins"===p||"Servers"===p||"Email Accounts"===p?(b.login.uri=c[4]&&""!==c[4]?i(c[4]):null,b.login.username=c[2]&&""!==c[2]?c[2]:null,b.login.password=c[3]&&""!==c[3]?c[3]:null,a(5,c,b)):c.length>2&&a(2,c,b),b.name&&"--"!==b.name&&"Web Logins"!==p&&"Servers"!==p&&"Email Accounts"!==p&&(b.name=p+": "+b.name),""===b.notes&&(b.notes=null),o.push(b),h&&n.push({name:u}),f){var w={key:g,value:m};r.push(w)}}y(n,o,r)}});break;case"meldiumcsv":f=p,h=m,Papa.parse(f,{header:!0,encoding:"UTF-8",complete:function(t){l(t);for(var n=[],o=0;o<t.data.length;o++){var r=t.data[o],a={type:e.cipherType.login,name:r.DisplayName&&""!==r.DisplayName?r.DisplayName:"--",favorite:!1,notes:r.Notes&&""!==r.Notes?r.Notes:null,login:{uri:r.Url&&""!==r.Url?i(r.Url):null,password:r.Password&&""!==r.Password?r.Password:null,username:r.UserName&&""!==r.UserName?r.UserName:null}};n.push(a)}h([],n,[])}});break;case"passkeepcsv":!function(t,n,o){function r(e,t){var n=t[e]||t[" "+e];return n&&""!==n?n:null}Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(t){l(t);var o=[],a=[],s=[];angular.forEach(t.data,function(t,n){var l=o.length,c=a.length,u=!!r("category",t),d=u,p=0;if(u)for(p=0;p<o.length;p++)if(o[p].name===r("category",t)){d=!1,l=p;break}var m={type:e.cipherType.login,favorite:!1,notes:r("description",t)?r("description",t):null,name:r("title",t)?r("title",t):"--",login:{uri:r("site",t)?i(r("site",t)):null,username:r("username",t)?r("username",t):null,password:r("password",t)?r("password",t):null}};if(r("password2",t)&&(m.notes?m.notes+="\n":m.notes="",m.notes+="Password 2: "+r("password2",t)),a.push(m),d&&o.push({name:r("category",t)}),u){var g={key:c,value:l};s.push(g)}}),n(o,a,s)}})}(p,m);break;case"gnomejson":!function(t,n,o){var r=[],a=[],s=[],l=0;c(t,function(t){var o=JSON.parse(t),c=0,u=0;if(o&&Object.keys(o).length)for(var d in o)if(o.hasOwnProperty(d)&&o[d].length)for(c=r.length,r.push({name:d}),l=0;l<o[d].length;l++){var p=o[d][l];if(p.display_name&&0===p.display_name.indexOf("http")){u=a.length;var m={type:e.cipherType.login,favorite:!1,notes:"",name:p.display_name.replace("http://","").replace("https://",""),login:{uri:i(p.display_name),username:p.attributes.username_value&&""!==p.attributes.username_value?p.attributes.username_value:null,password:p.secret&&""!==p.secret?p.secret:null}};for(var g in m.name>30&&(m.name=m.name.substring(0,30)),p.attributes)p.attributes.hasOwnProperty(g)&&"username_value"!==g&&"xdg:schema"!==g&&(""!==m.notes&&(m.notes+="\n"),m.notes+=g+": "+p.attributes[g]);""===m.notes&&(m.notes=null),a.push(m),s.push({key:u,value:c})}}n(r,a,s)},o)}(p,m,g);break;default:g()}else g()},t.importOrg=function(t,n,o,r){var a,i;if(n)switch(t){case"bitwardencsv":a=n,i=o,Papa.parse(a,{header:!0,encoding:"UTF-8",complete:function(t){l(t);var n,o=[],r=[],a=[];angular.forEach(t.data,function(t,i){var l=r.length;if(t.collections&&""!==t.collections){var c=t.collections.split(",");for(n=0;n<c.length;n++){for(var u=!0,d=o.length,p=0;p<o.length;p++)if(o[p].name===c[n]){u=!1,d=p;break}u&&o.push({name:c[n]}),a.push({key:l,value:d})}}var m={favorite:!1,notes:t.notes&&""!==t.notes?t.notes:null,name:t.name&&""!==t.name?t.name:"--",type:e.cipherType.login};if(t.fields&&""!==t.fields){var g=t.fields.split(/(?:\r\n|\r|\n)/);for(n=0;n<g.length;n++)if(g[n]&&""!==g[n]){var f=g[n].lastIndexOf(": ");if(-1!==f){m.fields||(m.fields=[]);var h={name:g[n].substr(0,f),value:null,type:e.fieldType.text};g[n].length>f+2&&(h.value=g[n].substr(f+2)),m.fields.push(h)}}}var v=t.type?t.type.toLowerCase():null;switch(v){case"login":case null:case void 0:m.type=e.cipherType.login;var y=t.login_totp||t.totp,b=t.login_uri||t.uri,w=t.login_username||t.username,C=t.login_password||t.password;m.login={totp:y&&""!==y?y:null,uri:b&&""!==b?s(b):null,username:w&&""!==w?w:null,password:C&&""!==C?C:null};break;case"note":m.type=e.cipherType.secureNote,m.secureNote={type:0}}r.push(m)}),i(o,r,a)}});break;case"lastpass":d(n,o,r,!0);break;default:r()}else r()};var n=["password","pass word","passphrase","pass phrase","pass","code","code word","codeword","secret","secret word","personpwd","key","keyword","key word","keyphrase","key phrase","form_pw","wppassword","pin","pwd","pw","pword","passwd","p","serial","serial#","license key","reg #","passwort"],o=["user","name","user name","username","login name","email","e-mail","id","userid","user id","login","form_loginname","wpname","mail","loginid","login id","log","personlogin","first name","last name","card#","account #","member","member #","nom","benutzername"],r=["url","hyper link","hyperlink","link","host","hostname","host name","server","address","hyper ref","href","web","website","web site","site","web-site","uri","ort","adresse"];function a(e,t){if(!e||""===e)return!1;e=e.trim().toLowerCase();for(var n=0;n<t.length;n++)if(e===t[n])return!0;return!1}function i(e){return!(e=e.toLowerCase().trim()).startsWith("http")&&e.indexOf(".")>=0&&(e="http://"+e),s(e)}function s(e){return e.length>1e3?e.substring(0,1e3):e}function l(e){if(e.errors&&e.errors.length)for(var t=0;t<e.errors.length;t++)console.warn("Error parsing row "+e.errors[t].row+": "+e.errors[t].message)}function c(e,t,n){if("string"==typeof e)t(e);else{var o=new FileReader;o.readAsText(e,"utf-8"),o.onload=function(e){t(e.target.result)},o.onerror=function(e){n()}}}function u(e,t,n){c(e,function(e){t($.parseXML(e))},n)}function d(t,n,o,r){if("string"!=typeof t&&t.type&&"text/html"===t.type){var a=new FileReader;a.readAsText(t,"utf-8"),a.onload=function(e){var t,n=$(e.target.result),r=n.find("pre");if(1===r.length)t=r.text().trim(),u(Papa.parse(t,{header:!0,encoding:"UTF-8"}).data);else{for(var a=!1,i=0;i<n.length;i++)if("pre"===n[i].tagName.toLowerCase()){a=!0,t=n[i].outerText.trim(),u(Papa.parse(t,{header:!0,encoding:"UTF-8"}).data);break}a||o()}},a.onerror=function(e){o()}}else Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(e){l(e),u(e.data)},beforeFirstChunk:function(e){return e.replace(/^\s+/,"")}});function i(e,t,n){for(var o={dataObj:{},notes:null},r=0;r<e.length;r++){var a=e[r].split(":");a.length<1||"NoteType"===a[0]||n.indexOf(a[0])>-1||!a[1]||""===a[1]||("Notes"===a[0]?o.notes?o.notes+="\n"+a[1]:o.notes=a[1]:t.hasOwnProperty(a[0])?o.dataObj[t[a[0]]]=a[1]:(o.notes?o.notes+="\n":o.notes="",o.notes+=a[0]+": "+a[1]))}return o}function c(e){var t={cardholderName:e.ccname&&""!==e.ccname?e.ccname:null,number:e.ccnum&&""!==e.ccnum?e.ccnum:null,brand:e.ccnum&&""!==e.ccnum?function(e){if(!e)return null;var t=new RegExp("^4");return null!=e.match(t)?"Visa":/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(e)?"Mastercard":(t=new RegExp("^3[47]"),null!=e.match(t)?"Amex":(t=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=e.match(t)?"Discover":(t=new RegExp("^36"),null!=e.match(t)?"Diners Club":(t=new RegExp("^30[0-5]"),null!=e.match(t)?"Diners Club":(t=new RegExp("^35(2[89]|[3-8][0-9])"),null!=e.match(t)?"JCB":(t=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=e.match(t)?"Visa":null))))))}(e.ccnum):null,code:e.cccsc&&""!==e.cccsc?e.cccsc:null};if(e.ccexp&&""!==e.ccexp&&e.ccexp.indexOf("-")>-1){var n=e.ccexp.split("-");n.length>1&&(t.expYear=n[0],t.expMonth=n[1],2===t.expMonth.length&&"0"===t.expMonth[0]&&(t.expMonth=t.expMonth[1]))}return t}function u(t){var o=[],a=[],l=[],u=0;angular.forEach(t,function(t,n){var d,p=o.length,m=a.length,g=t.grouping&&""!==t.grouping&&"(none)"!==t.grouping,f=g;if(g)for(u=0;u<o.length;u++)if(o[u].name===t.grouping){f=!1,p=u;break}if(t.hasOwnProperty("profilename")&&t.hasOwnProperty("profilelanguage")?(d={favorite:!1,name:t.profilename&&""!==t.profilename?t.profilename:"--",type:e.cipherType.card},""===t.title&&""===t.firstname&&""===t.lastname&&""===t.address1&&""===t.phone&&""===t.username&&""===t.email||(d.type=e.cipherType.identity)):d={favorite:!r&&"1"===t.fav,name:t.name&&""!==t.name?t.name:"--",type:"http://sn"===t.url?e.cipherType.secureNote:e.cipherType.login},d.type===e.cipherType.login)d.login={uri:t.url&&""!==t.url?s(t.url):null,username:t.username&&""!==t.username?t.username:null,password:t.password&&""!==t.password?t.password:null},d.notes=t.extra&&""!==t.extra?t.extra:null;else if(d.type===e.cipherType.secureNote){var h=t.extra.split(/(?:\r\n|\r|\n)/),v=!1;if(h.length){var y=h[0].split(":");if(y.length>1&&"NoteType"===y[0]&&("Credit Card"===y[1]||"Address"===y[1])){var b=null;"Credit Card"===y[1]?(b=i(h,{Number:"number","Name on Card":"cardholderName","Security Code":"code"},[]),d.type=e.cipherType.card,d.card=b.dataObj):"Address"===y[1]&&(b=i(h,{Title:"title","First Name":"firstName","Last Name":"lastName","Middle Name":"middleName",Company:"company","Address 1":"address1","Address 2":"address2","Address 3":"address3","City / Town":"city",State:"state","Zip / Postal Code":"postalCode",Country:"country","Email Address":"email",Username:"username"},[]),d.type=e.cipherType.identity,d.identity=b.dataObj),v=!0,d.notes=b.notes}}v||(d.secureNote={type:0},d.notes=t.extra&&""!==t.extra?t.extra:null)}else if(d.type===e.cipherType.card)d.card=c(t),d.notes=t.notes&&""!==t.notes?t.notes:null;else if(d.type===e.cipherType.identity&&(d.identity={title:t.title&&""!==t.title?t.title:null,firstName:t.firstname&&""!==t.firstname?t.firstname:null,middleName:t.middlename&&""!==t.middlename?t.middlename:null,lastName:t.lastname&&""!==t.lastname?t.lastname:null,username:t.username&&""!==t.username?t.username:null,company:t.company&&""!==t.company?t.company:null,ssn:t.ssn&&""!==t.ssn?t.ssn:null,address1:t.address1&&""!==t.address1?t.address1:null,address2:t.address2&&""!==t.address2?t.address2:null,address3:t.address3&&""!==t.address3?t.address3:null,city:t.city&&""!==t.city?t.city:null,state:t.state&&""!==t.state?t.state:null,postalCode:t.zip&&""!==t.zip?t.zip:null,country:t.country&&""!==t.country?t.country:null,email:t.email&&""!==t.email?t.email:null,phone:t.phone&&""!==t.phone?t.phone:null},d.notes=t.notes&&""!==t.notes?t.notes:null,d.identity.title&&(d.identity.title=d.identity.title.charAt(0).toUpperCase()+d.identity.title.slice(1)),t.ccnum&&""!==t.ccnum)){var w=JSON.parse(JSON.stringify(d));w.identity=null,w.type=e.cipherType.card,w.card=c(t),a.push(w)}if(a.push(d),f&&o.push({name:t.grouping}),g){var C={key:m,value:p};l.push(C)}}),n(o,a,l)}}return t}]),angular.module("bit.services").factory("passwordService",function(){var e={};function t(e,n){var o=0,r=n-e,a=Math.ceil(Math.log2(r));if(a>53)throw new Exception("We cannot generate numbers larger than 53 bits.");var i=Math.ceil(a/8),s=Math.pow(2,a)-1,l=new Uint8Array(i);window.crypto.getRandomValues(l);for(var c=8*(i-1),u=0;u<i;u++)o+=l[u]*Math.pow(2,c),c-=8;return(o&=s)>=r?t(e,n):e+o}return e.generatePassword=function(e){var n=angular.extend({},{length:10,ambiguous:!1,number:!0,minNumber:1,uppercase:!0,minUppercase:1,lowercase:!0,minLowercase:1,special:!1,minSpecial:1},e);n.uppercase&&n.minUppercase<0&&(n.minUppercase=1),n.lowercase&&n.minLowercase<0&&(n.minLowercase=1),n.number&&n.minNumber<0&&(n.minNumber=1),n.special&&n.minSpecial<0&&(n.minSpecial=1),(!n.length||n.length<1)&&(n.length=10);var o=n.minUppercase+n.minLowercase+n.minNumber+n.minSpecial;n.length<o&&(n.length=o);var r=[];if(n.lowercase&&n.minLowercase>0)for(var a=0;a<n.minLowercase;a++)r.push("l");if(n.uppercase&&n.minUppercase>0)for(var i=0;i<n.minUppercase;i++)r.push("u");if(n.number&&n.minNumber>0)for(var s=0;s<n.minNumber;s++)r.push("n");if(n.special&&n.minSpecial>0)for(var l=0;l<n.minSpecial;l++)r.push("s");for(;r.length<n.length;)r.push("a");r.sort(function(){return 2*t(0,1)-1});var c="",u="abcdefghijkmnopqrstuvwxyz";n.ambiguous&&(u+="l"),n.lowercase&&(c+=u);var d="ABCDEFGHIJKLMNPQRSTUVWXYZ";n.ambiguous&&(d+="O"),n.uppercase&&(c+=d);var p="23456789";n.ambiguous&&(p+="01"),n.number&&(c+=p);var m="!@#$%^&*";n.special&&(c+=m);for(var g="",f=0;f<n.length;f++){var h;switch(r[f]){case"l":h=u;break;case"u":h=d;break;case"n":h=p;break;case"s":h=m;break;case"a":h=c}var v=t(0,h.length-1);g+=h.charAt(v)}return g},e}),angular.module("bit.services").factory("tokenService",["$sessionStorage","$localStorage","jwtHelper",function(e,t,n){var o={},r=null,a=null;return o.setToken=function(t){e.accessToken=t,r=t},o.getToken=function(){return r||(r=e.accessToken),r||null},o.clearToken=function(){r=null,delete e.accessToken},o.setRefreshToken=function(t){e.refreshToken=t,a=t},o.getRefreshToken=function(){return a||(a=e.refreshToken),a||null},o.clearRefreshToken=function(){a=null,delete e.refreshToken},o.setTwoFactorToken=function(e,n){t.twoFactor||(t.twoFactor={}),t.twoFactor[n]=e},o.getTwoFactorToken=function(e){return t.twoFactor?t.twoFactor[e]:null},o.clearTwoFactorToken=function(e){e?t.twoFactor&&t.twoFactor[e]&&delete t.twoFactor[e]:delete t.twoFactor},o.clearTokens=function(){o.clearToken(),o.clearRefreshToken()},o.tokenSecondsRemaining=function(e,t){var o=n.getTokenExpirationDate(e);if(t=t||0,null===o)return 0;var r=o.valueOf()-((new Date).valueOf()+1e3*t);return Math.round(r/1e3)},o.tokenNeedsRefresh=function(e,t){return t=t||5,o.tokenSecondsRemaining(e)<60*t},o}]),angular.module("bit.services").factory("utilsService",["constants",function(e){var t,n={};return n.getDeviceType=function(n){return t||(t=navigator.userAgent.indexOf(" Vivaldi/")>=0?e.deviceType.vivaldi:window.chrome&&window.chrome.webstore?e.deviceType.chrome:"undefined"!=typeof InstallTrigger?e.deviceType.firefox:window.opr&&opr.addons||window.opera||navigator.userAgent.indexOf(" OPR/")>=0?e.deviceType.firefox:/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString()?e.deviceType.opera:document.documentMode?e.deviceType.ie:window.StyleMedia?e.deviceType.edge:e.deviceType.unknown)},n}]),angular.module("bit.services").factory("validationService",function(){var e={addErrors:function(t,n){var o=n.data,r="An unexpected error has occurred.";if(t.$errors=[],o&&angular.isObject(o))if(o&&o.ErrorModel&&(o=o.ErrorModel),o.ValidationErrors){for(var a in o.ValidationErrors)if(o.ValidationErrors.hasOwnProperty(a))for(var i=0;i<o.ValidationErrors[a].length;i++)e.addError(t,a,o.ValidationErrors[a][i])}else o.Message?t.$errors.push(o.Message):t.$errors.push(r);else t.$errors.push(r)},addError:function(e,t,n,o){!o&&e.$errors||(e.$errors=[]);for(var r=!0,a=0;a<e.$errors.length;a++)if(e.$errors[a]===n){r=!1;break}r&&e.$errors.push(n),t&&""!==t&&e[t]&&e[t].$registerApiError&&e[t].$registerApiError()},parseErrors:function(e){var t=e.data,n="An unexpected error has occurred.",o=[];if(!t||!angular.isObject(t))return o.push(n),o;for(var r in t&&t.ErrorModel&&(t=t.ErrorModel),t.ValidationErrors||(t.Message?o.push(t.Message):o.push(n)),t.ValidationErrors)if(t.ValidationErrors.hasOwnProperty(r))for(var a=0;a<t.ValidationErrors[r].length;a++)o.push(t.ValidationErrors[r][a]);return o}};return e}),angular.module("bit.vault").controller("settingsAddEditEquivalentDomainController",["$scope","$uibModalInstance","$analytics","domainIndex","domains",function(e,t,n,o,r){n.eventTrack("settingsAddEditEquivalentDomainController",{category:"Modal"}),e.domains=r,e.index=o,e.submit=function(r){n.eventTrack((o?"Edited":"Added")+" Equivalent Domain"),t.close({domains:e.domains,index:o})},e.close=function(){t.dismiss("close")}}]),angular.module("bit.settings").controller("settingsBillingAdjustStorageController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","add",function(e,t,n,o,r,a,i){r.eventTrack("settingsBillingAdjustStorageController",{category:"Modal"}),e.add=i,e.storageAdjustment=0,e.submit=function(){var t={storageGbAdjustment:e.storageAdjustment};i||(t.storageGbAdjustment*=-1),e.submitPromise=o.accounts.putStorage(null,t).$promise.then(function(t){i?(r.eventTrack("Added Storage"),a.success("You have added "+e.storageAdjustment+" GB.")):(r.eventTrack("Removed Storage"),a.success("You have removed "+e.storageAdjustment+" GB.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("settingsBillingChangePaymentController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","existingPaymentMethod","appSettings","$timeout",function(e,t,n,o,r,a,i,s,l){r.eventTrack("settingsBillingChangePaymentController",{category:"Modal"}),e.existingPaymentMethod=i,e.paymentMethod="card",e.dropinLoaded=!1,e.showPaymentOptions=!1,e.hideBank=!0,e.card={};var c=null;e.changePaymentMethod=function(t){e.paymentMethod=t,"paypal"===e.paymentMethod&&braintree.dropin.create({authorization:s.braintreeKey,container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue"}}},function(t,n){t?console.error(t):(c=n,l(function(){e.dropinLoaded=!0}))})},e.submit=function(){var t;e.submitPromise=(t=e.card,"paypal"===e.paymentMethod?c.requestPaymentMethod().then(function(e){return e.nonce}).catch(function(e){throw e.message}):stripe.card.createToken(t).then(function(e){return e.id}).catch(function(e){throw e.message})).then(function(e){if(!e)throw"No payment token.";var t={paymentToken:e};return o.accounts.putPayment(null,t).$promise},function(e){throw e}).then(function(t){e.card=null,i?(r.eventTrack("Changed Payment Method"),a.success("You have changed your payment method.")):(r.eventTrack("Added Payment Method"),a.success("You have added a payment method.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsBillingController",["$scope","apiService","authService","$state","$uibModal","toastr","$analytics","appSettings",function(e,t,n,o,r,a,i,s){e.selfHosted=s.selfHosted,e.charges=[],e.paymentSource=null,e.subscription=null,e.loading=!0;var l=null;function c(){n.getUserProfile().then(function(n){return e.premium=n.premium,n.premium?t.accounts.getBilling({}).$promise:null}).then(function(t){if(!t)return o.go("backend.user.settingsPremium");var n=0;if(e.expiration=t.Expiration,l=t.License,e.storage=null,t&&t.MaxStorageGb&&(e.storage={currentGb:t.StorageGb||0,maxGb:t.MaxStorageGb,currentName:t.StorageName||"0 GB"},e.storage.percentage=+(e.storage.currentGb/e.storage.maxGb*100).toFixed(2)),e.subscription=null,t&&t.Subscription&&(e.subscription={trialEndDate:t.Subscription.TrialEndDate,cancelledDate:t.Subscription.CancelledDate,status:t.Subscription.Status,cancelled:t.Subscription.Cancelled,markedForCancel:!t.Subscription.Cancelled&&t.Subscription.CancelAtEndDate}),e.nextInvoice=null,t&&t.UpcomingInvoice&&(e.nextInvoice={date:t.UpcomingInvoice.Date,amount:t.UpcomingInvoice.Amount}),t&&t.Subscription&&t.Subscription.Items)for(e.subscription.items=[],n=0;n<t.Subscription.Items.length;n++)e.subscription.items.push({amount:t.Subscription.Items[n].Amount,name:t.Subscription.Items[n].Name,interval:t.Subscription.Items[n].Interval,qty:t.Subscription.Items[n].Quantity});e.paymentSource=null,t&&t.PaymentSource&&(e.paymentSource={type:t.PaymentSource.Type,description:t.PaymentSource.Description,cardBrand:t.PaymentSource.CardBrand});var r=[];if(t&&t.Charges)for(n=0;n<t.Charges.length;n++)r.push({date:t.Charges[n].CreatedDate,paymentSource:t.Charges[n].PaymentSource?t.Charges[n].PaymentSource.Description:"-",amount:t.Charges[n].Amount,status:t.Charges[n].Status,failureMessage:t.Charges[n].FailureMessage,refunded:t.Charges[n].Refunded,partiallyRefunded:t.Charges[n].PartiallyRefunded,refundedAmount:t.Charges[n].RefundedAmount,invoiceId:t.Charges[n].InvoiceId});e.charges=r,e.loading=!1})}e.expiration=null,e.$on("$viewContentLoaded",function(){c()}),e.changePayment=function(){e.selfHosted||r.open({animation:!0,templateUrl:"app/settings/views/settingsBillingChangePayment.html",controller:"settingsBillingChangePaymentController",resolve:{existingPaymentMethod:function(){return e.paymentSource?e.paymentSource.description:null}}}).result.then(function(){c()})},e.adjustStorage=function(t){e.selfHosted||r.open({animation:!0,templateUrl:"app/settings/views/settingsBillingAdjustStorage.html",controller:"settingsBillingAdjustStorageController",resolve:{add:function(){return t}}}).result.then(function(){c()})},e.cancel=function(){e.selfHosted||confirm("Are you sure you want to cancel? You will lose access to all premium features at the end of this billing cycle.")&&t.accounts.putCancelPremium({},{}).$promise.then(function(e){i.eventTrack("Canceled Premium"),a.success("Premium subscription has been canceled."),c()})},e.reinstate=function(){e.selfHosted||confirm("Are you sure you want to remove the cancellation request and reinstate your premium membership?")&&t.accounts.putReinstatePremium({},{}).$promise.then(function(e){i.eventTrack("Reinstated Premium"),a.success("Premium cancellation request has been removed."),c()})},e.updateLicense=function(){e.selfHosted&&r.open({animation:!0,templateUrl:"app/settings/views/settingsBillingUpdateLicense.html",controller:"settingsBillingUpdateLicenseController"}).result.then(function(){c()})},e.license=function(){if(!e.selfHosted){var t=JSON.stringify(l,null,2),n=new Blob([t]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(n,"bitwarden_premium_license.json");else{var o=window.document.createElement("a");o.href=window.URL.createObjectURL(n,{type:"text/plain"}),o.download="bitwarden_premium_license.json",document.body.appendChild(o),o.click(),document.body.removeChild(o)}}}}]),angular.module("bit.settings").controller("settingsBillingUpdateLicenseController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","validationService",function(e,t,n,o,r,a,i){r.eventTrack("settingsBillingUpdateLicenseController",{category:"Modal"}),e.submit=function(t){var s=document.getElementById("file").files;if(s&&s.length){var l=new FormData;l.append("license",s[0]),e.submitPromise=o.accounts.putLicense(l).$promise.then(function(e){r.eventTrack("Updated License"),a.success("You have updated your license."),n.close()})}else i.addError(t,"file","Select a license file.",!0)},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsChangeEmailController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","validationService",function(e,t,n,o,r,a,i,s,l){var c,u,d;s.eventTrack("settingsChangeEmailController",{category:"Modal"}),e.token=function(t,o){r.getEncKey()?(u=t.masterPassword,d=t.newEmail.toLowerCase(),e.tokenPromise=r.hashPassword(u).then(function(t){var o={newEmail:d,masterPasswordHash:c=t};return n.accounts.emailToken(o,function(){e.tokenSent=!0}).$promise})):l.addError(o,null,"You cannot change your email until you update your encryption key.",!0)},e.confirm=function(l){e.confirmPromise=r.makeKeyAndHash(d,u).then(function(e){var t=r.getEncKey(),o=r.encrypt(t.key,e.key,"raw"),a={token:l.token,newEmail:d,masterPasswordHash:c,newMasterPasswordHash:e.hash,key:o};return n.accounts.email(a).$promise}).then(function(){return o.dismiss("cancel"),a.logOut(),s.eventTrack("Changed Email"),t.go("frontend.login.info")}).then(function(){i.success("Please log back in.","Email Changed")})},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsChangePasswordController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","validationService","toastr","$analytics",function(e,t,n,o,r,a,i,s,l){l.eventTrack("settingsChangePasswordController",{category:"Modal"}),e.save=function(c,u){var d,p=!1;(r.getEncKey()||(i.addError(u,null,"You cannot change your master password until you update your encryption key.",!0),p=!0),e.model.newMasterPassword.length<8&&(i.addError(u,"NewMasterPasswordHash","Master password must be at least 8 characters long.",!0),p=!0),e.model.newMasterPassword!==e.model.confirmNewMasterPassword&&(i.addError(u,"ConfirmNewMasterPasswordHash","New master password confirmation does not match.",!0),p=!0),p)||(e.savePromise=a.getUserProfile().then(function(e){return r.makeKeyAndHash(e.email,c.newMasterPassword)}).then(function(e){return d=e,r.hashPassword(c.masterPassword)}).then(function(e){var t=r.getEncKey(),o=r.encrypt(t.key,d.key,"raw"),a={masterPasswordHash:e,newMasterPasswordHash:d.hash,key:o};return n.accounts.putPassword(a).$promise}).then(function(){return o.dismiss("cancel"),a.logOut(),l.eventTrack("Changed Password"),t.go("frontend.login.info")}).then(function(){s.success("Please log back in.","Master Password Changed")}))},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsController",["$scope","$state","$uibModal","apiService","toastr","authService","$localStorage","$rootScope","cipherService",function(e,t,n,o,r,a,i,s,l){function c(){$("html, body").animate({scrollTop:0},200)}e.model={profile:{},email:null,disableWebsiteIcons:!1},e.$on("$viewContentLoaded",function(){o.accounts.getProfile({},function(t){if(e.model={profile:{name:t.Name,masterPasswordHint:t.MasterPasswordHint,culture:t.Culture},email:t.Email,disableWebsiteIcons:i.disableWebsiteIcons},t.Organizations){for(var n=[],o=0;o<t.Organizations.length;o++)2===t.Organizations[o].Status&&n.push({id:t.Organizations[o].Id,name:t.Organizations[o].Name,status:t.Organizations[o].Status,type:t.Organizations[o].Type,enabled:t.Organizations[o].Enabled});e.model.organizations=n}})}),e.generalSave=function(){e.generalPromise=o.accounts.putProfile({},e.model.profile,function(e){a.setUserProfile(e).then(function(e){r.success("Account has been updated.","Success!")})}).$promise},e.passwordHintSave=function(){e.passwordHintPromise=o.accounts.putProfile({},e.model.profile,function(e){a.setUserProfile(e).then(function(e){r.success("Account has been updated.","Success!")})}).$promise},e.optionsSave=function(){i.disableWebsiteIcons=l.disableWebsiteIcons=e.model.disableWebsiteIcons,s.vaultCiphers=null,r.success("Options have been updated.","Success!")},e.changePassword=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsChangePassword.html",controller:"settingsChangePasswordController"})},e.changeEmail=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsChangeEmail.html",controller:"settingsChangeEmailController"})},e.viewOrganization=function(e){if(2===e.type)return c(),void r.error("You cannot manage this organization.");t.go("backend.org.dashboard",{orgId:e.id})},e.leaveOrganization=function(t){confirm("Are you sure you want to leave this organization ("+t.name+")?")&&o.organizations.postLeave({id:t.id},{},function(n){a.refreshAccessToken().then(function(){var n=e.model.organizations.indexOf(t);n>-1&&e.model.organizations.splice(n,1),r.success("You have left the organization."),c()})},function(e){r.error("Unable to leave this organization."),c()})},e.sessions=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsSessions.html",controller:"settingsSessionsController"})},e.delete=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsDelete.html",controller:"settingsDeleteController"})},e.purge=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsPurge.html",controller:"settingsPurgeController"})}}]),angular.module("bit.settings").controller("settingsCreateOrganizationController",["$scope","$state","apiService","cryptoService","toastr","$analytics","authService","constants","appSettings","validationService",function(e,t,n,o,r,a,i,s,l,c){e.plans=s.plans,e.storageGb=s.storageGb,e.paymentMethod="card",e.selfHosted=l.selfHosted,e.model={plan:"free",additionalSeats:0,interval:"year",ownedBusiness:!1,additionalStorageGb:null},e.totalPrice=function(){return"month"===e.model.interval?(e.model.additionalSeats||0)*(e.plans[e.model.plan].monthlySeatPrice||0)+(e.model.additionalStorageGb||0)*e.storageGb.monthlyPrice+(e.plans[e.model.plan].monthlyBasePrice||0):(e.model.additionalSeats||0)*(e.plans[e.model.plan].annualSeatPrice||0)+(e.model.additionalStorageGb||0)*e.storageGb.yearlyPrice+(e.plans[e.model.plan].annualBasePrice||0)},e.changePaymentMethod=function(t){e.paymentMethod=t},e.changedPlan=function(){e.plans[e.model.plan].hasOwnProperty("monthPlanType")&&(e.model.interval="year"),e.plans[e.model.plan].noAdditionalSeats?e.model.additionalSeats=0:e.model.additionalSeats||e.plans[e.model.plan].baseSeats||e.plans[e.model.plan].noAdditionalSeats||(e.model.additionalSeats=1)},e.changedBusiness=function(){e.model.ownedBusiness&&(e.model.plan="teams")},e.submit=function(s,l){var u=o.makeShareKey(),d=o.encrypt("Default Collection",u.key);if(e.selfHosted){var p=document.getElementById("file").files;if(!p||!p.length)return void c.addError(l,"file","Select a license file.",!0);var m=new FormData;m.append("license",p[0]),m.append("key",u.ct),m.append("collectionName",d),e.submitPromise=n.organizations.postLicense(m).$promise.then(h)}else if("free"===s.plan){var g={name:s.name,planType:s.plan,key:u.ct,billingEmail:s.billingEmail,collectionName:d};e.submitPromise=n.organizations.post(g).$promise.then(h)}else{var f=null;if("card"===e.paymentMethod)f=stripe.card.createToken(s.card);else{if("bank"!==e.paymentMethod)return;s.bank.currency="USD",s.bank.country="US",f=stripe.bankAccount.createToken(s.bank)}e.submitPromise=f.then(function(t){var o={name:s.name,planType:"month"===s.interval?e.plans[s.plan].monthPlanType:e.plans[s.plan].annualPlanType,key:u.ct,paymentToken:t.id,additionalSeats:s.additionalSeats,additionalStorageGb:s.additionalStorageGb,billingEmail:s.billingEmail,businessName:s.ownedBusiness?s.businessName:null,country:"card"===e.paymentMethod?s.card.address_country:null,collectionName:d};return n.organizations.post(o).$promise},function(e){throw e.message}).then(h)}function h(e){a.eventTrack("Created Organization"),i.addProfileOrganizationOwner(e,u.ct),i.refreshAccessToken().then(function(){v(e.Id)},function(){v(e.Id)})}function v(e){t.go("backend.org.dashboard",{orgId:e}).then(function(){r.success("Your new organization is ready to go!","Organization Created")})}}}]),angular.module("bit.settings").controller("settingsDeleteController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","tokenService",function(e,t,n,o,r,a,i,s,l){s.eventTrack("settingsDeleteController",{category:"Modal"}),e.submit=function(c){var u;e.submitPromise=a.getUserProfile().then(function(e){return u=e,r.hashPassword(c.masterPassword)}).then(function(e){return n.accounts.postDelete({masterPasswordHash:e}).$promise}).then(function(){return o.dismiss("cancel"),a.logOut(),l.clearTwoFactorToken(u.email),s.eventTrack("Deleted Account"),t.go("frontend.login.info")}).then(function(){i.success("Your account has been closed and all associated data has been deleted.","Account Deleted")})},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsDomainsController",["$scope","$state","apiService","toastr","$analytics","$uibModal",function(e,t,n,o,r,a){e.globalEquivalentDomains=[],e.equivalentDomains=[],n.settings.getDomains({},function(t){var n;if(t.EquivalentDomains)for(n=0;n<t.EquivalentDomains.length;n++)e.equivalentDomains.push(t.EquivalentDomains[n].join(", "));if(t.GlobalEquivalentDomains)for(n=0;n<t.GlobalEquivalentDomains.length;n++)e.globalEquivalentDomains.push({domains:t.GlobalEquivalentDomains[n].Domains.join(", "),excluded:t.GlobalEquivalentDomains[n].Excluded,key:t.GlobalEquivalentDomains[n].Type})}),e.toggleExclude=function(e){e.excluded=!e.excluded},e.customize=function(t){t.excluded=!0,e.equivalentDomains.push(t.domains)},e.delete=function(t){e.equivalentDomains.splice(t,1),e.$emit("removeAppendedDropdownMenu")},e.addEdit=function(t){a.open({animation:!0,templateUrl:"app/settings/views/settingsAddEditEquivalentDomain.html",controller:"settingsAddEditEquivalentDomainController",resolve:{domainIndex:function(){return t},domains:function(){return null!==t?e.equivalentDomains[t]:null}}}).result.then(function(t){t.domains&&(t.domains=t.domains.split(" ").join("").split(",").join(", ")),null!==t.index?e.equivalentDomains[t.index]=t.domains:e.equivalentDomains.push(t.domains)})},e.saveGlobal=function(){e.globalPromise=i()},e.saveCustom=function(){e.customPromise=i()};var i=function(){for(var t={ExcludedGlobalEquivalentDomains:[],EquivalentDomains:[]},a=0;a<e.globalEquivalentDomains.length;a++)e.globalEquivalentDomains[a].excluded&&t.ExcludedGlobalEquivalentDomains.push(e.globalEquivalentDomains[a].key);for(a=0;a<e.equivalentDomains.length;a++)t.EquivalentDomains.push(e.equivalentDomains[a].split(" ").join("").split(","));return t.EquivalentDomains.length||(t.EquivalentDomains=null),t.ExcludedGlobalEquivalentDomains.length||(t.ExcludedGlobalEquivalentDomains=null),n.settings.putDomains(t,function(e){r.eventTrack("Saved Equivalent Domains"),o.success("Domains have been updated.","Success!")}).$promise}}]),angular.module("bit.settings").controller("settingsPremiumController",["$scope","$state","apiService","toastr","$analytics","authService","constants","$timeout","appSettings","validationService",function(e,t,n,o,r,a,i,s,l,c){var u=null;a.getUserProfile().then(function(e){if((u=e)&&u.premium)return t.go("backend.user.settingsBilling")}),e.selfHosted=l.selfHosted;var d=null;function p(){return a.updateProfilePremium(!0).then(function(){return r.eventTrack("Signed Up Premium"),a.refreshAccessToken()}).then(function(){return t.go("backend.user.settingsBilling")}).then(function(){o.success("Premium upgrade complete.","Success")})}e.storageGbPrice=i.storageGb.yearlyPrice,e.premiumPrice=i.premium.price,e.paymentMethod="card",e.dropinLoaded=!1,e.model={additionalStorageGb:null},e.changePaymentMethod=function(t){e.paymentMethod=t,"paypal"===e.paymentMethod&&braintree.dropin.create({authorization:l.braintreeKey,container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue"}}},function(t,n){t?console.error(t):(d=n,s(function(){e.dropinLoaded=!0}))})},e.totalPrice=function(){return e.premiumPrice+(e.model.additionalStorageGb||0)*e.storageGbPrice},e.submit=function(t,o){if(e.selfHosted){if(u&&!u.emailVerified)return void c.addError(o,null,"Your account's email address first must be verified.",!0);var r=document.getElementById("file").files;if(!r||!r.length)return void c.addError(o,"file","Select a license file.",!0);var a=new FormData;a.append("license",r[0]),e.submitPromise=n.accounts.postPremium(a).$promise.then(function(e){return p()})}else e.submitPromise=(i=t,"paypal"===e.paymentMethod?d.requestPaymentMethod().then(function(e){return e.nonce}).catch(function(e){throw e.message}):stripe.card.createToken(i.card).then(function(e){return e.id}).catch(function(e){throw e.message})).then(function(e){if(!e)throw"No payment token.";var o=new FormData;return o.append("paymentToken",e),o.append("additionalStorageGb",t.additionalStorageGb||0),n.accounts.postPremium(o).$promise},function(e){throw e}).then(function(e){return p()});var i}}]),angular.module("bit.settings").controller("settingsPurgeController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","tokenService",function(e,t,n,o,r,a,i,s,l){s.eventTrack("settingsPurgeController",{category:"Modal"}),e.submit=function(a){e.submitPromise=r.hashPassword(a.masterPassword).then(function(e){return n.ciphers.purge({masterPasswordHash:e}).$promise}).then(function(){return o.dismiss("cancel"),s.eventTrack("Purged Vault"),t.go("backend.user.vault",{refreshFromServer:!0})}).then(function(){i.success("All items in your vault have been deleted.","Vault Purged")})},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsSessionsController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","tokenService","toastr","$analytics",function(e,t,n,o,r,a,i,s,l){l.eventTrack("settingsSessionsController",{category:"Modal"}),e.submit=function(c){var u,d;e.submitPromise=r.hashPassword(c.masterPassword).then(function(e){return u=e,a.getUserProfile()}).then(function(e){return d=e,n.accounts.putSecurityStamp({masterPasswordHash:u}).$promise}).then(function(){return o.dismiss("cancel"),a.logOut(),i.clearTwoFactorToken(d.email),l.eventTrack("Deauthorized Sessions"),t.go("frontend.login.info")}).then(function(){s.success("Please log back in.","All Sessions Deauthorized")})},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsTwoStepAuthenticatorController",["$scope","apiService","$uibModalInstance","cryptoService","authService","$q","toastr","$analytics","constants","$timeout",function(e,t,n,o,r,a,i,s,l,c){s.eventTrack("settingsTwoStepAuthenticatorController",{category:"Modal"});var u,d="bitwarden",p=null,m=null;function g(t){var n;e.enabled=t.Enabled,m=t.Key,e.model={key:(n=m,n?n.replace(/(.{4})/g,"$1 ").trim().toUpperCase():null),qr:"https://chart.googleapis.com/chart?chs=160x160&chld=L|0&cht=qr&chl=otpauth://totp/"+d+":"+encodeURIComponent(p.email)+"%3Fsecret="+encodeURIComponent(m)+"%26issuer="+d},e.updateModel={token:null}}c(function(){$("#masterPassword").focus()}),e.auth=function(n){var a=null;e.authPromise=o.hashPassword(n.masterPassword).then(function(e){return u=e,t.twoFactor.getAuthenticator({},{masterPasswordHash:u}).$promise}).then(function(e){return a=e,r.getUserProfile()}).then(function(t){p=t,e.account=p.email,g(a)})},e.submit=function(n){var o;n&&n.token?(o=n,e.submitPromise=t.twoFactor.putAuthenticator({},{token:o.token.replace(" ",""),key:m,masterPasswordHash:u},function(e){s.eventTrack("Enabled Two-step Authenticator"),g(e),o.token=null}).$promise):function(){if(!confirm("Are you sure you want to disable the authenticator app provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:u,type:l.twoFactorProvider.authenticator},function(t){s.eventTrack("Disabled Two-step Authenticator"),i.success("Authenticator app has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}()};var f=!1;e.close=function(){f=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,o){f||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepController",["$scope","apiService","toastr","$analytics","constants","$filter","$uibModal","authService",function(e,t,n,o,r,a,i,s){e.providers=r.twoFactorProviderInfo,e.premium=!0,s.getUserProfile().then(function(n){return e.premium=n.premium,t.twoFactor.list({}).$promise}).then(function(t){if(t.Data)for(var n=0;n<t.Data.length;n++)if(t.Data[n].Enabled){var o=a("filter")(e.providers,{type:t.Data[n].Type});o.length&&(o[0].enabled=!0)}}),e.edit=function(t){if(e.premium||t.free){if(t.type===r.twoFactorProvider.authenticator)typeName="Authenticator";else if(t.type===r.twoFactorProvider.email)typeName="Email";else if(t.type===r.twoFactorProvider.yubikey)typeName="Yubi";else if(t.type===r.twoFactorProvider.duo)typeName="Duo";else{if(t.type!==r.twoFactorProvider.u2f)return;typeName="U2f"}i.open({animation:!0,templateUrl:"app/settings/views/settingsTwoStep"+typeName+".html",controller:"settingsTwoStep"+typeName+"Controller",resolve:{enabled:function(){return t.enabled}}}).result.then(function(e){(e||!1===e)&&(t.enabled=e)})}else i.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})},e.viewRecover=function(){i.open({animation:!0,templateUrl:"app/settings/views/settingsTwoStepRecover.html",controller:"settingsTwoStepRecoverController"})}}]),angular.module("bit.settings").controller("settingsTwoStepDuoController",["$scope","apiService","$uibModalInstance","cryptoService","toastr","$analytics","constants","$timeout",function(e,t,n,o,r,a,i,s){var l;function c(t){e.enabled=t.Enabled,e.updateModel={ikey:t.IntegrationKey,skey:t.SecretKey,host:t.Host}}a.eventTrack("settingsTwoStepDuoController",{category:"Modal"}),e.updateModel={token:null,host:null,ikey:null,skey:null},s(function(){$("#masterPassword").focus()}),e.auth=function(n){e.authPromise=o.hashPassword(n.masterPassword).then(function(e){return l=e,t.twoFactor.getDuo({},{masterPasswordHash:l}).$promise}).then(function(t){c(t),e.authed=!0})},e.submit=function(n){var o;e.enabled?function(){if(!confirm("Are you sure you want to disable the Duo provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:l,type:i.twoFactorProvider.duo},function(t){a.eventTrack("Disabled Two-step Duo"),r.success("Duo has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}():(o=n,e.submitPromise=t.twoFactor.putDuo({},{integrationKey:o.ikey,secretKey:o.skey,host:o.host,masterPasswordHash:l},function(e){a.eventTrack("Enabled Two-step Duo"),c(e)}).$promise)};var u=!1;e.close=function(){u=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,o){u||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepEmailController",["$scope","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","constants","$timeout",function(e,t,n,o,r,a,i,s,l){i.eventTrack("settingsTwoStepEmailController",{category:"Modal"});var c,u=null;e.updateModel={token:null,email:null},l(function(){$("#masterPassword").focus()}),e.auth=function(n){var a=null;e.authPromise=o.hashPassword(n.masterPassword).then(function(e){return c=e,t.twoFactor.getEmail({},{masterPasswordHash:c}).$promise}).then(function(e){return a=e,r.getUserProfile()}).then(function(t){u=t,e.enabled=a.Enabled,e.updateModel.email=e.enabled?a.Email:u.email,e.authed=!0})},e.sendEmail=function(n){if(e.emailError=!1,e.emailSuccess=!1,!n||!n.email||n.email.indexOf("@")<0)return e.emailError=!0,void(e.emailSuccess=!1);e.emailLoading=!0,t.twoFactor.sendEmail({},{masterPasswordHash:c,email:n.email},function(t){e.emailError=!1,e.emailSuccess=!0,e.emailLoading=!1},function(t){e.emailError=!0,e.emailSuccess=!1,e.emailLoading=!1})},e.submit=function(n){var o;n&&n.token?(o=n,e.submitPromise=t.twoFactor.putEmail({},{email:o.email.toLowerCase().trim(),token:o.token.replace(" ",""),masterPasswordHash:c},function(t){i.eventTrack("Enabled Two-step Email"),e.enabled=t.Enabled,o.email=t.Email,o.token=null}).$promise):function(){if(!confirm("Are you sure you want to disable the email provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:c,type:s.twoFactorProvider.email},function(t){i.eventTrack("Disabled Two-step Email"),a.success("Email has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}()};var d=!1;e.close=function(){d=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,o){d||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepRecoverController",["$scope","apiService","$uibModalInstance","cryptoService","$analytics","$timeout",function(e,t,n,o,r,a){r.eventTrack("settingsTwoStepRecoverController",{category:"Modal"}),e.code=null,e.auth=function(n){e.authPromise=o.hashPassword(n.masterPassword).then(function(e){return t.twoFactor.getRecover({},{masterPasswordHash:e}).$promise}).then(function(t){e.code=function(e){if(!e)return null;return e.replace(/(.{4})/g,"$1 ").trim().toUpperCase()}(t.Code),e.authed=!0})},a(function(){$("#masterPassword").focus()}),e.print=function(){if(e.code){r.eventTrack("Print Recovery Code");var t=window.open();t.document.write('<div style="font-size: 18px; text-align: center;"><p>bitwarden two-step login recovery code:</p><code style="font-family: Menlo, Monaco, Consolas, \'Courier New\', monospace;">'+e.code+'</code></div><p style="text-align: center;">'+new Date+"</p>"),t.print(),t.close()}},e.close=function(){n.close()}}]),angular.module("bit.settings").controller("settingsTwoStepU2fController",["$scope","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","constants","$timeout","$window",function(e,t,n,o,r,a,i,s,l,c){var u;i.eventTrack("settingsTwoStepU2fController",{category:"Modal"});var d=!1;e.deviceResponse=null,e.deviceListening=!1,e.deviceError=!1,l(function(){$("#masterPassword").focus()}),e.auth=function(n){e.authPromise=o.hashPassword(n.masterPassword).then(function(e){return u=e,t.twoFactor.getU2f({},{masterPasswordHash:u}).$promise}).then(function(t){return e.enabled=t.Enabled,e.challenge=t.Challenge,e.authed=!0,e.readDevice()})},e.readDevice=function(){d||e.enabled||(console.log("listening for key..."),e.deviceResponse=null,e.deviceError=!1,e.deviceListening=!0,c.u2f.register(e.challenge.AppId,[{version:e.challenge.Version,challenge:e.challenge.Challenge}],[],function(t){if(e.deviceListening=!1,5!==t.errorCode)return t.errorCode?(l(function(){e.deviceError=!0}),void console.log("error: "+t.errorCode)):void l(function(){e.deviceResponse=JSON.stringify(t)});e.readDevice()},10))},e.submit=function(){e.enabled?function(){if(!confirm("Are you sure you want to disable the U2F provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:u,type:s.twoFactorProvider.u2f},function(t){i.eventTrack("Disabled Two-step U2F"),a.success("U2F has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}():e.submitPromise=t.twoFactor.putU2f({},{deviceResponse:e.deviceResponse,masterPasswordHash:u},function(t){i.eventTrack("Enabled Two-step U2F"),e.enabled=t.Enabled,e.challenge=null,e.deviceResponse=null,e.deviceError=!1}).$promise},e.close=function(){d=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,o){d||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepYubiController",["$scope","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","constants","$timeout",function(e,t,n,o,r,a,i,s,l){i.eventTrack("settingsTwoStepYubiController",{category:"Modal"});var c;function u(t){e.enabled=t.Enabled,e.updateModel={key1:{key:t.Key1,existingKey:d(t.Key1,"*",44)},key2:{key:t.Key2,existingKey:d(t.Key2,"*",44)},key3:{key:t.Key3,existingKey:d(t.Key3,"*",44)},nfc:!0===t.Nfc||!t.Enabled}}function d(e,t,n){if(!e||!t||e.length>=n)return e;for(var o=(n-e.length)/t.length,r=0;r<o;r++)e+=t;return e}l(function(){$("#masterPassword").focus()}),e.auth=function(n){var a=null;e.authPromise=o.hashPassword(n.masterPassword).then(function(e){return c=e,t.twoFactor.getYubi({},{masterPasswordHash:c}).$promise}).then(function(e){return a=e,r.getUserProfile()}).then(function(t){t,u(a),e.authed=!0})},e.remove=function(e){e.key=null,e.existingKey=null},e.submit=function(n){e.submitPromise=t.twoFactor.putYubi({},{key1:n.key1.key,key2:n.key2.key,key3:n.key3.key,nfc:n.nfc,masterPasswordHash:c},function(e){i.eventTrack("Saved Two-step YubiKey"),a.success("YubiKey saved."),u(e)}).$promise},e.disable=function(){confirm("Are you sure you want to disable the YubiKey provider?")&&(e.disableLoading=!0,e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:c,type:s.twoFactorProvider.yubikey},function(t){e.disableLoading=!1,i.eventTrack("Disabled Two-step YubiKey"),a.success("YubiKey has been disabled."),e.enabled=t.Enabled,e.close()},function(t){a.error("Failed to disable."),e.disableLoading=!1}).$promise)};var p=!1;e.close=function(){p=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,o){p||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsUpdateKeyController",["$scope","$state","apiService","$uibModalInstance","cipherService","cryptoService","authService","validationService","toastr","$analytics","$q",function(e,t,n,o,r,a,i,s,l,c,u){c.eventTrack("settingsUpdateKeyController",{category:"Modal"}),e.save=function(d){a.getEncKey()?s.addError(d,"MasterPasswordHash","You do not need to update. You are already using the new encryption key.",!0):e.savePromise=a.hashPassword(e.masterPassword).then(function(e){return function(e){var t=a.makeEncKey(null),o=[],i=n.ciphers.list({},function(e){for(var n=[],a=0;a<e.Data.length;a++)e.Data[a].OrganizationId||n.push(e.Data[a]);var i=r.decryptCiphers(n);o=r.encryptCiphers(i,t.encKey)}).$promise,s=[],l=n.folders.list({},function(e){var n=r.decryptFolders(e.Data);s=r.encryptFolders(n,t.encKey)}).$promise,c=a.getPrivateKey("raw"),d=null;c&&(d=a.encrypt(c,t.encKey,"raw"));return u.all([i,l]).then(function(){var r={masterPasswordHash:e,ciphers:o,folders:s,privateKey:d,key:t.encKeyEnc};return n.accounts.putKey(r).$promise},function(){throw"Error while encrypting data."}).then(function(){a.setEncKey(t.encKey,null,!0)})}(e)}).then(function(){return o.dismiss("cancel"),i.logOut(),c.eventTrack("Key Updated"),t.go("frontend.login.info")},function(e){throw e||"Error occurred."}).then(function(){l.success("Please log back in. If you are using other bitwarden applications, log out and back in to those as well.","Key Updated",{timeOut:1e4})})},e.close=function(){o.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultAddCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","selectedFolder","$analytics","checkedFavorite","$rootScope","authService","$uibModal","constants","$filter",function(e,t,n,o,r,a,i,s,l,c,u,d,p,m){function g(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}s.eventTrack("vaultAddCipherController",{category:"Modal"}),e.folders=m("filter")(c.vaultGroupings,{folder:!0}),e.constants=p,e.selectedType=p.cipherType.login.toString(),e.cipher={folderId:i?i.id:null,favorite:!0===l,type:p.cipherType.login,login:{},identity:{},card:{},secureNote:{type:0}},u.getUserProfile().then(function(t){e.useTotp=t.premium}),e.typeChanged=function(){e.cipher.type=parseInt(e.selectedType)},e.savePromise=null,e.save=function(){var o=r.encryptCipher(e.cipher);e.savePromise=t.ciphers.post(o,function(e){s.eventTrack("Created Cipher");var t=r.decryptCipherPreview(e);n.close(t)}).$promise},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(s.eventTrack("Generated Password From Add"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addField=function(){e.cipher.fields||(e.cipher.fields=[]),e.cipher.fields.push({type:p.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.toggleFavorite=function(){e.cipher.favorite=!e.cipher.favorite},e.clipboardSuccess=function(e){e.clearSelection(),g(e)},e.clipboardError=function(e,t){t&&g(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.folderSort=function(e){return e.id?e.name.toLowerCase():""},e.close=function(){n.dismiss("close")},e.showUpgrade=function(){d.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}}]),angular.module("bit.vault").controller("vaultAddFolderController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","$analytics",function(e,t,n,o,r,a){a.eventTrack("vaultAddFolderController",{category:"Modal"}),e.savePromise=null,e.save=function(o){var i=r.encryptFolder(o);e.savePromise=t.folders.post(i,function(e){a.eventTrack("Created Folder");var t=r.decryptFolder(e);n.close(t)}).$promise},e.close=function(){n.dismiss("close")}}]),angular.module("bit.vault").controller("vaultAttachmentsController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","cipherId","$analytics","validationService","toastr","$timeout","authService","$uibModal",function(e,t,n,o,r,a,i,s,l,c,u,d){i.eventTrack("vaultAttachmentsController",{category:"Modal"}),e.cipher={},e.readOnly=!0,e.loading=!0,e.isPremium=!0,e.canUseAttachments=!0;var p=!1;function m(){return e.cipher.organizationId?o.getOrgKey(e.cipher.organizationId):null}u.getUserProfile().then(function(n){return e.isPremium=n.premium,t.ciphers.get({id:a}).$promise}).then(function(t){e.cipher=r.decryptCipher(t),e.readOnly=!e.cipher.edit,e.canUseAttachments=e.isPremium||e.cipher.organizationId,e.loading=!1},function(){e.loading=!1}),e.save=function(n){var o=document.getElementById("file"),c=o.files;c&&c.length?e.savePromise=r.encryptAttachmentFile(m(),c[0]).then(function(e){var n=new FormData,o=new Blob([e.data],{type:"application/octet-stream"});return n.append("data",o,e.fileName),t.ciphers.postAttachment({id:a},n).$promise}).then(function(t){i.eventTrack("Added Attachment"),e.cipher=r.decryptCipher(t),o.type="",o.type="file",o.value=""},function(e){var t=s.parseErrors(e);l.error(t.length?t[0]:"An error occurred.")}):s.addError(n,"file","Select a file.",!0)},e.download=function(t){if(t.loading=!0,!e.canUseAttachments)return t.loading=!1,void alert("Premium membership is required to use this feature.");r.downloadAndDecryptAttachment(m(),t,!0).then(function(e){c(function(){t.loading=!1})},function(){c(function(){t.loading=!1})})},e.remove=function(n){confirm("Are you sure you want to delete this attachment ("+n.fileName+")?")&&(n.loading=!0,t.ciphers.delAttachment({id:a,attachmentId:n.id}).$promise.then(function(){n.loading=!1,i.eventTrack("Deleted Attachment");var t=e.cipher.attachments.indexOf(n);t>-1&&e.cipher.attachments.splice(t,1)},function(){l.error("Cannot delete attachment."),n.loading=!1}))},e.close=function(){n.dismiss("cancel")},e.$on("modal.closing",function(t,o,r){p||(t.preventDefault(),p=!0,n.close(!!e.cipher.attachments&&e.cipher.attachments.length>0))}),e.showUpgrade=function(){d.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}}]),angular.module("bit.vault").controller("vaultCipherCollectionsController",["$scope","apiService","$uibModalInstance","cipherService","cipherId","$analytics",function(e,t,n,o,r,a){a.eventTrack("vaultCipherCollectionsController",{category:"Modal"}),e.cipher={},e.readOnly=!1,e.loadingCipher=!0,e.loadingCollections=!0,e.selectedCollections={},e.collections=[];var i=null;n.opened.then(function(){t.ciphers.getDetails({id:r}).$promise.then(function(t){if(e.loadingCipher=!1,e.readOnly=!t.Edit,t.Edit&&t.OrganizationId){1===t.Type&&(e.cipher=o.decryptCipherPreview(t));var n={};if(t.CollectionIds)for(var r=0;r<t.CollectionIds.length;r++)n[t.CollectionIds[r]]=null;return{cipher:t,cipherCollections:n}}return null}).then(function(n){return n?(i=n,t.collections.listMe({writeOnly:!0}).$promise):(e.loadingCollections=!1,!1)}).then(function(t){if(!1!==t){for(var n=[],r={},a=t.Data,s=0;s<a.length;s++)if(a[s].OrganizationId===i.cipher.OrganizationId){a[s].Id in i.cipherCollections&&(r[a[s].Id]=!0);var l=o.decryptCollection(a[s]);n.push(l)}e.loadingCollections=!1,e.collections=n,e.selectedCollections=r}})}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.collections.length;o++)n[e.collections[o].id]=!0;e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]=!0},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(){var o={collectionIds:[]};for(var i in e.selectedCollections)e.selectedCollections.hasOwnProperty(i)&&o.collectionIds.push(i);e.submitPromise=t.ciphers.putCollections({id:r},o).$promise.then(function(e){a.eventTrack("Edited Cipher Collections"),n.close({action:"collectionsEdit",collectionIds:o.collectionIds})})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultController",["$scope","$uibModal","apiService","$filter","cryptoService","authService","toastr","cipherService","$q","$localStorage","$timeout","$rootScope","$state","$analytics","constants","validationService",function(e,t,n,o,r,a,i,s,l,c,u,d,p,m,g,f){function h(t){d.vaultGroupings=o("orderBy")(t,["folder",b]);var n=o("filter")(d.vaultGroupings,{collection:!0});e.collectionCount=n.length,e.folderCount=t.length-n.length-1,n&&n.length&&(e.firstCollectionId=n[0].id)}function v(t){angular.forEach(d.vaultGroupings,function(e,n){e.collapsed=c.collapsedFolders&&(e.id||"none")in c.collapsedFolders,angular.forEach(t,function(t){t.favorite?t.sort=-1:e.folder&&t.folderId==e.id?t.sort=n:e.collection&&t.collectionIds.indexOf(e.id)>-1&&(t.sort=n)})}),d.vaultCiphers=e.ciphers=o("orderBy")(t,["sort","name","subTitle"]);var n=function(e,t){var n=[],o=0,r=e.length;for(;o<r;)n.push(e.slice(o,o+=t));return n}(d.vaultCiphers,400);if(n.length>0){e.ciphers=n[0];var r=200;angular.forEach(n,function(t,n){n>0&&u(function(){Array.prototype.push.apply(e.ciphers,t)},r+=200)})}}function y(){d.vaultCiphers=e.ciphers=o("orderBy")(d.vaultCiphers,["name","subTitle"])}function b(e){return e.id?e.name.toLowerCase():""}function w(e,t,n){return n.indexOf(e)===t}function C(){return $('input[name="cipherSelection"]:checked').map(function(){return $(this).val()}).get().filter(w)}function S(e){$('input[name="cipherSelection"]').prop("checked",e)}function k(t){var n=d.vaultCiphers.indexOf(t);n>-1&&d.vaultCiphers.splice(n,1),(n=e.ciphers.indexOf(t))>-1&&e.ciphers.splice(n,1)}e.loading=!0,e.ciphers=[],e.folderCount=0,e.collectionCount=0,e.firstCollectionId=null,e.constants=g,e.favoriteCollapsed=c.collapsedFolders&&"favorite"in c.collapsedFolders,e.groupingIdFilter=void 0,e.typeFilter=void 0,p.params.refreshFromServer&&(d.vaultGroupings=d.vaultCiphers=null),e.$on("$viewContentLoaded",function(){if($("#search").focus(),d.vaultGroupings&&d.vaultCiphers)return e.loading=!1,h(d.vaultGroupings),void v(d.vaultCiphers);var t,o,r,a,i;t=[{id:null,name:"No Folder",folder:!0}],o=n.collections.listMe({writeOnly:!1},function(e){for(var n=0;n<e.Data.length;n++){var o=s.decryptCollection(e.Data[n],null,!0);o.collection=!0,t.push(o)}}).$promise,r=n.folders.list({},function(e){for(var n=0;n<e.Data.length;n++){var o=s.decryptFolderPreview(e.Data[n]);o.folder=!0,t.push(o)}}).$promise,a=l.all([o,r]).then(function(){h(t)}),i=n.ciphers.list({},function(e){for(var t=[],n=0;n<e.Data.length;n++){var o=s.decryptCipherPreview(e.Data[n]);t.push(o)}a.then(function(){v(t)})}).$promise,l.all([i,a]).then(function(){e.loading=!1})}),e.clipboardError=function(e){alert("Your web browser does not support easy clipboard copying. Edit the item and copy it manually instead.")},e.collapseExpand=function(e,t){c.collapsedFolders||(c.collapsedFolders={});var n=t?"favorite":e.id||"none";n in c.collapsedFolders?delete c.collapsedFolders[n]:c.collapsedFolders[n]=!0},e.collapseAll=function(){if(c.collapsedFolders||(c.collapsedFolders={}),c.collapsedFolders.none=!0,c.collapsedFolders.favorite=!0,d.vaultGroupings)for(var e=0;e<d.vaultGroupings.length;e++)c.collapsedFolders[d.vaultGroupings[e].id]=!0;$(".box").addClass("collapsed-box"),$(".box .box-header button i.fa-minus").removeClass("fa-minus").addClass("fa-plus")},e.expandAll=function(){c.collapsedFolders&&delete c.collapsedFolders,$(".box").removeClass("collapsed-box"),$(".box-body").show(),$(".box .box-header button i.fa-plus").removeClass("fa-plus").addClass("fa-minus")},e.editCipher=function(n){t.open({animation:!0,templateUrl:"app/vault/views/vaultEditCipher.html",controller:"vaultEditCipherController",resolve:{cipherId:function(){return n.id}}}).result.then(function(t){if("edit"===t.action){var o=e.ciphers.indexOf(n);o>-1&&(t.data.collectionIds=d.vaultCiphers[o].collectionIds,d.vaultCiphers[o]=t.data),y()}else"partialEdit"===t.action?(n.folderId=t.data.folderId,n.favorite=t.data.favorite):"delete"===t.action&&k(n)})},e.$on("vaultAddCipher",function(t,n){e.addCipher()}),e.addCipher=function(e,n){t.open({animation:!0,templateUrl:"app/vault/views/vaultAddCipher.html",controller:"vaultAddCipherController",resolve:{selectedFolder:function(){return e&&e.folder?e:null},checkedFavorite:function(){return n}}}).result.then(function(e){d.vaultCiphers.push(e),y()})},e.deleteCipher=function(e){confirm("Are you sure you want to delete this item ("+e.name+")?")&&n.ciphers.del({id:e.id},function(){m.eventTrack("Deleted Item"),k(e)})},e.attachments=function(e){a.getUserProfile().then(function(t){return{isPremium:t.premium,orgUseStorage:e.organizationId&&!!t.organizations[e.organizationId].maxStorageGb}}).then(function(n){if(!e.hasAttachments){if(e.organizationId&&!n.orgUseStorage)return void t.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return e.organizationId}}});if(!e.organizationId&&!n.isPremium)return void t.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}e.organizationId||r.getEncKey()?t.open({animation:!0,templateUrl:"app/vault/views/vaultAttachments.html",controller:"vaultAttachmentsController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){e.hasAttachments=t}):i.error("You cannot use this feature until you update your encryption key.","Feature Unavailable")})},e.editFolder=function(e){t.open({animation:!0,templateUrl:"app/vault/views/vaultEditFolder.html",controller:"vaultEditFolderController",size:"sm",resolve:{folderId:function(){return e.id}}}).result.then(function(t){e.name=t.name})},e.$on("vaultAddFolder",function(t,n){e.addFolder()}),e.addFolder=function(){t.open({animation:!0,templateUrl:"app/vault/views/vaultAddFolder.html",controller:"vaultAddFolderController",size:"sm"}).result.then(function(e){e.folder=!0,d.vaultGroupings.push(e),h(d.vaultGroupings)})},e.deleteFolder=function(t){confirm("Are you sure you want to delete this folder ("+t.name+")?")&&n.folders.del({id:t.id},function(){m.eventTrack("Deleted Folder");var n=d.vaultGroupings.indexOf(t);n>-1&&(d.vaultGroupings.splice(n,1),e.folderCount--)})},e.canDeleteFolder=function(e){if(!e||!e.id||!d.vaultCiphers)return!1;var t=o("filter")(d.vaultCiphers,{folderId:e.id});return t&&0===t.length},e.share=function(e){t.open({animation:!0,templateUrl:"app/vault/views/vaultShareCipher.html",controller:"vaultShareCipherController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){e.organizationId=t})},e.editCollections=function(e){t.open({animation:!0,templateUrl:"app/vault/views/vaultCipherCollections.html",controller:"vaultCipherCollectionsController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){t.collectionIds&&!t.collectionIds.length?k(e):t.collectionIds&&(e.collectionIds=t.collectionIds)})},e.filterGrouping=function(t){e.groupingIdFilter=t.id,$.AdminLTE&&$.AdminLTE.layout&&u(function(){$.AdminLTE.layout.fix()},0)},e.filterType=function(t){e.typeFilter=t,$.AdminLTE&&$.AdminLTE.layout&&u(function(){$.AdminLTE.layout.fix()},0)},e.clearFilters=function(){e.groupingIdFilter=void 0,e.typeFilter=void 0,$.AdminLTE&&$.AdminLTE.layout&&u(function(){$.AdminLTE.layout.fix()},0)},e.groupingFilter=function(t){return void 0===e.groupingIdFilter||t.id===e.groupingIdFilter},e.cipherFilter=function(t){return function(n){var o=null===t;return!o&&t.folder&&n.folderId===t.id?o=!0:!o&&t.collection&&n.collectionIds.indexOf(t.id)>-1&&(o=!0),o&&(void 0===e.typeFilter||n.type===e.typeFilter)}},e.unselectAll=function(){S(!1)},e.selectFolder=function(e,t){$(t.currentTarget).closest(".box").find('input[name="cipherSelection"]').prop("checked",!0)},e.select=function(e){var t=$(e.currentTarget).closest("tr").find('input[name="cipherSelection"]');t.prop("checked",!t.prop("checked"))},e.bulkMove=function(){var e=C();0!==e.length?t.open({animation:!0,templateUrl:"app/vault/views/vaultMoveCiphers.html",controller:"vaultMoveCiphersController",size:"sm",resolve:{ids:function(){return e}}}).result.then(function(t){for(var n=0;n<e.length;n++){var r=o("filter")(d.vaultCiphers,{id:e[n]});r.length&&(r[0].folderId=t)}S(!1),y(),i.success("Items have been moved!")}):alert("You have not selected anything.")},e.bulkDelete=function(){var t=C();0!==t.length?confirm("Are you sure you want to delete the selected items (total: "+t.length+")?")&&(e.actionLoading=!0,n.ciphers.delMany({ids:t},function(){m.eventTrack("Bulk Deleted Items");for(var n=0;n<t.length;n++){var r=o("filter")(d.vaultCiphers,{id:t[n]});r.length&&r[0].edit&&k(r[0])}S(!1),e.actionLoading=!1,i.success("Items have been deleted!")},function(t){var n=f.parseErrors(t);i.error(n.length?n[0]:"An error occurred."),e.actionLoading=!1})):alert("You have not selected anything.")}}]),angular.module("bit.vault").controller("vaultEditCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","cipherId","$analytics","$rootScope","authService","$uibModal","constants","$filter",function(e,t,n,o,r,a,i,s,l,c,u,d,p){function m(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}s.eventTrack("vaultEditCipherController",{category:"Modal"}),e.folders=p("filter")(l.vaultGroupings,{folder:!0}),e.cipher={},e.readOnly=!1,e.constants=d,c.getUserProfile().then(function(n){return e.useTotp=n.premium,t.ciphers.get({id:i}).$promise}).then(function(t){e.cipher=r.decryptCipher(t),e.readOnly=!e.cipher.edit,e.useTotp=e.useTotp||e.cipher.organizationUseTotp}),e.save=function(o){if(e.readOnly)e.savePromise=t.ciphers.putPartial({id:i},{folderId:o.folderId,favorite:o.favorite},function(e){s.eventTrack("Partially Edited Cipher"),n.close({action:"partialEdit",data:{id:i,favorite:o.favorite,folderId:o.folderId&&""!==o.folderId?o.folderId:null}})}).$promise;else{var a=r.encryptCipher(o,e.cipher.type);e.savePromise=t.ciphers.put({id:i},a,function(e){s.eventTrack("Edited Cipher");var t=r.decryptCipherPreview(e);n.close({action:"edit",data:t})}).$promise}},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(s.eventTrack("Generated Password From Edit"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addField=function(){e.cipher.fields||(e.cipher.fields=[]),e.cipher.fields.push({type:d.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.toggleFavorite=function(){e.cipher.favorite=!e.cipher.favorite},e.clipboardSuccess=function(e){e.clearSelection(),m(e)},e.clipboardError=function(e,t){t&&m(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.folderSort=function(e){return e.id?e.name.toLowerCase():""},e.delete=function(){confirm("Are you sure you want to delete this item ("+e.cipher.name+")?")&&t.ciphers.del({id:e.cipher.id},function(){s.eventTrack("Deleted Cipher From Edit"),n.close({action:"delete",data:e.cipher.id})})},e.close=function(){n.dismiss("cancel")},e.showUpgrade=function(){u.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}}]),angular.module("bit.vault").controller("vaultEditFolderController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","folderId","$analytics",function(e,t,n,o,r,a,i){i.eventTrack("vaultEditFolderController",{category:"Modal"}),e.folder={},t.folders.get({id:a},function(t){e.folder=r.decryptFolder(t)}),e.savePromise=null,e.save=function(o){var s=r.encryptFolder(o);e.savePromise=t.folders.put({id:a},s,function(e){i.eventTrack("Edited Folder");var t=r.decryptFolder(e);n.close(t)}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultMoveCiphersController",["$scope","apiService","$uibModalInstance","ids","$analytics","$rootScope","$filter",function(e,t,n,o,r,a,i){r.eventTrack("vaultMoveCiphersController",{category:"Modal"}),e.folders=i("filter")(a.vaultGroupings,{folder:!0}),e.count=o.length,e.save=function(){e.savePromise=t.ciphers.moveMany({ids:o,folderId:e.folderId},function(){r.eventTrack("Bulk Moved Ciphers"),n.close(e.folderId||null)}).$promise},e.folderSort=function(e){return e.id?e.name.toLowerCase():"!"},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultShareCipherController",["$scope","apiService","$uibModalInstance","authService","cipherService","cipherId","$analytics","$state","cryptoService","$q","toastr",function(e,t,n,o,r,a,i,s,l,c,u){i.eventTrack("vaultShareCipherController",{category:"Modal"}),e.model={},e.cipher={},e.collections=[],e.selectedCollections={},e.organizations=[];var d={};e.loadingCollections=!0,e.loading=!0,e.readOnly=!1,t.ciphers.get({id:a}).$promise.then(function(t){return e.readOnly=!t.Edit,t.Edit&&(e.cipher=r.decryptCipher(t)),t.Edit}).then(function(t){if(e.loading=!1,t)return o.getUserProfile()}).then(function(n){if(n&&n.organizations){var o=[],a=!1;for(var i in n.organizations)n.organizations.hasOwnProperty(i)&&n.organizations[i].enabled&&(o.push({id:n.organizations[i].id,name:n.organizations[i].name}),d[n.organizations[i].id]=0,a||(a=!0,e.model.organizationId=n.organizations[i].id));e.organizations=o,t.collections.listMe({writeOnly:!0},function(t){for(var n=[],o=0;o<t.Data.length;o++){var a=r.decryptCollection(t.Data[o]);a.organizationId=t.Data[o].OrganizationId,n.push(a),d[a.organizationId]++}e.collections=n,e.loadingCollections=!1})}}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var o=0;o<e.collections.length;o++)e.model.organizationId&&e.collections[o].organizationId===e.model.organizationId&&(n[e.collections[o].id]=!0);e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]=!0},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return!!e.model.organizationId&&Object.keys(e.selectedCollections).length===d[e.model.organizationId]},e.orgChanged=function(){e.selectedCollections={}},e.submitPromise=null,e.submit=function(o){var s=l.getOrgKey(o.organizationId),d=!1,p=[];if(e.cipher.attachments)for(var m=0;m<e.cipher.attachments.length;m++)!function(e){var n=r.downloadAndDecryptAttachment(null,e,!1).then(function(e){return l.encryptToBytes(e.buffer,s)}).then(function(n){if(!d){var r=new FormData,i=new Blob([n],{type:"application/octet-stream"}),c=l.encrypt(e.fileName,s);return r.append("data",i,c),t.ciphers.postShareAttachment({id:a,attachmentId:e.id,orgId:o.organizationId},r).$promise}},function(e){d=!0});p.push(n)}(e.cipher.attachments[m]);e.submitPromise=c.all(p).then(function(){if(!d){e.cipher.organizationId=o.organizationId;var n={collectionIds:[],cipher:r.encryptCipher(e.cipher,e.cipher.type,null,!0)};for(var i in e.selectedCollections)e.selectedCollections.hasOwnProperty(i)&&n.collectionIds.push(i);return t.ciphers.putShare({id:a},n).$promise}}).then(function(e){i.eventTrack("Shared Cipher"),u.success("Item has been shared."),n.close(o.organizationId)})},e.close=function(){n.dismiss("cancel")},e.createOrg=function(){s.go("backend.user.settingsCreateOrg").then(function(){n.dismiss("cancel")})}}]),angular.module("bit.tools").controller("toolsController",["$scope","$uibModal","apiService","toastr","authService",function(e,t,n,o,r){e.import=function(){t.open({animation:!0,templateUrl:"app/tools/views/toolsImport.html",controller:"toolsImportController"})},e.export=function(){t.open({animation:!0,templateUrl:"app/tools/views/toolsExport.html",controller:"toolsExportController"})}}]),angular.module("bit.tools").controller("toolsExportController",["$scope","apiService","$uibModalInstance","cipherService","$q","toastr","$analytics","constants",function(e,t,n,o,r,a,i,s){function l(){var e=new Date;return"bitwarden_export_"+(e.getFullYear()+""+c(e.getMonth()+1,2)+c(e.getDate(),2)+c(e.getHours(),2)+c(e.getMinutes(),2)+c(e.getSeconds(),2))+".csv"}function c(e,t,n){return n=n||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(n)+e}i.eventTrack("toolsExportController",{category:"Modal"}),e.export=function(n){e.startedExport=!0;var c=[],u=[],d=t.folders.list({},function(e){u=o.decryptFolders(e.Data)}).$promise,p=t.ciphers.list({},function(e){c=o.decryptCiphers(e.Data)}).$promise;r.all([d,p]).then(function(){if(!c.length)return a.error("Nothing to export.","Error!"),void e.close();for(var t={},n=0;n<u.length;n++)t[u[n].id]=u[n];try{var o=[];for(n=0;n<c.length;n++)if(c[n].type===s.cipherType.login||c[n].type===s.cipherType.secureNote){var r={folder:c[n].folderId&&c[n].folderId in t?t[c[n].folderId].name:null,favorite:c[n].favorite?1:null,type:null,name:c[n].name,notes:c[n].notes,fields:null,login_uri:null,login_username:null,login_password:null,login_totp:null};if(c[n].fields)for(var d=0;d<c[n].fields.length;d++)r.fields?r.fields+="\n":r.fields="",r.fields+=(c[n].fields[d].name||"")+": "+c[n].fields[d].value;switch(c[n].type){case s.cipherType.login:r.type="login",r.login_uri=c[n].login.uri,r.login_username=c[n].login.username,r.login_password=c[n].login.password,r.login_totp=c[n].login.totp;break;case s.cipherType.secureNote:r.type="note";break;default:continue}o.push(r)}var p=Papa.unparse(o),m=new Blob([p]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(m,l());else{var g=window.document.createElement("a");g.href=window.URL.createObjectURL(m,{type:"text/plain"}),g.download=l(),document.body.appendChild(g),g.click(),document.body.removeChild(g)}i.eventTrack("Exported Data"),a.success("Your data has been exported. Check your browser's downloads folder.","Success!"),e.close()}catch(t){a.error("Something went wrong. Please try again.","Error!"),e.close()}},function(){a.error("Something went wrong. Please try again.","Error!"),e.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.tools").controller("toolsImportController",["$scope","$state","apiService","$uibModalInstance","cryptoService","cipherService","toastr","importService","$analytics","$sce","validationService",function(e,t,n,o,r,a,i,s,l,c,u){function d(r,s,c){if(r.length||s.length){if(s.length){var u=Math.floor(s.length/2),d=s.length-1;if(p(s[0])&&p(s[u])&&p(s[d]))return void m("Data is not formatted correctly. Please check your import file and try again.")}n.ciphers.import({folders:a.encryptFolders(r),ciphers:a.encryptCiphers(s),folderRelationships:c},function(){o.dismiss("cancel"),t.go("backend.user.vault",{refreshFromServer:!0}).then(function(){l.eventTrack("Imported Data",{label:e.model.source}),i.success("Data has been successfully imported into your vault.","Import Success")})},m)}else m("Nothing was imported.")}function p(e){return(null===e.name||"--"===e.name)&&e.login&&(null===e.login.password||""===e.login.password)}function m(t){if(l.eventTrack("Import Data Failed",{label:e.model.source}),o.dismiss("cancel"),t){var n=t.data;if(!n||!n.ValidationErrors)return n&&n.Message?void i.error(n.Message):void i.error(t);var r="";for(var a in n.ValidationErrors)if(n.ValidationErrors.hasOwnProperty(a))for(var s=0;s<n.ValidationErrors[a].length;s++)r+=a+": "+n.ValidationErrors[a][s]+" ";if(""!==r)return void i.error(r)}i.error("Something went wrong. Try again.","Oh No!")}l.eventTrack("toolsImportController",{category:"Modal"}),e.model={source:""},e.source={},e.splitFeatured=!0,e.options=[{id:"bitwardencsv",name:"bitwarden (csv)",featured:!0,sort:1,instructions:c.trustAsHtml('Export using the web vault (vault.bitwarden.com). Log into the web vault and navigate to "Tools" > "Export".')},{id:"lastpass",name:"LastPass (csv)",featured:!0,sort:2,instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-lastpass/">https://help.bitwarden.com/article/import-from-lastpass/</a>')},{id:"chromecsv",name:"Chrome (csv)",featured:!0,sort:3,instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-chrome/">https://help.bitwarden.com/article/import-from-chrome/</a>')},{id:"firefoxpasswordexportercsvxml",name:"Firefox Password Exporter (xml)",featured:!0,sort:4,instructions:c.trustAsHtml('Use the <a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/password-exporter/">Password Exporter</a> addon for FireFox to export your passwords to a XML file. After installing the addon, type <code>about:addons</code> in your FireFox navigation bar. Locate the Password Exporter addon and click the "Options" button. In the dialog that pops up, click the "Export Passwords" button to save the XML file.')},{id:"keepass2xml",name:"KeePass 2 (xml)",featured:!0,sort:5,instructions:c.trustAsHtml('Using the KeePass 2 desktop application, navigate to "File" > "Export" and select the KeePass XML (2.x) option.')},{id:"keepassxcsv",name:"KeePassX (csv)",instructions:c.trustAsHtml('Using the KeePassX desktop application, navigate to "Database" > "Export to CSV file" and save the CSV file.')},{id:"dashlanecsv",name:"Dashlane (csv)",featured:!0,sort:7,instructions:c.trustAsHtml('Using the Dashlane desktop application, navigate to "File" > "Export" > "Unsecured archive (readable) in CSV format" and save the CSV file.')},{id:"1password1pif",name:"1Password (1pif)",featured:!0,sort:6,instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-1password/">https://help.bitwarden.com/article/import-from-1password/</a>')},{id:"1password6wincsv",name:"1Password 6 Windows (csv)",instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-1password/">https://help.bitwarden.com/article/import-from-1password/</a>')},{id:"roboformhtml",name:"RoboForm (html)",instructions:c.trustAsHtml('Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) > "Print List" > "Logins". When the following print dialog pops up click on the "Save" button and save the HTML file.')},{id:"keepercsv",name:"Keeper (csv)",instructions:c.trustAsHtml('Log into the Keeper web vault (keepersecurity.com/vault). Navigate to "Backup" (top right) and find the "Export to Text File" option. Click "Export Now" to save the TXT/CSV file.')},{id:"enpasscsv",name:"Enpass (csv)",instructions:c.trustAsHtml('Using the Enpass desktop application, navigate to "File" > "Export" > "As CSV". Select "Yes" to the warning alert and save the CSV file. Note that the importer only fully supports files exported while Enpass is set to the English language, so adjust your settings accordingly.')},{id:"safeincloudxml",name:"SafeInCloud (xml)",instructions:c.trustAsHtml('Using the SaveInCloud desktop application, navigate to "File" > "Export" > "As XML" and save the XML file.')},{id:"pwsafexml",name:"Password Safe (xml)",instructions:c.trustAsHtml('Using the Password Safe desktop application, navigate to "File" > "Export To" > "XML format..." and save the XML file.')},{id:"stickypasswordxml",name:"Sticky Password (xml)",instructions:c.trustAsHtml('Using the Sticky Password desktop application, navigate to "Menu" (top right) > "Export" > "Export all". Select the unencrypted format XML option and then the "Save to file" button. Save the XML file.')},{id:"msecurecsv",name:"mSecure (csv)",instructions:c.trustAsHtml('Using the mSecure desktop application, navigate to "File" > "Export" > "CSV File..." and save the CSV file.')},{id:"truekeycsv",name:"True Key (csv)",instructions:c.trustAsHtml('Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export" button, enter your password and save the CSV file.')},{id:"passwordbossjson",name:"Password Boss (json)",instructions:c.trustAsHtml('Using the Password Boss desktop application, navigate to "File" > "Export data" > "Password Boss JSON - not encrypted" and save the JSON file.')},{id:"zohovaultcsv",name:"Zoho Vault (csv)",instructions:c.trustAsHtml('Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" > "Export Secrets". Select "All Secrets" and click the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad and paste the data. Save the data from the text editor as <code>zoho_export.csv</code>.')},{id:"splashidcsv",name:"SplashID (csv)",instructions:c.trustAsHtml('Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export" > "Export as CSV" and save the CSV file.')},{id:"passworddragonxml",name:"Password Dragon (xml)",instructions:c.trustAsHtml('Using the Password Dragon desktop application, navigate to "File" > "Export" > "To XML". In the dialog that pops up select "All Rows" and check all fields. Click the "Export" button and save the XML file.')},{id:"padlockcsv",name:"Padlock (csv)",instructions:c.trustAsHtml('Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings". Click the "Export Data" option. Ensure that the "CSV" option is selected from the dropdown. Highlight and copy the data from the textarea. Open a text editor like Notepad and paste the data. Save the data from the text editor as <code>padlock_export.csv</code>.')},{id:"clipperzhtml",name:"Clipperz (html)",instructions:c.trustAsHtml('Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation bar. Navigate to "Data" > "Export". Click the "download HTML+JSON" button to save the HTML file.')},{id:"avirajson",name:"Avira (json)",instructions:c.trustAsHtml('Using the Avira browser extension, click your username in the top right corner and navigate to "Settings". Locate the "Export Data" section and click "Export". In the dialog that pops up, click the "Export Password Manager Data" button to save the TXT/JSON file.')},{id:"saferpasscsv",name:"SaferPass (csv)",instructions:c.trustAsHtml('Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click the "Export accounts" button to save the CSV file.')},{id:"upmcsv",name:"Universal Password Manager (csv)",instructions:c.trustAsHtml('Using the Universal Password Manager desktop application, navigate to "Database" > "Export" and save the CSV file.')},{id:"ascendocsv",name:"Ascendo DataVault (csv)",instructions:c.trustAsHtml('Using the Ascendo DataVault desktop application, navigate to "Tools" > "Export". In the dialog that pops up, select the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file.')},{id:"meldiumcsv",name:"Meldium (csv)",instructions:c.trustAsHtml('Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save the CSV file.')},{id:"passkeepcsv",name:"PassKeep (csv)",instructions:c.trustAsHtml('Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to CSV" to save the CSV file.')},{id:"operacsv",name:"Opera (csv)",instructions:c.trustAsHtml('The process for importing from Opera is exactly the same as importing from Google Chrome. See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-chrome/">https://help.bitwarden.com/article/import-from-chrome/</a>')},{id:"vivaldicsv",name:"Vivaldi (csv)",instructions:c.trustAsHtml('The process for importing from Vivaldi is exactly the same as importing from Google Chrome. See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-chrome/">https://help.bitwarden.com/article/import-from-chrome/</a>')},{id:"gnomejson",name:"GNOME Passwords and Keys/Seahorse (json)",instructions:c.trustAsHtml('Make sure you have python-keyring and python-gnomekeyring installed. Save the <a target="_blank" href="http://bit.ly/2sMldAI">GNOME Keyring Import/Export</a> python script by Luke Plant to your desktop as <code>pw_helper.py</code>. Open terminal and run <code>chmod +rx Desktop/pw_helper.py</code> and then <code>python Desktop/pw_helper.py export Desktop/my_passwords.json</code>. Then upload the resulting <code>my_passwords.json</code> file here to bitwarden.')}],e.setSource=function(){for(var t=0;t<e.options.length;t++)if(e.options[t].id===e.model.source){e.source=e.options[t];break}},e.setSource(),e.import=function(t,n){if(t.source&&""!==t.source){var o=document.getElementById("file").files[0];o||t.fileContents&&""!==t.fileContents?(e.processing=!0,s.import(t.source,o||t.fileContents,d,m)):u.addError(n,"file","Select the import file or copy/paste the import file contents.",!0)}else u.addError(n,"source","Select the format of the import file.",!0)},e.close=function(){o.dismiss("cancel")}}]); -\ No newline at end of file +angular.module("bit",["ui.router","ngMessages","angular-jwt","ui.bootstrap.showErrors","toastr","angulartics","angular-promise-polyfill","bit.directives","bit.filters","bit.services","bit.global","bit.accounts","bit.vault","bit.settings","bit.tools","bit.organization","bit.reports"]),angular.module("bit").constant("appSettings",{apiUri:"/api",identityUri:"/identity",iconsUri:"/icons",stripeKey:"",braintreeKey:"",selfHosted:!1,version:"1.24.0",environment:"Production"}),angular.module("bit.accounts",["ui.bootstrap","ngCookies"]),angular.module("bit.directives",[]),angular.module("bit.global",[]),angular.module("bit.filters",[]),angular.module("bit.organization",["ui.bootstrap"]),angular.module("bit.reports",["toastr","ngSanitize"]),angular.module("bit.services",["ngResource","ngStorage","angular-jwt"]),angular.module("bit.settings",["ui.bootstrap","toastr"]),angular.module("bit.tools",["ui.bootstrap","toastr"]),angular.module("bit.vault",["ui.bootstrap","ngclipboard"]),angular.module("bit").factory("apiInterceptor",["$injector","$q","toastr","appSettings","utilsService",function(e,t,n,r,o){return{request:function(e){return 0===e.url.indexOf(r.apiUri+"/")&&(e.headers["Device-Type"]=o.getDeviceType()),e},response:function(r){return 401!==r.status&&403!==r.status||(e.get("authService").logOut(),e.get("$state").go("frontend.login.info").then(function(){n.warning("Your login session has expired.","Logged out")})),r||t.when(r)},responseError:function(r){return 401!==r.status&&403!==r.status||(e.get("authService").logOut(),e.get("$state").go("frontend.login.info").then(function(){n.warning("Your login session has expired.","Logged out")})),t.reject(r)}}}]),angular.module("bit").config(["$stateProvider","$urlRouterProvider","$httpProvider","jwtInterceptorProvider","jwtOptionsProvider","$uibTooltipProvider","toastrConfig","$locationProvider","$qProvider","appSettings",function(e,t,n,r,o,a,i,s,l,c){var u;angular.extend(c,window.bitwardenAppSettings),l.errorOnUnhandledRejections(!1),s.hashPrefix(""),o.config({whiteListedDomains:["localhost","api.bitwarden.com","vault.bitwarden.com","haveibeenpwned.com"]}),r.tokenGetter=["options","tokenService","authService",function(e,t,n){if(0===e.url.indexOf(c.apiUri+"/")){if(u)return u;var r=t.getToken();if(r){if(!t.tokenNeedsRefresh(r))return r;var o=n.refreshAccessToken();if(o)return u=o.then(function(e){return u=null,e||r})}}}],angular.extend(i,{closeButton:!0,progressBar:!0,showMethod:"slideDown",target:".toast-target"}),a.options({popupDelay:600,appendToBody:!0}),(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&(n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache"),n.interceptors.push("apiInterceptor"),n.interceptors.push("jwtInterceptor"),t.otherwise("/"),e.state("backend",{templateUrl:"app/views/backendLayout.html",abstract:!0,data:{authorize:!0}}).state("backend.user",{templateUrl:"app/views/userLayout.html",abstract:!0}).state("backend.user.vault",{url:"^/vault",templateUrl:"app/vault/views/vault.html",controller:"vaultController",data:{pageTitle:"My Vault",controlSidebar:!0},params:{refreshFromServer:!1}}).state("backend.user.settings",{url:"^/settings",templateUrl:"app/settings/views/settings.html",controller:"settingsController",data:{pageTitle:"Settings"}}).state("backend.user.settingsDomains",{url:"^/settings/domains",templateUrl:"app/settings/views/settingsDomains.html",controller:"settingsDomainsController",data:{pageTitle:"Domain Settings"}}).state("backend.user.settingsTwoStep",{url:"^/settings/two-step",templateUrl:"app/settings/views/settingsTwoStep.html",controller:"settingsTwoStepController",data:{pageTitle:"Two-step Login"}}).state("backend.user.settingsCreateOrg",{url:"^/settings/create-organization",templateUrl:"app/settings/views/settingsCreateOrganization.html",controller:"settingsCreateOrganizationController",data:{pageTitle:"Create Organization"}}).state("backend.user.settingsBilling",{url:"^/settings/billing",templateUrl:"app/settings/views/settingsBilling.html",controller:"settingsBillingController",data:{pageTitle:"Billing"}}).state("backend.user.settingsPremium",{url:"^/settings/premium",templateUrl:"app/settings/views/settingsPremium.html",controller:"settingsPremiumController",data:{pageTitle:"Go Premium"}}).state("backend.user.tools",{url:"^/tools",templateUrl:"app/tools/views/tools.html",controller:"toolsController",data:{pageTitle:"Tools"}}).state("backend.user.reportsBreach",{url:"^/reports/breach",templateUrl:"app/reports/views/reportsBreach.html",controller:"reportsBreachController",data:{pageTitle:"Data Breach Report"}}).state("backend.org",{templateUrl:"app/views/organizationLayout.html",abstract:!0}).state("backend.org.dashboard",{url:"^/organization/:orgId",templateUrl:"app/organization/views/organizationDashboard.html",controller:"organizationDashboardController",data:{pageTitle:"Organization Dashboard"}}).state("backend.org.people",{url:"/organization/:orgId/people?viewEvents&search",templateUrl:"app/organization/views/organizationPeople.html",controller:"organizationPeopleController",data:{pageTitle:"Organization People"}}).state("backend.org.collections",{url:"/organization/:orgId/collections?search",templateUrl:"app/organization/views/organizationCollections.html",controller:"organizationCollectionsController",data:{pageTitle:"Organization Collections"}}).state("backend.org.settings",{url:"/organization/:orgId/settings",templateUrl:"app/organization/views/organizationSettings.html",controller:"organizationSettingsController",data:{pageTitle:"Organization Settings"}}).state("backend.org.billing",{url:"/organization/:orgId/billing",templateUrl:"app/organization/views/organizationBilling.html",controller:"organizationBillingController",data:{pageTitle:"Organization Billing"}}).state("backend.org.vault",{url:"/organization/:orgId/vault?viewEvents&search",templateUrl:"app/organization/views/organizationVault.html",controller:"organizationVaultController",data:{pageTitle:"Organization Vault",controlSidebar:!0}}).state("backend.org.groups",{url:"/organization/:orgId/groups?search",templateUrl:"app/organization/views/organizationGroups.html",controller:"organizationGroupsController",data:{pageTitle:"Organization Groups"}}).state("backend.org.events",{url:"/organization/:orgId/events",templateUrl:"app/organization/views/organizationEvents.html",controller:"organizationEventsController",data:{pageTitle:"Organization Events"}}).state("frontend",{templateUrl:"app/views/frontendLayout.html",abstract:!0,data:{authorize:!1}}).state("frontend.login",{templateUrl:"app/accounts/views/accountsLogin.html",controller:"accountsLoginController",params:{returnState:null,email:null,premium:null,org:null},data:{bodyClass:"login-page"}}).state("frontend.login.info",{url:"^/?org&premium&email",templateUrl:"app/accounts/views/accountsLoginInfo.html",data:{pageTitle:"Log In"}}).state("frontend.login.twoFactor",{url:"^/two-step?org&premium&email",templateUrl:"app/accounts/views/accountsLoginTwoFactor.html",data:{pageTitle:"Log In (Two-step)"}}).state("frontend.logout",{url:"^/logout",controller:"accountsLogoutController",data:{authorize:!0}}).state("frontend.passwordHint",{url:"^/password-hint",templateUrl:"app/accounts/views/accountsPasswordHint.html",controller:"accountsPasswordHintController",data:{pageTitle:"Master Password Hint",bodyClass:"login-page"}}).state("frontend.recover",{url:"^/recover",templateUrl:"app/accounts/views/accountsRecover.html",controller:"accountsRecoverController",data:{pageTitle:"Recover Account",bodyClass:"login-page"}}).state("frontend.recover-delete",{url:"^/recover-delete",templateUrl:"app/accounts/views/accountsRecoverDelete.html",controller:"accountsRecoverDeleteController",data:{pageTitle:"Delete Account",bodyClass:"login-page"}}).state("frontend.verify-recover-delete",{url:"^/verify-recover-delete?userId&token&email",templateUrl:"app/accounts/views/accountsVerifyRecoverDelete.html",controller:"accountsVerifyRecoverDeleteController",data:{pageTitle:"Confirm Delete Account",bodyClass:"login-page"}}).state("frontend.register",{url:"^/register?org&premium",templateUrl:"app/accounts/views/accountsRegister.html",controller:"accountsRegisterController",params:{returnState:null,email:null,org:null,premium:null},data:{pageTitle:"Register",bodyClass:"register-page"}}).state("frontend.organizationAccept",{url:"^/accept-organization?organizationId&organizationUserId&token&email&organizationName",templateUrl:"app/accounts/views/accountsOrganizationAccept.html",controller:"accountsOrganizationAcceptController",data:{pageTitle:"Accept Organization Invite",bodyClass:"login-page",skipAuthorize:!0}}).state("frontend.verifyEmail",{url:"^/verify-email?userId&token",templateUrl:"app/accounts/views/accountsVerifyEmail.html",controller:"accountsVerifyEmailController",data:{pageTitle:"Verifying Email",bodyClass:"login-page",skipAuthorize:!0}})}]).run(["$rootScope","authService","$state",function(e,t,n){e.$on("$stateChangeSuccess",function(){$("html, body").animate({scrollTop:0},200)}),e.$on("$stateChangeStart",function(r,o,a){if(!o.data||!o.data.authorize){if(o.data&&o.data.skipAuthorize)return;if(!t.isAuthenticated())return;return r.preventDefault(),void n.go("backend.user.vault")}if(!t.isAuthenticated())return r.preventDefault(),t.logOut(),void n.go("frontend.login.info");o.name.indexOf("backend.org.")>-1&&a.orgId&&(e.vaultCiphers=e.vaultFolders=e.vaultCollections=null,t.getUserProfile().then(function(e){var t=e.organizations;t&&a.orgId in t&&2===t[a.orgId].status&&2!==t[a.orgId].type||(r.preventDefault(),n.go("backend.user.vault"))}))})}]),angular.module("bit").constant("constants",{rememberedEmailCookieName:"bit.rememberedEmail",encType:{AesCbc256_B64:0,AesCbc128_HmacSha256_B64:1,AesCbc256_HmacSha256_B64:2,Rsa2048_OaepSha256_B64:3,Rsa2048_OaepSha1_B64:4,Rsa2048_OaepSha256_HmacSha256_B64:5,Rsa2048_OaepSha1_HmacSha256_B64:6},orgUserType:{owner:0,admin:1,user:2},orgUserStatus:{invited:0,accepted:1,confirmed:2},twoFactorProvider:{u2f:4,yubikey:3,duo:2,authenticator:0,email:1,remember:5},cipherType:{login:1,secureNote:2,card:3,identity:4},fieldType:{text:0,hidden:1,boolean:2},deviceType:{android:0,ios:1,chromeExt:2,firefoxExt:3,operaExt:4,edgeExt:5,windowsDesktop:6,macOsDesktop:7,linuxDesktop:8,chrome:9,firefox:10,opera:11,edge:12,ie:13,unknown:14,uwp:16,safari:17,vivaldi:18,vivaldiExt:19},eventType:{User_LoggedIn:1e3,User_ChangedPassword:1001,User_Enabled2fa:1002,User_Disabled2fa:1003,User_Recovered2fa:1004,User_FailedLogIn:1005,User_FailedLogIn2fa:1006,Cipher_Created:1100,Cipher_Updated:1101,Cipher_Deleted:1102,Cipher_AttachmentCreated:1103,Cipher_AttachmentDeleted:1104,Cipher_Shared:1105,Cipher_UpdatedCollections:1106,Collection_Created:1300,Collection_Updated:1301,Collection_Deleted:1302,Group_Created:1400,Group_Updated:1401,Group_Deleted:1402,OrganizationUser_Invited:1500,OrganizationUser_Confirmed:1501,OrganizationUser_Updated:1502,OrganizationUser_Removed:1503,OrganizationUser_UpdatedGroups:1504,Organization_Updated:1600},twoFactorProviderInfo:[{type:0,name:"Authenticator App",description:"Use an authenticator app (such as Authy or Google Authenticator) to generate time-based verification codes.",enabled:!1,active:!0,free:!0,image:"authapp.png",displayOrder:0,priority:1,requiresUsb:!1},{type:3,name:"YubiKey OTP Security Key",description:"Use a YubiKey to access your account. Works with YubiKey 4, 4 Nano, 4C, and NEO devices.",enabled:!1,active:!0,image:"yubico.png",displayOrder:1,priority:3,requiresUsb:!0},{type:2,name:"Duo",description:"Verify with Duo Security using the Duo Mobile app, SMS, phone call, or U2F security key.",enabled:!1,active:!0,image:"duo.png",displayOrder:2,priority:2,requiresUsb:!1},{type:4,name:"FIDO U2F Security Key",description:"Use any FIDO U2F enabled security key to access your account.",enabled:!1,active:!0,image:"fido.png",displayOrder:3,priority:4,requiresUsb:!0},{type:1,name:"Email",description:"Verification codes will be emailed to you.",enabled:!1,active:!0,free:!0,image:"gmail.png",displayOrder:4,priority:0,requiresUsb:!1}],plans:{free:{basePrice:0,noAdditionalSeats:!0,noPayment:!0,upgradeSortOrder:-1},families:{basePrice:1,annualBasePrice:12,baseSeats:5,noAdditionalSeats:!0,annualPlanType:"familiesAnnually",upgradeSortOrder:1},teams:{basePrice:5,annualBasePrice:60,monthlyBasePrice:8,baseSeats:5,seatPrice:2,annualSeatPrice:24,monthlySeatPrice:2.5,monthPlanType:"teamsMonthly",annualPlanType:"teamsAnnually",upgradeSortOrder:2},enterprise:{seatPrice:3,annualSeatPrice:36,monthlySeatPrice:4,monthPlanType:"enterpriseMonthly",annualPlanType:"enterpriseAnnually",upgradeSortOrder:3}},storageGb:{price:.33,monthlyPrice:.5,yearlyPrice:4},premium:{price:10,yearlyPrice:10}}),angular.module("bit.accounts").controller("accountsLoginController",["$scope","$rootScope","$cookies","apiService","cryptoService","authService","$state","constants","$analytics","$uibModal","$timeout","$window","$filter","toastr",function(e,t,n,r,o,a,i,s,l,c,u,d,p,m){e.state=i,e.twoFactorProviderConstants=s.twoFactorProvider,e.rememberTwoFactor={checked:!1};var g=!0;e.returnState=i.params.returnState,e.stateEmail=i.params.email,!e.returnState&&i.params.org?e.returnState={name:"backend.user.settingsCreateOrg",params:{plan:i.params.org}}:!e.returnState&&i.params.premium&&(e.returnState={name:"backend.user.settingsPremium"}),!(i.current.name.indexOf("twoFactor")>-1)||e.twoFactorProviders&&e.twoFactorProviders.length||i.go("frontend.login.info",{returnState:e.returnState});var f,h,v=n.get(s.rememberedEmailCookieName);function y(){e.returnState?i.go(e.returnState.name,e.returnState.params):i.go("backend.user.vault")}function b(){var t;if(g=!0,e.twoFactorProvider===s.twoFactorProvider.duo)t=e.twoFactorProviders[s.twoFactorProvider.duo],d.Duo.init({host:t.Host,sig_request:t.Signature,submit_callback:function(t){var n=$(t).find('input[name="sig_response"]').val();e.twoFactor(n)}});else if(e.twoFactorProvider===s.twoFactorProvider.u2f){g=!1,t=e.twoFactorProviders[s.twoFactorProvider.u2f],function t(n){if(g)return;if(n.length<1||e.twoFactorProvider!==s.twoFactorProvider.u2f)return;console.log("listening for u2f key...");d.u2f.sign(n[0].appId,n[0].challenge,[{version:n[0].version,keyHandle:n[0].keyHandle}],function(r){if(e.twoFactorProvider===s.twoFactorProvider.u2f)return r.errorCode?(console.log(r.errorCode),void u(function(){t(n)},5===r.errorCode?0:1e3)):void e.twoFactor(JSON.stringify(r))},10)}(JSON.parse(t.Challenges))}else e.twoFactorProvider===s.twoFactorProvider.email&&(t=e.twoFactorProviders[s.twoFactorProvider.email],e.twoFactorEmail=t.Email,Object.keys(e.twoFactorProviders).length>1&&e.sendEmail(!1))}v||e.stateEmail?(e.model={email:e.stateEmail||v,rememberEmail:null!==v},u(function(){$("#masterPassword").focus()})):u(function(){$("#email").focus()}),e.twoFactorProviders=null,e.twoFactorProvider=null,e.login=function(t){e.loginPromise=a.logIn(t.email,t.masterPassword).then(function(r){if(t.rememberEmail){var o=new Date;o.setFullYear(o.getFullYear()+10),n.put(s.rememberedEmailCookieName,t.email,{expires:o})}else n.remove(s.rememberedEmailCookieName);r&&Object.keys(r).length>0?(f=t.email,h=t.masterPassword,e.twoFactorProviders=function(e){if(t=!1,n=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0,4)))&&(t=!0),!t&&!navigator.userAgent.match(/iPad/i))return e;var t,n;for(var r=Object.keys(e),o=0;o<r.length;o++){var a=p("filter")(s.twoFactorProviderInfo,{type:r[o],active:!0,requiresUsb:!1});a.length||delete e[r[o]]}return e}(r),e.twoFactorProvider=function(e){for(var t=Object.keys(e),n=null,r=-1,o=0;o<t.length;o++){var a=p("filter")(s.twoFactorProviderInfo,{type:t[o],active:!0});if(a.length&&a[0].priority>r){if(a[0].type===s.twoFactorProvider.u2f&&!u2f.isSupported)continue;n=a[0].type,r=a[0].priority}}if(null===n)return null;return parseInt(n)}(e.twoFactorProviders),l.eventTrack("Logged In To Two-step"),i.go("frontend.login.twoFactor",{returnState:e.returnState}).then(function(){u(function(){$("#code").focus(),b()})})):(l.eventTrack("Logged In"),y()),t.masterPassword=""})},e.twoFactor=function(t){e.twoFactorProvider!==s.twoFactorProvider.email&&e.twoFactorProvider!==s.twoFactorProvider.authenticator||(t=t.replace(" ","")),e.twoFactorPromise=a.logIn(f,h,t,e.twoFactorProvider,e.rememberTwoFactor.checked||!1),e.twoFactorPromise.then(function(){l.eventTrack("Logged In From Two-step"),y()},function(){e.twoFactorProvider===s.twoFactorProvider.u2f&&b()})},e.anotherMethod=function(){c.open({animation:!0,templateUrl:"app/accounts/views/accountsTwoFactorMethods.html",controller:"accountsTwoFactorMethodsController",resolve:{providers:function(){return e.twoFactorProviders}}}).result.then(function(t){e.twoFactorProvider=t,u(function(){$("#code").focus(),b()})})},e.sendEmail=function(t){if(e.twoFactorProvider===s.twoFactorProvider.email)return o.makeKeyAndHash(f,h).then(function(e){return r.twoFactor.sendEmailLogin({email:f,masterPasswordHash:e.hash}).$promise}).then(function(){t&&m.success("Verification email sent to "+e.twoFactorEmail+".")},function(){m.error("Could not send verification email.")})},e.$on("$destroy",function(){g=!0})}]),angular.module("bit.accounts").controller("accountsLogoutController",["$scope","authService","$state","$analytics",function(e,t,n,r){t.logOut(),r.eventTrack("Logged Out"),n.go("frontend.login.info")}]),angular.module("bit.accounts").controller("accountsOrganizationAcceptController",["$scope","$state","apiService","authService","toastr","$analytics",function(e,t,n,r,o,a){e.state={name:t.current.name,params:t.params},t.params.organizationId&&t.params.organizationUserId&&t.params.token&&t.params.email&&t.params.organizationName?e.$on("$viewContentLoaded",function(){r.isAuthenticated()?(e.accepting=!0,n.organizationUsers.accept({orgId:t.params.organizationId,id:t.params.organizationUserId},{token:t.params.token},function(){a.eventTrack("Accepted Invitation"),t.go("backend.user.vault",null,{location:"replace"}).then(function(){o.success("You can access this organization once an administrator confirms your membership. We'll send an email when that happens.","Invite Accepted",{timeOut:1e4})})},function(){a.eventTrack("Failed To Accept Invitation"),t.go("backend.user.vault",null,{location:"replace"}).then(function(){o.error("Unable to accept invitation.","Error")})})):e.loading=!1}):t.go("frontend.login.info").then(function(){o.error("Invalid parameters.")})}]),angular.module("bit.accounts").controller("accountsPasswordHintController",["$scope","$rootScope","apiService","$analytics",function(e,t,n,r){e.success=!1,e.submit=function(t){e.submitPromise=n.accounts.postPasswordHint({email:t.email},function(){r.eventTrack("Requested Password Hint"),e.success=!0}).$promise}}]),angular.module("bit.accounts").controller("accountsRecoverController",["$scope","apiService","cryptoService","$analytics",function(e,t,n,r){e.success=!1,e.submit=function(o){var a=o.email.toLowerCase();e.submitPromise=n.makeKeyAndHash(o.email,o.masterPassword).then(function(e){return t.twoFactor.recover({email:a,masterPasswordHash:e.hash,recoveryCode:o.code.replace(/\s/g,"").toLowerCase()}).$promise}).then(function(){r.eventTrack("Recovered 2FA"),e.success=!0})}}]),angular.module("bit.accounts").controller("accountsRecoverDeleteController",["$scope","$rootScope","apiService","$analytics",function(e,t,n,r){e.success=!1,e.submit=function(t){e.submitPromise=n.accounts.postDeleteRecover({email:t.email},function(){r.eventTrack("Started Delete Recovery"),e.success=!0}).$promise}}]),angular.module("bit.accounts").controller("accountsRegisterController",["$scope","$location","apiService","cryptoService","validationService","$analytics","$state","$timeout",function(e,t,n,r,o,a,i,s){var l=t.search(),c=i.params;e.createOrg=c.org,!c.returnState&&c.org?e.returnState={name:"backend.user.settingsCreateOrg",params:{plan:i.params.org}}:!c.returnState&&c.premium?e.returnState={name:"backend.user.settingsPremium",params:{plan:i.params.org}}:e.returnState=c.returnState,e.success=!1,e.model={email:l.email?l.email:c.email},e.readOnlyEmail=null!==c.email,s(function(){e.model.email?$("#name").focus():$("#email").focus()}),e.registerPromise=null,e.register=function(t){var i=!1;if(e.model.masterPassword.length<8&&(o.addError(t,"MasterPassword","Master password must be at least 8 characters long.",!0),i=!0),e.model.masterPassword!==e.model.confirmMasterPassword&&(o.addError(t,"ConfirmMasterPassword","Master password confirmation does not match.",!0),i=!0),!i){var s,l,c=e.model.email.toLowerCase();e.registerPromise=r.makeKeyAndHash(c,e.model.masterPassword).then(function(e){return s=e,l=r.makeEncKey(e.key),r.makeKeyPair(l.encKey)}).then(function(t){var r={name:e.model.name,email:c,masterPasswordHash:s.hash,masterPasswordHint:e.model.masterPasswordHint,key:l.encKeyEnc,keys:{publicKey:t.publicKey,encryptedPrivateKey:t.privateKeyEnc}};return n.accounts.register(r).$promise},function(e){return o.addError(t,null,"Problem generating keys.",!0),!1}).then(function(t){!1!==t&&(e.success=!0,a.eventTrack("Registered"))})}}}]),angular.module("bit.accounts").controller("accountsTwoFactorMethodsController",["$scope","$uibModalInstance","$analytics","providers","constants",function(e,t,n,r,o){function a(t){for(var n=0;n<o.twoFactorProviderInfo.length;n++)o.twoFactorProviderInfo[n].type===t&&e.providers.push(o.twoFactorProviderInfo[n])}n.eventTrack("accountsTwoFactorMethodsController",{category:"Modal"}),e.providers=[],r.hasOwnProperty(o.twoFactorProvider.authenticator)&&a(o.twoFactorProvider.authenticator),r.hasOwnProperty(o.twoFactorProvider.yubikey)&&a(o.twoFactorProvider.yubikey),r.hasOwnProperty(o.twoFactorProvider.email)&&a(o.twoFactorProvider.email),r.hasOwnProperty(o.twoFactorProvider.duo)&&a(o.twoFactorProvider.duo),r.hasOwnProperty(o.twoFactorProvider.u2f)&&u2f.isSupported&&a(o.twoFactorProvider.u2f),e.choose=function(e){t.close(e.type)},e.close=function(){t.dismiss("close")}}]),angular.module("bit.accounts").controller("accountsVerifyEmailController",["$scope","$state","apiService","toastr","$analytics",function(e,t,n,r,o){t.params.userId&&t.params.token?e.$on("$viewContentLoaded",function(){n.accounts.verifyEmailToken({},{token:t.params.token,userId:t.params.userId},function(){o.eventTrack("Verified Email"),t.go("frontend.login.info",null,{location:"replace"}).then(function(){r.success("Your email has been verified. Thank you.","Success")})},function(){t.go("frontend.login.info",null,{location:"replace"}).then(function(){r.error("Unable to verify email.","Error")})})}):t.go("frontend.login.info").then(function(){r.error("Invalid parameters.")})}]),angular.module("bit.accounts").controller("accountsVerifyRecoverDeleteController",["$scope","$state","apiService","toastr","$analytics",function(e,t,n,r,o){t.params.userId&&t.params.token&&t.params.email?(e.email=t.params.email,e.delete=function(){confirm("Are you sure you want to delete this account? This cannot be undone.")&&(e.deleting=!0,n.accounts.postDeleteRecoverToken({},{token:t.params.token,userId:t.params.userId},function(){o.eventTrack("Recovered Delete"),t.go("frontend.login.info",null,{location:"replace"}).then(function(){r.success("Your account has been deleted. You can register a new account again if you like.","Success")})},function(){t.go("frontend.login.info",null,{location:"replace"}).then(function(){r.error("Unable to delete account.","Error")})}))}):t.go("frontend.login.info").then(function(){r.error("Invalid parameters.")})}]),angular.module("bit.directives").directive("apiField",function(){var e=function(e,t,n,r){r.$registerApiError=function(){r.$setValidity("api",!1)},r.$validators.apiValidate=function(){return r.$setValidity("api",!0),!0}};return{require:"ngModel",restrict:"A",compile:function(t,n){if(!n.name||""===n.name)throw"api-field element does not have a valid name attribute";return e}}}),angular.module("bit.directives").directive("apiForm",["$rootScope","validationService","$timeout",function(e,t,n){return{require:"form",restrict:"A",link:function(e,r,o,a){var i=o.apiForm||null;void 0!==i&&e.$watch(i,function(e,r,o){if(!o||!o.then)return;e.$errors=null,e.$loading=!0,o.then(function(t){n(function(){e.$loading=!1})},function(o){n(function(){e.$loading=!1,"string"==typeof o?t.addError(e,null,o,!0):t.addErrors(e,o),r.$broadcast("show-errors-check-validity"),$("html, body").animate({scrollTop:0},200)})})}.bind(null,a,e))}}}]),angular.module("bit.directives").directive("fallbackSrc",function(){return function(e,t,n){var r=$(t);r.bind("error",function(e){r.attr("src",n.fallbackSrc)})}}),angular.module("bit.directives").directive("letterAvatar",function(){return{restrict:"AE",replace:!0,scope:{data:"@"},link:function(e,t,n){var r={charCount:n.charcount||2,data:n.data,textColor:n.textcolor||"#ffffff",bgColor:n.bgcolor,height:n.avheight||45,width:n.avwidth||45,fontSize:n.fontsize||20,fontWeight:n.fontweight||300,fontFamily:n.fontfamily||"Open Sans, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif",round:n.round||"true",dynamic:n.dynamic||"true",class:n.avclass||"",border:n.avborder||"false",borderStyle:n.borderstyle||"3px solid white"};function o(){var n=null,o=e.data.toUpperCase();r.charCount>1&&(n=function(e,t){var n=e.split(" ");if(n&&n.length>1){for(var r="",o=0;o<t;o++)r+=n[o].substr(0,1);return r}return null}(o,r.charCount)),n||(n=o.substr(0,r.charCount));var a,i,s,l,c,u,d,p,m=(a=n,i=r.textColor,s=r.fontFamily,l=r.fontWeight,c=r.fontSize,angular.element('<text text-anchor="middle"></text>').attr({y:"50%",x:"50%",dy:"0.35em","pointer-events":"auto",fill:i,"font-family":s}).text(a).css({"font-weight":l,"font-size":c+"px"})),g=r.bgColor?r.bgColor:function(e){var t=0,n=0;for(n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);var r="#";for(n=0;n<3;n++)r+=("00"+(t>>8*n&255).toString(16)).substr(-2);return r}(o),f=(u=r.width,d=r.height,p=g,angular.element("<svg></svg>").attr({xmlns:"http://www.w3.org/2000/svg","pointer-events":"none",width:u,height:d}).css({"background-color":p,width:u+"px",height:d+"px"}));f.append(m);var h=angular.element("<div>").append(f).html(),v="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(h))),y=angular.element("<img>").attr({src:v,title:e.data});"true"===r.round&&y.css("border-radius","50%"),"true"===r.border&&y.css("border",r.borderStyle),r.class&&y.addClass(r.class),"true"===r.dynamic?(t.empty(),t.append(y)):t.replaceWith(y)}"true"===r.dynamic?e.$watch("data",function(){o()}):o()}}}),angular.module("bit.directives").directive("masterPassword",["cryptoService","authService",function(e,t){return{require:"ngModel",restrict:"A",link:function(n,r,o,a){t.getUserProfile().then(function(t){a.$parsers.unshift(function(n){if(n)return e.makeKey(n,t.email).then(function(t){var r=t.keyB64===e.getKey().keyB64;return a.$setValidity("masterPassword",r),r?n:void 0})}),a.$formatters.unshift(function(n){if(n)return e.makeKey(n,t.email).then(function(t){var r=t.keyB64===e.getKey().keyB64;return a.$setValidity("masterPassword",r),n})})})}}}]),angular.module("bit.directives").directive("pageTitle",["$rootScope","$timeout","appSettings",function(e,t,n){return{link:function(n,r){e.$on("$stateChangeStart",function(e,n,o,a,i){var s="Bitwarden Web Vault";n.data&&n.data.pageTitle&&(s=n.data.pageTitle+" - "+s),t(function(){r.text(s)})})}}}]),angular.module("bit.directives").directive("passwordMeter",function(){return{template:'<div class="progress {{outerClass}}"><div class="progress-bar progress-bar-{{valueClass}}" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="100" ng-style="{width : ( value + \'%\' ) }"><span class="sr-only">{{value}}%</span></div></div>',restrict:"A",scope:{password:"=passwordMeter",username:"=passwordMeterUsername",outerClass:"@?"},link:function(e){var t=function(e){e.value=function(e,t){if(!t||t===e)return 0;var n=t.length;return e&&""!==e&&(-1!==e.indexOf(t)&&(n-=15),-1!==t.indexOf(e)&&(n-=e.length)),t.length>0&&t.length<=4?n+=t.length:t.length>=5&&t.length<=7?n+=6:t.length>=8&&t.length<=15?n+=12:t.length>=16&&(n+=18),t.match(/[a-z]/)&&(n+=1),t.match(/[A-Z]/)&&(n+=5),t.match(/\d/)&&(n+=5),t.match(/.*\d.*\d.*\d/)&&(n+=5),t.match(/[!,@,#,$,%,^,&,*,?,_,~]/)&&(n+=5),t.match(/.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~]/)&&(n+=5),t.match(/(?=.*[a-z])(?=.*[A-Z])/)&&(n+=2),t.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/)&&(n+=2),t.match(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!,@,#,$,%,^,&,*,?,_,~])/)&&(n+=2),n=Math.round(2*n),Math.max(0,Math.min(100,n))}(e.username,e.password),e.valueClass=function(e){switch(Math.round(e/33)){case 0:case 1:return"danger";case 2:return"warning";case 3:return"success"}}(e.value)};e.$watch("password",function(){t(e)}),e.$watch("username",function(){t(e)})}}}),angular.module("bit.directives").directive("passwordViewer",function(){return{restrict:"A",link:function(e,t,n){var r=n.passwordViewer;r&&(t.onclick=function(e){},t.on("click",function(e){var n=$(r);n&&"password"===n.attr("type")?(t.removeClass("fa-eye").addClass("fa-eye-slash"),n.attr("type","text")):n&&"text"===n.attr("type")&&(t.removeClass("fa-eye-slash").addClass("fa-eye"),n.attr("type","password"))}))}}}),angular.module("bit.directives").directive("stopClick",function(){return function(e,t,n){$(t).click(function(e){e.preventDefault()})}}),angular.module("bit.directives").directive("stopProp",function(){return function(e,t,n){$(t).click(function(e){e.stopPropagation()})}}),angular.module("bit.directives").directive("totp",["$timeout","$q",function(e,t){return{template:'<div class="totp{{(low ? \' low\' : \'\')}}" ng-if="code"><span class="totp-countdown"><span class="totp-sec">{{sec}}</span><svg><g><circle class="totp-circle inner" r="12.6" cy="16" cx="16" style="stroke-dashoffset: {{dash}}px;"></circle><circle class="totp-circle outer" r="14" cy="16" cx="16"></circle></g></svg></span><span class="totp-code" id="totp-code">{{codeFormatted}}</span><a href="#" stop-click class="btn btn-link" ngclipboard ngclipboard-error="clipboardError(e)" data-clipboard-text="{{code}}" uib-tooltip="Copy Code" tooltip-placement="right"><i class="fa fa-clipboard"></i></a></div>',restrict:"A",scope:{key:"=totp"},link:function(n){var r=null,o=new function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",n=function(e,t,n){return t+1>=e.length&&(e=Array(t+1-e.length).join(n)+e),e},r=function(e){return parseInt(e,16)},o=function(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)t[n/2]=parseInt(e.substr(n,2),16);return t},a=function(t){return o(function(t){t=t.toUpperCase();var r,o="";for(r=0;r<t.length;r++)e.indexOf(t[r])<0||(o+=t[r]);t=o;var a="",i="";for(r=0;r<t.length;r++){var s=e.indexOf(t.charAt(r));s<0||(a+=n(s.toString(2),5,"0"))}for(r=0;r+4<=a.length;r+=4){var l=a.substr(r,4);i+=parseInt(l,2).toString(16)}return i}(t))},i=function(e,t){return window.crypto.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign"]).then(function(e){return window.crypto.subtle.sign({name:"HMAC",hash:{name:"SHA-1"}},e,t)}).then(function(e){return function(e){for(var t=new Uint8Array(e),n=[],r=0;r<t.length;r++)n.push((t[r]>>>4).toString(16)),n.push((15&t[r]).toString(16));return n.join("")}(e)}).catch(function(e){return null})};this.getCode=function(e){var s,l=Math.round((new Date).getTime()/1e3),c=n(((s=Math.floor(l/30))<15.5?"0":"")+Math.round(s).toString(16),16,"0"),u=o(c),d=a(e);return d.length&&u.length?i(d,u).then(function(e){if(!e)return null;var t=r(e.substring(e.length-1)),n=(r(e.substr(2*t,8))&r("7fffffff"))+"";return n=n.substr(n.length-6,6)}):t(function(e,t){e(null)})}},a=function(t){o.getCode(t.key).then(function(n){e(function(){n?(t.codeFormatted=n.substring(0,3)+" "+n.substring(3),t.code=n):(t.code=null,r&&clearInterval(r))})})},i=function(t){e(function(){var e=Math.round((new Date).getTime()/1e3)%30,n=30-e;t.sec=n,t.dash=(2.62*e).toFixed(2),t.low=n<=7,0===e&&a(t)})};n.$watch("key",function(){if(!n.key)return n.code=null,void(r&&clearInterval(r));a(n),i(n),r&&clearInterval(r),r=setInterval(function(){i(n)},1e3)}),n.$on("$destroy",function(){r&&clearInterval(r)}),n.clipboardError=function(e){alert("Your web browser does not support easy clipboard copying.")}}}}]),angular.module("bit.global").controller("mainController",["$scope","$state","authService","appSettings","toastr","$window","$document","cryptoService","$uibModal","apiService",function(e,t,n,r,o,a,i,s,l,c){var u,d,p,m=this;m.skinClass=r.selfHosted?"skin-blue-light":"skin-blue",m.bodyClass="",m.usingControlSidebar=m.openControlSidebar=!1,m.searchVaultText=null,m.version=r.version,m.outdatedBrowser=-1!==a.navigator.userAgent.indexOf("MSIE")||-1!==a.navigator.userAgent.indexOf("SamsungBrowser"),e.currentYear=(new Date).getFullYear(),e.$on("$viewContentLoaded",function(){n.getUserProfile().then(function(e){m.userProfile=e}),$.AdminLTE&&($.AdminLTE.layout&&($.AdminLTE.layout.fix(),$.AdminLTE.layout.fixSidebar()),$.AdminLTE.pushMenu&&$.AdminLTE.pushMenu.expandOnHover(),i.off("click",".sidebar li a"))}),e.$on("$stateChangeSuccess",function(e,t,n,r,o){m.usingEncKey=!!s.getEncKey(),m.searchVaultText=null,t.data.bodyClass?m.bodyClass=t.data.bodyClass:(m.bodyClass="",m.usingControlSidebar=!!t.data.controlSidebar,m.openControlSidebar=m.usingControlSidebar&&i.width()>768)}),e.addCipher=function(){e.$broadcast("vaultAddCipher")},e.addFolder=function(){e.$broadcast("vaultAddFolder")},e.addOrganizationCipher=function(){e.$broadcast("organizationVaultAddCipher")},e.addOrganizationCollection=function(){e.$broadcast("organizationCollectionsAdd")},e.inviteOrganizationUser=function(){e.$broadcast("organizationPeopleInvite")},e.addOrganizationGroup=function(){e.$broadcast("organizationGroupsAdd")},e.updateKey=function(){l.open({animation:!0,templateUrl:"app/settings/views/settingsUpdateKey.html",controller:"settingsUpdateKeyController"})},e.verifyEmail=function(){e.sendingVerify||(e.sendingVerify=!0,c.accounts.verifyEmail({},null).$promise.then(function(){o.success("Verification email sent."),e.sendingVerify=!1,e.verifyEmailSent=!0}).catch(function(){o.success("Verification email failed."),e.sendingVerify=!1}))},e.updateBrowser=function(){a.open("https://browser-update.org/update.html","_blank")};var g={scrollbarWidth:function(){if(!u){var e=$("body");e.addClass("bit-position-body-scrollbar-measure"),u=a.innerWidth-e[0].clientWidth,u=isFinite(u)?u:0,e.removeClass("bit-position-body-scrollbar-measure")}return u},scrollbarInfo:function(){return{width:g.scrollbarWidth(),visible:i.height()>$(a).height()}}};$(window).on("show.bs.dropdown",function(e){var t=p=$(e.target),n=t.data("appendTo");if(!n)return!0;d=t.find(".dropdown-menu"),$(n).append(d.detach());var r=t.offset(),o={display:"block",top:r.top+t.outerHeight()-("body"!==n?$(window).scrollTop():0)};if(d.hasClass("dropdown-menu-right")){var i=g.scrollbarInfo(),s=0;i.visible&&i.width&&(s=i.width),o.right=a.innerWidth-s-(r.left+t.prop("offsetWidth"))+"px",o.left="auto"}else o.left=r.left+"px",o.right="auto";d.css(o)}),$(window).on("hide.bs.dropdown",function(e){if(!d)return!0;$(e.target).append(d.detach()),d.hide(),d=null,p=null}),e.$on("removeAppendedDropdownMenu",function(e,t){if(!d&&!p)return!0;p.append(d.detach()),d.hide(),d=null,p=null})}]),angular.module("bit.global").controller("paidOrgRequiredController",["$scope","$state","$uibModalInstance","$analytics","$uibModalStack","orgId","constants","authService",function(e,t,n,r,o,a,i,s){r.eventTrack("paidOrgRequiredController",{category:"Modal"}),s.getUserProfile().then(function(t){e.admin=t.organizations[a].type!==i.orgUserType.user}),e.go=function(){e.admin&&(r.eventTrack("Get Paid Org"),t.go("backend.org.billing",{orgId:a}).then(function(){o.dismissAll()}))},e.close=function(){n.dismiss("close")}}]),angular.module("bit.global").controller("premiumRequiredController",["$scope","$state","$uibModalInstance","$analytics","$uibModalStack",function(e,t,n,r,o){r.eventTrack("premiumRequiredController",{category:"Modal"}),e.go=function(){r.eventTrack("Get Premium"),t.go("backend.user.settingsPremium").then(function(){o.dismissAll()})},e.close=function(){n.dismiss("close")}}]),angular.module("bit.global").controller("sideNavController",["$scope","$state","authService","toastr","$analytics","constants","appSettings",function(e,t,n,r,o,a,i){e.$state=t,e.params=t.params,e.orgs=[],e.name="",i.selfHosted?(e.orgIconBgColor="#ffffff",e.orgIconBorder="3px solid #a0a0a0",e.orgIconTextColor="#333333"):(e.orgIconBgColor="#2c3b41",e.orgIconBorder="3px solid #1a2226",e.orgIconTextColor="#ffffff"),n.getUserProfile().then(function(n){if(e.name=n.extended&&n.extended.name?n.extended.name:n.email,n.organizations)if(t.includes("backend.org")&&t.params.orgId in n.organizations)e.orgProfile=n.organizations[t.params.orgId];else{var r=[];for(var o in n.organizations)n.organizations.hasOwnProperty(o)&&(n.organizations[o].enabled||n.organizations[o].type<2)&&r.push(n.organizations[o]);e.orgs=r}}),e.viewOrganization=function(e){e.type!==a.orgUserType.user?(o.eventTrack("View Organization From Side Nav"),t.go("backend.org.dashboard",{orgId:e.id})):r.error("You cannot manage this organization.")},e.isOrgOwner=function(e){return e&&e.type===a.orgUserType.owner}}]),angular.module("bit.global").controller("topNavController",["$scope",function(e){e.toggleControlSidebar=function(){var e=$("body");e.hasClass("control-sidebar-open")?e.removeClass("control-sidebar-open"):e.addClass("control-sidebar-open")}}]),angular.module("bit.filters").filter("enumLabelClass",function(){return function(e,t){if("number"!=typeof e)return e.toString();var n;switch(t){case"OrgUserStatus":switch(e){case 0:n="label-default";break;case 1:n="label-warning";break;case 2:default:n="label-success"}break;default:n="label-default"}return n}}),angular.module("bit.filters").filter("enumName",function(){return function(e,t){if("number"!=typeof e)return e.toString();var n;switch(t){case"OrgUserStatus":switch(e){case 0:n="Invited";break;case 1:n="Accepted";break;case 2:default:n="Confirmed"}break;case"OrgUserType":switch(e){case 0:n="Owner";break;case 1:n="Admin";break;case 2:default:n="User"}break;default:n=e.toString()}return n}}),angular.module("bit.organization").controller("organizationBillingAdjustSeatsController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","add",function(e,t,n,r,o,a,i){o.eventTrack("organizationBillingAdjustSeatsController",{category:"Modal"}),e.add=i,e.seatAdjustment=0,e.submit=function(){var s={seatAdjustment:e.seatAdjustment};i||(s.seatAdjustment*=-1),e.submitPromise=r.organizations.putSeat({id:t.params.orgId},s).$promise.then(function(t){i?(o.eventTrack("Added Seats"),a.success("You have added "+e.seatAdjustment+" seats.")):(o.eventTrack("Removed Seats"),a.success("You have removed "+e.seatAdjustment+" seats.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingAdjustStorageController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","add",function(e,t,n,r,o,a,i){o.eventTrack("organizationBillingAdjustStorageController",{category:"Modal"}),e.add=i,e.storageAdjustment=0,e.submit=function(){var s={storageGbAdjustment:e.storageAdjustment};i||(s.storageGbAdjustment*=-1),e.submitPromise=r.organizations.putStorage({id:t.params.orgId},s).$promise.then(function(t){i?(o.eventTrack("Added Organization Storage"),a.success("You have added "+e.storageAdjustment+" GB.")):(o.eventTrack("Removed Organization Storage"),a.success("You have removed "+e.storageAdjustment+" GB.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingChangePaymentController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","existingPaymentMethod",function(e,t,n,r,o,a,i){o.eventTrack("organizationBillingChangePaymentController",{category:"Modal"}),e.existingPaymentMethod=i,e.paymentMethod="card",e.showPaymentOptions=!0,e.hidePaypal=!0,e.card={},e.bank={},e.changePaymentMethod=function(t){e.paymentMethod=t},e.submit=function(){var s=null;if("card"===e.paymentMethod)s=stripe.card.createToken(e.card);else{if("bank"!==e.paymentMethod)return;e.bank.currency="USD",e.bank.country="US",s=stripe.bankAccount.createToken(e.bank)}e.submitPromise=s.then(function(e){var n={paymentToken:e.id};return r.organizations.putPayment({id:t.params.orgId},n).$promise},function(e){throw e.message}).then(function(t){e.card=null,i?(o.eventTrack("Changed Organization Payment Method"),a.success("You have changed your payment method.")):(o.eventTrack("Added Organization Payment Method"),a.success("You have added a payment method.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingChangePlanController",["$scope","$state","apiService","$uibModalInstance","toastr","$analytics",function(e,t,n,r,o,a){a.eventTrack("organizationBillingChangePlanController",{category:"Modal"}),e.submit=function(){},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingController",["$scope","apiService","$state","$uibModal","toastr","$analytics","appSettings","tokenService","$window",function(e,t,n,r,o,a,i,s,l){e.selfHosted=i.selfHosted,e.charges=[],e.paymentSource=null,e.plan=null,e.subscription=null,e.loading=!0;function c(){t.organizations.getBilling({id:n.params.orgId},function(t){e.loading=!1,e.noSubscription=0===t.PlanType,e.canAdjustSeats=t.PlanType>1;var n=0;if(e.expiration=t.Expiration,t.License,e.plan={name:t.Plan,type:t.PlanType,seats:t.Seats},e.storage=null,e&&t.MaxStorageGb&&(e.storage={currentGb:t.StorageGb||0,maxGb:t.MaxStorageGb,currentName:t.StorageName||"0 GB"},e.storage.percentage=+(e.storage.currentGb/e.storage.maxGb*100).toFixed(2)),e.subscription=null,t.Subscription&&(e.subscription={trialEndDate:t.Subscription.TrialEndDate,cancelledDate:t.Subscription.CancelledDate,status:t.Subscription.Status,cancelled:t.Subscription.Cancelled,markedForCancel:!t.Subscription.Cancelled&&t.Subscription.CancelAtEndDate}),e.nextInvoice=null,t.UpcomingInvoice&&(e.nextInvoice={date:t.UpcomingInvoice.Date,amount:t.UpcomingInvoice.Amount}),t.Subscription&&t.Subscription.Items)for(e.subscription.items=[],n=0;n<t.Subscription.Items.length;n++)e.subscription.items.push({amount:t.Subscription.Items[n].Amount,name:t.Subscription.Items[n].Name,interval:t.Subscription.Items[n].Interval,qty:t.Subscription.Items[n].Quantity});e.paymentSource=null,t.PaymentSource&&(e.paymentSource={type:t.PaymentSource.Type,description:t.PaymentSource.Description,cardBrand:t.PaymentSource.CardBrand,needsVerification:t.PaymentSource.NeedsVerification});var r=[];for(n=0;n<t.Charges.length;n++)r.push({date:t.Charges[n].CreatedDate,paymentSource:t.Charges[n].PaymentSource?t.Charges[n].PaymentSource.Description:"-",amount:t.Charges[n].Amount,status:t.Charges[n].Status,failureMessage:t.Charges[n].FailureMessage,refunded:t.Charges[n].Refunded,partiallyRefunded:t.Charges[n].PartiallyRefunded,refundedAmount:t.Charges[n].RefundedAmount,invoiceId:t.Charges[n].InvoiceId});e.charges=r})}e.expiration=null,e.$on("$viewContentLoaded",function(){c()}),e.changePayment=function(){e.selfHosted||r.open({animation:!0,templateUrl:"app/settings/views/settingsBillingChangePayment.html",controller:"organizationBillingChangePaymentController",resolve:{existingPaymentMethod:function(){return e.paymentSource?e.paymentSource.description:null}}}).result.then(function(){c()})},e.changePlan=function(){e.selfHosted||r.open({animation:!0,templateUrl:"app/organization/views/organizationBillingChangePlan.html",controller:"organizationBillingChangePlanController",resolve:{plan:function(){return e.plan}}}).result.then(function(){c()})},e.adjustSeats=function(t){!e.selfHosted&&e.canAdjustSeats&&r.open({animation:!0,templateUrl:"app/organization/views/organizationBillingAdjustSeats.html",controller:"organizationBillingAdjustSeatsController",resolve:{add:function(){return t}}}).result.then(function(){c()})},e.adjustStorage=function(t){e.selfHosted||r.open({animation:!0,templateUrl:"app/settings/views/settingsBillingAdjustStorage.html",controller:"organizationBillingAdjustStorageController",resolve:{add:function(){return t}}}).result.then(function(){c()})},e.verifyBank=function(){e.selfHosted||r.open({animation:!0,templateUrl:"app/organization/views/organizationBillingVerifyBank.html",controller:"organizationBillingVerifyBankController"}).result.then(function(){c()})},e.cancel=function(){e.selfHosted||confirm("Are you sure you want to cancel? All users will lose access to the organization at the end of this billing cycle.")&&t.organizations.putCancel({id:n.params.orgId},{}).$promise.then(function(e){a.eventTrack("Canceled Plan"),o.success("Organization subscription has been canceled."),c()})},e.reinstate=function(){e.selfHosted||confirm("Are you sure you want to remove the cancellation request and reinstate this organization?")&&t.organizations.putReinstate({id:n.params.orgId},{}).$promise.then(function(e){a.eventTrack("Reinstated Plan"),o.success("Organization cancellation request has been removed."),c()})},e.updateLicense=function(){e.selfHosted&&r.open({animation:!0,templateUrl:"app/settings/views/settingsBillingUpdateLicense.html",controller:"organizationBillingUpdateLicenseController"}).result.then(function(){c()})},e.license=function(){if(!e.selfHosted){var r=prompt("Enter your installation id");r&&""!==r&&t.organizations.getLicense({id:n.params.orgId,installationId:r},function(e){var t=JSON.stringify(e,null,2),n=new Blob([t]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(n,"bitwarden_organization_license.json");else{var r=window.document.createElement("a");r.href=window.URL.createObjectURL(n,{type:"text/plain"}),r.download="bitwarden_organization_license.json",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},function(e){400===e.status?o.error("Invalid installation id."):o.error("Unable to generate license.")})}},e.viewInvoice=function(t){if(!e.selfHosted){var r=i.apiUri+"/organizations/"+n.params.orgId+"/billing-invoice/"+t.invoiceId+"?access_token="+s.getToken();l.open(r)}}}]),angular.module("bit.organization").controller("organizationBillingUpdateLicenseController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","validationService",function(e,t,n,r,o,a,i){o.eventTrack("organizationBillingUpdateLicenseController",{category:"Modal"}),e.submit=function(s){var l=document.getElementById("file").files;if(l&&l.length){var c=new FormData;c.append("license",l[0]),e.submitPromise=r.organizations.putLicense({id:t.params.orgId},c).$promise.then(function(e){o.eventTrack("Updated License"),a.success("You have updated your license."),n.close()})}else i.addError(s,"file","Select a license file.",!0)},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationBillingVerifyBankController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr",function(e,t,n,r,o,a){o.eventTrack("organizationBillingVerifyBankController",{category:"Modal"}),e.submit=function(){var i={amount1:e.amount1,amount2:e.amount2};e.submitPromise=r.organizations.postVerifyBank({id:t.params.orgId},i).$promise.then(function(e){o.eventTrack("Verified Bank Account"),a.success("You have successfully verified your bank account."),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationCollectionsAddController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","authService",function(e,t,n,r,o,a,i){a.eventTrack("organizationCollectionsAddController",{category:"Modal"});var s=0;e.groups=[],e.selectedGroups={},e.loading=!0,e.useGroups=!1,n.opened.then(function(){return i.getUserProfile()}).then(function(n){if(n.organizations){var o=n.organizations[t.params.orgId];e.useGroups=!!o.useGroups}return e.useGroups?r.groups.listOrganization({orgId:t.params.orgId}).$promise:null}).then(function(t){if(t){for(var n=[],r=0;r<t.Data.length;r++)n.push({id:t.Data[r].Id,name:t.Data[r].Name,accessAll:t.Data[r].AccessAll}),t.Data[r].AccessAll||s++;e.groups=n,e.loading=!1}else e.loading=!1}),e.toggleGroupSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.groups.length;r++)n[e.groups[r].id]={id:e.groups[r].id,readOnly:e.groups[r].id in e.selectedGroups&&e.selectedGroups[e.groups[r].id].readOnly};e.selectedGroups=n},e.toggleGroupSelection=function(t){t in e.selectedGroups?delete e.selectedGroups[t]:e.selectedGroups[t]={id:t,readOnly:!1}},e.toggleGroupReadOnlySelection=function(t){t.id in e.selectedGroups&&(e.selectedGroups[t.id].readOnly=!t.accessAll&&!e.selectedGroups[t.id].readOnly)},e.groupSelected=function(t){return t.id in e.selectedGroups||t.accessAll},e.allSelected=function(){return Object.keys(e.selectedGroups).length>=s},e.submit=function(i){var s=o.encryptCollection(i,t.params.orgId);if(e.useGroups)for(var l in s.groups=[],e.selectedGroups)if(e.selectedGroups.hasOwnProperty(l))for(var c=0;c<e.groups.length;c++)if(e.groups[c].id===e.selectedGroups[l].id){e.groups[c].accessAll||s.groups.push(e.selectedGroups[l]);break}e.submitPromise=r.collections.post({orgId:t.params.orgId},s,function(e){a.eventTrack("Created Collection");var r=o.decryptCollection(e,t.params.orgId,!0);n.close(r)}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationCollectionsController",["$scope","$state","apiService","$uibModal","cipherService","$filter","toastr","$analytics","$uibModalStack",function(e,t,n,r,o,a,i,s,l){e.collections=[],e.loading=!0,e.$on("$viewContentLoaded",function(){n.collections.listOrganization({orgId:t.params.orgId},function(n){e.collections=o.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1,t.params.search&&(l.dismissAll(),e.filterSearch=t.params.search,$("#filterSearch").focus())})}),e.$on("organizationCollectionsAdd",function(t,n){e.add()}),e.add=function(){r.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsAdd.html",controller:"organizationCollectionsAddController"}).result.then(function(t){e.collections.push(t)})},e.edit=function(t){r.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsEdit.html",controller:"organizationCollectionsEditController",resolve:{id:function(){return t.id}}}).result.then(function(t){var n=a("filter")(e.collections,{id:t.id},!0);n&&n.length>0&&(n[0].name=t.name)})},e.users=function(e){r.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsUsers.html",controller:"organizationCollectionsUsersController",size:"lg",resolve:{collection:function(){return e}}}).result.then(function(){})},e.groups=function(e){r.open({animation:!0,templateUrl:"app/organization/views/organizationCollectionsGroups.html",controller:"organizationCollectionsGroupsController",resolve:{collection:function(){return e}}}).result.then(function(){})},e.delete=function(r){confirm("Are you sure you want to delete this collection ("+r.name+")?")&&n.collections.del({orgId:t.params.orgId,id:r.id},function(){var t=e.collections.indexOf(r);t>-1&&e.collections.splice(t,1),s.eventTrack("Deleted Collection"),i.success(r.name+" has been deleted.","Collection Deleted")},function(){i.error(r.name+" was not able to be deleted.","Error")})}}]),angular.module("bit.organization").controller("organizationCollectionsEditController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","id","authService",function(e,t,n,r,o,a,i,s){a.eventTrack("organizationCollectionsEditController",{category:"Modal"});var l=0;e.collection={},e.groups=[],e.selectedGroups={},e.loading=!0,e.useGroups=!1,n.opened.then(function(){return r.collections.getDetails({orgId:t.params.orgId,id:i}).$promise}).then(function(t){e.collection=o.decryptCollection(t);var n={};if(t.Groups)for(var r=0;r<t.Groups.length;r++)n[t.Groups[r].Id]={id:t.Groups[r].Id,readOnly:t.Groups[r].ReadOnly};return e.selectedGroups=n,s.getUserProfile()}).then(function(n){if(n.organizations){var o=n.organizations[t.params.orgId];e.useGroups=!!o.useGroups}return e.useGroups?r.groups.listOrganization({orgId:t.params.orgId}).$promise:null}).then(function(t){if(t){for(var n=[],r=0;r<t.Data.length;r++)n.push({id:t.Data[r].Id,name:t.Data[r].Name,accessAll:t.Data[r].AccessAll}),t.Data[r].AccessAll||l++;e.groups=n,e.loading=!1}else e.loading=!1}),e.toggleGroupSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.groups.length;r++)n[e.groups[r].id]={id:e.groups[r].id,readOnly:e.groups[r].id in e.selectedGroups&&e.selectedGroups[e.groups[r].id].readOnly};e.selectedGroups=n},e.toggleGroupSelection=function(t){t in e.selectedGroups?delete e.selectedGroups[t]:e.selectedGroups[t]={id:t,readOnly:!1}},e.toggleGroupReadOnlySelection=function(t){t.id in e.selectedGroups&&(e.selectedGroups[t.id].readOnly=!t.accessAll&&!e.selectedGroups[t.id].readOnly)},e.groupSelected=function(t){return t.id in e.selectedGroups||t.accessAll},e.allSelected=function(){return Object.keys(e.selectedGroups).length>=l},e.submit=function(s){var l=o.encryptCollection(s,t.params.orgId);if(e.useGroups)for(var c in l.groups=[],e.selectedGroups)if(e.selectedGroups.hasOwnProperty(c))for(var u=0;u<e.groups.length;u++)if(e.groups[u].id===e.selectedGroups[c].id){e.groups[u].accessAll||l.groups.push(e.selectedGroups[c]);break}e.submitPromise=r.collections.put({orgId:t.params.orgId,id:i},l,function(e){a.eventTrack("Edited Collection");var r=o.decryptCollection(e,t.params.orgId,!0);n.close(r)}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationCollectionsUsersController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","collection","toastr",function(e,t,n,r,o,a,i,s){a.eventTrack("organizationCollectionsUsersController",{category:"Modal"}),e.loading=!0,e.collection=i,e.users=[],n.opened.then(function(){e.loading=!1,r.collections.listUsers({orgId:t.params.orgId,id:i.id},function(t){if(t&&t.Data.length){for(var n=[],r=0;r<t.Data.length;r++)n.push({organizationUserId:t.Data[r].OrganizationUserId,name:t.Data[r].Name,email:t.Data[r].Email,type:t.Data[r].Type,status:t.Data[r].Status,readOnly:t.Data[r].ReadOnly,accessAll:t.Data[r].AccessAll});e.users=n}})}),e.remove=function(n){confirm("Are you sure you want to remove this user ("+n.email+") from this collection ("+i.name+")?")&&r.collections.delUser({orgId:t.params.orgId,id:i.id,orgUserId:n.organizationUserId},null,function(){s.success(n.email+" has been removed.","User Removed"),a.eventTrack("Removed User From Collection");var t=e.users.indexOf(n);t>-1&&e.users.splice(t,1)},function(){s.error("Unable to remove user.","Error")})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationDashboardController",["$scope","authService","$state","appSettings",function(e,t,n,r){e.selfHosted=r.selfHosted,e.$on("$viewContentLoaded",function(){t.getUserProfile().then(function(t){t.organizations&&(e.orgProfile=t.organizations[n.params.orgId])})}),e.goBilling=function(){n.go("backend.org.billing",{orgId:n.params.orgId})}}]),angular.module("bit.organization").controller("organizationDeleteController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics",function(e,t,n,r,o,a,i,s){s.eventTrack("organizationDeleteController",{category:"Modal"}),e.submit=function(){e.submitPromise=o.hashPassword(e.masterPassword).then(function(e){return n.organizations.del({id:t.params.orgId},{masterPasswordHash:e}).$promise}).then(function(){return r.dismiss("cancel"),a.removeProfileOrganization(t.params.orgId),s.eventTrack("Deleted Organization"),t.go("backend.user.vault")}).then(function(){i.success("This organization and all associated data has been deleted.","Organization Deleted")})},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationEventsController",["$scope","$state","apiService","$uibModal","$filter","toastr","$analytics","constants","eventService","$compile","$sce",function(e,t,n,r,o,a,i,s,l,c,u){e.events=[],e.orgUsers=[],e.loading=!0,e.continuationToken=null;var d=l.getDefaultDateFilters();e.filterStart=d.start,e.filterEnd=d.end,e.$on("$viewContentLoaded",function(){n.organizationUsers.list({orgId:t.params.orgId}).$promise.then(function(t){var n=[];for(p=0;p<t.Data.length;p++){var r={id:t.Data[p].Id,userId:t.Data[p].UserId,name:t.Data[p].Name,email:t.Data[p].Email};n.push(r);var o=r.name||r.email;m[r.userId]=o,g[r.id]=o}return e.orgUsers=n,f(!0)})}),e.refresh=function(){f(!0)},e.next=function(){f(!1)};var p=0,m={},g={};function f(r){var o=l.formatDateFilters(e.filterStart,e.filterEnd);if(!o.error)return r&&(e.continuationToken=null,e.events=[]),e.loading=!0,n.events.listOrganization({orgId:t.params.orgId,start:o.start,end:o.end,continuationToken:e.continuationToken}).$promise.then(function(t){e.continuationToken=t.ContinuationToken;var n=[];for(p=0;p<t.Data.length;p++){var r=t.Data[p].ActingUserId||t.Data[p].UserId,o=l.getEventInfo(t.Data[p]),a=c("<span>"+o.message+"</span>")(e);n.push({message:u.trustAsHtml(a[0].outerHTML),appIcon:o.appIcon,appName:o.appName,userId:r,userName:r&&m[r]||"-",date:t.Data[p].Date,ip:t.Data[p].IpAddress})}e.events&&e.events.length>0?e.events=e.events.concat(n):e.events=n,e.loading=!1});alert(o.error)}}]),angular.module("bit.organization").controller("organizationGroupsAddController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics",function(e,t,n,r,o,a){a.eventTrack("organizationGroupsAddController",{category:"Modal"}),e.collections=[],e.selectedCollections={},e.loading=!0,n.opened.then(function(){return r.collections.listOrganization({orgId:t.params.orgId}).$promise}).then(function(n){e.collections=o.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.collections.length;r++)n[e.collections[r].id]={id:e.collections[r].id,readOnly:e.collections[r].id in e.selectedCollections&&e.selectedCollections[e.collections[r].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(o){var i={name:o.name,accessAll:!!o.accessAll,externalId:o.externalId};if(!i.accessAll)for(var s in i.collections=[],e.selectedCollections)e.selectedCollections.hasOwnProperty(s)&&i.collections.push(e.selectedCollections[s]);e.submitPromise=r.groups.post({orgId:t.params.orgId},i,function(e){a.eventTrack("Created Group"),n.close({id:e.Id,name:e.Name})}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationGroupsController",["$scope","$state","apiService","$uibModal","$filter","toastr","$analytics","$uibModalStack",function(e,t,n,r,o,a,i,s){e.groups=[],e.loading=!0,e.$on("$viewContentLoaded",function(){n.groups.listOrganization({orgId:t.params.orgId},function(n){for(var r=[],o=0;o<n.Data.length;o++)r.push({id:n.Data[o].Id,name:n.Data[o].Name});e.groups=r,e.loading=!1,t.params.search&&(s.dismissAll(),e.filterSearch=t.params.search,$("#filterSearch").focus())})}),e.$on("organizationGroupsAdd",function(t,n){e.add()}),e.add=function(){r.open({animation:!0,templateUrl:"app/organization/views/organizationGroupsAdd.html",controller:"organizationGroupsAddController"}).result.then(function(t){e.groups.push(t)})},e.edit=function(t){r.open({animation:!0,templateUrl:"app/organization/views/organizationGroupsEdit.html",controller:"organizationGroupsEditController",resolve:{id:function(){return t.id}}}).result.then(function(t){var n=o("filter")(e.groups,{id:t.id},!0);n&&n.length>0&&(n[0].name=t.name)})},e.users=function(e){r.open({animation:!0,templateUrl:"app/organization/views/organizationGroupsUsers.html",controller:"organizationGroupsUsersController",size:"lg",resolve:{group:function(){return e}}}).result.then(function(){})},e.delete=function(r){confirm("Are you sure you want to delete this group ("+r.name+")?")&&n.groups.del({orgId:t.params.orgId,id:r.id},function(){var t=e.groups.indexOf(r);t>-1&&e.groups.splice(t,1),i.eventTrack("Deleted Group"),a.success(r.name+" has been deleted.","Group Deleted")},function(){a.error(r.name+" was not able to be deleted.","Error")})}}]),angular.module("bit.organization").controller("organizationGroupsEditController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics","id",function(e,t,n,r,o,a,i){a.eventTrack("organizationGroupsEditController",{category:"Modal"}),e.collections=[],e.selectedCollections={},e.loading=!0,n.opened.then(function(){return r.groups.getDetails({orgId:t.params.orgId,id:i}).$promise}).then(function(n){e.group={id:i,name:n.Name,externalId:n.ExternalId,accessAll:n.AccessAll};var o={};if(n.Collections)for(var a=0;a<n.Collections.length;a++)o[n.Collections[a].Id]={id:n.Collections[a].Id,readOnly:n.Collections[a].ReadOnly};return e.selectedCollections=o,r.collections.listOrganization({orgId:t.params.orgId}).$promise}).then(function(n){e.collections=o.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.collections.length;r++)n[e.collections[r].id]={id:e.collections[r].id,readOnly:e.collections[r].id in e.selectedCollections&&e.selectedCollections[e.collections[r].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(){var o={name:e.group.name,accessAll:!!e.group.accessAll,externalId:e.group.externalId};if(!o.accessAll)for(var s in o.collections=[],e.selectedCollections)e.selectedCollections.hasOwnProperty(s)&&o.collections.push(e.selectedCollections[s]);e.submitPromise=r.groups.put({orgId:t.params.orgId,id:i},o,function(e){a.eventTrack("Edited Group"),n.close({id:e.Id,name:e.Name})}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationGroupsUsersController",["$scope","$state","$uibModalInstance","apiService","$analytics","group","toastr",function(e,t,n,r,o,a,i){o.eventTrack("organizationGroupUsersController",{category:"Modal"}),e.loading=!0,e.group=a,e.users=[],n.opened.then(function(){return r.groups.listUsers({orgId:t.params.orgId,id:a.id}).$promise}).then(function(t){var n=[];if(t&&t.Data.length)for(var r=0;r<t.Data.length;r++)n.push({organizationUserId:t.Data[r].OrganizationUserId,name:t.Data[r].Name,email:t.Data[r].Email,type:t.Data[r].Type,status:t.Data[r].Status,accessAll:t.Data[r].AccessAll});e.users=n,e.loading=!1}),e.remove=function(n){confirm("Are you sure you want to remove this user ("+n.email+") from this group ("+a.name+")?")&&r.groups.delUser({orgId:t.params.orgId,id:a.id,orgUserId:n.organizationUserId},null,function(){i.success(n.email+" has been removed.","User Removed"),o.eventTrack("Removed User From Group");var t=e.users.indexOf(n);t>-1&&e.users.splice(t,1)},function(){i.error("Unable to remove user.","Error")})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleController",["$scope","$state","$uibModal","cryptoService","apiService","authService","toastr","$analytics","$filter","$uibModalStack",function(e,t,n,r,o,a,i,s,l,c){function u(){o.organizationUsers.list({orgId:t.params.orgId},function(n){for(var r=[],o=0;o<n.Data.length;o++){var a={id:n.Data[o].Id,userId:n.Data[o].UserId,name:n.Data[o].Name,email:n.Data[o].Email,status:n.Data[o].Status,type:n.Data[o].Type,accessAll:n.Data[o].AccessAll};r.push(a)}if(e.users=r,t.params.search&&(c.dismissAll(),e.filterSearch=t.params.search,$("#filterSearch").focus()),t.params.viewEvents){c.dismissAll();var i=l("filter")(e.users,{id:t.params.viewEvents});i&&i.length&&e.events(i[0])}})}e.users=[],e.useGroups=!1,e.useEvents=!1,e.$on("$viewContentLoaded",function(){u(),a.getUserProfile().then(function(n){if(n.organizations){var r=n.organizations[t.params.orgId];e.useGroups=!!r.useGroups,e.useEvents=!!r.useEvents}})}),e.reinvite=function(e){o.organizationUsers.reinvite({orgId:t.params.orgId,id:e.id},null,function(){s.eventTrack("Reinvited User"),i.success(e.email+" has been invited again.","User Invited")},function(){i.error("Unable to invite user.","Error")})},e.delete=function(n){confirm("Are you sure you want to remove this user ("+n.email+")?")&&o.organizationUsers.del({orgId:t.params.orgId,id:n.id},null,function(){s.eventTrack("Deleted User"),i.success(n.email+" has been removed.","User Removed");var t=e.users.indexOf(n);t>-1&&e.users.splice(t,1)},function(){i.error("Unable to remove user.","Error")})},e.confirm=function(e){o.users.getPublicKey({id:e.userId},function(n){var a=r.getOrgKey(t.params.orgId);if(a){var l=r.rsaEncrypt(a.key,n.PublicKey);o.organizationUsers.confirm({orgId:t.params.orgId,id:e.id},{key:l},function(){e.status=2,s.eventTrack("Confirmed User"),i.success(e.email+" has been confirmed.","User Confirmed")},function(){i.error("Unable to confirm user.","Error")})}else i.error("Unable to confirm user.","Error")},function(){i.error("Unable to confirm user.","Error")})},e.$on("organizationPeopleInvite",function(t,n){e.invite()}),e.invite=function(){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleInvite.html",controller:"organizationPeopleInviteController"}).result.then(function(){u()})},e.edit=function(e){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleEdit.html",controller:"organizationPeopleEditController",resolve:{orgUser:function(){return e}}}).result.then(function(){u()})},e.groups=function(e){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleGroups.html",controller:"organizationPeopleGroupsController",resolve:{orgUser:function(){return e}}}).result.then(function(){})},e.events=function(e){n.open({animation:!0,templateUrl:"app/organization/views/organizationPeopleEvents.html",controller:"organizationPeopleEventsController",resolve:{orgUser:function(){return e},orgId:function(){return t.params.orgId}}})}}]),angular.module("bit.organization").controller("organizationPeopleEditController",["$scope","$state","$uibModalInstance","apiService","cipherService","orgUser","$analytics",function(e,t,n,r,o,a,i){i.eventTrack("organizationPeopleEditController",{category:"Modal"}),e.loading=!0,e.collections=[],e.selectedCollections={},n.opened.then(function(){r.collections.listOrganization({orgId:t.params.orgId},function(n){e.collections=o.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1}),r.organizationUsers.get({orgId:t.params.orgId,id:a.id},function(t){var n={};if(t&&t.Collections)for(var r=0;r<t.Collections.length;r++)n[t.Collections[r].Id]={id:t.Collections[r].Id,readOnly:t.Collections[r].ReadOnly};e.email=a.email,e.type=t.Type,e.accessAll=t.AccessAll,e.selectedCollections=n})}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.collections.length;r++)n[e.collections[r].id]={id:e.collections[r].id,readOnly:e.collections[r].id in e.selectedCollections&&e.selectedCollections[e.collections[r].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submitPromise=null,e.submit=function(o){var s=[];if(!e.accessAll)for(var l in e.selectedCollections)e.selectedCollections.hasOwnProperty(l)&&s.push(e.selectedCollections[l]);e.submitPromise=r.organizationUsers.put({orgId:t.params.orgId,id:a.id},{type:e.type,collections:s,accessAll:e.accessAll},function(){i.eventTrack("Edited User"),n.close()}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleEventsController",["$scope","apiService","$uibModalInstance","orgUser","$analytics","eventService","orgId","$compile","$sce",function(e,t,n,r,o,a,i,s,l){o.eventTrack("organizationPeopleEventsController",{category:"Modal"}),e.email=r.email,e.events=[],e.loading=!0,e.continuationToken=null;var c=a.getDefaultDateFilters();function u(n){var o=a.formatDateFilters(e.filterStart,e.filterEnd);if(!o.error)return n&&(e.continuationToken=null,e.events=[]),e.loading=!0,t.events.listOrganizationUser({orgId:i,id:r.id,start:o.start,end:o.end,continuationToken:e.continuationToken}).$promise.then(function(t){e.continuationToken=t.ContinuationToken;for(var n=[],r=0;r<t.Data.length;r++){var o=a.getEventInfo(t.Data[r]),i=s("<span>"+o.message+"</span>")(e);n.push({message:l.trustAsHtml(i[0].outerHTML),appIcon:o.appIcon,appName:o.appName,date:t.Data[r].Date,ip:t.Data[r].IpAddress})}e.events&&e.events.length>0?e.events=e.events.concat(n):e.events=n,e.loading=!1});alert(o.error)}e.filterStart=c.start,e.filterEnd=c.end,n.opened.then(function(){u(!0)}),e.refresh=function(){u(!0)},e.next=function(){u(!1)},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleGroupsController",["$scope","$state","$uibModalInstance","apiService","orgUser","$analytics",function(e,t,n,r,o,a){a.eventTrack("organizationPeopleGroupsController",{category:"Modal"}),e.loading=!0,e.groups=[],e.selectedGroups={},e.orgUser=o,n.opened.then(function(){return r.groups.listOrganization({orgId:t.params.orgId}).$promise}).then(function(n){for(var a=[],i=0;i<n.Data.length;i++)a.push({id:n.Data[i].Id,name:n.Data[i].Name});return e.groups=a,r.organizationUsers.listGroups({orgId:t.params.orgId,id:o.id}).$promise}).then(function(t){var n={};if(t)for(var r=0;r<t.length;r++)n[t[r]]=!0;e.selectedGroups=n,e.loading=!1}),e.toggleGroupSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.groups.length;r++)n[e.groups[r].id]=!0;e.selectedGroups=n},e.toggleGroupSelection=function(t){t in e.selectedGroups?delete e.selectedGroups[t]:e.selectedGroups[t]=!0},e.groupSelected=function(t){return t.id in e.selectedGroups},e.allSelected=function(){return Object.keys(e.selectedGroups).length===e.groups.length},e.submitPromise=null,e.submit=function(i){var s=[];for(var l in e.selectedGroups)e.selectedGroups.hasOwnProperty(l)&&s.push(l);e.submitPromise=r.organizationUsers.putGroups({orgId:t.params.orgId,id:o.id},{groupIds:s},function(){a.eventTrack("Edited User Groups"),n.close()}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationPeopleInviteController",["$scope","$state","$uibModalInstance","apiService","cipherService","$analytics",function(e,t,n,r,o,a){a.eventTrack("organizationPeopleInviteController",{category:"Modal"}),e.loading=!0,e.collections=[],e.selectedCollections={},e.model={type:"User"},n.opened.then(function(){r.collections.listOrganization({orgId:t.params.orgId},function(n){e.collections=o.decryptCollections(n.Data,t.params.orgId,!0),e.loading=!1})}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.collections.length;r++)n[e.collections[r].id]={id:e.collections[r].id,readOnly:e.collections[r].id in e.selectedCollections&&e.selectedCollections[e.collections[r].id].readOnly};e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]={id:t,readOnly:!1}},e.toggleCollectionReadOnlySelection=function(t){t in e.selectedCollections&&(e.selectedCollections[t].readOnly=!e.selectedCollections[t].readOnly)},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submitPromise=null,e.submit=function(o){var i=[];if(!o.accessAll)for(var s in e.selectedCollections)e.selectedCollections.hasOwnProperty(s)&&i.push(e.selectedCollections[s]);var l=o.emails.trim().split(/\s*,\s*/);e.submitPromise=r.organizationUsers.invite({orgId:t.params.orgId},{emails:l,type:o.type,collections:i,accessAll:o.accessAll},function(){a.eventTrack("Invited User"),n.close()}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationSettingsController",["$scope","$state","apiService","toastr","authService","$uibModal","$analytics","appSettings",function(e,t,n,r,o,a,i,s){e.selfHosted=s.selfHosted,e.model={},e.$on("$viewContentLoaded",function(){n.organizations.get({id:t.params.orgId},function(t){e.model={name:t.Name,billingEmail:t.BillingEmail,businessName:t.BusinessName,businessAddress1:t.BusinessAddress1,businessAddress2:t.BusinessAddress2,businessAddress3:t.BusinessAddress3,businessCountry:t.BusinessCountry,businessTaxNumber:t.BusinessTaxNumber}})}),e.generalSave=function(){e.selfHosted||(e.generalPromise=n.organizations.put({id:t.params.orgId},e.model,function(e){o.updateProfileOrganization(e).then(function(e){i.eventTrack("Updated Organization Settings"),r.success("Organization has been updated.","Success!")})}).$promise)},e.import=function(){a.open({animation:!0,templateUrl:"app/tools/views/toolsImport.html",controller:"organizationSettingsImportController"})},e.export=function(){a.open({animation:!0,templateUrl:"app/tools/views/toolsExport.html",controller:"organizationSettingsExportController"})},e.delete=function(){a.open({animation:!0,templateUrl:"app/organization/views/organizationDelete.html",controller:"organizationDeleteController"})}}]),angular.module("bit.organization").controller("organizationSettingsExportController",["$scope","apiService","$uibModalInstance","cipherService","$q","toastr","$analytics","$state","constants",function(e,t,n,r,o,a,i,s,l){function c(){var e=new Date;return"bitwarden_org_export_"+(e.getFullYear()+""+u(e.getMonth()+1,2)+u(e.getDate(),2)+u(e.getHours(),2)+u(e.getMinutes(),2)+u(e.getSeconds(),2))+".csv"}function u(e,t,n){return n=n||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(n)+e}i.eventTrack("organizationSettingsExportController",{category:"Modal"}),e.export=function(n){e.startedExport=!0;var u=[],d=[],p=t.collections.listOrganization({orgId:s.params.orgId},function(e){d=r.decryptCollections(e.Data,s.params.orgId,!0)}).$promise,m=t.ciphers.listOrganizationDetails({organizationId:s.params.orgId},function(e){u=r.decryptCiphers(e.Data)}).$promise;o.all([p,m]).then(function(){if(!u.length)return a.error("Nothing to export.","Error!"),void e.close();var t,n={};for(t=0;t<d.length;t++)n[d[t].id]=d[t];try{var r=[];for(t=0;t<u.length;t++)if(u[t].type===l.cipherType.login||u[t].type===l.cipherType.secureNote){var o,s={collections:[],type:null,name:u[t].name,notes:u[t].notes,fields:null,login_uri:null,login_username:null,login_password:null,login_totp:null};if(u[t].collectionIds)for(o=0;o<u[t].collectionIds.length;o++)n.hasOwnProperty(u[t].collectionIds[o])&&s.collections.push(n[u[t].collectionIds[o]].name);if(u[t].fields)for(o=0;o<u[t].fields.length;o++)s.fields?s.fields+="\n":s.fields="",s.fields+=(u[t].fields[o].name||"")+": "+u[t].fields[o].value;switch(u[t].type){case l.cipherType.login:if(s.type="login",s.login_uri=null,s.login_username=u[t].login.username,s.login_password=u[t].login.password,s.login_totp=u[t].login.totp,u[t].login.uris&&u[t].login.uris.length)for(s.login_uri=[],o=0;o<u[t].login.uris.length;o++)s.login_uri.push(u[t].login.uris[o].uri);break;case l.cipherType.secureNote:s.type="note";break;default:continue}r.push(s)}var p=Papa.unparse(r),m=new Blob([p]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(m,c());else{var g=window.document.createElement("a");g.href=window.URL.createObjectURL(m,{type:"text/plain"}),g.download=c(),document.body.appendChild(g),g.click(),document.body.removeChild(g)}i.eventTrack("Exported Organization Data"),a.success("Your data has been exported. Check your browser's downloads folder.","Success!"),e.close()}catch(t){a.error("Something went wrong. Please try again.","Error!"),e.close()}},function(){a.error("Something went wrong. Please try again.","Error!"),e.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationSettingsImportController",["$scope","$state","apiService","$uibModalInstance","cipherService","toastr","importService","$analytics","$sce","validationService","cryptoService",function(e,t,n,r,o,a,i,s,l,c,u){function d(i,l,c){if(i.length||l.length){if(l.length){var d=Math.floor(l.length/2),g=l.length-1;if(p(l[0])&&p(l[d])&&p(l[g]))return void m("Data is not formatted correctly. Please check your import file and try again.")}n.ciphers.importOrg({orgId:t.params.orgId},{collections:o.encryptCollections(i,t.params.orgId),ciphers:o.encryptCiphers(l,u.getOrgKey(t.params.orgId)),collectionRelationships:c},function(){r.dismiss("cancel"),t.go("backend.org.vault",{orgId:t.params.orgId}).then(function(){s.eventTrack("Imported Org Data",{label:e.model.source}),a.success("Data has been successfully imported into your vault.","Import Success")})},m)}else m("Nothing was imported.")}function p(e){return(null===e.name||"--"===e.name)&&e.login&&(null===e.login.password||""===e.login.password)}function m(t){if(s.eventTrack("Import Org Data Failed",{label:e.model.source}),r.dismiss("cancel"),t){var n=t.data;if(!n||!n.ValidationErrors)return n&&n.Message?void a.error(n.Message):void a.error(t);var o="";for(var i in n.ValidationErrors)if(n.ValidationErrors.hasOwnProperty(i))for(var l=0;l<n.ValidationErrors[i].length;l++)o+=i+": "+n.ValidationErrors[i][l]+" ";if(""!==o)return void a.error(o)}a.error("Something went wrong. Try again.","Oh No!")}s.eventTrack("organizationSettingsImportController",{category:"Modal"}),e.model={source:""},e.source={},e.splitFeatured=!1,e.options=[{id:"bitwardencsv",name:"Bitwarden (csv)",featured:!0,sort:1,instructions:l.trustAsHtml('Export using the web vault (vault.bitwarden.com). Log into the web vault and navigate to your organization\'s admin area. Then to go "Settings" > "Tools" > "Export".')},{id:"lastpass",name:"LastPass (csv)",featured:!0,sort:2,instructions:l.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-lastpass/">https://help.bitwarden.com/article/import-from-lastpass/</a>')}],e.setSource=function(){for(var t=0;t<e.options.length;t++)if(e.options[t].id===e.model.source){e.source=e.options[t];break}},e.setSource(),e.import=function(t,n){if(t.source&&""!==t.source){var r=document.getElementById("file").files[0];r||t.fileContents&&""!==t.fileContents?(e.processing=!0,i.importOrg(t.source,r||t.fileContents,d,m)):c.addError(n,"file","Select the import file or copy/paste the import file contents.",!0)}else c.addError(n,"source","Select the format of the import file.",!0)},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationVaultAddCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","$analytics","authService","orgId","$uibModal","constants","selectedType",function(e,t,n,r,o,a,i,s,l,c,u,d){function p(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}i.eventTrack("organizationVaultAddCipherController",{category:"Modal"}),e.constants=u,e.selectedType=d?d.toString():u.cipherType.login.toString(),e.cipher={type:d||u.cipherType.login,login:{uris:[{uri:null,match:null,matchValue:null}]},identity:{},card:{},secureNote:{type:"0"}},e.hideFolders=e.hideFavorite=e.fromOrg=!0,s.getUserProfile().then(function(t){var n=t.organizations[l];e.useTotp=n.useTotp}),e.typeChanged=function(){e.cipher.type=parseInt(e.selectedType)},e.savePromise=null,e.save=function(){e.cipher.organizationId=l;var r=o.encryptCipher(e.cipher);e.savePromise=t.ciphers.postAdmin(r,function(e){i.eventTrack("Created Organization Cipher");var t=o.decryptCipherPreview(e);n.close(t)}).$promise},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(i.eventTrack("Generated Password From Add"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addUri=function(){e.cipher.login&&(e.cipher.login.uris||(e.cipher.login.uris=[]),e.cipher.login.uris.push({uri:null,match:null,matchValue:null}))},e.removeUri=function(t){if(e.cipher.login&&e.cipher.login.uris){var n=e.cipher.login.uris.indexOf(t);n>-1&&e.cipher.login.uris.splice(n,1)}},e.uriMatchChanged=function(e){!e.matchValue&&0!==e.matchValue||""===e.matchValue?e.match=null:e.match=parseInt(e.matchValue)},e.addField=function(){e.cipher.fields||(e.cipher.fields=[]),e.cipher.fields.push({type:u.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.clipboardSuccess=function(e){e.clearSelection(),p(e)},e.clipboardError=function(e,t){t&&p(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.close=function(){n.dismiss("close")},e.showUpgrade=function(){c.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return l}}})}}]),angular.module("bit.organization").controller("organizationVaultAttachmentsController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","cipherId","$analytics","validationService","toastr","$timeout",function(e,t,n,r,o,a,i,s,l,c){i.eventTrack("organizationVaultAttachmentsController",{category:"Modal"}),e.cipher={},e.loading=!0,e.isPremium=!0,e.canUseAttachments=!0;var u=!1;t.ciphers.getAdmin({id:a},function(t){e.cipher=o.decryptCipher(t),e.loading=!1},function(){e.loading=!1}),e.save=function(c){var d=document.getElementById("file").files;if(d&&d.length){var p=r.getOrgKey(e.cipher.organizationId);e.savePromise=o.encryptAttachmentFile(p,d[0]).then(function(e){var n=new FormData,r=new Blob([e.data],{type:"application/octet-stream"});return n.append("data",r,e.fileName),t.ciphers.postAttachmentAdmin({id:a},n).$promise}).then(function(e){i.eventTrack("Added Attachment"),l.success("The attachment has been added."),u=!0,n.close(!0)},function(e){var t=s.parseErrors(e);l.error(t.length?t[0]:"An error occurred.")})}else s.addError(c,"file","Select a file.",!0)},e.download=function(t){t.loading=!0;var n=r.getOrgKey(e.cipher.organizationId);o.downloadAndDecryptAttachment(n,t,!0).then(function(e){c(function(){t.loading=!1})},function(){c(function(){t.loading=!1})})},e.remove=function(n){confirm("Are you sure you want to delete this attachment ("+n.fileName+")?")&&(n.loading=!0,t.ciphers.delAttachmentAdmin({id:a,attachmentId:n.id}).$promise.then(function(){n.loading=!1,i.eventTrack("Deleted Organization Attachment");var t=e.cipher.attachments.indexOf(n);t>-1&&e.cipher.attachments.splice(t,1)},function(){l.error("Cannot delete attachment."),n.loading=!1}))},e.close=function(){n.dismiss("cancel")},e.$on("modal.closing",function(t,r,o){u||(t.preventDefault(),u=!0,n.close(!!e.cipher.attachments&&e.cipher.attachments.length>0))})}]),angular.module("bit.organization").controller("organizationVaultCipherCollectionsController",["$scope","apiService","$uibModalInstance","cipherService","cipher","$analytics","collections",function(e,t,n,r,o,a,i){a.eventTrack("organizationVaultCipherCollectionsController",{category:"Modal"}),e.cipher={},e.collections=[],e.selectedCollections={},n.opened.then(function(){for(var t=[],n=0;n<i.length;n++)i[n].id&&t.push(i[n]);e.collections=t,e.cipher=o;var r={};if(e.cipher.collectionIds)for(n=0;n<e.cipher.collectionIds.length;n++)r[e.cipher.collectionIds[n]]=!0;e.selectedCollections=r}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.collections.length;r++)n[e.collections[r].id]=!0;e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]=!0},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(){var r={collectionIds:[]};for(var i in e.selectedCollections)e.selectedCollections.hasOwnProperty(i)&&r.collectionIds.push(i);e.submitPromise=t.ciphers.putCollectionsAdmin({id:o.id},r).$promise.then(function(e){a.eventTrack("Edited Cipher Collections"),n.close({action:"collectionsEdit",collectionIds:r.collectionIds})})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationVaultCipherEventsController",["$scope","apiService","$uibModalInstance","cipher","$analytics","eventService",function(e,t,n,r,o,a){o.eventTrack("organizationVaultCipherEventsController",{category:"Modal"}),e.cipher=r,e.events=[],e.loading=!0,e.continuationToken=null;var i=a.getDefaultDateFilters();e.filterStart=i.start,e.filterEnd=i.end,n.opened.then(function(){t.organizationUsers.list({orgId:r.organizationId}).$promise.then(function(t){var n=[];for(s=0;s<t.Data.length;s++){var r={id:t.Data[s].Id,userId:t.Data[s].UserId,name:t.Data[s].Name,email:t.Data[s].Email};n.push(r);var o=r.name||r.email;l[r.userId]=o,c[r.id]=o}return e.orgUsers=n,u(!0)})}),e.refresh=function(){u(!0)},e.next=function(){u(!1)};var s=0,l={},c={};function u(n){var o=a.formatDateFilters(e.filterStart,e.filterEnd);if(!o.error)return n&&(e.continuationToken=null,e.events=[]),e.loading=!0,t.events.listCipher({id:r.id,start:o.start,end:o.end,continuationToken:e.continuationToken}).$promise.then(function(t){e.continuationToken=t.ContinuationToken;var n=[];for(s=0;s<t.Data.length;s++){var r=t.Data[s].ActingUserId||t.Data[s].UserId,o=a.getEventInfo(t.Data[s],{cipherInfo:!1});n.push({message:o.message,appIcon:o.appIcon,appName:o.appName,userId:r,userName:r&&l[r]||"-",date:t.Data[s].Date,ip:t.Data[s].IpAddress})}e.events&&e.events.length>0?e.events=e.events.concat(n):e.events=n,e.loading=!1});alert(o.error)}e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("organizationVaultController",["$scope","apiService","cipherService","$analytics","$q","$state","$localStorage","$uibModal","$filter","authService","$uibModalStack","constants","$timeout",function(e,t,n,r,o,a,i,s,l,c,u,d,p){function m(){e.selectedCollection=void 0,e.selectedType=void 0,e.selectedAll=!1}function g(){$.AdminLTE&&$.AdminLTE.layout&&p(function(){$.AdminLTE.layout.fix()},0)}e.ciphers=[],e.collections=[],e.loading=!0,e.useEvents=!1,e.constants=d,e.filter=void 0,e.selectedType=void 0,e.selectedCollection=void 0,e.selectedAll=!0,e.selectedTitle="All",e.selectedIcon="fa-th",e.$on("$viewContentLoaded",function(){c.getUserProfile().then(function(t){if(t.organizations){var n=t.organizations[a.params.orgId];e.useEvents=!!n.useEvents}});var r=t.collections.listOrganization({orgId:a.params.orgId},function(t){for(var r=[{id:null,name:"Unassigned"}],o=0;o<t.Data.length;o++){var a=n.decryptCollection(t.Data[o],null,!0);r.push(a)}e.collections=r}).$promise,i=t.ciphers.listOrganizationDetails({organizationId:a.params.orgId},function(t){for(var r=[],o=0;o<t.Data.length;o++){var a=n.decryptCipherPreview(t.Data[o]);r.push(a)}e.ciphers=r}).$promise;o.all([r,i]).then(function(){if(e.loading=!1,p(function(){$("body").hasClass("control-sidebar-open")&&$("#search").focus()},500),a.params.search&&(u.dismissAll(),e.searchVaultText=a.params.search),a.params.viewEvents){u.dismissAll();var t=l("filter")(e.ciphers,{id:a.params.viewEvents});t&&t.length&&e.viewEvents(t[0])}})}),e.collectionSort=function(e){return e.id?e.name.toLowerCase():""},e.editCipher=function(t){s.open({animation:!0,templateUrl:"app/vault/views/vaultEditCipher.html",controller:"organizationVaultEditCipherController",resolve:{cipherId:function(){return t.id},orgId:function(){return a.params.orgId}}}).result.then(function(n){var r;"edit"===n.action?(r=e.ciphers.indexOf(t))>-1&&(n.data.collectionIds=e.ciphers[r].collectionIds,e.ciphers[r]=n.data):"delete"===n.action&&(r=e.ciphers.indexOf(t))>-1&&e.ciphers.splice(r,1)})},e.$on("organizationVaultAddCipher",function(t,n){e.addCipher()}),e.addCipher=function(){s.open({animation:!0,templateUrl:"app/vault/views/vaultAddCipher.html",controller:"organizationVaultAddCipherController",resolve:{orgId:function(){return a.params.orgId},selectedType:function(){return e.selectedType}}}).result.then(function(t){e.ciphers.push(t)})},e.editCollections=function(t){s.open({animation:!0,templateUrl:"app/organization/views/organizationVaultCipherCollections.html",controller:"organizationVaultCipherCollectionsController",resolve:{cipher:function(){return t},collections:function(){return e.collections}}}).result.then(function(e){e.collectionIds&&(t.collectionIds=e.collectionIds)})},e.viewEvents=function(e){s.open({animation:!0,templateUrl:"app/organization/views/organizationVaultCipherEvents.html",controller:"organizationVaultCipherEventsController",resolve:{cipher:function(){return e}}})},e.attachments=function(e){c.getUserProfile().then(function(t){return!!t.organizations[e.organizationId].maxStorageGb}).then(function(t){t?s.open({animation:!0,templateUrl:"app/vault/views/vaultAttachments.html",controller:"organizationVaultAttachmentsController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){e.hasAttachments=t}):s.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return e.organizationId}}})})},e.deleteCipher=function(n){confirm("Are you sure you want to delete this item ("+n.name+")?")&&t.ciphers.delAdmin({id:n.id},function(){r.eventTrack("Deleted Cipher");var t=e.ciphers.indexOf(n);t>-1&&e.ciphers.splice(t,1)})},e.filterCollection=function(t){m(),e.selectedCollection=t,e.selectedIcon="fa-cube",e.filter=function(e){return e.collectionIds&&e.collectionIds.indexOf(t.id)>-1},g()},e.filterType=function(t){switch(m(),e.selectedType=t,t){case d.cipherType.login:e.selectedTitle="Login",e.selectedIcon="fa-globe";break;case d.cipherType.card:e.selectedTitle="Card",e.selectedIcon="fa-credit-card";break;case d.cipherType.identity:e.selectedTitle="Identity",e.selectedIcon="fa-id-card-o";break;case d.cipherType.secureNote:e.selectedTitle="Secure Note",e.selectedIcon="fa-sticky-note-o"}e.filter=function(e){return e.type===t},g()},e.filterAll=function(){m(),e.selectedAll=!0,e.selectedTitle="All",e.selectedIcon="fa-th",e.filter=null,g()},e.cipherFilter=function(){return function(t){return!e.filter||e.filter(t)}}}]),angular.module("bit.organization").controller("organizationVaultEditCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","cipherId","$analytics","orgId","$uibModal","constants",function(e,t,n,r,o,a,i,s,l,c,u){function d(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}s.eventTrack("organizationVaultEditCipherController",{category:"Modal"}),e.cipher={},e.hideFolders=e.hideFavorite=e.fromOrg=!0,e.constants=u,t.ciphers.getAdmin({id:i},function(t){e.cipher=o.decryptCipher(t),e.useTotp=e.cipher.organizationUseTotp,function(){if(e.cipher.login&&e.cipher.login.uris)for(var t=0;t<e.cipher.login.uris.length;t++)e.cipher.login.uris[t].matchValue=e.cipher.login.uris[t].match||0===e.cipher.login.uris[t].match?e.cipher.login.uris[t].match.toString():""}()}),e.save=function(r){var a=o.encryptCipher(r,e.cipher.type);e.savePromise=t.ciphers.putAdmin({id:i},a,function(e){s.eventTrack("Edited Organization Cipher");var t=o.decryptCipherPreview(e);n.close({action:"edit",data:t})}).$promise},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(s.eventTrack("Generated Password From Edit"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addUri=function(){e.cipher.login&&(e.cipher.login.uris||(e.cipher.login.uris=[]),e.cipher.login.uris.push({uri:null,match:null,matchValue:null}))},e.removeUri=function(t){if(e.cipher.login&&e.cipher.login.uris){var n=e.cipher.login.uris.indexOf(t);n>-1&&e.cipher.login.uris.splice(n,1)}},e.uriMatchChanged=function(e){!e.matchValue&&0!==e.matchValue||""===e.matchValue?e.match=null:e.match=parseInt(e.matchValue)},e.addField=function(){e.cipher.login.fields||(e.cipher.login.fields=[]),e.cipher.fields.push({type:u.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.clipboardSuccess=function(e){e.clearSelection(),d(e)},e.clipboardError=function(e,t){t&&d(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.delete=function(){confirm("Are you sure you want to delete this item ("+e.cipher.name+")?")&&t.ciphers.delAdmin({id:e.cipher.id},function(){s.eventTrack("Deleted Organization Cipher From Edit"),n.close({action:"delete",data:e.cipher.id})})},e.close=function(){n.dismiss("cancel")},e.showUpgrade=function(){c.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return l}}})}}]),angular.module("bit.tools").controller("reportsBreachController",["$scope","apiService","toastr","authService",function(e,t,n,r){e.loading=!0,e.error=!1,e.breachAccounts=[],e.email=null,e.$on("$viewContentLoaded",function(){r.getUserProfile().then(function(n){return e.email=n.email,t.hibp.get({email:e.email}).$promise}).then(function(t){for(var n=[],r=0;r<t.length;r++){var o={id:t[r].Name,title:t[r].Title,domain:t[r].Domain,date:new Date(t[r].BreachDate),reportedDate:new Date(t[r].AddedDate),modifiedDate:new Date(t[r].ModifiedDate),count:t[r].PwnCount,description:t[r].Description,classes:t[r].DataClasses,image:"https://haveibeenpwned.com/Content/Images/PwnedLogos/"+t[r].Name+"."+t[r].LogoType};n.push(o)}e.breachAccounts=n,e.loading=!1},function(t){e.error=404!==t.status,e.loading=!1})})}]),angular.module("bit.services").factory("apiService",["$resource","tokenService","appSettings","$httpParamSerializer","utilsService",function(e,t,n,r,o){var a={},i=n.apiUri,s=n.identityUri;return a.folders=e(i+"/folders/:id",{},{get:{method:"GET",params:{id:"@id"}},list:{method:"GET",params:{}},post:{method:"POST",params:{}},put:{method:"POST",params:{id:"@id"}},del:{url:i+"/folders/:id/delete",method:"POST",params:{id:"@id"}}}),a.ciphers=e(i+"/ciphers/:id",{},{get:{method:"GET",params:{id:"@id"}},getAdmin:{url:i+"/ciphers/:id/admin",method:"GET",params:{id:"@id"}},getDetails:{url:i+"/ciphers/:id/details",method:"GET",params:{id:"@id"}},list:{method:"GET",params:{}},listDetails:{url:i+"/ciphers/details",method:"GET",params:{}},listOrganizationDetails:{url:i+"/ciphers/organization-details",method:"GET",params:{}},post:{method:"POST",params:{}},postAdmin:{url:i+"/ciphers/admin",method:"POST",params:{}},put:{method:"POST",params:{id:"@id"}},putAdmin:{url:i+"/ciphers/:id/admin",method:"POST",params:{id:"@id"}},import:{url:i+"/ciphers/import",method:"POST",params:{}},importOrg:{url:i+"/ciphers/import-organization?organizationId=:orgId",method:"POST",params:{orgId:"@orgId"}},putPartial:{url:i+"/ciphers/:id/partial",method:"POST",params:{id:"@id"}},putShare:{url:i+"/ciphers/:id/share",method:"POST",params:{id:"@id"}},putCollections:{url:i+"/ciphers/:id/collections",method:"POST",params:{id:"@id"}},putCollectionsAdmin:{url:i+"/ciphers/:id/collections-admin",method:"POST",params:{id:"@id"}},del:{url:i+"/ciphers/:id/delete",method:"POST",params:{id:"@id"}},delAdmin:{url:i+"/ciphers/:id/delete-admin",method:"POST",params:{id:"@id"}},delMany:{url:i+"/ciphers/delete",method:"POST"},moveMany:{url:i+"/ciphers/move",method:"POST"},purge:{url:i+"/ciphers/purge",method:"POST"},postAttachment:{url:i+"/ciphers/:id/attachment",method:"POST",headers:{"Content-Type":void 0},params:{id:"@id"}},postAttachmentAdmin:{url:i+"/ciphers/:id/attachment-admin",method:"POST",headers:{"Content-Type":void 0},params:{id:"@id"}},postShareAttachment:{url:i+"/ciphers/:id/attachment/:attachmentId/share?organizationId=:orgId",method:"POST",headers:{"Content-Type":void 0},params:{id:"@id",attachmentId:"@attachmentId",orgId:"@orgId"}},delAttachment:{url:i+"/ciphers/:id/attachment/:attachmentId/delete",method:"POST",params:{id:"@id",attachmentId:"@attachmentId"}},delAttachmentAdmin:{url:i+"/ciphers/:id/attachment/:attachmentId/delete-admin",method:"POST",params:{id:"@id",attachmentId:"@attachmentId"}}}),a.organizations=e(i+"/organizations/:id",{},{get:{method:"GET",params:{id:"@id"}},getBilling:{url:i+"/organizations/:id/billing",method:"GET",params:{id:"@id"}},getLicense:{url:i+"/organizations/:id/license",method:"GET",params:{id:"@id"}},list:{method:"GET",params:{}},post:{method:"POST",params:{}},put:{method:"POST",params:{id:"@id"}},putPayment:{url:i+"/organizations/:id/payment",method:"POST",params:{id:"@id"}},putSeat:{url:i+"/organizations/:id/seat",method:"POST",params:{id:"@id"}},putStorage:{url:i+"/organizations/:id/storage",method:"POST",params:{id:"@id"}},putUpgrade:{url:i+"/organizations/:id/upgrade",method:"POST",params:{id:"@id"}},putCancel:{url:i+"/organizations/:id/cancel",method:"POST",params:{id:"@id"}},putReinstate:{url:i+"/organizations/:id/reinstate",method:"POST",params:{id:"@id"}},postLeave:{url:i+"/organizations/:id/leave",method:"POST",params:{id:"@id"}},postVerifyBank:{url:i+"/organizations/:id/verify-bank",method:"POST",params:{id:"@id"}},del:{url:i+"/organizations/:id/delete",method:"POST",params:{id:"@id"}},postLicense:{url:i+"/organizations/license",method:"POST",headers:{"Content-Type":void 0}},putLicense:{url:i+"/organizations/:id/license",method:"POST",headers:{"Content-Type":void 0}}}),a.organizationUsers=e(i+"/organizations/:orgId/users/:id",{},{get:{method:"GET",params:{id:"@id",orgId:"@orgId"}},list:{method:"GET",params:{orgId:"@orgId"}},listGroups:{url:i+"/organizations/:orgId/users/:id/groups",method:"GET",params:{id:"@id",orgId:"@orgId"},isArray:!0},invite:{url:i+"/organizations/:orgId/users/invite",method:"POST",params:{orgId:"@orgId"}},reinvite:{url:i+"/organizations/:orgId/users/:id/reinvite",method:"POST",params:{id:"@id",orgId:"@orgId"}},accept:{url:i+"/organizations/:orgId/users/:id/accept",method:"POST",params:{id:"@id",orgId:"@orgId"}},confirm:{url:i+"/organizations/:orgId/users/:id/confirm",method:"POST",params:{id:"@id",orgId:"@orgId"}},put:{method:"POST",params:{id:"@id",orgId:"@orgId"}},putGroups:{url:i+"/organizations/:orgId/users/:id/groups",method:"POST",params:{id:"@id",orgId:"@orgId"}},del:{url:i+"/organizations/:orgId/users/:id/delete",method:"POST",params:{id:"@id",orgId:"@orgId"}}}),a.collections=e(i+"/organizations/:orgId/collections/:id",{},{get:{method:"GET",params:{id:"@id",orgId:"@orgId"}},getDetails:{url:i+"/organizations/:orgId/collections/:id/details",method:"GET",params:{id:"@id",orgId:"@orgId"}},listMe:{url:i+"/collections?writeOnly=:writeOnly",method:"GET",params:{writeOnly:"@writeOnly"}},listOrganization:{method:"GET",params:{orgId:"@orgId"}},listUsers:{url:i+"/organizations/:orgId/collections/:id/users",method:"GET",params:{id:"@id",orgId:"@orgId"}},post:{method:"POST",params:{orgId:"@orgId"}},put:{method:"POST",params:{id:"@id",orgId:"@orgId"}},del:{url:i+"/organizations/:orgId/collections/:id/delete",method:"POST",params:{id:"@id",orgId:"@orgId"}},delUser:{url:i+"/organizations/:orgId/collections/:id/delete-user/:orgUserId",method:"POST",params:{id:"@id",orgId:"@orgId",orgUserId:"@orgUserId"}}}),a.groups=e(i+"/organizations/:orgId/groups/:id",{},{get:{method:"GET",params:{id:"@id",orgId:"@orgId"}},getDetails:{url:i+"/organizations/:orgId/groups/:id/details",method:"GET",params:{id:"@id",orgId:"@orgId"}},listOrganization:{method:"GET",params:{orgId:"@orgId"}},listUsers:{url:i+"/organizations/:orgId/groups/:id/users",method:"GET",params:{id:"@id",orgId:"@orgId"}},post:{method:"POST",params:{orgId:"@orgId"}},put:{method:"POST",params:{id:"@id",orgId:"@orgId"}},del:{url:i+"/organizations/:orgId/groups/:id/delete",method:"POST",params:{id:"@id",orgId:"@orgId"}},delUser:{url:i+"/organizations/:orgId/groups/:id/delete-user/:orgUserId",method:"POST",params:{id:"@id",orgId:"@orgId",orgUserId:"@orgUserId"}}}),a.accounts=e(i+"/accounts",{},{register:{url:i+"/accounts/register",method:"POST",params:{}},emailToken:{url:i+"/accounts/email-token",method:"POST",params:{}},email:{url:i+"/accounts/email",method:"POST",params:{}},verifyEmailToken:{url:i+"/accounts/verify-email-token",method:"POST",params:{}},verifyEmail:{url:i+"/accounts/verify-email",method:"POST",params:{}},postDeleteRecoverToken:{url:i+"/accounts/delete-recover-token",method:"POST",params:{}},postDeleteRecover:{url:i+"/accounts/delete-recover",method:"POST",params:{}},putPassword:{url:i+"/accounts/password",method:"POST",params:{}},getProfile:{url:i+"/accounts/profile",method:"GET",params:{}},putProfile:{url:i+"/accounts/profile",method:"POST",params:{}},getDomains:{url:i+"/accounts/domains",method:"GET",params:{}},putDomains:{url:i+"/accounts/domains",method:"POST",params:{}},postPasswordHint:{url:i+"/accounts/password-hint",method:"POST",params:{}},putSecurityStamp:{url:i+"/accounts/security-stamp",method:"POST",params:{}},putKeys:{url:i+"/accounts/keys",method:"POST",params:{}},putKey:{url:i+"/accounts/key",method:"POST",params:{}},import:{url:i+"/accounts/import",method:"POST",params:{}},postDelete:{url:i+"/accounts/delete",method:"POST",params:{}},putStorage:{url:i+"/accounts/storage",method:"POST",params:{}},putPayment:{url:i+"/accounts/payment",method:"POST",params:{}},putCancelPremium:{url:i+"/accounts/cancel-premium",method:"POST",params:{}},putReinstatePremium:{url:i+"/accounts/reinstate-premium",method:"POST",params:{}},getBilling:{url:i+"/accounts/billing",method:"GET",params:{}},postPremium:{url:i+"/accounts/premium",method:"POST",headers:{"Content-Type":void 0}},putLicense:{url:i+"/accounts/license",method:"POST",headers:{"Content-Type":void 0}}}),a.twoFactor=e(i+"/two-factor",{},{list:{method:"GET",params:{}},getEmail:{url:i+"/two-factor/get-email",method:"POST",params:{}},getU2f:{url:i+"/two-factor/get-u2f",method:"POST",params:{}},getDuo:{url:i+"/two-factor/get-duo",method:"POST",params:{}},getAuthenticator:{url:i+"/two-factor/get-authenticator",method:"POST",params:{}},getYubi:{url:i+"/two-factor/get-yubikey",method:"POST",params:{}},sendEmail:{url:i+"/two-factor/send-email",method:"POST",params:{}},sendEmailLogin:{url:i+"/two-factor/send-email-login",method:"POST",params:{}},putEmail:{url:i+"/two-factor/email",method:"POST",params:{}},putU2f:{url:i+"/two-factor/u2f",method:"POST",params:{}},putAuthenticator:{url:i+"/two-factor/authenticator",method:"POST",params:{}},putDuo:{url:i+"/two-factor/duo",method:"POST",params:{}},putYubi:{url:i+"/two-factor/yubikey",method:"POST",params:{}},disable:{url:i+"/two-factor/disable",method:"POST",params:{}},recover:{url:i+"/two-factor/recover",method:"POST",params:{}},getRecover:{url:i+"/two-factor/get-recover",method:"POST",params:{}}}),a.settings=e(i+"/settings",{},{getDomains:{url:i+"/settings/domains",method:"GET",params:{}},putDomains:{url:i+"/settings/domains",method:"POST",params:{}}}),a.users=e(i+"/users/:id",{},{getPublicKey:{url:i+"/users/:id/public-key",method:"GET",params:{id:"@id"}}}),a.events=e(i+"/events",{},{list:{method:"GET",params:{}},listOrganization:{url:i+"/organizations/:orgId/events",method:"GET",params:{id:"@orgId"}},listCipher:{url:i+"/ciphers/:id/events",method:"GET",params:{id:"@id"}},listOrganizationUser:{url:i+"/organizations/:orgId/users/:id/events",method:"GET",params:{orgId:"@orgId",id:"@id"}}}),a.identity=e(s+"/connect",{},{token:{url:s+"/connect/token",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8","Device-Type":o.getDeviceType()},transformRequest:function(e){return r(e)},skipAuthorization:!0,params:{}}}),a.hibp=e("https://haveibeenpwned.com/api/v2/breachedaccount/:email",{},{get:{method:"GET",params:{email:"@email"},isArray:!0}}),a}]),angular.module("bit.services").factory("authService",["cryptoService","apiService","tokenService","$q","jwtHelper","$rootScope","constants",function(e,t,n,r,o,a,i){var s={},l=null;s.logIn=function(o,a,l,c,u){o=o.toLowerCase();var d,p=r.defer();return e.makeKeyAndHash(o,a).then(function(e){d=e;var r={username:o,password:e.hash,grant_type:"password",scope:"api offline_access",client_id:"web"};return l&&null!=c?(u=u||!1!==u,r.twoFactorToken=l,r.twoFactorProvider=c,r.twoFactorRemember=u?"1":"0"):n.getTwoFactorToken(o)&&(r.twoFactorToken=n.getTwoFactorToken(o),r.twoFactorProvider=i.twoFactorProvider.remember,r.twoFactorRemember="0"),t.identity.token(r).$promise}).then(function(t){if(t&&t.access_token)return n.setToken(t.access_token),n.setRefreshToken(t.refresh_token),e.setKey(d.key),t.TwoFactorToken&&n.setTwoFactorToken(t.TwoFactorToken,o),t.Key&&e.setEncKey(t.Key,d.key),t.PrivateKey?(e.setPrivateKey(t.PrivateKey),!0):e.makeKeyPair()}).then(function(n){if(!0!==n)return e.setPrivateKey(n.privateKeyEnc),t.accounts.putKeys({publicKey:n.publicKey,encryptedPrivateKey:n.privateKeyEnc}).$promise}).then(function(){return s.setUserProfile()}).then(function(){p.resolve()},function(e){s.logOut(),400===e.status&&e.data.TwoFactorProviders2&&Object.keys(e.data.TwoFactorProviders2).length?(n.clearTwoFactorToken(o),p.resolve(e.data.TwoFactorProviders2)):p.reject(e)}),p.promise},s.logOut=function(){n.clearTokens(),e.clearKeys(),a.vaultCiphers=a.vaultFolders=a.vaultCollections=null,l=null},s.getUserProfile=function(){if(!l)return s.setUserProfile();var e=r.defer();return e.resolve(l),e.promise};var c=null;return s.setUserProfile=function(){return c&&0===c.promise.$$state.status?c.promise:(c=r.defer(),n.getToken()?(t.accounts.getProfile({},function(t){if(l={id:t.Id,email:t.Email,emailVerified:t.EmailVerified,premium:t.Premium,extended:{name:t.Name,twoFactorEnabled:t.TwoFactorEnabled,culture:t.Culture}},t.Organizations){for(var n={},r=0;r<t.Organizations.length;r++)n[t.Organizations[r].Id]={id:t.Organizations[r].Id,name:t.Organizations[r].Name,key:t.Organizations[r].Key,status:t.Organizations[r].Status,type:t.Organizations[r].Type,enabled:t.Organizations[r].Enabled,maxCollections:t.Organizations[r].MaxCollections,maxStorageGb:t.Organizations[r].MaxStorageGb,seats:t.Organizations[r].Seats,useGroups:t.Organizations[r].UseGroups,useDirectory:t.Organizations[r].UseDirectory,useEvents:t.Organizations[r].UseEvents,useTotp:t.Organizations[r].UseTotp};l.organizations=n,e.setOrgKeys(n),c.resolve(l)}},function(e){c.reject(e)}),c.promise):(c.reject(),c.promise))},s.addProfileOrganizationOwner=function(t,n){return s.getUserProfile().then(function(r){if(r){r.organizations||(r.organizations={});var o={id:t.Id,name:t.Name,key:n,status:2,type:0,enabled:!0,maxCollections:t.MaxCollections,maxStorageGb:t.MaxStorageGb,seats:t.Seats,useGroups:t.UseGroups,useDirectory:t.UseDirectory,useEvents:t.UseEvents,useTotp:t.UseTotp};r.organizations[o.id]=o,l=r,e.addOrgKey(o.id,o.key)}})},s.removeProfileOrganization=function(t){return s.getUserProfile().then(function(n){n&&(n.organizations&&n.organizations.hasOwnProperty(t)&&(delete n.organizations[t],l=n),e.clearOrgKey(t))})},s.updateProfileOrganization=function(e){return s.getUserProfile().then(function(t){t&&t.organizations&&e.Id in t.organizations&&(t.organizations[e.Id].name=e.Name,l=t)})},s.updateProfilePremium=function(e){return s.getUserProfile().then(function(t){t&&(t.premium=e,l=t)})},s.isAuthenticated=function(){return null!==n.getToken()},s.refreshAccessToken=function(){var e=n.getRefreshToken();return e?t.identity.token({grant_type:"refresh_token",client_id:"web",refresh_token:e}).$promise.then(function(e){return n.setToken(e.access_token),n.setRefreshToken(e.refresh_token),e.access_token},function(e){}):r(function(e,t){e(null)})},s}]),angular.module("bit.services").factory("cipherService",["cryptoService","apiService","$q","$window","constants","appSettings","$localStorage",function(e,t,n,r,o,a,i){var s={disableWebsiteIcons:i.disableWebsiteIcons};function l(t,n){return t&&""!==t?e.encrypt(t,n):null}return s.decryptCiphers=function(e){if(!e)throw"encryptedCiphers is undefined or null";for(var t=[],n=0;n<e.length;n++)t.push(s.decryptCipher(e[n]));return t},s.decryptCipher=function(t){if(!t)throw"encryptedCipher is undefined or null";var n=null;t.OrganizationId&&(n=e.getOrgKey(t.OrganizationId));var r,a={id:t.Id,organizationId:t.OrganizationId,collectionIds:t.CollectionIds||[],type:t.Type,name:e.decrypt(t.Name,n),notes:s.decryptProperty(t.Notes,n,!0,!1),fields:s.decryptFields(n,t.Fields),folderId:t.FolderId,favorite:t.Favorite,edit:t.Edit,organizationUseTotp:t.OrganizationUseTotp,attachments:null,icon:null};switch(a.type){case o.cipherType.login:if(a.login={username:s.decryptProperty(t.Login.Username,n,!0,!1),password:s.decryptProperty(t.Login.Password,n,!0,!1),totp:s.decryptProperty(t.Login.Totp,n,!0,!1),uris:null},t.Login.Uris)for(a.login.uris=[],r=0;r<t.Login.Uris.length;r++)a.login.uris.push({uri:s.decryptProperty(t.Login.Uris[r].Uri,n,!0,!1),match:t.Login.Uris[r].Match});a.icon="fa-globe";break;case o.cipherType.secureNote:a.secureNote={type:t.SecureNote.Type},a.icon="fa-sticky-note-o";break;case o.cipherType.card:a.card={cardholderName:s.decryptProperty(t.Card.CardholderName,n,!0,!1),number:s.decryptProperty(t.Card.Number,n,!0,!1),brand:s.decryptProperty(t.Card.Brand,n,!0,!1),expMonth:s.decryptProperty(t.Card.ExpMonth,n,!0,!1),expYear:s.decryptProperty(t.Card.ExpYear,n,!0,!1),code:s.decryptProperty(t.Card.Code,n,!0,!1)},a.icon="fa-credit-card";break;case o.cipherType.identity:a.identity={title:s.decryptProperty(t.Identity.Title,n,!0,!1),firstName:s.decryptProperty(t.Identity.FirstName,n,!0,!1),middleName:s.decryptProperty(t.Identity.MiddleName,n,!0,!1),lastName:s.decryptProperty(t.Identity.LastName,n,!0,!1),address1:s.decryptProperty(t.Identity.Address1,n,!0,!1),address2:s.decryptProperty(t.Identity.Address2,n,!0,!1),address3:s.decryptProperty(t.Identity.Address3,n,!0,!1),city:s.decryptProperty(t.Identity.City,n,!0,!1),state:s.decryptProperty(t.Identity.State,n,!0,!1),postalCode:s.decryptProperty(t.Identity.PostalCode,n,!0,!1),country:s.decryptProperty(t.Identity.Country,n,!0,!1),company:s.decryptProperty(t.Identity.Company,n,!0,!1),email:s.decryptProperty(t.Identity.Email,n,!0,!1),phone:s.decryptProperty(t.Identity.Phone,n,!0,!1),ssn:s.decryptProperty(t.Identity.SSN,n,!0,!1),username:s.decryptProperty(t.Identity.Username,n,!0,!1),passportNumber:s.decryptProperty(t.Identity.PassportNumber,n,!0,!1),licenseNumber:s.decryptProperty(t.Identity.LicenseNumber,n,!0,!1)},a.icon="fa-id-card-o"}if(!t.Attachments)return a;for(a.attachments=[],r=0;r<t.Attachments.length;r++)a.attachments.push(s.decryptAttachment(n,t.Attachments[r]));return a},s.decryptCipherPreview=function(t){if(!t)throw"encryptedCipher is undefined or null";var n=null;t.OrganizationId&&(n=e.getOrgKey(t.OrganizationId));var r={id:t.Id,organizationId:t.OrganizationId,collectionIds:t.CollectionIds||[],type:t.Type,name:s.decryptProperty(t.Name,n,!1,!0),folderId:t.FolderId,favorite:t.Favorite,edit:t.Edit,organizationUseTotp:t.OrganizationUseTotp,hasAttachments:!!t.Attachments&&t.Attachments.length>0,meta:{},icon:null};switch(r.type){case o.cipherType.login:r.subTitle=s.decryptProperty(t.Login.Username,n,!0,!0),r.meta.password=s.decryptProperty(t.Login.Password,n,!0,!0),r.meta.uri=null,t.Login.Uris&&t.Login.Uris.length&&(r.meta.uri=s.decryptProperty(t.Login.Uris[0].Uri,n,!0,!0)),function(e,t,n){if(!s.disableWebsiteIcons&&t){var r=t,o=!1;if(0===r.indexOf("androidapp://")?e.icon="fa-android":0===r.indexOf("iosapp://")?e.icon="fa-apple":-1===r.indexOf("://")&&r.indexOf(".")>-1?(r="http://"+r,o=!0):o=0===r.indexOf("http")&&r.indexOf(".")>-1,n&&o)try{var i=new URL(r);e.meta.image=a.iconsUri+"/"+i.hostname+"/icon.png"}catch(e){}}e.icon||(e.icon="fa-globe")}(r,r.meta.uri,!0);break;case o.cipherType.secureNote:r.subTitle=null,r.icon="fa-sticky-note-o";break;case o.cipherType.card:r.subTitle="",r.meta.number=s.decryptProperty(t.Card.Number,n,!0,!0);var i=s.decryptProperty(t.Card.Brand,n,!0,!0);i&&(r.subTitle=i),r.meta.number&&r.meta.number.length>=4&&(""!==r.subTitle&&(r.subTitle+=", "),r.subTitle+="*"+r.meta.number.substr(r.meta.number.length-4)),r.icon="fa-credit-card";break;case o.cipherType.identity:var l=s.decryptProperty(t.Identity.FirstName,n,!0,!0),c=s.decryptProperty(t.Identity.LastName,n,!0,!0);r.subTitle="",l&&(r.subTitle=l),c&&(""!==r.subTitle&&(r.subTitle+=" "),r.subTitle+=c),r.icon="fa-id-card-o"}return""===r.subTitle&&(r.subTitle=null),r},s.decryptAttachment=function(t,n){if(!n)throw"encryptedAttachment is undefined or null";return{id:n.Id,url:n.Url,fileName:e.decrypt(n.FileName,t),size:n.SizeName}},s.downloadAndDecryptAttachment=function(t,o,a){var i=n.defer(),s=new XMLHttpRequest;return s.open("GET",o.url,!0),s.responseType="arraybuffer",s.onload=function(n){s.response?e.decryptFromBytes(s.response,t).then(function(e){if(a){var t=new Blob([e]);if(r.navigator.msSaveOrOpenBlob)r.navigator.msSaveBlob(t,o.fileName);else{var n=r.document.createElement("a");n.href=r.URL.createObjectURL(t),n.download=o.fileName,r.document.body.appendChild(n),n.click(),r.document.body.removeChild(n)}}i.resolve(new Uint8Array(e))}):i.reject("No response")},s.send(null),i.promise},s.decryptFields=function(e,t){var n=[];if(t)for(var r=0;r<t.length;r++)n.push(s.decryptField(e,t[r]));return n},s.decryptField=function(t,n){if(!n)throw"encryptedField is undefined or null";return{type:n.Type.toString(),name:n.Name&&""!==n.Name?e.decrypt(n.Name,t):null,value:n.Value&&""!==n.Value?e.decrypt(n.Value,t):null}},s.decryptFolders=function(e){if(!e)throw"encryptedFolders is undefined or null";for(var t=[],n=0;n<e.length;n++)t.push(s.decryptFolder(e[n]));return t},s.decryptFolder=function(t){if(!t)throw"encryptedFolder is undefined or null";return{id:t.Id,name:e.decrypt(t.Name)}},s.decryptFolderPreview=function(e){if(!e)throw"encryptedFolder is undefined or null";return{id:e.Id,name:s.decryptProperty(e.Name,null,!1,!0)}},s.decryptCollections=function(e,t,n){if(!e)throw"encryptedCollections is undefined or null";for(var r=[],o=0;o<e.length;o++)r.push(s.decryptCollection(e[o],t,n));return r},s.decryptCollection=function(t,n,r){if(!t)throw"encryptedCollection is undefined or null";r=!0===r,n=n||t.OrganizationId;var o=e.getOrgKey(n);return{id:t.Id,name:r?s.decryptProperty(t.Name,o,!1,!0):e.decrypt(t.Name,o)}},s.decryptProperty=function(t,n,r,o){if(r&&(!t||""===t))return null;try{t=e.decrypt(t,n)}catch(e){t=null}return t||(o?"[error: cannot decrypt]":null)},s.encryptCiphers=function(e,t){if(!e)throw"unencryptedCiphers is undefined or null";for(var n=[],r=0;r<e.length;r++)n.push(s.encryptCipher(e[r],null,t));return n},s.encryptCipher=function(t,n,r,a){if(!t)throw"unencryptedCipher is undefined or null";t.organizationId&&(r=r||e.getOrgKey(t.organizationId));var i,c={id:t.id,type:n||t.type,organizationId:t.organizationId||null,folderId:""===t.folderId?null:t.folderId,favorite:null!==t.favorite&&t.favorite,name:e.encrypt(t.name,r),notes:l(t.notes,r),fields:s.encryptFields(t.fields,r)};switch(c.type){case o.cipherType.login:var u=t.login;if(c.login={username:l(u.username,r),password:l(u.password,r),totp:l(u.totp,r)},u.uris&&u.uris.length)for(c.login.uris=[],i=0;i<u.uris.length;i++)c.login.uris.push({uri:l(u.uris[i].uri,r),match:u.uris[i].match});break;case o.cipherType.secureNote:c.secureNote={type:t.secureNote.type};break;case o.cipherType.card:var d=t.card;c.card={cardholderName:l(d.cardholderName,r),brand:l(d.brand,r),number:l(d.number,r),expMonth:l(d.expMonth,r),expYear:l(d.expYear,r),code:l(d.code,r)};break;case o.cipherType.identity:var p=t.identity;c.identity={title:l(p.title,r),firstName:l(p.firstName,r),middleName:l(p.middleName,r),lastName:l(p.lastName,r),address1:l(p.address1,r),address2:l(p.address2,r),address3:l(p.address3,r),city:l(p.city,r),state:l(p.state,r),postalCode:l(p.postalCode,r),country:l(p.country,r),company:l(p.company,r),email:l(p.email,r),phone:l(p.phone,r),ssn:l(p.ssn,r),username:l(p.username,r),passportNumber:l(p.passportNumber,r),licenseNumber:l(p.licenseNumber,r)}}if(t.attachments&&a)for(c.attachments={},i=0;i<t.attachments.length;i++)c.attachments[t.attachments[i].id]=e.encrypt(t.attachments[i].fileName,r);return c},s.encryptAttachmentFile=function(t,r){var o=n.defer();if(!(r.size>104857600)){var a=new FileReader;return a.readAsArrayBuffer(r),a.onload=function(n){e.encryptToBytes(n.target.result,t).then(function(n){o.resolve({fileName:e.encrypt(r.name,t),data:new Uint8Array(n),size:r.size})})},a.onerror=function(e){o.reject("Error reading file.")},o.promise}o.reject("Maximum file size is 100 MB.")},s.encryptFields=function(e,t){if(!e||!e.length)return null;for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(s.encryptField(e[r],t));return n},s.encryptField=function(t,n){if(!t)throw"unencryptedField is undefined or null";return{type:parseInt(t.type),name:t.name?e.encrypt(t.name,n):null,value:t.value?e.encrypt(t.value.toString(),n):null}},s.encryptFolders=function(e,t){if(!e)throw"unencryptedFolders is undefined or null";for(var n=[],r=0;r<e.length;r++)n.push(s.encryptFolder(e[r],t));return n},s.encryptFolder=function(t,n){if(!t)throw"unencryptedFolder is undefined or null";return{id:t.id,name:e.encrypt(t.name,n)}},s.encryptCollections=function(e,t){if(!e)throw"unencryptedCollections is undefined or null";for(var n=[],r=0;r<e.length;r++)n.push(s.encryptCollection(e[r],t));return n},s.encryptCollection=function(t,n){if(!t)throw"unencryptedCollection is undefined or null";return{id:t.id,name:e.encrypt(t.name,e.getOrgKey(n))}},s}]),angular.module("bit.services").factory("cryptoService",["$sessionStorage","constants","$q","$window",function(e,t,n,r){var o,a,i,s,l,c,u={},d=void 0!==r.crypto?r.crypto:null,p=d&&void 0!==r.crypto.subtle?r.crypto.subtle:null;function m(e,t,n,r){return e="string"==typeof e?b(e):e,t="string"==typeof t?b(t):t,p.importKey("raw",e.buffer,{name:"PBKDF2"},!1,["deriveKey","deriveBits"]).then(function(e){return p.deriveKey({name:"PBKDF2",salt:t.buffer,iterations:n,hash:{name:"SHA-256"}},e,{name:"AES-CBC",length:r},!0,["encrypt","decrypt"])}).then(function(e){return p.exportKey("raw",e)})}function g(e,t,n){var r=forge.hmac.create();r.start("sha256",t),r.update(e);var o=r.digest();return n?forge.util.encode64(o.getBytes()):o.getBytes()}function f(e,t){return p.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]).then(function(t){return p.sign({name:"HMAC",hash:{name:"SHA-256"}},t,e)})}function h(e,t){var n=forge.hmac.create();return n.start("sha256",function(e){var t=new Uint32Array(e/4);d.getRandomValues(t);for(var n=forge.util.createBuffer(),r=0;r<t.length;r++)n.putInt32(t[r]);return n.getBytes()}(32)),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(t),e===(t=n.digest().getBytes())}function v(e,n,r){if(n&&(e=forge.util.decode64(e)),!e)throw"Must provide keyBytes";var o=forge.util.createBuffer(e);if(!o||0===o.length())throw"Couldn't make buffer";var a=o.length();if(null==r)if(32===a)r=t.encType.AesCbc256_B64;else{if(64!==a)throw"Unable to determine encType.";r=t.encType.AesCbc256_HmacSha256_B64}if(this.key=e,this.keyB64=forge.util.encode64(e),this.encType=r,r===t.encType.AesCbc256_B64&&32===a)this.encKey=e,this.macKey=null;else if(r===t.encType.AesCbc128_HmacSha256_B64&&32===a)this.encKey=o.getBytes(16),this.macKey=o.getBytes(16);else{if(r!==t.encType.AesCbc256_HmacSha256_B64||64!==a)throw"Unsupported encType/key length.";this.encKey=o.getBytes(32),this.macKey=o.getBytes(32)}}function y(e){for(var t="",n=new Uint8Array(e),o=0;o<n.byteLength;o++)t+=String.fromCharCode(n[o]);return r.btoa(t)}function b(e){for(var t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function w(e,t,n){if(e.slice)return e.slice(t,n);if(e=e.buffer,void 0===t&&(t=0),void 0===n&&(n=e.byteLength),t=Math.floor(t),n=Math.floor(n),t<0&&(t+=e.byteLength),n<0&&(n+=e.byteLength),t=Math.min(Math.max(0,t),e.byteLength),(n=Math.min(Math.max(0,n),e.byteLength))-t<=0)return new ArrayBuffer(0);var r=new ArrayBuffer(n-t),o=new Uint8Array(r),a=new Uint8Array(e,t,n-t);return o.set(a),new Uint8Array(r)}return u.setKey=function(t){o=t,e.key=o.keyB64},u.setEncKey=function(t,n,r){if(r)return a=t,void(e.encKey=a.keyB64);try{var o=u.decrypt(t,n,"raw");e.encKey=forge.util.encode64(o),a=new v(o)}catch(e){console.log("Cannot set enc key. Decryption failed.")}},u.setPrivateKey=function(t,n){try{var r=u.decrypt(t,n,"raw");e.privateKey=forge.util.encode64(r),l=forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(r))}catch(e){console.log("Cannot set private key. Decryption failed.")}},u.setOrgKeys=function(t,n){if(t&&0!==Object.keys(t).length){u.clearOrgKeys();var r={},o={},a=!1;for(var i in t)if(t.hasOwnProperty(i))try{var s=new v(u.rsaDecrypt(t[i].key,n));o[i]=s,r[i]=s.keyB64,a=!0}catch(e){console.log("Cannot set org key for "+i+". Decryption failed.")}a?e.orgKeys=r:o=null}},u.addOrgKey=function(t,n,r){(s=u.getOrgKeys())||(s={});var o=e.orgKeys;o||(o={});try{var a=new v(u.rsaDecrypt(n,r));s[t]=a,o[t]=a.keyB64}catch(e){s=null,console.log("Cannot set org key. Decryption failed.")}e.orgKeys=o},u.getKey=function(){if(!o&&e.key&&(o=new v(e.key,!0)),!o)throw"key unavailable";return o},u.getEncKey=function(){return!a&&e.encKey&&(a=new v(e.encKey,!0)),a},u.getPrivateKey=function(t){if(t=t||"native",l){if("raw"===t){var n=forge.pki.privateKeyToAsn1(l),r=forge.pki.wrapRsaPrivateKey(n);return forge.asn1.toDer(r).getBytes()}return l}if(e.privateKey){var o=forge.util.decode64(e.privateKey);if(l=forge.pki.privateKeyFromAsn1(forge.asn1.fromDer(o)),"raw"===t)return o}return l},u.getPublicKey=function(){if(c)return c;var e=u.getPrivateKey();return e?c=forge.pki.setRsaPublicKey(e.n,e.e):null},u.getOrgKeys=function(){if(s)return s;if(e.orgKeys){var t={},n=!1;for(var r in e.orgKeys)e.orgKeys.hasOwnProperty(r)&&(t[r]=new v(e.orgKeys[r],!0),n=!0);n&&(s=t)}return s},u.getOrgKey=function(e){var t=u.getOrgKeys();return t&&e in t?t[e]:null},u.clearKey=function(){o=null,i=null,delete e.key},u.clearEncKey=function(){a=null,delete e.encKey},u.clearKeyPair=function(){l=null,c=null,delete e.privateKey},u.clearOrgKeys=function(){s=null,delete e.orgKeys},u.clearOrgKey=function(t){s.hasOwnProperty(t)&&delete s[t],e.orgKeys.hasOwnProperty(t)&&delete e.orgKeys[t]},u.clearKeys=function(){u.clearKey(),u.clearEncKey(),u.clearKeyPair(),u.clearOrgKeys()},u.makeKey=function(e,t){if(r.cryptoShimmed||-1!==r.navigator.userAgent.indexOf("Edge")){var o=n.defer(),a=forge.pbkdf2(forge.util.encodeUtf8(e),forge.util.encodeUtf8(t),5e3,32,"sha256");return o.resolve(new v(a)),o.promise}return m(e,t,5e3,256).then(function(e){return new v(y(e),!0)})},u.makeEncKey=function(e){var t=forge.random.getBytesSync(64),n=u.encrypt(t,e,"raw");return{encKey:new v(t),encKeyEnc:n}},u.makeKeyPair=function(e){var t=n.defer();return forge.pki.rsa.generateKeyPair({bits:2048,workers:2,workerScript:"/lib/forge/prime.worker.min.js"},function(n,r){if(n)t.reject(n);else{var o=forge.pki.privateKeyToAsn1(r.privateKey),a=forge.pki.wrapRsaPrivateKey(o),i=forge.asn1.toDer(a).getBytes(),s=u.encrypt(i,e,"raw"),l=forge.pki.publicKeyToAsn1(r.publicKey),c=forge.asn1.toDer(l).getBytes();t.resolve({publicKey:forge.util.encode64(c),privateKeyEnc:s})}}),t.promise},u.makeShareKey=function(){var e=forge.random.getBytesSync(64);return{key:new v(e),ct:u.rsaEncryptMe(e)}},u.hashPassword=function(e,t){if(t||(t=u.getKey()),!e||!t)throw"Invalid parameters.";if(r.cryptoShimmed||-1!==r.navigator.userAgent.indexOf("Edge")){var o=n.defer(),a=forge.pbkdf2(t.key,forge.util.encodeUtf8(e),1,32,"sha256");return o.resolve(forge.util.encode64(a)),o.promise}var i=t.getBuffers();return m(new Uint8Array(i.key),e,1,256).then(function(e){return y(e)})},u.makeKeyAndHash=function(e,t){var n;return e=e.toLowerCase(),u.makeKey(t,e).then(function(e){return n=e,u.hashPassword(t,e)}).then(function(e){return{key:n,hash:e}})},u.encrypt=function(e,t,n){var r=function(e,t,n){if(!(t=t||u.getEncKey()||u.getKey()))throw"Encryption key unavailable.";n=n||"utf8";var r=forge.util.createBuffer(e,n),o=forge.random.getBytesSync(16),a=forge.cipher.createCipher("AES-CBC",t.encKey);a.start({iv:o}),a.update(r),a.finish();var i=a.output.getBytes(),s=null;t.macKey&&(s=g(o+i,t.macKey,!1));return{iv:o,ct:i,mac:s,key:t,plainValueEncoding:n}}(e,t,n),o=forge.util.encode64(r.iv)+"|"+forge.util.encode64(r.ct);r.mac&&(o=o+"|"+forge.util.encode64(r.mac));return r.key.encType+"."+o},u.encryptToBytes=function(e,t){return function(e,t){if(!(t=t||u.getEncKey()||u.getKey()))throw"Encryption key unavailable.";var n={iv:new Uint8Array(16),ct:null,mac:null,key:t},r=t.getBuffers();return d.getRandomValues(n.iv),p.importKey("raw",r.encKey,{name:"AES-CBC"},!1,["encrypt"]).then(function(t){return p.encrypt({name:"AES-CBC",iv:n.iv},t,e)}).then(function(e){if(n.ct=new Uint8Array(e),!r.macKey)return null;var t=new Uint8Array(n.iv.length+n.ct.length);return t.set(n.iv,0),t.set(n.ct,n.iv.length),f(t.buffer,r.macKey)}).then(function(e){return e&&(n.mac=new Uint8Array(e)),n})}(e,t).then(function(e){var t=0;e.mac&&(t=e.mac.length);var n=new Uint8Array(1+e.iv.length+t+e.ct.length);return n.set([e.key.encType]),n.set(e.iv,1),e.mac&&n.set(e.mac,1+e.iv.length),n.set(e.ct,1+e.iv.length+t),n.buffer})},u.rsaEncrypt=function(e,n,r){if(!(n=n||u.getPublicKey()))throw"Public key unavailable.";if("string"==typeof n){var o=forge.util.decode64(n);n=forge.pki.publicKeyFromAsn1(forge.asn1.fromDer(o))}var a=n.encrypt(e,"RSA-OAEP",{md:forge.md.sha1.create()}),i=forge.util.encode64(a);if(r&&r.macKey){var s=g(a,r.macKey,!0);return t.encType.Rsa2048_OaepSha1_HmacSha256_B64+"."+i+"|"+s}return t.encType.Rsa2048_OaepSha1_B64+"."+i},u.rsaEncryptMe=function(e){return u.rsaEncrypt(e,u.getPublicKey(),u.getEncKey())},u.decrypt=function(e,n,r){try{n=n||u.getEncKey()||u.getKey();var o,a,s=e.split(".");if(2===s.length)try{o=parseInt(s[0]),a=s[1].split("|")}catch(e){return console.error("Cannot parse headerPieces."),null}else o=3===(a=e.split("|")).length?t.encType.AesCbc128_HmacSha256_B64:t.encType.AesCbc256_B64;if(o===t.encType.AesCbc128_HmacSha256_B64&&n.encType===t.encType.AesCbc256_B64&&(n=i=i||new v(n.key,!1,t.encType.AesCbc128_HmacSha256_B64)),o!==n.encType)throw"encType unavailable.";switch(o){case t.encType.AesCbc128_HmacSha256_B64:case t.encType.AesCbc256_HmacSha256_B64:if(3!==a.length)return console.error("Enc type ("+o+") not valid."),null;break;case t.encType.AesCbc256_B64:if(2!==a.length)return console.error("Enc type ("+o+") not valid."),null;break;default:return console.error("Enc type ("+o+") not supported."),null}var l=forge.util.decode64(a[0]),c=forge.util.decode64(a[1]);if(n.macKey&&a.length>2)if(!h(forge.util.decode64(a[2]),g(l+c,n.macKey,!1)))return console.error("MAC failed."),null;var d=forge.util.createBuffer(c),p=forge.cipher.createDecipher("AES-CBC",n.encKey);return p.start({iv:l}),p.update(d),p.finish(),"utf8"===(r=r||"utf8")?p.output.toString("utf8"):p.output.getBytes()}catch(e){throw console.error("Caught unhandled error in decrypt: "+e),e}},u.decryptFromBytes=function(e,n){try{if(!e)throw"no encBuf.";var r=new Uint8Array(e),o=r[0],a=null,i=null,s=null;switch(o){case t.encType.AesCbc128_HmacSha256_B64:case t.encType.AesCbc256_HmacSha256_B64:if(r.length<=49)return console.error("Enc type ("+o+") not valid."),null;i=w(r,1,17),s=w(r,17,49),a=w(r,49);break;case t.encType.AesCbc256_B64:if(r.length<=17)return console.error("Enc type ("+o+") not valid."),null;i=w(r,1,17),a=w(r,17);break;default:return console.error("Enc type ("+o+") not supported."),null}return function(e,t,n,r,o){if(!(o=o||u.getEncKey()||u.getKey()))throw"Encryption key unavailable.";if(o.macKey&&!r)throw"macBuf required for this type of key.";if(e!==o.encType)throw"encType unavailable.";var a=o.getBuffers(),i=null;return p.importKey("raw",a.encKey,{name:"AES-CBC"},!1,["decrypt"]).then(function(e){if(i=e,!o.macKey||!r)return null;var s=new Uint8Array(n.byteLength+t.byteLength);return s.set(new Uint8Array(n),0),s.set(new Uint8Array(t),n.byteLength),f(s.buffer,a.macKey)}).then(function(e){return null===e?null:(t=r,n=e,i=new Uint8Array(32),d.getRandomValues(i),window.crypto.subtle.importKey("raw",i.buffer,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]).then(function(e){return a=e,window.crypto.subtle.sign({name:"HMAC",hash:{name:"SHA-256"}},a,t)}).then(function(e){return o=e,window.crypto.subtle.sign({name:"HMAC",hash:{name:"SHA-256"}},a,n)}).then(function(e){if(o.byteLength!==e.byteLength)return!1;for(var t=new Uint8Array(o),n=new Uint8Array(e),r=0;r<n.length;r++)if(t[r]!==n[r])return!1;return!0}));var t,n,o,a,i}).then(function(e){return!1===e?(console.error("MAC failed."),null):p.decrypt({name:"AES-CBC",iv:n},i,t)})}(o,a.buffer,i.buffer,s?s.buffer:null,n)}catch(e){throw console.error("Caught unhandled error in decryptFromBytes: "+e),e}},u.rsaDecrypt=function(e,n,r){if(n=n||u.getPrivateKey(),r=r||u.getEncKey(),!n)throw"Private key unavailable.";var o,a,i=e.split(".");if(1===i.length)o=t.encType.Rsa2048_OaepSha256_B64,a=[i[0]];else if(2===i.length)try{o=parseInt(i[0]),a=i[1].split("|")}catch(e){return null}switch(o){case t.encType.Rsa2048_OaepSha256_B64:case t.encType.Rsa2048_OaepSha1_B64:if(1!==a.length)return null;break;case t.encType.Rsa2048_OaepSha256_HmacSha256_B64:case t.encType.Rsa2048_OaepSha1_HmacSha256_B64:if(2!==a.length)return null;break;default:return null}var s,l=forge.util.decode64(a[0]);if(r&&r.macKey&&a.length>1&&!h(forge.util.decode64(a[1]),g(l,r.macKey,!1)))return console.error("MAC failed."),null;if(o===t.encType.Rsa2048_OaepSha256_B64||o===t.encType.Rsa2048_OaepSha256_HmacSha256_B64)s=forge.md.sha256.create();else{if(o!==t.encType.Rsa2048_OaepSha1_B64&&o!==t.encType.Rsa2048_OaepSha1_HmacSha256_B64)throw"encType unavailable.";s=forge.md.sha1.create()}return n.decrypt(l,"RSA-OAEP",{md:s})},v.prototype.getBuffers=function(){if(this.keyBuf)return this.keyBuf;var e=function(e){for(var t=r.atob(e),n=new Uint8Array(t.length),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}(this.keyB64),t={key:e.buffer};return this.macKey?(t.encKey=w(e,0,e.length/2).buffer,t.macKey=w(e,e.length/2).buffer):(t.encKey=e.buffer,t.macKey=null),this.keyBuf=t,this.keyBuf},u}]),angular.module("bit.services").factory("eventService",["constants","$filter",function(e,t){var n={};function r(e){var t=e.CipherId.substring(0,8);return e.OrganizationId?'<a title="View item '+e.CipherId+'" ui-sref="backend.org.vault({orgId:\''+e.OrganizationId+"',search:'"+t+"',viewEvents:'"+e.CipherId+"'})\"><code>"+t+"</code></a>":"<code>"+t+"</code>"}function o(e){var t=e.GroupId.substring(0,8);return'<a title="View group '+e.GroupId+'" ui-sref="backend.org.groups({orgId:\''+e.OrganizationId+"',search:'"+t+"'})\"><code>"+t+"</code></a>"}function a(e){var t=e.CollectionId.substring(0,8);return'<a title="View collection '+e.CollectionId+'" ui-sref="backend.org.collections({orgId:\''+e.OrganizationId+"',search:'"+t+"'})\"><code>"+t+"</code></a>"}function i(e){var t=e.OrganizationUserId.substring(0,8);return'<a title="View user '+e.OrganizationUserId+'" ui-sref="backend.org.people({orgId:\''+e.OrganizationId+"',search:'"+t+"'})\"><code>"+t+"</code></a>"}return n.getDefaultDateFilters=function(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59);return e.setDate(e.getDate()-30),{start:new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0),end:t}},n.formatDateFilters=function(e,n){var r={start:null,end:null,error:null};try{var o="yyyy-MM-ddTHH:mm";r.start=t("date")(e,o+"Z","UTC"),r.end=t("date")(n,o+":59.999Z","UTC")}catch(e){}return(!r.start||!r.end||r.end<r.start)&&(r.error="Invalid date range."),r},n.getEventInfo=function(t,n){n=n||{cipherInfo:!0};var s=function(t){var n={icon:"fa-globe",name:"Unknown"};switch(t.DeviceType){case e.deviceType.android:n.icon="fa-android",n.name="Mobile App - Android";break;case e.deviceType.ios:n.icon="fa-apple",n.name="Mobile App - iOS";break;case e.deviceType.uwp:n.icon="fa-windows",n.name="Mobile App - Windows";break;case e.deviceType.chromeExt:n.icon="fa-chrome",n.name="Extension - Chrome";break;case e.deviceType.firefoxExt:n.icon="fa-firefox",n.name="Extension - Firefox";break;case e.deviceType.operaExt:n.icon="fa-opera",n.name="Extension - Opera";break;case e.deviceType.edgeExt:n.icon="fa-edge",n.name="Extension - Edge";break;case e.deviceType.vivaldiExt:n.icon="fa-puzzle-piece",n.name="Extension - Vivaldi";break;case e.deviceType.windowsDesktop:n.icon="fa-windows",n.name="Desktop - Windows";break;case e.deviceType.macOsDesktop:n.icon="fa-apple",n.name="Desktop - macOS";break;case e.deviceType.linuxDesktop:n.icon="fa-linux",n.name="Desktop - Linux";break;case e.deviceType.chrome:n.icon="fa-globe",n.name="Web Vault - Chrome";break;case e.deviceType.firefox:n.icon="fa-globe",n.name="Web Vault - Firefox";break;case e.deviceType.opera:n.icon="fa-globe",n.name="Web Vault - Opera";break;case e.deviceType.safari:n.icon="fa-globe",n.name="Web Vault - Safari";break;case e.deviceType.vivaldi:n.icon="fa-globe",n.name="Web Vault - Vivaldi";break;case e.deviceType.edge:n.icon="fa-globe",n.name="Web Vault - Edge";break;case e.deviceType.ie:n.icon="fa-globe",n.name="Web Vault - IE";break;case e.deviceType.unknown:n.icon="fa-globe",n.name="Web Vault - Unknown"}return n}(t);return{message:function(t,n){var s="";switch(t.Type){case e.eventType.User_LoggedIn:s="Logged in.";break;case e.eventType.User_ChangedPassword:s="Changed account password.";break;case e.eventType.User_Enabled2fa:s="Enabled two-step login.";break;case e.eventType.User_Disabled2fa:s="Disabled two-step login.";break;case e.eventType.User_Recovered2fa:s="Recovered account from two-step login.";break;case e.eventType.User_FailedLogIn:s="Login attempt failed with incorrect password.";break;case e.eventType.User_FailedLogIn2fa:s="Login attempt failed with incorrect two-step login.";break;case e.eventType.Cipher_Created:s=n.cipherInfo?"Created item "+r(t)+".":"Created.";break;case e.eventType.Cipher_Updated:s=n.cipherInfo?"Edited item "+r(t)+".":"Edited.";break;case e.eventType.Cipher_Deleted:s=n.cipherInfo?"Deleted item "+r(t)+".":"Deleted";break;case e.eventType.Cipher_AttachmentCreated:s=n.cipherInfo?"Created attachment for item "+r(t)+".":"Created attachment.";break;case e.eventType.Cipher_AttachmentDeleted:s=n.cipherInfo?"Deleted attachment for item "+r(t)+".":"Deleted attachment.";break;case e.eventType.Cipher_Shared:s=n.cipherInfo?"Shared item "+r(t)+".":"Shared.";break;case e.eventType.Cipher_UpdatedCollections:s=n.cipherInfo?"Update collections for item "+r(t)+".":"Updated collections.";break;case e.eventType.Collection_Created:s="Created collection "+a(t)+".";break;case e.eventType.Collection_Updated:s="Edited collection "+a(t)+".";break;case e.eventType.Collection_Deleted:s="Deleted collection "+a(t)+".";break;case e.eventType.Group_Created:s="Created group "+o(t)+".";break;case e.eventType.Group_Updated:s="Edited group "+o(t)+".";break;case e.eventType.Group_Deleted:s="Deleted group "+o(t)+".";break;case e.eventType.OrganizationUser_Invited:s="Invited user "+i(t)+".";break;case e.eventType.OrganizationUser_Confirmed:s="Confirmed user "+i(t)+".";break;case e.eventType.OrganizationUser_Updated:s="Edited user "+i(t)+".";break;case e.eventType.OrganizationUser_Removed:s="Removed user "+i(t)+".";break;case e.eventType.OrganizationUser_UpdatedGroups:s="Edited groups for user "+i(t)+".";break;case e.eventType.Organization_Updated:s="Edited organization settings."}return""===s?null:s}(t,n),appIcon:s.icon,appName:s.name}},n}]),angular.module("bit.services").factory("importService",["constants",function(e){var t={};t.import=function(t,i,m,g){var f,h,v,y,b,w,C,S,k,T,P,I,E,z,O,A,U,x,D,F,M,N,B,K,G,L,_,R,H,V,j,q,Y;if(i)switch(t){case"bitwardencsv":q=i,Y=m,Papa.parse(q,{header:!0,encoding:"UTF-8",complete:function(t){c(t);var n=[],r=[],o=[],a=0;angular.forEach(t.data,function(t,i){var c=n.length,u=r.length,d=t.folder&&""!==t.folder,p=d;if(d)for(a=0;a<n.length;a++)if(n[a].name===t.folder){p=!1,c=a;break}var m={favorite:!(!t.favorite||""===t.favorite||"0"===t.favorite),notes:t.notes&&""!==t.notes?t.notes:null,name:t.name&&""!==t.name?t.name:"--",type:e.cipherType.login};if(t.fields&&""!==t.fields){var g=t.fields.split(/(?:\r\n|\r|\n)/);for(a=0;a<g.length;a++)if(g[a]&&""!==g[a]){var f=g[a].lastIndexOf(": ");if(-1!==f){m.fields||(m.fields=[]);var h={name:g[a].substr(0,f),value:null,type:e.fieldType.text};g[a].length>f+2&&(h.value=g[a].substr(f+2)),m.fields.push(h)}}}var v=t.type?t.type.toLowerCase():null;switch(v){case"login":case null:case void 0:m.type=e.cipherType.login;var y=t.login_totp||t.totp,b=l(t.login_uri||t.uri),w=t.login_username||t.username,C=t.login_password||t.password;m.login={totp:y&&""!==y?y:null,uris:s(b),username:w&&""!==w?w:null,password:C&&""!==C?C:null};break;case"note":m.type=e.cipherType.secureNote,m.secureNote={type:0}}if(r.push(m),p&&n.push({name:t.folder}),d){var S={key:u,value:c};o.push(S)}}),Y(n,r,o)}});break;case"lastpass":p(i,m,g,!1);break;case"safeincloudxml":!function(t,n,r){var o=[],a=[],i=[],l=[],c=0,u=0;d(t,function(t){var d=$(t).find("database");if(d.length){var p=d.find("> label");if(p.length)for(c=0;c<p.length;c++){var m=$(p[c]);l[m.attr("id")]=o.length,o.push({name:m.attr("name")})}var g=d.find("> card");if(g.length)for(c=0;c<g.length;c++){var f=$(g[c]);if("true"!==f.attr("template")){var h={favorite:!1,notes:"",name:f.attr("title"),fields:null};if(h.name&&""!==h.name||(h.name="--"),"note"===f.attr("type"))h.type=e.cipherType.secureNote,h.secureNote={type:0};else{h.type=e.cipherType.login,h.login={};var v=f.find("> field");for(u=0;u<v.length;u++){var y=$(v[u]),b=y.text(),w=y.attr("type"),C=y.attr("name");b&&""!==b&&("login"===w?h.login.username=b:"password"===w?h.login.password=b:"notes"===w?h.notes+=b+"\n":"weblogin"===w||"website"===w?h.login.uris=s(b):b.length>200?h.notes+=C+": "+b+"\n":(h.fields||(h.fields=[]),h.fields.push({name:C,value:b,type:e.fieldType.text})))}}var S=f.find("> notes");for(u=0;u<S.length;u++)h.notes+=$(S[u]).text()+"\n";if(""===h.notes&&(h.notes=null),a.push(h),(p=f.find("> label_id")).length){var k=$(p[0]).text(),T=l[k];null!==k&&""!==k&&null!==T&&i.push({key:a.length-1,value:T})}}}n(o,a,i)}else r()},r)}(i,m,g);break;case"keepass2xml":!function(t,n,r){var o=[],a=[],i=[];d(t,function(t){var l=$(t).find("Root");if(l.length){var c=l.find("> Group");c.length&&(!function t(n,r,l){var c=o.length;var u=l;r||(""!==u&&(u+=" > "),u+=n.find("> Name").text(),o.push({name:u}));var d=n.find("> Entry");if(d.length)for(var p=0;p<d.length;p++){for(var m=$(d[p]),g=a.length,f={favorite:!1,notes:null,name:null,type:e.cipherType.login,login:{uris:null,username:null,password:null},fields:null},h=m.find("> String"),v=0;v<h.length;v++){var y=$(h[v]),b=y.find("> Key").text(),w=y.find("> Value").text();if(""!==w)switch(b){case"URL":f.login.uris=s(w);break;case"UserName":f.login.username=w;break;case"Password":f.login.password=w;break;case"Title":f.name=w;break;case"Notes":f.notes=null===f.notes?w+"\n":f.notes+w+"\n";break;default:w.length>200||w.indexOf("\n")>-1?(f.notes||(f.notes=""),f.notes+=b+": "+w+"\n"):(f.fields||(f.fields=[]),f.fields.push({name:b,value:w,type:e.fieldType.text}))}}null===f.name&&(f.name="--"),a.push(f),r||i.push({key:g,value:c})}var C=n.find("> Group");if(C.length)for(var S=0;S<C.length;S++)t($(C[S]),!1,u)}($(c[0]),!0,""),n(o,a,i))}else r()},r)}(i,m,g);break;case"keepassxcsv":V=i,j=m,Papa.parse(V,{header:!0,encoding:"UTF-8",complete:function(t){c(t);var n=[],r=[],o=[];angular.forEach(t.data,function(t,a){t.Group=t.Group.startsWith("Root/")?t.Group.replace("Root/",""):t.Group;var i=t.Group&&""!==t.Group?t.Group.split("/").join(" > "):null,l=n.length,c=r.length,u=null!==i,d=u,p=0;if(u)for(p=0;p<n.length;p++)if(n[p].name===i){d=!1,l=p;break}var m={type:e.cipherType.login,favorite:!1,notes:t.Notes&&""!==t.Notes?t.Notes:null,name:t.Title&&""!==t.Title?t.Title:"--",login:{uris:s(t.URL),username:t.Username&&""!==t.Username?t.Username:null,password:t.Password&&""!==t.Password?t.Password:null}};if(t.Title&&r.push(m),d&&n.push({name:i}),u){var g={key:c,value:l};o.push(g)}}),j(n,r,o)}});break;case"padlockcsv":R=i,H=m,Papa.parse(R,{encoding:"UTF-8",complete:function(t){c(t);var n=[],r=[],o=[],a=[],i=0,l=0;for(i=0;i<t.data.length;i++){var u=t.data[i];if(0!==i){var d=n.length,p=r.length,m=u[1]&&""!==u[1],g=m;if(m)for(l=0;l<n.length;l++)if(n[l].name===u[1]){g=!1,d=l;break}var f={favorite:!1,type:e.cipherType.login,notes:null,name:u[0]&&""!==u[0]?u[0]:"--",login:{uris:null,username:u[2]&&""!==u[2]?u[2]:null,password:u[3]&&""!==u[3]?u[3]:null},fields:null};if(a.length)for(l=4;l<u.length;l++){var h=u[l];if(h&&""!==h){var v=a[l-4];"url"===v.toLowerCase()||"uri"===v.toLowerCase()?f.login.uris=s(h):(f.fields||(f.fields=[]),f.fields.push({name:v,value:h,type:e.fieldType.text}))}}r.push(f),g&&n.push({name:u[1]}),m&&o.push({key:p,value:d})}else for(l=4;l<u.length;l++)a.push(u[l])}H(n,r,o)}});break;case"1password1pif":!function(t,n,r){var o=[],a=[],i=0;function l(t,n,r,o,a){for(var i=0;i<t.length;i++){var s=t[i];if(s[o]&&""!==s[o]){var l=s[o].toString();if(n.type==e.cipherType.login&&!n.login.username&&s[r]&&"username"===s[r])n.login.username=l;else if(n.type==e.cipherType.login&&!n.login.password&&s[r]&&"password"===s[r])n.login.password=l;else if(n.type==e.cipherType.login&&!n.login.totp&&s[r]&&s[r].startsWith("TOTP_"))n.login.totp=l;else if(l){var c=s[a]||"no_name";l.indexOf("\\n")>-1||l.length>200?(null===n.notes?n.notes="":n.notes+="\n",n.notes+=c+": "+l.split("\\r\\n").join("\n").split("\\n").join("\n")):(n.fields||(n.fields=[]),n.fields.push({name:c,value:l,type:e.fieldType.text}))}}}}u(t,function(t){var r=t.split(/(?:\r\n|\r|\n)/);for(i=0;i<r.length;i++){var c=r[i];if(c.length&&"{"===c[0]){var u=JSON.parse(c),d={type:e.cipherType.login,favorite:!(!u.openContents||!u.openContents.faveIndex),notes:null,name:u.title&&""!==u.title?u.title:"--",fields:null};if("securenotes.SecureNote"===u.typeName?(d.type=e.cipherType.secureNote,d.secureNote={type:0}):(d.type=e.cipherType.login,d.login={uris:s(u.location),username:null,password:null,totp:null}),u.secureContents&&(u.secureContents.notesPlain&&""!==u.secureContents.notesPlain&&(d.notes=u.secureContents.notesPlain.split("\\r\\n").join("\n").split("\\n").join("\n")),u.secureContents.fields&&l(u.secureContents.fields,d,"designation","value","name"),u.secureContents.sections))for(var p=0;p<u.secureContents.sections.length;p++)u.secureContents.sections[p].fields&&l(u.secureContents.sections[p].fields,d,"n","v","t");a.push(d)}}n(o,a,[])},r)}(i,m,g);break;case"1password6wincsv":K=i,G=m,L=[],_=[],Papa.parse(K,{encoding:"UTF-8",header:!0,complete:function(t){c(t);for(var n=0;n<t.data.length;n++){var r=t.data[n];if(r.title){var o={type:e.cipherType.login,favorite:!1,notes:r.notesPlain&&""!==r.notesPlain?r.notesPlain:"",name:r.title&&""!==r.title?r.title:"--",login:{uris:null,username:null,password:null}};for(var a in r)if(r.hasOwnProperty(a)){if(null===r[a]||""===r[a])continue;if(o.login.password||"password"!==a)if(o.login.username||"username"!==a)if(o.login.uris||"urls"!==a)"ainfo"===a||"autosubmit"===a||"notesPlain"===a||"ps"===a||"scope"===a||"tags"===a||"title"===a||"uuid"===a||a.startsWith("section:")||(""!==o.notes&&(o.notes+="\n"),o.notes+=a+": "+r[a]);else{var i=r[a].split(/(?:\r\n|\r|\n)/);o.login.uris=s(i)}else o.login.username=r[a];else o.login.password=r[a]}""===o.notes&&(o.notes=null),_.push(o)}}G(L,_,[])}});break;case"chromecsv":case"vivaldicsv":case"operacsv":N=i,B=m,Papa.parse(N,{header:!0,encoding:"UTF-8",complete:function(t){c(t);var n=[];angular.forEach(t.data,function(t,r){n.push({type:e.cipherType.login,favorite:!1,notes:null,name:t.name&&""!==t.name?t.name:"--",login:{uris:s(t.url),username:t.username&&""!==t.username?t.username:null,password:t.password&&""!==t.password?t.password:null}})}),B([],n,[])}});break;case"firefoxpasswordexportercsvxml":!function(t,n,r){var o=[],a=[];function i(e){var t="--";try{if(e&&""!==e){var n=document.createElement("a");n.href=e,n.hostname&&(t=n.hostname)}}catch(e){}return t}{if(!t.type||"text/xml"!==t.type)return void r("Only .xml exports are supported.");d(t,function(t){for(var r=$(t).find("entry"),l=0;l<r.length;l++){var c=$(r[l]);if(c){var u=c.attr("host"),d=c.attr("user"),p=c.attr("password");a.push({type:e.cipherType.login,favorite:!1,notes:null,name:i(u),login:{uris:s(u),username:d&&""!==d?d:null,password:p&&""!==p?p:null}})}}n(o,a,[])},r)}}(i,m,g);break;case"upmcsv":F=i,M=m,Papa.parse(F,{encoding:"UTF-8",complete:function(t){c(t);var n=[];angular.forEach(t.data,function(t,r){5===t.length&&n.push({type:e.cipherType.login,favorite:!1,notes:t[4]&&""!==t[4]?t[4]:null,name:t[0]&&""!==t[0]?t[0]:"--",login:{uris:s(t[3]),username:t[1]&&""!==t[1]?t[1]:null,password:t[2]&&""!==t[2]?t[2]:null}})}),M([],n,[])}});break;case"keepercsv":x=i,D=m,Papa.parse(x,{encoding:"UTF-8",complete:function(t){c(t);var n=[],r=[],o=[];angular.forEach(t.data,function(t,a){if(t.length>=6){var i=n.length,l=r.length,c=t[0]&&""!==t[0],u=c,d=0;if(c)for(d=0;d<n.length;d++)if(n[d].name===t[0]){u=!1,i=d;break}var p={type:e.cipherType.login,favorite:!1,notes:t[5]&&""!==t[5]?t[5]:null,name:t[1]&&""!==t[1]?t[1]:"--",login:{uris:s(t[4]),username:t[2]&&""!==t[2]?t[2]:null,password:t[3]&&""!==t[3]?t[3]:null},fields:null};if(t.length>6)for(d=6;d<t.length;d+=2)t[d+1]&&t[d+1].length>200?(p.notes||(p.notes=""),p.notes+=t[d]+": "+t[d+1]+"\n"):(p.fields||(p.fields=[]),p.fields.push({name:t[d],value:t[d+1],type:e.fieldType.text}));if(r.push(p),u&&n.push({name:t[0]}),c){var m={key:l,value:i};o.push(m)}}}),D(n,r,o)}});break;case"passworddragonxml":!function(t,n,r){var o=[],a=[],i=[],l=0;d(t,function(t){var c=$(t).find("PasswordManager");if(c.length){var u=c.find("> record");if(u.length)for(var d=0;d<u.length;d++){var p=$(u[d]),m=p.find("> Account-Name"),g=m.length?$(m):null,f=p.find("> User-Id"),h=f.length?$(f):null,v=p.find("> Password"),y=v.length?$(v):null,b=p.find("> URL"),w=b.length?$(b):null,C=p.find("> Notes"),S=C.length?$(C):null,k=p.find("> Category"),T=k.length?$(k):null,P=T?T.text():null,I=o.length,E=a.length,z=P&&""!==P&&"Unfiled"!==P,O=z;if(z)for(l=0;l<o.length;l++)if(o[l].name===P){O=!1,I=l;break}var A={type:e.cipherType.login,favorite:!1,notes:S&&""!==S.text()?S.text():null,name:g&&""!==g.text()?g.text():"--",login:{uris:w?s(w.text()):null,username:h&&""!==h.text()?h.text():null,password:y&&""!==y.text()?y.text():null},fields:null},U="";for(l=1;l<=10;l++)U+="> Attribute-"+l,l<10&&(U+=", ");var x=p.find(U);if(x.length)for(l=0;l<x.length;l++){var D=$(x[l]),F=D.prop("tagName"),M=D.text();M&&""!==M&&"null"!==M&&(M.length>200?(A.notes||(A.notes=""),A.notes+=F+": "+M+"\n"):(A.fields||(A.fields=[]),A.fields.push({name:F,value:M,type:e.fieldType.text})))}if(a.push(A),O&&o.push({name:P}),z){var N={key:E,value:I};i.push(N)}}n(o,a,i)}else r()},r)}(i,m,g);break;case"enpasscsv":A=i,U=m,Papa.parse(A,{encoding:"UTF-8",complete:function(t){c(t);for(var n=[],r=0;r<t.data.length;r++){var o=t.data[r];if(!(o.length<2||0===r&&"Title"===o[0])){var a=o[o.length-1],i={type:e.cipherType.login,name:o[0],favorite:!1,notes:a&&""!==a?a:null,fields:null,login:{uris:null,password:null,username:null,totp:null}};if(o.length>2&&o.length%2==0)for(var l=0;l<o.length-2;l+=2){var u=o[l+2];if(u&&""!==u){var d=o[l+1],p=d.toLowerCase();"url"!==p||i.login.uris?"username"!==p&&"email"!==p||i.login.username?"password"!==p||i.login.password?"totp"!==p||i.login.totp?u.length>200?(i.notes||(i.notes=""),i.notes+=d+": "+u+"\n"):(i.fields||(i.fields=[]),i.fields.push({name:d,value:u,type:e.fieldType.text})):i.login.totp=u:i.login.password=u:i.login.username=u:i.login.uris=s(u)}}n.push(i)}}U([],n,[])}});break;case"pwsafexml":!function(t,n,r){var o=[],a=[],i=[],l=0;d(t,function(t){var c=$(t).find("passwordsafe");if(c.length){var u=c.attr("delimiter"),d=c.find("> entry");if(d.length)for(var p=0;p<d.length;p++){var m=$(d[p]),g=m.find("> title"),f=g.length?$(g):null,h=m.find("> username"),v=h.length?$(h):null,y=m.find("> email"),b=y.length?$(y):null,w=b?b.text():null,C=m.find("> password"),S=C.length?$(C):null,k=m.find("> url"),T=k.length?$(k):null,P=m.find("> notes"),I=P.length?$(P):null,E=I?I.text().split(u).join("\n"):null,z=m.find("> group"),O=z.length?$(z):null,A=O?O.text().split(".").join(" > "):null,U=o.length,x=a.length,D=A&&""!==A,F=D;if(D)for(l=0;l<o.length;l++)if(o[l].name===A){F=!1,U=l;break}var M={type:e.cipherType.login,favorite:!1,notes:I&&""!==E?E:null,name:f&&""!==f.text()?f.text():"--",login:{uris:T?s(T.text()):null,username:v&&""!==v.text()?v.text():null,password:S&&""!==S.text()?S.text():null}};if(!M.login.username&&w&&""!==w?M.login.username=w:w&&""!==w&&(M.notes=null===M.notes?"Email: "+w:M.notes+"\nEmail: "+w),a.push(M),F&&o.push({name:A}),D){var N={key:x,value:U};i.push(N)}}n(o,a,i)}else r()},r)}(i,m,g);break;case"dashlanecsv":z=i,O=m,Papa.parse(z,{encoding:"UTF-8",complete:function(t){c(t);for(var n=[],r=0;r<t.data.length;r++){var o=!1,a=t.data[r];if(a.length&&1!==a.length){var i={type:e.cipherType.login,name:a[0]&&""!==a[0]?a[0]:"--",favorite:!1,notes:null,login:{uris:null,password:null,username:null}};if(2===a.length)i.login.uris=s(a[1]);else if(3===a.length)i.login.uris=s(a[1]),i.login.username=a[2];else if(4===a.length)""===a[2]&&""===a[3]?(i.login.username=a[1],i.notes=a[2]+"\n"+a[3]):(i.login.username=a[2],i.notes=a[1]+"\n"+a[3]);else if(5===a.length)i.login.uris=s(a[1]),i.login.username=a[2],i.login.password=a[3],i.notes=a[4];else if(6===a.length)""===a[2]?(i.login.username=a[3],i.login.password=a[4],i.notes=a[5]):(i.login.username=a[2],i.login.password=a[3],i.notes=a[4]+"\n"+a[5]),i.login.uris=s(a[1]);else if(7===a.length)""===a[2]?(i.login.username=a[3],i.notes=a[4]+"\n"+a[6]):(i.login.username=a[2],i.notes=a[3]+"\n"+a[4]+"\n"+a[6]),i.login.uris=s(a[1]),i.login.password=a[5];else{i.notes="";for(var l=1;l<a.length;l++)if(i.notes=i.notes+a[l]+"\n","NO_TYPE"===a[l]){o=!0;break}}o||(""===i.login.username&&(i.login.username=null),""===i.login.password&&(i.login.password=null),""===i.notes&&(i.notes=null),n.push(i))}}O([],n,[])}});break;case"stickypasswordxml":!function(t,n,r){var o=[],a=[],i=[],l=0;function c(e,t,n){var r=e.find('> Groups > Group[ID="'+t+'"]');if(r.length){n&&""!==n&&(n=" > "+n),n=r.attr("Name")+n;var o=r.attr("ParentID");return c(e,o,n)}return n}d(t,function(t){var u=$(t).find("root > Database");if(u.length){var d=u.find("> Logins > Login");if(d.length)for(var p=0;p<d.length;p++){var m=$(d[p]),g=m.attr("Name"),f=m.attr("Password"),h=m.attr("ID"),v=null,y=null,b=null,w=null,C=null;if(h&&""!==h){var S=u.find('> Accounts > Account > LoginLinks > Login[SourceLoginID="'+h+'"]');if(S.length){var k=S.parent().parent();k.length&&(v=k.attr("Name"),y=k.attr("Link"),w=k.attr("ParentID"),(b=k.attr("Comments"))&&(b=b.split("/n").join("\n")))}}w&&""!==w&&(C=c(u,w,""));var T=o.length,P=a.length,I=C&&""!==C,E=I;if(I)for(l=0;l<o.length;l++)if(o[l].name===C){E=!1,T=l;break}var z={type:e.cipherType.login,favorite:!1,notes:b&&""!==b?b:null,name:v&&""!==v?v:"--",login:{uris:s(y),username:g&&""!==g?g:null,password:f&&""!==f?f:null}};if(a.push(z),E&&o.push({name:C}),I){var O={key:P,value:T};i.push(O)}}n(o,a,i)}else r()},r)}(i,m,g);break;case"msecurecsv":I=i,E=m,Papa.parse(I,{encoding:"UTF-8",complete:function(t){c(t);var n=[],r=[],o=[];angular.forEach(t.data,function(t,a){if(t.length>=3){var i=n.length,l=r.length,c=t[0]&&""!==t[0]&&"Unassigned"!==t[0],u=c,d=0;if(c)for(d=0;d<n.length;d++)if(n[d].name===t[0]){u=!1,i=d;break}var p={type:e.cipherType.login,favorite:!1,notes:"",name:t[2]&&""!==t[2]?t[2]:null,login:{uris:null,username:null,password:null}};if("Web Logins"===t[1])p.login.uris=s(t[4]),p.login.username=t[5]&&""!==t[5]?t[5]:null,p.login.password=t[6]&&""!==t[6]?t[6]:null,p.notes=t[3]&&""!==t[3]?t[3].split("\\n").join("\n"):null;else if(t.length>3)for(var m=3;m<t.length;m++)t[m]&&""!==t[m]&&(""!==p.notes&&(p.notes=p.notes+"\n"),p.notes=p.notes+t[m]);if(t[1]&&""!==t[1]&&"Web Logins"!==t[1]&&(p.name=t[1]+": "+p.name),""===p.notes&&(p.notes=null),r.push(p),u&&n.push({name:t[0]}),c){var g={key:l,value:i};o.push(g)}}}),E(n,r,o)}});break;case"truekeycsv":C=i,S=m,k=[],T=[],P=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"],Papa.parse(C,{header:!0,encoding:"UTF-8",complete:function(t){c(t),angular.forEach(t.data,function(t,n){var r={type:e.cipherType.login,favorite:!(!t.favorite||"true"!==t.favorite.toLowerCase()),notes:t.memo&&""!==t.memo?t.memo:null,name:t.name&&""!==t.name?t.name:"--",login:{uris:s(t.url),username:t.login&&""!==t.login?t.login:null,password:t.password&&""!==t.password?t.password:null},fields:null};if("login"!==t.kind)for(var o in r.name=t.title&&""!==t.title?t.title:"--",r.notes=t.note&&""!==t.note?t.note:null,r.notes||(r.notes=t.document_content&&""!==t.document_content?t.document_content:null),t)t.hasOwnProperty(o)&&P.indexOf(o.toLowerCase())<0&&t[o]&&""!==t[o]&&(t[o].length>200?(r.notes||(r.notes=""),r.notes+=o+": "+t[o]+"\n"):(r.fields||(r.fields=[]),r.fields.push({name:o,value:t[o],type:e.fieldType.text})));T.push(r)}),S(k,T,[])}});break;case"clipperzhtml":!function(t,o,i){var l=[],c=[];u(t,function(t){var i=$(t).find("textarea"),u=i&&i.length?i.val():null,d=u?JSON.parse(u):null;if(d&&d.length)for(var p=0;p<d.length;p++){var m=d[p],g={type:e.cipherType.login,favorite:!1,notes:"",name:m.label&&""!==m.label?m.label.split(" ")[0]:"--",login:{uris:null,username:null,password:null},fields:null};if(m.data&&m.data.notes&&""!==m.data.notes&&(g.notes=m.data.notes.split("\\n").join("\n")),m.currentVersion&&m.currentVersion.fields)for(var f in m.currentVersion.fields)if(m.currentVersion.fields.hasOwnProperty(f)){var h=m.currentVersion.fields[f],v=h.actionType.toLowerCase();switch(v){case"password":g.login.password=h.value;break;case"email":case"username":case"user":case"name":g.login.username=h.value;break;case"url":g.login.uris=s(h.value);break;default:!g.login.username&&a(h.label,r)?g.login.username=h.value:!g.login.password&&a(h.label,n)?g.login.password=h.value:h.value.length>200?(g.notes||(g.notes=""),g.notes+=h.label+": "+h.value+"\n"):(g.fields||(g.fields=[]),g.fields.push({name:h.label,value:h.value,type:e.fieldType.text}))}}""===g.notes&&(g.notes=null),c.push(g)}o(l,c,[])},i)}(i,m,g);break;case"avirajson":!function(t,n,r){var o=[],a=[],i=0;u(t,function(t){var r=JSON.parse(t);if(r&&r.accounts)for(i=0;i<r.accounts.length;i++){var l=r.accounts[i],c={type:e.cipherType.login,favorite:l.is_favorite&&!0===l.is_favorite,notes:null,name:l.label&&""!==l.label?l.label:l.domain,login:{uris:s(l.domain),username:l.username&&""!==l.username?l.username:null,password:l.password&&""!==l.password?l.password:null}};l.email&&""!==l.email&&(c.login.username&&""!==c.login.username?c.notes=l.email:c.login.username=l.email),c.name&&""!==c.name||(c.name="--"),a.push(c)}n(o,a,[])},r)}(i,m,g);break;case"roboformhtml":!function(t,o,i){var l=[],c=[];u(t,function(t){var i=$(t.split("&shy;").join("").split("<WBR>").join("")).find("table.nobr");if(i.length)for(var u=0;u<i.length;u++){var d=$(i[u]),p={type:e.cipherType.login,favorite:!1,notes:"",name:d.find("span.caption").text(),login:{uris:null,username:null,password:null},fields:null},m=d.find(".subcaption").text();m&&""!==m&&(p.login.uris=s(m));var g=[];if($.each(d.find("table td:not(.subcaption)"),function(e,t){$(t).find("br").replaceWith("\n");var n=$(t).text();""!==n&&g.push(n.split("\\n").join("\n"))}),g.length&&g.length%2==0)for(var f=0;f<g.length;f+=2){var h=g[f],v=g[f+1];!p.login.password&&a(h.replace(":",""),n)?p.login.password=v:!p.login.username&&a(h.replace(":",""),r)?p.login.username=v:v.length>200?(p.notes||(p.notes=""),p.notes+=h+": "+v+"\n"):(p.fields||(p.fields=[]),p.fields.push({name:h,value:v,type:e.fieldType.text}))}p.notes&&""!==p.notes||(p.notes=null),p.name&&""!==p.name||(p.name="--"),c.push(p)}o(l,c,[])},i)}(i,m,g);break;case"saferpasscsv":!function(t,n,r){var o=[],a=[];Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(t){c(t),angular.forEach(t.data,function(t,n){var r,o;a.push({type:e.cipherType.login,favorite:!1,notes:t.notes&&""!==t.notes?t.notes:null,name:t.url&&""!==t.url?(r=t.url,o=document.createElement("a"),o.href=r,o.hostname.startsWith("www.")?o.hostname.replace("www.",""):o.hostname):"--",login:{uris:s(t.url),username:t.username&&""!==t.username?t.username:null,password:t.password&&""!==t.password?t.password:null}})}),n(o,a,[])}})}(i,m);break;case"ascendocsv":b=i,w=m,Papa.parse(b,{encoding:"UTF-8",complete:function(t){c(t);for(var i=[],l=0;l<t.data.length;l++){var u=t.data[l];if(!(u.length<2)){var d=u[u.length-1],p={type:e.cipherType.login,name:u[0],favorite:!1,notes:d&&""!==d?d:null,login:{uris:null,password:null,username:null},fields:null};if(u.length>2&&u.length%2==0)for(var m=0;m<u.length-2;m+=2){var g=u[m+2],f=u[m+1];f&&""!==f&&g&&""!==g&&(f.toLowerCase(),!p.login.uris&&a(f,o)?p.login.uris=s(g):!p.login.username&&a(f,r)?p.login.username=g:!p.login.password&&a(f,n)?p.login.password=g:g.length>200?(p.notes||(p.notes=""),p.notes+=f+": "+g+"\n"):(p.fields||(p.fields=[]),p.fields.push({name:f,value:g,type:e.fieldType.text})))}i.push(p)}}w([],i,[])}});break;case"passwordbossjson":!function(t,n,r){var o=[],a=[],i=0;u(t,function(t){var r=JSON.parse(t);if(r&&r.length)for(i=0;i<r.length;i++){var l=r[i],c={type:e.cipherType.login,favorite:!1,notes:"",name:l.name&&""!==l.name?l.name:"--",login:{uris:s(l.login_url),username:null,password:null},fields:null};if(l.identifiers){for(var u in l.identifiers.notes&&""!==l.identifiers.notes&&(c.notes=l.identifiers.notes.split("\\r\\n").join("\n").split("\\n").join("\n")),l.identifiers)if(l.identifiers.hasOwnProperty(u)){var d=l.identifiers[u];if("notes"===u||""===d||null===d)continue;"username"===u?c.login.username=d:"password"===u?c.login.password=d:d.length>200?(c.notes||(c.notes=""),c.notes+=u+": "+d+"\n"):(c.fields||(c.fields=[]),c.fields.push({name:u,value:d,type:e.fieldType.text}))}""===c.notes&&(c.notes=null),a.push(c)}}n(o,a,[])},r)}(i,m,g);break;case"zohovaultcsv":!function(t,n,r){function o(t,n){if(t&&""!==t)for(var r=t.split(/(?:\r\n|\r|\n)/),o=0;o<r.length;o++){var a=r[o],i=a.indexOf(":");if(!(i<0)){var s=a.substring(0,i),l=a.length>i?a.substring(i+1):null;if(s&&""!==s&&l&&""!==l&&"SecretType"!==s){var c=s.toLowerCase();"user name"===c?n.login.username=l:"password"===c?n.login.password=l:l.length>200?(n.notes||(n.notes=""),n.notes+=s+": "+l+"\n"):(n.fields||(n.fields=[]),n.fields.push({name:s,value:l,type:e.fieldType.text}))}}}}Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(t){c(t);var r=[],a=[],i=[];angular.forEach(t.data,function(t,n){var l=t.ChamberName,c=r.length,u=a.length,d=l&&""!==l,p=d,m=0;if(d)for(m=0;m<r.length;m++)if(r[m].name===l){p=!1,c=m;break}var g={type:e.cipherType.login,favorite:!(!t.Favorite||"1"!==t.Favorite),notes:t.Notes&&""!==t.Notes?t.Notes:"",name:t["Secret Name"]&&""!==t["Secret Name"]?t["Secret Name"]:"--",login:{uris:s(t["Secret URL"]),username:null,password:null},fields:null};if(o(t.SecretData,g),o(t.CustomData,g),""===g.notes&&(g.notes=null),t["Secret Name"]&&a.push(g),p&&r.push({name:l}),d){var f={key:u,value:c};i.push(f)}}),n(r,a,i)}})}(i,m);break;case"splashidcsv":v=i,y=m,Papa.parse(v,{encoding:"UTF-8",complete:function(t){c(t);var n=[],r=[],o=[];function a(e,t,n){for(var r=e;r<t.length-3;r++)t[r]&&""!==t[r]&&(n.notes?""!==n.notes&&(n.notes+="\n"):n.notes="",n.notes+=t[r])}for(var i=1;i<t.data.length;i++)if(!(t.data[i].length<3)){var l=t.data[i],u=l[t.data.length-1],d=l[t.data.length-2],p=l[0],m=n.length,g=r.length,f=u&&""!==u&&"Unfiled"!==u,h=f,v=0;if(f)for(v=0;v<n.length;v++)if(n[v].name===u){h=!1,m=v;break}var b={type:e.cipherType.login,favorite:!1,notes:d,name:l[1]&&""!==l[1]?l[1]:"--",fields:null,login:{uris:null,username:null,password:null}};if("Web Logins"===p||"Servers"===p||"Email Accounts"===p?(b.login.uris=s(l[4]),b.login.username=l[2]&&""!==l[2]?l[2]:null,b.login.password=l[3]&&""!==l[3]?l[3]:null,a(5,l,b)):l.length>2&&a(2,l,b),b.name&&"--"!==b.name&&"Web Logins"!==p&&"Servers"!==p&&"Email Accounts"!==p&&(b.name=p+": "+b.name),""===b.notes&&(b.notes=null),r.push(b),h&&n.push({name:u}),f){var w={key:g,value:m};o.push(w)}}y(n,r,o)}});break;case"meldiumcsv":f=i,h=m,Papa.parse(f,{header:!0,encoding:"UTF-8",complete:function(t){c(t);for(var n=[],r=0;r<t.data.length;r++){var o=t.data[r],a={type:e.cipherType.login,name:o.DisplayName&&""!==o.DisplayName?o.DisplayName:"--",favorite:!1,notes:o.Notes&&""!==o.Notes?o.Notes:null,login:{uris:s(o.Url),password:o.Password&&""!==o.Password?o.Password:null,username:o.UserName&&""!==o.UserName?o.UserName:null}};n.push(a)}h([],n,[])}});break;case"passkeepcsv":!function(t,n,r){function o(e,t){var n=t[e]||t[" "+e];return n&&""!==n?n:null}Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(t){c(t);var r=[],a=[],i=[];angular.forEach(t.data,function(t,n){var l=r.length,c=a.length,u=!!o("category",t),d=u,p=0;if(u)for(p=0;p<r.length;p++)if(r[p].name===o("category",t)){d=!1,l=p;break}var m={type:e.cipherType.login,favorite:!1,notes:o("description",t)?o("description",t):null,name:o("title",t)?o("title",t):"--",login:{uris:o("site",t)?s(o("site",t)):null,username:o("username",t)?o("username",t):null,password:o("password",t)?o("password",t):null}};if(o("password2",t)&&(m.notes?m.notes+="\n":m.notes="",m.notes+="Password 2: "+o("password2",t)),a.push(m),d&&r.push({name:o("category",t)}),u){var g={key:c,value:l};i.push(g)}}),n(r,a,i)}})}(i,m);break;case"gnomejson":!function(t,n,r){var o=[],a=[],i=[],l=0;u(t,function(t){var r=JSON.parse(t),c=0,u=0;if(r&&Object.keys(r).length)for(var d in r)if(r.hasOwnProperty(d)&&r[d].length)for(c=o.length,o.push({name:d}),l=0;l<r[d].length;l++){var p=r[d][l];if(p.display_name&&0===p.display_name.indexOf("http")){u=a.length;var m={type:e.cipherType.login,favorite:!1,notes:"",name:p.display_name.replace("http://","").replace("https://",""),login:{uris:s(p.display_name),username:p.attributes.username_value&&""!==p.attributes.username_value?p.attributes.username_value:null,password:p.secret&&""!==p.secret?p.secret:null}};for(var g in m.name>30&&(m.name=m.name.substring(0,30)),p.attributes)p.attributes.hasOwnProperty(g)&&"username_value"!==g&&"xdg:schema"!==g&&(""!==m.notes&&(m.notes+="\n"),m.notes+=g+": "+p.attributes[g]);""===m.notes&&(m.notes=null),a.push(m),i.push({key:u,value:c})}}n(o,a,i)},r)}(i,m,g);break;default:g()}else g()},t.importOrg=function(t,n,r,o){var a,i;if(n)switch(t){case"bitwardencsv":a=n,i=r,Papa.parse(a,{header:!0,encoding:"UTF-8",complete:function(t){c(t);var n,r=[],o=[],a=[];angular.forEach(t.data,function(t,i){var c=o.length;if(t.collections&&""!==t.collections){var u=t.collections.split(",");for(n=0;n<u.length;n++){for(var d=!0,p=r.length,m=0;m<r.length;m++)if(r[m].name===u[n]){d=!1,p=m;break}d&&r.push({name:u[n]}),a.push({key:c,value:p})}}var g={favorite:!1,notes:t.notes&&""!==t.notes?t.notes:null,name:t.name&&""!==t.name?t.name:"--",type:e.cipherType.login};if(t.fields&&""!==t.fields){var f=t.fields.split(/(?:\r\n|\r|\n)/);for(n=0;n<f.length;n++)if(f[n]&&""!==f[n]){var h=f[n].lastIndexOf(": ");if(-1!==h){g.fields||(g.fields=[]);var v={name:f[n].substr(0,h),value:null,type:e.fieldType.text};f[n].length>h+2&&(v.value=f[n].substr(h+2)),g.fields.push(v)}}}var y=t.type?t.type.toLowerCase():null;switch(y){case"login":case null:case void 0:g.type=e.cipherType.login;var b=t.login_totp||t.totp,w=l(t.login_uri||t.uri),C=t.login_username||t.username,S=t.login_password||t.password;g.login={totp:b&&""!==b?b:null,uris:s(w),username:C&&""!==C?C:null,password:S&&""!==S?S:null};break;case"note":g.type=e.cipherType.secureNote,g.secureNote={type:0}}o.push(g)}),i(r,o,a)}});break;case"lastpass":p(n,r,o,!0);break;default:o()}else o()};var n=["password","pass word","passphrase","pass phrase","pass","code","code word","codeword","secret","secret word","personpwd","key","keyword","key word","keyphrase","key phrase","form_pw","wppassword","pin","pwd","pw","pword","passwd","p","serial","serial#","license key","reg #","passwort"],r=["user","name","user name","username","login name","email","e-mail","id","userid","user id","login","form_loginname","wpname","mail","loginid","login id","log","personlogin","first name","last name","card#","account #","member","member #","nom","benutzername"],o=["url","hyper link","hyperlink","link","host","hostname","host name","server","address","hyper ref","href","web","website","web site","site","web-site","uri","ort","adresse"];function a(e,t){if(!e||""===e)return!1;e=e.trim().toLowerCase();for(var n=0;n<t.length;n++)if(e===t[n])return!0;return!1}function i(e){return-1===(e=e.toLowerCase().trim()).indexOf("://")&&e.indexOf(".")>=0&&(e="http://"+e),e.length>1e3?e.substring(0,1e3):e}function s(e){if(!e)return null;if("string"==typeof e)return[{uri:i(e),match:null}];if(e.length){for(var t=[],n=0;n<e.length;n++)t.push({uri:i(e[n]),match:null});return t}return null}function l(e){if(!e||""===e)return null;var t=Papa.parse(e);return t&&t.data&&t.data.length&&t.data[0].length?t.data[0]:null}function c(e){if(e.errors&&e.errors.length)for(var t=0;t<e.errors.length;t++)console.warn("Error parsing row "+e.errors[t].row+": "+e.errors[t].message)}function u(e,t,n){if("string"==typeof e)t(e);else{var r=new FileReader;r.readAsText(e,"utf-8"),r.onload=function(e){t(e.target.result)},r.onerror=function(e){n()}}}function d(e,t,n){u(e,function(e){t($.parseXML(e))},n)}function p(t,n,r,o){if("string"!=typeof t&&t.type&&"text/html"===t.type){var a=new FileReader;a.readAsText(t,"utf-8"),a.onload=function(e){var t,n=$(e.target.result),o=n.find("pre");if(1===o.length)t=o.text().trim(),u(Papa.parse(t,{header:!0,encoding:"UTF-8"}).data);else{for(var a=!1,i=0;i<n.length;i++)if("pre"===n[i].tagName.toLowerCase()){a=!0,t=n[i].outerText.trim(),u(Papa.parse(t,{header:!0,encoding:"UTF-8"}).data);break}a||r()}},a.onerror=function(e){r()}}else Papa.parse(t,{header:!0,encoding:"UTF-8",complete:function(e){c(e),u(e.data)},beforeFirstChunk:function(e){return e.replace(/^\s+/,"")}});function i(e,t,n){for(var r={dataObj:{},notes:null},o=0;o<e.length;o++){var a=e[o].split(":");a.length<1||"NoteType"===a[0]||n.indexOf(a[0])>-1||!a[1]||""===a[1]||("Notes"===a[0]?r.notes?r.notes+="\n"+a[1]:r.notes=a[1]:t.hasOwnProperty(a[0])?r.dataObj[t[a[0]]]=a[1]:(r.notes?r.notes+="\n":r.notes="",r.notes+=a[0]+": "+a[1]))}return r}function l(e){var t={cardholderName:e.ccname&&""!==e.ccname?e.ccname:null,number:e.ccnum&&""!==e.ccnum?e.ccnum:null,brand:e.ccnum&&""!==e.ccnum?function(e){if(!e)return null;var t=new RegExp("^4");return null!=e.match(t)?"Visa":/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(e)?"Mastercard":(t=new RegExp("^3[47]"),null!=e.match(t)?"Amex":(t=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=e.match(t)?"Discover":(t=new RegExp("^36"),null!=e.match(t)?"Diners Club":(t=new RegExp("^30[0-5]"),null!=e.match(t)?"Diners Club":(t=new RegExp("^35(2[89]|[3-8][0-9])"),null!=e.match(t)?"JCB":(t=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=e.match(t)?"Visa":null))))))}(e.ccnum):null,code:e.cccsc&&""!==e.cccsc?e.cccsc:null};if(e.ccexp&&""!==e.ccexp&&e.ccexp.indexOf("-")>-1){var n=e.ccexp.split("-");n.length>1&&(t.expYear=n[0],t.expMonth=n[1],2===t.expMonth.length&&"0"===t.expMonth[0]&&(t.expMonth=t.expMonth[1]))}return t}function u(t){var r=[],a=[],c=[],u=0;angular.forEach(t,function(t,n){var d,p=r.length,m=a.length,g=t.grouping&&""!==t.grouping&&"(none)"!==t.grouping,f=g;if(g)for(u=0;u<r.length;u++)if(r[u].name===t.grouping){f=!1,p=u;break}if(t.hasOwnProperty("profilename")&&t.hasOwnProperty("profilelanguage")?(d={favorite:!1,name:t.profilename&&""!==t.profilename?t.profilename:"--",type:e.cipherType.card},""===t.title&&""===t.firstname&&""===t.lastname&&""===t.address1&&""===t.phone&&""===t.username&&""===t.email||(d.type=e.cipherType.identity)):d={favorite:!o&&"1"===t.fav,name:t.name&&""!==t.name?t.name:"--",type:"http://sn"===t.url?e.cipherType.secureNote:e.cipherType.login},d.type===e.cipherType.login)d.login={uris:s(t.url),username:t.username&&""!==t.username?t.username:null,password:t.password&&""!==t.password?t.password:null},d.notes=t.extra&&""!==t.extra?t.extra:null;else if(d.type===e.cipherType.secureNote){var h=t.extra.split(/(?:\r\n|\r|\n)/),v=!1;if(h.length){var y=h[0].split(":");if(y.length>1&&"NoteType"===y[0]&&("Credit Card"===y[1]||"Address"===y[1])){var b=null;"Credit Card"===y[1]?(b=i(h,{Number:"number","Name on Card":"cardholderName","Security Code":"code"},[]),d.type=e.cipherType.card,d.card=b.dataObj):"Address"===y[1]&&(b=i(h,{Title:"title","First Name":"firstName","Last Name":"lastName","Middle Name":"middleName",Company:"company","Address 1":"address1","Address 2":"address2","Address 3":"address3","City / Town":"city",State:"state","Zip / Postal Code":"postalCode",Country:"country","Email Address":"email",Username:"username"},[]),d.type=e.cipherType.identity,d.identity=b.dataObj),v=!0,d.notes=b.notes}}v||(d.secureNote={type:0},d.notes=t.extra&&""!==t.extra?t.extra:null)}else if(d.type===e.cipherType.card)d.card=l(t),d.notes=t.notes&&""!==t.notes?t.notes:null;else if(d.type===e.cipherType.identity&&(d.identity={title:t.title&&""!==t.title?t.title:null,firstName:t.firstname&&""!==t.firstname?t.firstname:null,middleName:t.middlename&&""!==t.middlename?t.middlename:null,lastName:t.lastname&&""!==t.lastname?t.lastname:null,username:t.username&&""!==t.username?t.username:null,company:t.company&&""!==t.company?t.company:null,ssn:t.ssn&&""!==t.ssn?t.ssn:null,address1:t.address1&&""!==t.address1?t.address1:null,address2:t.address2&&""!==t.address2?t.address2:null,address3:t.address3&&""!==t.address3?t.address3:null,city:t.city&&""!==t.city?t.city:null,state:t.state&&""!==t.state?t.state:null,postalCode:t.zip&&""!==t.zip?t.zip:null,country:t.country&&""!==t.country?t.country:null,email:t.email&&""!==t.email?t.email:null,phone:t.phone&&""!==t.phone?t.phone:null},d.notes=t.notes&&""!==t.notes?t.notes:null,d.identity.title&&(d.identity.title=d.identity.title.charAt(0).toUpperCase()+d.identity.title.slice(1)),t.ccnum&&""!==t.ccnum)){var w=JSON.parse(JSON.stringify(d));w.identity=null,w.type=e.cipherType.card,w.card=l(t),a.push(w)}if(a.push(d),f&&r.push({name:t.grouping}),g){var C={key:m,value:p};c.push(C)}}),n(r,a,c)}}return t}]),angular.module("bit.services").factory("passwordService",function(){var e={};function t(e,n){var r=0,o=n-e,a=Math.ceil(Math.log2(o));if(a>53)throw new Exception("We cannot generate numbers larger than 53 bits.");var i=Math.ceil(a/8),s=Math.pow(2,a)-1,l=new Uint8Array(i);window.crypto.getRandomValues(l);for(var c=8*(i-1),u=0;u<i;u++)r+=l[u]*Math.pow(2,c),c-=8;return(r&=s)>=o?t(e,n):e+r}return e.generatePassword=function(e){var n=angular.extend({},{length:10,ambiguous:!1,number:!0,minNumber:1,uppercase:!0,minUppercase:1,lowercase:!0,minLowercase:1,special:!1,minSpecial:1},e);n.uppercase&&n.minUppercase<0&&(n.minUppercase=1),n.lowercase&&n.minLowercase<0&&(n.minLowercase=1),n.number&&n.minNumber<0&&(n.minNumber=1),n.special&&n.minSpecial<0&&(n.minSpecial=1),(!n.length||n.length<1)&&(n.length=10);var r=n.minUppercase+n.minLowercase+n.minNumber+n.minSpecial;n.length<r&&(n.length=r);var o=[];if(n.lowercase&&n.minLowercase>0)for(var a=0;a<n.minLowercase;a++)o.push("l");if(n.uppercase&&n.minUppercase>0)for(var i=0;i<n.minUppercase;i++)o.push("u");if(n.number&&n.minNumber>0)for(var s=0;s<n.minNumber;s++)o.push("n");if(n.special&&n.minSpecial>0)for(var l=0;l<n.minSpecial;l++)o.push("s");for(;o.length<n.length;)o.push("a");o.sort(function(){return 2*t(0,1)-1});var c="",u="abcdefghijkmnopqrstuvwxyz";n.ambiguous&&(u+="l"),n.lowercase&&(c+=u);var d="ABCDEFGHIJKLMNPQRSTUVWXYZ";n.ambiguous&&(d+="O"),n.uppercase&&(c+=d);var p="23456789";n.ambiguous&&(p+="01"),n.number&&(c+=p);var m="!@#$%^&*";n.special&&(c+=m);for(var g="",f=0;f<n.length;f++){var h;switch(o[f]){case"l":h=u;break;case"u":h=d;break;case"n":h=p;break;case"s":h=m;break;case"a":h=c}var v=t(0,h.length-1);g+=h.charAt(v)}return g},e}),angular.module("bit.services").factory("tokenService",["$sessionStorage","$localStorage","jwtHelper",function(e,t,n){var r={},o=null,a=null;return r.setToken=function(t){e.accessToken=t,o=t},r.getToken=function(){return o||(o=e.accessToken),o||null},r.clearToken=function(){o=null,delete e.accessToken},r.setRefreshToken=function(t){e.refreshToken=t,a=t},r.getRefreshToken=function(){return a||(a=e.refreshToken),a||null},r.clearRefreshToken=function(){a=null,delete e.refreshToken},r.setTwoFactorToken=function(e,n){t.twoFactor||(t.twoFactor={}),t.twoFactor[n]=e},r.getTwoFactorToken=function(e){return t.twoFactor?t.twoFactor[e]:null},r.clearTwoFactorToken=function(e){e?t.twoFactor&&t.twoFactor[e]&&delete t.twoFactor[e]:delete t.twoFactor},r.clearTokens=function(){r.clearToken(),r.clearRefreshToken()},r.tokenSecondsRemaining=function(e,t){var r=n.getTokenExpirationDate(e);if(t=t||0,null===r)return 0;var o=r.valueOf()-((new Date).valueOf()+1e3*t);return Math.round(o/1e3)},r.tokenNeedsRefresh=function(e,t){return t=t||5,r.tokenSecondsRemaining(e)<60*t},r}]),angular.module("bit.services").factory("utilsService",["constants",function(e){var t,n={};return n.getDeviceType=function(n){return t||(t=navigator.userAgent.indexOf(" Vivaldi/")>=0?e.deviceType.vivaldi:window.chrome&&window.chrome.webstore?e.deviceType.chrome:"undefined"!=typeof InstallTrigger?e.deviceType.firefox:window.opr&&opr.addons||window.opera||navigator.userAgent.indexOf(" OPR/")>=0?e.deviceType.firefox:/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString()?e.deviceType.opera:document.documentMode?e.deviceType.ie:window.StyleMedia?e.deviceType.edge:e.deviceType.unknown)},n}]),angular.module("bit.services").factory("validationService",function(){var e={addErrors:function(t,n){var r=n.data,o="An unexpected error has occurred.";if(t.$errors=[],r&&angular.isObject(r))if(r&&r.ErrorModel&&(r=r.ErrorModel),r.ValidationErrors){for(var a in r.ValidationErrors)if(r.ValidationErrors.hasOwnProperty(a))for(var i=0;i<r.ValidationErrors[a].length;i++)e.addError(t,a,r.ValidationErrors[a][i])}else r.Message?t.$errors.push(r.Message):t.$errors.push(o);else t.$errors.push(o)},addError:function(e,t,n,r){!r&&e.$errors||(e.$errors=[]);for(var o=!0,a=0;a<e.$errors.length;a++)if(e.$errors[a]===n){o=!1;break}o&&e.$errors.push(n),t&&""!==t&&e[t]&&e[t].$registerApiError&&e[t].$registerApiError()},parseErrors:function(e){var t=e.data,n="An unexpected error has occurred.",r=[];if(!t||!angular.isObject(t))return r.push(n),r;for(var o in t&&t.ErrorModel&&(t=t.ErrorModel),t.ValidationErrors||(t.Message?r.push(t.Message):r.push(n)),t.ValidationErrors)if(t.ValidationErrors.hasOwnProperty(o))for(var a=0;a<t.ValidationErrors[o].length;a++)r.push(t.ValidationErrors[o][a]);return r}};return e}),angular.module("bit.vault").controller("settingsAddEditEquivalentDomainController",["$scope","$uibModalInstance","$analytics","domainIndex","domains",function(e,t,n,r,o){n.eventTrack("settingsAddEditEquivalentDomainController",{category:"Modal"}),e.domains=o,e.index=r,e.submit=function(o){n.eventTrack((r?"Edited":"Added")+" Equivalent Domain"),t.close({domains:e.domains,index:r})},e.close=function(){t.dismiss("close")}}]),angular.module("bit.settings").controller("settingsBillingAdjustStorageController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","add",function(e,t,n,r,o,a,i){o.eventTrack("settingsBillingAdjustStorageController",{category:"Modal"}),e.add=i,e.storageAdjustment=0,e.submit=function(){var t={storageGbAdjustment:e.storageAdjustment};i||(t.storageGbAdjustment*=-1),e.submitPromise=r.accounts.putStorage(null,t).$promise.then(function(t){i?(o.eventTrack("Added Storage"),a.success("You have added "+e.storageAdjustment+" GB.")):(o.eventTrack("Removed Storage"),a.success("You have removed "+e.storageAdjustment+" GB.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.organization").controller("settingsBillingChangePaymentController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","existingPaymentMethod","appSettings","$timeout",function(e,t,n,r,o,a,i,s,l){o.eventTrack("settingsBillingChangePaymentController",{category:"Modal"}),e.existingPaymentMethod=i,e.paymentMethod="card",e.dropinLoaded=!1,e.showPaymentOptions=!1,e.hideBank=!0,e.card={};var c=null;e.changePaymentMethod=function(t){e.paymentMethod=t,"paypal"===e.paymentMethod&&braintree.dropin.create({authorization:s.braintreeKey,container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue"}}},function(t,n){t?console.error(t):(c=n,l(function(){e.dropinLoaded=!0}))})},e.submit=function(){var t;e.submitPromise=(t=e.card,"paypal"===e.paymentMethod?c.requestPaymentMethod().then(function(e){return e.nonce}).catch(function(e){throw e.message}):stripe.card.createToken(t).then(function(e){return e.id}).catch(function(e){throw e.message})).then(function(e){if(!e)throw"No payment token.";var t={paymentToken:e};return r.accounts.putPayment(null,t).$promise},function(e){throw e}).then(function(t){e.card=null,i?(o.eventTrack("Changed Payment Method"),a.success("You have changed your payment method.")):(o.eventTrack("Added Payment Method"),a.success("You have added a payment method.")),n.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsBillingController",["$scope","apiService","authService","$state","$uibModal","toastr","$analytics","appSettings",function(e,t,n,r,o,a,i,s){e.selfHosted=s.selfHosted,e.charges=[],e.paymentSource=null,e.subscription=null,e.loading=!0;var l=null;function c(){n.getUserProfile().then(function(n){return e.premium=n.premium,n.premium?t.accounts.getBilling({}).$promise:null}).then(function(t){if(!t)return r.go("backend.user.settingsPremium");var n=0;if(e.expiration=t.Expiration,l=t.License,e.storage=null,t&&t.MaxStorageGb&&(e.storage={currentGb:t.StorageGb||0,maxGb:t.MaxStorageGb,currentName:t.StorageName||"0 GB"},e.storage.percentage=+(e.storage.currentGb/e.storage.maxGb*100).toFixed(2)),e.subscription=null,t&&t.Subscription&&(e.subscription={trialEndDate:t.Subscription.TrialEndDate,cancelledDate:t.Subscription.CancelledDate,status:t.Subscription.Status,cancelled:t.Subscription.Cancelled,markedForCancel:!t.Subscription.Cancelled&&t.Subscription.CancelAtEndDate}),e.nextInvoice=null,t&&t.UpcomingInvoice&&(e.nextInvoice={date:t.UpcomingInvoice.Date,amount:t.UpcomingInvoice.Amount}),t&&t.Subscription&&t.Subscription.Items)for(e.subscription.items=[],n=0;n<t.Subscription.Items.length;n++)e.subscription.items.push({amount:t.Subscription.Items[n].Amount,name:t.Subscription.Items[n].Name,interval:t.Subscription.Items[n].Interval,qty:t.Subscription.Items[n].Quantity});e.paymentSource=null,t&&t.PaymentSource&&(e.paymentSource={type:t.PaymentSource.Type,description:t.PaymentSource.Description,cardBrand:t.PaymentSource.CardBrand});var o=[];if(t&&t.Charges)for(n=0;n<t.Charges.length;n++)o.push({date:t.Charges[n].CreatedDate,paymentSource:t.Charges[n].PaymentSource?t.Charges[n].PaymentSource.Description:"-",amount:t.Charges[n].Amount,status:t.Charges[n].Status,failureMessage:t.Charges[n].FailureMessage,refunded:t.Charges[n].Refunded,partiallyRefunded:t.Charges[n].PartiallyRefunded,refundedAmount:t.Charges[n].RefundedAmount,invoiceId:t.Charges[n].InvoiceId});e.charges=o,e.loading=!1})}e.expiration=null,e.$on("$viewContentLoaded",function(){c()}),e.changePayment=function(){e.selfHosted||o.open({animation:!0,templateUrl:"app/settings/views/settingsBillingChangePayment.html",controller:"settingsBillingChangePaymentController",resolve:{existingPaymentMethod:function(){return e.paymentSource?e.paymentSource.description:null}}}).result.then(function(){c()})},e.adjustStorage=function(t){e.selfHosted||o.open({animation:!0,templateUrl:"app/settings/views/settingsBillingAdjustStorage.html",controller:"settingsBillingAdjustStorageController",resolve:{add:function(){return t}}}).result.then(function(){c()})},e.cancel=function(){e.selfHosted||confirm("Are you sure you want to cancel? You will lose access to all premium features at the end of this billing cycle.")&&t.accounts.putCancelPremium({},{}).$promise.then(function(e){i.eventTrack("Canceled Premium"),a.success("Premium subscription has been canceled."),c()})},e.reinstate=function(){e.selfHosted||confirm("Are you sure you want to remove the cancellation request and reinstate your premium membership?")&&t.accounts.putReinstatePremium({},{}).$promise.then(function(e){i.eventTrack("Reinstated Premium"),a.success("Premium cancellation request has been removed."),c()})},e.updateLicense=function(){e.selfHosted&&o.open({animation:!0,templateUrl:"app/settings/views/settingsBillingUpdateLicense.html",controller:"settingsBillingUpdateLicenseController"}).result.then(function(){c()})},e.license=function(){if(!e.selfHosted){var t=JSON.stringify(l,null,2),n=new Blob([t]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(n,"bitwarden_premium_license.json");else{var r=window.document.createElement("a");r.href=window.URL.createObjectURL(n,{type:"text/plain"}),r.download="bitwarden_premium_license.json",document.body.appendChild(r),r.click(),document.body.removeChild(r)}}}}]),angular.module("bit.settings").controller("settingsBillingUpdateLicenseController",["$scope","$state","$uibModalInstance","apiService","$analytics","toastr","validationService",function(e,t,n,r,o,a,i){o.eventTrack("settingsBillingUpdateLicenseController",{category:"Modal"}),e.submit=function(t){var s=document.getElementById("file").files;if(s&&s.length){var l=new FormData;l.append("license",s[0]),e.submitPromise=r.accounts.putLicense(l).$promise.then(function(e){o.eventTrack("Updated License"),a.success("You have updated your license."),n.close()})}else i.addError(t,"file","Select a license file.",!0)},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsChangeEmailController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","validationService",function(e,t,n,r,o,a,i,s,l){var c,u,d;s.eventTrack("settingsChangeEmailController",{category:"Modal"}),e.token=function(t,r){o.getEncKey()?(u=t.masterPassword,d=t.newEmail.toLowerCase(),e.tokenPromise=o.hashPassword(u).then(function(t){var r={newEmail:d,masterPasswordHash:c=t};return n.accounts.emailToken(r,function(){e.tokenSent=!0}).$promise})):l.addError(r,null,"You cannot change your email until you update your encryption key.",!0)},e.confirm=function(l){e.confirmPromise=o.makeKeyAndHash(d,u).then(function(e){var t=o.getEncKey(),r=o.encrypt(t.key,e.key,"raw"),a={token:l.token,newEmail:d,masterPasswordHash:c,newMasterPasswordHash:e.hash,key:r};return n.accounts.email(a).$promise}).then(function(){return r.dismiss("cancel"),a.logOut(),s.eventTrack("Changed Email"),t.go("frontend.login.info")}).then(function(){i.success("Please log back in.","Email Changed")})},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsChangePasswordController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","validationService","toastr","$analytics",function(e,t,n,r,o,a,i,s,l){l.eventTrack("settingsChangePasswordController",{category:"Modal"}),e.save=function(c,u){var d,p=!1;(o.getEncKey()||(i.addError(u,null,"You cannot change your master password until you update your encryption key.",!0),p=!0),e.model.newMasterPassword.length<8&&(i.addError(u,"NewMasterPasswordHash","Master password must be at least 8 characters long.",!0),p=!0),e.model.newMasterPassword!==e.model.confirmNewMasterPassword&&(i.addError(u,"ConfirmNewMasterPasswordHash","New master password confirmation does not match.",!0),p=!0),p)||(e.savePromise=a.getUserProfile().then(function(e){return o.makeKeyAndHash(e.email,c.newMasterPassword)}).then(function(e){return d=e,o.hashPassword(c.masterPassword)}).then(function(e){var t=o.getEncKey(),r=o.encrypt(t.key,d.key,"raw"),a={masterPasswordHash:e,newMasterPasswordHash:d.hash,key:r};return n.accounts.putPassword(a).$promise}).then(function(){return r.dismiss("cancel"),a.logOut(),l.eventTrack("Changed Password"),t.go("frontend.login.info")}).then(function(){s.success("Please log back in.","Master Password Changed")}))},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsController",["$scope","$state","$uibModal","apiService","toastr","authService","$localStorage","$rootScope","cipherService",function(e,t,n,r,o,a,i,s,l){function c(){$("html, body").animate({scrollTop:0},200)}e.model={profile:{},email:null,disableWebsiteIcons:!1},e.$on("$viewContentLoaded",function(){r.accounts.getProfile({},function(t){if(e.model={profile:{name:t.Name,masterPasswordHint:t.MasterPasswordHint,culture:t.Culture},email:t.Email,disableWebsiteIcons:i.disableWebsiteIcons},t.Organizations){for(var n=[],r=0;r<t.Organizations.length;r++)2===t.Organizations[r].Status&&n.push({id:t.Organizations[r].Id,name:t.Organizations[r].Name,status:t.Organizations[r].Status,type:t.Organizations[r].Type,enabled:t.Organizations[r].Enabled});e.model.organizations=n}})}),e.generalSave=function(){e.generalPromise=r.accounts.putProfile({},e.model.profile,function(e){a.setUserProfile(e).then(function(e){o.success("Account has been updated.","Success!")})}).$promise},e.passwordHintSave=function(){e.passwordHintPromise=r.accounts.putProfile({},e.model.profile,function(e){a.setUserProfile(e).then(function(e){o.success("Account has been updated.","Success!")})}).$promise},e.optionsSave=function(){i.disableWebsiteIcons=l.disableWebsiteIcons=e.model.disableWebsiteIcons,s.vaultCiphers=null,o.success("Options have been updated.","Success!")},e.changePassword=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsChangePassword.html",controller:"settingsChangePasswordController"})},e.changeEmail=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsChangeEmail.html",controller:"settingsChangeEmailController"})},e.viewOrganization=function(e){if(2===e.type)return c(),void o.error("You cannot manage this organization.");t.go("backend.org.dashboard",{orgId:e.id})},e.leaveOrganization=function(t){confirm("Are you sure you want to leave this organization ("+t.name+")?")&&r.organizations.postLeave({id:t.id},{},function(n){a.refreshAccessToken().then(function(){var n=e.model.organizations.indexOf(t);n>-1&&e.model.organizations.splice(n,1),o.success("You have left the organization."),c()})},function(e){o.error("Unable to leave this organization."),c()})},e.sessions=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsSessions.html",controller:"settingsSessionsController"})},e.delete=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsDelete.html",controller:"settingsDeleteController"})},e.purge=function(){n.open({animation:!0,templateUrl:"app/settings/views/settingsPurge.html",controller:"settingsPurgeController"})}}]),angular.module("bit.settings").controller("settingsCreateOrganizationController",["$scope","$state","apiService","cryptoService","toastr","$analytics","authService","constants","appSettings","validationService",function(e,t,n,r,o,a,i,s,l,c){e.plans=s.plans,e.storageGb=s.storageGb,e.paymentMethod="card",e.selfHosted=l.selfHosted,e.model={plan:"free",additionalSeats:0,interval:"year",ownedBusiness:!1,additionalStorageGb:null},e.totalPrice=function(){return"month"===e.model.interval?(e.model.additionalSeats||0)*(e.plans[e.model.plan].monthlySeatPrice||0)+(e.model.additionalStorageGb||0)*e.storageGb.monthlyPrice+(e.plans[e.model.plan].monthlyBasePrice||0):(e.model.additionalSeats||0)*(e.plans[e.model.plan].annualSeatPrice||0)+(e.model.additionalStorageGb||0)*e.storageGb.yearlyPrice+(e.plans[e.model.plan].annualBasePrice||0)},e.changePaymentMethod=function(t){e.paymentMethod=t},e.changedPlan=function(){e.plans[e.model.plan].hasOwnProperty("monthPlanType")&&(e.model.interval="year"),e.plans[e.model.plan].noAdditionalSeats?e.model.additionalSeats=0:e.model.additionalSeats||e.plans[e.model.plan].baseSeats||e.plans[e.model.plan].noAdditionalSeats||(e.model.additionalSeats=1)},e.changedBusiness=function(){e.model.ownedBusiness&&(e.model.plan="teams")},e.submit=function(s,l){var u=r.makeShareKey(),d=r.encrypt("Default Collection",u.key);if(e.selfHosted){var p=document.getElementById("file").files;if(!p||!p.length)return void c.addError(l,"file","Select a license file.",!0);var m=new FormData;m.append("license",p[0]),m.append("key",u.ct),m.append("collectionName",d),e.submitPromise=n.organizations.postLicense(m).$promise.then(h)}else if("free"===s.plan){var g={name:s.name,planType:s.plan,key:u.ct,billingEmail:s.billingEmail,collectionName:d};e.submitPromise=n.organizations.post(g).$promise.then(h)}else{var f=null;if("card"===e.paymentMethod)f=stripe.card.createToken(s.card);else{if("bank"!==e.paymentMethod)return;s.bank.currency="USD",s.bank.country="US",f=stripe.bankAccount.createToken(s.bank)}e.submitPromise=f.then(function(t){var r={name:s.name,planType:"month"===s.interval?e.plans[s.plan].monthPlanType:e.plans[s.plan].annualPlanType,key:u.ct,paymentToken:t.id,additionalSeats:s.additionalSeats,additionalStorageGb:s.additionalStorageGb,billingEmail:s.billingEmail,businessName:s.ownedBusiness?s.businessName:null,country:"card"===e.paymentMethod?s.card.address_country:null,collectionName:d};return n.organizations.post(r).$promise},function(e){throw e.message}).then(h)}function h(e){a.eventTrack("Created Organization"),i.addProfileOrganizationOwner(e,u.ct),i.refreshAccessToken().then(function(){v(e.Id)},function(){v(e.Id)})}function v(e){t.go("backend.org.dashboard",{orgId:e}).then(function(){o.success("Your new organization is ready to go!","Organization Created")})}}}]),angular.module("bit.settings").controller("settingsDeleteController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","tokenService",function(e,t,n,r,o,a,i,s,l){s.eventTrack("settingsDeleteController",{category:"Modal"}),e.submit=function(c){var u;e.submitPromise=a.getUserProfile().then(function(e){return u=e,o.hashPassword(c.masterPassword)}).then(function(e){return n.accounts.postDelete({masterPasswordHash:e}).$promise}).then(function(){return r.dismiss("cancel"),a.logOut(),l.clearTwoFactorToken(u.email),s.eventTrack("Deleted Account"),t.go("frontend.login.info")}).then(function(){i.success("Your account has been closed and all associated data has been deleted.","Account Deleted")})},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsDomainsController",["$scope","$state","apiService","toastr","$analytics","$uibModal",function(e,t,n,r,o,a){e.globalEquivalentDomains=[],e.equivalentDomains=[],n.settings.getDomains({},function(t){var n;if(t.EquivalentDomains)for(n=0;n<t.EquivalentDomains.length;n++)e.equivalentDomains.push(t.EquivalentDomains[n].join(", "));if(t.GlobalEquivalentDomains)for(n=0;n<t.GlobalEquivalentDomains.length;n++)e.globalEquivalentDomains.push({domains:t.GlobalEquivalentDomains[n].Domains.join(", "),excluded:t.GlobalEquivalentDomains[n].Excluded,key:t.GlobalEquivalentDomains[n].Type})}),e.toggleExclude=function(e){e.excluded=!e.excluded},e.customize=function(t){t.excluded=!0,e.equivalentDomains.push(t.domains)},e.delete=function(t){e.equivalentDomains.splice(t,1),e.$emit("removeAppendedDropdownMenu")},e.addEdit=function(t){a.open({animation:!0,templateUrl:"app/settings/views/settingsAddEditEquivalentDomain.html",controller:"settingsAddEditEquivalentDomainController",resolve:{domainIndex:function(){return t},domains:function(){return null!==t?e.equivalentDomains[t]:null}}}).result.then(function(t){t.domains&&(t.domains=t.domains.split(" ").join("").split(",").join(", ")),null!==t.index?e.equivalentDomains[t.index]=t.domains:e.equivalentDomains.push(t.domains)})},e.saveGlobal=function(){e.globalPromise=i()},e.saveCustom=function(){e.customPromise=i()};var i=function(){for(var t={ExcludedGlobalEquivalentDomains:[],EquivalentDomains:[]},a=0;a<e.globalEquivalentDomains.length;a++)e.globalEquivalentDomains[a].excluded&&t.ExcludedGlobalEquivalentDomains.push(e.globalEquivalentDomains[a].key);for(a=0;a<e.equivalentDomains.length;a++)t.EquivalentDomains.push(e.equivalentDomains[a].split(" ").join("").split(","));return t.EquivalentDomains.length||(t.EquivalentDomains=null),t.ExcludedGlobalEquivalentDomains.length||(t.ExcludedGlobalEquivalentDomains=null),n.settings.putDomains(t,function(e){o.eventTrack("Saved Equivalent Domains"),r.success("Domains have been updated.","Success!")}).$promise}}]),angular.module("bit.settings").controller("settingsPremiumController",["$scope","$state","apiService","toastr","$analytics","authService","constants","$timeout","appSettings","validationService",function(e,t,n,r,o,a,i,s,l,c){var u=null;a.getUserProfile().then(function(e){if((u=e)&&u.premium)return t.go("backend.user.settingsBilling")}),e.selfHosted=l.selfHosted;var d=null;function p(){return a.updateProfilePremium(!0).then(function(){return o.eventTrack("Signed Up Premium"),a.refreshAccessToken()}).then(function(){return t.go("backend.user.settingsBilling")}).then(function(){r.success("Premium upgrade complete.","Success")})}e.storageGbPrice=i.storageGb.yearlyPrice,e.premiumPrice=i.premium.price,e.paymentMethod="card",e.dropinLoaded=!1,e.model={additionalStorageGb:null},e.changePaymentMethod=function(t){e.paymentMethod=t,"paypal"===e.paymentMethod&&braintree.dropin.create({authorization:l.braintreeKey,container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue"}}},function(t,n){t?console.error(t):(d=n,s(function(){e.dropinLoaded=!0}))})},e.totalPrice=function(){return e.premiumPrice+(e.model.additionalStorageGb||0)*e.storageGbPrice},e.submit=function(t,r){if(e.selfHosted){if(u&&!u.emailVerified)return void c.addError(r,null,"Your account's email address first must be verified.",!0);var o=document.getElementById("file").files;if(!o||!o.length)return void c.addError(r,"file","Select a license file.",!0);var a=new FormData;a.append("license",o[0]),e.submitPromise=n.accounts.postPremium(a).$promise.then(function(e){return p()})}else e.submitPromise=(i=t,"paypal"===e.paymentMethod?d.requestPaymentMethod().then(function(e){return e.nonce}).catch(function(e){throw e.message}):stripe.card.createToken(i.card).then(function(e){return e.id}).catch(function(e){throw e.message})).then(function(e){if(!e)throw"No payment token.";var r=new FormData;return r.append("paymentToken",e),r.append("additionalStorageGb",t.additionalStorageGb||0),n.accounts.postPremium(r).$promise},function(e){throw e}).then(function(e){return p()});var i}}]),angular.module("bit.settings").controller("settingsPurgeController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","tokenService",function(e,t,n,r,o,a,i,s,l){s.eventTrack("settingsPurgeController",{category:"Modal"}),e.submit=function(a){e.submitPromise=o.hashPassword(a.masterPassword).then(function(e){return n.ciphers.purge({masterPasswordHash:e}).$promise}).then(function(){return r.dismiss("cancel"),s.eventTrack("Purged Vault"),t.go("backend.user.vault",{refreshFromServer:!0})}).then(function(){i.success("All items in your vault have been deleted.","Vault Purged")})},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsSessionsController",["$scope","$state","apiService","$uibModalInstance","cryptoService","authService","tokenService","toastr","$analytics",function(e,t,n,r,o,a,i,s,l){l.eventTrack("settingsSessionsController",{category:"Modal"}),e.submit=function(c){var u,d;e.submitPromise=o.hashPassword(c.masterPassword).then(function(e){return u=e,a.getUserProfile()}).then(function(e){return d=e,n.accounts.putSecurityStamp({masterPasswordHash:u}).$promise}).then(function(){return r.dismiss("cancel"),a.logOut(),i.clearTwoFactorToken(d.email),l.eventTrack("Deauthorized Sessions"),t.go("frontend.login.info")}).then(function(){s.success("Please log back in.","All Sessions Deauthorized")})},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.settings").controller("settingsTwoStepAuthenticatorController",["$scope","apiService","$uibModalInstance","cryptoService","authService","$q","toastr","$analytics","constants","$timeout",function(e,t,n,r,o,a,i,s,l,c){s.eventTrack("settingsTwoStepAuthenticatorController",{category:"Modal"});var u,d="Bitwarden",p=null,m=null;function g(t){var n;e.enabled=t.Enabled,m=t.Key,e.model={key:(n=m,n?n.replace(/(.{4})/g,"$1 ").trim().toUpperCase():null),qr:"https://chart.googleapis.com/chart?chs=160x160&chld=L|0&cht=qr&chl=otpauth://totp/"+d+":"+encodeURIComponent(p.email)+"%3Fsecret="+encodeURIComponent(m)+"%26issuer="+d},e.updateModel={token:null}}c(function(){$("#masterPassword").focus()}),e.auth=function(n){var a=null;e.authPromise=r.hashPassword(n.masterPassword).then(function(e){return u=e,t.twoFactor.getAuthenticator({},{masterPasswordHash:u}).$promise}).then(function(e){return a=e,o.getUserProfile()}).then(function(t){p=t,e.account=p.email,g(a)})},e.submit=function(n){var r;n&&n.token?(r=n,e.submitPromise=t.twoFactor.putAuthenticator({},{token:r.token.replace(" ",""),key:m,masterPasswordHash:u},function(e){s.eventTrack("Enabled Two-step Authenticator"),g(e),r.token=null}).$promise):function(){if(!confirm("Are you sure you want to disable the authenticator app provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:u,type:l.twoFactorProvider.authenticator},function(t){s.eventTrack("Disabled Two-step Authenticator"),i.success("Authenticator app has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}()};var f=!1;e.close=function(){f=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,r){f||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepController",["$scope","apiService","toastr","$analytics","constants","$filter","$uibModal","authService",function(e,t,n,r,o,a,i,s){e.providers=o.twoFactorProviderInfo,e.premium=!0,s.getUserProfile().then(function(n){return e.premium=n.premium,t.twoFactor.list({}).$promise}).then(function(t){if(t.Data)for(var n=0;n<t.Data.length;n++)if(t.Data[n].Enabled){var r=a("filter")(e.providers,{type:t.Data[n].Type});r.length&&(r[0].enabled=!0)}}),e.edit=function(t){if(e.premium||t.free){if(t.type===o.twoFactorProvider.authenticator)typeName="Authenticator";else if(t.type===o.twoFactorProvider.email)typeName="Email";else if(t.type===o.twoFactorProvider.yubikey)typeName="Yubi";else if(t.type===o.twoFactorProvider.duo)typeName="Duo";else{if(t.type!==o.twoFactorProvider.u2f)return;typeName="U2f"}i.open({animation:!0,templateUrl:"app/settings/views/settingsTwoStep"+typeName+".html",controller:"settingsTwoStep"+typeName+"Controller",resolve:{enabled:function(){return t.enabled}}}).result.then(function(e){(e||!1===e)&&(t.enabled=e)})}else i.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})},e.viewRecover=function(){i.open({animation:!0,templateUrl:"app/settings/views/settingsTwoStepRecover.html",controller:"settingsTwoStepRecoverController"})}}]),angular.module("bit.settings").controller("settingsTwoStepDuoController",["$scope","apiService","$uibModalInstance","cryptoService","toastr","$analytics","constants","$timeout",function(e,t,n,r,o,a,i,s){var l;function c(t){e.enabled=t.Enabled,e.updateModel={ikey:t.IntegrationKey,skey:t.SecretKey,host:t.Host}}a.eventTrack("settingsTwoStepDuoController",{category:"Modal"}),e.updateModel={token:null,host:null,ikey:null,skey:null},s(function(){$("#masterPassword").focus()}),e.auth=function(n){e.authPromise=r.hashPassword(n.masterPassword).then(function(e){return l=e,t.twoFactor.getDuo({},{masterPasswordHash:l}).$promise}).then(function(t){c(t),e.authed=!0})},e.submit=function(n){var r;e.enabled?function(){if(!confirm("Are you sure you want to disable the Duo provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:l,type:i.twoFactorProvider.duo},function(t){a.eventTrack("Disabled Two-step Duo"),o.success("Duo has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}():(r=n,e.submitPromise=t.twoFactor.putDuo({},{integrationKey:r.ikey,secretKey:r.skey,host:r.host,masterPasswordHash:l},function(e){a.eventTrack("Enabled Two-step Duo"),c(e)}).$promise)};var u=!1;e.close=function(){u=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,r){u||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepEmailController",["$scope","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","constants","$timeout",function(e,t,n,r,o,a,i,s,l){i.eventTrack("settingsTwoStepEmailController",{category:"Modal"});var c,u=null;e.updateModel={token:null,email:null},l(function(){$("#masterPassword").focus()}),e.auth=function(n){var a=null;e.authPromise=r.hashPassword(n.masterPassword).then(function(e){return c=e,t.twoFactor.getEmail({},{masterPasswordHash:c}).$promise}).then(function(e){return a=e,o.getUserProfile()}).then(function(t){u=t,e.enabled=a.Enabled,e.updateModel.email=e.enabled?a.Email:u.email,e.authed=!0})},e.sendEmail=function(n){if(e.emailError=!1,e.emailSuccess=!1,!n||!n.email||n.email.indexOf("@")<0)return e.emailError=!0,void(e.emailSuccess=!1);e.emailLoading=!0,t.twoFactor.sendEmail({},{masterPasswordHash:c,email:n.email},function(t){e.emailError=!1,e.emailSuccess=!0,e.emailLoading=!1},function(t){e.emailError=!0,e.emailSuccess=!1,e.emailLoading=!1})},e.submit=function(n){var r;n&&n.token?(r=n,e.submitPromise=t.twoFactor.putEmail({},{email:r.email.toLowerCase().trim(),token:r.token.replace(" ",""),masterPasswordHash:c},function(t){i.eventTrack("Enabled Two-step Email"),e.enabled=t.Enabled,r.email=t.Email,r.token=null}).$promise):function(){if(!confirm("Are you sure you want to disable the email provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:c,type:s.twoFactorProvider.email},function(t){i.eventTrack("Disabled Two-step Email"),a.success("Email has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}()};var d=!1;e.close=function(){d=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,r){d||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepRecoverController",["$scope","apiService","$uibModalInstance","cryptoService","$analytics","$timeout",function(e,t,n,r,o,a){o.eventTrack("settingsTwoStepRecoverController",{category:"Modal"}),e.code=null,e.auth=function(n){e.authPromise=r.hashPassword(n.masterPassword).then(function(e){return t.twoFactor.getRecover({},{masterPasswordHash:e}).$promise}).then(function(t){e.code=function(e){if(!e)return null;return e.replace(/(.{4})/g,"$1 ").trim().toUpperCase()}(t.Code),e.authed=!0})},a(function(){$("#masterPassword").focus()}),e.print=function(){if(e.code){o.eventTrack("Print Recovery Code");var t=window.open();t.document.write('<div style="font-size: 18px; text-align: center;"><p>Bitwarden two-step login recovery code:</p><code style="font-family: Menlo, Monaco, Consolas, \'Courier New\', monospace;">'+e.code+'</code></div><p style="text-align: center;">'+new Date+"</p>"),t.print(),t.close()}},e.close=function(){n.close()}}]),angular.module("bit.settings").controller("settingsTwoStepU2fController",["$scope","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","constants","$timeout","$window",function(e,t,n,r,o,a,i,s,l,c){var u;i.eventTrack("settingsTwoStepU2fController",{category:"Modal"});var d=!1;e.deviceResponse=null,e.deviceListening=!1,e.deviceError=!1,l(function(){$("#masterPassword").focus()}),e.auth=function(n){e.authPromise=r.hashPassword(n.masterPassword).then(function(e){return u=e,t.twoFactor.getU2f({},{masterPasswordHash:u}).$promise}).then(function(t){return e.enabled=t.Enabled,e.challenge=t.Challenge,e.authed=!0,e.readDevice()})},e.readDevice=function(){d||e.enabled||(console.log("listening for key..."),e.deviceResponse=null,e.deviceError=!1,e.deviceListening=!0,c.u2f.register(e.challenge.AppId,[{version:e.challenge.Version,challenge:e.challenge.Challenge}],[],function(t){if(e.deviceListening=!1,5!==t.errorCode)return t.errorCode?(l(function(){e.deviceError=!0}),void console.log("error: "+t.errorCode)):void l(function(){e.deviceResponse=JSON.stringify(t)});e.readDevice()},10))},e.submit=function(){e.enabled?function(){if(!confirm("Are you sure you want to disable the U2F provider?"))return;e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:u,type:s.twoFactorProvider.u2f},function(t){i.eventTrack("Disabled Two-step U2F"),a.success("U2F has been disabled."),e.enabled=t.Enabled,e.close()}).$promise}():e.submitPromise=t.twoFactor.putU2f({},{deviceResponse:e.deviceResponse,masterPasswordHash:u},function(t){i.eventTrack("Enabled Two-step U2F"),e.enabled=t.Enabled,e.challenge=null,e.deviceResponse=null,e.deviceError=!1}).$promise},e.close=function(){d=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,r){d||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsTwoStepYubiController",["$scope","apiService","$uibModalInstance","cryptoService","authService","toastr","$analytics","constants","$timeout",function(e,t,n,r,o,a,i,s,l){i.eventTrack("settingsTwoStepYubiController",{category:"Modal"});var c;function u(t){e.enabled=t.Enabled,e.updateModel={key1:{key:t.Key1,existingKey:d(t.Key1,"*",44)},key2:{key:t.Key2,existingKey:d(t.Key2,"*",44)},key3:{key:t.Key3,existingKey:d(t.Key3,"*",44)},nfc:!0===t.Nfc||!t.Enabled}}function d(e,t,n){if(!e||!t||e.length>=n)return e;for(var r=(n-e.length)/t.length,o=0;o<r;o++)e+=t;return e}l(function(){$("#masterPassword").focus()}),e.auth=function(n){var a=null;e.authPromise=r.hashPassword(n.masterPassword).then(function(e){return c=e,t.twoFactor.getYubi({},{masterPasswordHash:c}).$promise}).then(function(e){return a=e,o.getUserProfile()}).then(function(t){t,u(a),e.authed=!0})},e.remove=function(e){e.key=null,e.existingKey=null},e.submit=function(n){e.submitPromise=t.twoFactor.putYubi({},{key1:n.key1.key,key2:n.key2.key,key3:n.key3.key,nfc:n.nfc,masterPasswordHash:c},function(e){i.eventTrack("Saved Two-step YubiKey"),a.success("YubiKey saved."),u(e)}).$promise},e.disable=function(){confirm("Are you sure you want to disable the YubiKey provider?")&&(e.disableLoading=!0,e.submitPromise=t.twoFactor.disable({},{masterPasswordHash:c,type:s.twoFactorProvider.yubikey},function(t){e.disableLoading=!1,i.eventTrack("Disabled Two-step YubiKey"),a.success("YubiKey has been disabled."),e.enabled=t.Enabled,e.close()},function(t){a.error("Failed to disable."),e.disableLoading=!1}).$promise)};var p=!1;e.close=function(){p=!0,n.close(e.enabled)},e.$on("modal.closing",function(t,n,r){p||(t.preventDefault(),e.close())})}]),angular.module("bit.settings").controller("settingsUpdateKeyController",["$scope","$state","apiService","$uibModalInstance","cipherService","cryptoService","authService","validationService","toastr","$analytics","$q",function(e,t,n,r,o,a,i,s,l,c,u){c.eventTrack("settingsUpdateKeyController",{category:"Modal"}),e.save=function(d){a.getEncKey()?s.addError(d,"MasterPasswordHash","You do not need to update. You are already using the new encryption key.",!0):e.savePromise=a.hashPassword(e.masterPassword).then(function(e){return function(e){var t=a.makeEncKey(null),r=[],i=n.ciphers.list({},function(e){for(var n=[],a=0;a<e.Data.length;a++)e.Data[a].OrganizationId||n.push(e.Data[a]);var i=o.decryptCiphers(n);r=o.encryptCiphers(i,t.encKey)}).$promise,s=[],l=n.folders.list({},function(e){var n=o.decryptFolders(e.Data);s=o.encryptFolders(n,t.encKey)}).$promise,c=a.getPrivateKey("raw"),d=null;c&&(d=a.encrypt(c,t.encKey,"raw"));return u.all([i,l]).then(function(){var o={masterPasswordHash:e,ciphers:r,folders:s,privateKey:d,key:t.encKeyEnc};return n.accounts.putKey(o).$promise},function(){throw"Error while encrypting data."}).then(function(){a.setEncKey(t.encKey,null,!0)})}(e)}).then(function(){return r.dismiss("cancel"),i.logOut(),c.eventTrack("Key Updated"),t.go("frontend.login.info")},function(e){throw e||"Error occurred."}).then(function(){l.success("Please log back in. If you are using other Bitwarden applications, log out and back in to those as well.","Key Updated",{timeOut:1e4})})},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.tools").controller("toolsController",["$scope","$uibModal","apiService","toastr","authService",function(e,t,n,r,o){e.import=function(){t.open({animation:!0,templateUrl:"app/tools/views/toolsImport.html",controller:"toolsImportController"})},e.export=function(){t.open({animation:!0,templateUrl:"app/tools/views/toolsExport.html",controller:"toolsExportController"})}}]),angular.module("bit.tools").controller("toolsExportController",["$scope","apiService","$uibModalInstance","cipherService","$q","toastr","$analytics","constants",function(e,t,n,r,o,a,i,s){function l(){var e=new Date;return"bitwarden_export_"+(e.getFullYear()+""+c(e.getMonth()+1,2)+c(e.getDate(),2)+c(e.getHours(),2)+c(e.getMinutes(),2)+c(e.getSeconds(),2))+".csv"}function c(e,t,n){return n=n||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(n)+e}i.eventTrack("toolsExportController",{category:"Modal"}),e.export=function(n){e.startedExport=!0;var c=[],u=[],d=t.folders.list({},function(e){u=r.decryptFolders(e.Data)}).$promise,p=t.ciphers.list({},function(e){c=r.decryptCiphers(e.Data)}).$promise;o.all([d,p]).then(function(){if(!c.length)return a.error("Nothing to export.","Error!"),void e.close();for(var t={},n=0;n<u.length;n++)t[u[n].id]=u[n];try{var r=[];for(n=0;n<c.length;n++)if(c[n].type===s.cipherType.login||c[n].type===s.cipherType.secureNote){var o,d={folder:c[n].folderId&&c[n].folderId in t?t[c[n].folderId].name:null,favorite:c[n].favorite?1:null,type:null,name:c[n].name,notes:c[n].notes,fields:null,login_uri:null,login_username:null,login_password:null,login_totp:null};if(c[n].fields)for(o=0;o<c[n].fields.length;o++)d.fields?d.fields+="\n":d.fields="",d.fields+=(c[n].fields[o].name||"")+": "+c[n].fields[o].value;switch(c[n].type){case s.cipherType.login:if(d.type="login",d.login_username=c[n].login.username,d.login_password=c[n].login.password,d.login_totp=c[n].login.totp,c[n].login.uris&&c[n].login.uris.length)for(d.login_uri=[],o=0;o<c[n].login.uris.length;o++)d.login_uri.push(c[n].login.uris[o].uri);break;case s.cipherType.secureNote:d.type="note";break;default:continue}r.push(d)}var p=Papa.unparse(r),m=new Blob([p]);if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(m,l());else{var g=window.document.createElement("a");g.href=window.URL.createObjectURL(m,{type:"text/plain"}),g.download=l(),document.body.appendChild(g),g.click(),document.body.removeChild(g)}i.eventTrack("Exported Data"),a.success("Your data has been exported. Check your browser's downloads folder.","Success!"),e.close()}catch(t){a.error("Something went wrong. Please try again.","Error!"),e.close()}},function(){a.error("Something went wrong. Please try again.","Error!"),e.close()})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.tools").controller("toolsImportController",["$scope","$state","apiService","$uibModalInstance","cryptoService","cipherService","toastr","importService","$analytics","$sce","validationService",function(e,t,n,r,o,a,i,s,l,c,u){function d(o,s,c){if(o.length||s.length){if(s.length){var u=Math.floor(s.length/2),d=s.length-1;if(p(s[0])&&p(s[u])&&p(s[d]))return void m("Data is not formatted correctly. Please check your import file and try again.")}n.ciphers.import({folders:a.encryptFolders(o),ciphers:a.encryptCiphers(s),folderRelationships:c},function(){r.dismiss("cancel"),t.go("backend.user.vault",{refreshFromServer:!0}).then(function(){l.eventTrack("Imported Data",{label:e.model.source}),i.success("Data has been successfully imported into your vault.","Import Success")})},m)}else m("Nothing was imported.")}function p(e){return(null===e.name||"--"===e.name)&&e.login&&(null===e.login.password||""===e.login.password)}function m(t){if(l.eventTrack("Import Data Failed",{label:e.model.source}),r.dismiss("cancel"),t){var n=t.data;if(!n||!n.ValidationErrors)return n&&n.Message?void i.error(n.Message):void i.error(t);var o="";for(var a in n.ValidationErrors)if(n.ValidationErrors.hasOwnProperty(a))for(var s=0;s<n.ValidationErrors[a].length;s++)o+=a+": "+n.ValidationErrors[a][s]+" ";if(""!==o)return void i.error(o)}i.error("Something went wrong. Try again.","Oh No!")}l.eventTrack("toolsImportController",{category:"Modal"}),e.model={source:""},e.source={},e.splitFeatured=!0,e.options=[{id:"bitwardencsv",name:"Bitwarden (csv)",featured:!0,sort:1,instructions:c.trustAsHtml('Export using the web vault (vault.bitwarden.com). Log into the web vault and navigate to "Tools" > "Export".')},{id:"lastpass",name:"LastPass (csv)",featured:!0,sort:2,instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-lastpass/">https://help.bitwarden.com/article/import-from-lastpass/</a>')},{id:"chromecsv",name:"Chrome (csv)",featured:!0,sort:3,instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-chrome/">https://help.bitwarden.com/article/import-from-chrome/</a>')},{id:"firefoxpasswordexportercsvxml",name:"Firefox Password Exporter (xml)",featured:!0,sort:4,instructions:c.trustAsHtml('Use the <a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/password-exporter/">Password Exporter</a> addon for FireFox to export your passwords to a XML file. After installing the addon, type <code>about:addons</code> in your FireFox navigation bar. Locate the Password Exporter addon and click the "Options" button. In the dialog that pops up, click the "Export Passwords" button to save the XML file.')},{id:"keepass2xml",name:"KeePass 2 (xml)",featured:!0,sort:5,instructions:c.trustAsHtml('Using the KeePass 2 desktop application, navigate to "File" > "Export" and select the KeePass XML (2.x) option.')},{id:"keepassxcsv",name:"KeePassX (csv)",instructions:c.trustAsHtml('Using the KeePassX desktop application, navigate to "Database" > "Export to CSV file" and save the CSV file.')},{id:"dashlanecsv",name:"Dashlane (csv)",featured:!0,sort:7,instructions:c.trustAsHtml('Using the Dashlane desktop application, navigate to "File" > "Export" > "Unsecured archive (readable) in CSV format" and save the CSV file.')},{id:"1password1pif",name:"1Password (1pif)",featured:!0,sort:6,instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-1password/">https://help.bitwarden.com/article/import-from-1password/</a>')},{id:"1password6wincsv",name:"1Password 6 Windows (csv)",instructions:c.trustAsHtml('See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-1password/">https://help.bitwarden.com/article/import-from-1password/</a>')},{id:"roboformhtml",name:"RoboForm (html)",instructions:c.trustAsHtml('Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) > "Print List" > "Logins". When the following print dialog pops up click on the "Save" button and save the HTML file.')},{id:"keepercsv",name:"Keeper (csv)",instructions:c.trustAsHtml('Log into the Keeper web vault (keepersecurity.com/vault). Navigate to "Backup" (top right) and find the "Export to Text File" option. Click "Export Now" to save the TXT/CSV file.')},{id:"enpasscsv",name:"Enpass (csv)",instructions:c.trustAsHtml('Using the Enpass desktop application, navigate to "File" > "Export" > "As CSV". Select "Yes" to the warning alert and save the CSV file. Note that the importer only fully supports files exported while Enpass is set to the English language, so adjust your settings accordingly.')},{id:"safeincloudxml",name:"SafeInCloud (xml)",instructions:c.trustAsHtml('Using the SaveInCloud desktop application, navigate to "File" > "Export" > "As XML" and save the XML file.')},{id:"pwsafexml",name:"Password Safe (xml)",instructions:c.trustAsHtml('Using the Password Safe desktop application, navigate to "File" > "Export To" > "XML format..." and save the XML file.')},{id:"stickypasswordxml",name:"Sticky Password (xml)",instructions:c.trustAsHtml('Using the Sticky Password desktop application, navigate to "Menu" (top right) > "Export" > "Export all". Select the unencrypted format XML option and then the "Save to file" button. Save the XML file.')},{id:"msecurecsv",name:"mSecure (csv)",instructions:c.trustAsHtml('Using the mSecure desktop application, navigate to "File" > "Export" > "CSV File..." and save the CSV file.')},{id:"truekeycsv",name:"True Key (csv)",instructions:c.trustAsHtml('Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export" button, enter your password and save the CSV file.')},{id:"passwordbossjson",name:"Password Boss (json)",instructions:c.trustAsHtml('Using the Password Boss desktop application, navigate to "File" > "Export data" > "Password Boss JSON - not encrypted" and save the JSON file.')},{id:"zohovaultcsv",name:"Zoho Vault (csv)",instructions:c.trustAsHtml('Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" > "Export Secrets". Select "All Secrets" and click the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad and paste the data. Save the data from the text editor as <code>zoho_export.csv</code>.')},{id:"splashidcsv",name:"SplashID (csv)",instructions:c.trustAsHtml('Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export" > "Export as CSV" and save the CSV file.')},{id:"passworddragonxml",name:"Password Dragon (xml)",instructions:c.trustAsHtml('Using the Password Dragon desktop application, navigate to "File" > "Export" > "To XML". In the dialog that pops up select "All Rows" and check all fields. Click the "Export" button and save the XML file.')},{id:"padlockcsv",name:"Padlock (csv)",instructions:c.trustAsHtml('Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings". Click the "Export Data" option. Ensure that the "CSV" option is selected from the dropdown. Highlight and copy the data from the textarea. Open a text editor like Notepad and paste the data. Save the data from the text editor as <code>padlock_export.csv</code>.')},{id:"clipperzhtml",name:"Clipperz (html)",instructions:c.trustAsHtml('Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation bar. Navigate to "Data" > "Export". Click the "download HTML+JSON" button to save the HTML file.')},{id:"avirajson",name:"Avira (json)",instructions:c.trustAsHtml('Using the Avira browser extension, click your username in the top right corner and navigate to "Settings". Locate the "Export Data" section and click "Export". In the dialog that pops up, click the "Export Password Manager Data" button to save the TXT/JSON file.')},{id:"saferpasscsv",name:"SaferPass (csv)",instructions:c.trustAsHtml('Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click the "Export accounts" button to save the CSV file.')},{id:"upmcsv",name:"Universal Password Manager (csv)",instructions:c.trustAsHtml('Using the Universal Password Manager desktop application, navigate to "Database" > "Export" and save the CSV file.')},{id:"ascendocsv",name:"Ascendo DataVault (csv)",instructions:c.trustAsHtml('Using the Ascendo DataVault desktop application, navigate to "Tools" > "Export". In the dialog that pops up, select the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file.')},{id:"meldiumcsv",name:"Meldium (csv)",instructions:c.trustAsHtml('Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save the CSV file.')},{id:"passkeepcsv",name:"PassKeep (csv)",instructions:c.trustAsHtml('Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to CSV" to save the CSV file.')},{id:"operacsv",name:"Opera (csv)",instructions:c.trustAsHtml('The process for importing from Opera is exactly the same as importing from Google Chrome. See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-chrome/">https://help.bitwarden.com/article/import-from-chrome/</a>')},{id:"vivaldicsv",name:"Vivaldi (csv)",instructions:c.trustAsHtml('The process for importing from Vivaldi is exactly the same as importing from Google Chrome. See detailed instructions on our help site at <a target="_blank" href="https://help.bitwarden.com/article/import-from-chrome/">https://help.bitwarden.com/article/import-from-chrome/</a>')},{id:"gnomejson",name:"GNOME Passwords and Keys/Seahorse (json)",instructions:c.trustAsHtml('Make sure you have python-keyring and python-gnomekeyring installed. Save the <a target="_blank" href="http://bit.ly/2sMldAI">GNOME Keyring Import/Export</a> python script by Luke Plant to your desktop as <code>pw_helper.py</code>. Open terminal and run <code>chmod +rx Desktop/pw_helper.py</code> and then <code>python Desktop/pw_helper.py export Desktop/my_passwords.json</code>. Then upload the resulting <code>my_passwords.json</code> file here to Bitwarden.')}],e.setSource=function(){for(var t=0;t<e.options.length;t++)if(e.options[t].id===e.model.source){e.source=e.options[t];break}},e.setSource(),e.import=function(t,n){if(t.source&&""!==t.source){var r=document.getElementById("file").files[0];r||t.fileContents&&""!==t.fileContents?(e.processing=!0,s.import(t.source,r||t.fileContents,d,m)):u.addError(n,"file","Select the import file or copy/paste the import file contents.",!0)}else u.addError(n,"source","Select the format of the import file.",!0)},e.close=function(){r.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultAddCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","selectedFolder","$analytics","checkedFavorite","$rootScope","authService","$uibModal","constants","$filter","selectedType",function(e,t,n,r,o,a,i,s,l,c,u,d,p,m,g){function f(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}s.eventTrack("vaultAddCipherController",{category:"Modal"}),e.folders=c.vaultFolders,e.constants=p,e.selectedType=g?g.toString():p.cipherType.login.toString(),e.cipher={folderId:i?i.id:null,favorite:!0===l,type:g||p.cipherType.login,login:{uris:[{uri:null,match:null,matchValue:null}]},identity:{},card:{},secureNote:{type:0}},u.getUserProfile().then(function(t){e.useTotp=t.premium}),e.typeChanged=function(){e.cipher.type=parseInt(e.selectedType)},e.savePromise=null,e.save=function(){var r=o.encryptCipher(e.cipher);e.savePromise=t.ciphers.post(r,function(e){s.eventTrack("Created Cipher");var t=o.decryptCipherPreview(e);n.close(t)}).$promise},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(s.eventTrack("Generated Password From Add"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addUri=function(){e.cipher.login&&(e.cipher.login.uris||(e.cipher.login.uris=[]),e.cipher.login.uris.push({uri:null,match:null,matchValue:null}))},e.removeUri=function(t){if(e.cipher.login&&e.cipher.login.uris){var n=e.cipher.login.uris.indexOf(t);n>-1&&e.cipher.login.uris.splice(n,1)}},e.uriMatchChanged=function(e){!e.matchValue&&0!==e.matchValue||""===e.matchValue?e.match=null:e.match=parseInt(e.matchValue)},e.addField=function(){e.cipher.fields||(e.cipher.fields=[]),e.cipher.fields.push({type:p.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.toggleFavorite=function(){e.cipher.favorite=!e.cipher.favorite},e.clipboardSuccess=function(e){e.clearSelection(),f(e)},e.clipboardError=function(e,t){t&&f(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.folderSort=function(e){return e.id?e.name.toLowerCase():""},e.close=function(){n.dismiss("close")},e.showUpgrade=function(){d.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}}]),angular.module("bit.vault").controller("vaultAddFolderController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","$analytics",function(e,t,n,r,o,a){a.eventTrack("vaultAddFolderController",{category:"Modal"}),e.savePromise=null,e.save=function(r){var i=o.encryptFolder(r);e.savePromise=t.folders.post(i,function(e){a.eventTrack("Created Folder");var t=o.decryptFolder(e);n.close(t)}).$promise},e.close=function(){n.dismiss("close")}}]),angular.module("bit.vault").controller("vaultAttachmentsController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","cipherId","$analytics","validationService","toastr","$timeout","authService","$uibModal",function(e,t,n,r,o,a,i,s,l,c,u,d){i.eventTrack("vaultAttachmentsController",{category:"Modal"}),e.cipher={},e.readOnly=!0,e.loading=!0,e.isPremium=!0,e.canUseAttachments=!0;var p=!1;function m(){return e.cipher.organizationId?r.getOrgKey(e.cipher.organizationId):null}u.getUserProfile().then(function(n){return e.isPremium=n.premium,t.ciphers.get({id:a}).$promise}).then(function(t){e.cipher=o.decryptCipher(t),e.readOnly=!e.cipher.edit,e.canUseAttachments=e.isPremium||e.cipher.organizationId,e.loading=!1},function(){e.loading=!1}),e.save=function(n){var r=document.getElementById("file"),c=r.files;c&&c.length?e.savePromise=o.encryptAttachmentFile(m(),c[0]).then(function(e){var n=new FormData,r=new Blob([e.data],{type:"application/octet-stream"});return n.append("data",r,e.fileName),t.ciphers.postAttachment({id:a},n).$promise}).then(function(t){i.eventTrack("Added Attachment"),e.cipher=o.decryptCipher(t),r.type="",r.type="file",r.value=""},function(e){var t=s.parseErrors(e);l.error(t.length?t[0]:"An error occurred.")}):s.addError(n,"file","Select a file.",!0)},e.download=function(t){if(t.loading=!0,!e.canUseAttachments)return t.loading=!1,void alert("Premium membership is required to use this feature.");o.downloadAndDecryptAttachment(m(),t,!0).then(function(e){c(function(){t.loading=!1})},function(){c(function(){t.loading=!1})})},e.remove=function(n){confirm("Are you sure you want to delete this attachment ("+n.fileName+")?")&&(n.loading=!0,t.ciphers.delAttachment({id:a,attachmentId:n.id}).$promise.then(function(){n.loading=!1,i.eventTrack("Deleted Attachment");var t=e.cipher.attachments.indexOf(n);t>-1&&e.cipher.attachments.splice(t,1)},function(){l.error("Cannot delete attachment."),n.loading=!1}))},e.close=function(){n.dismiss("cancel")},e.$on("modal.closing",function(t,r,o){p||(t.preventDefault(),p=!0,n.close(!!e.cipher.attachments&&e.cipher.attachments.length>0))}),e.showUpgrade=function(){d.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}}]),angular.module("bit.vault").controller("vaultCipherCollectionsController",["$scope","apiService","$uibModalInstance","cipherService","cipherId","$analytics",function(e,t,n,r,o,a){a.eventTrack("vaultCipherCollectionsController",{category:"Modal"}),e.cipher={},e.readOnly=!1,e.loadingCipher=!0,e.loadingCollections=!0,e.selectedCollections={},e.collections=[];var i=null;n.opened.then(function(){t.ciphers.getDetails({id:o}).$promise.then(function(t){if(e.loadingCipher=!1,e.readOnly=!t.Edit,t.Edit&&t.OrganizationId){1===t.Type&&(e.cipher=r.decryptCipherPreview(t));var n={};if(t.CollectionIds)for(var o=0;o<t.CollectionIds.length;o++)n[t.CollectionIds[o]]=null;return{cipher:t,cipherCollections:n}}return null}).then(function(n){return n?(i=n,t.collections.listMe({writeOnly:!0}).$promise):(e.loadingCollections=!1,!1)}).then(function(t){if(!1!==t){for(var n=[],o={},a=t.Data,s=0;s<a.length;s++)if(a[s].OrganizationId===i.cipher.OrganizationId){a[s].Id in i.cipherCollections&&(o[a[s].Id]=!0);var l=r.decryptCollection(a[s]);n.push(l)}e.loadingCollections=!1,e.collections=n,e.selectedCollections=o}})}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.collections.length;r++)n[e.collections[r].id]=!0;e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]=!0},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return Object.keys(e.selectedCollections).length===e.collections.length},e.submit=function(){var r={collectionIds:[]};for(var i in e.selectedCollections)e.selectedCollections.hasOwnProperty(i)&&r.collectionIds.push(i);e.submitPromise=t.ciphers.putCollections({id:o},r).$promise.then(function(e){a.eventTrack("Edited Cipher Collections"),n.close({action:"collectionsEdit",collectionIds:r.collectionIds})})},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultController",["$scope","$uibModal","apiService","$filter","cryptoService","authService","toastr","cipherService","$q","$localStorage","$timeout","$rootScope","$state","$analytics","constants","validationService",function(e,t,n,r,o,a,i,s,l,c,u,d,p,m,g,f){function h(t){d.vaultCiphers=e.ciphers=r("orderBy")(t,["sort","name","subTitle"]);var n=function(e,t){var n=[],r=0,o=e.length;for(;r<o;)n.push(e.slice(r,r+=t));return n}(d.vaultCiphers,200);if(n.length>0){e.ciphers=n[0];var o=200;angular.forEach(n,function(t,n){n>0&&u(function(){Array.prototype.push.apply(e.ciphers,t)},o+=200)})}e.loadingCiphers=!1}function v(){d.vaultCiphers=e.ciphers=r("orderBy")(d.vaultCiphers,["name","subTitle"])}function y(){e.selectedFolder=void 0,e.selectedCollection=void 0,e.selectedType=void 0,e.selectedFavorites=!1,e.selectedAll=!1}function b(){$.AdminLTE&&$.AdminLTE.layout&&u(function(){$.AdminLTE.layout.fix()},0)}function w(e,t,n){return n.indexOf(e)===t}function C(){return $('input[name="cipherSelection"]:checked').map(function(){return $(this).val()}).get().filter(w)}function S(e){$('input[name="cipherSelection"]').prop("checked",e)}function k(t){var n=d.vaultCiphers.indexOf(t);n>-1&&d.vaultCiphers.splice(n,1),(n=e.ciphers.indexOf(t))>-1&&e.ciphers.splice(n,1)}e.loadingCiphers=!0,e.loadingGroupings=!0,e.ciphers=[],e.folders=[],e.collections=[],e.constants=g,e.filter=void 0,e.selectedType=void 0,e.selectedFolder=void 0,e.selectedCollection=void 0,e.selectedFavorites=!1,e.selectedAll=!0,e.selectedTitle="All",e.selectedIcon="fa-th",p.params.refreshFromServer&&(d.vaultFolders=d.vaultCollections=d.vaultCiphers=null),e.$on("$viewContentLoaded",function(){if(u(function(){$("body").hasClass("control-sidebar-open")&&$("#search").focus()},500),(d.vaultFolders||d.vaultCollections)&&d.vaultCiphers)return e.loadingCiphers=e.loadingGroupings=!1,void h(d.vaultCiphers);var t,r,o,a,i;t=[{id:null,name:"No Folder"}],r=[],o=n.collections.listMe({writeOnly:!1},function(e){for(var t=0;t<e.Data.length;t++){var n=s.decryptCollection(e.Data[t],null,!0);r.push(n)}}).$promise,a=n.folders.list({},function(e){for(var n=0;n<e.Data.length;n++){var r=s.decryptFolderPreview(e.Data[n]);t.push(r)}}).$promise,i=l.all([o,a]).then(function(){d.vaultCollections=r,d.vaultFolders=t,e.loadingGroupings=!1}),n.ciphers.list({},function(e){for(var t=[],n=0;n<e.Data.length;n++){var r=s.decryptCipherPreview(e.Data[n]);t.push(r)}i.then(function(){h(t)})}).$promise}),e.groupingSort=function(e){return e.id?e.name.toLowerCase():""},e.clipboardError=function(e){alert("Your web browser does not support easy clipboard copying. Edit the item and copy it manually instead.")},e.editCipher=function(n){t.open({animation:!0,templateUrl:"app/vault/views/vaultEditCipher.html",controller:"vaultEditCipherController",resolve:{cipherId:function(){return n.id}}}).result.then(function(t){if("edit"===t.action){var r=e.ciphers.indexOf(n);r>-1&&(t.data.collectionIds=d.vaultCiphers[r].collectionIds,d.vaultCiphers[r]=t.data),v()}else"partialEdit"===t.action?(n.folderId=t.data.folderId,n.favorite=t.data.favorite):"delete"===t.action&&k(n)})},e.$on("vaultAddCipher",function(t,n){e.addCipher()}),e.addCipher=function(){t.open({animation:!0,templateUrl:"app/vault/views/vaultAddCipher.html",controller:"vaultAddCipherController",resolve:{selectedFolder:function(){return e.selectedFolder},selectedType:function(){return e.selectedType},checkedFavorite:function(){return e.selectedFavorites}}}).result.then(function(e){d.vaultCiphers.push(e),v()})},e.deleteCipher=function(e){confirm("Are you sure you want to delete this item ("+e.name+")?")&&n.ciphers.del({id:e.id},function(){m.eventTrack("Deleted Item"),k(e)})},e.attachments=function(e){a.getUserProfile().then(function(t){return{isPremium:t.premium,orgUseStorage:e.organizationId&&!!t.organizations[e.organizationId].maxStorageGb}}).then(function(n){if(!e.hasAttachments){if(e.organizationId&&!n.orgUseStorage)return void t.open({animation:!0,templateUrl:"app/views/paidOrgRequired.html",controller:"paidOrgRequiredController",resolve:{orgId:function(){return e.organizationId}}});if(!e.organizationId&&!n.isPremium)return void t.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}e.organizationId||o.getEncKey()?t.open({animation:!0,templateUrl:"app/vault/views/vaultAttachments.html",controller:"vaultAttachmentsController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){e.hasAttachments=t}):i.error("You cannot use this feature until you update your encryption key.","Feature Unavailable")})},e.editFolder=function(e){e.id&&t.open({animation:!0,templateUrl:"app/vault/views/vaultEditFolder.html",controller:"vaultEditFolderController",size:"sm",resolve:{folderId:function(){return e.id}}}).result.then(function(t){e.name=t.name})},e.$on("vaultAddFolder",function(t,n){e.addFolder()}),e.addFolder=function(){t.open({animation:!0,templateUrl:"app/vault/views/vaultAddFolder.html",controller:"vaultAddFolderController",size:"sm"}).result.then(function(e){d.vaultFolders.push(e)})},e.deleteFolder=function(t){t.id&&confirm("Are you sure you want to delete this folder ("+t.name+')? Any items will be moved to "No Folder".')&&n.folders.del({id:t.id},function(){m.eventTrack("Deleted Folder");var n=d.vaultFolders.indexOf(t);n>-1&&(d.vaultFolders.splice(n,1),e.filterAll())})},e.share=function(e){t.open({animation:!0,templateUrl:"app/vault/views/vaultShareCipher.html",controller:"vaultShareCipherController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){e.organizationId=t})},e.editCollections=function(e){t.open({animation:!0,templateUrl:"app/vault/views/vaultCipherCollections.html",controller:"vaultCipherCollectionsController",resolve:{cipherId:function(){return e.id}}}).result.then(function(t){t.collectionIds&&!t.collectionIds.length?k(e):t.collectionIds&&(e.collectionIds=t.collectionIds)})},e.filterCollection=function(t){y(),e.selectedCollection=t,e.selectedIcon="fa-cube",e.filter=function(e){return e.collectionIds&&e.collectionIds.indexOf(t.id)>-1},b()},e.filterFolder=function(t){y(),e.selectedFolder=t,e.selectedIcon="fa-folder-open"+(t.id?"":"-o"),e.filter=function(e){return e.folderId===t.id},b()},e.filterType=function(t){switch(y(),e.selectedType=t,t){case g.cipherType.login:e.selectedTitle="Login",e.selectedIcon="fa-globe";break;case g.cipherType.card:e.selectedTitle="Card",e.selectedIcon="fa-credit-card";break;case g.cipherType.identity:e.selectedTitle="Identity",e.selectedIcon="fa-id-card-o";break;case g.cipherType.secureNote:e.selectedTitle="Secure Note",e.selectedIcon="fa-sticky-note-o"}e.filter=function(e){return e.type===t},b()},e.filterFavorites=function(){y(),e.selectedFavorites=!0,e.selectedTitle="Favorites",e.selectedIcon="fa-star",e.filter=function(e){return!!e.favorite},b()},e.filterAll=function(){y(),e.selectedAll=!0,e.selectedTitle="All",e.selectedIcon="fa-th",e.filter=null,b()},e.cipherFilter=function(){return function(t){return!e.filter||e.filter(t)}},e.unselectAll=function(){S(!1)},e.selectAll=function(){S(!0)},e.select=function(e){var t=$(e.currentTarget).closest("tr").find('input[name="cipherSelection"]');t.prop("checked",!t.prop("checked"))},e.bulkMove=function(){var e=C();0!==e.length?t.open({animation:!0,templateUrl:"app/vault/views/vaultMoveCiphers.html",controller:"vaultMoveCiphersController",size:"sm",resolve:{ids:function(){return e}}}).result.then(function(t){for(var n=0;n<e.length;n++){var o=r("filter")(d.vaultCiphers,{id:e[n]});o.length&&(o[0].folderId=t)}S(!1),v(),i.success("Items have been moved!")}):alert("You have not selected anything.")},e.bulkDelete=function(){var t=C();0!==t.length?confirm("Are you sure you want to delete the selected items (total: "+t.length+")?")&&(e.actionLoading=!0,n.ciphers.delMany({ids:t},function(){m.eventTrack("Bulk Deleted Items");for(var n=0;n<t.length;n++){var o=r("filter")(d.vaultCiphers,{id:t[n]});o.length&&o[0].edit&&k(o[0])}S(!1),e.actionLoading=!1,i.success("Items have been deleted!")},function(t){var n=f.parseErrors(t);i.error(n.length?n[0]:"An error occurred."),e.actionLoading=!1})):alert("You have not selected anything.")}}]),angular.module("bit.vault").controller("vaultEditCipherController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","passwordService","cipherId","$analytics","$rootScope","authService","$uibModal","constants","$filter",function(e,t,n,r,o,a,i,s,l,c,u,d,p){function m(e){var t=$(e.trigger).parent().prev();"text"===t.attr("type")&&t.select()}s.eventTrack("vaultEditCipherController",{category:"Modal"}),e.folders=l.vaultFolders,e.cipher={},e.readOnly=!1,e.constants=d,c.getUserProfile().then(function(n){return e.useTotp=n.premium,t.ciphers.get({id:i}).$promise}).then(function(t){e.cipher=o.decryptCipher(t),e.readOnly=!e.cipher.edit,e.useTotp=e.useTotp||e.cipher.organizationUseTotp,function(){if(e.cipher.login&&e.cipher.login.uris)for(var t=0;t<e.cipher.login.uris.length;t++)e.cipher.login.uris[t].matchValue=e.cipher.login.uris[t].match||0===e.cipher.login.uris[t].match?e.cipher.login.uris[t].match.toString():""}()}),e.save=function(r){if(e.readOnly)e.savePromise=t.ciphers.putPartial({id:i},{folderId:r.folderId,favorite:r.favorite},function(e){s.eventTrack("Partially Edited Cipher"),n.close({action:"partialEdit",data:{id:i,favorite:r.favorite,folderId:r.folderId&&""!==r.folderId?r.folderId:null}})}).$promise;else{var a=o.encryptCipher(r,e.cipher.type);e.savePromise=t.ciphers.put({id:i},a,function(e){s.eventTrack("Edited Cipher");var t=o.decryptCipherPreview(e);n.close({action:"edit",data:t})}).$promise}},e.generatePassword=function(){e.cipher.login.password&&!confirm("Are you sure you want to overwrite the current password?")||(s.eventTrack("Generated Password From Edit"),e.cipher.login.password=a.generatePassword({length:14,special:!0}))},e.addUri=function(){e.cipher.login&&(e.cipher.login.uris||(e.cipher.login.uris=[]),e.cipher.login.uris.push({uri:null,match:null,matchValue:null}))},e.removeUri=function(t){if(e.cipher.login&&e.cipher.login.uris){var n=e.cipher.login.uris.indexOf(t);n>-1&&e.cipher.login.uris.splice(n,1)}},e.uriMatchChanged=function(e){!e.matchValue&&0!==e.matchValue||""===e.matchValue?e.match=null:e.match=parseInt(e.matchValue)},e.addField=function(){e.cipher.fields||(e.cipher.fields=[]),e.cipher.fields.push({type:d.fieldType.text.toString(),name:null,value:null})},e.removeField=function(t){var n=e.cipher.fields.indexOf(t);n>-1&&e.cipher.fields.splice(n,1)},e.toggleFavorite=function(){e.cipher.favorite=!e.cipher.favorite},e.clipboardSuccess=function(e){e.clearSelection(),m(e)},e.clipboardError=function(e,t){t&&m(e),alert("Your web browser does not support easy clipboard copying. Copy it manually instead.")},e.folderSort=function(e){return e.id?e.name.toLowerCase():""},e.delete=function(){confirm("Are you sure you want to delete this item ("+e.cipher.name+")?")&&t.ciphers.del({id:e.cipher.id},function(){s.eventTrack("Deleted Cipher From Edit"),n.close({action:"delete",data:e.cipher.id})})},e.close=function(){n.dismiss("cancel")},e.showUpgrade=function(){u.open({animation:!0,templateUrl:"app/views/premiumRequired.html",controller:"premiumRequiredController"})}}]),angular.module("bit.vault").controller("vaultEditFolderController",["$scope","apiService","$uibModalInstance","cryptoService","cipherService","folderId","$analytics",function(e,t,n,r,o,a,i){i.eventTrack("vaultEditFolderController",{category:"Modal"}),e.folder={},t.folders.get({id:a},function(t){e.folder=o.decryptFolder(t)}),e.savePromise=null,e.save=function(r){var s=o.encryptFolder(r);e.savePromise=t.folders.put({id:a},s,function(e){i.eventTrack("Edited Folder");var t=o.decryptFolder(e);n.close(t)}).$promise},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultMoveCiphersController",["$scope","apiService","$uibModalInstance","ids","$analytics","$rootScope","$filter",function(e,t,n,r,o,a,i){o.eventTrack("vaultMoveCiphersController",{category:"Modal"}),e.folders=a.vaultFolders,e.count=r.length,e.save=function(){e.savePromise=t.ciphers.moveMany({ids:r,folderId:e.folderId},function(){o.eventTrack("Bulk Moved Ciphers"),n.close(e.folderId||null)}).$promise},e.folderSort=function(e){return e.id?e.name.toLowerCase():"!"},e.close=function(){n.dismiss("cancel")}}]),angular.module("bit.vault").controller("vaultShareCipherController",["$scope","apiService","$uibModalInstance","authService","cipherService","cipherId","$analytics","$state","cryptoService","$q","toastr",function(e,t,n,r,o,a,i,s,l,c,u){i.eventTrack("vaultShareCipherController",{category:"Modal"}),e.model={},e.cipher={},e.collections=[],e.selectedCollections={},e.organizations=[];var d={};e.loadingCollections=!0,e.loading=!0,e.readOnly=!1,t.ciphers.get({id:a}).$promise.then(function(t){return e.readOnly=!t.Edit,t.Edit&&(e.cipher=o.decryptCipher(t)),t.Edit}).then(function(t){if(e.loading=!1,t)return r.getUserProfile()}).then(function(n){if(n&&n.organizations){var r=[],a=!1;for(var i in n.organizations)n.organizations.hasOwnProperty(i)&&n.organizations[i].enabled&&(r.push({id:n.organizations[i].id,name:n.organizations[i].name}),d[n.organizations[i].id]=0,a||(a=!0,e.model.organizationId=n.organizations[i].id));e.organizations=r,t.collections.listMe({writeOnly:!0},function(t){for(var n=[],r=0;r<t.Data.length;r++){var a=o.decryptCollection(t.Data[r]);a.organizationId=t.Data[r].OrganizationId,n.push(a),d[a.organizationId]++}e.collections=n,e.loadingCollections=!1})}}),e.toggleCollectionSelectionAll=function(t){var n={};if(t.target.checked)for(var r=0;r<e.collections.length;r++)e.model.organizationId&&e.collections[r].organizationId===e.model.organizationId&&(n[e.collections[r].id]=!0);e.selectedCollections=n},e.toggleCollectionSelection=function(t){t in e.selectedCollections?delete e.selectedCollections[t]:e.selectedCollections[t]=!0},e.collectionSelected=function(t){return t.id in e.selectedCollections},e.allSelected=function(){return!!e.model.organizationId&&Object.keys(e.selectedCollections).length===d[e.model.organizationId]},e.orgChanged=function(){e.selectedCollections={}},e.submitPromise=null,e.submit=function(r){var s=l.getOrgKey(r.organizationId),d=!1,p=[];if(e.cipher.attachments)for(var m=0;m<e.cipher.attachments.length;m++)!function(e){var n=o.downloadAndDecryptAttachment(null,e,!1).then(function(e){return l.encryptToBytes(e.buffer,s)}).then(function(n){if(!d){var o=new FormData,i=new Blob([n],{type:"application/octet-stream"}),c=l.encrypt(e.fileName,s);return o.append("data",i,c),t.ciphers.postShareAttachment({id:a,attachmentId:e.id,orgId:r.organizationId},o).$promise}},function(e){d=!0});p.push(n)}(e.cipher.attachments[m]);e.submitPromise=c.all(p).then(function(){if(!d){e.cipher.organizationId=r.organizationId;var n={collectionIds:[],cipher:o.encryptCipher(e.cipher,e.cipher.type,null,!0)};for(var i in e.selectedCollections)e.selectedCollections.hasOwnProperty(i)&&n.collectionIds.push(i);return t.ciphers.putShare({id:a},n).$promise}}).then(function(e){i.eventTrack("Shared Cipher"),u.success("Item has been shared."),n.close(r.organizationId)})},e.close=function(){n.dismiss("cancel")},e.createOrg=function(){s.go("backend.user.settingsCreateOrg").then(function(){n.dismiss("cancel")})}}]); +\ No newline at end of file diff --git a/web-vault/js/fallback-styles.min.js b/web-vault/js/fallback-styles.min.js @@ -1 +1 @@ -var cacheTag="twgcvb";function loadStylesheetIfMissing(e,t,s){var i=document.getElementsByTagName("SCRIPT"),l=i[i.length-1].previousElementSibling,n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(l):l.currentStyle;if(n&&n[e]!==t)for(var o=0;o<s.length;o++)document.write('<link rel="stylesheet" href="'+s[o]+"?v="+cacheTag+'" />')}loadStylesheetIfMissing("visibility","hidden",["lib/bootstrap/css/bootstrap.min.css"]),loadStylesheetIfMissing("fontFamily","FontAwesome",["lib/font-awesome/css/font-awesome.min.css"]); -\ No newline at end of file +var cacheTag="h5k6l8";function loadStylesheetIfMissing(e,t,s){var i=document.getElementsByTagName("SCRIPT"),l=i[i.length-1].previousElementSibling,n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(l):l.currentStyle;if(n&&n[e]!==t)for(var o=0;o<s.length;o++)document.write('<link rel="stylesheet" href="'+s[o]+"?v="+cacheTag+'" />')}loadStylesheetIfMissing("visibility","hidden",["lib/bootstrap/css/bootstrap.min.css"]),loadStylesheetIfMissing("fontFamily","FontAwesome",["lib/font-awesome/css/font-awesome.min.css"]); +\ No newline at end of file diff --git a/web-vault/js/lib.min.js b/web-vault/js/lib.min.js @@ -1 +1 @@ -!function(t,e){"use strict";var n=window.angulartics||(window.angulartics={});function r(t){return["a:","button:","button:button","button:submit","input:button","input:submit"].indexOf(t.tagName.toLowerCase()+":"+(t.type||""))>=0}function i(t){var e=t.slice(9);return null!=e&&e.length>0?e.substring(0,1).toLowerCase()+e.substring(1):e}n.waitForVendorCount=0,n.waitForVendorApi=function(t,e,r,i,o){o||n.waitForVendorCount++,i||(i=r,r=void 0),!Object.prototype.hasOwnProperty.call(window,t)||void 0!==r&&void 0===window[t][r]?setTimeout(function(){n.waitForVendorApi(t,e,r,i,!0)},e):(n.waitForVendorCount--,i(window[t]))},t.module("angulartics",[]).provider("$analytics",function(){var e=this,r={pageTracking:{autoTrackFirstPage:!0,autoTrackVirtualPages:!0,trackRelativePath:!1,trackRoutes:!0,trackStates:!0,autoBasePath:!1,basePath:"",excludedRoutes:[],queryKeysWhitelisted:[],queryKeysBlacklisted:[]},eventTracking:{},bufferFlushDelay:1e3,trackExceptions:!1,optOut:!1,developerMode:!1},i=["pageTrack","eventTrack","exceptionTrack","transactionTrack","setAlias","setUsername","setUserProperties","setUserPropertiesOnce","setSuperProperties","setSuperPropertiesOnce","incrementProperty","userTimings","clearCookies"],o={},a={},s={};function u(e,n,r){return a[e]||(a[e]=[]),a[e].push(n),s[n]=r,function(){if(!this.settings.optOut){var n=Array.prototype.slice.apply(arguments);return this.$inject(["$q",t.bind(this,function(r){return r.all(a[e].map(function(e){var i=s[e]||{};if(i.async){var o=r.defer(),a=t.copy(n);return a.unshift(o.resolve),e.apply(this,a),o.promise}return r.when(e.apply(this,n))},this))})])}}}var l={settings:r};l.setOptOut=function(t){this.settings.optOut=t,g()},l.getOptOut=function(){return this.settings.optOut};var c={$get:["$injector",function(t){return d(t)}],api:l,settings:r,virtualPageviews:function(t){this.settings.pageTracking.autoTrackVirtualPages=t},trackStates:function(t){this.settings.pageTracking.trackStates=t},trackRoutes:function(t){this.settings.pageTracking.trackRoutes=t},excludeRoutes:function(t){this.settings.pageTracking.excludedRoutes=t},queryKeysWhitelist:function(t){this.settings.pageTracking.queryKeysWhitelisted=t},queryKeysBlacklist:function(t){this.settings.pageTracking.queryKeysBlacklisted=t},firstPageview:function(t){this.settings.pageTracking.autoTrackFirstPage=t},withBase:function(e){this.settings.pageTracking.basePath=e?t.element(document).find("base").attr("href"):""},withAutoBase:function(t){this.settings.pageTracking.autoBasePath=t},trackExceptions:function(t){this.settings.trackExceptions=t},developerMode:function(t){this.settings.developerMode=t}};function p(e,n,i){if(!r.developerMode){l[e]=u(e,n,i);var a=r[e],s=a?a.bufferFlushDelay:null,c=null!==s?s:r.bufferFlushDelay;t.forEach(o[e],function(t,e){var r,i;r=function(){n.apply(this,t)},(i=e*c)?setTimeout(r,i):r()})}}var d=function(e){return t.extend(l,{$inject:e.invoke})};function f(t){var e,r="register"+t.replace(/^./,function(t){return t.toUpperCase()});c[r]=function(e,n){p(t,e,n)},l[t]=u(t,(e=t,function(){n.waitForVendorCount&&(o[e]||(o[e]=[]),o[e].push(arguments))}))}function h(n,r,i){for(var o in t.forEach(r,i),n)e[o]=n[o]}var g=function(){h(c,i,f)};h(c,i,f)}).run(["$rootScope","$window","$analytics","$injector",function(e,n,r,i){function o(t,e,n){if(/\?/.test(t)&&e.length>0){for(var r=t.split("?"),i=r[0],o=r[1].split("&"),a=[],s=0;s<e.length;s++)for(var u=e[s],l=0;l<o.length;l++)(u instanceof RegExp&&u.test(o[l])||o[l].indexOf(u)>-1)&&a.push(o[l]);var c="white"==n?a:function(t,e){for(var n=[],r=0;r<t.length;r++)-1===e.indexOf(t[r])&&n.push(t[r]);return n}(o,a);return c.length>0?i+"?"+c.join("&"):i}return t}function a(t,e){(function(t){for(var e=0;e<r.settings.pageTracking.excludedRoutes.length;e++){var n=r.settings.pageTracking.excludedRoutes[e];if(n instanceof RegExp&&n.test(t)||t.indexOf(n)>-1)return!0}return!1})(t)||(t=o(t,r.settings.pageTracking.queryKeysWhitelisted,"white"),t=o(t,r.settings.pageTracking.queryKeysBlacklisted,"black"),r.pageTrack(t,e))}r.settings.pageTracking.autoTrackFirstPage&&i.invoke(["$location",function(t){var e=!0;if(i.has("$route")){var o=i.get("$route");if(o)for(var s in o.routes){e=!1;break}else null===o&&(e=!1)}else if(i.has("$state")){var u=i.get("$state");u.get().length>1&&(e=!1)}if(e)if(r.settings.pageTracking.autoBasePath&&(r.settings.pageTracking.basePath=n.location.pathname),r.settings.pageTracking.trackRelativePath){var l=r.settings.pageTracking.basePath+t.url();a(l,t)}else a(t.absUrl(),t)}]);r.settings.pageTracking.autoTrackVirtualPages&&i.invoke(["$location",function(t){r.settings.pageTracking.autoBasePath&&(r.settings.pageTracking.basePath=n.location.pathname+"#");var o=!0;if(r.settings.pageTracking.trackRoutes&&i.has("$route")){var s=i.get("$route");if(s)for(var u in s.routes){o=!1;break}else null===s&&(o=!1);e.$on("$routeChangeSuccess",function(e,n){if(!n||!(n.$$route||n).redirectTo){var i=r.settings.pageTracking.basePath+t.url();a(i,t)}})}r.settings.pageTracking.trackStates&&(i.has("$state")&&!i.has("$transitions")&&(o=!1,e.$on("$stateChangeSuccess",function(e,n){var i=r.settings.pageTracking.basePath+t.url();a(i,t)})),i.has("$state")&&i.has("$transitions")&&(o=!1,i.invoke(["$transitions",function(e){e.onSuccess({},function(e){var n=e.options();if(n.notify){var i=r.settings.pageTracking.basePath+t.url();a(i,t)}})}]))),o&&e.$on("$locationChangeSuccess",function(e,n){if(!n||!(n.$$route||n).redirectTo)if(r.settings.pageTracking.trackRelativePath){var i=r.settings.pageTracking.basePath+t.url();a(i,t)}else a(t.absUrl(),t)})}]);r.settings.developerMode&&t.forEach(r,function(t,e){"function"==typeof t&&(r[e]=function(){})})}]).directive("analyticsOn",["$analytics",function(e){return{restrict:"A",link:function(n,o,a){var s=a.analyticsOn||"click",u={};t.forEach(a.$attr,function(t,e){var n;"analytics"===(n=e).substr(0,9)&&-1===["On","Event","If","Properties","EventType"].indexOf(n.substr(9))&&(u[i(e)]=a[e],a.$observe(e,function(t){u[i(e)]=t}))}),t.element(o[0]).on(s,function(i){var s,l=a.analyticsEvent||(r(s=o[0])?s.innerText||s.value:s.id||s.name||s.tagName);u.eventType=i.type,a.analyticsIf&&!n.$eval(a.analyticsIf)||(a.analyticsProperties&&t.extend(u,n.$eval(a.analyticsProperties)),e.eventTrack(l,u))})}}}]).config(["$provide",function(t){t.decorator("$exceptionHandler",["$delegate","$injector",function(t,e){return function(n,r){var i=t(n,r),o=e.get("$analytics");return o.settings.trackExceptions&&o.exceptionTrack(n,r),i}}])}])}(angular),function(){var t;(t=angular.module("ui.bootstrap.showErrors",[])).directive("showErrors",["$timeout","showErrorsConfig","$interpolate",function(t,e,n){var r,i,o;return i=function(t){var n;return n=e.trigger,t&&null!=t.trigger&&(n=t.trigger),n},r=function(t){var n;return n=e.showSuccess,t&&null!=t.showSuccess&&(n=t.showSuccess),n},o=function(e,o,a,s){var u,l,c,p,d,f,h,g;if(u=!1,d=e.$eval(a.showErrors),f=r(d),g=i(d),l=o[0].querySelector(".form-control[name]"),p=angular.element(l),!(c=n(p.attr("name")||"")(e)))throw"show-errors element has no child input elements with a 'name' attribute and a 'form-control' class";return p.bind(g,function(){return u=!0,h(s[c].$invalid)}),e.$watch(function(){return s[c]&&s[c].$invalid},function(t){if(u)return h(t)}),e.$on("show-errors-check-validity",function(){return h(s[c].$invalid)}),e.$on("show-errors-reset",function(){return t(function(){return o.removeClass("has-error"),o.removeClass("has-success"),u=!1},0,!1)}),h=function(t){if(o.toggleClass("has-error",t),f)return o.toggleClass("has-success",!t)}},{restrict:"A",require:"^form",compile:function(t,e){if(-1===e.showErrors.indexOf("skipFormGroupCheck")&&!t.hasClass("form-group")&&!t.hasClass("input-group"))throw"show-errors element does not have the 'form-group' or 'input-group' class";return o}}}]),t.provider("showErrorsConfig",function(){var t,e;t=!1,e="blur",this.showSuccess=function(e){return t=e},this.trigger=function(t){return e=t},this.$get=function(){return{showSuccess:t,trigger:e}}})}.call(this),function(t,e){"use strict";function n(t,n,r){var i=r.baseHref(),o=t[0];return function(t,r,a){o.cookie=function(t,r,o){var a,s;s=(o=o||{}).expires,a=e.isDefined(o.path)?o.path:i,e.isUndefined(r)&&(s="Thu, 01 Jan 1970 00:00:00 GMT",r=""),e.isString(s)&&(s=new Date(s));var u=encodeURIComponent(t)+"="+encodeURIComponent(r);u+=a?";path="+a:"",u+=o.domain?";domain="+o.domain:"",u+=s?";expires="+s.toUTCString():"";var l=(u+=o.secure?";secure":"").length+1;return l>4096&&n.warn("Cookie '"+t+"' possibly not set or overflowed because it was too large ("+l+" > 4096 bytes)!"),u}(t,r,a)}}e.module("ngCookies",["ng"]).info({angularVersion:"1.6.7"}).provider("$cookies",[function(){var t=this.defaults={};function n(n){return n?e.extend({},t,n):t}this.$get=["$$cookieReader","$$cookieWriter",function(t,r){return{get:function(e){return t()[e]},getObject:function(t){var n=this.get(t);return n?e.fromJson(n):n},getAll:function(){return t()},put:function(t,e,i){r(t,e,n(i))},putObject:function(t,n,r){this.put(t,e.toJson(n),r)},remove:function(t,e){r(t,void 0,n(e))}}}]}]),e.module("ngCookies").factory("$cookieStore",["$cookies",function(t){return{get:function(e){return t.getObject(e)},put:function(e,n){t.putObject(e,n)},remove:function(e){t.remove(e)}}}]),n.$inject=["$document","$log","$browser"],e.module("ngCookies").provider("$$cookieWriter",function(){this.$get=n})}(window,window.angular),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).angularCreditCards=t()}}(function(){return function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}}()({1:[function(t,e,n){"use strict";var r=t("creditcards").cvc,i=t("function-bind");function o(t){return{restrict:"A",require:"ngModel",compile:function(e,n){return n.$set("maxlength",4),n.$set("pattern","[0-9]*"),n.$set("xAutocompletetype","cc-csc"),function(e,n,o,a){a.$validators.ccCvc=function(n){return a.$isEmpty(a.$viewValue)||r.isValid(n,t(o.ccType)(e))},o.ccType&&e.$watch(o.ccType,i.call(a.$validate,a))}}}}e.exports=o,o.$inject=["$parse"]},{creditcards:13,"function-bind":18}],2:[function(t,e,n){"use strict";var r=t("creditcards").expiration,i=r.month,o=r.year,a=t("ap");function s(t,e){var n={$setValidity:l},i=e.inheritedData("$formController")||n,o={year:{},month:{}};function a(t){var n=t.month,o=t.year,a=null==n&&null==o||!!n&&!!o&&!r.isPast(n,o);i.$setValidity("ccExp",a,e)}this.setMonth=function(t){o.month=t},this.setYear=function(t){o.year=t},this.$watch=function(){t.$watch(function(){return{month:o.month.$modelValue,year:o.year.$modelValue}},a,!0)}}n=e.exports=function(){return{restrict:"AE",require:"ccExp",controller:s,link:function(t,e,n,r){r.$watch()}}},s.$inject=["$scope","$element"];var u={setMonth:l,setYear:l};function l(){}n.month=function(){return{restrict:"A",require:["ngModel","^?ccExp"],compile:function(t,e){return e.$set("maxlength",2),e.$set("pattern","[0-9]*"),e.$set("xAutocompletetype","cc-exp-month"),function(t,e,n,r){var o=r[0];(r[1]||u).setMonth(o),o.$parsers.unshift(i.parse),o.$validators.ccExpMonth=function(t){return o.$isEmpty(o.$viewValue)||i.isValid(t)}}}}},n.year=function(){return{restrict:"A",require:["ngModel","^?ccExp"],compile:function(t,e){var n=void 0!==e.fullYear;return e.$set("maxlength",n?4:2),e.$set("pattern","[0-9]*"),e.$set("xAutocompletetype","cc-exp-year"),function(t,e,r,i){var s=i[0];(i[1]||u).setYear(s),s.$parsers.unshift(a.partialRight(o.parse,!n)),s.$formatters.unshift(function(t){return t?o.format(t,!n):""}),s.$validators.ccExpYear=function(t){return s.$isEmpty(s.$viewValue)||o.isValid(t)&&!o.isPast(t)}}}}}},{ap:5,creditcards:13}],3:[function(t,e,n){(function(n){"use strict";var r="undefined"!=typeof window?window.angular:void 0!==n?n.angular:null,i=t("creditcards"),o=t("./number"),a=t("./cvc"),s=t("./expiration");e.exports=r.module("credit-cards",[]).value("creditcards",i).directive("ccNumber",o).directive("ccExp",s).directive("ccExpMonth",s.month).directive("ccExpYear",s.year).directive("ccCvc",a).name}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cvc":1,"./expiration":2,"./number":4,creditcards:13}],4:[function(t,e,n){"use strict";var r=t("creditcards").card,i=t("cast-array"),o=t("ap").partial;function a(t,e){return{restrict:"A",require:["ngModel","ccNumber"],controller:function(){this.type=null,this.eagerType=null},compile:function(n,a){return a.$set("pattern","[0-9]*"),a.$set("xAutocompletetype","cc-number"),function(n,a,s,u){var l=u[0],c=u[1];function p(){return l.$viewValue}n.$watch(s.ngModel,function(t){l.$ccType=c.type=r.type(t)}),null!=s.ccEagerType&&n.$watch(p,function(t){t=r.parse(t),l.$ccEagerType=c.eagerType=r.type(t,!0)}),s.ccType&&n.$watch(s.ccType,function(){l.$validate()}),null!=s.ccFormat&&(l.$formatters.unshift(r.format),a.on("input",function(){var t=a.val(),n=p();if(t){var i,o,s=a[0],u=r.format(r.parse(t)),c=s.selectionEnd;l.$setViewValue(u),l.$render(),n&&n.length<u.length&&(c=u.length),i=s,o=c,e(function(){if(i.setSelectionRange)i.setSelectionRange(o,o);else if(i.createTextRange){var t=i.createTextRange();t.move("character",o),t.select()}},0)}})),l.$parsers.unshift(r.parse),l.$validators.ccNumber=function(t){return l.$isEmpty(l.$viewValue)||r.isValid(t)},l.$validators.ccNumberType=function(e){if(l.$isEmpty(l.$viewValue))return!0;var a=t(s.ccType)(n);return a||r.isValid(e),i(a).some(o(r.isValid,e))}}}}}e.exports=a,a.$inject=["$parse","$timeout"]},{ap:5,"cast-array":6,creditcards:13}],5:[function(t,e,n){function r(t,e){return function(){var n=[].slice.call(arguments),r=t.slice();return r.push.apply(r,n),e.apply(this,r)}}function i(t,e){return function(){var n=[].slice.call(arguments);return n.push.apply(n,t),e.apply(this,n)}}function o(t){return r([].slice.call(arguments,1),t)}function a(t){return i([].slice.call(arguments,1),t)}(n=e.exports=r).pa=i,n.apa=function(t,e,n){return function(){return n.apply(this,t.concat.apply(t,arguments).concat(e))}},n.partial=o,n.partialRight=a,n.curry=function(t){return o(o,t)},n.curryRight=function(t){return o(a,t)}},{}],6:[function(t,e,n){"use strict";var r=t("isarray");e.exports=function(t){return r(t)?t:[t]}},{isarray:22}],7:[function(t,e,n){"use strict";var r=n.types=t("./src/types");n.Type=t("./src/type"),n.find=function(t){for(var e in r){var n=r[e];if(t(n))return n}}},{"./src/type":8,"./src/types":9}],8:[function(t,e,n){"use strict";var r=t("xtend/mutable");function i(t,e){r(this,{name:t},e)}e.exports=i,i.prototype.cvcLength=3,i.prototype.luhn=!0,i.prototype.groupPattern=/(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?/,i.prototype.group=function(t){return(t.match(this.groupPattern)||[]).slice(1).filter(Boolean)},i.prototype.test=function(t,e){return this[e?"eagerPattern":"pattern"].test(t)}},{"xtend/mutable":30}],9:[function(t,e,n){"use strict";var r=t("./type"),i=/(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?(\d{1,3})?/;n.visa=new r("Visa",{pattern:/^4\d{12}(\d{3}|\d{6})?$/,eagerPattern:/^4/,groupPattern:i}),n.maestro=new r("Maestro",{pattern:/^(?:5[06789]\d\d|(?!6011[0234])(?!60117[4789])(?!60118[6789])(?!60119)(?!64[456789])(?!65)6\d{3})\d{8,15}$/,eagerPattern:/^(5(018|0[23]|[68])|6[37]|60111|60115|60117([56]|7[56])|60118[0-5]|64[0-3]|66)/,groupPattern:i}),n.forbrugsforeningen=new r("Forbrugsforeningen",{pattern:/^600722\d{10}$/,eagerPattern:/^600/}),n.dankort=new r("Dankort",{pattern:/^5019\d{12}$/,eagerPattern:/^5019/}),n.masterCard=new r("MasterCard",{pattern:/^(5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)\d{12}$/,eagerPattern:/^(2|5[1-5])/}),n.americanExpress=new r("American Express",{pattern:/^3[47]\d{13}$/,eagerPattern:/^3[47]/,groupPattern:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,cvcLength:4}),n.dinersClub=new r("Diners Club",{pattern:/^3(0[0-5]|[68]\d)\d{11}$/,eagerPattern:/^3(0|[68])/,groupPattern:/(\d{1,4})?(\d{1,6})?(\d{1,4})?/}),n.discover=new r("Discover",{pattern:/^6(011(0[0-9]|[2-4]\d|74|7[7-9]|8[6-9]|9[0-9])|4[4-9]\d{3}|5\d{4})\d{10}$/,eagerPattern:/^6(011(0[0-9]|[2-4]|74|7[7-9]|8[6-9]|9[0-9])|4[4-9]|5)/}),n.jcb=new r("JCB",{pattern:/^35\d{14}$/,eagerPattern:/^35/}),n.unionPay=new r("UnionPay",{pattern:/^62[0-5]\d{13,16}$/,eagerPattern:/^62/,groupPattern:i,luhn:!1}),n.troy=new r("Troy",{pattern:/^9792\d{12}$/,eagerPattern:/^9792/})},{"./type":8}],10:[function(t,e,n){"use strict";var r=t("fast-luhn"),i=t("./types");function o(t,e){return i.find(function(n){return n.test(t,e)})}e.exports={types:i,parse:function(t){return"string"!=typeof t?"":t.replace(/[^\d]/g,"")},format:function(t,e){var n=o(t,!0);return n?n.group(t).join(e||" "):t},type:function(t,e){var n=o(t,e);return n?n.name:void 0},luhn:r,isValid:function(t,e){e=e?i.get(e):o(t);return!!e&&(!e.luhn||r(t))&&e.test(t)}}},{"./types":14,"fast-luhn":16}],11:[function(t,e,n){"use strict";var r=t("./types"),i=/^\d{3,4}$/;e.exports={isValid:function(t,e){return!("string"!=typeof t||!i.test(t)||e&&r.get(e).cvcLength!==t.length)}}},{"./types":14}],12:[function(t,e,n){"use strict";var r=t("is-valid-month"),i=t("parse-int"),o=t("parse-year");e.exports={isPast:function(t,e){return Date.now()>=new Date(e,t)},month:{parse:function(t){return i(t)},isValid:r},year:{parse:o,format:function(t,e){return t=t.toString(),e?t.substr(2,4):t},isValid:function(t){return"number"==typeof t&&(t=i(t))>0},isPast:function(t){return(new Date).getFullYear()>t}}}},{"is-valid-month":21,"parse-int":24,"parse-year":25}],13:[function(t,e,n){"use strict";e.exports={card:t("./card"),cvc:t("./cvc"),expiration:t("./expiration")}},{"./card":10,"./cvc":11,"./expiration":12}],14:[function(t,e,n){"use strict";var r=t("creditcards-types"),i=t("to-camel-case"),o=t("xtend");e.exports=o(r,{get:function(t){return r.types[i(t)]}})},{"creditcards-types":7,"to-camel-case":26,xtend:29}],15:[function(t,e,n){"use strict";var r=t("zero-fill"),i=t("parse-int"),o=r(2);e.exports=function(t,e){var n=(e=e||new Date).getFullYear().toString().substr(0,2);return t=i(t),i(n+o(t))}},{"parse-int":24,"zero-fill":31}],16:[function(t,e,n){"use strict";var r;e.exports=(r=[0,2,4,6,8,1,3,5,7,9],function(t){if("string"!=typeof t)throw new TypeError("Expected string input");if(!t)return!1;for(var e,n=t.length,i=1,o=0;n;)e=parseInt(t.charAt(--n),10),o+=(i^=1)?r[e]:e;return!!o&&o%10==0})},{}],17:[function(t,e,n){"use strict";var r=Array.prototype.slice,i=Object.prototype.toString;e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,o=r.call(arguments,1),a=Math.max(0,e.length-o.length),s=[],u=0;u<a;u++)s.push("$"+u);if(n=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var i=e.apply(this,o.concat(r.call(arguments)));return Object(i)===i?i:this}return e.apply(t,o.concat(r.call(arguments)))}),e.prototype){var l=function(){};l.prototype=e.prototype,n.prototype=new l,l.prototype=null}return n}},{}],18:[function(t,e,n){"use strict";var r=t("./implementation");e.exports=Function.prototype.bind||r},{"./implementation":17}],19:[function(t,e,n){"use strict";var r=t("number-is-nan");e.exports=Number.isFinite||function(t){return!("number"!=typeof t||r(t)||t===1/0||t===-1/0)}},{"number-is-nan":23}],20:[function(t,e,n){var r=t("is-finite");e.exports=Number.isInteger||function(t){return"number"==typeof t&&r(t)&&Math.floor(t)===t}},{"is-finite":19}],21:[function(t,e,n){"use strict";var r=t("is-integer");e.exports=function(t){return!("number"!=typeof t||!r(t))&&(t>=1&&t<=12)}},{"is-integer":20}],22:[function(t,e,n){e.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},{}],23:[function(t,e,n){"use strict";e.exports=Number.isNaN||function(t){return t!=t}},{}],24:[function(t,e,n){"use strict";var r=t("is-integer");e.exports=function(t){return"number"==typeof t?r(t)?t:void 0:"string"==typeof t&&/^-?\d+$/.test(t)?parseInt(t,10):void 0}},{"is-integer":20}],25:[function(t,e,n){"use strict";var r=t("parse-int"),i=t("expand-year");e.exports=function(t,e,n){if(null!=(t=r(t)))return e?i(t,n):t}},{"expand-year":15,"parse-int":24}],26:[function(t,e,n){var r=t("to-space-case");e.exports=function(t){return r(t).replace(/\s(\w)/g,function(t,e){return e.toUpperCase()})}},{"to-space-case":28}],27:[function(t,e,n){e.exports=function(t){return r.test(t)?t.toLowerCase():i.test(t)?(n=t,n.replace(a,function(t,e){return e?" "+e:""})||t).toLowerCase():o.test(t)?(e=t,e.replace(s,function(t,e,n){return e+" "+n.toLowerCase().split("").join(" ")})).toLowerCase():t.toLowerCase();var e;var n};var r=/\s/,i=/(_|-|\.|:)/,o=/([a-z][A-Z]|[A-Z][a-z])/;var a=/[\W_]+(.|$)/g;var s=/(.)([A-Z]+)/g},{}],28:[function(t,e,n){var r=t("to-no-case");e.exports=function(t){return r(t).replace(/[\W_]+(.|$)/g,function(t,e){return e?" "+e:""}).trim()}},{"to-no-case":27}],29:[function(t,e,n){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],30:[function(t,e,n){e.exports=function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],31:[function(t,e,n){e.exports=function t(e,n,r){return void 0===n?function(n,r){return t(e,n,r)}:(void 0===r&&(r="0"),(e-=n.toString().length)>0?new Array(e+(/\./.test(n)?2:1)).join(r)+n:n+"")}},{}]},{},[3])(3)}),angular.module("angular-jwt",["angular-jwt.options","angular-jwt.interceptor","angular-jwt.jwt","angular-jwt.authManager"]),angular.module("angular-jwt.authManager",[]).provider("authManager",function(){this.$get=["$rootScope","$injector","$location","jwtHelper","jwtInterceptor","jwtOptions",function(t,e,n,r,i,o){var a=o.getConfig();function s(t){return Array.isArray(t)?e.invoke(t,this,{options:null}):t()}function u(t){if(Array.isArray(t)||angular.isFunction(t))return e.invoke(t,a,{});throw new Error("unauthenticatedRedirector must be a function")}function l(){t.isAuthenticated=!0}function c(){t.isAuthenticated=!1}t.isAuthenticated=!1;var p=e.has("$state")?"$stateChangeStart":"$routeChangeStart";return t.$on(p,function(t,e){if(!e)return!1;var n=e.$$route?e.$$route:e.data;if(n&&!0===n.requiresLogin){var i=s(a.tokenGetter);i&&!r.isTokenExpired(i)||(t.preventDefault(),u(a.unauthenticatedRedirector))}}),{authenticate:l,unauthenticate:c,getToken:function(){return s(a.tokenGetter)},redirect:function(){return u(a.unauthenticatedRedirector)},checkAuthOnRefresh:function(){t.$on("$locationChangeStart",function(){var e=s(a.tokenGetter);e&&(r.isTokenExpired(e)?t.$broadcast("tokenHasExpired",e):l())})},redirectWhenUnauthenticated:function(){t.$on("unauthenticated",function(){u(a.unauthenticatedRedirector),c()})},isAuthenticated:function(){var t=s(a.tokenGetter);if(t)return!r.isTokenExpired(t)}}}]}),angular.module("angular-jwt.interceptor",[]).provider("jwtInterceptor",function(){this.urlParam,this.authHeader,this.authPrefix,this.whiteListedDomains,this.tokenGetter;var t=this;this.$get=["$q","$injector","$rootScope","urlUtils","jwtOptions",function(e,n,r,i,o){var a=angular.extend({},o.getConfig(),t);return{request:function(t){if(t.skipAuthorization||!function(t){if(!i.isSameOrigin(t)&&!a.whiteListedDomains.length)throw new Error("As of v0.1.0, requests to domains other than the application's origin must be white listed. Use jwtOptionsProvider.config({ whiteListedDomains: [<domain>] }); to whitelist.");for(var e=i.urlResolve(t).hostname.toLowerCase(),n=0;n<a.whiteListedDomains.length;n++){var r=a.whiteListedDomains[n],o=r instanceof RegExp?r:new RegExp(r,"i");if(e.match(o))return!0}return!!i.isSameOrigin(t)}(t.url))return t;if(a.urlParam){if(t.params=t.params||{},t.params[a.urlParam])return t}else if(t.headers=t.headers||{},t.headers[a.authHeader])return t;return e.when(n.invoke(a.tokenGetter,this,{options:t})).then(function(e){return e&&(a.urlParam?t.params[a.urlParam]=e:t.headers[a.authHeader]=a.authPrefix+e),t})},responseError:function(t){return 401===t.status&&r.$broadcast("unauthenticated",t),e.reject(t)}}}]}),angular.module("angular-jwt.jwt",[]).service("jwtHelper",["$window",function(t){this.urlBase64Decode=function(e){var n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw"Illegal base64url string!"}return t.decodeURIComponent(escape(t.atob(n)))},this.decodeToken=function(t){var e=t.split(".");if(3!==e.length)throw new Error("JWT must have 3 parts");var n=this.urlBase64Decode(e[1]);if(!n)throw new Error("Cannot decode the token");return angular.fromJson(n)},this.getTokenExpirationDate=function(t){var e=this.decodeToken(t);if(void 0===e.exp)return null;var n=new Date(0);return n.setUTCSeconds(e.exp),n},this.isTokenExpired=function(t,e){var n=this.getTokenExpirationDate(t);return e=e||0,null!==n&&!(n.valueOf()>(new Date).valueOf()+1e3*e)}}]),angular.module("angular-jwt.options",[]).provider("jwtOptions",function(){var t={};this.config=function(e){t=e},this.$get=function(){var e={urlParam:null,authHeader:"Authorization",authPrefix:"Bearer ",whiteListedDomains:[],tokenGetter:function(){return null},loginPath:"/",unauthenticatedRedirectPath:"/",unauthenticatedRedirector:["$location",function(t){t.path(this.unauthenticatedRedirectPath)}]};function n(){this.config=angular.extend({},e,t)}return n.prototype.getConfig=function(){return this.config},new n}}),angular.module("angular-jwt.interceptor").service("urlUtils",function(){var t=document.createElement("a"),e=n(window.location.href);function n(e){var n=e;return t.setAttribute("href",n),n=t.href,t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return{urlResolve:n,isSameOrigin:function(t){var r=angular.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}}),function(t,e){"use strict";var n,r,i,o;function a(){return["$animate",function(t){return{restrict:"AE",transclude:"element",priority:1,terminal:!0,require:"^^ngMessages",link:function(e,n,i,o,a){var s,u,l,c=n[0],p=i.ngMessage||i.when,d=i.ngMessageExp||i.whenExp,f=function(t){s=t?r(t)?t:t.split(/[\s,]+/):null,o.reRender()};d?(f(e.$eval(d)),e.$watchCollection(d,f)):f(p),o.register(c,l={test:function(t){return function(t,e){if(t)return r(t)?t.indexOf(e)>=0:t.hasOwnProperty(e)}(s,t)},attach:function(){u||a(function(e,r){t.enter(e,null,n);var i=(u=e).$$attachId=o.getAttachId();u.on("$destroy",function(){u&&u.$$attachId===i&&(o.deregister(c),l.detach()),r.$destroy()})})},detach:function(){if(u){var e=u;u=null,t.leave(e)}}})}}}]}e.module("ngMessages",[],function(){n=e.forEach,r=e.isArray,i=e.isString,o=e.element}).info({angularVersion:"1.6.7"}).directive("ngMessages",["$animate",function(t){var e="ng-active",r="ng-inactive";return{require:"ngMessages",restrict:"AE",controller:["$element","$scope","$attrs",function(i,s,u){var l=this,c=0,p=0;this.getAttachId=function(){return p++};var d,f,h=this.messages={};function g(t,e){for(var n=e,r=[];n&&n!==t;){var i=n.$$ngMessageNode;if(i&&i.length)return h[i];n.childNodes.length&&-1===r.indexOf(n)?(r.push(n),n=n.childNodes[n.childNodes.length-1]):n.previousSibling?n=n.previousSibling:(n=n.parentNode,r.push(n))}}this.render=function(c){d=!1,f=c=c||{};for(var p=o(s,u.ngMessagesMultiple)||o(s,u.multiple),h=[],g={},m=l.head,v=!1,y=0;null!=m;){y++;var b=m.message,w=!1;v||n(c,function(t,e){if(!w&&a(t)&&b.test(e)){if(g[e])return;g[e]=!0,w=!0,b.attach()}}),w?v=!p:h.push(b),m=m.next}n(h,function(t){t.detach()}),h.length!==y?t.setClass(i,e,r):t.setClass(i,r,e)},s.$watchCollection(u.ngMessages||u.for,l.render),i.on("$destroy",function(){n(h,function(t){t.message.detach()})}),this.reRender=function(){d||(d=!0,s.$evalAsync(function(){d&&f&&l.render(f)}))},this.register=function(t,e){var n=c.toString();h[n]={message:e},function(t,e,n){var r=h[n];if(l.head){var i=g(t,e);i?(r.next=i.next,i.next=r):(r.next=l.head,l.head=r)}else l.head=r}(i[0],t,n),t.$$ngMessageNode=n,c++,l.reRender()},this.deregister=function(t){var e,n,r,o,a=t.$$ngMessageNode;delete t.$$ngMessageNode,e=i[0],n=t,r=h[a],(o=g(e,n))?o.next=r.next:l.head=r.next,delete h[a],l.reRender()}}]};function o(t,e){return i(e)&&0===e.length||a(t.$eval(e))}function a(t){return i(t)?t.length:!!t}}]).directive("ngMessagesInclude",["$templateRequest","$document","$compile",function(t,e,n){return{restrict:"AE",require:"^^ngMessages",link:function(e,o,a){var s=a.ngMessagesInclude||a.src;t(s).then(function(t){e.$$destroyed||(i(t)&&!t.trim()?r(o,s):n(t)(e,function(t){o.after(t),r(o,s)}))})}};function r(t,r){var i=n.$$createComment?n.$$createComment("ngMessagesInclude",r):e[0].createComment(" ngMessagesInclude: "+r+" "),a=o(i);t.after(a),t.remove()}}]).directive("ngMessage",a()).directive("ngMessageExp",a())}(window,window.angular);var app=angular.module("angular-promise-polyfill",[]).run(["$q","$window",function(t,e){e.Promise=function(e){return t(e)},e.Promise.all=t.all.bind(t),e.Promise.reject=t.reject.bind(t),e.Promise.resolve=t.when.bind(t),e.Promise.race=function(e){for(var n=t.defer(),r=0;r<e.length;r++)e[r].then(function(t){n&&(n.resolve(t),n=null)}),e[r].catch(function(t){n&&(n.reject(t),n=null)});return n.promise}}]);if("object"==typeof module&&(module.exports=app.name),function(t,e){"use strict";var n=e.$$minErr("$resource"),r=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;function i(t,i){if(null==(o=i)||""===o||"hasOwnProperty"===o||!r.test("."+o))throw n("badmember",'Dotted member path "@{0}" is invalid.',i);for(var o,a=i.split("."),s=0,u=a.length;s<u&&e.isDefined(t);s++){var l=a[s];t=null!==t?t[l]:void 0}return t}function o(t,n){for(var r in n=n||{},e.forEach(n,function(t,e){delete n[e]}),t)!t.hasOwnProperty(r)||"$"===r.charAt(0)&&"$"===r.charAt(1)||(n[r]=t[r]);return n}e.module("ngResource",["ng"]).info({angularVersion:"1.6.7"}).provider("$resource",function(){var t=/^https?:\/\/\[[^\]]*][^/]*/,r=this;this.defaults={stripTrailingSlashes:!0,cancellable:!1,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},delete:{method:"DELETE"}}},this.$get=["$http","$log","$q","$timeout",function(a,s,u,l){var c=e.noop,p=e.forEach,d=e.extend,f=e.copy,h=e.isArray,g=e.isDefined,m=e.isFunction,v=e.isNumber,y=e.$$encodeUriQuery,b=e.$$encodeUriSegment;function w(t,e){this.template=t,this.defaults=d({},r.defaults,e),this.urlParams={}}return w.prototype={setUrlParams:function(e,r,i){var o,a,s=this,u=i||s.template,l="",c=s.urlParams=Object.create(null);p(u.split(/\W/),function(t){if("hasOwnProperty"===t)throw n("badname","hasOwnProperty is not a valid parameter name.");!new RegExp("^\\d+$").test(t)&&t&&new RegExp("(^|[^\\\\]):"+t+"(\\W|$)").test(u)&&(c[t]={isQueryParamValue:new RegExp("\\?.*=:"+t+"(?:\\W|$)").test(u)})}),u=(u=u.replace(/\\:/g,":")).replace(t,function(t){return l=t,""}),r=r||{},p(s.urlParams,function(t,e){o=r.hasOwnProperty(e)?r[e]:s.defaults[e],g(o)&&null!==o?(a=t.isQueryParamValue?y(o,!0):b(o),u=u.replace(new RegExp(":"+e+"(\\W|$)","g"),function(t,e){return a+e})):u=u.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(t,e,n){return"/"===n.charAt(0)?n:e+n})}),s.defaults.stripTrailingSlashes&&(u=u.replace(/\/+$/,"")||"/"),u=u.replace(/\/\.(?=\w+($|\?))/,"."),e.url=l+u.replace(/\/(\\|%5C)\./,"/."),p(r,function(t,n){s.urlParams[n]||(e.params=e.params||{},e.params[n]=t)})}},function(t,e,y,b){var $=new w(t,b);function k(t){return t.resource}function C(t){o(t||{},this)}return y=d({},r.defaults.actions,y),C.prototype.toJSON=function(){var t=d({},this);return delete t.$promise,delete t.$resolved,delete t.$cancelRequest,t},p(y,function(t,r){var y=!0===t.hasBody||!1!==t.hasBody&&/^(POST|PUT|PATCH)$/i.test(t.method),b=t.timeout,w=g(t.cancellable)?t.cancellable:$.defaults.cancellable;b&&!v(b)&&(s.debug("ngResource:\n Only numeric values are allowed as `timeout`.\n Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),delete t.timeout,b=null),C[r]=function(s,g,v,x){var T,S,E,D={};switch(arguments.length){case 4:E=x,S=v;case 3:case 2:if(!m(g)){D=s,T=g,S=v;break}if(m(s)){S=s,E=g;break}S=g,E=v;case 1:m(s)?S=s:y?T=s:D=s;break;case 0:break;default:throw n("badargs","Expected up to 4 arguments [params, data, success, error], got {0} arguments",arguments.length)}var A,B,I,O,M,P=this instanceof C,_=P?T:t.isArray?[]:new C(T),R={},L=t.interceptor&&t.interceptor.response||k,N=t.interceptor&&t.interceptor.responseError||void 0,U=!!E,j=!!N;p(t,function(t,e){switch(e){default:R[e]=f(t);break;case"params":case"isArray":case"interceptor":case"cancellable":}}),!P&&w&&(A=u.defer(),R.timeout=A.promise,b&&(B=l(A.resolve,b))),y&&(R.data=T),$.setUrlParams(R,d({},(I=T,O=t.params||{},M={},O=d({},e,O),p(O,function(t,e){m(t)&&(t=t(I)),M[e]=t&&t.charAt&&"@"===t.charAt(0)?i(I,t.substr(1)):t}),M),D),t.url);var q=a(R).then(function(e){var i=e.data;if(i){if(h(i)!==!!t.isArray)throw n("badcfg","Error in resource configuration for action `{0}`. Expected response to contain an {1} but got an {2} (Request: {3} {4})",r,t.isArray?"array":"object",h(i)?"array":"object",R.method,R.url);if(t.isArray)_.length=0,p(i,function(t){"object"==typeof t?_.push(new C(t)):_.push(t)});else{var a=_.$promise;o(i,_),_.$promise=a}}return e.resource=_,e},function(t){return t.resource=_,u.reject(t)});return q=(q=q.finally(function(){_.$resolved=!0,!P&&w&&(_.$cancelRequest=c,l.cancel(B),A=B=R.timeout=null)})).then(function(t){var e=L(t);return(S||c)(e,t.headers,t.status,t.statusText),e},U||j?function(t){return U&&!j&&q.catch(c),U&&E(t),j?N(t):u.reject(t)}:void 0),P?q:(_.$promise=q,_.$resolved=!1,w&&(_.$cancelRequest=function(t){q.catch(c),null!==A&&A.resolve(t)}),_)},C.prototype["$"+r]=function(t,e,n){m(t)&&(n=e,e=t,t={});var i=C[r].call(this,t,this,e,n);return i.$promise||i}}),C}}]})}(window,window.angular),function(t,e){"use strict";var n,r,i,o,a,s,u,l,c,p=e.$$minErr("$sanitize");e.module("ngSanitize",[]).provider("$sanitize",function(){var d=!1;this.$get=["$$sanitizeUri",function(t){return d&&r(C,$),function(e){var n=[];return l(e,c(n,function(e,n){return!/^unsafe:/.test(t(e,n))})),n.join("")}}],this.enableSvg=function(t){return o(t)?(d=t,this):d},n=e.bind,r=e.extend,i=e.forEach,o=e.isDefined,a=e.lowercase,s=e.noop,l=function(t,e){null==t?t="":"string"!=typeof t&&(t=""+t);var n=A(t);if(!n)return"";var r=5;do{if(0===r)throw p("uinput","Failed to sanitize html because the input is unstable");r--,t=n.innerHTML,n=A(t)}while(t!==n.innerHTML);for(var i=n.firstChild;i;){switch(i.nodeType){case 1:e.start(i.nodeName.toLowerCase(),B(i.attributes));break;case 3:e.chars(i.textContent)}var o;if(!((o=i.firstChild)||(1===i.nodeType&&e.end(i.nodeName.toLowerCase()),o=O("nextSibling",i))))for(;null==o&&(i=O("parentNode",i))!==n;)o=O("nextSibling",i),1===i.nodeType&&e.end(i.nodeName.toLowerCase());i=o}for(;i=n.firstChild;)n.removeChild(i)},c=function(t,e){var r=!1,o=n(t,t.push);return{start:function(t,n){t=a(t),!r&&k[t]&&(r=t),r||!0!==C[t]||(o("<"),o(t),i(n,function(n,r){var i=a(r),s="img"===t&&"src"===i||"background"===i;!0!==E[i]||!0===x[i]&&!e(n,s)||(o(" "),o(r),o('="'),o(I(n)),o('"'))}),o(">"))},end:function(t){t=a(t),r||!0!==C[t]||!0===g[t]||(o("</"),o(t),o(">")),t==r&&(r=!1)},chars:function(t){r||o(I(t))}}},u=t.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))};var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,h=/([^#-~ |!])/g,g=D("area,br,col,hr,img,wbr"),m=D("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),v=D("rp,rt"),y=r({},v,m),b=r({},m,D("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),w=r({},v,D("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),$=D("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),k=D("script,style"),C=r({},g,b,w,y),x=D("background,cite,href,longdesc,src,xlink:href"),T=D("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),S=D("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),E=r({},x,S,T);function D(t,e){var n,r={},i=t.split(",");for(n=0;n<i.length;n++)r[e?a(i[n]):i[n]]=!0;return r}var A=function(e,n){var r;if(!n||!n.implementation)throw p("noinert","Can't create an inert html document");var i=((r=n.implementation.createHTMLDocument("inert")).documentElement||r.getDocumentElement()).querySelector("body");return i.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',i.querySelector("svg")?(i.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',i.querySelector("svg img")?function(t){t="<remove></remove>"+t;try{var n=(new e.DOMParser).parseFromString(t,"text/html").body;return n.firstChild.remove(),n}catch(t){return}}:function(e){return i.innerHTML=e,n.documentMode&&function e(n){for(;n;){if(n.nodeType===t.Node.ELEMENT_NODE)for(var r=n.attributes,i=0,o=r.length;i<o;i++){var a=r[i],s=a.name.toLowerCase();"xmlns:ns1"!==s&&0!==s.lastIndexOf("ns1:",0)||(n.removeAttributeNode(a),i--,o--)}var u=n.firstChild;u&&e(u),n=O("nextSibling",n)}}(i),i}):function(t){t="<remove></remove>"+t;try{t=encodeURI(t)}catch(t){return}var n=new e.XMLHttpRequest;n.responseType="document",n.open("GET","data:text/html;charset=utf-8,"+t,!1),n.send(null);var r=n.response.body;return r.firstChild.remove(),r}}(t,t.document);function B(t){for(var e={},n=0,r=t.length;n<r;n++){var i=t[n];e[i.name]=i.value}return e}function I(t){return t.replace(/&/g,"&amp;").replace(f,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(h,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function O(t,e){var n=e[t];if(n&&u.call(e,n))throw p("elclob","Failed to sanitize html because the element is clobbered: {0}",e.outerHTML||e.outerText);return n}}).info({angularVersion:"1.6.7"}),e.module("ngSanitize").filter("linky",["$sanitize",function(t){var n=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,r=/^mailto:/i,i=e.$$minErr("linky"),o=e.isDefined,a=e.isFunction,u=e.isObject,l=e.isString;return function(e,p,d){if(null==e||""===e)return e;if(!l(e))throw i("notstring","Expected string but received: {0}",e);for(var f,h,g,m=a(d)?d:u(d)?function(){return d}:function(){return{}},v=e,y=[];f=v.match(n);)h=f[0],f[2]||f[4]||(h=(f[3]?"http://":"mailto:")+h),g=f.index,b(v.substr(0,g)),w(h,f[0].replace(r,"")),v=v.substring(g+f[0].length);return b(v),t(y.join(""));function b(t){var e,n;t&&y.push((e=t,c(n=[],s).chars(e),n.join("")))}function w(t,e){var n,r=m(t);for(n in y.push("<a "),r)y.push(n+'="'+r[n]+'" ');!o(p)||"target"in r||y.push('target="',p,'" '),y.push('href="',t.replace(/"/g,"&quot;"),'">'),b(e),y.push("</a>")}}}])}(window,window.angular),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).angularStripe=t()}}(function(){return function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}}()({1:[function(t,e,n){(function(t){"use strict";var n="undefined"!=typeof window?window.angular:void 0!==t?t.angular:null;function r(t){return function(e){if("function"!=typeof t)throw new Error(e||"$q is not a function")}}e.exports=n.module("assert-q-constructor",[]).factory("assertQConstructor",r).name,r.$inject=["$q"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){(function(n){"use strict";var r=t("./promisify");e.exports=("undefined"!=typeof window?window.angular:void 0!==n?n.angular:null).module("promisify",[]).service("promisify",r).name}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./promisify":3}],3:[function(t,e,n){(function(n){"use strict";var r="undefined"!=typeof window?window.angular:void 0!==n?n.angular:null,i=t("assert-function"),o=t("to-array");function a(t,e){function n(n,r){function a(){var i=arguments;return t(function(t,a){var s,u,l,c=e.$apply.bind(e);try{n.apply(r,o(i).concat((s=c,u=t,l=a,function(t,e){var n=arguments;s(function(){return t?l(t):n.length<=2?u(e):void u(o(n,1))})})))}catch(t){setTimeout(function(){c(function(){a(t)})})}})}return r=r||{},"string"==typeof n&&(n=r[n]),i(n),a.__isPromisifed__=!0,a}return r.extend(n,{promisifyAll:function(t){return r.forEach(t,function(e,r){r+="Async",e&&"function"==typeof e&&!e.__isPromisifed__&&(t[r]=n(e,t))})}})}e.exports=a,a.$inject=["$q","$rootScope"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"assert-function":13,"to-array":36}],4:[function(t,e,n){(function(n){"use strict";var r="undefined"!=typeof window?window.angular:void 0!==n?n.angular:null,i=t("./provider");function o(t){t("angular-stripe: For Angular <= 1.2 support, first load https://github.com/bendrucker/angular-q-constructor")}e.exports=r.module("angular-stripe",[t("angular-q-promisify"),t("angular-assert-q-constructor")]).provider("stripe",i).run(o).name,o.$inject=["assertQConstructor"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./provider":6,"angular-assert-q-constructor":1,"angular-q-promisify":2}],5:[function(t,e,n){"use strict";var r=t("lazy-async"),i=t("dot-prop"),o=t("load-script-global"),a=t("stripe-errback");e.exports=function(t,e){var n=a.methods.async.concat(a.methods.sync),s=r(n,function(e){o({url:t,global:"Stripe"},function(t,n){if(t)return e(t);var r=a(n);r.setPublishableKey=(i=r.setPublishableKey,o=r,function(){var t=Array.prototype.pop.call(arguments);i.apply(o,arguments),t()}),e(null,r);var i,o})});return n.reduce(function(t,n){var r=i.get(s,n);return i.set(t,n,e(r)),t},{})}},{"dot-prop":20,"lazy-async":26,"load-script-global":28,"stripe-errback":35}],6:[function(t,e,n){"use strict";var r=t("./lazy");e.exports=function(){var t=null,e=null;this.url="https://js.stripe.com/v2/",this.setPublishableKey=function(e){t=e},this.$get=function(n,i){return e||((e=r(this.url,n)).setPublishableKey(t),e)},this.$get.$inject=["promisify","$exceptionHandler"]}},{"./lazy":5}],7:[function(t,e,n){var r=t("is-number"),i=t("array-slice");e.exports=function(t,e){if(!Array.isArray(t))throw new Error("array-last expects an array as the first argument.");if(0===t.length)return null;var n=i(t,t.length-(r(e)?+e:1));return 1==+e||null==e?n[0]:n}},{"array-slice":9,"is-number":8}],8:[function(t,e,n){"use strict";e.exports=function(t){return!!+t||0===t||"0"===t}},{}],9:[function(t,e,n){"use strict";function r(t,e,n){var r=t.length>>>0;return e=null==e?n||0:e<0?Math.max(r+e,0):Math.min(e,r)}e.exports=function(t,e,n){var i=t.length>>>0,o=[];for(e=r(t,e),n=r(t,n,i);e<n;)o.push(t[e++]);return o}},{}],10:[function(t,e,n){"use strict";var r=t("./raw"),i=[],o=[],a=r.makeRequestCallFromTimer(function(){if(o.length)throw o.shift()});function s(t){var e;(e=i.length?i.pop():new u).task=t,r(e)}function u(){this.task=null}e.exports=s,u.prototype.call=function(){try{this.task.call()}catch(t){s.onerror?s.onerror(t):(o.push(t),a())}finally{this.task=null,i[i.length]=this}}},{"./raw":11}],11:[function(t,e,n){(function(t){"use strict";function n(t){i.length||(r(),!0),i[i.length]=t}e.exports=n;var r,i=[],o=0,a=1024;function s(){for(;o<i.length;){var t=o;if(o+=1,i[t].call(),o>a){for(var e=0,n=i.length-o;e<n;e++)i[e]=i[e+o];i.length-=o,o=0}}i.length=0,o=0,!1}var u,l,c,p=void 0!==t?t:self,d=p.MutationObserver||p.WebKitMutationObserver;function f(t){return function(){var e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}"function"==typeof d?(u=1,l=new d(s),c=document.createTextNode(""),l.observe(c,{characterData:!0}),r=function(){u=-u,c.data=u}):r=f(s),n.requestFlush=r,n.makeRequestCallFromTimer=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(t,e,n){"use strict";var r=t("assert-ok"),i=t("simple-format"),o=t("print-value");e.exports=function(t,e){r(t===e,i("expected `%s` to equal `%s`",o(t),o(e)))}},{"assert-ok":14,"print-value":31,"simple-format":34}],13:[function(t,e,n){"use strict";e.exports=function(t){if("function"!=typeof t)throw new TypeError("Expected function, got: "+t)}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){if(!t)throw new Error(e||"Expected true, got "+t)}},{}],15:[function(t,e,n){"use strict";e.exports=function(t){return t=Array.isArray(t)?t:arguments,function(){for(var e=arguments,n=new Array(t.length),r=0,i=t.length;r<i;r++)n[r]=t[r].apply(null,e);return n}}},{}],16:[function(t,e,n){var r=t("./lib/fingerprint.js"),i=t("./lib/pad.js"),o=0,a=4,s=36,u=Math.pow(s,a);function l(){return i((Math.random()*u<<0).toString(s),a)}function c(){return o=o<u?o:0,++o-1}function p(){return"c"+(new Date).getTime().toString(s)+i(c().toString(s),a)+r()+(l()+l())}p.slug=function(){var t=(new Date).getTime().toString(36),e=c().toString(36).slice(-4),n=r().slice(0,1)+r().slice(-1),i=l().slice(-2);return t.slice(-2)+e+n+i},p.fingerprint=r,e.exports=p},{"./lib/fingerprint.js":17,"./lib/pad.js":18}],17:[function(t,e,n){var r=t("./pad.js"),i="object"==typeof window?window:self,o=Object.keys(i),a=r(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+o.toString(36),4);e.exports=function(){return a}},{"./pad.js":18}],18:[function(t,e,n){e.exports=function(t,e){var n="000000000"+t;return n.substr(n.length-e)}},{}],19:[function(t,e,n){var r=t("wrappy");e.exports=r(function(t){var e=!0;return i(function(){e=!1}),function(){var n=arguments,r=this;e?i(function(){t.apply(r,n)}):t.apply(r,n)}});var i=t("asap")},{asap:10,wrappy:37}],20:[function(t,e,n){"use strict";var r=t("is-obj");function i(t){for(var e=t.split("."),n=[],r=0;r<e.length;r++){for(var i=e[r];"\\"===i[i.length-1]&&void 0!==e[r+1];)i=i.slice(0,-1)+".",i+=e[++r];n.push(i)}return n}e.exports.get=function(t,e){if(!r(t)||"string"!=typeof e)return t;for(var n=i(e),o=0;o<n.length;o++){var a=Object.getOwnPropertyDescriptor(t,n[o])||Object.getOwnPropertyDescriptor(Object.prototype,n[o]);if(a&&!a.enumerable)return;if(null==(t=t[n[o]])){if(o!==n.length-1)return;break}}return t},e.exports.set=function(t,e,n){if(r(t)&&"string"==typeof e)for(var o=i(e),a=0;a<o.length;a++){var s=o[a];r(t[s])||(t[s]={}),a===o.length-1&&(t[s]=n),t=t[s]}},e.exports.delete=function(t,e){if(r(t)&&"string"==typeof e)for(var n=i(e),o=0;o<n.length;o++){var a=n[o];if(o===n.length-1)return void delete t[a];t=t[a]}},e.exports.has=function(t,e){if(!r(t)||"string"!=typeof e)return!1;for(var n=i(e),o=0;o<n.length;o++)if(void 0===(t=t[n[o]]))return!1;return!0}},{"is-obj":23}],21:[function(t,e,n){"use strict";var r=t("assert-function");e.exports=function(){var t=[];function e(){for(var e=arguments,n=0,r=t.length;n<r;n++){var i=t[n];i.apply(null,e)}}return e.add=function(e){return r(e),t.push(e),function(){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return void t.splice(n,1)}},e}},{"assert-function":13}],22:[function(t,e,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(t,e,n){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],24:[function(t,e,n){e.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},{}],25:[function(t,e,n){function r(t,e){var n=[],r=[];return null==e&&(e=function(t,e){return n[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(e)).join(".")+"]"}),function(i,o){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?r.splice(a,1/0,i):r.push(i),~n.indexOf(o)&&(o=e.call(this,i,o))}else n.push(o);return null==t?o:t.call(this,i,o)}}(e.exports=function(t,e,n,i){return JSON.stringify(t,r(e,i),n)}).getSerialize=r},{}],26:[function(t,e,n){"use strict";var r=t("assert-ok"),i=t("assert-equal"),o=t("dot-prop"),a=t("to-array"),s=t("array-last"),u=t("dezalgo"),l=t("call-all-fns");e.exports=function(t,e){r(Array.isArray(t),"methods are required"),i(typeof e,"function","load fn is required");var n=null,c=null,p=[];return e(function(t,e){c=t,n=e,l(p)(t,e),p=null}),t.reduce(function(t,e){var r;return o.set(t,e,(r=e,function(){var t=arguments;!function(t){if(t=u(t),n||c)return t(c,n);p.push(t)}(function(e,n){if(!e)return o.get(n,r).apply(null,t);var i=s(a(t));return"function"==typeof i?i(e):void 0})})),t},{})}},{"array-last":7,"assert-equal":12,"assert-ok":14,"call-all-fns":15,dezalgo:19,"dot-prop":27,"to-array":36}],27:[function(t,e,n){"use strict";var r=t("is-obj");function i(t){for(var e=t.split("."),n=[],r=0;r<e.length;r++){for(var i=e[r];"\\"===i[i.length-1];)i=i.slice(0,-1)+".",i+=e[++r];n.push(i)}return n}e.exports.get=function(t,e){if(!r(t)||"string"!=typeof e)return t;for(var n=i(e),o=0;o<n.length&&void 0!==(t=t[n[o]]);o++);return t},e.exports.set=function(t,e,n){if(r(t)&&"string"==typeof e)for(var o=i(e),a=0;a<o.length;a++){var s=o[a];r(t[s])||(t[s]={}),a===o.length-1&&(t[s]=n),t=t[s]}},e.exports.delete=function(t,e){if(r(t)&&"string"==typeof e)for(var n=i(e),o=0;o<n.length;o++){var a=n[o];if(o===n.length-1)return void delete t[a];t=t[a]}},e.exports.has=function(t,e){if(!r(t)||"string"!=typeof e)return!1;for(var n=i(e),o=0;o<n.length;o++)if(void 0===(t=t[n[o]]))return!1;return!0}},{"is-obj":23}],28:[function(t,e,n){"use strict";var r=t("load-script"),i=t("global/window"),o=t("xtend"),a=t("assert-ok"),s=t("dezalgo"),u=t("ear"),l=t("query-extend"),c=t("cuid");e.exports=function(t,e){if(a(t,"options required"),a(t.url,"url required"),a(t.global,"global required"),a(e,"callback required"),t=o(t),e=s(e),d(t))return e(null,d(t));if(!(e=function(t,e){return n()?void n().add(e):(r(u()),n().add(e),function(t,e){n()(t,e),r(u())});function n(){return p[t.global]}function r(e){p[t.global]=e}}(t,e)))return;if(t.jsonp){var n=(f=t,h=e,g=c(),i[g]=function(){h(null,d(f)),delete i[g]},g);t.url=l(t.url,{callback:n})}var f,h,g;r(t.url,t,function(n){if(n)return e(n);if(!t.jsonp){var r=d(t);if(!r)return e(new Error("expected: `window."+t.global+"`, actual: `"+r+"`"));e(null,r)}})};var p={};function d(t){return i[t.global]}},{"assert-ok":14,cuid:16,dezalgo:19,ear:21,"global/window":22,"load-script":29,"query-extend":33,xtend:38}],29:[function(t,e,n){function r(t,e){t.onload=function(){this.onerror=this.onload=null,e(null,t)},t.onerror=function(){this.onerror=this.onload=null,e(new Error("Failed to load "+this.src),t)}}function i(t,e){t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,e(null,t))}}e.exports=function(t,e,n){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},a.type=e.type||"text/javascript",a.charset=e.charset||"utf8",a.async=!("async"in e)||!!e.async,a.src=t,e.attrs&&function(t,e){for(var n in e)t.setAttribute(n,e[n])}(a,e.attrs),e.text&&(a.text=""+e.text),("onload"in a?r:i)(a,n),a.onload||r(a,n),o.appendChild(a)}},{}],30:[function(t,e,n){"use strict";e.exports=function(t){var e=1,n="",r=t.split("%"),i=r.length;i>0&&(n+=r[0]);for(var o=1;o<i;o++){if("s"===r[o][0]||"d"===r[o][0]){var a=arguments[e++];n+="d"===r[o][0]?Math.floor(a):a}else r[o][0]?n+="%"+r[o][0]:n+="%"+r[++o][0];n+=r[o].substring(1)}return n}},{}],31:[function(t,e,n){"use strict";var r=t("isobject"),i=t("json-stringify-safe");function o(t){return i(t,null,"")}e.exports=function(t){var e;return(r(e=t)||Array.isArray(e)?o:String)(t)}},{isobject:32,"json-stringify-safe":25}],32:[function(t,e,n){"use strict";var r=t("isarray");e.exports=function(t){return null!=t&&"object"==typeof t&&!r(t)}},{isarray:24}],33:[function(t,e,n){var r,i,o,a,s,u,l;r=this,i=function(t){var e=t.indexOf("[");return-1===e?{type:"string",val:t}:{type:"array",val:t.substr(0,e)}},o=function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t},s=function(){var t=Array.prototype.slice.call(arguments,0),e=!0===t[t.length-1],n="";if(!t.length)return n;e&&t.pop();var r=l(t,function(t){if("string"==typeof t){var e=(s=(a=t).lastIndexOf("?"),c=void 0,(l=-1!==s)&&s>0?c=a.substring(0,s):!l&&a&&a.length>0&&(c=a),{base:c,query:l?a.substring(s+1):void 0});return e.base&&(n=e.base),o={},(r=e.query)?(u(r.split("&"),function(t){var e=t.split("="),n=i(e[0]),r=decodeURIComponent(n.val),a=e[1]&&decodeURIComponent(e[1]);"array"===n.type?(o[r]||(o[r]=[]),o[r].push(a)):"string"===n.type&&(o[r]=a)}),o):o}var r,o,a,s,l,c;return t});return e?a.apply({},r):n+function(t){var e,n=[];for(var r in t)t.hasOwnProperty(r)&&(void 0!==t[r]?(e=encodeURIComponent(r),o(t[r])?u(t[r],function(t){n.push(e+"[]="+encodeURIComponent(t))}):n.push(e+"="+encodeURIComponent(t[r]))):n.push(encodeURIComponent(r)));return n.length?"?"+n.join("&"):""}(a.apply({},r))},u=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},l=function(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(e(t[r],r));return n},void 0!==e&&e.exports?e.exports=s:r.queryExtend=s},{}],34:[function(t,e,n){"use strict";var r=t("pff"),i=t("to-array"),o=/%[sdj]/;e.exports=function(t){return o.test(t)?r.apply(null,arguments):i(arguments).join(" ")}},{pff:30,"to-array":36}],35:[function(t,e,n){"use strict";var r=t("xtend/mutable"),i=t("dot-prop"),o=a.methods={async:["card.createToken","bankAccount.createToken","piiData.createToken","bitcoinReceiver.createReceiver","bitcoinReceiver.pollReceiver","bitcoinReceiver.getReceiver"],sync:["setPublishableKey","card.validateCardNumber","card.validateExpiry","card.validateCVC","card.cardType","bankAccount.validateRoutingNumber","bankAccount.validateAccountNumber","bitcoinReceiver.cancelReceiverPoll"]};function a(t){if("function"!=typeof t)throw new Error("Stripe.js must be provided");var e={};return o.async.forEach(function(n){var o,a,s=n.split("."),u=s[0],l=s[1];i.set(e,n,(o=l,a=t[u],function(){var t=Array.prototype.slice.call(arguments),e=t.pop();a[o].apply(a,t.concat(function(t,n){if(n.error)return e(r(new Error,n.error,{status:t}));e(null,n)}))}))}),o.sync.forEach(function(n){i.set(e,n,i.get(t,n))}),e}e.exports=a},{"dot-prop":20,"xtend/mutable":39}],36:[function(t,e,n){e.exports=function(t,e){for(var n=[],r=(e=e||0)||0;r<t.length;r++)n[r-e]=t[r];return n}},{}],37:[function(t,e,n){e.exports=function t(e,n){if(e&&n)return t(e)(n);if("function"!=typeof e)throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){r[t]=e[t]});return r;function r(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return"function"==typeof r&&r!==i&&Object.keys(i).forEach(function(t){r[t]=i[t]}),r}}},{}],38:[function(t,e,n){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],39:[function(t,e,n){e.exports=function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}]},{},[4])(4)}),function(){"use strict";function t(t,e,n,r,i,o,a){var s,u=0,l=[],c="",p={},d=a.defer();return{active:function(){return l.length},clear:function(t){if(1===arguments.length&&!t)return;if(t)f(t.toastId);else for(var e=0;e<l.length;e++)f(l[e].toastId)},error:function(t,e,n){return h(g().iconClasses.error,t,e,n)},info:function(t,e,n){return h(g().iconClasses.info,t,e,n)},remove:f,success:function(t,e,n){return h(g().iconClasses.success,t,e,n)},warning:function(t,e,n){return h(g().iconClasses.warning,t,e,n)},refreshTimer:function(t,e){t&&t.isOpened&&l.indexOf(t)>=0&&t.scope.refreshTimer(e)}};function f(e,n){var r=function(t){for(var e=0;e<l.length;e++)if(l[e].toastId===t)return l[e]}(e);r&&!r.deleting&&(r.deleting=!0,r.isOpened=!1,t.leave(r.el).then(function(){r.scope.options.onHidden&&r.scope.options.onHidden(!!n,r),r.scope.$destroy();var t=l.indexOf(r);delete p[r.scope.message],l.splice(t,1);var e=o.maxOpened;e&&l.length>=e&&l[e-1].open.resolve(),l.length||(s.remove(),s=null,d=a.defer())}))}function h(n,o,h,m){return angular.isObject(h)&&(m=h,h=null),function(n){var o=g();if(function(){var t=o.preventDuplicates&&n.message===c,e=o.preventOpenDuplicates&&p[n.message];if(t||e)return!0;return c=n.message,p[n.message]=!0,!1}())return;var h=function(){var t={toastId:u++,isOpened:!1,scope:r.$new(),open:a.defer()};t.iconClass=n.iconClass,n.optionsOverride&&(angular.extend(o,function(t){for(var e=["containerId","iconClasses","maxOpened","newestOnTop","positionClass","preventDuplicates","preventOpenDuplicates","templates"],n=0,r=e.length;n<r;n++)delete t[e[n]];return t}(n.optionsOverride)),t.iconClass=n.optionsOverride.iconClass||t.iconClass);return function(t,e,n){function r(e){if(n[e])return function(){n[e](t)}}n.allowHtml?(t.scope.allowHtml=!0,t.scope.title=i.trustAsHtml(e.title),t.scope.message=i.trustAsHtml(e.message)):(t.scope.title=e.title,t.scope.message=e.message),t.scope.toastType=t.iconClass,t.scope.toastId=t.toastId,t.scope.extraData=n.extraData,t.scope.options={extendedTimeOut:n.extendedTimeOut,messageClass:n.messageClass,onHidden:n.onHidden,onShown:r("onShown"),onTap:r("onTap"),progressBar:n.progressBar,tapToDismiss:n.tapToDismiss,timeOut:n.timeOut,titleClass:n.titleClass,toastClass:n.toastClass},n.closeButton&&(t.scope.options.closeHtml=n.closeHtml)}(t,n,o),t.el=(s=t.scope,l=angular.element("<div toast></div>"),e.get("$compile")(l)(s)),t;var s,l}();if(l.push(h),o.autoDismiss&&o.maxOpened&&l.length>o.maxOpened)for(var m=l.slice(0,l.length-o.maxOpened),v=0,y=m.length;v<y;v++)f(m[v].toastId);(o.maxOpened&&l.length<=o.maxOpened||!o.maxOpened)&&h.open.resolve();return h.open.promise.then(function(){(function(e){if(s)return d.promise;(s=angular.element("<div></div>")).attr("id",e.containerId),s.addClass(e.positionClass),s.css({"pointer-events":"auto"});var n=angular.element(document.querySelector(e.target));if(!n||!n.length)throw"Target for toasts doesn't exist";return t.enter(s,n).then(function(){d.resolve()}),d.promise})(o).then(function(){if(h.isOpened=!0,o.newestOnTop)t.enter(h.el,s).then(function(){h.scope.init()});else{var e=s[0].lastChild?angular.element(s[0].lastChild):null;t.enter(h.el,s,e).then(function(){h.scope.init()})}})}),h}({iconClass:n,message:o,optionsOverride:m,title:h})}function g(){return angular.extend({},o)}}angular.module("toastr",[]).factory("toastr",t),t.$inject=["$animate","$injector","$document","$rootScope","$sce","toastrConfig","$q"]}(),function(){"use strict";angular.module("toastr").constant("toastrConfig",{allowHtml:!1,autoDismiss:!1,closeButton:!1,closeHtml:"<button>&times;</button>",containerId:"toast-container",extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},maxOpened:0,messageClass:"toast-message",newestOnTop:!0,onHidden:null,onShown:null,onTap:null,positionClass:"toast-top-right",preventDuplicates:!1,preventOpenDuplicates:!1,progressBar:!1,tapToDismiss:!0,target:"body",templates:{toast:"directives/toast/toast.html",progressbar:"directives/progressbar/progressbar.html"},timeOut:5e3,titleClass:"toast-title",toastClass:"toast"})}(),function(){"use strict";function t(t){return{require:"^toast",templateUrl:function(){return t.templates.progressbar},link:function(t,e,n,r){var i,o,a;function s(){var t=(a-(new Date).getTime())/o*100;e.css("width",t+"%")}r.progressBar=t,t.start=function(t){i&&clearInterval(i),o=parseFloat(t),a=(new Date).getTime()+o,i=setInterval(s,10)},t.stop=function(){i&&clearInterval(i)},t.$on("$destroy",function(){clearInterval(i)})}}}angular.module("toastr").directive("progressBar",t),t.$inject=["toastrConfig"]}(),function(){"use strict";angular.module("toastr").controller("ToastController",function(){this.progressBar=null,this.startProgressBar=function(t){this.progressBar&&this.progressBar.start(t)},this.stopProgressBar=function(){this.progressBar&&this.progressBar.stop()}})}(),function(){"use strict";function t(t,e,n,r){return{templateUrl:function(){return n.templates.toast},controller:"ToastController",link:function(n,i,o,a){var s;if(n.toastClass=n.options.toastClass,n.titleClass=n.options.titleClass,n.messageClass=n.options.messageClass,n.progressBar=n.options.progressBar,n.options.closeHtml){var u=angular.element(n.options.closeHtml),l=t.get("$compile");u.addClass("toast-close-button"),u.attr("ng-click","close(true, $event)"),l(u)(n),i.children().prepend(u)}function c(t){return a.startProgressBar(t),e(function(){a.stopProgressBar(),r.remove(n.toastId)},t,1)}n.init=function(){n.options.timeOut&&(s=c(n.options.timeOut)),n.options.onShown&&n.options.onShown()},i.on("mouseenter",function(){n.progressBar=!1,a.stopProgressBar(),s&&e.cancel(s)}),n.tapToast=function(){angular.isFunction(n.options.onTap)&&n.options.onTap(),n.options.tapToDismiss&&n.close(!0)},n.close=function(t,e){e&&angular.isFunction(e.stopPropagation)&&e.stopPropagation(),r.remove(n.toastId,t)},n.refreshTimer=function(t){s&&(e.cancel(s),s=c(t||n.options.timeOut))},i.on("mouseleave",function(){0===n.options.timeOut&&0===n.options.extendedTimeOut||(n.$apply(function(){n.progressBar=n.options.progressBar}),s=c(n.options.extendedTimeOut))})}}}angular.module("toastr").directive("toast",t),t.$inject=["$injector","$interval","toastrConfig","toastr"]}(),function(){"use strict";function t(t,e,n,r,i,o,a){var s,u=0,l=[],c="",p={},d=a.defer();return{active:function(){return l.length},clear:function(t){if(1===arguments.length&&!t)return;if(t)f(t.toastId);else for(var e=0;e<l.length;e++)f(l[e].toastId)},error:function(t,e,n){return h(g().iconClasses.error,t,e,n)},info:function(t,e,n){return h(g().iconClasses.info,t,e,n)},remove:f,success:function(t,e,n){return h(g().iconClasses.success,t,e,n)},warning:function(t,e,n){return h(g().iconClasses.warning,t,e,n)},refreshTimer:function(t,e){t&&t.isOpened&&l.indexOf(t)>=0&&t.scope.refreshTimer(e)}};function f(e,n){var r=function(t){for(var e=0;e<l.length;e++)if(l[e].toastId===t)return l[e]}(e);r&&!r.deleting&&(r.deleting=!0,r.isOpened=!1,t.leave(r.el).then(function(){r.scope.options.onHidden&&r.scope.options.onHidden(!!n,r),r.scope.$destroy();var t=l.indexOf(r);delete p[r.scope.message],l.splice(t,1);var e=o.maxOpened;e&&l.length>=e&&l[e-1].open.resolve(),l.length||(s.remove(),s=null,d=a.defer())}))}function h(n,o,h,m){return angular.isObject(h)&&(m=h,h=null),function(n){var o=g();if(function(){var t=o.preventDuplicates&&n.message===c,e=o.preventOpenDuplicates&&p[n.message];if(t||e)return!0;return c=n.message,p[n.message]=!0,!1}())return;var h=function(){var t={toastId:u++,isOpened:!1,scope:r.$new(),open:a.defer()};t.iconClass=n.iconClass,n.optionsOverride&&(angular.extend(o,function(t){for(var e=["containerId","iconClasses","maxOpened","newestOnTop","positionClass","preventDuplicates","preventOpenDuplicates","templates"],n=0,r=e.length;n<r;n++)delete t[e[n]];return t}(n.optionsOverride)),t.iconClass=n.optionsOverride.iconClass||t.iconClass);return function(t,e,n){function r(e){if(n[e])return function(){n[e](t)}}n.allowHtml?(t.scope.allowHtml=!0,t.scope.title=i.trustAsHtml(e.title),t.scope.message=i.trustAsHtml(e.message)):(t.scope.title=e.title,t.scope.message=e.message),t.scope.toastType=t.iconClass,t.scope.toastId=t.toastId,t.scope.extraData=n.extraData,t.scope.options={extendedTimeOut:n.extendedTimeOut,messageClass:n.messageClass,onHidden:n.onHidden,onShown:r("onShown"),onTap:r("onTap"),progressBar:n.progressBar,tapToDismiss:n.tapToDismiss,timeOut:n.timeOut,titleClass:n.titleClass,toastClass:n.toastClass},n.closeButton&&(t.scope.options.closeHtml=n.closeHtml)}(t,n,o),t.el=(s=t.scope,l=angular.element("<div toast></div>"),e.get("$compile")(l)(s)),t;var s,l}();if(l.push(h),o.autoDismiss&&o.maxOpened&&l.length>o.maxOpened)for(var m=l.slice(0,l.length-o.maxOpened),v=0,y=m.length;v<y;v++)f(m[v].toastId);(o.maxOpened&&l.length<=o.maxOpened||!o.maxOpened)&&h.open.resolve();return h.open.promise.then(function(){(function(e){if(s)return d.promise;(s=angular.element("<div></div>")).attr("id",e.containerId),s.addClass(e.positionClass),s.css({"pointer-events":"auto"});var n=angular.element(document.querySelector(e.target));if(!n||!n.length)throw"Target for toasts doesn't exist";return t.enter(s,n).then(function(){d.resolve()}),d.promise})(o).then(function(){if(h.isOpened=!0,o.newestOnTop)t.enter(h.el,s).then(function(){h.scope.init()});else{var e=s[0].lastChild?angular.element(s[0].lastChild):null;t.enter(h.el,s,e).then(function(){h.scope.init()})}})}),h}({iconClass:n,message:o,optionsOverride:m,title:h})}function g(){return angular.extend({},o)}}angular.module("toastr",[]).factory("toastr",t),t.$inject=["$animate","$injector","$document","$rootScope","$sce","toastrConfig","$q"]}(),function(){"use strict";angular.module("toastr").constant("toastrConfig",{allowHtml:!1,autoDismiss:!1,closeButton:!1,closeHtml:"<button>&times;</button>",containerId:"toast-container",extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},maxOpened:0,messageClass:"toast-message",newestOnTop:!0,onHidden:null,onShown:null,onTap:null,positionClass:"toast-top-right",preventDuplicates:!1,preventOpenDuplicates:!1,progressBar:!1,tapToDismiss:!0,target:"body",templates:{toast:"directives/toast/toast.html",progressbar:"directives/progressbar/progressbar.html"},timeOut:5e3,titleClass:"toast-title",toastClass:"toast"})}(),function(){"use strict";function t(t){return{require:"^toast",templateUrl:function(){return t.templates.progressbar},link:function(t,e,n,r){var i,o,a;function s(){var t=(a-(new Date).getTime())/o*100;e.css("width",t+"%")}r.progressBar=t,t.start=function(t){i&&clearInterval(i),o=parseFloat(t),a=(new Date).getTime()+o,i=setInterval(s,10)},t.stop=function(){i&&clearInterval(i)},t.$on("$destroy",function(){clearInterval(i)})}}}angular.module("toastr").directive("progressBar",t),t.$inject=["toastrConfig"]}(),function(){"use strict";angular.module("toastr").controller("ToastController",function(){this.progressBar=null,this.startProgressBar=function(t){this.progressBar&&this.progressBar.start(t)},this.stopProgressBar=function(){this.progressBar&&this.progressBar.stop()}})}(),function(){"use strict";function t(t,e,n,r){return{templateUrl:function(){return n.templates.toast},controller:"ToastController",link:function(n,i,o,a){var s;if(n.toastClass=n.options.toastClass,n.titleClass=n.options.titleClass,n.messageClass=n.options.messageClass,n.progressBar=n.options.progressBar,n.options.closeHtml){var u=angular.element(n.options.closeHtml),l=t.get("$compile");u.addClass("toast-close-button"),u.attr("ng-click","close(true, $event)"),l(u)(n),i.children().prepend(u)}function c(t){return a.startProgressBar(t),e(function(){a.stopProgressBar(),r.remove(n.toastId)},t,1)}n.init=function(){n.options.timeOut&&(s=c(n.options.timeOut)),n.options.onShown&&n.options.onShown()},i.on("mouseenter",function(){n.progressBar=!1,a.stopProgressBar(),s&&e.cancel(s)}),n.tapToast=function(){angular.isFunction(n.options.onTap)&&n.options.onTap(),n.options.tapToDismiss&&n.close(!0)},n.close=function(t,e){e&&angular.isFunction(e.stopPropagation)&&e.stopPropagation(),r.remove(n.toastId,t)},n.refreshTimer=function(t){s&&(e.cancel(s),s=c(t||n.options.timeOut))},i.on("mouseleave",function(){0===n.options.timeOut&&0===n.options.extendedTimeOut||(n.$apply(function(){n.progressBar=n.options.progressBar}),s=c(n.options.extendedTimeOut))})}}}angular.module("toastr").directive("toast",t),t.$inject=["$injector","$interval","toastrConfig","toastr"]}(),angular.module("toastr").run(["$templateCache",function(t){t.put("directives/progressbar/progressbar.html",'<div class="toast-progress"></div>\n'),t.put("directives/toast/toast.html",'<div class="{{toastClass}} {{toastType}}" ng-click="tapToast()">\n <div ng-switch on="allowHtml">\n <div ng-switch-default ng-if="title" class="{{titleClass}}" aria-label="{{title}}">{{title}}</div>\n <div ng-switch-default class="{{messageClass}}" aria-label="{{message}}">{{message}}</div>\n <div ng-switch-when="true" ng-if="title" class="{{titleClass}}" ng-bind-html="title"></div>\n <div ng-switch-when="true" class="{{messageClass}}" ng-bind-html="message"></div>\n </div>\n <progress-bar ng-if="progressBar"></progress-bar>\n</div>\n')}]),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(t,e,n){"use strict";var r,i=e.isDefined,o=e.isFunction,a=e.isString,s=e.isObject,u=e.isArray,l=e.forEach,c=e.extend,p=e.copy,d=e.toJson;function f(t,e){return c(new(c(function(){},{prototype:t})),e)}function h(t){return l(arguments,function(e){e!==t&&l(e,function(e,n){t.hasOwnProperty(n)||(t[n]=e)})}),t}function g(t){if(Object.keys)return Object.keys(t);var e=[];return l(t,function(t,n){e.push(n)}),e}function m(t,e){if(Array.prototype.indexOf)return t.indexOf(e,Number(arguments[2])||0);var n=t.length>>>0,r=Number(arguments[2])||0;for((r=r<0?Math.ceil(r):Math.floor(r))<0&&(r+=n);r<n;r++)if(r in t&&t[r]===e)return r;return-1}function v(t,e,n,r){var i,o=function(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}(n,r),a={},s=[];for(var u in o)if(o[u]&&o[u].params&&(i=g(o[u].params)).length)for(var l in i)m(s,i[l])>=0||(s.push(i[l]),a[i[l]]=t[i[l]]);return c({},a,e)}function y(t,e){var n={};return l(t,function(t){n[t]=e[t]}),n}function b(t){var e={},n=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return l(n,function(n){n in t&&(e[n]=t[n])}),e}function w(t){var e={},n=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var r in t)-1==m(n,r)&&(e[r]=t[r]);return e}function $(t,e){var n=u(t),r=n?[]:{};return l(t,function(t,i){e(t,i)&&(r[n?r.length:i]=t)}),r}function k(t,e){var n=u(t)?[]:{};return l(t,function(t,r){n[r]=e(t,r)}),n}function C(t){return t.then(n,function(){})&&t}function x(t,e){var r=1,o=2,u={},p=[],d=u,f=c(t.when(u),{$$promises:u,$$values:u});this.study=function(u){if(!s(u))throw new Error("'invocables' must be an object");var v=g(u||{}),y=[],b=[],$={};function k(t){return s(t)&&t.then&&t.$$promises}return l(u,function t(n,i){if($[i]!==o){if(b.push(i),$[i]===r)throw b.splice(0,m(b,i)),new Error("Cyclic dependency: "+b.join(" -> "));if($[i]=r,a(n))y.push(i,[function(){return e.get(n)}],p);else{var s=e.annotate(n);l(s,function(e){e!==i&&u.hasOwnProperty(e)&&t(u[e],e)}),y.push(i,n,s)}b.pop(),$[i]=o}}),u=b=$=null,function(r,o,a){if(k(r)&&a===n&&(a=o,o=r,r=null),r){if(!s(r))throw new Error("'locals' must be an object")}else r=d;if(o){if(!k(o))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else o=f;var u=t.defer(),p=C(u.promise),g=p.$$promises={},m=c({},r),b=1+y.length/3,$=!1;function x(){--b||($||h(m,o.$$values),p.$$values=m,p.$$promises=p.$$promises||!0,delete p.$$inheritedValues,u.resolve(m))}function T(t){p.$$failure=t,u.reject(t)}if(C(p),i(o.$$failure))return T(o.$$failure),p;o.$$inheritedValues&&h(m,w(o.$$inheritedValues,v)),c(g,o.$$promises),o.$$values?($=h(m,w(o.$$values,v)),p.$$inheritedValues=w(o.$$values,v),x()):(o.$$inheritedValues&&(p.$$inheritedValues=w(o.$$inheritedValues,v)),o.then(x,T));for(var S=0,E=y.length;S<E;S+=3)r.hasOwnProperty(y[S])?x():D(y[S],y[S+1],y[S+2]);function D(n,o,s){var u=t.defer(),c=0;function d(t){u.reject(t),T(t)}function f(){if(!i(p.$$failure))try{u.resolve(e.invoke(o,a,m)),u.promise.then(function(t){m[n]=t,x()},d)}catch(t){d(t)}}l(s,function(t){g.hasOwnProperty(t)&&!r.hasOwnProperty(t)&&(c++,g[t].then(function(e){m[t]=e,--c||f()},d))}),c||f(),g[n]=C(u.promise)}return p}},this.resolve=function(t,e,n,r){return this.study(t)(e,n,r)}}function T(t,e,i){e=c({params:{}},s(e)?e:{});var o,a,u,l,p=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,d=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h="^",g=0,m=this.segments=[],v=i?i.params:{},y=this.params=i?i.params.$$new():new r.ParamSet,b=[];function w(e,n,i,o){if(b.push(e),v[e])return v[e];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(e))throw new Error("Invalid parameter name '"+e+"' in pattern '"+t+"'");if(y[e])throw new Error("Duplicate parameter name '"+e+"' in pattern '"+t+"'");return y[e]=new r.Param(e,n,i,o),y[e]}function $(t,e,n,r){var i=["",""],o=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return o;switch(n){case!1:i=["(",")"+(r?"?":"")];break;case!0:o=o.replace(/\/$/,""),i=["(?:/(",")|/)?"];break;default:i=["("+n+"|",")?"]}return o+i[0]+e+i[1]}function k(i,o){var a,s,u,l,c;return a=i[2]||i[3],c=e.params[a],u=t.substring(g,i.index),(s=o?i[4]:i[4]||("*"==i[1]?".*":null))&&(l=r.type(s)||f(r.type("string"),{pattern:new RegExp(s,e.caseInsensitive?"i":n)})),{id:a,regexp:s,segment:u,type:l,cfg:c}}for(this.source=t;(o=p.exec(t))&&!((a=k(o,!1)).segment.indexOf("?")>=0);)u=w(a.id,a.type,a.cfg,"path"),h+=$(a.segment,u.type.pattern.source,u.squash,u.isOptional),m.push(a.segment),g=p.lastIndex;var C=(l=t.substring(g)).indexOf("?");if(C>=0){var x=this.sourceSearch=l.substring(C);if(l=l.substring(0,C),this.sourcePath=t.substring(0,g+C),x.length>0)for(g=0;o=d.exec(x);)u=w((a=k(o,!0)).id,a.type,a.cfg,"search"),g=p.lastIndex}else this.sourcePath=t,this.sourceSearch="";h+=$(l)+(!1===e.strict?"/?":"")+"$",m.push(l),this.regexp=new RegExp(h,e.caseInsensitive?"i":n),this.prefix=m[0],this.$$paramNames=b}function S(t){c(this,t)}function E(t,r){var s,l=[],p=null,d=!1;function f(t,e,n){if(!n)return!1;var r=t.invoke(e,e,{$match:n});return!i(r)||r}function h(r,i,o,u,c){var f,h=u.baseHref(),g=r.url();function m(t){if(!t||!t.defaultPrevented){f&&r.url();f=n;var e,i=l.length;for(e=0;e<i;e++)if(s(l[e]))return;p&&s(p)}function s(t){var e=t(o,r);return!!e&&(a(e)&&r.replace().url(e),!0)}}function v(){return s=s||i.$on("$locationChangeSuccess",m)}return d||v(),{sync:function(){m()},listen:function(){return v()},update:function(t){t?g=r.url():r.url()!==g&&(r.url(g),r.replace())},push:function(t,e,i){var o=t.format(e||{});null!==o&&e&&e["#"]&&(o+="#"+e["#"]),r.url(o),f=i&&i.$$avoidResync?r.url():n,i&&i.replace&&r.replace()},href:function(n,i,o){if(!n.validates(i))return null;var a=t.html5Mode();e.isObject(a)&&(a=a.enabled),a=a&&c.history;var s,u,l,p=n.format(i);if(o=o||{},a||null===p||(p="#"+t.hashPrefix()+p),null!==p&&i&&i["#"]&&(p+="#"+i["#"]),s=p,u=a,l=o.absolute,p="/"===h?s:u?h.slice(0,-1)+s:l?h.slice(1)+s:s,!o.absolute||!p)return p;var d=!a&&p?"/":"",f=r.port();return f=80===f||443===f?"":":"+f,[r.protocol(),"://",r.host(),f,d,p].join("")}}}this.rule=function(t){if(!o(t))throw new Error("'rule' must be a function");return l.push(t),this},this.otherwise=function(t){if(a(t)){var e=t;t=function(){return e}}else if(!o(t))throw new Error("'rule' must be a function");return p=t,this},this.when=function(t,e){var n,i=a(e);if(a(t)&&(t=r.compile(t)),!i&&!o(e)&&!u(e))throw new Error("invalid 'handler' in when()");var s={matcher:function(t,e){return i&&(n=r.compile(e),e=["$match",function(t){return n.format(t)}]),c(function(n,r){return f(n,e,t.exec(r.path(),r.search()))},{prefix:a(t.prefix)?t.prefix:""})},regex:function(t,e){if(t.global||t.sticky)throw new Error("when() RegExp must not be global or sticky");return i&&(n=e,e=["$match",function(t){return e=t,n.replace(/\$(\$|\d{1,2})/,function(t,n){return e["$"===n?0:Number(n)]});var e}]),c(function(n,r){return f(n,e,t.exec(r.path()))},{prefix:(r=t,o=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(r.source),null!=o?o[1].replace(/\\(.)/g,"$1"):"")});var r,o}},l={matcher:r.isMatcher(t),regex:t instanceof RegExp};for(var p in l)if(l[p])return this.rule(s[p](t,e));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(t){t===n&&(t=!0),d=t},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function D(t,d){var h,w,$={},x={},T="abstract",S={parent:function(t){if(i(t.parent)&&t.parent)return E(t.parent);var e=/^(.+)\.[^.]+$/.exec(t.name);return e?E(e[1]):h},data:function(t){return t.parent&&t.parent.data&&(t.data=t.self.data=f(t.parent.data,t.data)),t.data},url:function(t){var e=t.url,n={params:t.params||{}};if(a(e))return"^"==e.charAt(0)?d.compile(e.substring(1),n):(t.parent.navigable||h).url.concat(e,n);if(!e||d.isMatcher(e))return e;throw new Error("Invalid url '"+e+"' in state '"+t+"'")},navigable:function(t){return t.url?t:t.parent?t.parent.navigable:null},ownParams:function(t){var e=t.url&&t.url.params||new r.ParamSet;return l(t.params||{},function(t,n){e[n]||(e[n]=new r.Param(n,null,t,"config"))}),e},params:function(t){var e=b(t.ownParams,t.ownParams.$$keys());return t.parent&&t.parent.params?c(t.parent.params.$$new(),e):new r.ParamSet},views:function(t){var e={};return l(i(t.views)?t.views:{"":t},function(n,r){r.indexOf("@")<0&&(r+="@"+t.parent.name),n.resolveAs=n.resolveAs||t.resolveAs||"$resolve",e[r]=n}),e},path:function(t){return t.parent?t.parent.path.concat(t):[]},includes:function(t){var e=t.parent?c({},t.parent.includes):{};return e[t.name]=!0,e},$delegates:{}};function E(t,e){if(!t)return n;var r,i=a(t),o=i?t:t.name;if(0===(r=o).indexOf(".")||0===r.indexOf("^")){if(!e)throw new Error("No reference point given for path '"+o+"'");e=E(e);for(var s=o.split("."),u=0,l=s.length,c=e;u<l;u++)if(""!==s[u]||0!==u){if("^"!==s[u])break;if(!c.parent)throw new Error("Path '"+o+"' not valid for state '"+e.name+"'");c=c.parent}else c=e;s=s.slice(u).join("."),o=c.name+(c.name&&s?".":"")+s}var p=$[o];return!p||!i&&(i||p!==t&&p.self!==t)?n:p}function D(e){var n=(e=f(e,{self:e,resolve:e.resolve||{},toString:function(){return this.name}})).name;if(!a(n)||n.indexOf("@")>=0)throw new Error("State must have a valid name");if($.hasOwnProperty(n))throw new Error("State '"+n+"' is already defined");var r,i,u=-1!==n.indexOf(".")?n.substring(0,n.lastIndexOf(".")):a(e.parent)?e.parent:s(e.parent)&&a(e.parent.name)?e.parent.name:"";if(u&&!$[u])return r=u,i=e.self,x[r]||(x[r]=[]),void x[r].push(i);for(var l in S)o(S[l])&&(e[l]=S[l](e,S.$delegates[l]));return $[n]=e,!e[T]&&e.url&&t.when(e.url,["$match","$stateParams",function(t,n){w.$current.navigable==e&&function(t,e,n){if(!n)for(var r in n=[],t)n.push(r);for(var i=0;i<n.length;i++){var o=n[i];if(t[o]!=e[o])return!1}return!0}(t,n)||w.transitionTo(e,t,{inherit:!0,location:!1})}]),function(t){for(var e=x[t]||[];e.length;)D(e.shift())}(n),e}function A(t,d,x,S,D,A,B,I,O){var M=new Error("transition superseded"),P=C(d.reject(M)),_=C(d.reject(new Error("transition prevented"))),R=C(d.reject(new Error("transition aborted"))),L=C(d.reject(new Error("transition failed")));function N(t,n,r,i,a,s){var c=r?n:y(t.params.$$keys(),n),p={$stateParams:c};a.resolve=D.resolve(t.resolve,p,a.resolve,t);var f=[a.resolve.then(function(t){a.globals=t})];return i&&f.push(i),d.all(f).then(function(){var n=[];return l(t.views,function(r,i){var l=r.resolve&&r.resolve!==t.resolve?r.resolve:{};l.$template=[function(){return x.load(i,{view:r,locals:a.globals,params:c,notify:s.notify})||""}],n.push(D.resolve(l,a.globals,a.resolve,t).then(function(n){if(o(r.controllerProvider)||u(r.controllerProvider)){var s=e.extend({},l,a.globals);n.$$controller=S.invoke(r.controllerProvider,null,s)}else n.$$controller=r.controller;n.$$state=t,n.$$controllerAs=r.controllerAs,n.$$resolveAs=r.resolveAs,a[i]=n}))}),d.all(n).then(function(){return a.globals})}).then(function(t){return a})}return h.locals={resolve:null,globals:{$stateParams:{}}},(w={params:{},current:h.self,$current:h,transition:null}).reload=function(t){return w.transitionTo(w.current,A,{reload:t||!0,inherit:!1,notify:!0})},w.go=function(t,e,n){return w.transitionTo(t,e,c({inherit:!0,relative:w.$current},n))},w.transitionTo=function(e,n,o){n=n||{},o=c({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},o||{});var u=w.$current,l=w.params,g=u.path,m=E(e,o.relative),$=n["#"];if(!i(m)){var k={to:e,toParams:n,options:o},x=function(e,n,r,i){var o=t.$broadcast("$stateNotFound",e,n,r);if(o.defaultPrevented)return B.update(),R;if(!o.retry)return null;if(i.$retry)return B.update(),L;var a=w.transition=d.when(o.retry);return a.then(function(){return a!==w.transition?(t.$broadcast("$stateChangeCancel",e.to,e.toParams,n,r),P):(e.options.$retry=!0,w.transitionTo(e.to,e.toParams,e.options))},function(){return R}),B.update(),a}(k,u.self,l,o);if(x)return x;if(n=k.toParams,m=E(e=k.to,(o=k.options).relative),!i(m)){if(!o.relative)throw new Error("No such state '"+e+"'");throw new Error("Could not resolve '"+e+"' from state '"+o.relative+"'")}}if(m[T])throw new Error("Cannot transition to abstract state '"+e+"'");if(o.inherit&&(n=v(A,n||{},w.$current,m)),!m.params.$$validates(n))return L;n=m.params.$$values(n);var D=(e=m).path,I=0,O=D[I],U=h.locals,j=[];if(o.reload){if(a(o.reload)||s(o.reload)){if(s(o.reload)&&!o.reload.name)throw new Error("Invalid reload state object");var q=!0===o.reload?g[0]:E(o.reload);if(o.reload&&!q)throw new Error("No such reload state '"+(a(o.reload)?o.reload:o.reload.name)+"'");for(;O&&O===g[I]&&O!==q;)U=j[I]=O.locals,O=D[++I]}}else for(;O&&O===g[I]&&O.ownParams.$$equals(n,l);)U=j[I]=O.locals,O=D[++I];if(function(t,e,n,i,o,a){if(!a.reload&&t===n&&(o===n.locals||!1===t.self.reloadOnSearch&&function(t,e,n){var i=t.params.$$keys().filter(function(e){return"search"!=t.params[e].location}),o=b.apply({},[t.params].concat(i));return new r.ParamSet(o).$$equals(e,n)}(n,i,e)))return!0}(e,n,u,l,U,o))return $&&(n["#"]=$),w.params=n,p(w.params,A),p(y(e.params.$$keys(),A),e.locals.globals.$stateParams),o.location&&e.navigable&&e.navigable.url&&(B.push(e.navigable.url,n,{$$avoidResync:!0,replace:"replace"===o.location}),B.update(!0)),w.transition=null,d.when(w.current);if(n=y(e.params.$$keys(),n||{}),$&&(n["#"]=$),o.notify&&t.$broadcast("$stateChangeStart",e.self,n,u.self,l,o).defaultPrevented)return t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),null==w.transition&&B.update(),_;for(var F=d.when(U),V=I;V<D.length;O=D[++V])U=j[V]=f(U),F=N(O,n,O===e,F,U,o);var z=w.transition=F.then(function(){var r,i,a;if(w.transition!==z)return t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),P;for(r=g.length-1;r>=I;r--)(a=g[r]).self.onExit&&S.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(r=I;r<D.length;r++)(i=D[r]).locals=j[r],i.self.onEnter&&S.invoke(i.self.onEnter,i.self,i.locals.globals);return w.transition!==z?(t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),P):(w.$current=e,w.current=e.self,w.params=n,p(w.params,A),w.transition=null,o.location&&e.navigable&&B.push(e.navigable.url,e.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===o.location}),o.notify&&t.$broadcast("$stateChangeSuccess",e.self,n,u.self,l),B.update(!0),w.current)}).then(null,function(r){return r===M?P:w.transition!==z?(t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),P):(w.transition=null,t.$broadcast("$stateChangeError",e.self,n,u.self,l,r).defaultPrevented||B.update(),d.reject(r))});return C(z),z},w.is=function(t,e,r){var o=E(t,(r=c({relative:w.$current},r||{})).relative);return i(o)?w.$current===o&&(!e||g(e).reduce(function(t,n){var r=o.params[n];return t&&!r||r.type.equals(A[n],e[n])},!0)):n},w.includes=function(t,e,r){if(r=c({relative:w.$current},r||{}),a(t)&&t.indexOf("*")>-1){if(!function(t){for(var e=t.split("."),n=w.$current.name.split("."),r=0,i=e.length;r<i;r++)"*"===e[r]&&(n[r]="*");return"**"===e[0]&&(n=n.slice(m(n,e[1]))).unshift("**"),"**"===e[e.length-1]&&(n.splice(m(n,e[e.length-2])+1,Number.MAX_VALUE),n.push("**")),e.length==n.length&&n.join("")===e.join("")}(t))return!1;t=w.$current.name}var o=E(t,r.relative);if(!i(o))return n;if(!i(w.$current.includes[o.name]))return!1;if(!e)return!0;for(var s=g(e),u=0;u<s.length;u++){var l=s[u],p=o.params[l];if(p&&!p.type.equals(A[l],e[l]))return!1}return g(e).reduce(function(t,n){var r=o.params[n];return t&&!r||r.type.equals(A[n],e[n])},!0)},w.href=function(t,e,r){var o=E(t,(r=c({lossy:!0,inherit:!0,absolute:!1,relative:w.$current},r||{})).relative);if(!i(o))return null;r.inherit&&(e=v(A,e||{},w.$current,o));var a=o&&r.lossy?o.navigable:o;return a&&a.url!==n&&null!==a.url?B.href(a.url,y(o.params.$$keys().concat("#"),e||{}),{absolute:r.absolute}):null},w.get=function(t,e){if(0===arguments.length)return k(g($),function(t){return $[t].self});var n=E(t,e||w.$current);return n&&n.self?n.self:null},w}(h=D({name:"",url:"^",views:null,abstract:!0})).navigable=null,this.decorator=function(t,e){if(a(t)&&!i(e))return S[t];if(!o(e)||!a(t))return this;S[t]&&!S.$delegates[t]&&(S.$delegates[t]=S[t]);return S[t]=e,this},this.state=function(t,e){s(t)?e=t:e.name=t;return D(e),this},this.$get=A,A.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function A(){function t(t,e){return{load:function(t,n){var r;return(n=c({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},n)).view&&(r=e.fromConfig(n.view,n.params,n.locals)),r}}}this.$get=t,t.$inject=["$rootScope","$templateFactory"]}function B(t,n,r,i,o){var a=n.has?function(t){return n.has(t)?n.get(t):null}:function(t){try{return n.get(t)}catch(t){return null}},s=a("$animator"),u=a("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(n,a,l){return function(n,a,c){var p,d,f,h,g=c.onload||"",m=c.autoscroll,v=function(t,n){if(u)return{enter:function(t,n,r){e.version.minor>2?u.enter(t,null,n).then(r):u.enter(t,null,n,r)},leave:function(t,n){e.version.minor>2?u.leave(t).then(n):u.leave(t,n)}};if(s){var r=s&&s(n,t);return{enter:function(t,e,n){r.enter(t,null,e),n()},leave:function(t,e){r.leave(t),e()}}}return{enter:function(t,e,n){e.after(t),n()},leave:function(t,e){t.remove(),e()}}}(c,n);a.inheritedData("$uiView");function y(s){var u,y=O(n,c,a,i),b=y&&t.$current&&t.$current.locals[y];if(s||b!==h){u=n.$new(),h=t.$current.locals[y],u.$emit("$viewContentLoading",y);var w=l(u,function(t){var i=o.defer(),s=o.defer(),u={$animEnter:i.promise,$animLeave:s.promise,$$animLeave:s};t.data("$uiViewAnim",u),v.enter(t,a,function(){i.resolve(),f&&f.$emit("$viewContentAnimationEnded"),(e.isDefined(m)&&!m||n.$eval(m))&&r(t)}),function(){if(p&&(p.remove(),p=null),f&&(f.$destroy(),f=null),d){var t=d.data("$uiViewAnim");v.leave(d,function(){t.$$animLeave.resolve(),p=null}),p=d,d=null}}()});d=w,(f=u).$emit("$viewContentLoaded",y),f.$eval(g)}}n.$on("$stateChangeSuccess",function(){y(!1)}),y(!0)}}}}function I(t,n,r,i){return{restrict:"ECA",priority:-400,compile:function(a){var s=a.html();return a.empty?a.empty():a[0].innerHTML=null,function(a,u,l){var c=r.$current,p=O(a,l,u,i),d=c&&c.locals[p];if(!d)return u.html(s),void t(u.contents())(a);u.data("$uiView",{name:p,state:d.$$state}),u.html(d.$template?d.$template:s);var f=e.extend({},d);a[d.$$resolveAs]=f;var h=t(u.contents());if(d.$$controller){d.$scope=a,d.$element=u;var g=n(d.$$controller,d);d.$$controllerAs&&(a[d.$$controllerAs]=g,a[d.$$controllerAs][d.$$resolveAs]=f),o(g.$onInit)&&g.$onInit(),u.data("$ngControllerController",g),u.children().data("$ngControllerController",g)}h(a)}}}}function O(t,e,n,r){var i=r(e.uiView||e.name||"")(t),o=n.inheritedData("$uiView");return i.indexOf("@")>=0?i:i+"@"+(o?o.state.name:"")}function M(t,e){var n,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t=e+"("+r[1]+")"),!(n=t.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==n.length)throw new Error("Invalid state ref '"+t+"'");return{state:n[1],paramExpr:n[3]||null}}function P(t){var e=t.parent().inheritedData("$uiView");if(e&&e.state&&e.state.name)return e.state}function _(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),n="FORM"===t[0].nodeName;return{attr:n?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!n}}function R(t,e,n,r,i){return function(o){var a=o.which||o.button,s=i();if(!(a>1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var u=n(function(){e.go(s.state,s.params,s.options)});o.preventDefault();var l=r.isAnchor&&!s.href?1:0;o.preventDefault=function(){l--<=0&&n.cancel(u)}}}}function L(t,n){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(r,i,o,a){var s,u,l=M(o.uiSref,t.current.name),p={state:l.state,href:null,params:null},d=_(i),f=a[1]||a[0],h=null;p.options=c((u=t,{relative:P(i)||u.$current,inherit:!0}),o.uiSrefOpts?r.$eval(o.uiSrefOpts):{});var g=function(n){n&&(p.params=e.copy(n)),p.href=t.href(l.state,p.params,p.options),h&&h(),f&&(h=f.$$addStateInfo(l.state,p.params)),null!==p.href&&o.$set(d.attr,p.href)};l.paramExpr&&(r.$watch(l.paramExpr,function(t){t!==p.params&&g(t)},!0),p.params=e.copy(r.$eval(l.paramExpr))),g(),d.clickable&&(s=R(i,t,n,d,function(){return p}),i[i.on?"on":"bind"]("click",s),r.$on("$destroy",function(){i[i.off?"off":"unbind"]("click",s)}))}}}function N(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,r,i,o){var a,s=_(r),u=o[1]||o[0],l="["+[i.uiState,i.uiStateParams||null,i.uiStateOpts||null].map(function(t){return t||"null"}).join(", ")+"]",c={state:null,params:null,options:null,href:null},p=null;function d(e){c.state=e[0],c.params=e[1],c.options=e[2],c.href=t.href(c.state,c.params,c.options),p&&p(),u&&(p=u.$$addStateInfo(c.state,c.params)),c.href&&i.$set(s.attr,c.href)}n.$watch(l,d,!0),d(n.$eval(l)),s.clickable&&(a=R(r,t,e,s,function(){return c}),r[r.on?"on":"bind"]("click",a),n.$on("$destroy",function(){r[r.off?"off":"unbind"]("click",a)}))}}}function U(t,e,n){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(e,r,i,o){var u,c,p=[],f={};u=n(i.uiSrefActiveEq||"",!1)(e);try{c=e.$eval(i.uiSrefActive)}catch(t){}function h(n,i,o){var u=t.get(n,P(r)),l=function(t,n){if(!a(t))throw new Error("state should be a string");if(s(n))return t+d(n);if(n=e.$eval(n),s(n))return t+d(n);return t}(n,i),c={state:u||{name:n},params:i,hash:l};return p.push(c),f[l]=o,function(){var t=p.indexOf(c);-1!==t&&p.splice(t,1)}}function g(){for(var e=0;e<p.length;e++)o=p[e].state,a=p[e].params,t.includes(o.name,a)?m(r,f[p[e].hash]):v(r,f[p[e].hash]),n=p[e].state,i=p[e].params,t.is(n.name,i)?m(r,u):v(r,u);var n,i,o,a}function m(t,e){o(function(){t.addClass(e)})}function v(t,e){t.removeClass(e)}c=c||n(i.uiSrefActive||"",!1)(e),s(c)&&l(c,function(n,r){if(a(n)){var i=M(n,t.current.name);h(i.state,e.$eval(i.paramExpr),r)}}),this.$$addStateInfo=function(t,e){if(!(s(c)&&p.length>0)){var n=h(t,e,c);return g(),n}},e.$on("$stateChangeSuccess",g),g()}]}}function j(t){var e=function(e,n){return t.is(e,n)};return e.$stateful=!0,e}function q(t){var e=function(e,n,r){return t.includes(e,n,r)};return e.$stateful=!0,e}e.module("ui.router.util",["ng"]),e.module("ui.router.router",["ui.router.util"]),e.module("ui.router.state",["ui.router.router","ui.router.util"]),e.module("ui.router",["ui.router.state"]),e.module("ui.router.compat",["ui.router"]),x.$inject=["$q","$injector"],e.module("ui.router.util").service("$resolve",x),e.module("ui.router.util").provider("$templateFactory",function(){var t=e.version.minor<3;this.shouldUnsafelyUseHttp=function(e){t=!!e},this.$get=["$http","$templateCache","$injector",function(e,n,r){return new function(t,e,n,r){this.fromConfig=function(t,e,n){return i(t.template)?this.fromString(t.template,e):i(t.templateUrl)?this.fromUrl(t.templateUrl,e):i(t.templateProvider)?this.fromProvider(t.templateProvider,e,n):null},this.fromString=function(t,e){return o(t)?t(e):t},this.fromUrl=function(i,a){return o(i)&&(i=i(a)),null==i?null:r?t.get(i,{cache:e,headers:{Accept:"text/html"}}).then(function(t){return t.data}):n.get("$templateRequest")(i)},this.fromProvider=function(t,e,r){return n.invoke(t,null,r||{params:e})}}(e,n,r,t)}]}),T.prototype.concat=function(t,e){var n={caseInsensitive:r.caseInsensitive(),strict:r.strictMode(),squash:r.defaultSquashPolicy()};return new T(this.sourcePath+t+this.sourceSearch,c(n,e),this)},T.prototype.toString=function(){return this.source},T.prototype.exec=function(t,e){var n=this.regexp.exec(t);if(!n)return null;e=e||{};var r,o,a,s,u,l=this.parameters(),c=l.length,p=this.segments.length-1,d={};if(p!==n.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");function f(t){function e(t){return t.split("").reverse().join("")}return k(k(e(t).split(/-(?!\\)/),e),function(t){return t.replace(/\\-/g,"-")}).reverse()}for(r=0;r<p;r++){for(a=l[r],s=this.params[a],u=n[r+1],o=0;o<s.replace.length;o++)s.replace[o].from===u&&(u=s.replace[o].to);u&&!0===s.array&&(u=f(u)),i(u)&&(u=s.type.decode(u)),d[a]=s.value(u)}for(;r<c;r++){for(d[a=l[r]]=this.params[a].value(e[a]),s=this.params[a],u=e[a],o=0;o<s.replace.length;o++)s.replace[o].from===u&&(u=s.replace[o].to);i(u)&&(u=s.type.decode(u)),d[a]=s.value(u)}return d},T.prototype.parameters=function(t){return i(t)?this.params[t]||null:this.$$paramNames},T.prototype.validates=function(t){return this.params.$$validates(t)},T.prototype.format=function(t){t=t||{};var e=this.segments,n=this.parameters(),r=this.params;if(!this.validates(t))return null;var i,o=!1,s=e.length-1,l=n.length,c=e[0];function p(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})}for(i=0;i<l;i++){var d=i<s,f=n[i],h=r[f],g=h.value(t[f]),m=h.isOptional&&h.type.equals(h.value(),g),v=!!m&&h.squash,y=h.type.encode(g);if(d){var b=e[i+1],w=i+1===s;if(!1===v)null!=y&&(u(y)?c+=k(y,p).join("-"):c+=encodeURIComponent(y)),c+=b;else if(!0===v){var $=c.match(/\/$/)?/\/?(.*)/:/(.*)/;c+=b.match($)[1]}else a(v)&&(c+=v+b);w&&!0===h.squash&&"/"===c.slice(-1)&&(c=c.slice(0,-1))}else{if(null==y||m&&!1!==v)continue;if(u(y)||(y=[y]),0===y.length)continue;c+=(o?"&":"?")+f+"="+(y=k(y,encodeURIComponent).join("&"+f+"=")),o=!0}}return c},S.prototype.is=function(t,e){return!0},S.prototype.encode=function(t,e){return t},S.prototype.decode=function(t,e){return t},S.prototype.equals=function(t,e){return t==e},S.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},S.prototype.pattern=/.*/,S.prototype.toString=function(){return"{Type:"+this.name+"}"},S.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},S.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new function(t,e){function r(t,e){return function(){return t[e].apply(t,arguments)}}function o(t){return u(t)?t:i(t)?[t]:[]}function a(t){return!t}function s(t,r){return function(i){if(u(i)&&0===i.length)return i;var s=k(i=o(i),t);return!0===r?0===$(s,a).length:function(t){switch(t.length){case 0:return n;case 1:return"auto"===e?t[0]:t;default:return t}}(s)}}var l;this.encode=s(r(t,"encode")),this.decode=s(r(t,"decode")),this.is=s(r(t,"is"),!0),this.equals=(l=r(t,"equals"),function(t,e){var n=o(t),r=o(e);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!l(n[i],r[i]))return!1;return!0}),this.pattern=t.pattern,this.$normalize=s(r(t,"$normalize")),this.name=t.name,this.$arrayMode=e}(this,t)},e.module("ui.router.util").provider("$urlMatcherFactory",function t(){r=this;var p=!1,d=!0,h=!1;function v(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t}var y,b={},w=!0,C=[],x={string:{encode:v,decode:function(t){return null!=t?t.toString().replace(/(~~|~2F)/g,function(t){return{"~~":"~","~2F":"/"}[t]}):t},is:function(t){return null==t||!i(t)||"string"==typeof t},pattern:/[^/]*/},int:{encode:v,decode:function(t){return parseInt(t,10)},is:function(t){return t!==n&&null!==t&&this.decode(t.toString())===t},pattern:/\d+/},bool:{encode:function(t){return t?1:0},decode:function(t){return 0!==parseInt(t,10)},is:function(t){return!0===t||!1===t},pattern:/0|1/},date:{encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):n},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):n},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return this.is(t)&&this.is(e)&&t.toISOString()===e.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:e.toJson,decode:e.fromJson,is:e.isObject,equals:e.equals,pattern:/[^/]*/},any:{encode:e.identity,decode:e.identity,equals:e.equals,pattern:/.*/}};function E(t){return o(t)||u(t)&&o(t[t.length-1])}function D(){for(;C.length;){var t=C.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");e.extend(b[t.name],y.invoke(t.def))}}function A(t){c(this,t||{})}t.$$getDefaultValue=function(t){if(!E(t.value))return t.value;if(!y)throw new Error("Injectable functions cannot be called at configuration time");return y.invoke(t.value)},this.caseInsensitive=function(t){return i(t)&&(p=t),p},this.strictMode=function(t){return i(t)&&(d=t),d},this.defaultSquashPolicy=function(t){if(!i(t))return h;if(!0!==t&&!1!==t&&!a(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return h=t,t},this.compile=function(t,e){return new T(t,c({strict:d,caseInsensitive:p},e))},this.isMatcher=function(t){if(!s(t))return!1;var e=!0;return l(T.prototype,function(n,r){o(n)&&(e=e&&i(t[r])&&o(t[r]))}),e},this.type=function(t,e,n){if(!i(e))return b[t];if(b.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return b[t]=new S(c({name:t},e)),n&&(C.push({name:t,def:n}),w||D()),this},l(x,function(t,e){b[e]=new S(c({name:e},t))}),b=f(b,{}),this.$get=["$injector",function(t){return y=t,w=!1,D(),l(x,function(t,e){b[e]||(b[e]=new S(t))}),this}],this.Param=function(t,r,o,l){var p,d,f=this;-1===m(d=s(p=o)?g(p):[],"value")&&-1===m(d,"type")&&-1===m(d,"squash")&&-1===m(d,"array")&&(p={value:p}),p.$$fn=E(p.value)?p.value:function(){return p.value},r=function(n,r,i){if(n.type&&r)throw new Error("Param '"+t+"' has two type configurations.");return r||(n.type?e.isString(n.type)?b[n.type]:n.type instanceof S?n.type:new S(n.type):"config"===i?b.any:b.string)}(o=p,r,l);var v,w,C=(v={array:"search"===l&&"auto"},w=t.match(/\[\]$/)?{array:!0}:{},c(v,w,o).array);"string"!==(r=C?r.$asArray(C,"search"===l):r).name||C||"path"!==l||o.value!==n||(o.value="");var x,T,D,A,B,I,O,M=o.value!==n,P=function(t,e){var n=t.squash;if(!e||!1===n)return!1;if(!i(n)||null==n)return h;if(!0===n||a(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}(o,M),_=(T=C,A=P,O=[{from:"",to:(D=M)||T?n:""},{from:null,to:D||T?n:""}],B=u((x=o).replace)?x.replace:[],a(A)&&B.push({from:A,to:n}),I=k(B,function(t){return t.from}),$(O,function(t){return-1===m(I,t.from)}).concat(B));c(this,{id:t,type:r,location:l,array:C,squash:P,replace:_,isOptional:M,value:function(t){var e,r,a;return e=t,t=(a=k($(f.replace,(r=e,function(t){return t.from===r})),function(t){return t.to})).length?a[0]:e,i(t)?f.type.$normalize(t):function(){if(!y)throw new Error("Injectable functions cannot be called at configuration time");var t=y.invoke(o.$$fn);if(null!==t&&t!==n&&!f.type.is(t))throw new Error("Default value ("+t+") for parameter '"+f.id+"' is not an instance of Type ("+f.type.name+")");return t}()},dynamic:n,config:o,toString:function(){return"{Param:"+t+" "+r+" squash: '"+P+"' optional: "+M+"}"}})},A.prototype={$$new:function(){return f(this,c(new A,{$$parent:this}))},$$keys:function(){for(var t=[],e=[],n=this,r=g(A.prototype);n;)e.push(n),n=n.$$parent;return e.reverse(),l(e,function(e){l(g(e),function(e){-1===m(t,e)&&-1===m(r,e)&&t.push(e)})}),t},$$values:function(t){var e={},n=this;return l(n.$$keys(),function(r){e[r]=n[r].value(t&&t[r])}),e},$$equals:function(t,e){var n=!0,r=this;return l(r.$$keys(),function(i){var o=t&&t[i],a=e&&e[i];r[i].type.equals(o,a)||(n=!1)}),n},$$validates:function(t){var r,i,o,a,s,u=this.$$keys();for(r=0;r<u.length&&(i=this[u[r]],(o=t[u[r]])!==n&&null!==o||!i.isOptional);r++){if(a=i.type.$normalize(o),!i.type.is(a))return!1;if(s=i.type.encode(a),e.isString(s)&&!i.type.pattern.exec(s))return!1}return!0},$$parent:n},this.ParamSet=A}),e.module("ui.router.util").run(["$urlMatcherFactory",function(t){}]),E.$inject=["$locationProvider","$urlMatcherFactoryProvider"],e.module("ui.router.router").provider("$urlRouter",E),D.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],e.module("ui.router.state").factory("$stateParams",function(){return{}}).constant("$state.runtime",{autoinject:!0}).provider("$state",D).run(["$injector",function(t){t.get("$state.runtime").autoinject&&t.get("$state")}]),A.$inject=[],e.module("ui.router.state").provider("$view",A),e.module("ui.router.state").provider("$uiViewScroll",function(){var t=!1;this.useAnchorScroll=function(){t=!0},this.$get=["$anchorScroll","$timeout",function(e,n){return t?e:function(t){return n(function(){t[0].scrollIntoView()},0,!1)}}]}),B.$inject=["$state","$injector","$uiViewScroll","$interpolate","$q"],I.$inject=["$compile","$controller","$state","$interpolate"],e.module("ui.router.state").directive("uiView",B),e.module("ui.router.state").directive("uiView",I),L.$inject=["$state","$timeout"],N.$inject=["$state","$timeout"],U.$inject=["$state","$stateParams","$interpolate"],e.module("ui.router.state").directive("uiSref",L).directive("uiSrefActive",U).directive("uiSrefActiveEq",U).directive("uiState",N),j.$inject=["$state"],q.$inject=["$state"],e.module("ui.router.state").filter("isState",j).filter("includedByState",q)}(window,window.angular),angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.tabindex","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.multiMap","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(t,e,n,r){var i=r.has("$animateCss")?r.get("$animateCss"):null;return{link:function(r,o,a){var s=n(a.expanding),u=n(a.expanded),l=n(a.collapsing),c=n(a.collapsed),p=!1,d={},f={};function h(t){return p?{width:t.scrollWidth+"px"}:{height:t.scrollHeight+"px"}}function g(){o.removeClass("collapsing").addClass("collapse").css(d),u(r)}function m(){o.css(f),o.removeClass("collapsing").addClass("collapse"),c(r)}!function(){(p=!!("horizontal"in a))?(d={width:""},f={width:"0"}):(d={height:""},f={height:"0"});r.$eval(a.uibCollapse)||o.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css(d)}(),r.$watch(a.uibCollapse,function(n){n?function(){if(!o.hasClass("collapse")&&!o.hasClass("in"))return m();e.resolve(l(r)).then(function(){o.css(h(o[0])).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),i?i(o,{removeClass:"in",to:f}).start().finally(m):t.removeClass(o,"in",{to:f}).then(m)},angular.noop)}():o.hasClass("collapse")&&o.hasClass("in")||e.resolve(s(r)).then(function(){o.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),i?i(o,{addClass:"in",easing:"ease",css:{overflow:"hidden"},to:h(o[0])}).start().finally(g):t.addClass(o,"in",{css:{overflow:"hidden"},to:h(o[0])}).then(g)},angular.noop)})}}}]),angular.module("ui.bootstrap.tabindex",[]).directive("uibTabindexToggle",function(){return{restrict:"A",link:function(t,e,n){n.$observe("disabled",function(t){n.$set("tabindex",t?-1:null)})}}}),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse","ui.bootstrap.tabindex"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(t,e,n){this.groups=[],this.closeOthers=function(r){(angular.isDefined(e.closeOthers)?t.$eval(e.closeOthers):n.closeOthers)&&angular.forEach(this.groups,function(t){t!==r&&(t.isOpen=!1)})},this.addGroup=function(t){var e=this;this.groups.push(t),t.$on("$destroy",function(n){e.removeGroup(t)})},this.removeGroup=function(t){var e=this.groups.indexOf(t);-1!==e&&this.groups.splice(e,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,restrict:"A",templateUrl:function(t,e){return e.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(t){this.heading=t}},link:function(t,e,n,r){e.addClass("panel"),r.addGroup(t),t.openClass=n.openClass||"panel-open",t.panelClass=n.panelClass||"panel-default",t.$watch("isOpen",function(n){e.toggleClass(t.openClass,!!n),n&&r.closeOthers(t)}),t.toggleOpen=function(e){t.isDisabled||e&&32!==e.which||(t.isOpen=!t.isOpen)};var i="accordiongroup-"+t.$id+"-"+Math.floor(1e4*Math.random());t.headingId=i+"-tab",t.panelId=i+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(t,e,n,r,i){r.setHeading(i(t,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:"^uibAccordionGroup",link:function(t,e,n,r){t.$watch(function(){return r[n.uibAccordionTransclude]},function(t){if(t){var n=angular.element(e[0].querySelector("uib-accordion-header,data-uib-accordion-header,x-uib-accordion-header,uib\\:accordion-header,[uib-accordion-header],[data-uib-accordion-header],[x-uib-accordion-header]"));n.html(""),n.append(t)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$element","$attrs","$interpolate","$timeout",function(t,e,n,r,i){t.closeable=!!n.close,e.addClass("alert"),n.$set("role","alert"),t.closeable&&e.addClass("alert-dismissible");var o=angular.isDefined(n.dismissOnTimeout)?r(n.dismissOnTimeout)(t.$parent):null;o&&i(function(){t.close()},parseInt(o,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",restrict:"A",templateUrl:function(t,e){return e.templateUrl||"uib/template/alert/alert.html"},transclude:!0,scope:{close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(t){this.activeClass=t.activeClass||"active",this.toggleEvent=t.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(t){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(e,n,r,i){var o=i[0],a=i[1],s=t(r.uibUncheckable);n.find("input").css({display:"none"}),a.$render=function(){n.toggleClass(o.activeClass,angular.equals(a.$modelValue,e.$eval(r.uibBtnRadio)))},n.on(o.toggleEvent,function(){if(!r.disabled){var t=n.hasClass(o.activeClass);t&&!angular.isDefined(r.uncheckable)||e.$apply(function(){a.$setViewValue(t?null:e.$eval(r.uibBtnRadio)),a.$render()})}}),r.uibUncheckable&&e.$watch(s,function(t){r.$set("uncheckable",t?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(t,e,n,r){var i=r[0],o=r[1];function a(){return s(n.btnCheckboxTrue,!0)}function s(e,n){return angular.isDefined(e)?t.$eval(e):n}e.find("input").css({display:"none"}),o.$render=function(){e.toggleClass(i.activeClass,angular.equals(o.$modelValue,a()))},e.on(i.toggleEvent,function(){n.disabled||t.$apply(function(){o.$setViewValue(e.hasClass(i.activeClass)?s(n.btnCheckboxFalse,!1):a()),o.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(t,e,n,r,i){var o,a,s=this,u=s.slides=t.slides=[],l="uib-slideDirection",c=t.active,p=!1;function d(t){for(var e=0;e<u.length;e++)u[e].slide.active=e===t}function f(t){for(var e=0;e<u.length;e++)if(u[e].slide===t)return e}function h(){o&&(n.cancel(o),o=null)}function g(){h();var e=+t.interval;!isNaN(e)&&e>0&&(o=n(m,e))}function m(){var e=+t.interval;a&&!isNaN(e)&&e>0&&u.length?t.next():t.pause()}e.addClass("carousel"),s.addSlide=function(e,n){u.push({slide:e,element:n}),u.sort(function(t,e){return+t.slide.index-+e.slide.index}),(e.index===t.active||1===u.length&&!angular.isNumber(t.active))&&(t.$currentTransition&&(t.$currentTransition=null),c=e.index,t.active=e.index,d(c),s.select(u[f(e)]),1===u.length&&t.play())},s.getCurrentIndex=function(){for(var t=0;t<u.length;t++)if(u[t].slide.index===c)return t},s.next=t.next=function(){var e=(s.getCurrentIndex()+1)%u.length;if(0!==e||!t.noWrap())return s.select(u[e],"next");t.pause()},s.prev=t.prev=function(){var e=s.getCurrentIndex()-1<0?u.length-1:s.getCurrentIndex()-1;if(!t.noWrap()||e!==u.length-1)return s.select(u[e],"prev");t.pause()},s.removeSlide=function(e){var n=f(e);u.splice(n,1),u.length>0&&c===n?n>=u.length?(c=u.length-1,t.active=c,d(c),s.select(u[u.length-1])):(c=n,t.active=c,d(c),s.select(u[n])):c>n&&(c--,t.active=c),0===u.length&&(c=null,t.active=null)},s.select=t.select=function(n,r){var o=f(n.slide);void 0===r&&(r=o>s.getCurrentIndex()?"next":"prev"),n.slide.index===c||t.$currentTransition||function(n,r,o){if(p)return;if(angular.extend(n,{direction:o}),angular.extend(u[c].slide||{},{direction:o}),i.enabled(e)&&!t.$currentTransition&&u[r].element&&s.slides.length>1){u[r].element.data(l,n.direction);var a=s.getCurrentIndex();angular.isNumber(a)&&u[a].element&&u[a].element.data(l,n.direction),t.$currentTransition=!0,i.on("addClass",u[r].element,function(e,n){"close"===n&&(t.$currentTransition=null,i.off("addClass",e))})}t.active=n.index,c=n.index,d(r),g()}(n.slide,o,r)},t.indexOfSlide=function(t){return+t.slide.index},t.isActive=function(e){return t.active===e.slide.index},t.isPrevDisabled=function(){return 0===t.active&&t.noWrap()},t.isNextDisabled=function(){return t.active===u.length-1&&t.noWrap()},t.pause=function(){t.noPause||(a=!1,h())},t.play=function(){a||(a=!0,g())},e.on("mouseenter",t.pause),e.on("mouseleave",t.play),t.$on("$destroy",function(){p=!0,h()}),t.$watch("noTransition",function(t){i.enabled(e,!t)}),t.$watch("interval",g),t.$watchCollection("slides",function(e){e.length||(t.$currentTransition=null)}),t.$watch("active",function(t){if(angular.isNumber(t)&&c!==t){for(var e=0;e<u.length;e++)if(u[e].slide.index===t){t=e;break}u[t]&&(d(t),s.select(u[t]),c=t)}})}]).directive("uibCarousel",function(){return{transclude:!0,controller:"UibCarouselController",controllerAs:"carousel",restrict:"A",templateUrl:function(t,e){return e.templateUrl||"uib/template/carousel/carousel.html"},scope:{active:"=",interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}).directive("uibSlide",["$animate",function(t){return{require:"^uibCarousel",restrict:"A",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/carousel/slide.html"},scope:{actual:"=?",index:"=?"},link:function(e,n,r,i){n.addClass("item"),i.addSlide(e,n),e.$on("$destroy",function(){i.removeSlide(e)}),e.$watch("active",function(e){t[e?"addClass":"removeClass"](n,"active")})}}}]).animation(".item",["$animateCss",function(t){var e="uib-slideDirection";function n(t,e,n){t.removeClass(e),n&&n()}return{beforeAddClass:function(r,i,o){if("active"===i){var a=r.data(e),s="next"===a?"left":"right",u=n.bind(this,r,s+" "+a,o);return r.addClass(a),t(r,{addClass:s}).start().done(u),function(){!0}}o()},beforeRemoveClass:function(r,i,o){if("active"===i){var a="next"===r.data(e)?"left":"right",s=n.bind(this,r,a,o);return t(r,{addClass:a}).start().done(s),function(){!0}}o()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","dateFilter","orderByFilter","filterFilter",function(t,e,n,r,i){var o,a,s=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;function u(t){return i(a,{key:t},!0)[0]}function l(t,e,n){return function(){return t.substr(e+1,n-e-1)}}function c(t,e){for(var n=t.substr(e),r=0;r<a.length;r++)if(new RegExp("^"+a[r].key).test(n)){var i=a[r];return{endIdx:e+i.key.length,parser:i.formatter}}return{endIdx:e+1,parser:function(){return n.charAt(0)}}}function p(t){return parseInt(t,10)}function d(t,e){t=t.replace(/:/g,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function f(t,e){return(t=new Date(t.getTime())).setMinutes(t.getMinutes()+e),t}function h(t,e,n){n=n?-1:1;var r=t.getTimezoneOffset();return f(t,n*(d(e,r)-r))}this.init=function(){o=e.id,this.parsers={},this.formatters={},a=[{key:"yyyy",regex:"\\d{4}",apply:function(t){this.year=+t},formatter:function(t){var e=new Date;return e.setFullYear(Math.abs(t.getFullYear())),n(e,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(t){t=+t,this.year=t<69?t+2e3:t+1900},formatter:function(t){var e=new Date;return e.setFullYear(Math.abs(t.getFullYear())),n(e,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(t){this.year=+t},formatter:function(t){var e=new Date;return e.setFullYear(Math.abs(t.getFullYear())),n(e,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(t){this.month=t-1},formatter:function(t){var e=t.getMonth();return/^[0-9]$/.test(e)?n(t,"MM"):n(t,"M")}},{key:"MMMM",regex:e.DATETIME_FORMATS.MONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.MONTH.indexOf(t)},formatter:function(t){return n(t,"MMMM")}},{key:"MMM",regex:e.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.SHORTMONTH.indexOf(t)},formatter:function(t){return n(t,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(t){this.month=t-1},formatter:function(t){return n(t,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(t){this.month=t-1},formatter:function(t){return n(t,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t},formatter:function(t){var e=t.getDate();return/^[1-9]$/.test(e)?n(t,"dd"):n(t,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t},formatter:function(t){return n(t,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t},formatter:function(t){return n(t,"d")}},{key:"EEEE",regex:e.DATETIME_FORMATS.DAY.join("|"),formatter:function(t){return n(t,"EEEE")}},{key:"EEE",regex:e.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(t){return n(t,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(t){this.minutes=+t},formatter:function(t){return n(t,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(t){this.minutes=+t},formatter:function(t){return n(t,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(t){this.milliseconds=+t},formatter:function(t){return n(t,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(t){this.seconds=+t},formatter:function(t){return n(t,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(t){this.seconds=+t},formatter:function(t){return n(t,"s")}},{key:"a",regex:e.DATETIME_FORMATS.AMPMS.join("|"),apply:function(t){12===this.hours&&(this.hours=0),"PM"===t&&(this.hours+=12)},formatter:function(t){return n(t,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(t){var e=t.match(/([+-])(\d{2})(\d{2})/),n=e[1],r=e[2],i=e[3];this.hours+=p(n+r),this.minutes+=p(n+i)},formatter:function(t){return n(t,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(t){return n(t,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(t){return n(t,"w")}},{key:"GGGG",regex:e.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(t){return n(t,"GGGG")}},{key:"GGG",regex:e.DATETIME_FORMATS.ERAS.join("|"),formatter:function(t){return n(t,"GGG")}},{key:"GG",regex:e.DATETIME_FORMATS.ERAS.join("|"),formatter:function(t){return n(t,"GG")}},{key:"G",regex:e.DATETIME_FORMATS.ERAS.join("|"),formatter:function(t){return n(t,"G")}}],angular.version.major>=1&&angular.version.minor>4&&a.push({key:"LLLL",regex:e.DATETIME_FORMATS.STANDALONEMONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.STANDALONEMONTH.indexOf(t)},formatter:function(t){return n(t,"LLLL")}})},this.init(),this.getParser=function(t){var e=u(t);return e&&e.apply||null},this.overrideParser=function(t,e){var n=u(t);n&&angular.isFunction(e)&&(this.parsers={},n.apply=e)}.bind(this),this.filter=function(t,n){return angular.isDate(t)&&!isNaN(t)&&n?(n=e.DATETIME_FORMATS[n]||n,e.id!==o&&this.init(),this.formatters[n]||(this.formatters[n]=function(t){for(var e,n,r=[],i=0;i<t.length;)if(angular.isNumber(n)){if("'"===t.charAt(i))(i+1>=t.length||"'"!==t.charAt(i+1))&&(r.push(l(t,n,i)),n=null);else if(i===t.length)for(;n<t.length;)e=c(t,n),r.push(e),n=e.endIdx;i++}else"'"!==t.charAt(i)?(e=c(t,i),r.push(e.parser),i=e.endIdx):(n=i,i++);return r}(n)),this.formatters[n].reduce(function(e,n){return e+n(t)},"")):""},this.parse=function(n,i,u){if(!angular.isString(n)||!i)return n;i=(i=e.DATETIME_FORMATS[i]||i).replace(s,"\\$&"),e.id!==o&&this.init(),this.parsers[i]||(this.parsers[i]=function(t){var e=[],n=t.split(""),i=t.indexOf("'");if(i>-1){var o=!1;t=t.split("");for(var s=i;s<t.length;s++)o?("'"===t[s]&&(s+1<t.length&&"'"===t[s+1]?(t[s+1]="$",n[s+1]=""):(n[s]="",o=!1)),t[s]="$"):"'"===t[s]&&(t[s]="$",n[s]="",o=!0);t=t.join("")}return angular.forEach(a,function(r){var i=t.indexOf(r.key);if(i>-1){t=t.split(""),n[i]="("+r.regex+")",t[i]="$";for(var o=i+1,a=i+r.key.length;o<a;o++)n[o]="",t[o]="$";t=t.join(""),e.push({index:i,key:r.key,apply:r.apply,matcher:r.regex})}}),{regex:new RegExp("^"+n.join("")+"$"),map:r(e,"index")}}(i));var l=this.parsers[i],c=l.regex,p=l.map,d=n.match(c),f=!1;if(d&&d.length){var h,g;angular.isDate(u)&&!isNaN(u.getTime())?h={year:u.getFullYear(),month:u.getMonth(),date:u.getDate(),hours:u.getHours(),minutes:u.getMinutes(),seconds:u.getSeconds(),milliseconds:u.getMilliseconds()}:(u&&t.warn("dateparser:","baseDate is not a valid date"),h={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var m=1,v=d.length;m<v;m++){var y=p[m-1];"Z"===y.matcher&&(f=!0),y.apply&&y.apply.call(h,d[m])}var b=f?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,w=f?Date.prototype.setUTCHours:Date.prototype.setHours;return function(t,e,n){if(n<1)return!1;if(1===e&&n>28)return 29===n&&(t%4==0&&t%100!=0||t%400==0);if(3===e||5===e||8===e||10===e)return n<31;return!0}(h.year,h.month,h.date)&&(!angular.isDate(u)||isNaN(u.getTime())||f?(g=new Date(0),b.call(g,h.year,h.month,h.date),w.call(g,h.hours||0,h.minutes||0,h.seconds||0,h.milliseconds||0)):(g=new Date(u),b.call(g,h.year,h.month,h.date),w.call(g,h.hours,h.minutes,h.seconds,h.milliseconds))),g}},this.toTimezone=function(t,e){return t&&e?h(t,e):t},this.fromTimezone=function(t,e){return t&&e?h(t,e,!0):t},this.timezoneToOffset=d,this.addDateMinutes=f,this.convertTimezoneToLocal=h}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(t){var e=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,n=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(r,i){var o=[],a=[],s={},u=i.uibIsClass.match(e),l=u[2],c=u[1].split(",");return function(e,r,i){o.push(e),a.push({scope:e,element:r}),c.forEach(function(r,i){!function(e,r){var i=e.match(n),o=r.$eval(i[1]),u=i[2],c=s[e];if(!c){var p=function(e){var n=null;a.some(function(t){var r=t.scope.$eval(l);if(r===e)return n=t,!0}),c.lastActivated!==n&&(c.lastActivated&&t.removeClass(c.lastActivated.element,o),n&&t.addClass(n.element,o),c.lastActivated=n)};s[e]=c={lastActivated:null,scope:r,watchFn:p,compareWithExp:u,watcher:r.$watch(u,p)}}c.watchFn(r.$eval(u))}(r,e)}),e.$on("$destroy",p)};function p(t){var e=t.targetScope,n=o.indexOf(e);if(o.splice(n,1),a.splice(n,1),o.length){var r=o[0];angular.forEach(s,function(t){t.scope===e&&(t.watcher=r.$watch(t.compareWithExp,t.watchFn),t.scope=r)})}else s={}}}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",monthColumns:3,ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$element","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(t,e,n,r,i,o,a,s,u,l,c,p){var d=this,f={$setViewValue:angular.noop},h={},g=[];e.addClass("uib-datepicker"),n.$set("role","application"),t.datepickerOptions||(t.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","monthColumns","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(e){switch(e){case"customClass":case"dateDisabled":t[e]=t.datepickerOptions[e]||angular.noop;break;case"datepickerMode":t.datepickerMode=angular.isDefined(t.datepickerOptions.datepickerMode)?t.datepickerOptions.datepickerMode:u.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":d[e]=angular.isDefined(t.datepickerOptions[e])?i(t.datepickerOptions[e])(t.$parent):u[e];break;case"monthColumns":case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":d[e]=angular.isDefined(t.datepickerOptions[e])?t.datepickerOptions[e]:u[e];break;case"startingDay":angular.isDefined(t.datepickerOptions.startingDay)?d.startingDay=t.datepickerOptions.startingDay:angular.isNumber(u.startingDay)?d.startingDay=u.startingDay:d.startingDay=(o.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":t.$watch("datepickerOptions."+e,function(t){t?angular.isDate(t)?d[e]=p.fromTimezone(new Date(t),h.getOption("timezone")):(l&&a.warn("Literal date support has been deprecated, please switch to date object usage"),d[e]=new Date(s(t,"medium"))):d[e]=u[e]?p.fromTimezone(new Date(u[e]),h.getOption("timezone")):null,d.refreshView()});break;case"maxMode":case"minMode":t.datepickerOptions[e]?t.$watch(function(){return t.datepickerOptions[e]},function(n){d[e]=t[e]=angular.isDefined(n)?n:t.datepickerOptions[e],("minMode"===e&&d.modes.indexOf(t.datepickerOptions.datepickerMode)<d.modes.indexOf(d[e])||"maxMode"===e&&d.modes.indexOf(t.datepickerOptions.datepickerMode)>d.modes.indexOf(d[e]))&&(t.datepickerMode=d[e],t.datepickerOptions.datepickerMode=d[e])}):d[e]=t[e]=u[e]||null}}),t.uniqueId="datepicker-"+t.$id+"-"+Math.floor(1e4*Math.random()),t.disabled=angular.isDefined(n.disabled)||!1,angular.isDefined(n.ngDisabled)&&g.push(t.$parent.$watch(n.ngDisabled,function(e){t.disabled=e,d.refreshView()})),t.isActive=function(e){return 0===d.compare(e.date,d.activeDate)&&(t.activeDateId=e.uid,!0)},this.init=function(e){h=function(e){var n;if(angular.version.minor<6)(n=e.$options||t.datepickerOptions.ngModelOptions||u.ngModelOptions||{}).getOption=function(t){return n[t]};else{var r=e.$options.getOption("timezone")||(t.datepickerOptions.ngModelOptions?t.datepickerOptions.ngModelOptions.timezone:null)||(u.ngModelOptions?u.ngModelOptions.timezone:null);n=e.$options.createChild(u.ngModelOptions).createChild(t.datepickerOptions.ngModelOptions).createChild(e.$options).createChild({timezone:r})}return n}(f=e),t.datepickerOptions.initDate?(d.activeDate=p.fromTimezone(t.datepickerOptions.initDate,h.getOption("timezone"))||new Date,t.$watch("datepickerOptions.initDate",function(t){t&&(f.$isEmpty(f.$modelValue)||f.$invalid)&&(d.activeDate=p.fromTimezone(t,h.getOption("timezone")),d.refreshView())})):d.activeDate=new Date;var n=f.$modelValue?new Date(f.$modelValue):new Date;this.activeDate=isNaN(n)?p.fromTimezone(new Date,h.getOption("timezone")):p.fromTimezone(n,h.getOption("timezone")),f.$render=function(){d.render()}},this.render=function(){if(f.$viewValue){var t=new Date(f.$viewValue);!isNaN(t)?this.activeDate=p.fromTimezone(t,h.getOption("timezone")):c||a.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){t.selectedDt=null,this._refreshView(),t.activeDt&&(t.activeDateId=t.activeDt.uid);var e=f.$viewValue?new Date(f.$viewValue):null;e=p.fromTimezone(e,h.getOption("timezone")),f.$setValidity("dateDisabled",!e||this.element&&!this.isDisabled(e))}},this.createDateObject=function(e,n){var r=f.$viewValue?new Date(f.$viewValue):null;r=p.fromTimezone(r,h.getOption("timezone"));var i=new Date;i=p.fromTimezone(i,h.getOption("timezone"));var o=this.compare(e,i),a={date:e,label:p.filter(e,n),selected:r&&0===this.compare(e,r),disabled:this.isDisabled(e),past:o<0,current:0===o,future:o>0,customClass:this.customClass(e)||null};return r&&0===this.compare(e,r)&&(t.selectedDt=a),d.activeDate&&0===this.compare(a.date,d.activeDate)&&(t.activeDt=a),a},this.isDisabled=function(e){return t.disabled||this.minDate&&this.compare(e,this.minDate)<0||this.maxDate&&this.compare(e,this.maxDate)>0||t.dateDisabled&&t.dateDisabled({date:e,mode:t.datepickerMode})},this.customClass=function(e){return t.customClass({date:e,mode:t.datepickerMode})},this.split=function(t,e){for(var n=[];t.length>0;)n.push(t.splice(0,e));return n},t.select=function(e){if(t.datepickerMode===d.minMode){var n=f.$viewValue?p.fromTimezone(new Date(f.$viewValue),h.getOption("timezone")):new Date(0,0,0,0,0,0,0);n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n=p.toTimezone(n,h.getOption("timezone")),f.$setViewValue(n),f.$render()}else d.activeDate=e,m(d.modes[d.modes.indexOf(t.datepickerMode)-1]),t.$emit("uib:datepicker.mode");t.$broadcast("uib:datepicker.focus")},t.move=function(t){var e=d.activeDate.getFullYear()+t*(d.step.years||0),n=d.activeDate.getMonth()+t*(d.step.months||0);d.activeDate.setFullYear(e,n,1),d.refreshView()},t.toggleMode=function(e){e=e||1,t.datepickerMode===d.maxMode&&1===e||t.datepickerMode===d.minMode&&-1===e||(m(d.modes[d.modes.indexOf(t.datepickerMode)+e]),t.$emit("uib:datepicker.mode"))},t.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};function m(e){t.datepickerMode=e,t.datepickerOptions.datepickerMode=e}t.$on("uib:datepicker.focus",function(){d.element[0].focus()}),t.keydown=function(e){var n=t.keys[e.which];if(n&&!e.shiftKey&&!e.altKey&&!t.disabled)if(e.preventDefault(),d.shortcutPropagation||e.stopPropagation(),"enter"===n||"space"===n){if(d.isDisabled(d.activeDate))return;t.select(d.activeDate)}else!e.ctrlKey||"up"!==n&&"down"!==n?(d.handleKeyDown(n,e),d.refreshView()):t.toggleMode("up"===n?1:-1)},e.on("keydown",function(e){t.$apply(function(){t.keydown(e)})}),t.$on("$destroy",function(){for(;g.length;)g.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(t,e,n){var r=[31,28,31,30,31,30,31,31,30,31,30,31];function i(t,e){return 1!==e||t%4!=0||t%100==0&&t%400!=0?r[e]:29}function o(t){var e=new Date(t);e.setDate(e.getDate()+4-(e.getDay()||7));var n=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((n-e)/864e5)/7)+1}this.step={months:1},this.element=e,this.init=function(e){angular.extend(e,this),t.showWeeks=e.showWeeks,e.refreshView()},this.getDates=function(t,e){for(var n,r=new Array(e),i=new Date(t),o=0;o<e;)n=new Date(i),r[o++]=n,i.setDate(i.getDate()+1);return r},this._refreshView=function(){var e=this.activeDate.getFullYear(),r=this.activeDate.getMonth(),i=new Date(this.activeDate);i.setFullYear(e,r,1);var a=this.startingDay-i.getDay(),s=a>0?7-a:-a,u=new Date(i);s>0&&u.setDate(1-s);for(var l=this.getDates(u,42),c=0;c<42;c++)l[c]=angular.extend(this.createDateObject(l[c],this.formatDay),{secondary:l[c].getMonth()!==r,uid:t.uniqueId+"-"+c});t.labels=new Array(7);for(var p=0;p<7;p++)t.labels[p]={abbr:n(l[p].date,this.formatDayHeader),full:n(l[p].date,"EEEE")};if(t.title=n(this.activeDate,this.formatDayTitle),t.rows=this.split(l,7),t.showWeeks){t.weekNumbers=[];for(var d=(11-this.startingDay)%7,f=t.rows.length,h=0;h<f;h++)t.weekNumbers.push(o(t.rows[h][d].date))}},this.compare=function(t,e){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n.setFullYear(t.getFullYear()),r.setFullYear(e.getFullYear()),n-r},this.handleKeyDown=function(t,e){var n=this.activeDate.getDate();if("left"===t)n-=1;else if("up"===t)n-=7;else if("right"===t)n+=1;else if("down"===t)n+=7;else if("pageup"===t||"pagedown"===t){var r=this.activeDate.getMonth()+("pageup"===t?-1:1);this.activeDate.setMonth(r,1),n=Math.min(i(this.activeDate.getFullYear(),this.activeDate.getMonth()),n)}else"home"===t?n=1:"end"===t&&(n=i(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(n)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(t,e,n){this.step={years:1},this.element=e,this.init=function(t){angular.extend(t,this),t.refreshView()},this._refreshView=function(){for(var e,r=new Array(12),i=this.activeDate.getFullYear(),o=0;o<12;o++)(e=new Date(this.activeDate)).setFullYear(i,o,1),r[o]=angular.extend(this.createDateObject(e,this.formatMonth),{uid:t.uniqueId+"-"+o});t.title=n(this.activeDate,this.formatMonthTitle),t.rows=this.split(r,this.monthColumns),t.yearHeaderColspan=this.monthColumns>3?this.monthColumns-2:1},this.compare=function(t,e){var n=new Date(t.getFullYear(),t.getMonth()),r=new Date(e.getFullYear(),e.getMonth());return n.setFullYear(t.getFullYear()),r.setFullYear(e.getFullYear()),n-r},this.handleKeyDown=function(t,e){var n=this.activeDate.getMonth();if("left"===t)n-=1;else if("up"===t)n-=this.monthColumns;else if("right"===t)n+=1;else if("down"===t)n+=this.monthColumns;else if("pageup"===t||"pagedown"===t){var r=this.activeDate.getFullYear()+("pageup"===t?-1:1);this.activeDate.setFullYear(r)}else"home"===t?n=0:"end"===t&&(n=11);this.activeDate.setMonth(n)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(t,e,n){var r,i;function o(t){return parseInt((t-1)/i,10)*i+1}this.element=e,this.yearpickerInit=function(){r=this.yearColumns,i=this.yearRows*r,this.step={years:i}},this._refreshView=function(){for(var e,n=new Array(i),a=0,s=o(this.activeDate.getFullYear());a<i;a++)(e=new Date(this.activeDate)).setFullYear(s+a,0,1),n[a]=angular.extend(this.createDateObject(e,this.formatYear),{uid:t.uniqueId+"-"+a});t.title=[n[0].label,n[i-1].label].join(" - "),t.rows=this.split(n,r),t.columns=r},this.compare=function(t,e){return t.getFullYear()-e.getFullYear()},this.handleKeyDown=function(t,e){var n=this.activeDate.getFullYear();"left"===t?n-=1:"up"===t?n-=r:"right"===t?n+=1:"down"===t?n+=r:"pageup"===t||"pagedown"===t?n+=("pageup"===t?-1:1)*i:"home"===t?n=o(this.activeDate.getFullYear()):"end"===t&&(n=o(this.activeDate.getFullYear())+i-1),this.activeDate.setFullYear(n)}}]).directive("uibDatepicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],restrict:"A",controller:"UibDatepickerController",controllerAs:"datepicker",link:function(t,e,n,r){var i=r[0],o=r[1];i.init(o)}}}).directive("uibDaypicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],restrict:"A",controller:"UibDaypickerController",link:function(t,e,n,r){var i=r[0];r[1].init(i)}}}).directive("uibMonthpicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],restrict:"A",controller:"UibMonthpickerController",link:function(t,e,n,r){var i=r[0];r[1].init(i)}}}).directive("uibYearpicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],restrict:"A",controller:"UibYearpickerController",link:function(t,e,n,r){var i=r[0];angular.extend(i,r[1]),i.yearpickerInit(),i.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(t,e){var n,r,i={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},o={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},a=/(HTML|BODY)/;return{getRawNode:function(t){return t.nodeName?t:t[0]||t},parseStyle:function(t){return t=parseFloat(t),isFinite(t)?t:0},offsetParent:function(n){var r,i=(n=this.getRawNode(n)).offsetParent||t[0].documentElement;for(;i&&i!==t[0].documentElement&&(r=i,"static"===(e.getComputedStyle(r).position||"static"));)i=i.offsetParent;return i||t[0].documentElement},scrollbarWidth:function(i){if(i){if(angular.isUndefined(r)){var o=t.find("body");o.addClass("uib-position-body-scrollbar-measure"),r=e.innerWidth-o[0].clientWidth,r=isFinite(r)?r:0,o.removeClass("uib-position-body-scrollbar-measure")}return r}if(angular.isUndefined(n)){var a=angular.element('<div class="uib-position-scrollbar-measure"></div>');t.find("body").append(a),n=a[0].offsetWidth-a[0].clientWidth,n=isFinite(n)?n:0,a.remove()}return n},scrollbarPadding:function(t){t=this.getRawNode(t);var n=e.getComputedStyle(t),r=this.parseStyle(n.paddingRight),i=this.parseStyle(n.paddingBottom),o=this.scrollParent(t,!1,!0),s=this.scrollbarWidth(a.test(o.tagName));return{scrollbarWidth:s,widthOverflow:o.scrollWidth>o.clientWidth,right:r+s,originalRight:r,heightOverflow:o.scrollHeight>o.clientHeight,bottom:i+s,originalBottom:i}},isScrollable:function(t,n){t=this.getRawNode(t);var r=n?i.hidden:i.normal,o=e.getComputedStyle(t);return r.test(o.overflow+o.overflowY+o.overflowX)},scrollParent:function(n,r,o){n=this.getRawNode(n);var a=r?i.hidden:i.normal,s=t[0].documentElement,u=e.getComputedStyle(n);if(o&&a.test(u.overflow+u.overflowY+u.overflowX))return n;var l="absolute"===u.position,c=n.parentElement||s;if(c===s||"fixed"===u.position)return s;for(;c.parentElement&&c!==s;){var p=e.getComputedStyle(c);if(l&&"static"!==p.position&&(l=!1),!l&&a.test(p.overflow+p.overflowY+p.overflowX))break;c=c.parentElement}return c},position:function(n,r){n=this.getRawNode(n);var i=this.offset(n);if(r){var o=e.getComputedStyle(n);i.top-=this.parseStyle(o.marginTop),i.left-=this.parseStyle(o.marginLeft)}var a=this.offsetParent(n),s={top:0,left:0};return a!==t[0].documentElement&&((s=this.offset(a)).top+=a.clientTop-a.scrollTop,s.left+=a.clientLeft-a.scrollLeft),{width:Math.round(angular.isNumber(i.width)?i.width:n.offsetWidth),height:Math.round(angular.isNumber(i.height)?i.height:n.offsetHeight),top:Math.round(i.top-s.top),left:Math.round(i.left-s.left)}},offset:function(n){var r=(n=this.getRawNode(n)).getBoundingClientRect();return{width:Math.round(angular.isNumber(r.width)?r.width:n.offsetWidth),height:Math.round(angular.isNumber(r.height)?r.height:n.offsetHeight),top:Math.round(r.top+(e.pageYOffset||t[0].documentElement.scrollTop)),left:Math.round(r.left+(e.pageXOffset||t[0].documentElement.scrollLeft))}},viewportOffset:function(n,r,i){i=!1!==i;var o=(n=this.getRawNode(n)).getBoundingClientRect(),a={top:0,left:0,bottom:0,right:0},s=r?t[0].documentElement:this.scrollParent(n),u=s.getBoundingClientRect();if(a.top=u.top+s.clientTop,a.left=u.left+s.clientLeft,s===t[0].documentElement&&(a.top+=e.pageYOffset,a.left+=e.pageXOffset),a.bottom=a.top+s.clientHeight,a.right=a.left+s.clientWidth,i){var l=e.getComputedStyle(s);a.top+=this.parseStyle(l.paddingTop),a.bottom-=this.parseStyle(l.paddingBottom),a.left+=this.parseStyle(l.paddingLeft),a.right-=this.parseStyle(l.paddingRight)}return{top:Math.round(o.top-a.top),bottom:Math.round(a.bottom-o.bottom),left:Math.round(o.left-a.left),right:Math.round(a.right-o.right)}},parsePlacement:function(t){var e=o.auto.test(t);return e&&(t=t.replace(o.auto,"")),(t=t.split("-"))[0]=t[0]||"top",o.primary.test(t[0])||(t[0]="top"),t[1]=t[1]||"center",o.secondary.test(t[1])||(t[1]="center"),t[2]=!!e,t},positionElements:function(t,n,r,i){t=this.getRawNode(t),n=this.getRawNode(n);var a=angular.isDefined(n.offsetWidth)?n.offsetWidth:n.prop("offsetWidth"),s=angular.isDefined(n.offsetHeight)?n.offsetHeight:n.prop("offsetHeight");r=this.parsePlacement(r);var u=i?this.offset(t):this.position(t),l={top:0,left:0,placement:""};if(r[2]){var c=this.viewportOffset(t,i),p=e.getComputedStyle(n),d=a+Math.round(Math.abs(this.parseStyle(p.marginLeft)+this.parseStyle(p.marginRight))),f=s+Math.round(Math.abs(this.parseStyle(p.marginTop)+this.parseStyle(p.marginBottom)));if(r[0]="top"===r[0]&&f>c.top&&f<=c.bottom?"bottom":"bottom"===r[0]&&f>c.bottom&&f<=c.top?"top":"left"===r[0]&&d>c.left&&d<=c.right?"right":"right"===r[0]&&d>c.right&&d<=c.left?"left":r[0],r[1]="top"===r[1]&&f-u.height>c.bottom&&f-u.height<=c.top?"bottom":"bottom"===r[1]&&f-u.height>c.top&&f-u.height<=c.bottom?"top":"left"===r[1]&&d-u.width>c.right&&d-u.width<=c.left?"right":"right"===r[1]&&d-u.width>c.left&&d-u.width<=c.right?"left":r[1],"center"===r[1])if(o.vertical.test(r[0])){var h=u.width/2-a/2;c.left+h<0&&d-u.width<=c.right?r[1]="left":c.right+h<0&&d-u.width<=c.left&&(r[1]="right")}else{var g=u.height/2-f/2;c.top+g<0&&f-u.height<=c.bottom?r[1]="top":c.bottom+g<0&&f-u.height<=c.top&&(r[1]="bottom")}}switch(r[0]){case"top":l.top=u.top-s;break;case"bottom":l.top=u.top+u.height;break;case"left":l.left=u.left-a;break;case"right":l.left=u.left+u.width}switch(r[1]){case"top":l.top=u.top;break;case"bottom":l.top=u.top+u.height-s;break;case"left":l.left=u.left;break;case"right":l.left=u.left+u.width-a;break;case"center":o.vertical.test(r[0])?l.left=u.left+u.width/2-a/2:l.top=u.top+u.height/2-s/2}return l.top=Math.round(l.top),l.left=Math.round(l.left),l.placement="center"===r[1]?r[0]:r[0]+"-"+r[1],l},adjustTop:function(t,e,n,r){if(-1!==t.indexOf("top")&&n!==r)return{top:e.top-r+"px"}},positionArrow:function(t,n){var r=(t=this.getRawNode(t)).querySelector(".tooltip-inner, .popover-inner");if(r){var i=angular.element(r).hasClass("tooltip-inner"),a=i?t.querySelector(".tooltip-arrow"):t.querySelector(".arrow");if(a){var s={top:"",bottom:"",left:"",right:""};if("center"!==(n=this.parsePlacement(n))[1]){var u="border-"+n[0]+"-width",l=e.getComputedStyle(a)[u],c="border-";o.vertical.test(n[0])?c+=n[0]+"-"+n[1]:c+=n[1]+"-"+n[0],c+="-radius";var p=e.getComputedStyle(i?r:t)[c];switch(n[0]){case"top":s.bottom=i?"0":"-"+l;break;case"bottom":s.top=i?"0":"-"+l;break;case"left":s.right=i?"0":"-"+l;break;case"right":s.left=i?"0":"-"+l}s[n[1]]=p,angular.element(a).css(s)}else angular.element(a).css(s)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(t,e,n,r,i,o,a,s,u,l,c,p,d,f,h,g){var m,v,y,b,w,$,k,C,x,T,S,E,D,A=!1,B=[];function I(e){var n=p.parse(e,m,t.date);if(isNaN(n))for(var r=0;r<D.length;r++)if(n=p.parse(e,D[r],t.date),!isNaN(n))return n;return n}function O(t){if(angular.isNumber(t)&&(t=new Date(t)),!t)return null;if(angular.isDate(t)&&!isNaN(t))return t;if(angular.isString(t)){var e=I(t);if(!isNaN(e))return p.toTimezone(e,S.getOption("timezone"))}return S.getOption("allowInvalid")?t:void 0}function M(t,e){var r=t||e;return!n.ngRequired&&!r||(angular.isNumber(r)&&(r=new Date(r)),!r||(!(!angular.isDate(r)||isNaN(r))||!!angular.isString(r)&&!isNaN(I(r))))}function P(n){if(t.isOpen||!t.disabled){var r=E[0],i=e[0].contains(n.target),o=void 0!==r.contains&&r.contains(n.target);!t.isOpen||i||o||t.$apply(function(){t.isOpen=!1})}}function _(n){27===n.which&&t.isOpen?(n.preventDefault(),n.stopPropagation(),t.$apply(function(){t.isOpen=!1}),e[0].focus()):40!==n.which||t.isOpen||(n.preventDefault(),n.stopPropagation(),t.$apply(function(){t.isOpen=!0}))}function R(){if(t.isOpen){var r=angular.element(E[0].querySelector(".uib-datepicker-popup")),i=n.popupPlacement?n.popupPlacement:d.placement,o=l.positionElements(e,r,i,y);r.css({top:o.top+"px",left:o.left+"px"}),r.hasClass("uib-position-measure")&&r.removeClass("uib-position-measure")}}this.init=function(i){if(S=function(t){var e;angular.version.minor<6?(e=angular.isObject(t.$options)?t.$options:{timezone:null}).getOption=function(t){return e[t]}:e=t.$options;return e}(T=i),v=angular.isDefined(n.closeOnDateSelection)?t.$parent.$eval(n.closeOnDateSelection):d.closeOnDateSelection,y=angular.isDefined(n.datepickerAppendToBody)?t.$parent.$eval(n.datepickerAppendToBody):d.appendToBody,b=angular.isDefined(n.onOpenFocus)?t.$parent.$eval(n.onOpenFocus):d.onOpenFocus,w=angular.isDefined(n.datepickerPopupTemplateUrl)?n.datepickerPopupTemplateUrl:d.datepickerPopupTemplateUrl,$=angular.isDefined(n.datepickerTemplateUrl)?n.datepickerTemplateUrl:d.datepickerTemplateUrl,D=angular.isDefined(n.altInputFormats)?t.$parent.$eval(n.altInputFormats):d.altInputFormats,t.showButtonBar=angular.isDefined(n.showButtonBar)?t.$parent.$eval(n.showButtonBar):d.showButtonBar,d.html5Types[n.type]?(m=d.html5Types[n.type],A=!0):(m=n.uibDatepickerPopup||d.datepickerPopup,n.$observe("uibDatepickerPopup",function(t,e){var n=t||d.datepickerPopup;if(n!==m&&(m=n,T.$modelValue=null,!m))throw new Error("uibDatepickerPopup must have a date format specified.")})),!m)throw new Error("uibDatepickerPopup must have a date format specified.");if(A&&n.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");(k=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>")).attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":w}),(C=angular.element(k.children()[0])).attr("template-url",$),t.datepickerOptions||(t.datepickerOptions={}),A&&"month"===n.type&&(t.datepickerOptions.datepickerMode="month",t.datepickerOptions.minMode="month"),C.attr("datepicker-options","datepickerOptions"),A?T.$formatters.push(function(e){return t.date=p.fromTimezone(e,S.getOption("timezone")),e}):(T.$$parserName="date",T.$validators.date=M,T.$parsers.unshift(O),T.$formatters.push(function(e){return T.$isEmpty(e)?(t.date=e,e):(angular.isNumber(e)&&(e=new Date(e)),t.date=p.fromTimezone(e,S.getOption("timezone")),p.filter(t.date,m))})),T.$viewChangeListeners.push(function(){t.date=I(T.$viewValue)}),e.on("keydown",_),E=r(k)(t),k.remove(),y?s.find("body").append(E):e.after(E),t.$on("$destroy",function(){for(!0===t.isOpen&&(u.$$phase||t.$apply(function(){t.isOpen=!1})),E.remove(),e.off("keydown",_),s.off("click",P),x&&x.off("scroll",R),angular.element(a).off("resize",R);B.length;)B.shift()()})},t.getText=function(e){return t[e+"Text"]||d[e+"Text"]},t.isDisabled=function(e){"today"===e&&(e=p.fromTimezone(new Date,S.getOption("timezone")));var n={};return angular.forEach(["minDate","maxDate"],function(e){t.datepickerOptions[e]?angular.isDate(t.datepickerOptions[e])?n[e]=new Date(t.datepickerOptions[e]):(g&&i.warn("Literal date support has been deprecated, please switch to date object usage"),n[e]=new Date(c(t.datepickerOptions[e],"medium"))):n[e]=null}),t.datepickerOptions&&n.minDate&&t.compare(e,n.minDate)<0||n.maxDate&&t.compare(e,n.maxDate)>0},t.compare=function(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate())-new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.dateSelection=function(n){t.date=n;var r=t.date?p.filter(t.date,m):null;e.val(r),T.$setViewValue(r),v&&(t.isOpen=!1,e[0].focus())},t.keydown=function(n){27===n.which&&(n.stopPropagation(),t.isOpen=!1,e[0].focus())},t.select=function(e,n){if(n.stopPropagation(),"today"===e){var r=new Date;angular.isDate(t.date)?(e=new Date(t.date)).setFullYear(r.getFullYear(),r.getMonth(),r.getDate()):(e=p.fromTimezone(r,S.getOption("timezone"))).setHours(0,0,0,0)}t.dateSelection(e)},t.close=function(n){n.stopPropagation(),t.isOpen=!1,e[0].focus()},t.disabled=angular.isDefined(n.disabled)||!1,n.ngDisabled&&B.push(t.$parent.$watch(o(n.ngDisabled),function(e){t.disabled=e})),t.$watch("isOpen",function(r){r?t.disabled?t.isOpen=!1:f(function(){R(),b&&t.$broadcast("uib:datepicker.focus"),s.on("click",P);var r=n.popupPlacement?n.popupPlacement:d.placement;y||l.parsePlacement(r)[2]?(x=x||angular.element(l.scrollParent(e)))&&x.on("scroll",R):x=null,angular.element(a).on("resize",R)},0,!1):(s.off("click",P),x&&x.off("scroll",R),angular.element(a).off("resize",R))}),t.$on("uib:datepicker.mode",function(){f(R,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(t,e,n,r){var i=r[0];r[1].init(i)}}}).directive("uibDatepickerPopupWrap",function(){return{restrict:"A",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(t){return function(e,n){var r;return function(){var i=this,o=Array.prototype.slice.call(arguments);r&&t.cancel(r),r=t(function(){e.apply(i,o)},n)}}}]),angular.module("ui.bootstrap.multiMap",[]).factory("$$multiMap",function(){return{createNew:function(){var t={};return{entries:function(){return Object.keys(t).map(function(e){return{key:e,value:t[e]}})},get:function(e){return t[e]},hasKey:function(e){return!!t[e]},keys:function(){return Object.keys(t)},put:function(e,n){t[e]||(t[e]=[]),t[e].push(n)},remove:function(e,n){var r=t[e];if(r){var i=r.indexOf(n);-1!==i&&r.splice(i,1),r.length||delete t[e]}}}}}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.multiMap","ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope","$$multiMap",function(t,e,n){var r=null,i=n.createNew();this.isOnlyOpen=function(t,e){var n=i.get(e);if(n&&n.reduce(function(e,n){return n.scope===t?n:e},{}))return 1===n.length;return!1},this.open=function(e,n,a){if(r||t.on("click",o),r&&r!==e&&(r.isOpen=!1),r=e,a){var s=i.get(a);if(s)-1===s.map(function(t){return t.scope}).indexOf(e)&&i.put(a,{scope:e});else i.put(a,{scope:e})}},this.close=function(e,n,a){if(r===e&&(t.off("click",o),t.off("keydown",this.keybindFilter),r=null),a){var s=i.get(a);if(s){var u=s.reduce(function(t,n){return n.scope===e?n:t},{});u&&i.remove(a,u)}}};var o=function(t){if(r&&r.isOpen&&!(t&&"disabled"===r.getAutoClose()||t&&3===t.which)){var n=r.getToggleElement();if(!(t&&n&&n[0].contains(t.target))){var i=r.getDropdownElement();t&&"outsideClick"===r.getAutoClose()&&i&&i[0].contains(t.target)||(r.focusToggleElement(),r.isOpen=!1,e.$$phase||r.$apply())}}};this.keybindFilter=function(t){if(r){var e=r.getDropdownElement(),n=r.getToggleElement(),i=e&&e[0].contains(t.target),a=n&&n[0].contains(t.target);27===t.which?(t.stopPropagation(),r.focusToggleElement(),o()):r.isKeynavEnabled()&&-1!==[38,40].indexOf(t.which)&&r.isOpen&&(i||a)&&(t.preventDefault(),t.stopPropagation(),r.focusDropdownEntry(t.which))}}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(t,e,n,r,i,o,a,s,u,l,c){var p,d,f=this,h=t.$new(),g=i.appendToOpenClass,m=i.openClass,v=angular.noop,y=n.onToggle?r(n.onToggle):angular.noop,b=!1,w=u.find("body");function $(){e.append(f.dropdownMenu)}e.addClass("dropdown"),this.init=function(){n.isOpen&&(d=r(n.isOpen),v=d.assign,t.$watch(d,function(t){h.isOpen=!!t})),b=angular.isDefined(n.keyboardNav)},this.toggle=function(t){return h.isOpen=arguments.length?!!t:!h.isOpen,angular.isFunction(v)&&v(h,h.isOpen),h.isOpen},this.isOpen=function(){return h.isOpen},h.getToggleElement=function(){return f.toggleElement},h.getAutoClose=function(){return n.autoClose||"always"},h.getElement=function(){return e},h.isKeynavEnabled=function(){return b},h.focusDropdownEntry=function(t){var n=f.dropdownMenu?angular.element(f.dropdownMenu).find("a"):e.find("ul").eq(0).find("a");switch(t){case 40:angular.isNumber(f.selectedOption)?f.selectedOption=f.selectedOption===n.length-1?f.selectedOption:f.selectedOption+1:f.selectedOption=0;break;case 38:angular.isNumber(f.selectedOption)?f.selectedOption=0===f.selectedOption?0:f.selectedOption-1:f.selectedOption=n.length-1}n[f.selectedOption].focus()},h.getDropdownElement=function(){return f.dropdownMenu},h.focusToggleElement=function(){f.toggleElement&&f.toggleElement[0].focus()},h.$watch("isOpen",function(i,d){var b=null,k=!1;if(angular.isDefined(n.dropdownAppendTo)){var C=r(n.dropdownAppendTo)(h);C&&(b=angular.element(C))}angular.isDefined(n.dropdownAppendToBody)&&(!1!==r(n.dropdownAppendToBody)(h)&&(k=!0));if(k&&!b&&(b=w),b&&f.dropdownMenu&&(i?(b.append(f.dropdownMenu),e.on("$destroy",$)):(e.off("$destroy",$),$())),b&&f.dropdownMenu){var x,T,S,E=s.positionElements(e,f.dropdownMenu,"bottom-left",!0),D=0;if(x={top:E.top+"px",display:i?"block":"none"},(T=f.dropdownMenu.hasClass("dropdown-menu-right"))?(x.left="auto",(S=s.scrollbarPadding(b)).heightOverflow&&S.scrollbarWidth&&(D=S.scrollbarWidth),x.right=window.innerWidth-D-(E.left+e.prop("offsetWidth"))+"px"):(x.left=E.left+"px",x.right="auto"),!k){var A=s.offset(b);x.top=E.top-A.top+"px",T?x.right=window.innerWidth-(E.left-A.left+e.prop("offsetWidth"))+"px":x.left=E.left-A.left+"px"}f.dropdownMenu.css(x)}var B=b||e,I=b?g:m,O=B.hasClass(I),M=o.isOnlyOpen(t,b);O===!i&&a[b?M?"removeClass":"addClass":i?"addClass":"removeClass"](B,I).then(function(){angular.isDefined(i)&&i!==d&&y(t,{open:!!i})});if(i)f.dropdownMenuTemplateUrl?c(f.dropdownMenuTemplateUrl).then(function(t){p=h.$new(),l(t.trim())(p,function(t){var e=t;f.dropdownMenu.replaceWith(e),f.dropdownMenu=e,u.on("keydown",o.keybindFilter)})}):u.on("keydown",o.keybindFilter),h.focusToggleElement(),o.open(h,e,b);else{if(o.close(h,e,b),f.dropdownMenuTemplateUrl){p&&p.$destroy();var P=angular.element('<ul class="dropdown-menu"></ul>');f.dropdownMenu.replaceWith(P),f.dropdownMenu=P}f.selectedOption=null}angular.isFunction(v)&&v(t,i)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(t,e,n,r){r.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(t,e,n,r){if(r&&!angular.isDefined(n.dropdownNested)){e.addClass("dropdown-menu");var i=n.templateUrl;i&&(r.dropdownMenuTemplateUrl=i),r.dropdownMenu||(r.dropdownMenu=e)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(t,e,n,r){if(r){e.addClass("dropdown-toggle"),r.toggleElement=e;var i=function(i){i.preventDefault(),e.hasClass("disabled")||n.disabled||t.$apply(function(){r.toggle()})};e.on("click",i),e.attr({"aria-haspopup":!0,"aria-expanded":!1}),t.$watch(r.isOpen,function(t){e.attr("aria-expanded",!!t)}),t.$on("$destroy",function(){e.off("click",i)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var t=[];return{add:function(e,n){t.push({key:e,value:n})},get:function(e){for(var n=0;n<t.length;n++)if(e===t[n].key)return t[n]},keys:function(){for(var e=[],n=0;n<t.length;n++)e.push(t[n].key);return e},top:function(){return t[t.length-1]},remove:function(e){for(var n=-1,r=0;r<t.length;r++)if(e===t[r].key){n=r;break}return t.splice(n,1)[0]},removeTop:function(){return t.pop()},length:function(){return t.length}}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.multiMap","ui.bootstrap.stackedMap","ui.bootstrap.position"]).provider("$uibResolve",function(){var t=this;this.resolver=null,this.setResolver=function(t){this.resolver=t},this.$get=["$injector","$q",function(e,n){var r=t.resolver?e.get(t.resolver):null;return{resolve:function(t,i,o,a){if(r)return r.resolve(t,i,o,a);var s=[];return angular.forEach(t,function(t){angular.isFunction(t)||angular.isArray(t)?s.push(n.resolve(e.invoke(t))):angular.isString(t)?s.push(n.resolve(e.get(t))):s.push(n.resolve(t))}),n.all(s).then(function(e){var n={},r=0;return angular.forEach(t,function(t,i){n[i]=e[r++]}),n})}}}]}).directive("uibModalBackdrop",["$animate","$injector","$uibModalStack",function(t,e,n){return{restrict:"A",compile:function(t,e){return t.addClass(e.backdropClass),r}};function r(e,r,i){i.modalInClass&&(t.addClass(r,i.modalInClass),e.$on(n.NOW_CLOSING_EVENT,function(n,o){var a=o();e.modalOptions.animation?t.removeClass(r,i.modalInClass).then(a):a()}))}}]).directive("uibModalWindow",["$uibModalStack","$q","$animateCss","$document",function(t,e,n,r){return{scope:{index:"@"},restrict:"A",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/modal/window.html"},link:function(i,o,a){o.addClass(a.windowTopClass||""),i.size=a.size,i.close=function(e){var n=t.getTop();n&&n.value.backdrop&&"static"!==n.value.backdrop&&e.target===e.currentTarget&&(e.preventDefault(),e.stopPropagation(),t.dismiss(n.key,"backdrop click"))},o.on("click",i.close),i.$isRendered=!0;var s=e.defer();i.$$postDigest(function(){s.resolve()}),s.promise.then(function(){var s=null;a.modalInClass&&(s=n(o,{addClass:a.modalInClass}).start(),i.$on(t.NOW_CLOSING_EVENT,function(t,e){var r=e();n(o,{removeClass:a.modalInClass}).start().then(r)})),e.when(s).then(function(){var e=t.getTop();if(e&&t.modalRendered(e.key),!r[0].activeElement||!o[0].contains(r[0].activeElement)){var n=o[0].querySelector("[autofocus]");n?n.focus():o[0].focus()}})})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(t,e){e.modalAnimation&&t.addClass(e.uibModalAnimationClass)}}}).directive("uibModalTransclude",["$animate",function(t){return{link:function(e,n,r,i,o){o(e.$parent,function(e){n.empty(),t.enter(e,n)})}}}]).factory("$uibModalStack",["$animate","$animateCss","$document","$compile","$rootScope","$q","$$multiMap","$$stackedMap","$uibPosition",function(t,e,n,r,i,o,a,s,u){var l,c,p,d="modal-open",f=s.createNew(),h=a.createNew(),g={NOW_CLOSING_EVENT:"modal.stack.now-closing"},m=0,v=null,y="data-bootstrap-modal-aria-hidden-count",b=/[A-Z]/g;function w(){for(var t=-1,e=f.keys(),n=0;n<e.length;n++)f.get(e[n]).value.backdrop&&(t=n);return t>-1&&t<m&&(t=m),t}function $(t,e){var n=f.get(t).value,r=n.appendTo;f.remove(t),(v=f.top())&&(m=parseInt(v.value.modalDomEl.attr("index"),10)),C(n.modalDomEl,n.modalScope,function(){var e=n.openedClass||d;h.remove(e,t);var i=h.hasKey(e);r.toggleClass(e,i),!i&&p&&p.heightOverflow&&p.scrollbarWidth&&(p.originalRight?r.css({paddingRight:p.originalRight+"px"}):r.css({paddingRight:""}),p=null),k(!0)},n.closedDeferred),function(){if(l&&-1===w()){C(l,c,function(){null}),l=void 0,c=void 0}}(),e&&e.focus?e.focus():r.focus&&r.focus()}function k(t){var e;f.length()>0&&(e=f.top().value).modalDomEl.toggleClass(e.windowTopClass||"",t)}function C(e,n,r,i){var a,s=null;return n.$broadcast(g.NOW_CLOSING_EVENT,function(){return a||(a=o.defer(),s=a.promise),function(){a.resolve()}}),o.when(s).then(function o(){if(o.done)return;o.done=!0;t.leave(e).then(function(){r&&r(),e.remove(),i&&i.resolve()});n.$destroy()})}function x(t){if(t.isDefaultPrevented())return t;var e=f.top();if(e)switch(t.which){case 27:e.value.keyboard&&(t.preventDefault(),i.$apply(function(){g.dismiss(e.key,"escape key press")}));break;case 9:var n=g.loadFocusElementList(e),r=!1;t.shiftKey?(g.isFocusInFirstItem(t,n)||g.isModalFocused(t,e))&&(r=g.focusLastFocusableElement(n)):g.isFocusInLastItem(t,n)&&(r=g.focusFirstFocusableElement(n)),r&&(t.preventDefault(),t.stopPropagation())}}function T(t,e,n){return!t.value.modalScope.$broadcast("modal.closing",e,n).defaultPrevented}function S(){Array.prototype.forEach.call(document.querySelectorAll("["+y+"]"),function(t){var e=parseInt(t.getAttribute(y),10)-1;t.setAttribute(y,e),e||(t.removeAttribute(y),t.removeAttribute("aria-hidden"))})}return i.$watch(w,function(t){c&&(c.index=t)}),n.on("keydown",x),i.$on("$destroy",function(){n.off("keydown",x)}),g.open=function(e,o){var a=n[0].activeElement,s=o.openedClass||d;k(!1),v=f.top(),f.add(e,{deferred:o.deferred,renderDeferred:o.renderDeferred,closedDeferred:o.closedDeferred,modalScope:o.scope,backdrop:o.backdrop,keyboard:o.keyboard,openedClass:o.openedClass,windowTopClass:o.windowTopClass,animation:o.animation,appendTo:o.appendTo}),h.put(s,e);var g,$=o.appendTo,C=w();C>=0&&!l&&((c=i.$new(!0)).modalOptions=o,c.index=C,(l=angular.element('<div uib-modal-backdrop="modal-backdrop"></div>')).attr({class:"modal-backdrop","ng-style":"{'z-index': 1040 + (index && 1 || 0) + index*10}","uib-modal-animation-class":"fade","modal-in-class":"in"}),o.backdropClass&&l.addClass(o.backdropClass),o.animation&&l.attr("modal-animation","true"),r(l)(c),t.enter(l,$),u.isScrollable($)&&(p=u.scrollbarPadding($)).heightOverflow&&p.scrollbarWidth&&$.css({paddingRight:p.right+"px"})),o.component?(g=document.createElement(o.component.name.replace(b,function(t,e){return(e?"-":"")+t.toLowerCase()})),(g=angular.element(g)).attr({resolve:"$resolve","modal-instance":"$uibModalInstance",close:"$close($value)",dismiss:"$dismiss($value)"})):g=o.content,m=v?parseInt(v.value.modalDomEl.attr("index"),10)+1:0;var x=angular.element('<div uib-modal-window="modal-window"></div>');x.attr({class:"modal","template-url":o.windowTemplateUrl,"window-top-class":o.windowTopClass,role:"dialog","aria-labelledby":o.ariaLabelledBy,"aria-describedby":o.ariaDescribedBy,size:o.size,index:m,animate:"animate","ng-style":"{'z-index': 1050 + $$topModalIndex*10, display: 'block'}",tabindex:-1,"uib-modal-animation-class":"fade","modal-in-class":"in"}).append(g),o.windowClass&&x.addClass(o.windowClass),o.animation&&x.attr("modal-animation","true"),$.addClass(s),o.scope&&(o.scope.$$topModalIndex=m),t.enter(r(x)(o.scope),$),f.top().value.modalDomEl=x,f.top().value.modalOpener=a,function t(e){if(!e||"BODY"===e[0].tagName)return;(n=e,r=n.parent()?n.parent().children():[],Array.prototype.filter.call(r,function(t){return t!==n[0]})).forEach(function(t){var e="true"===t.getAttribute("aria-hidden"),n=parseInt(t.getAttribute(y),10);n||(n=e?1:0),t.setAttribute(y,n+1),t.setAttribute("aria-hidden","true")});var n,r;return t(e.parent())}(x)},g.close=function(t,e){var n=f.get(t);return S(),n&&T(n,e,!0)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.resolve(e),$(t,n.value.modalOpener),!0):!n},g.dismiss=function(t,e){var n=f.get(t);return S(),n&&T(n,e,!1)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.reject(e),$(t,n.value.modalOpener),!0):!n},g.dismissAll=function(t){for(var e=this.getTop();e&&this.dismiss(e.key,t);)e=this.getTop()},g.getTop=function(){return f.top()},g.modalRendered=function(t){var e=f.get(t);e&&e.value.renderDeferred.resolve()},g.focusFirstFocusableElement=function(t){return t.length>0&&(t[0].focus(),!0)},g.focusLastFocusableElement=function(t){return t.length>0&&(t[t.length-1].focus(),!0)},g.isModalFocused=function(t,e){if(t&&e){var n=e.value.modalDomEl;if(n&&n.length)return(t.target||t.srcElement)===n[0]}return!1},g.isFocusInFirstItem=function(t,e){return e.length>0&&(t.target||t.srcElement)===e[0]},g.isFocusInLastItem=function(t,e){return e.length>0&&(t.target||t.srcElement)===e[e.length-1]},g.loadFocusElementList=function(t){if(t){var e=t.value.modalDomEl;if(e&&e.length){var n=e[0].querySelectorAll("a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]");return n?Array.prototype.filter.call(n,function(t){return!!((e=t).offsetWidth||e.offsetHeight||e.getClientRects().length);var e}):n}}},g}]).provider("$uibModal",function(){var t={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(e,n,r,i,o,a,s){var u={};var l=null;return u.getPromiseChain=function(){return l},u.open=function(u){var c,p,d,f=n.defer(),h=n.defer(),g=n.defer(),m=n.defer(),v={result:f.promise,opened:h.promise,closed:g.promise,rendered:m.promise,close:function(t){return s.close(v,t)},dismiss:function(t){return s.dismiss(v,t)}};if((u=angular.extend({},t.options,u)).resolve=u.resolve||{},u.appendTo=u.appendTo||r.find("body").eq(0),!u.appendTo.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");if(!u.component&&!u.template&&!u.templateUrl)throw new Error("One of component or template or templateUrl options is required.");function y(){return c}return c=u.component?n.when(a.resolve(u.resolve,{},null,null)):n.all([(p=u,p.template?n.when(p.template):i(angular.isFunction(p.templateUrl)?p.templateUrl():p.templateUrl)),a.resolve(u.resolve,{},null,null)]),d=l=n.all([l]).then(y,y).then(function(t){var n=u.scope||e,r=n.$new();r.$close=v.close,r.$dismiss=v.dismiss,r.$on("$destroy",function(){r.$$uibDestructionScheduled||r.$dismiss("$uibUnscheduledDestruction")});var i,a,l={scope:r,deferred:f,renderDeferred:m,closedDeferred:g,animation:u.animation,backdrop:u.backdrop,keyboard:u.keyboard,backdropClass:u.backdropClass,windowTopClass:u.windowTopClass,windowClass:u.windowClass,windowTemplateUrl:u.windowTemplateUrl,ariaLabelledBy:u.ariaLabelledBy,ariaDescribedBy:u.ariaDescribedBy,size:u.size,openedClass:u.openedClass,appendTo:u.appendTo},c={},p={};function d(e,n,i,o){e.$scope=r,e.$scope.$resolve={},i?e.$scope.$uibModalInstance=v:e.$uibModalInstance=v;var a=n?t[1]:t;angular.forEach(a,function(t,n){o&&(e[n]=t),e.$scope.$resolve[n]=t})}u.component?(d(c,!1,!0,!1),c.name=u.component,l.component=c):u.controller&&(d(p,!0,!1,!0),a=o(u.controller,p,!0,u.controllerAs),u.controllerAs&&u.bindToController&&((i=a.instance).$close=r.$close,i.$dismiss=r.$dismiss,angular.extend(i,{$resolve:p.$scope.$resolve},n)),i=a(),angular.isFunction(i.$onInit)&&i.$onInit()),u.component||(l.content=t[0]),s.open(v,l),h.resolve(!0)},function(t){h.reject(t),f.reject(t)}).finally(function(){l===d&&(l=null)}),v},u}]};return t}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(t){return{create:function(e,n,r){e.setNumPages=r.numPages?t(r.numPages).assign:angular.noop,e.ngModelCtrl={$setViewValue:angular.noop},e._watchers=[],e.init=function(t,i){e.ngModelCtrl=t,e.config=i,t.$render=function(){e.render()},r.itemsPerPage?e._watchers.push(n.$parent.$watch(r.itemsPerPage,function(t){e.itemsPerPage=parseInt(t,10),n.totalPages=e.calculateTotalPages(),e.updatePage()})):e.itemsPerPage=i.itemsPerPage,n.$watch("totalItems",function(t,r){(angular.isDefined(t)||t!==r)&&(n.totalPages=e.calculateTotalPages(),e.updatePage())})},e.calculateTotalPages=function(){var t=e.itemsPerPage<1?1:Math.ceil(n.totalItems/e.itemsPerPage);return Math.max(t||0,1)},e.render=function(){n.page=parseInt(e.ngModelCtrl.$viewValue,10)||1},n.selectPage=function(t,r){r&&r.preventDefault(),(!n.ngDisabled||!r)&&n.page!==t&&t>0&&t<=n.totalPages&&(r&&r.target&&r.target.blur(),e.ngModelCtrl.$setViewValue(t),e.ngModelCtrl.$render())},n.getText=function(t){return n[t+"Text"]||e.config[t+"Text"]},n.noPrevious=function(){return 1===n.page},n.noNext=function(){return n.page===n.totalPages},e.updatePage=function(){e.setNumPages(n.$parent,n.totalPages),n.page>n.totalPages?n.selectPage(n.totalPages):e.ngModelCtrl.$render()},n.$on("$destroy",function(){for(;e._watchers.length;)e._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(t,e,n,r){t.align=angular.isDefined(e.align)?t.$parent.$eval(e.align):r.align,n.create(this,t,e)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(t){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],restrict:"A",controller:"UibPagerController",controllerAs:"pager",templateUrl:function(t,e){return e.templateUrl||"uib/template/pager/pager.html"},link:function(e,n,r,i){n.addClass("pager");var o=i[0],a=i[1];a&&o.init(a,t)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(t,e,n,r,i){var o=this,a=angular.isDefined(e.maxSize)?t.$parent.$eval(e.maxSize):i.maxSize,s=angular.isDefined(e.rotate)?t.$parent.$eval(e.rotate):i.rotate,u=angular.isDefined(e.forceEllipses)?t.$parent.$eval(e.forceEllipses):i.forceEllipses,l=angular.isDefined(e.boundaryLinkNumbers)?t.$parent.$eval(e.boundaryLinkNumbers):i.boundaryLinkNumbers,c=angular.isDefined(e.pageLabel)?function(n){return t.$parent.$eval(e.pageLabel,{$page:n})}:angular.identity;function p(t,e,n){return{number:t,text:e,active:n}}t.boundaryLinks=angular.isDefined(e.boundaryLinks)?t.$parent.$eval(e.boundaryLinks):i.boundaryLinks,t.directionLinks=angular.isDefined(e.directionLinks)?t.$parent.$eval(e.directionLinks):i.directionLinks,e.$set("role","menu"),r.create(this,t,e),e.maxSize&&o._watchers.push(t.$parent.$watch(n(e.maxSize),function(t){a=parseInt(t,10),o.render()}));var d=this.render;this.render=function(){d(),t.page>0&&t.page<=t.totalPages&&(t.pages=function(t,e){var n=[],r=1,i=e,o=angular.isDefined(a)&&a<e;o&&(s?(i=(r=Math.max(t-Math.floor(a/2),1))+a-1)>e&&(r=(i=e)-a+1):(r=(Math.ceil(t/a)-1)*a+1,i=Math.min(r+a-1,e)));for(var d=r;d<=i;d++){var f=p(d,c(d),d===t);n.push(f)}if(o&&a>0&&(!s||u||l)){if(r>1){if(!l||r>3){var h=p(r-1,"...",!1);n.unshift(h)}if(l){if(3===r){var g=p(2,"2",!1);n.unshift(g)}var m=p(1,"1",!1);n.unshift(m)}}if(i<e){if(!l||i<e-2){var v=p(i+1,"...",!1);n.push(v)}if(l){if(i===e-2){var y=p(e-1,e-1,!1);n.push(y)}var b=p(e,e,!1);n.push(b)}}}return n}(t.page,t.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(t,e){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],restrict:"A",controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(t,e){return e.templateUrl||"uib/template/pagination/pagination.html"},link:function(t,n,r,i){n.addClass("pagination");var o=i[0],a=i[1];a&&o.init(a,e)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){var t={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},e={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},n={};this.options=function(t){angular.extend(n,t)},this.setTriggers=function(t){angular.extend(e,t)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(r,i,o,a,s,u,l,c,p){var d=p.createNew();function f(t){if(27===t.which){var e=d.top();e&&(e.value.close(),e=null)}}return a.on("keyup",f),l.$on("$destroy",function(){a.off("keyup",f)}),function(r,l,p,f){function h(t){var n=(t||f.trigger||p).split(" ");return{show:n,hide:n.map(function(t){return e[t]||t})}}f=angular.extend({},t,n,f);var g=r.replace(/[A-Z]/g,function(t,e){return(e?"-":"")+t.toLowerCase()}),m=u.startSymbol(),v=u.endSymbol(),y="<div "+g+'-popup uib-title="'+m+"title"+v+'" '+(f.useContentExp?'content-exp="contentExp()" ':'content="'+m+"content"+v+'" ')+'origin-scope="origScope" class="uib-position-measure '+l+'" tooltip-animation-class="fade"uib-tooltip-classes ng-class="{ in: isOpen }" ></div>';return{compile:function(t,e){var n=i(y);return function(t,e,i,u){var p,g,m,v,y,b,w,$,k=!!angular.isDefined(f.appendToBody)&&f.appendToBody,C=h(void 0),x=angular.isDefined(i[l+"Enable"]),T=t.$new(!0),S=!1,E=!!angular.isDefined(i[l+"IsOpen"])&&c(i[l+"IsOpen"]),D=!!f.useContentExp&&c(i[r]),A=[],B=function(){p&&p.html()&&(b||(b=o(function(){var t=s.positionElements(e,p,T.placement,k),n=angular.isDefined(p.offsetHeight)?p.offsetHeight:p.prop("offsetHeight"),r=k?s.offset(e):s.position(e);p.css({top:t.top+"px",left:t.left+"px"});var i=t.placement.split("-");p.hasClass(i[0])||(p.removeClass($.split("-")[0]),p.addClass(i[0])),p.hasClass(f.placementClassPrefix+t.placement)||(p.removeClass(f.placementClassPrefix+$),p.addClass(f.placementClassPrefix+t.placement)),w=o(function(){var t=angular.isDefined(p.offsetHeight)?p.offsetHeight:p.prop("offsetHeight"),e=s.adjustTop(i,r,n,t);e&&p.css(e),w=null},0,!1),p.hasClass("uib-position-measure")?(s.positionArrow(p,t.placement),p.removeClass("uib-position-measure")):$!==t.placement&&s.positionArrow(p,t.placement),$=t.placement,b=null},0,!1)))};function I(){T.isOpen?M():O()}function O(){x&&!t.$eval(i[l+"Enable"])||(L(),function(){T.title=i[l+"Title"],T.content=D?D(t):i[r];T.popupClass=i[l+"Class"],T.placement=angular.isDefined(i[l+"Placement"])?i[l+"Placement"]:f.placement;var e=s.parsePlacement(T.placement);$=e[1]?e[0]+"-"+e[1]:e[0];var n=parseInt(i[l+"PopupDelay"],10),o=parseInt(i[l+"PopupCloseDelay"],10);T.popupDelay=isNaN(n)?f.popupDelay:n,T.popupCloseDelay=isNaN(o)?f.popupCloseDelay:o}(),T.popupDelay?v||(v=o(P,T.popupDelay,!1)):P())}function M(){_(),T.popupCloseDelay?y||(y=o(R,T.popupCloseDelay,!1)):R()}function P(){if(_(),L(),!T.content)return angular.noop;!function(){if(p)return;g=T.$new(),p=n(g,function(t){k?a.find("body").append(t):e.after(t)}),d.add(T,{close:R}),function(){A.length=0,D?(A.push(t.$watch(D,function(t){T.content=t,!t&&T.isOpen&&R()})),A.push(g.$watch(function(){S||(S=!0,g.$$postDigest(function(){S=!1,T&&T.isOpen&&B()}))}))):A.push(i.$observe(r,function(t){T.content=t,!t&&T.isOpen?R():B()}));A.push(i.$observe(l+"Title",function(t){T.title=t,T.isOpen&&B()})),A.push(i.$observe(l+"Placement",function(t){T.placement=t||f.placement,T.isOpen&&B()}))}()}(),T.$evalAsync(function(){T.isOpen=!0,U(!0),B()})}function _(){v&&(o.cancel(v),v=null),b&&(o.cancel(b),b=null)}function R(){T&&T.$evalAsync(function(){T&&(T.isOpen=!1,U(!1),T.animation?m||(m=o(N,150,!1)):N())})}function L(){y&&(o.cancel(y),y=null),m&&(o.cancel(m),m=null)}function N(){_(),L(),A.length&&(angular.forEach(A,function(t){t()}),A.length=0),p&&(p.remove(),p=null,w&&o.cancel(w)),d.remove(T),g&&(g.$destroy(),g=null)}function U(e){E&&angular.isFunction(E.assign)&&E.assign(t,e)}function j(t){T&&T.isOpen&&p&&(e[0].contains(t.target)||p[0].contains(t.target)||M())}function q(t){27===t.which&&M()}T.origScope=t,T.isOpen=!1,T.contentExp=function(){return T.content},i.$observe("disabled",function(t){t&&_(),t&&T.isOpen&&R()}),E&&t.$watch(E,function(t){T&&!t===T.isOpen&&I()});var F,V,z,H=function(){C.show.forEach(function(t){"outsideClick"===t?e.off("click",I):(e.off(t,O),e.off(t,I)),e.off("keypress",q)}),C.hide.forEach(function(t){"outsideClick"===t?a.off("click",j):e.off(t,M)})};F=[],V=[],z=t.$eval(i[l+"Trigger"]),H(),angular.isObject(z)?(Object.keys(z).forEach(function(t){F.push(t),V.push(z[t])}),C={show:F,hide:V}):C=h(z),"none"!==C.show&&C.show.forEach(function(t,n){"outsideClick"===t?(e.on("click",I),a.on("click",j)):t===C.hide[n]?e.on(t,I):t&&(e.on(t,O),e.on(C.hide[n],M)),e.on("keypress",q)});var K,W=t.$eval(i[l+"Animation"]);T.animation=angular.isDefined(W)?!!W:f.animation;var G=l+"AppendToBody";K=G in i&&void 0===i[G]||t.$eval(i[G]),k=angular.isDefined(K)?K:k,t.$on("$destroy",function(){H(),N(),T=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(t,e,n,r){return{link:function(i,o,a){var s,u,l,c=i.$eval(a.tooltipTemplateTranscludeScope),p=0,d=function(){u&&(u.remove(),u=null),s&&(s.$destroy(),s=null),l&&(t.leave(l).then(function(){u=null}),u=l,l=null)};i.$watch(e.parseAsResourceUrl(a.uibTooltipTemplateTransclude),function(e){var a=++p;e?(r(e,!0).then(function(r){if(a===p){var i=c.$new(),u=n(r)(i,function(e){d(),t.enter(e,o)});l=u,(s=i).$emit("$includeContentLoaded",e)}},function(){a===p&&(d(),i.$emit("$includeContentError",e))}),i.$emit("$includeContentRequested",e)):d()}),i.$on("$destroy",d)}}}]).directive("uibTooltipClasses",["$uibPosition",function(t){return{restrict:"A",link:function(e,n,r){if(e.placement){var i=t.parsePlacement(e.placement);n.addClass(i[0])}e.popupClass&&n.addClass(e.popupClass),e.animation&&n.addClass(r.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{restrict:"A",scope:{content:"@"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(t){return t("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{restrict:"A",scope:{contentExp:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(t){return t("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(t){return t("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{restrict:"A",scope:{uibTitle:"@",contentExp:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(t){return t("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&",uibTitle:"@"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(t){return t("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{restrict:"A",scope:{uibTitle:"@",content:"@"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(t){return t("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(t,e,n){var r=this,i=angular.isDefined(e.animate)?t.$parent.$eval(e.animate):n.animate;function o(){return angular.isDefined(t.maxParam)?t.maxParam:n.max}this.bars=[],t.max=o(),this.addBar=function(t,e,n){i||e.css({transition:"none"}),this.bars.push(t),t.max=o(),t.title=n&&angular.isDefined(n.title)?n.title:"progressbar",t.$watch("value",function(e){t.recalculatePercentage()}),t.recalculatePercentage=function(){var e=r.bars.reduce(function(t,e){return e.percent=+(100*e.value/e.max).toFixed(2),t+e.percent},0);e>100&&(t.percent-=e-100)},t.$on("$destroy",function(){e=null,r.removeBar(t)})},this.removeBar=function(t){this.bars.splice(this.bars.indexOf(t),1),this.bars.forEach(function(t){t.recalculatePercentage()})},t.$watch("maxParam",function(t){r.bars.forEach(function(t){t.max=o(),t.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(t,e,n,r){r.addBar(t,e,n)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(t,e,n,r){r.addBar(t,angular.element(e.children()[0]),{title:n.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(t,e,n){var r={$setViewValue:angular.noop},i=this;this.init=function(i){(r=i).$render=this.render,r.$formatters.push(function(t){return angular.isNumber(t)&&t<<0!==t&&(t=Math.round(t)),t}),this.stateOn=angular.isDefined(e.stateOn)?t.$parent.$eval(e.stateOn):n.stateOn,this.stateOff=angular.isDefined(e.stateOff)?t.$parent.$eval(e.stateOff):n.stateOff,this.enableReset=angular.isDefined(e.enableReset)?t.$parent.$eval(e.enableReset):n.enableReset;var o=angular.isDefined(e.titles)?t.$parent.$eval(e.titles):n.titles;this.titles=angular.isArray(o)&&o.length>0?o:n.titles;var a=angular.isDefined(e.ratingStates)?t.$parent.$eval(e.ratingStates):new Array(angular.isDefined(e.max)?t.$parent.$eval(e.max):n.max);t.range=this.buildTemplateObjects(a)},this.buildTemplateObjects=function(t){for(var e=0,n=t.length;e<n;e++)t[e]=angular.extend({index:e},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(e)},t[e]);return t},this.getTitle=function(t){return t>=this.titles.length?t+1:this.titles[t]},t.rate=function(e){if(!t.readonly&&e>=0&&e<=t.range.length){var n=i.enableReset&&r.$viewValue===e?0:e;r.$setViewValue(n),r.$render()}},t.enter=function(e){t.readonly||(t.value=e),t.onHover({value:e})},t.reset=function(){t.value=r.$viewValue,t.onLeave()},t.onKeydown=function(e){/(37|38|39|40)/.test(e.which)&&(e.preventDefault(),e.stopPropagation(),t.rate(t.value+(38===e.which||39===e.which?1:-1)))},this.render=function(){t.value=r.$viewValue,t.title=i.getTitle(t.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],restrict:"A",scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",link:function(t,e,n,r){var i=r[0],o=r[1];i.init(o)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(t){var e,n,r=this;function i(t){for(var e=0;e<r.tabs.length;e++)if(r.tabs[e].index===t)return e}r.tabs=[],r.select=function(t,o){if(!n){var a=i(e),s=r.tabs[a];if(s){if(s.tab.onDeselect({$event:o,$selectedIndex:t}),o&&o.isDefaultPrevented())return;s.tab.active=!1}var u=r.tabs[t];u?(u.tab.onSelect({$event:o}),u.tab.active=!0,r.active=u.index,e=u.index):!u&&angular.isDefined(e)&&(r.active=null,e=null)}},r.addTab=function(t){if(r.tabs.push({tab:t,index:t.index}),r.tabs.sort(function(t,e){return t.index>e.index?1:t.index<e.index?-1:0}),t.index===r.active||!angular.isDefined(r.active)&&1===r.tabs.length){var e=i(t.index);r.select(e)}},r.removeTab=function(t){for(var e,n=0;n<r.tabs.length;n++)if(r.tabs[n].tab===t){e=n;break}if(r.tabs[e].index===r.active){var i=e===r.tabs.length-1?e-1:e+1%r.tabs.length;r.select(i)}r.tabs.splice(e,1)},t.$watch("tabset.active",function(t){angular.isDefined(t)&&t!==e&&r.select(i(t))}),t.$on("$destroy",function(){n=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{},bindToController:{active:"=?",type:"@"},controller:"UibTabsetController",controllerAs:"tabset",templateUrl:function(t,e){return e.templateUrl||"uib/template/tabs/tabset.html"},link:function(t,e,n){t.vertical=!!angular.isDefined(n.vertical)&&t.$parent.$eval(n.vertical),t.justified=!!angular.isDefined(n.justified)&&t.$parent.$eval(n.justified)}}}).directive("uibTab",["$parse",function(t){return{require:"^uibTabset",replace:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/tabs/tab.html"},transclude:!0,scope:{heading:"@",index:"=?",classes:"@?",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(e,n,r,i,o){e.disabled=!1,r.disable&&e.$parent.$watch(t(r.disable),function(t){e.disabled=!!t}),angular.isUndefined(r.index)&&(i.tabs&&i.tabs.length?e.index=Math.max.apply(null,i.tabs.map(function(t){return t.index}))+1:e.index=0),angular.isUndefined(r.classes)&&(e.classes=""),e.select=function(t){if(!e.disabled){for(var n,r=0;r<i.tabs.length;r++)if(i.tabs[r].tab===e){n=r;break}i.select(n,t)}},i.addTab(e),e.$on("$destroy",function(){i.removeTab(e)}),e.$transcludeFn=o}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(t,e){t.$watch("headingElement",function(t){t&&(e.html(""),e.append(t))})}}}).directive("uibTabContentTransclude",function(){return{restrict:"A",require:"^uibTabset",link:function(t,e,n){var r=t.$eval(n.uibTabContentTransclude).tab;r.$transcludeFn(r.$parent,function(t){angular.forEach(t,function(t){var n;(n=t).tagName&&(n.hasAttribute("uib-tab-heading")||n.hasAttribute("data-uib-tab-heading")||n.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===n.tagName.toLowerCase()||"data-uib-tab-heading"===n.tagName.toLowerCase()||"x-uib-tab-heading"===n.tagName.toLowerCase()||"uib:tab-heading"===n.tagName.toLowerCase())?r.headingElement=t:e.append(t)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("uibTimepickerConfig",{hourStep:1,minuteStep:1,secondStep:1,showMeridian:!0,showSeconds:!1,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0,templateUrl:"uib/template/timepicker/timepicker.html"}).controller("UibTimepickerController",["$scope","$element","$attrs","$parse","$log","$locale","uibTimepickerConfig",function(t,e,n,r,i,o,a){var s,u,l,c=new Date,p=[],d={$setViewValue:angular.noop},f=angular.isDefined(n.meridians)?t.$parent.$eval(n.meridians):a.meridians||o.DATETIME_FORMATS.AMPMS,h=!angular.isDefined(n.padHours)||t.$parent.$eval(n.padHours);t.tabindex=angular.isDefined(n.tabindex)?n.tabindex:0,e.removeAttr("tabindex"),this.init=function(e,r){(d=e).$render=this.render,d.$formatters.unshift(function(t){return t?new Date(t):null});var i=r.eq(0),o=r.eq(1),c=r.eq(2);s=i.controller("ngModel"),u=o.controller("ngModel"),l=c.controller("ngModel"),(angular.isDefined(n.mousewheel)?t.$parent.$eval(n.mousewheel):a.mousewheel)&&this.setupMousewheelEvents(i,o,c),(angular.isDefined(n.arrowkeys)?t.$parent.$eval(n.arrowkeys):a.arrowkeys)&&this.setupArrowkeyEvents(i,o,c),t.readonlyInput=angular.isDefined(n.readonlyInput)?t.$parent.$eval(n.readonlyInput):a.readonlyInput,this.setupInputEvents(i,o,c)};var g=a.hourStep;n.hourStep&&p.push(t.$parent.$watch(r(n.hourStep),function(t){g=+t}));var m,v,y=a.minuteStep;n.minuteStep&&p.push(t.$parent.$watch(r(n.minuteStep),function(t){y=+t})),p.push(t.$parent.$watch(r(n.min),function(t){var e=new Date(t);m=isNaN(e)?void 0:e})),p.push(t.$parent.$watch(r(n.max),function(t){var e=new Date(t);v=isNaN(e)?void 0:e}));var b=!1;n.ngDisabled&&p.push(t.$parent.$watch(r(n.ngDisabled),function(t){b=t})),t.noIncrementHours=function(){var t=D(c,60*g);return b||t>v||t<c&&t<m},t.noDecrementHours=function(){var t=D(c,60*-g);return b||t<m||t>c&&t>v},t.noIncrementMinutes=function(){var t=D(c,y);return b||t>v||t<c&&t<m},t.noDecrementMinutes=function(){var t=D(c,-y);return b||t<m||t>c&&t>v},t.noIncrementSeconds=function(){var t=A(c,w);return b||t>v||t<c&&t<m},t.noDecrementSeconds=function(){var t=A(c,-w);return b||t<m||t>c&&t>v},t.noToggleMeridian=function(){return c.getHours()<12?b||D(c,720)>v:b||D(c,-720)<m};var w=a.secondStep;function $(){var e=+t.hours;if((t.showMeridian?e>0&&e<13:e>=0&&e<24)&&""!==t.hours)return t.showMeridian&&(12===e&&(e=0),t.meridian===f[1]&&(e+=12)),e}function k(){var e=+t.minutes;if(e>=0&&e<60&&""!==t.minutes)return e}function C(t,e){return null===t?"":angular.isDefined(t)&&t.toString().length<2&&!e?"0"+t:t.toString()}function x(t){T(),d.$setViewValue(new Date(c)),S(t)}function T(){s&&s.$setValidity("hours",!0),u&&u.$setValidity("minutes",!0),l&&l.$setValidity("seconds",!0),d.$setValidity("time",!0),t.invalidHours=!1,t.invalidMinutes=!1,t.invalidSeconds=!1}function S(e){if(d.$modelValue){var n=c.getHours(),r=c.getMinutes(),i=c.getSeconds();t.showMeridian&&(n=0===n||12===n?12:n%12),t.hours="h"===e?n:C(n,!h),"m"!==e&&(t.minutes=C(r)),t.meridian=c.getHours()<12?f[0]:f[1],"s"!==e&&(t.seconds=C(i)),t.meridian=c.getHours()<12?f[0]:f[1]}else t.hours=null,t.minutes=null,t.seconds=null,t.meridian=f[0]}function E(t){c=A(c,t),x()}function D(t,e){return A(t,60*e)}function A(t,e){var n=new Date(t.getTime()+1e3*e),r=new Date(t);return r.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),r}function B(){return(null===t.hours||""===t.hours)&&(null===t.minutes||""===t.minutes)&&(!t.showSeconds||t.showSeconds&&(null===t.seconds||""===t.seconds))}n.secondStep&&p.push(t.$parent.$watch(r(n.secondStep),function(t){w=+t})),t.showSeconds=a.showSeconds,n.showSeconds&&p.push(t.$parent.$watch(r(n.showSeconds),function(e){t.showSeconds=!!e})),t.showMeridian=a.showMeridian,n.showMeridian&&p.push(t.$parent.$watch(r(n.showMeridian),function(e){if(t.showMeridian=!!e,d.$error.time){var n=$(),r=k();angular.isDefined(n)&&angular.isDefined(r)&&(c.setHours(n),x())}else S()})),this.setupMousewheelEvents=function(e,n,r){var i=function(t){t.originalEvent&&(t=t.originalEvent);var e=t.wheelDelta?t.wheelDelta:-t.deltaY;return t.detail||e>0};e.on("mousewheel wheel",function(e){b||t.$apply(i(e)?t.incrementHours():t.decrementHours()),e.preventDefault()}),n.on("mousewheel wheel",function(e){b||t.$apply(i(e)?t.incrementMinutes():t.decrementMinutes()),e.preventDefault()}),r.on("mousewheel wheel",function(e){b||t.$apply(i(e)?t.incrementSeconds():t.decrementSeconds()),e.preventDefault()})},this.setupArrowkeyEvents=function(e,n,r){e.on("keydown",function(e){b||(38===e.which?(e.preventDefault(),t.incrementHours(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementHours(),t.$apply()))}),n.on("keydown",function(e){b||(38===e.which?(e.preventDefault(),t.incrementMinutes(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementMinutes(),t.$apply()))}),r.on("keydown",function(e){b||(38===e.which?(e.preventDefault(),t.incrementSeconds(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementSeconds(),t.$apply()))})},this.setupInputEvents=function(e,n,r){if(t.readonlyInput)return t.updateHours=angular.noop,t.updateMinutes=angular.noop,void(t.updateSeconds=angular.noop);var i=function(e,n,r){d.$setViewValue(null),d.$setValidity("time",!1),angular.isDefined(e)&&(t.invalidHours=e,s&&s.$setValidity("hours",!1)),angular.isDefined(n)&&(t.invalidMinutes=n,u&&u.$setValidity("minutes",!1)),angular.isDefined(r)&&(t.invalidSeconds=r,l&&l.$setValidity("seconds",!1))};t.updateHours=function(){var t=$(),e=k();d.$setDirty(),angular.isDefined(t)&&angular.isDefined(e)?(c.setHours(t),c.setMinutes(e),c<m||c>v?i(!0):x("h")):i(!0)},e.on("blur",function(e){d.$setTouched(),B()?T():null===t.hours||""===t.hours?i(!0):!t.invalidHours&&t.hours<10&&t.$apply(function(){t.hours=C(t.hours,!h)})}),t.updateMinutes=function(){var t=k(),e=$();d.$setDirty(),angular.isDefined(t)&&angular.isDefined(e)?(c.setHours(e),c.setMinutes(t),c<m||c>v?i(void 0,!0):x("m")):i(void 0,!0)},n.on("blur",function(e){d.$setTouched(),B()?T():null===t.minutes?i(void 0,!0):!t.invalidMinutes&&t.minutes<10&&t.$apply(function(){t.minutes=C(t.minutes)})}),t.updateSeconds=function(){var e,n=(e=+t.seconds)>=0&&e<60?e:void 0;d.$setDirty(),angular.isDefined(n)?(c.setSeconds(n),x("s")):i(void 0,void 0,!0)},r.on("blur",function(e){B()?T():!t.invalidSeconds&&t.seconds<10&&t.$apply(function(){t.seconds=C(t.seconds)})})},this.render=function(){var e=d.$viewValue;isNaN(e)?(d.$setValidity("time",!1),i.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(e&&(c=e),c<m||c>v?(d.$setValidity("time",!1),t.invalidHours=!0,t.invalidMinutes=!0):T(),S())},t.showSpinners=angular.isDefined(n.showSpinners)?t.$parent.$eval(n.showSpinners):a.showSpinners,t.incrementHours=function(){t.noIncrementHours()||E(60*g*60)},t.decrementHours=function(){t.noDecrementHours()||E(60*-g*60)},t.incrementMinutes=function(){t.noIncrementMinutes()||E(60*y)},t.decrementMinutes=function(){t.noDecrementMinutes()||E(60*-y)},t.incrementSeconds=function(){t.noIncrementSeconds()||E(w)},t.decrementSeconds=function(){t.noDecrementSeconds()||E(-w)},t.toggleMeridian=function(){var e=k(),n=$();t.noToggleMeridian()||(angular.isDefined(e)&&angular.isDefined(n)?E(720*(c.getHours()<12?60:-60)):t.meridian=t.meridian===f[0]?f[1]:f[0])},t.blur=function(){d.$setTouched()},t.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(t){return{require:["uibTimepicker","?^ngModel"],restrict:"A",controller:"UibTimepickerController",controllerAs:"timepicker",scope:{},templateUrl:function(e,n){return n.templateUrl||t.templateUrl},link:function(t,e,n,r){var i=r[0],o=r[1];o&&i.init(o,e.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(t){var e=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(n){var r=n.match(e);if(!r)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+n+'".');return{itemName:r[3],source:t(r[4]),viewMapper:t(r[2]||r[1]),modelMapper:t(r[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(t,e,n,r,i,o,a,s,u,l,c,p,d){var f,h,g=[9,13,27,38,40],m=t.$eval(n.typeaheadMinLength);m||0===m||(m=1),t.$watch(n.typeaheadMinLength,function(t){m=t||0===t?t:1});var v=t.$eval(n.typeaheadWaitMs)||0,y=!1!==t.$eval(n.typeaheadEditable);t.$watch(n.typeaheadEditable,function(t){y=!1!==t});var b,w,$=i(n.typeaheadLoading).assign||angular.noop,k=n.typeaheadShouldSelect?i(n.typeaheadShouldSelect):function(t,e){var n=e.$event;return 13===n.which||9===n.which},C=i(n.typeaheadOnSelect),x=!!angular.isDefined(n.typeaheadSelectOnBlur)&&t.$eval(n.typeaheadSelectOnBlur),T=i(n.typeaheadNoResults).assign||angular.noop,S=n.typeaheadInputFormatter?i(n.typeaheadInputFormatter):void 0,E=!!n.typeaheadAppendToBody&&t.$eval(n.typeaheadAppendToBody),D=n.typeaheadAppendTo?t.$eval(n.typeaheadAppendTo):null,A=!1!==t.$eval(n.typeaheadFocusFirst),B=!!n.typeaheadSelectOnExact&&t.$eval(n.typeaheadSelectOnExact),I=i(n.typeaheadIsOpen).assign||angular.noop,O=t.$eval(n.typeaheadShowHint)||!1,M=i(n.ngModel),P=i(n.ngModel+"($$$p)"),_=d.parse(n.uibTypeahead),R=t.$new(),L=t.$on("$destroy",function(){R.$destroy()});R.$on("$destroy",L);var N,U,j="typeahead-"+R.$id+"-"+Math.floor(1e4*Math.random());e.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":j}),O&&((N=angular.element("<div></div>")).css("position","relative"),e.after(N),(U=e.clone()).attr("placeholder",""),U.attr("tabindex","-1"),U.val(""),U.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),e.css({position:"relative","vertical-align":"top","background-color":"transparent"}),U.attr("id")&&U.removeAttr("id"),N.append(U),U.after(e));var q=angular.element("<div uib-typeahead-popup></div>");q.attr({id:j,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(n.typeaheadTemplateUrl)&&q.attr("template-url",n.typeaheadTemplateUrl),angular.isDefined(n.typeaheadPopupTemplateUrl)&&q.attr("popup-template-url",n.typeaheadPopupTemplateUrl);var F=function(){R.matches=[],R.activeIdx=-1,e.attr("aria-expanded",!1),O&&U.val("")},V=function(t){return j+"-option-"+t};R.$watch("activeIdx",function(t){t<0?e.removeAttr("aria-activedescendant"):e.attr("aria-activedescendant",V(t))});var z=function(n,r){var i={$viewValue:n};$(t,!0),T(t,!1),o.when(_.source(t,i)).then(function(o){var a,s,u=n===f.$viewValue;if(u&&b)if(o&&o.length>0){R.activeIdx=A?0:-1,T(t,!1),R.matches.length=0;for(var l=0;l<o.length;l++)i[_.itemName]=o[l],R.matches.push({id:V(l),label:_.viewMapper(R,i),model:o[l]});if(R.query=n,G(),e.attr("aria-expanded",!0),B&&1===R.matches.length&&(a=n,s=0,R.matches.length>s&&a&&a.toUpperCase()===R.matches[s].label.toUpperCase())&&(angular.isNumber(R.debounceUpdate)||angular.isObject(R.debounceUpdate)?c(function(){R.select(0,r)},angular.isNumber(R.debounceUpdate)?R.debounceUpdate:R.debounceUpdate.default):R.select(0,r)),O){var p=R.matches[0].label;angular.isString(n)&&n.length>0&&p.slice(0,n.length).toUpperCase()===n.toUpperCase()?U.val(n+p.slice(n.length)):U.val("")}}else F(),T(t,!0);u&&$(t,!1)},function(){F(),$(t,!1),T(t,!0)})};E&&(angular.element(u).on("resize",W),s.find("body").on("scroll",W));var H,K=c(function(){R.matches.length&&G(),R.moveInProgress=!1},200);function W(){R.moveInProgress||(R.moveInProgress=!0,R.$digest()),K()}function G(){R.position=E?p.offset(e):p.position(e),R.position.top+=e.prop("offsetHeight")}R.moveInProgress=!1,R.query=void 0;var Y=function(){H&&a.cancel(H)};F(),R.assignIsOpen=function(e){I(t,e)},R.select=function(r,i){var o,s,u,l,c={};w=!0,c[_.itemName]=s=R.matches[r].model,o=_.modelMapper(t,c),u=t,l=o,angular.isFunction(M(t))&&h.getOption("getterSetter")?P(u,{$$$p:l}):M.assign(u,l),f.$setValidity("editable",!0),f.$setValidity("parse",!0),C(t,{$item:s,$model:o,$label:_.viewMapper(t,c),$event:i}),F(),!1!==R.$eval(n.typeaheadFocusOnSelect)&&a(function(){e[0].focus()},0,!1)},e.on("keydown",function(e){if(0!==R.matches.length&&-1!==g.indexOf(e.which)){var n,r=k(t,{$event:e});if(-1===R.activeIdx&&r||9===e.which&&e.shiftKey)return F(),void R.$digest();switch(e.preventDefault(),e.which){case 27:e.stopPropagation(),F(),t.$digest();break;case 38:R.activeIdx=(R.activeIdx>0?R.activeIdx:R.matches.length)-1,R.$digest(),(n=q[0].querySelectorAll(".uib-typeahead-match")[R.activeIdx]).parentNode.scrollTop=n.offsetTop;break;case 40:R.activeIdx=(R.activeIdx+1)%R.matches.length,R.$digest(),(n=q[0].querySelectorAll(".uib-typeahead-match")[R.activeIdx]).parentNode.scrollTop=n.offsetTop;break;default:r&&R.$apply(function(){angular.isNumber(R.debounceUpdate)||angular.isObject(R.debounceUpdate)?c(function(){R.select(R.activeIdx,e)},angular.isNumber(R.debounceUpdate)?R.debounceUpdate:R.debounceUpdate.default):R.select(R.activeIdx,e)})}}}),e.on("focus",function(t){b=!0,0!==m||f.$viewValue||a(function(){z(f.$viewValue,t)},0)}),e.on("blur",function(t){x&&R.matches.length&&-1!==R.activeIdx&&!w&&(w=!0,R.$apply(function(){angular.isObject(R.debounceUpdate)&&angular.isNumber(R.debounceUpdate.blur)?c(function(){R.select(R.activeIdx,t)},R.debounceUpdate.blur):R.select(R.activeIdx,t)})),!y&&f.$error.editable&&(f.$setViewValue(),R.$apply(function(){f.$setValidity("editable",!0),f.$setValidity("parse",!0)}),e.val("")),b=!1,w=!1});var Q=function(n){e[0]!==n.target&&3!==n.which&&0!==R.matches.length&&(F(),l.$$phase||t.$digest())};s.on("click",Q),t.$on("$destroy",function(){s.off("click",Q),(E||D)&&Z.remove(),E&&(angular.element(u).off("resize",W),s.find("body").off("scroll",W)),q.remove(),O&&N.remove()});var Z=r(q)(R);E?s.find("body").append(Z):D?angular.element(D).eq(0).append(Z):e.after(Z),this.init=function(e){h=function(t){var e;angular.version.minor<6?(e=t.$options||{}).getOption=function(t){return e[t]}:e=t.$options;return e}(f=e),R.debounceUpdate=i(h.getOption("debounce"))(t),f.$parsers.unshift(function(e){var n;return b=!0,0===m||e&&e.length>=m?v>0?(Y(),n=e,H=a(function(){z(n)},v)):z(e):($(t,!1),Y(),F()),y?e:e?void f.$setValidity("editable",!1):(f.$setValidity("editable",!0),null)}),f.$formatters.push(function(e){var n,r={};return y||f.$setValidity("editable",!0),S?(r.$model=e,S(t,r)):(r[_.itemName]=e,n=_.viewMapper(t,r),r[_.itemName]=void 0,n!==_.viewMapper(t,r)?n:e)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","uibTypeahead"],link:function(t,e,n,r){r[1].init(r[0])}}}).directive("uibTypeaheadPopup",["$$debounce",function(t){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(t,e){return e.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(e,n,r){e.templateUrl=r.templateUrl,e.isOpen=function(){var t=e.matches.length>0;return e.assignIsOpen({isOpen:t}),t},e.isActive=function(t){return e.active===t},e.selectActive=function(t){e.active=t},e.selectMatch=function(n,r){var i=e.debounce();angular.isNumber(i)||angular.isObject(i)?t(function(){e.select({activeIdx:n,evt:r})},angular.isNumber(i)?i:i.default):e.select({activeIdx:n,evt:r})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(t,e,n){return{scope:{index:"=",match:"=",query:"="},link:function(r,i,o){var a=n(o.templateUrl)(r.$parent)||"uib/template/typeahead/typeahead-match.html";t(a).then(function(t){var n=angular.element(t.trim());i.replaceWith(n),e(n)(r)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(t,e,n){var r;return r=e.has("$sanitize"),function(e,i){return!r&&/<.*>/g.test(e)&&n.warn("Unsafe use of typeahead please use ngSanitize"),e=i?(""+e).replace(new RegExp(i.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"gi"),"<strong>$&</strong>"):e,r||(e=t.trustAsHtml(e)),e}}]),angular.module("uib/template/accordion/accordion-group.html",[]).run(["$templateCache",function(t){t.put("uib/template/accordion/accordion-group.html",'<div role="tab" id="{{::headingId}}" aria-selected="{{isOpen}}" class="panel-heading" ng-keypress="toggleOpen($event)">\n <h4 class="panel-title">\n <a role="button" data-toggle="collapse" href aria-expanded="{{isOpen}}" aria-controls="{{::panelId}}" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading" ng-disabled="isDisabled" uib-tabindex-toggle><span uib-accordion-header ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n</div>\n<div id="{{::panelId}}" aria-labelledby="{{::headingId}}" aria-hidden="{{!isOpen}}" role="tabpanel" class="panel-collapse collapse" uib-collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/accordion/accordion.html",[]).run(["$templateCache",function(t){t.put("uib/template/accordion/accordion.html",'<div role="tablist" class="panel-group" ng-transclude></div>')}]),angular.module("uib/template/alert/alert.html",[]).run(["$templateCache",function(t){t.put("uib/template/alert/alert.html",'<button ng-show="closeable" type="button" class="close" ng-click="close({$event: $event})">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n</button>\n<div ng-transclude></div>\n')}]),angular.module("uib/template/carousel/carousel.html",[]).run(["$templateCache",function(t){t.put("uib/template/carousel/carousel.html",'<div class="carousel-inner" ng-transclude></div>\n<a role="button" href class="left carousel-control" ng-click="prev()" ng-class="{ disabled: isPrevDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-left"></span>\n <span class="sr-only">previous</span>\n</a>\n<a role="button" href class="right carousel-control" ng-click="next()" ng-class="{ disabled: isNextDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-right"></span>\n <span class="sr-only">next</span>\n</a>\n<ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:indexOfSlide track by $index" ng-class="{ active: isActive(slide) }" ng-click="select(slide)">\n <span class="sr-only">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if="isActive(slide)">, currently active</span></span>\n </li>\n</ol>\n')}]),angular.module("uib/template/carousel/slide.html",[]).run(["$templateCache",function(t){t.put("uib/template/carousel/slide.html",'<div class="text-center" ng-transclude></div>\n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/datepicker.html",'<div ng-switch="datepickerMode">\n <div uib-daypicker ng-switch-when="day" tabindex="0" class="uib-daypicker"></div>\n <div uib-monthpicker ng-switch-when="month" tabindex="0" class="uib-monthpicker"></div>\n <div uib-yearpicker ng-switch-when="year" tabindex="0" class="uib-yearpicker"></div>\n</div>\n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/day.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::5 + showWeeks}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></button></th>\n </tr>\n <tr>\n <th ng-if="showWeeks" class="text-center"></th>\n <th ng-repeat="label in ::labels track by $index" class="text-center"><small aria-label="{{::label.full}}">{{::label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-weeks" ng-repeat="row in rows track by $index" role="row">\n <td ng-if="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row" class="uib-day text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default btn-sm"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/month.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::yearHeaderColspan}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-months" ng-repeat="row in rows track by $index" role="row">\n <td ng-repeat="dt in row" class="uib-month text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/popup.html",'<div>\n <ul class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" class="uib-button-bar">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select(\'today\', $event)" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select(null, $event)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText(\'close\') }}</button>\n </li>\n </ul>\n</div>\n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/year.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::columns - 2}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-years" ng-repeat="row in rows track by $index" role="row">\n <td ng-repeat="dt in row" class="uib-year text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepickerPopup/popup.html",'<ul role="presentation" class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" class="uib-button-bar">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select(\'today\', $event)" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select(null, $event)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')}]),angular.module("uib/template/modal/backdrop.html",[]).run(["$templateCache",function(t){t.put("uib/template/modal/backdrop.html",'<div class="modal-backdrop"\n uib-modal-animation-class="fade"\n modal-in-class="in"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("uib/template/modal/window.html",[]).run(["$templateCache",function(t){t.put("uib/template/modal/window.html","<div class=\"modal-dialog {{size ? 'modal-' + size : ''}}\"><div class=\"modal-content\" uib-modal-transclude></div></div>\n")}]),angular.module("uib/template/pager/pager.html",[]).run(["$templateCache",function(t){t.put("uib/template/pager/pager.html",'<li ng-class="{disabled: noPrevious()||ngDisabled, previous: align}"><a href ng-click="selectPage(page - 1, $event)" ng-disabled="noPrevious()||ngDisabled" uib-tabindex-toggle>{{::getText(\'previous\')}}</a></li>\n<li ng-class="{disabled: noNext()||ngDisabled, next: align}"><a href ng-click="selectPage(page + 1, $event)" ng-disabled="noNext()||ngDisabled" uib-tabindex-toggle>{{::getText(\'next\')}}</a></li>\n')}]),angular.module("uib/template/pagination/pagination.html",[]).run(["$templateCache",function(t){t.put("uib/template/pagination/pagination.html",'<li role="menuitem" ng-if="::boundaryLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-first"><a href ng-click="selectPage(1, $event)" ng-disabled="noPrevious()||ngDisabled" uib-tabindex-toggle>{{::getText(\'first\')}}</a></li>\n<li role="menuitem" ng-if="::directionLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-prev"><a href ng-click="selectPage(page - 1, $event)" ng-disabled="noPrevious()||ngDisabled" uib-tabindex-toggle>{{::getText(\'previous\')}}</a></li>\n<li role="menuitem" ng-repeat="page in pages track by $index" ng-class="{active: page.active,disabled: ngDisabled&&!page.active}" class="pagination-page"><a href ng-click="selectPage(page.number, $event)" ng-disabled="ngDisabled&&!page.active" uib-tabindex-toggle>{{page.text}}</a></li>\n<li role="menuitem" ng-if="::directionLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-next"><a href ng-click="selectPage(page + 1, $event)" ng-disabled="noNext()||ngDisabled" uib-tabindex-toggle>{{::getText(\'next\')}}</a></li>\n<li role="menuitem" ng-if="::boundaryLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-last"><a href ng-click="selectPage(totalPages, $event)" ng-disabled="noNext()||ngDisabled" uib-tabindex-toggle>{{::getText(\'last\')}}</a></li>\n')}]),angular.module("uib/template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-html-popup.html",'<div class="tooltip-arrow"></div>\n<div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n')}]),angular.module("uib/template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-popup.html",'<div class="tooltip-arrow"></div>\n<div class="tooltip-inner" ng-bind="content"></div>\n')}]),angular.module("uib/template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-template-popup.html",'<div class="tooltip-arrow"></div>\n<div class="tooltip-inner"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n')}]),angular.module("uib/template/popover/popover-html.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover-html.html",'<div class="arrow"></div>\n\n<div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind-html="contentExp()"></div>\n</div>\n')}]),angular.module("uib/template/popover/popover-template.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover-template.html",'<div class="arrow"></div>\n\n<div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')}]),angular.module("uib/template/popover/popover.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover.html",'<div class="arrow"></div>\n\n<div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind="content"></div>\n</div>\n')}]),angular.module("uib/template/progressbar/bar.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n')}]),angular.module("uib/template/progressbar/progress.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/progress.html",'<div class="progress" ng-transclude aria-labelledby="{{::title}}"></div>')}]),angular.module("uib/template/progressbar/progressbar.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/rating/rating.html",[]).run(["$templateCache",function(t){t.put("uib/template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}" aria-valuetext="{{title}}">\n <span ng-repeat-start="r in range track by $index" class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n <i ng-repeat-end ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')" ng-attr-title="{{r.title}}"></i>\n</span>\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(t){t.put("uib/template/tabs/tab.html",'<li ng-class="[{active: active, disabled: disabled}, classes]" class="uib-tab nav-item">\n <a href ng-click="select($event)" class="nav-link" uib-tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(t){t.put("uib/template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{tabset.type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane"\n ng-repeat="tab in tabset.tabs"\n ng-class="{active: tabset.active === tab.index}"\n uib-tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("uib/template/timepicker/timepicker.html",[]).run(["$templateCache",function(t){t.put("uib/template/timepicker/timepicker.html",'<table class="uib-timepicker">\n <tbody>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-increment hours"><a ng-click="incrementHours()" ng-class="{disabled: noIncrementHours()}" class="btn btn-link" ng-disabled="noIncrementHours()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-increment minutes"><a ng-click="incrementMinutes()" ng-class="{disabled: noIncrementMinutes()}" class="btn btn-link" ng-disabled="noIncrementMinutes()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-increment seconds"><a ng-click="incrementSeconds()" ng-class="{disabled: noIncrementSeconds()}" class="btn btn-link" ng-disabled="noIncrementSeconds()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group uib-time hours" ng-class="{\'has-error\': invalidHours}">\n <input type="text" placeholder="HH" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementHours()" ng-blur="blur()">\n </td>\n <td class="uib-separator">:</td>\n <td class="form-group uib-time minutes" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" placeholder="MM" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementMinutes()" ng-blur="blur()">\n </td>\n <td ng-show="showSeconds" class="uib-separator">:</td>\n <td class="form-group uib-time seconds" ng-class="{\'has-error\': invalidSeconds}" ng-show="showSeconds">\n <input type="text" placeholder="SS" ng-model="seconds" ng-change="updateSeconds()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementSeconds()" ng-blur="blur()">\n </td>\n <td ng-show="showMeridian" class="uib-time am-pm"><button type="button" ng-class="{disabled: noToggleMeridian()}" class="btn btn-default text-center" ng-click="toggleMeridian()" ng-disabled="noToggleMeridian()" tabindex="{{::tabindex}}">{{meridian}}</button></td>\n </tr>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-decrement hours"><a ng-click="decrementHours()" ng-class="{disabled: noDecrementHours()}" class="btn btn-link" ng-disabled="noDecrementHours()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-decrement minutes"><a ng-click="decrementMinutes()" ng-class="{disabled: noDecrementMinutes()}" class="btn btn-link" ng-disabled="noDecrementMinutes()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-decrement seconds"><a ng-click="decrementSeconds()" ng-class="{disabled: noDecrementSeconds()}" class="btn btn-link" ng-disabled="noDecrementSeconds()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(t){t.put("uib/template/typeahead/typeahead-match.html",'<a href\n tabindex="-1"\n ng-bind-html="match.label | uibTypeaheadHighlight:query"\n ng-attr-title="{{match.label}}"></a>\n')}]),angular.module("uib/template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen() && !moveInProgress" ng-style="{top: position().top+\'px\', left: position().left+\'px\'}" role="listbox" aria-hidden="{{!isOpen()}}">\n <li class="uib-typeahead-match" ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index, $event)" role="option" id="{{::match.id}}">\n <div uib-typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>'),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-time input{width:50px;}</style>'),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>'),angular.$$uibTypeaheadCss=!0}),function(t,e,n){"use strict";e.module("angulartics.google.analytics",["angulartics"]).config(["$analyticsProvider",function(n){n.settings.pageTracking.trackRelativePath=!0,n.settings.ga={additionalAccountNames:void 0,additionalAccountHitTypes:{pageview:!0,event:!0,exception:!1,ecommerce:!1,userTiming:!1,setUserProperties:!1,userId:!1},disableEventTracking:null,disablePageTracking:null,enhancedEcommerce:!1,transport:null,userId:null},n.registerPageTrack(function(t,i){i=i||{},n.settings.ga.disablePageTracking||r("pageview","send",e.extend({},i,{hitType:"pageview",page:t}))}),n.registerEventTrack(function(i,o){if(!n.settings.ga.disableEventTracking&&(i||i+""=="0")){if((o=o||{}).category=o.category||"Event",o.value){var a=parseInt(o.value,10);o.value=isNaN(a)?0:a}e.isFunction(o.hitCallback)||(o.hitCallback=null),o.nonInteraction=o.nonInteraction||o.noninteraction,r("event","send",e.extend({},o,{hitType:"event",eventCategory:o.category,eventAction:i,eventLabel:o.label,eventValue:o.value,nonInteraction:o.nonInteraction,page:o.page||t.location.hash.substring(1)||t.location.pathname,hitCallback:o.hitCallback}))}}),n.registerExceptionTrack(function(e,n){r("exception","send",{hitType:"event",eventCategory:"Exceptions",eventAction:e.toString(),eventLabel:e.stack,nonInteraction:!0,page:t.location.hash.substring(1)||t.location.pathname,isException:!0})}),n.registerSetUsername(function(t){n.settings.ga.userId=t}),n.registerSetUserProperties(function(t){t&&r("setUserProperties","set",function(t){var e,n={};for(e in t)e.indexOf("dimension")&&e.indexOf("metric")||(n[e]=t[e]);return n}(t))}),n.registerUserTimings(function(n){if(!e.isObject(n)||e.isArray(n))return console.log("Required argument properties is missing or not an object");e.forEach(["timingCategory","timingVar","timingValue"],function(t){if(e.isUndefined(n[t]))return console.log("Argument properties missing required property "+t)}),r("userTiming","send",{hitType:"timing",timingCategory:n.timingCategory,timingVar:n.timingVar,timingValue:n.timingValue,timingLabel:n.timingLabel,optSampleRate:n.optSampleRate,page:n.page||t.location.hash.substring(1)||t.location.pathname})}),n.registerTransactionTrack(function(t){var n,i;if(r("ecommerce","require","ecommerce"),r("ecommerce","ecommerce:addTransaction",t),t.products)for(i=0;i<t.products.length;i++)(n=t.products[i]).sku=n.id,n.id=t.id,r("ecommerce","ecommerce:addItem",t.products[i]);t.currencyCode&&r("ecommerce","_set",t.currencyCode),r("ecommerce","ecommerce:send",e.copy(t))});var r=function(){var r,i;return e.isUndefined(t._gaq)||(r=function(r,i,o){if("set"===r)return console.log('Classic Analytics does not support the "set" command or Custom Dimensions. Command ignored.');var a;if("send"===r)switch(i.hitType){case"pageview":a=["_trackPageview",i.page];break;case"event":a=["_trackEvent",i.category,i.action,i.label,i.value,i.nonInteraction];break;case"timing":a=["_trackTiming",i.timingCategory,i.timingVar,i.timingValue,i.timingLabel,i.optSampleRate]}"ecommerce:addTransaction"===r&&(a=["_addTrans",i.id,i.affiliation,i.revenue,i.tax,i.shipping,i.billingCity,i.billingRegion,i.billingCountry]);"ecommerce:addItem"===r&&(a=["_addItem",i.id,i.sku,i.name,i.category,i.price,i.quantity]);"_set"===r&&(a=["_set","currencyCode",i]);"ecommerce:send"===r&&(a=["_trackTrans"]);if(!a)return console.log("Unable to find command "+r+" or fieldsObj missing required properties. Command ignored.");t._gaq.push(a),o&&e.forEach(n.settings.ga.additionalAccountNames,function(e){var n=[].slice.call(a);n[0]=e+"."+n[0],t._gaq.push(n)})}),(i=t.GoogleAnalyticsObject)&&t[i]&&(r=function(t,r,i){var a,s=n.settings.ga.userId;if("require"===t&&"ecommerce"===r)return a=r,n.settings.ga.enhancedEcommerce&&(a="ec"),o([t,a],i);s&&e.isObject(r)&&(r.userId=s);n.settings.ga.transport&&(r.transport=n.settings.ga.transport);if(t.indexOf("ecommerce:")>-1&&n.settings.ga.enhancedEcommerce)switch(t){case"ecommerce:addTransaction":t=["ec:setAction","purchase"];break;case"ecommerce:addItem":t="ec:addProduct",r.id=r.sku;break;case"ecommerce:send":t="send",r.hitType="event",r.eventCategory="Angulartics Enhanced Ecommerce",r.eventAction="Purchase",r.nonInteraction=!0}o(t instanceof Array?t.concat(r):[t,r],i)}),r?function(t,e,i){var o=n.settings.ga.additionalAccountHitTypes[t];r(e,i,o)}:e.noop;function o(r,i){var o,a=n.settings.ga.userId,s=t.GoogleAnalyticsObject;t[s].apply(this,r),i&&(o=e.copy(r),a&&!n.settings.ga.additionalAccountHitTypes.userId&&o[2]&&"object"==typeof o[2]&&delete o[2].userId,e.forEach(n.settings.ga.additionalAccountNames,function(e){o[0]=e+"."+o[0],t[s].apply(this,o)}))}}()}])}(window,window.angular),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Clipboard=t()}}(function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){var r=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}e.exports=function(t,e){for(;t&&t.nodeType!==r;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},{}],2:[function(t,e,n){var r=t("./closest");e.exports=function(t,e,n,i,o){var a=function(t,e,n,i){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&i.call(t,n)}}.apply(this,arguments);return t.addEventListener(n,a,o),{destroy:function(){t.removeEventListener(n,a,o)}}}},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){var r=t("./is"),i=t("delegate");e.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!r.string(e))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(t))return d=e,f=n,(p=t).addEventListener(d,f),{destroy:function(){p.removeEventListener(d,f)}};if(r.nodeList(t))return u=t,l=e,c=n,Array.prototype.forEach.call(u,function(t){t.addEventListener(l,c)}),{destroy:function(){Array.prototype.forEach.call(u,function(t){t.removeEventListener(l,c)})}};if(r.string(t))return o=t,a=e,s=n,i(document.body,o,a,s);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,a,s,u,l,c,p,d,f}},{"./is":3,delegate:2}],5:[function(t,e,n){e.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(t),r.removeAllRanges(),r.addRange(i),e=r.toString()}return e}},{}],6:[function(t,e,n){function r(){}r.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function i(){r.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,a=r.length;o<a;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}},e.exports=r},{}],7:[function(t,e,n){!function(r,i){if(void 0!==n)i(e,t("select"));else{var o={exports:{}};i(o,r.select),r.clipboardAction=o.exports}}(this,function(t,e){"use strict";var n,r=(n=e)&&n.__esModule?n:{default:n};var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},{select:5}],8:[function(t,e,n){!function(r,i){if(void 0!==n)i(e,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};i(o,r.clipboardAction,r.tinyEmitter,r.goodListener),r.clipboard=o.exports}}(this,function(t,e,n,r){"use strict";var i=s(e),o=s(n),a=s(r);function s(t){return t&&t.__esModule?t:{default:t}}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var l=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var c=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.resolveOptions(n),r.listenClick(t),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),l(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===u(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,a.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return p("action",t)}},{key:"defaultTarget",value:function(t){var e=p("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return p("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}();function p(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=c})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();n._onReady(n.init),t.Duo=n}}(this,function(){var t,e,n,r,i,o=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/,a=/^ERR\|[\w\s\.\(\)]+$/,s=/^DUO_OPEN_WINDOW\|/,u=["duo.com","duosecurity.com","duomobile.s3-us-west-1.amazonaws.com"],l="duo_iframe",c="",p="sig_response";function d(t,e){throw new Error("Duo Web SDK error: "+t+(e?"\nSee "+e+" for more information":""))}function f(t,e){return"dataset"in t?t.dataset[e]:t.getAttribute("data-"+e.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase())}function h(t,e,n,r){"addEventListener"in window?t.addEventListener(e,r,!1):t.attachEvent(n,r)}function g(t,e,n,r){"removeEventListener"in window?t.removeEventListener(e,r,!1):t.detachEvent(n,r)}function m(t){h(document,"DOMContentLoaded","onreadystatechange",t)}function v(t){g(document,"DOMContentLoaded","onreadystatechange",t)}function y(t){if(t){0===t.indexOf("ERR|")&&d(t.split("|")[1]),-1!==t.indexOf(":")&&2===t.split(":").length||d("Duo was given a bad token. This might indicate a configuration problem with one of Duo's client libraries.","https://www.duosecurity.com/docs/duoweb#first-steps");var r=t.split(":");return t,e=r[0],n=r[1],{sigRequest:t,duoSig:r[0],appSig:r[1]}}}function b(){if(!(r=document.getElementById(l)))throw new Error('This page does not contain an iframe for Duo to use.Add an element like <iframe id="duo_iframe"></iframe> to this page. See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe for more information.');k(),v(b)}function w(e){return Boolean(e.origin==="https://"+t&&"string"==typeof e.data&&(e.data.match(o)||e.data.match(a)||e.data.match(s)))}function $(t){if(w(t))if(t.data.match(s)){var e=t.data.substring("DUO_OPEN_WINDOW|".length);(function(t){if(!t)return!1;var e=document.createElement("a");{if(e.href=t,"duotrustedendpoints:"===e.protocol)return!0;if("https:"!==e.protocol)return!1}for(var n=0;n<u.length;n++)if(e.hostname.endsWith("."+u[n])||e.hostname===u[n])return!0;return!1})(e)&&window.open(e,"_self")}else C(t.data),g(window,"message","onmessage",$)}function k(){t||(t=f(r,"host"))||d("No API hostname is given for Duo to use. Be sure to pass a `host` parameter to Duo.init, or through the `data-host` attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe"),e&&n||(y(f(r,"sigRequest")),e&&n||d("No valid signed request is given. Be sure to give the `sig_request` parameter to Duo.init, or use the `data-sig-request` attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe")),""===c&&(c=f(r,"postAction")||c),"sig_response"===p&&(p=f(r,"postArgument")||p),r.src=["https://",t,"/frame/web/v1/auth?tx=",e,"&parent=",encodeURIComponent(document.location.href),"&v=2.6"].join(""),h(window,"message","onmessage",$)}function C(t){var e=document.createElement("input");e.type="hidden",e.name=p,e.value=t+":"+n;var o=document.getElementById("duo_form");o||(o=document.createElement("form"),r.parentElement.insertBefore(o,r.nextSibling)),o.method="POST",o.action=c,o.appendChild(e),"function"==typeof i?i.call(null,o):o.submit()}return{init:function e(n){n&&(n.host&&(t=n.host),n.sig_request&&y(n.sig_request),n.post_action&&(c=n.post_action),n.post_argument&&(p=n.post_argument),n.iframe&&(n.iframe.tagName?r=n.iframe:"string"==typeof n.iframe&&(l=n.iframe)),"function"==typeof n.submit_callback&&(i=n.submit_callback)),(r=document.getElementById(l))?k():m(b),v(e)},_onReady:m,_parseSigRequest:y,_isDuoMessage:w,_doPostBack:C}}),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.forge=e():t.forge=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,n){var r=n(0),i=t.exports=r.util=r.util||{};function o(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function a(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(i.isArrayBuffer(t)||i.isArrayBufferView(t)){var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var n=0;n<e.length;++n)this.putByte(e[n])}}else(t instanceof a||"object"==typeof t&&"string"==typeof t.data&&"number"==typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick)return i.nextTick=process.nextTick,void("function"==typeof setImmediate?i.setImmediate=setImmediate:i.setImmediate=i.nextTick);if("function"==typeof setImmediate)return i.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(i.nextTick=function(t){return setImmediate(t)});if(i.setImmediate=function(t){setTimeout(t,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var t="forge.setImmediate",e=[];i.setImmediate=function(n){e.push(n),1===e.length&&window.postMessage(t,"*")},window.addEventListener("message",function(n){if(n.source===window&&n.data===t){n.stopPropagation();var r=e.slice();e.length=0,r.forEach(function(t){t()})}},!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),r=!0,o=document.createElement("div");e=[];new MutationObserver(function(){var t=e.slice();e.length=0,t.forEach(function(t){t()})}).observe(o,{attributes:!0});var a=i.setImmediate;i.setImmediate=function(t){Date.now()-n>15?(n=Date.now(),a(t)):(e.push(t),1===e.length&&o.setAttribute("a",r=!r))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},i.isArrayBufferView=function(t){return t&&i.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},i.ByteBuffer=a,i.ByteStringBuffer=a;i.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},i.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var n=this.data;e>0;)1&e&&(n+=t),(e>>>=1)>0&&(t+=t);return this.data=n,this._optimizeConstructedString(e),this},i.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},i.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(i.encodeUtf8(t))},i.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},i.ByteStringBuffer.prototype.putInt=function(t,e){o(e);var n="";do{e-=8,n+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(n)},i.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},i.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},i.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},i.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},i.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t},i.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t},i.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},i.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t},i.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t},i.ByteStringBuffer.prototype.getInt=function(t){o(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},i.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),n=2<<t-2;return e>=n&&(e-=n<<1),e},i.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},i.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},i.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},i.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var t=i.createBuffer(this.data);return t.read=this.read,t},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var n=this.data.charCodeAt(e);n<16&&(t+="0"),t+=n.toString(16)}return t},i.ByteStringBuffer.prototype.toString=function(){return i.decodeUtf8(this.bytes())},i.DataBuffer=function(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var n=i.isArrayBuffer(t),r=i.isArrayBufferView(t);if(n||r)return this.data=n?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)},i.DataBuffer.prototype.length=function(){return this.write-this.read},i.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},i.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var n=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+e);return r.set(n),this.data=new DataView(r.buffer),this},i.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},i.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var n=0;n<e;++n)this.data.setUint8(t);return this},i.DataBuffer.prototype.putBytes=function(t,e){if(i.isArrayBufferView(t)){var n=(r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-r.byteOffset;return this.accommodate(n),new Uint8Array(this.data.buffer,this.write).set(r),this.write+=n,this}if(i.isArrayBuffer(t)){var r=new Uint8Array(t);return this.accommodate(r.byteLength),new Uint8Array(this.data.buffer).set(r,this.write),this.write+=r.byteLength,this}if(t instanceof i.DataBuffer||"object"==typeof t&&"number"==typeof t.read&&"number"==typeof t.write&&i.isArrayBufferView(t.data)){r=new Uint8Array(t.data.byteLength,t.read,t.length());return this.accommodate(r.byteLength),new Uint8Array(t.data.byteLength,this.write).set(r),this.write+=r.byteLength,this}if(t instanceof i.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"==typeof t){var o;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.hex.decode(t,o,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.base64.decode(t,o,this.write),this;if("utf8"===e&&(t=i.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.raw.decode(o),this;if("utf16"===e)return this.accommodate(2*t.length),o=new Uint16Array(this.data.buffer,this.write),this.write+=i.text.utf16.encode(o),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},i.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},i.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},i.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},i.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(t,e){o(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},i.DataBuffer.prototype.putSignedInt=function(t,e){return o(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},i.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},i.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},i.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},i.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},i.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},i.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},i.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},i.DataBuffer.prototype.getInt=function(t){o(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},i.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),n=2<<t-2;return e>=n&&(e-=n<<1),e},i.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},i.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},i.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},i.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var n=this.data.getUint8(e);n<16&&(t+="0"),t+=n.toString(16)}return t},i.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return i.binary.raw.encode(e);if("hex"===t)return i.binary.hex.encode(e);if("base64"===t)return i.binary.base64.encode(e);if("utf8"===t)return i.text.utf8.decode(e);if("utf16"===t)return i.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},i.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=i.encodeUtf8(t)),new i.ByteBuffer(t)},i.fillString=function(t,e){for(var n="";e>0;)1&e&&(n+=t),(e>>>=1)>0&&(t+=t);return n},i.xorBytes=function(t,e,n){for(var r="",i="",o="",a=0,s=0;n>0;--n,++a)i=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(r+=o,o="",s=0),o+=String.fromCharCode(i),++s;return r+=o},i.hexToBytes=function(t){var e="",n=0;for(!0&t.length&&(n=1,e+=String.fromCharCode(parseInt(t[0],16)));n<t.length;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e},i.bytesToHex=function(t){return i.createBuffer(t).toHex()},i.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];i.encode64=function(t,e){for(var n,r,i,o="",a="",u=0;u<t.length;)n=t.charCodeAt(u++),r=t.charCodeAt(u++),i=t.charCodeAt(u++),o+=s.charAt(n>>2),o+=s.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=s.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":s.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},i.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,n,r,i,o="",a=0;a<t.length;)e=u[t.charCodeAt(a++)-43],n=u[t.charCodeAt(a++)-43],r=u[t.charCodeAt(a++)-43],i=u[t.charCodeAt(a++)-43],o+=String.fromCharCode(e<<2|n>>4),64!==r&&(o+=String.fromCharCode((15&n)<<4|r>>2),64!==i&&(o+=String.fromCharCode((3&r)<<6|i)));return o},i.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},i.decodeUtf8=function(t){return decodeURIComponent(escape(t))},i.binary={raw:{},hex:{},base64:{}},i.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},i.binary.raw.decode=function(t,e,n){var r=e;r||(r=new Uint8Array(t.length));for(var i=n=n||0,o=0;o<t.length;++o)r[i++]=t.charCodeAt(o);return e?i-n:r},i.binary.hex.encode=i.bytesToHex,i.binary.hex.decode=function(t,e,n){var r=e;r||(r=new Uint8Array(Math.ceil(t.length/2)));var i=0,o=n=n||0;for(1&t.length&&(i=1,r[o++]=parseInt(t[0],16));i<t.length;i+=2)r[o++]=parseInt(t.substr(i,2),16);return e?o-n:r},i.binary.base64.encode=function(t,e){for(var n,r,i,o="",a="",u=0;u<t.byteLength;)n=t[u++],r=t[u++],i=t[u++],o+=s.charAt(n>>2),o+=s.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=s.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":s.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},i.binary.base64.decode=function(t,e,n){var r,i,o,a,s=e;s||(s=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var l=0,c=n=n||0;l<t.length;)r=u[t.charCodeAt(l++)-43],i=u[t.charCodeAt(l++)-43],o=u[t.charCodeAt(l++)-43],a=u[t.charCodeAt(l++)-43],s[c++]=r<<2|i>>4,64!==o&&(s[c++]=(15&i)<<4|o>>2,64!==a&&(s[c++]=(3&o)<<6|a));return e?c-n:s.subarray(0,c)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(t,e,n){t=i.encodeUtf8(t);var r=e;r||(r=new Uint8Array(t.length));for(var o=n=n||0,a=0;a<t.length;++a)r[o++]=t.charCodeAt(a);return e?o-n:r},i.text.utf8.decode=function(t){return i.decodeUtf8(String.fromCharCode.apply(null,t))},i.text.utf16.encode=function(t,e,n){var r=e;r||(r=new Uint8Array(2*t.length));for(var i=new Uint16Array(r.buffer),o=n=n||0,a=n,s=0;s<t.length;++s)i[a++]=t.charCodeAt(s),o+=2;return e?o-n:r},i.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},i.deflate=function(t,e,n){if(e=i.decode64(t.deflate(i.encode64(e)).rval),n){var r=2;32&e.charCodeAt(1)&&(r=6),e=e.substring(r,e.length-4)}return e},i.inflate=function(t,e,n){var r=t.inflate(i.encode64(e)).rval;return null===r?null:i.decode64(r)};var l=function(t,e,n){if(!t)throw new Error("WebStorage not available.");var r;if(null===n?r=t.removeItem(e):(n=i.encode64(JSON.stringify(n)),r=t.setItem(e,n)),void 0!==r&&!0!==r.rval){var o=new Error(r.error.message);throw o.id=r.error.id,o.name=r.error.name,o}},c=function(t,e){if(!t)throw new Error("WebStorage not available.");var n=t.getItem(e);if(t.init)if(null===n.rval){if(n.error){var r=new Error(n.error.message);throw r.id=n.error.id,r.name=n.error.name,r}n=null}else n=n.rval;return null!==n&&(n=JSON.parse(i.decode64(n))),n},p=function(t,e,n,r){var i=c(t,e);null===i&&(i={}),i[n]=r,l(t,e,i)},d=function(t,e,n){var r=c(t,e);return null!==r&&(r=n in r?r[n]:null),r},f=function(t,e,n){var r=c(t,e);if(null!==r&&n in r){delete r[n];var i=!0;for(var o in r){i=!1;break}i&&(r=null),l(t,e,r)}},h=function(t,e){l(t,e,null)},g=function(t,e,n){var r,i=null;void 0===n&&(n=["web","flash"]);var o=!1,a=null;for(var s in n){r=n[s];try{if("flash"===r||"both"===r){if(null===e[0])throw new Error("Flash local storage not available.");i=t.apply(this,e),o="flash"===r}"web"!==r&&"both"!==r||(e[0]=localStorage,i=t.apply(this,e),o=!0)}catch(t){a=t}if(o)break}if(!o)throw a;return i};i.setItem=function(t,e,n,r,i){g(p,arguments,i)},i.getItem=function(t,e,n,r){return g(d,arguments,r)},i.removeItem=function(t,e,n,r){g(f,arguments,r)},i.clearItems=function(t,e,n){g(h,arguments,n)},i.parseUrl=function(t){var e=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;e.lastIndex=0;var n=e.exec(t),r=null===n?null:{full:t,scheme:n[1],host:n[2],port:n[3],path:n[4]};return r&&(r.fullHost=r.host,r.port?80!==r.port&&"http"===r.scheme?r.fullHost+=":"+r.port:443!==r.port&&"https"===r.scheme&&(r.fullHost+=":"+r.port):"http"===r.scheme?r.port=80:"https"===r.scheme&&(r.port=443),r.full=r.scheme+"://"+r.fullHost),r};var m=null;i.getQueryVariables=function(t){var e,n=function(t){for(var e={},n=t.split("&"),r=0;r<n.length;r++){var i,o,a=n[r].indexOf("=");a>0?(i=n[r].substring(0,a),o=n[r].substring(a+1)):(i=n[r],o=null),i in e||(e[i]=[]),i in Object.prototype||null===o||e[i].push(unescape(o))}return e};return void 0===t?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?n(window.location.search.substring(1)):{}),e=m):e=n(t),e},i.parseFragment=function(t){var e=t,n="",r=t.indexOf("?");r>0&&(e=t.substring(0,r),n=t.substring(r+1));var o=e.split("/");return o.length>0&&""===o[0]&&o.shift(),{pathString:e,queryString:n,path:o,query:""===n?{}:i.getQueryVariables(n)}},i.makeRequest=function(t){var e=i.parseFragment(t),n={path:e.pathString,query:e.queryString,getPath:function(t){return void 0===t?e.path:e.path[t]},getQuery:function(t,n){var r;return void 0===t?r=e.query:(r=e.query[t])&&void 0!==n&&(r=r[n]),r},getQueryLast:function(t,e){var r=n.getQuery(t);return r?r[r.length-1]:e}};return n},i.makeLink=function(t,e,n){t=jQuery.isArray(t)?t.join("/"):t;var r=jQuery.param(e||{});return n=n||"",t+(r.length>0?"?"+r:"")+(n.length>0?"#"+n:"")},i.setPath=function(t,e,n){if("object"==typeof t&&null!==t)for(var r=0,i=e.length;r<i;){var o=e[r++];if(r==i)t[o]=n;else{var a=o in t;(!a||a&&"object"!=typeof t[o]||a&&null===t[o])&&(t[o]={}),t=t[o]}}},i.getPath=function(t,e,n){for(var r=0,i=e.length,o=!0;o&&r<i&&"object"==typeof t&&null!==t;){var a=e[r++];(o=a in t)&&(t=t[a])}return o?t:n},i.deletePath=function(t,e){if("object"==typeof t&&null!==t)for(var n=0,r=e.length;n<r;){var i=e[n++];if(n==r)delete t[i];else{if(!(i in t)||"object"!=typeof t[i]||null===t[i])break;t=t[i]}}},i.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},i.format=function(t){for(var e,n,r=/%./g,i=0,o=[],a=0;e=r.exec(t);){(n=t.substring(a,r.lastIndex-2)).length>0&&o.push(n),a=r.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(t.substring(a)),o.join("")},i.formatNumber=function(t,e,n,r){var i=t,o=isNaN(e=Math.abs(e))?2:e,a=void 0===n?",":n,s=void 0===r?".":r,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-l).toFixed(o).slice(2):"")},i.formatSize=function(t){return t=t>=1073741824?i.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?i.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?i.formatNumber(t/1024,0)+" KiB":i.formatNumber(t,0)+" bytes"},i.bytesFromIP=function(t){return-1!==t.indexOf(".")?i.bytesFromIPv4(t):-1!==t.indexOf(":")?i.bytesFromIPv6(t):null},i.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=i.createBuffer(),n=0;n<t.length;++n){var r=parseInt(t[n],10);if(isNaN(r))return null;e.putByte(r)}return e.getBytes()},i.bytesFromIPv6=function(t){for(var e=0,n=2*(8-(t=t.split(":").filter(function(t){return 0===t.length&&++e,!0})).length+e),r=i.createBuffer(),o=0;o<8;++o)if(t[o]&&0!==t[o].length){var a=i.hexToBytes(t[o]);a.length<2&&r.putByte(0),r.putBytes(a)}else r.fillWithByte(0,n),n=0;return r.getBytes()},i.bytesToIP=function(t){return 4===t.length?i.bytesToIPv4(t):16===t.length?i.bytesToIPv6(t):null},i.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e.join(".")},i.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],n=[],r=0,o=0;o<t.length;o+=2){for(var a=i.bytesToHex(t[o]+t[o+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=n[n.length-1],u=e.length;s&&u===s.end+1?(s.end=u,s.end-s.start>n[r].end-n[r].start&&(r=n.length-1)):n.push({start:u,end:u})}e.push(a)}if(n.length>0){var l=n[r];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),0===l.start&&e.unshift(""),7===l.end&&e.push(""))}return e.join(":")},i.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in i&&!t.update)return e(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,e(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,e(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,e(null,i.cores);var n=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),n=e+4;Date.now()<n;);self.postMessage({st:e,et:n})})}.toString(),")()"],{type:"application/javascript"}));!function t(r,o,a){if(0===o){var s=Math.floor(r.reduce(function(t,e){return t+e},0)/r.length);return i.cores=Math.max(1,s),URL.revokeObjectURL(n),e(null,i.cores)}!function(t,e){for(var r=[],i=[],o=0;o<t;++o){var a=new Worker(n);a.addEventListener("message",function(n){if(i.push(n.data),i.length===t){for(var o=0;o<t;++o)r[o].terminate();e(null,i)}}),r.push(a)}for(var o=0;o<t;++o)r[o].postMessage(o)}(a,function(e,n){r.push(function(t,e){for(var n=[],r=0;r<t;++r)for(var i=e[r],o=n[r]=[],a=0;a<t;++a)if(r!==a){var s=e[a];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&o.push(a)}return n.reduce(function(t,e){return Math.max(t,e.length)},0)}(a,n)),t(r,o-1,a)})}([],5,16)}},function(t,e,n){var r=n(0);t.exports=r.md=r.md||{},r.md.algorithms=r.md.algorithms||{}},function(t,e,n){var r=n(0);n(6),n(9),n(17),n(1),r.random&&r.random.getBytes?t.exports=r.random:function(e){var n={},i=new Array(4),o=r.util.createBuffer();function a(){var t=r.prng.create(n);return t.getBytes=function(e,n){return t.generate(e,n)},t.getBytesSync=function(e){return t.generate(e)},t}n.formatKey=function(t){var e=r.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),r.aes._expandKey(t,!1)},n.formatSeed=function(t){var e=r.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},n.cipher=function(t,e){return r.aes._updateBlock(t,e,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},n.increment=function(t){return++t[3],t},n.md=r.md.sha256;var s=a(),u=null;if("undefined"!=typeof window){var l=window.crypto||window.msCrypto;l&&l.getRandomValues&&(u=function(t){return l.getRandomValues(t)})}if(r.options.usePureJavaScript||!r.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var c="";for(var p in navigator)try{"string"==typeof navigator[p]&&(c+=navigator[p])}catch(t){}s.collect(c),c=null}e&&(e().mousemove(function(t){s.collectInt(t.clientX,16),s.collectInt(t.clientY,16)}),e().keypress(function(t){s.collectInt(t.charCode,8)}))}if(r.random)for(var p in s)r.random[p]=s[p];else r.random=s;r.random.createInstance=a,t.exports=r.random}("undefined"!=typeof jQuery?jQuery:null)},function(t,e,n){var r=n(0);n(2),n(1),(t.exports=r.hmac=r.hmac||{}).create=function(){var t=null,e=null,n=null,i=null,o={start:function(o,a){if(null!==o)if("string"==typeof o){if(!((o=o.toLowerCase())in r.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');e=r.md.algorithms[o].create()}else e=o;if(null===a)a=t;else{if("string"==typeof a)a=r.util.createBuffer(a);else if(r.util.isArray(a)){var s=a;a=r.util.createBuffer();for(var u=0;u<s.length;++u)a.putByte(s[u])}var l=a.length();l>e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),n=r.util.createBuffer(),i=r.util.createBuffer(),l=a.length();for(u=0;u<l;++u){s=a.at(u);n.putByte(54^s),i.putByte(92^s)}if(l<e.blockLength)for(s=e.blockLength-l,u=0;u<s;++u)n.putByte(54),i.putByte(92);t=a,n=n.bytes(),i=i.bytes()}e.start(),e.update(n)},update:function(t){e.update(t)},getMac:function(){var t=e.digest().bytes();return e.start(),e.update(i),e.update(t),e.digest()}};return o.digest=o.getMac,o}},function(t,e){},function(t,e,n){var r=n(0);function i(t,e){r.cipher.registerAlgorithm(t,function(){return new r.aes.Algorithm(t,e)})}n(12),n(13),n(1),t.exports=r.aes=r.aes||{},r.aes.startEncrypting=function(t,e,n,r){var i=g({key:t,output:n,decrypt:!1,mode:r});return i.start(e),i},r.aes.createEncryptionCipher=function(t,e){return g({key:t,output:null,decrypt:!1,mode:e})},r.aes.startDecrypting=function(t,e,n,r){var i=g({key:t,output:n,decrypt:!0,mode:r});return i.start(e),i},r.aes.createDecryptionCipher=function(t,e){return g({key:t,output:null,decrypt:!0,mode:e})},r.aes.Algorithm=function(t,e){c||d();var n=this;n.name=t,n.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return h(n._w,t,e,!1)},decrypt:function(t,e){return h(n._w,t,e,!0)}}}),n._init=!1},r.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,n=t.key;if("string"!=typeof n||16!==n.length&&24!==n.length&&32!==n.length){if(r.util.isArray(n)&&(16===n.length||24===n.length||32===n.length)){e=n,n=r.util.createBuffer();for(var i=0;i<e.length;++i)n.putByte(e[i])}}else n=r.util.createBuffer(n);if(!r.util.isArray(n)){e=n,n=[];var o=e.length();if(16===o||24===o||32===o){o>>>=2;for(i=0;i<o;++i)n.push(e.getInt32())}}if(!r.util.isArray(n)||4!==n.length&&6!==n.length&&8!==n.length)throw new Error("Invalid key parameter.");var a=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=f(n,t.decrypt&&!s),this._init=!0}},r.aes._expandKey=function(t,e){return c||d(),f(t,e)},r.aes._updateBlock=h,i("AES-ECB",r.cipher.modes.ecb),i("AES-CBC",r.cipher.modes.cbc),i("AES-CFB",r.cipher.modes.cfb),i("AES-OFB",r.cipher.modes.ofb),i("AES-CTR",r.cipher.modes.ctr),i("AES-GCM",r.cipher.modes.gcm);var o,a,s,u,l,c=!1,p=4;function d(){c=!0,s=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;o=new Array(256),a=new Array(256),u=new Array(4),l=new Array(4);for(e=0;e<4;++e)u[e]=new Array(256),l[e]=new Array(256);var n,r,i,p,d,f,h,g=0,m=0;for(e=0;e<256;++e){p=(p=m^m<<1^m<<2^m<<3^m<<4)>>8^255&p^99,o[g]=p,a[p]=g,f=(d=t[p])<<24^p<<16^p<<8^p^d,h=((n=t[g])^(r=t[n])^(i=t[r]))<<24^(g^i)<<16^(g^r^i)<<8^g^n^i;for(var v=0;v<4;++v)u[v][g]=f,l[v][p]=h,f=f<<24|f>>>8,h=h<<24|h>>>8;0===g?g=m=1:(g=n^t[t[t[n^i]]],m^=t[t[m]])}}function f(t,e){for(var n,r=t.slice(0),i=1,a=r.length,u=p*(a+6+1),c=a;c<u;++c)n=r[c-1],c%a==0?(n=o[n>>>16&255]<<24^o[n>>>8&255]<<16^o[255&n]<<8^o[n>>>24]^s[i]<<24,i++):a>6&&c%a==4&&(n=o[n>>>24]<<24^o[n>>>16&255]<<16^o[n>>>8&255]<<8^o[255&n]),r[c]=r[c-a]^n;if(e){for(var d,f=l[0],h=l[1],g=l[2],m=l[3],v=r.slice(0),y=(c=0,(u=r.length)-p);c<u;c+=p,y-=p)if(0===c||c===u-p)v[c]=r[y],v[c+1]=r[y+3],v[c+2]=r[y+2],v[c+3]=r[y+1];else for(var b=0;b<p;++b)d=r[y+b],v[c+(3&-b)]=f[o[d>>>24]]^h[o[d>>>16&255]]^g[o[d>>>8&255]]^m[o[255&d]];r=v}return r}function h(t,e,n,r){var i,s,c,p,d,f,h,g,m,v,y,b,w=t.length/4-1;r?(i=l[0],s=l[1],c=l[2],p=l[3],d=a):(i=u[0],s=u[1],c=u[2],p=u[3],d=o),f=e[0]^t[0],h=e[r?3:1]^t[1],g=e[2]^t[2],m=e[r?1:3]^t[3];for(var $=3,k=1;k<w;++k)v=i[f>>>24]^s[h>>>16&255]^c[g>>>8&255]^p[255&m]^t[++$],y=i[h>>>24]^s[g>>>16&255]^c[m>>>8&255]^p[255&f]^t[++$],b=i[g>>>24]^s[m>>>16&255]^c[f>>>8&255]^p[255&h]^t[++$],m=i[m>>>24]^s[f>>>16&255]^c[h>>>8&255]^p[255&g]^t[++$],f=v,h=y,g=b;n[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[g>>>8&255]<<8^d[255&m]^t[++$],n[r?3:1]=d[h>>>24]<<24^d[g>>>16&255]<<16^d[m>>>8&255]<<8^d[255&f]^t[++$],n[2]=d[g>>>24]<<24^d[m>>>16&255]<<16^d[f>>>8&255]<<8^d[255&h]^t[++$],n[r?1:3]=d[m>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[255&g]^t[++$]}function g(t){var e,n="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?r.cipher.createDecipher(n,t.key):r.cipher.createCipher(n,t.key)).start;return e.start=function(t,n){var o=null;n instanceof r.util.ByteBuffer&&(o=n,n={}),(n=n||{}).output=o,n.iv=t,i.call(e,n)},e}},function(t,e,n){var r=n(0);r.pki=r.pki||{};var i=t.exports=r.pki.oids=r.oids=r.oids||{};function o(t,e){i[t]=e,i[e]=t}function a(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.16.840.1.113730.1.1","nsCertType"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e,n){var r,i=n(0);t.exports=i.jsbn=i.jsbn||{};function o(t,e,n){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new o(null)}function s(t,e,n,r,i,o){for(var a=16383&e,s=e>>14;--o>=0;){var u=16383&this.data[t],l=this.data[t++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+n.data[r]+i)>>28)+(c>>14)+s*l,n.data[r++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"==typeof navigator?(o.prototype.am=s,r=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,n,r,i,o){for(var a=32767&e,s=e>>15;--o>=0;){var u=32767&this.data[t],l=this.data[t++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+n.data[r]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),n.data[r++]=1073741823&u}return i},r=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,n,r,i,o){for(;--o>=0;){var a=e*this.data[t++]+n.data[r]+i;i=Math.floor(a/67108864),n.data[r++]=67108863&a}return i},r=26):(o.prototype.am=s,r=28),o.prototype.DB=r,o.prototype.DM=(1<<r)-1,o.prototype.DV=1<<r;o.prototype.FV=Math.pow(2,52),o.prototype.F1=52-r,o.prototype.F2=2*r-52;var u,l,c="0123456789abcdefghijklmnopqrstuvwxyz",p=new Array;for(u="0".charCodeAt(0),l=0;l<=9;++l)p[u++]=l;for(u="a".charCodeAt(0),l=10;l<36;++l)p[u++]=l;for(u="A".charCodeAt(0),l=10;l<36;++l)p[u++]=l;function d(t){return c.charAt(t)}function f(t,e){var n=p[t.charCodeAt(e)];return null==n?-1:n}function h(t){var e=a();return e.fromInt(t),e}function g(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function m(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function y(t,e){return t&e}function b(t,e){return t|e}function w(t,e){return t^e}function $(t,e){return t&~e}function k(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function C(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function x(){}function T(t){return t}function S(t){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}m.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},m.prototype.revert=function(t){return t},m.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},m.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},m.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.convert=function(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},v.prototype.revert=function(t){var e=a();return t.copyTo(e),this.reduce(e),e},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t.data[e],r=n*this.mpl+((n*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t.data[n]+=this.m.am(0,r,t,e,0,this.m.t);t.data[n]>=t.DV;)t.data[n]-=t.DV,t.data[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},o.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,a=0;--r>=0;){var s=8==n?255&t[r]:f(t,r);s<0?"-"==t.charAt(r)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+n>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this.data[this.t++]=s>>this.DB-a):this.data[this.t-1]|=s<<a,(a+=n)>=this.DB&&(a-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e.data[n+t]=this.data[n];for(n=t-1;n>=0;--n)e.data[n]=0;e.t=this.t+t,e.s=this.s},o.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e.data[n-t]=this.data[n];e.t=Math.max(this.t-t,0),e.s=this.s},o.prototype.lShiftTo=function(t,e){var n,r=t%this.DB,i=this.DB-r,o=(1<<i)-1,a=Math.floor(t/this.DB),s=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e.data[n+a+1]=this.data[n]>>i|s,s=(this.data[n]&o)<<r;for(n=a-1;n>=0;--n)e.data[n]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,o=(1<<r)-1;e.data[0]=this.data[n]>>r;for(var a=n+1;a<this.t;++a)e.data[a-n-1]|=(this.data[a]&o)<<i,e.data[a-n]=this.data[a]>>r;r>0&&(e.data[this.t-n-1]|=(this.s&o)<<i),e.t=this.t-n,e.clamp()}},o.prototype.subTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this.data[n]-t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e.data[n++]=this.DV+r:r>0&&(e.data[n++]=r),e.t=n,e.clamp()},o.prototype.multiplyTo=function(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e.data[i]=0;for(i=0;i<r.t;++i)e.data[i+n.t]=n.am(0,r.data[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&o.ZERO.subTo(e,e)},o.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t.data[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e.data[n],t,2*n,0,1);(t.data[n+e.t]+=e.am(n+1,2*e.data[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t.data[n+e.t]-=e.DV,t.data[n+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(n,e.data[n],t,2*n,0,1)),t.s=0,t.clamp()},o.prototype.divRemTo=function(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=a());var s=a(),u=this.s,l=t.s,c=this.DB-g(r.data[r.t-1]);c>0?(r.lShiftTo(c,s),i.lShiftTo(c,n)):(r.copyTo(s),i.copyTo(n));var p=s.t,d=s.data[p-1];if(0!=d){var f=d*(1<<this.F1)+(p>1?s.data[p-2]>>this.F2:0),h=this.FV/f,m=(1<<this.F1)/f,v=1<<this.F2,y=n.t,b=y-p,w=null==e?a():e;for(s.dlShiftTo(b,w),n.compareTo(w)>=0&&(n.data[n.t++]=1,n.subTo(w,n)),o.ONE.dlShiftTo(p,w),w.subTo(s,s);s.t<p;)s.data[s.t++]=0;for(;--b>=0;){var $=n.data[--y]==d?this.DM:Math.floor(n.data[y]*h+(n.data[y-1]+v)*m);if((n.data[y]+=s.am(0,$,n,b,0,p))<$)for(s.dlShiftTo(b,w),n.subTo(w,n);n.data[y]<--$;)n.subTo(w,n)}null!=e&&(n.drShiftTo(p,e),u!=l&&o.ZERO.subTo(e,e)),n.t=p,n.clamp(),c>0&&n.rShiftTo(c,n),u<0&&o.ZERO.subTo(n,n)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var n=a(),r=a(),i=e.convert(this),s=g(t)-1;for(i.copyTo(n);--s>=0;)if(e.sqrTo(n,r),(t&1<<s)>0)e.mulTo(r,i,n);else{var u=n;n=r,r=u}return e.revert(n)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%e;if(a-- >0)for(s<this.DB&&(n=this.data[a]>>s)>0&&(i=!0,o=d(n));a>=0;)s<e?(n=(this.data[a]&(1<<s)-1)<<e-s,n|=this.data[--a]>>(s+=this.DB-e)):(n=this.data[a]>>(s-=e)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=d(n));return i?o:"0"},o.prototype.negate=function(){var t=a();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this.data[n]-t.data[n]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+g(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new m(e):new v(e),this.exp(t,n)},o.ZERO=h(0),o.ONE=h(1),x.prototype.convert=T,x.prototype.revert=T,x.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},x.prototype.sqrTo=function(t,e){t.squareTo(e)},S.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e},S.prototype.revert=function(t){return t},S.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},S.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},S.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var E=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],D=(1<<26)/E[E.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),r=h(n),i=a(),o=a(),s="";for(this.divRemTo(r,i,o);i.signum()>0;)s=(n+o.intValue()).toString(t).substr(1)+s,i.divRemTo(r,i,o);return o.intValue().toString(t)+s},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),r=Math.pow(e,n),i=!1,a=0,s=0,u=0;u<t.length;++u){var l=f(t,u);l<0?"-"==t.charAt(u)&&0==this.signum()&&(i=!0):(s=e*s+l,++a>=n&&(this.dMultiply(r),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var r=new Array,i=7&t;r.length=1+(t>>3),e.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}},o.prototype.bitwiseTo=function(t,e,n){var r,i,o=Math.min(t.t,this.t);for(r=0;r<o;++r)n.data[r]=e(this.data[r],t.data[r]);if(t.t<this.t){for(i=t.s&this.DM,r=o;r<this.t;++r)n.data[r]=e(this.data[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<t.t;++r)n.data[r]=e(i,t.data[r]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},o.prototype.changeBit=function(t,e){var n=o.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},o.prototype.addTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this.data[n]+t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e.data[n++]=r:r<-1&&(e.data[n++]=this.DV+r),e.t=n,e.clamp()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},o.prototype.multiplyLowerTo=function(t,e,n){var r,i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n.data[--i]=0;for(r=n.t-this.t;i<r;++i)n.data[i+this.t]=this.am(0,t.data[i],n,i,0,this.t);for(r=Math.min(t.t,e);i<r;++i)this.am(0,t.data[i],n,i,0,e-i);n.clamp()},o.prototype.multiplyUpperTo=function(t,e,n){--e;var r=n.t=this.t+t.t-e;for(n.s=0;--r>=0;)n.data[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)n.data[this.t+r-e]=this.am(e-r,t.data[r],n,0,0,this.t+r-e);n.clamp(),n.drShiftTo(1,n)},o.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this.data[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this.data[r])%t;return n},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),n=e.getLowestSetBit();if(n<=0)return!1;for(var r,i=e.shiftRight(n),a={nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(256*Math.random())}},s=0;s<t;++s){do{r=new o(this.bitLength(),a)}while(r.compareTo(o.ONE)<=0||r.compareTo(e)>=0);var u=r.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var l=1;l++<n&&0!=u.compareTo(e);)if(0==(u=u.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0},o.prototype.clone=function(){var t=a();return this.copyTo(t),t},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r<this.DB&&(n=this.data[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this.data[t]&(1<<r)-1)<<8-r,n|=this.data[--t]>>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=a();return this.bitwiseTo(t,y,e),e},o.prototype.or=function(t){var e=a();return this.bitwiseTo(t,b,e),e},o.prototype.xor=function(t){var e=a();return this.bitwiseTo(t,w,e),e},o.prototype.andNot=function(t){var e=a();return this.bitwiseTo(t,$,e),e},o.prototype.not=function(){for(var t=a(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t},o.prototype.shiftLeft=function(t){var e=a();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},o.prototype.shiftRight=function(t){var e=a();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},o.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this.data[t])return t*this.DB+k(this.data[t]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=C(this.data[n]^e);return t},o.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this.data[e]&1<<t%this.DB)},o.prototype.setBit=function(t){return this.changeBit(t,b)},o.prototype.clearBit=function(t){return this.changeBit(t,$)},o.prototype.flipBit=function(t){return this.changeBit(t,w)},o.prototype.add=function(t){var e=a();return this.addTo(t,e),e},o.prototype.subtract=function(t){var e=a();return this.subTo(t,e),e},o.prototype.multiply=function(t){var e=a();return this.multiplyTo(t,e),e},o.prototype.divide=function(t){var e=a();return this.divRemTo(t,e,null),e},o.prototype.remainder=function(t){var e=a();return this.divRemTo(t,null,e),e},o.prototype.divideAndRemainder=function(t){var e=a(),n=a();return this.divRemTo(t,e,n),new Array(e,n)},o.prototype.modPow=function(t,e){var n,r,i=t.bitLength(),o=h(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new m(e):e.isEven()?new S(e):new v(e);var s=new Array,u=3,l=n-1,c=(1<<n)-1;if(s[1]=r.convert(this),n>1){var p=a();for(r.sqrTo(s[1],p);u<=c;)s[u]=a(),r.mulTo(p,s[u-2],s[u]),u+=2}var d,f,y=t.t-1,b=!0,w=a();for(i=g(t.data[y])-1;y>=0;){for(i>=l?d=t.data[y]>>i-l&c:(d=(t.data[y]&(1<<i+1)-1)<<l-i,y>0&&(d|=t.data[y-1]>>this.DB+i-l)),u=n;0==(1&d);)d>>=1,--u;if((i-=u)<0&&(i+=this.DB,--y),b)s[d].copyTo(o),b=!1;else{for(;u>1;)r.sqrTo(o,w),r.sqrTo(w,o),u-=2;u>0?r.sqrTo(o,w):(f=o,o=w,w=f),r.mulTo(w,s[d],o)}for(;y>=0&&0==(t.data[y]&1<<i);)r.sqrTo(o,w),f=o,o=w,w=f,--i<0&&(i=this.DB-1,--y)}return r.revert(o)},o.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return o.ZERO;for(var n=t.clone(),r=this.clone(),i=h(1),a=h(0),s=h(0),u=h(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;r.isEven();)r.rShiftTo(1,r),e?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(r)>=0?(n.subTo(r,n),e&&i.subTo(s,i),a.subTo(u,a)):(r.subTo(n,r),e&&s.subTo(i,s),u.subTo(a,u))}return 0!=r.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new x)},o.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},o.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n.data[0]<=E[E.length-1]){for(e=0;e<E.length;++e)if(n.data[0]==E[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<E.length;){for(var r=E[e],i=e+1;i<E.length&&r<D;)r*=E[i++];for(r=n.modInt(r);e<i;)if(r%E[e++]==0)return!1}return n.millerRabin(t)}},function(t,e,n){var r=n(0);n(2),n(1);var i=t.exports=r.sha256=r.sha256||{};r.md.sha256=r.md.algorithms.sha256=i,i.create=function(){a||(o=String.fromCharCode(128),o+=r.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0);var t=null,e=r.util.createBuffer(),n=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,o=0;o<n;++o)i.fullMessageLength.push(0);return e=r.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=r.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=s[1],s[1]=s[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),u(t,n,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=r.util.createBuffer();a.putBytes(e.bytes());var s,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],p=0;p<i.fullMessageLength.length-1;++p)c+=(s=8*i.fullMessageLength[p+1])/4294967296>>>0,a.putInt32(c>>>0),c=s>>>0;a.putInt32(c);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(d,n,a);var f=r.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f.putInt32(d.h5),f.putInt32(d.h6),f.putInt32(d.h7),f},i};var o=null,a=!1,s=null;function u(t,e,n){for(var r,i,o,a,u,l,c,p,d,f,h,g,m,v=n.length();v>=64;){for(u=0;u<16;++u)e[u]=n.getInt32();for(;u<64;++u)r=((r=e[u-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=((i=e[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=r+e[u-7]+i+e[u-16]|0;for(l=t.h0,c=t.h1,p=t.h2,d=t.h3,f=t.h4,h=t.h5,g=t.h6,m=t.h7,u=0;u<64;++u)o=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),a=l&c|p&(l^c),r=m+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(g^f&(h^g))+s[u]+e[u],m=g,g=h,h=f,f=d+r>>>0,d=p,p=c,c=l,l=r+(i=o+a)>>>0;t.h0=t.h0+l|0,t.h1=t.h1+c|0,t.h2=t.h2+p|0,t.h3=t.h3+d|0,t.h4=t.h4+f|0,t.h5=t.h5+h|0,t.h6=t.h6+g|0,t.h7=t.h7+m|0,v-=64}}},function(t,e,n){n(11),n(6),n(14),n(4),n(9),n(3),t.exports=n(0)},function(t,e,n){var r=n(0);n(4),n(2),n(1);var i,o=r.pkcs5=r.pkcs5||{};r.util.isNodejs&&!r.options.usePureJavaScript&&(i=n(5)),t.exports=r.pbkdf2=o.pbkdf2=function(t,e,n,o,a,s){if("function"==typeof a&&(s=a,a=null),r.util.isNodejs&&!r.options.usePureJavaScript&&i.pbkdf2&&(null===a||"object"!=typeof a)&&(i.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),t=new Buffer(t,"binary"),e=new Buffer(e,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(t,e,n,o,function(t,e){if(t)return s(t);s(null,e.toString("binary"))}):i.pbkdf2(t,e,n,o,a,function(t,e){if(t)return s(t);s(null,e.toString("binary"))}):4===i.pbkdf2Sync.length?i.pbkdf2Sync(t,e,n,o).toString("binary"):i.pbkdf2Sync(t,e,n,o,a).toString("binary");if(null==a&&(a="sha1"),"string"==typeof a){if(!(a in r.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=r.md[a].create()}var u=a.digestLength;if(o>4294967295*u){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var c=Math.ceil(o/u),p=o-(c-1)*u,d=r.hmac.create();d.start(a,t);var f,h,g,m="";if(!s){for(var v=1;v<=c;++v){d.start(null,null),d.update(e),d.update(r.util.int32ToBytes(v)),f=g=d.digest().getBytes();for(var y=2;y<=n;++y)d.start(null,null),d.update(g),h=d.digest().getBytes(),f=r.util.xorBytes(f,h,u),g=h;m+=v<c?f:f.substr(0,p)}return m}v=1;function b(){if(v>c)return s(null,m);d.start(null,null),d.update(e),d.update(r.util.int32ToBytes(v)),f=g=d.digest().getBytes(),y=2,w()}function w(){if(y<=n)return d.start(null,null),d.update(g),h=d.digest().getBytes(),f=r.util.xorBytes(f,h,u),g=h,++y,r.util.setImmediate(w);m+=v<c?f:f.substr(0,p),++v,b()}b()}},function(t,e,n){var r=n(0);n(1),t.exports=r.cipher=r.cipher||{},r.cipher.algorithms=r.cipher.algorithms||{},r.cipher.createCipher=function(t,e){var n=t;if("string"==typeof n&&(n=r.cipher.getAlgorithm(n))&&(n=n()),!n)throw new Error("Unsupported algorithm: "+t);return new r.cipher.BlockCipher({algorithm:n,key:e,decrypt:!1})},r.cipher.createDecipher=function(t,e){var n=t;if("string"==typeof n&&(n=r.cipher.getAlgorithm(n))&&(n=n()),!n)throw new Error("Unsupported algorithm: "+t);return new r.cipher.BlockCipher({algorithm:n,key:e,decrypt:!0})},r.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),r.cipher.algorithms[t]=e},r.cipher.getAlgorithm=function(t){return(t=t.toUpperCase())in r.cipher.algorithms?r.cipher.algorithms[t]:null};var i=r.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};i.prototype.start=function(t){t=t||{};var e={};for(var n in t)e[n]=t[n];e.decrypt=this._decrypt,this._finish=!1,this._input=r.util.createBuffer(),this.output=t.output||r.util.createBuffer(),this.mode.start(e)},i.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(t){!t||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(e){return t(this.blockSize,e,!1)},this.mode.unpad=function(e){return t(this.blockSize,e,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,e)))}},function(t,e,n){var r=n(0);n(1),r.cipher=r.cipher||{};var i=t.exports=r.cipher.modes=r.cipher.modes||{};function o(t){if("string"==typeof t&&(t=r.util.createBuffer(t)),r.util.isArray(t)&&t.length>4){var e=t;t=r.util.createBuffer();for(var n=0;n<e.length;++n)t.putByte(e[n])}return r.util.isArray(t)||(t=[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]),t}function a(t){t[t.length-1]=t[t.length-1]+1&4294967295}function s(t){return[t/4294967296|0,4294967295&t]}i.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(t){},i.ecb.prototype.encrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._outBlock[r])},i.ecb.prototype.decrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._outBlock[r])},i.ecb.prototype.pad=function(t,e){var n=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(n,n),!0},i.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var n=t.length(),r=t.at(n-1);return!(r>this.blockSize<<2)&&(t.truncate(r),!0)},i.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._outBlock[r]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(t,e){var n=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(n,n),!0},i.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var n=t.length(),r=t.at(n-1);return!(r>this.blockSize<<2)&&(t.truncate(r),!0)},i.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},i.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,n){var r=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,n=r.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?r.util.createBuffer(t.additionalData):r.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=r.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=n.length();if(12===i)this._j0=[n.getInt32(),n.getInt32(),n.getInt32(),1];else{for(this._j0=[0,0,0,0];n.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[n.getInt32(),n.getInt32(),n.getInt32(),n.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,e=r.util.createBuffer(e),this._aDataLength=s(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(0===o||n){if(n){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(t,e,n){var r=t.length();if(r<this.blockSize&&!(n&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^this._hashBlock[i]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(t,e){var n=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=r.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^o[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(n=!1),n},i.gcm.prototype.multiply=function(t,e){for(var n=[0,0,0,0],r=e.slice(0),i=0;i<128;++i){t[i/32|0]&1<<31-i%32&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),this.pow(r,r)}return n},i.gcm.prototype.pow=function(t,e){for(var n=1&t[3],r=3;r>0;--r)e[r]=t[r]>>>1|(1&t[r-1])<<31;e[0]=t[0]>>>1,n&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],n=0;n<32;++n){var r=t[n/8|0]>>>4*(7-n%8)&15,i=this._m[n][r];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.gcm.prototype.ghash=function(t,e,n){return e[0]^=n[0],e[1]^=n[1],e[2]^=n[2],e[3]^=n[3],this.tableMultiply(e)},i.gcm.prototype.generateHashTable=function(t,e){for(var n=8/e,r=4*n,i=16*n,o=new Array(i),a=0;a<i;++a){var s=[0,0,0,0],u=(r-1-a%r)*e;s[a/r|0]=1<<e-1<<u,o[a]=this.generateSubHashTable(this.multiply(s,t),e)}return o},i.gcm.prototype.generateSubHashTable=function(t,e){var n=1<<e,r=n>>>1,i=new Array(n);i[r]=t.slice(0);for(var o=r>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<r;){for(var a=1;a<o;++a){var s=i[o],u=i[a];i[o+a]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=r+1;o<n;++o){var l=i[o^r];i[o]=[t[0]^l[0],t[1]^l[1],t[2]^l[2],t[3]^l[3]]}return i}},function(t,e,n){var r=n(0);if(n(15),n(8),n(7),n(16),n(19),n(3),n(1),void 0===i)var i=r.jsbn.BigInteger;var o=r.asn1;r.pki=r.pki||{},t.exports=r.pki.rsa=r.rsa=r.rsa||{};var a=r.pki,s=[6,4,2,4,2,4,6,2],u={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},c={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=r.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(t){var e;if(!(t.algorithm in a.oids)){var n=new Error("Unknown message digest algorithm.");throw n.algorithm=t.algorithm,n}e=a.oids[t.algorithm];var r=o.oidToDer(e).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);s.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,r)),s.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var u=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(u),o.toDer(i).getBytes()},f=function(t,e,n){if(n)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(r.util.bytesToHex(r.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var a=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(s)<0;)a=a.add(e.p);var u=a.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return u=u.multiply(o.modInverse(e.n)).mod(e.n)};function h(t,e,n){var i=r.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=o-11,a}i.putByte(0),i.putByte(n);var s,u=o-3-t.length;if(0===n||1===n){s=0===n?0:255;for(var l=0;l<u;++l)i.putByte(s)}else for(;u>0;){var c=0,p=r.random.getBytes(u);for(l=0;l<u;++l)0===(s=p.charCodeAt(l))?++c:i.putByte(s);u=c}return i.putByte(0),i.putBytes(t),i}function g(t,e,n,i){var o=Math.ceil(e.n.bitLength()/8),a=r.util.createBuffer(t),s=a.getByte(),u=a.getByte();if(0!==s||n&&0!==u&&1!==u||!n&&2!=u||n&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var l=0;if(0===u){l=o-3-i;for(var c=0;c<l;++c)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(l=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++l}else if(2===u)for(l=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++l}if(0!==a.getByte()||l!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function m(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var n=r.util.hexToBytes(e);return n.length>1&&(0===n.charCodeAt(0)&&0==(128&n.charCodeAt(1))||255===n.charCodeAt(0)&&128==(128&n.charCodeAt(1)))?n.substr(1):n}function v(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function y(t){return"undefined"!=typeof window&&"object"==typeof window.crypto&&"object"==typeof window.crypto.subtle&&"function"==typeof window.crypto.subtle[t]}function b(t){return"undefined"!=typeof window&&"object"==typeof window.msCrypto&&"object"==typeof window.msCrypto.subtle&&"function"==typeof window.msCrypto.subtle[t]}function w(t){for(var e=r.util.hexToBytes(t.toString(16)),n=new Uint8Array(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}a.rsa.encrypt=function(t,e,n){var o,a=n,s=Math.ceil(e.n.bitLength()/8);!1!==n&&!0!==n?(a=2===n,o=h(t,e,n)):(o=r.util.createBuffer()).putBytes(t);for(var u=new i(o.toHex(),16),l=f(u,e,a).toString(16),c=r.util.createBuffer(),p=s-Math.ceil(l.length/2);p>0;)c.putByte(0),--p;return c.putBytes(r.util.hexToBytes(l)),c.getBytes()},a.rsa.decrypt=function(t,e,n,o){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=a,s}var u=new i(r.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=f(u,e,n).toString(16),c=r.util.createBuffer(),p=a-Math.ceil(l.length/2);p>0;)c.putByte(0),--p;return c.putBytes(r.util.hexToBytes(l)),!1!==o?g(c.getBytes(),e,n):c.getBytes()},a.rsa.createKeyPairGenerationState=function(t,e,n){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var o,a=(n=n||{}).prng||r.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),n=0;n<t.length;++n)t[n]=e.charCodeAt(n)}},u=n.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(o={algorithm:u,state:0,bits:t,rng:s,eInt:e||65537,e:new i(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},a.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var n=new i(null);n.fromInt(30);for(var r,o=0,u=function(t,e){return t|e},l=+new Date,c=0;null===t.keys&&(e<=0||c<e);){if(0===t.state){var p=null===t.p?t.pBits:t.qBits,d=p-1;0===t.pqState?(t.num=new i(p,t.rng),t.num.testBit(d)||t.num.bitwiseTo(i.ONE.shiftLeft(d),u,t.num),t.num.dAddOffset(31-t.num.mod(n).byteValue(),0),o=0,++t.pqState):1===t.pqState?t.num.bitLength()>p?t.pqState=0:t.num.isProbablePrime(v(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(s[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var f=t.e.modInverse(t.phi);t.keys={privateKey:a.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:a.rsa.setPublicKey(t.n,t.e)}}c+=(r=+new Date)-l,l=r}return null!==t.keys},a.rsa.generateKeyPair=function(t,e,n,s){if(1===arguments.length?"object"==typeof t?(n=t,t=void 0):"function"==typeof t&&(s=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(s=e,e=void 0):"number"!=typeof e&&(n=e,e=void 0):(n=t,s=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof n&&(s=n,n=void 0):(s=n,n=e,e=void 0)),n=n||{},void 0===t&&(t=n.bits||2048),void 0===e&&(e=n.e||65537),!r.options.usePureJavaScript&&s&&t>=256&&t<=16384&&(65537===e||3===e)){if(y("generateKey")&&y("exportKey"))return window.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:w(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return window.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){s(t)}).then(function(t){if(t){var e=a.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(t)));s(null,{privateKey:e,publicKey:a.setRsaPublicKey(e.n,e.e)})}});if(b("generateKey")&&b("exportKey")){var u=window.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:w(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(t){var e=t.target.result,n=window.msCrypto.subtle.exportKey("pkcs8",e.privateKey);n.oncomplete=function(t){var e=t.target.result,n=a.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(e)));s(null,{privateKey:n,publicKey:a.setRsaPublicKey(n.n,n.e)})},n.onerror=function(t){s(t)}},void(u.onerror=function(t){s(t)})}}var l=a.rsa.createKeyPairGenerationState(t,e,n);if(!s)return a.rsa.stepKeyPairGenerationState(l,0),l.keys;!function(t,e,n){"function"==typeof e&&(n=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(o.prng=e.prng);function s(){u(t.pBits,function(e,r){return e?n(e):(t.p=r,null!==t.q?l(e,t.q):void u(t.qBits,l))})}function u(t,e){r.prime.generateProbablePrime(t,o,e)}function l(e,r){if(e)return n(e);if(t.q=r,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void s();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void u(t.qBits,l);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void s();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void u(t.qBits,l);var c=t.e.modInverse(t.phi);t.keys={privateKey:a.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:a.rsa.setPublicKey(t.n,t.e)},n(null,t.keys)}s()}(l,n,s)},a.setRsaPublicKey=a.rsa.setPublicKey=function(t,e){var n={n:t,e:e,encrypt:function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,n){return h(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return r.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,n,!0);return a.rsa.encrypt(o,n,!0)},verify:function(t,e,r){"string"==typeof r?r=r.toUpperCase():void 0===r&&(r="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===r?r={verify:function(t,e){return e=g(e,n,!0),t===o.fromDer(e).value[1].value}}:"NONE"!==r&&"NULL"!==r&&null!==r||(r={verify:function(t,e){return t===(e=g(e,n,!0))}});var i=a.rsa.decrypt(e,n,!0,!1);return r.verify(t,i,n.n.bitLength())}};return n},a.setRsaPrivateKey=a.rsa.setPrivateKey=function(t,e,n,i,o,s,u,l){var c={n:t,e:e,d:n,p:i,q:o,dP:s,dQ:u,qInv:l,decrypt:function(t,e,n){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=a.rsa.decrypt(t,c,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:g};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return r.pkcs1.decode_rsa_oaep(e,t,n)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,c,!1)},sign:function(t,e){var n=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:d},n=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},n=1);var r=e.encode(t,c.n.bitLength());return a.rsa.encrypt(r,c,n)}};return c},a.wrapRsaPrivateKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(t).getBytes())])},a.privateKeyFromAsn1=function(t){var e,n,s,c,p,d,f,h,g={},m=[];if(o.validate(t,u,g,m)&&(t=o.fromDer(r.util.createBuffer(g.privateKey))),g={},m=[],!o.validate(t,l,g,m)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=m,v}return e=r.util.createBuffer(g.privateKeyModulus).toHex(),n=r.util.createBuffer(g.privateKeyPublicExponent).toHex(),s=r.util.createBuffer(g.privateKeyPrivateExponent).toHex(),c=r.util.createBuffer(g.privateKeyPrime1).toHex(),p=r.util.createBuffer(g.privateKeyPrime2).toHex(),d=r.util.createBuffer(g.privateKeyExponent1).toHex(),f=r.util.createBuffer(g.privateKeyExponent2).toHex(),h=r.util.createBuffer(g.privateKeyCoefficient).toHex(),a.setRsaPrivateKey(new i(e,16),new i(n,16),new i(s,16),new i(c,16),new i(p,16),new i(d,16),new i(f,16),new i(h,16))},a.privateKeyToAsn1=a.privateKeyToRSAPrivateKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.qInv))])},a.publicKeyFromAsn1=function(t){var e={},n=[];if(o.validate(t,p,e,n)){var s,u=o.derToOid(e.publicKeyOid);if(u!==a.oids.rsaEncryption)throw(s=new Error("Cannot read public key. Unknown OID.")).oid=u,s;t=e.rsaPublicKey}if(n=[],!o.validate(t,c,e,n))throw(s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=n,s;var l=r.util.createBuffer(e.publicKeyModulus).toHex(),d=r.util.createBuffer(e.publicKeyExponent).toHex();return a.setRsaPublicKey(new i(l,16),new i(d,16))},a.publicKeyToAsn1=a.publicKeyToSubjectPublicKeyInfo=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[a.publicKeyToRSAPublicKey(t)])])},a.publicKeyToRSAPublicKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.e))])}},function(t,e,n){var r=n(0);n(1),n(7);var i=t.exports=r.asn1=r.asn1||{};function o(t,e,n){if(n>e){var r=new Error("Too few bytes to parse DER.");throw r.available=t.length(),r.remaining=e,r.requested=n,r}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(t,e,n,o,a){if(r.util.isArray(o)){for(var s=[],u=0;u<o.length;++u)void 0!==o[u]&&s.push(o[u]);o=s}var l={tagClass:t,type:e,constructed:n,composed:n||r.util.isArray(o),value:o};return a&&"bitStringContents"in a&&(l.bitStringContents=a.bitStringContents,l.original=i.copy(l)),l},i.copy=function(t,e){var n;if(r.util.isArray(t)){n=[];for(var o=0;o<t.length;++o)n.push(i.copy(t[o],e));return n}return"string"==typeof t?t:(n={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:i.copy(t.value,e)},e&&!e.excludeBitStringContents&&(n.bitStringContents=t.bitStringContents),n)},i.equals=function(t,e,n){if(r.util.isArray(t)){if(!r.util.isArray(e))return!1;if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)return!!i.equals(t[o],e[o])}if(typeof t!=typeof e)return!1;if("string"==typeof t)return t===e;var a=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&i.equals(t.value,e.value);return n&&n.includeBitStringContents&&(a=a&&t.bitStringContents===e.bitStringContents),a},i.getBerValueLength=function(t){var e=t.getByte();if(128!==e)return 128&e?t.getInt((127&e)<<3):e};var a=function(t,e){var n=t.getByte();if(128!==n){var r;if(128&n){var i=127&n;o(t,--e,i),r=t.getInt(i<<3)}else r=n;if(r<0)throw new Error("Negative length: "+r);return r}};i.fromDer=function(t,e){return void 0===e&&(e={strict:!0,decodeBitStrings:!0}),"boolean"==typeof e&&(e={strict:e,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"string"==typeof t&&(t=r.util.createBuffer(t)),function t(e,n,r,s){var u;o(e,n,2);var l=e.getByte();n--;var c=192&l;var p=31&l;u=e.length();var d=a(e,n);n-=u-e.length();if(void 0!==d&&d>n){if(s.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=e.length(),f.remaining=n,f.requested=d,f}d=n}var h;var g;var m=32==(32&l);if(m)if(h=[],void 0===d)for(;;){if(o(e,n,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),n-=2;break}u=e.length(),h.push(t(e,n,r+1,s)),n-=u-e.length()}else for(;d>0;)u=e.length(),h.push(t(e,d,r+1,s)),n-=u-e.length(),d-=u-e.length();void 0===h&&c===i.Class.UNIVERSAL&&p===i.Type.BITSTRING&&(g=e.bytes(d));if(void 0===h&&s.decodeBitStrings&&c===i.Class.UNIVERSAL&&p===i.Type.BITSTRING&&d>1){var v=e.read,y=n,b=0;if(p===i.Type.BITSTRING&&(o(e,n,1),b=e.getByte(),n--),0===b)try{u=e.length();var w={verbose:s.verbose,strict:!0,decodeBitStrings:!0},$=t(e,n,r+1,w),k=u-e.length();n-=k,p==i.Type.BITSTRING&&k++;var C=$.tagClass;k!==d||C!==i.Class.UNIVERSAL&&C!==i.Class.CONTEXT_SPECIFIC||(h=[$])}catch(t){}void 0===h&&(e.read=v,n=y)}if(void 0===h){if(void 0===d){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=n}if(p===i.Type.BMPSTRING)for(h="";d>0;d-=2)o(e,n,2),h+=String.fromCharCode(e.getInt16()),n-=2;else h=e.getBytes(d)}var x=void 0===g?null:{bitStringContents:g};return i.create(c,p,m,h,x)}(t,t.length(),0,e)},i.toDer=function(t){var e=r.util.createBuffer(),n=t.tagClass|t.type,o=r.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=i.equals(t,t.original))),a)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?n|=32:o.putByte(0);for(var s=0;s<t.value.length;++s)void 0!==t.value[s]&&o.putBuffer(i.toDer(t.value[s]))}else if(t.type===i.Type.BMPSTRING)for(s=0;s<t.value.length;++s)o.putInt16(t.value.charCodeAt(s));else t.type===i.Type.INTEGER&&t.value.length>1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(n),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);e.putByte(128|l.length);for(s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,n,i,o,a=t.split("."),s=r.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u<a.length;++u){e=!0,n=[],i=parseInt(a[u],10);do{o=127&i,i>>>=7,e||(o|=128),n.push(o),e=!1}while(i>0);for(var l=n.length-1;l>=0;--l)s.putByte(n[l])}return s},i.derToOid=function(t){var e;"string"==typeof t&&(t=r.util.createBuffer(t));var n=t.getByte();e=Math.floor(n/40)+"."+n%40;for(var i=0;t.length()>0;)i<<=7,128&(n=t.getByte())?i+=127&n:(e+="."+(i+n),i=0);return e},i.utcTimeToDate=function(t){var e=new Date,n=parseInt(t.substr(0,2),10);n=n>=50?1900+n:2e3+n;var r=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),l+=2)}if(e.setUTCFullYear(n,r,i),e.setUTCHours(o,a,s,0),l&&("+"===(u=t.charAt(l))||"-"===u)){var c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},i.generalizedTimeToDate=function(t){var e=new Date,n=parseInt(t.substr(0,4),10),r=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,l=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var p=t.length-5,d=t.charAt(p);"+"!==d&&"-"!==d||(l=60*parseInt(t.substr(p+1,2),10)+parseInt(t.substr(p+4,2),10),l*=6e4,"+"===d&&(l*=-1),c=!0);return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(n,r,i),e.setUTCHours(o,a,s,u),e.setTime(+e+l)):(e.setFullYear(n,r,i),e.setHours(o,a,s,u)),e},i.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",n=[];n.push((""+t.getUTCFullYear()).substr(2)),n.push(""+(t.getUTCMonth()+1)),n.push(""+t.getUTCDate()),n.push(""+t.getUTCHours()),n.push(""+t.getUTCMinutes()),n.push(""+t.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(e+="0"),e+=n[r];return e+="Z"},i.dateToGeneralizedTime=function(t){if("string"==typeof t)return t;var e="",n=[];n.push(""+t.getUTCFullYear()),n.push(""+(t.getUTCMonth()+1)),n.push(""+t.getUTCDate()),n.push(""+t.getUTCHours()),n.push(""+t.getUTCMinutes()),n.push(""+t.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(e+="0"),e+=n[r];return e+="Z"},i.integerToDer=function(t){var e=r.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var n=new Error("Integer too large; max is 32-bits.");throw n.integer=t,n},i.derToInteger=function(t){"string"==typeof t&&(t=r.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,n,o){var a=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(a=!0,e.value&&r.util.isArray(e.value))for(var s=0,u=0;a&&u<e.value.length;++u)a=e.value[u].optional||!1,t.value[s]&&((a=i.validate(t.value[s],e.value[u],n,o))?++s:e.value[u].optional&&(a=!0)),!a&&o&&o.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(a&&n)if(e.capture&&(n[e.capture]=t.value),e.captureAsn1&&(n[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(n[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t)if(t.bitStringContents.length<2)n[e.captureBitStringValue]="";else{if(0!==t.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");n[e.captureBitStringValue]=t.bitStringContents.slice(1)}}else o&&o.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');return a};var s=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(t,e,n){var o="";n=n||2,(e=e||0)>0&&(o+="\n");for(var a="",u=0;u<e*n;++u)a+=" ";switch(o+=a+"Tag: ",t.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(t.tagClass===i.Class.UNIVERSAL)switch(o+=t.type,t.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=t.type;if(o+="\n",o+=a+"Constructed: "+t.constructed+"\n",t.composed){var l=0,c="";for(u=0;u<t.value.length;++u)void 0!==t.value[u]&&(l+=1,c+=i.prettyPrint(t.value[u],e+1,n),u+1<t.value.length&&(c+=","));o+=a+"Sub values: "+l+c}else{if(o+=a+"Value: ",t.type===i.Type.OID){var p=i.derToOid(t.value);o+=p,r.pki&&r.pki.oids&&p in r.pki.oids&&(o+=" ("+r.pki.oids[p]+") ")}if(t.type===i.Type.INTEGER)try{o+=i.derToInteger(t.value)}catch(e){o+="0x"+r.util.bytesToHex(t.value)}else if(t.type===i.Type.BITSTRING){if(t.value.length>1?o+="0x"+r.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);1==d?o+=" (1 unused bit shown)":d>1&&(o+=" ("+d+" unused bits shown)")}}else t.type===i.Type.OCTETSTRING?(s.test(t.value)||(o+="("+t.value+") "),o+="0x"+r.util.bytesToHex(t.value)):t.type===i.Type.UTF8?o+=r.util.decodeUtf8(t.value):t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:s.test(t.value)?o+="0x"+r.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},function(t,e,n){var r=n(0);n(1),n(3),n(18);var i=t.exports=r.pkcs1=r.pkcs1||{};function o(t,e,n){n||(n=r.md.sha1.create());for(var i="",o=Math.ceil(e/n.digestLength),a=0;a<o;++a){var s=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);n.start(),n.update(t+s),i+=n.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,n){var i,a,s,u;"string"==typeof n?(i=n,a=arguments[3]||void 0,s=arguments[4]||void 0):n&&(i=n.label||void 0,a=n.seed||void 0,s=n.md||void 0,n.mgf1&&n.mgf1.md&&(u=n.mgf1.md)),s?s.start():s=r.md.sha1.create(),u||(u=s);var l=Math.ceil(t.n.bitLength()/8),c=l-2*s.digestLength-2;if(e.length>c)throw(m=new Error("RSAES-OAEP input message length is too long.")).length=e.length,m.maxLength=c,m;i||(i=""),s.update(i,"raw");for(var p=s.digest(),d="",f=c-e.length,h=0;h<f;h++)d+="\0";var g=p.getBytes()+d+""+e;if(a){if(a.length!==s.digestLength){var m;throw(m=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,m.digestLength=s.digestLength,m}}else a=r.random.getBytes(s.digestLength);var v=o(a,l-s.digestLength-1,u),y=r.util.xorBytes(g,v,g.length),b=o(y,s.digestLength,u);return"\0"+r.util.xorBytes(a,b,a.length)+y},i.decode_rsa_oaep=function(t,e,n){var i,a,s;"string"==typeof n?(i=n,a=arguments[3]||void 0):n&&(i=n.label||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(s=n.mgf1.md));var u=Math.ceil(t.n.bitLength()/8);if(e.length!==u)throw(v=new Error("RSAES-OAEP encoded message length is invalid.")).length=e.length,v.expectedLength=u,v;if(void 0===a?a=r.md.sha1.create():a.start(),s||(s=a),u<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var l=a.digest().getBytes(),c=e.charAt(0),p=e.substring(1,a.digestLength+1),d=e.substring(1+a.digestLength),f=o(d,a.digestLength,s),h=o(r.util.xorBytes(p,f,p.length),u-a.digestLength-1,s),g=r.util.xorBytes(d,h,d.length),m=g.substring(0,a.digestLength),v="\0"!==c,y=0;y<a.digestLength;++y)v|=l.charAt(y)!==m.charAt(y);for(var b=1,w=a.digestLength,$=a.digestLength;$<g.length;$++){var k=g.charCodeAt($);v|=k&(b?65534:0),w+=b&=1&k^1}if(v||1!==g.charCodeAt(w))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(w+1)}},function(t,e,n){var r=n(0);n(1);var i=null;!r.util.isNodejs||r.options.usePureJavaScript||process.versions["node-webkit"]||(i=n(5)),(t.exports=r.prng=r.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0},n=t.md,o=new Array(32),a=0;a<32;++a)o[a]=n.create();function s(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){var t=e.plugin.md.create();t.update(e.pools[0].digest().getBytes()),e.pools[0].start();for(var n=1,r=1;r<32;++r)(n=31===n?2147483648:n<<2)%e.reseeds==0&&(t.update(e.pools[r].digest().getBytes()),e.pools[r].start());var i=t.digest().getBytes();t.start(),t.update(i);var o=t.digest().getBytes();e.key=e.plugin.formatKey(i),e.seed=e.plugin.formatSeed(o),e.reseeds=4294967295===e.reseeds?0:e.reseeds+1,e.generated=0}function l(t){var e=null;if("undefined"!=typeof window){var n=window.crypto||window.msCrypto;n&&n.getRandomValues&&(e=function(t){return n.getRandomValues(t)})}var i=r.util.createBuffer();if(e)for(;i.length()<t;){var o=Math.max(1,Math.min(t-i.length(),65536)/4),a=new Uint32Array(Math.floor(o));try{e(a);for(var s=0;s<a.length;++s)i.putInt32(a[s])}catch(t){if(!("undefined"!=typeof QuotaExceededError&&t instanceof QuotaExceededError))throw t}}if(i.length()<t)for(var u,l,c,p=Math.floor(65536*Math.random());i.length()<t;){l=16807*(65535&p),l+=(32767&(u=16807*(p>>16)))<<16,p=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(s=0;s<3;++s)c=p>>>(s<<3),c^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&c))}return i.getBytes(t)}return e.pools=o,e.pool=0,e.generate=function(t,n){if(!n)return e.generateSync(t);var i=e.plugin.cipher,o=e.plugin.increment,a=e.plugin.formatKey,s=e.plugin.formatSeed,l=r.util.createBuffer();e.key=null,function c(p){if(p)return n(p);if(l.length()>=t)return n(null,l.getBytes(t));e.generated>1048575&&(e.key=null);if(null===e.key)return r.util.nextTick(function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var n=32-e.pools[0].messageLength<<5;e.seedFile(n,function(n,r){if(n)return t(n);e.collect(r),u(),t()})}(c)});var d=i(e.key,e.seed);e.generated+=d.length;l.putBytes(d);e.key=a(i(e.key,o(e.seed)));e.seed=s(i(e.key,e.seed));r.util.setImmediate(c)}()},e.generateSync=function(t){var n=e.plugin.cipher,i=e.plugin.increment,o=e.plugin.formatKey,a=e.plugin.formatSeed;e.key=null;for(var u=r.util.createBuffer();u.length()<t;){e.generated>1048575&&(e.key=null),null===e.key&&s();var l=n(e.key,e.seed);e.generated+=l.length,u.putBytes(l),e.key=o(n(e.key,i(e.seed))),e.seed=a(n(e.key,e.seed))}return u.getBytes(t)},i?(e.seedFile=function(t,e){i.randomBytes(t,function(t,n){if(t)return e(t);e(null,n.toString())})},e.seedFileSync=function(t){return i.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,l(t))}catch(t){e(t)}},e.seedFileSync=l),e.collect=function(t){for(var n=t.length,r=0;r<n;++r)e.pools[e.pool].update(t.substr(r,1)),e.pool=31===e.pool?0:e.pool+1},e.collectInt=function(t,n){for(var r="",i=0;i<n;i+=8)r+=String.fromCharCode(t>>i&255);e.collect(r)},e.registerWorker=function(t){if(t===self)e.seedFile=function(t,e){self.addEventListener("message",function t(n){var r=n.data;r.forge&&r.forge.prng&&(self.removeEventListener("message",t),e(r.forge.prng.err,r.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:t}}})};else{t.addEventListener("message",function(n){var r=n.data;r.forge&&r.forge.prng&&e.seedFile(r.forge.prng.needed,function(e,n){t.postMessage({forge:{prng:{err:e,bytes:n}}})})})}},e}},function(t,e,n){var r=n(0);n(2),n(1);var i=t.exports=r.sha1=r.sha1||{};r.md.sha1=r.md.algorithms.sha1=i,i.create=function(){a||(o=String.fromCharCode(128),o+=r.util.fillString(String.fromCharCode(0),64),a=!0);var t=null,e=r.util.createBuffer(),n=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,o=0;o<n;++o)i.fullMessageLength.push(0);return e=r.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=r.util.encodeUtf8(o));var u=o.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=u[1],u[1]=u[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),s(t,n,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=r.util.createBuffer();a.putBytes(e.bytes());var u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],p=0;p<i.fullMessageLength.length-1;++p)c+=(u=8*i.fullMessageLength[p+1])/4294967296>>>0,a.putInt32(c>>>0),c=u>>>0;a.putInt32(c);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};s(d,n,a);var f=r.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f},i};var o=null,a=!1;function s(t,e,n){for(var r,i,o,a,s,u,l,c=n.length();c>=64;){for(i=t.h0,o=t.h1,a=t.h2,s=t.h3,u=t.h4,l=0;l<16;++l)r=n.getInt32(),e[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<20;++l)r=(r=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|r>>>31,e[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<32;++l)r=(r=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|r>>>31,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<40;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<60;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<80;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,c-=64}}},function(t,e,n){var r=n(0);n(1),n(8),n(3),function(){if(r.prime)t.exports=r.prime;else{var e=t.exports=r.prime=r.prime||{},n=r.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new n(null);o.fromInt(30);var a=function(t,e){return t|e};e.generateProbablePrime=function(t,e,i){"function"==typeof e&&(i=e,e={});var o=(e=e||{}).algorithm||"PRIMEINC";"string"==typeof o&&(o={name:o}),o.options=o.options||{};var a=e.prng||r.random,l={nextBytes:function(t){for(var e=a.getBytesSync(t.length),n=0;n<t.length;++n)t[n]=e.charCodeAt(n)}};if("PRIMEINC"===o.name)return function(t,e,i,o){if("workers"in i)return function(t,e,i,o){if("undefined"==typeof Worker)return s(t,e,i,o);var a=u(t,e),l=i.workers,c=i.workLoad||100,p=30*c/8,d=i.workerScript||"forge/prime.worker.js";if(-1===l)return r.util.estimateCores(function(t,e){t&&(e=2),l=e-1,f()});function f(){l=Math.max(1,l);for(var r=[],i=0;i<l;++i)r[i]=new Worker(d);for(var i=0;i<l;++i)r[i].addEventListener("message",f);var s=!1;function f(i){if(!s){0;var l=i.data;if(l.found){for(var d=0;d<r.length;++d)r[d].terminate();return s=!0,o(null,new n(l.prime,16))}a.bitLength()>t&&(a=u(t,e));var f=a.toString(16);i.target.postMessage({hex:f,workLoad:c}),a.dAddOffset(p,0)}}}f()}(t,e,i,o);return s(t,e,i,o)}(t,l,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function s(t,e,n,o){var a,s=u(t,e),l=(a=s.bitLength())<=100?27:a<=150?18:a<=200?15:a<=250?12:a<=300?9:a<=350?8:a<=400?7:a<=500?6:a<=600?5:a<=800?4:a<=1250?3:2;"millerRabinTests"in n&&(l=n.millerRabinTests);var c=10;"maxBlockTime"in n&&(c=n.maxBlockTime),function t(e,n,o,a,s,l,c){var p=+new Date;do{if(e.bitLength()>n&&(e=u(n,o)),e.isProbablePrime(s))return c(null,e);e.dAddOffset(i[a++%8],0)}while(l<0||+new Date-p<l);r.util.setImmediate(function(){t(e,n,o,a,s,l,c)})}(s,t,e,0,l,c,o)}function u(t,e){var r=new n(t,e),i=t-1;return r.testBit(i)||r.bitwiseTo(n.ONE.shiftLeft(i),a,r),r.dAddOffset(31-r.mod(o).byteValue(),0),r}}()}])}),function(){"use strict";var t,e,n="ngclipboard";"object"==typeof module&&module.exports?(t=require("angular"),e=require("clipboard"),module.exports=n):(t=window.angular,e=window.Clipboard),t.module(n,[]).directive("ngclipboard",function(){return{restrict:"A",scope:{ngclipboardSuccess:"&",ngclipboardError:"&"},link:function(t,n){var r=new e(n[0]);r.on("success",function(e){t.$apply(function(){t.ngclipboardSuccess({e:e})})}),r.on("error",function(e){t.$apply(function(){t.ngclipboardError({e:e})})})}}})}(),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["angular"],e):t.hasOwnProperty("angular")?e(t.angular):"object"==typeof exports&&(module.exports=e(require("angular")))}(this,function(t){"use strict";function e(t,e){var n;try{n=t[e]}catch(t){n=!1}if(n){var r="__"+Math.round(1e7*Math.random());try{t[e].setItem(r,r),t[e].removeItem(r,r)}catch(t){n=!1}}return n}return(t=t&&t.module?t:window.angular).module("ngStorage",[]).provider("$localStorage",n("localStorage")).provider("$sessionStorage",n("sessionStorage"));function n(n){var r=e(window,n);return function(){var i="ngStorage-";this.setKeyPrefix=function(t){if("string"!=typeof t)throw new TypeError("[ngStorage] - "+n+"Provider.setKeyPrefix() expects a String.");i=t};var o=t.toJson,a=t.fromJson;this.setSerializer=function(t){if("function"!=typeof t)throw new TypeError("[ngStorage] - "+n+"Provider.setSerializer expects a function.");o=t},this.setDeserializer=function(t){if("function"!=typeof t)throw new TypeError("[ngStorage] - "+n+"Provider.setDeserializer expects a function.");a=t},this.supported=function(){return!!r},this.get=function(t){return r&&a(r.getItem(i+t))},this.set=function(t,e){return r&&r.setItem(i+t,o(e))},this.remove=function(t){r&&r.removeItem(i+t)},this.$get=["$rootScope","$window","$log","$timeout","$document",function(r,s,u,l,c){var p,d,f=i.length,h=e(s,n),g=h||(u.warn("This browser does not support Web Storage!"),{setItem:t.noop,getItem:t.noop,removeItem:t.noop}),m={$default:function(e){for(var n in e)t.isDefined(m[n])||(m[n]=t.copy(e[n]));return m.$sync(),m},$reset:function(t){for(var e in m)"$"===e[0]||delete m[e]&&g.removeItem(i+e);return m.$default(t)},$sync:function(){for(var t,e=0,n=g.length;e<n;e++)(t=g.key(e))&&i===t.slice(0,f)&&(m[t.slice(f)]=a(g.getItem(t)))},$apply:function(){var e;if(d=null,!t.equals(m,p)){for(var n in e=t.copy(p),t.forEach(m,function(n,r){t.isDefined(n)&&"$"!==r[0]&&(g.setItem(i+r,o(n)),delete e[r])}),e)g.removeItem(i+n);p=t.copy(m)}},$supported:function(){return!!h}};return m.$sync(),p=t.copy(m),r.$watch(function(){d||(d=l(m.$apply,100,!1))}),s.addEventListener&&s.addEventListener("storage",function(e){if(e.key){var n=c[0];n.hasFocus&&n.hasFocus()||i!==e.key.slice(0,f)||(e.newValue?m[e.key.slice(f)]=a(e.newValue):delete m[e.key.slice(f)],p=t.copy(m),r.$apply())}}),s.addEventListener&&s.addEventListener("beforeunload",function(){m.$apply()}),m}]}}}),function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&"undefined"!=typeof exports?module.exports=e():t.Papa=e()}(this,function(){"use strict";var t,e,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},r=!n.document&&!!n.postMessage,i=r&&/(\?|&)papaworker(=|&|$)/.test(n.location.search),o=!1,a={},s=0,u={parse:function(e,r){var i=(r=r||{}).dynamicTyping||!1;k(i)&&(r.dynamicTypingFunction=i,i={});if(r.dynamicTyping=i,r.worker&&u.WORKERS_SUPPORTED){var l=function(){if(!u.WORKERS_SUPPORTED)return!1;if(!o&&null===u.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var e=u.SCRIPT_PATH||t;e+=(-1!==e.indexOf("?")?"&":"?")+"papaworker";var r=new n.Worker(e);return r.onmessage=v,r.id=s++,a[r.id]=r,r}();return l.userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=k(r.step),r.chunk=k(r.chunk),r.complete=k(r.complete),r.error=k(r.error),delete r.worker,void l.postMessage({input:e,config:r,workerId:l.id})}var c=null;"string"==typeof e?c=r.download?new p(r):new f(r):!0===e.readable&&k(e.read)&&k(e.on)?c=new h(r):(n.File&&e instanceof File||e instanceof Object)&&(c=new d(r));return c.stream(e)},unparse:function(t,e){var n=!1,r=!0,i=",",o="\r\n",a='"';!function(){if("object"!=typeof e)return;"string"==typeof e.delimiter&&1===e.delimiter.length&&-1===u.BAD_DELIMITERS.indexOf(e.delimiter)&&(i=e.delimiter);("boolean"==typeof e.quotes||e.quotes instanceof Array)&&(n=e.quotes);"string"==typeof e.newline&&(o=e.newline);"string"==typeof e.quoteChar&&(a=e.quoteChar);"boolean"==typeof e.header&&(r=e.header)}();var s=new RegExp(a,"g");"string"==typeof t&&(t=JSON.parse(t));if(t instanceof Array){if(!t.length||t[0]instanceof Array)return c(null,t);if("object"==typeof t[0])return c(l(t[0]),t)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),t.data instanceof Array&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=t.data[0]instanceof Array?t.fields:l(t.data[0])),t.data[0]instanceof Array||"object"==typeof t.data[0]||(t.data=[t.data])),c(t.fields||[],t.data||[]);throw"exception: Unable to serialize unrecognized input";function l(t){if("object"!=typeof t)return[];var e=[];for(var n in t)e.push(n);return e}function c(t,e){var n="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var a=t instanceof Array&&t.length>0,s=!(e[0]instanceof Array);if(a&&r){for(var u=0;u<t.length;u++)u>0&&(n+=i),n+=p(t[u],u);e.length>0&&(n+=o)}for(var l=0;l<e.length;l++){for(var c=a?t.length:e[l].length,d=0;d<c;d++){d>0&&(n+=i);var f=a&&s?t[d]:d;n+=p(e[l][f],d)}l<e.length-1&&(n+=o)}return n}function p(t,e){if(null==t)return"";t=t.toString().replace(s,a+a);var r="boolean"==typeof n&&n||n instanceof Array&&n[e]||function(t,e){for(var n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return!0;return!1}(t,u.BAD_DELIMITERS)||t.indexOf(i)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1);return r?a+t+a:t}}};if(u.RECORD_SEP=String.fromCharCode(30),u.UNIT_SEP=String.fromCharCode(31),u.BYTE_ORDER_MARK="\ufeff",u.BAD_DELIMITERS=["\r","\n",'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!n.Worker,u.SCRIPT_PATH=null,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=m,u.ParserHandle=g,u.NetworkStreamer=p,u.FileStreamer=d,u.StringStreamer=f,u.ReadableStreamStreamer=h,n.jQuery){var l=n.jQuery;l.fn.parse=function(t){var e=t.config||{},r=[];return this.each(function(t){if(!("INPUT"===l(this).prop("tagName").toUpperCase()&&"file"===l(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return!0;for(var i=0;i<this.files.length;i++)r.push({file:this.files[i],inputElem:this,instanceConfig:l.extend({},e)})}),i(),this;function i(){if(0!==r.length){var e,n,i,a,s=r[0];if(k(t.before)){var c=t.before(s.file,s.inputElem);if("object"==typeof c){if("abort"===c.action)return e="AbortError",n=s.file,i=s.inputElem,a=c.reason,void(k(t.error)&&t.error({name:e},n,i,a));if("skip"===c.action)return void o();"object"==typeof c.config&&(s.instanceConfig=l.extend(s.instanceConfig,c.config))}else if("skip"===c)return void o()}var p=s.instanceConfig.complete;s.instanceConfig.complete=function(t){k(p)&&p(t,s.file,s.inputElem),o()},u.parse(s.file,s.instanceConfig)}else k(t.complete)&&t.complete()}function o(){r.splice(0,1),i()}}}function c(t){this._handle=null,this._paused=!1,this._finished=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=w(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new g(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t){if(this.isFirstChunk&&k(this._config.beforeFirstChunk)){var e=this._config.beforeFirstChunk(t);void 0!==e&&(t=e)}this.isFirstChunk=!1;var r=this._partialLine+t;this._partialLine="";var o=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var a=o.meta.cursor;this._finished||(this._partialLine=r.substring(a-this._baseIndex),this._baseIndex=a),o&&o.data&&(this._rowCount+=o.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(i)n.postMessage({results:o,workerId:u.WORKER_ID,finished:s});else if(k(this._config.chunk)){if(this._config.chunk(o,this._handle),this._paused)return;o=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(o.data),this._completeResults.errors=this._completeResults.errors.concat(o.errors),this._completeResults.meta=o.meta),!s||!k(this._config.complete)||o&&o.meta.aborted||this._config.complete(this._completeResults,this._input),s||o&&o.meta.paused||this._nextChunk(),o}},this._sendError=function(t){k(this._config.error)?this._config.error(t):i&&this._config.error&&n.postMessage({workerId:u.WORKER_ID,error:t,finished:!1})}}function p(t){var e;(t=t||{}).chunkSize||(t.chunkSize=u.RemoteChunkSize),c.call(this,t),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),r||(e.onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)),e.open("GET",this._input,!r),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var n in t)e.setRequestHeader(n,t[n])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+i),e.setRequestHeader("If-None-Match","webkit-no-cache")}try{e.send()}catch(t){this._chunkError(t.message)}r&&0===e.status?this._chunkError():this._start+=this._config.chunkSize}},this._chunkLoaded=function(){4==e.readyState&&(e.status<200||e.status>=400?this._chunkError():(this._finished=!this._config.chunkSize||this._start>function(t){var e=t.getResponseHeader("Content-Range");if(null===e)return-1;return parseInt(e.substr(e.lastIndexOf("/")+1))}(e),this.parseChunk(e.responseText)))},this._chunkError=function(t){var n=e.statusText||t;this._sendError(n)}}function d(t){var e,n;(t=t||{}).chunkSize||(t.chunkSize=u.LocalChunkSize),c.call(this,t);var r="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,n=t.slice||t.webkitSlice||t.mozSlice,r?((e=new FileReader).onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var i=Math.min(this._start+this._config.chunkSize,this._input.size);t=n.call(t,this._start,i)}var o=e.readAsText(t,this._config.encoding);r||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function f(t){var e;t=t||{},c.call(this,t),this.stream=function(t){return t,e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,n=t?e.substr(0,t):e;return e=t?e.substr(t):"",this._finished=!e,this.parseChunk(n)}}}function h(t){t=t||{},c.call(this,t);var e=[],n=!0;this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._nextChunk=function(){e.length?this.parseChunk(e.shift()):n=!0},this._streamData=$(function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),n&&(n=!1,this.parseChunk(e.shift()))}catch(t){this._streamError(t)}},this),this._streamError=$(function(t){this._streamCleanUp(),this._sendError(t.message)},this),this._streamEnd=$(function(){this._streamCleanUp(),this._finished=!0,this._streamData("")},this),this._streamCleanUp=$(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function g(t){var e,n,r,i=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,o=this,a=0,s=!1,l=!1,c=[],p={data:[],errors:[],meta:{}};if(k(t.step)){var d=t.step;t.step=function(e){if(p=e,h())f();else{if(f(),0===p.data.length)return;a+=e.data.length,t.preview&&a>t.preview?n.abort():d(p,o)}}}function f(){if(p&&r&&(v("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),r=!1),t.skipEmptyLines)for(var e=0;e<p.data.length;e++)1===p.data[e].length&&""===p.data[e][0]&&p.data.splice(e--,1);return h()&&function(){if(!p)return;for(var t=0;h()&&t<p.data.length;t++)for(var e=0;e<p.data[t].length;e++)c.push(p.data[t][e]);p.data.splice(0,1)}(),function(){if(!p||!t.header&&!t.dynamicTyping)return p;for(var e=0;e<p.data.length;e++){for(var n=t.header?{}:[],r=0;r<p.data[e].length;r++){var i=r,o=p.data[e][r];t.header&&(i=r>=c.length?"__parsed_extra":c[r]),o=g(i,o),"__parsed_extra"===i?(n[i]=n[i]||[],n[i].push(o)):n[i]=o}p.data[e]=n,t.header&&(r>c.length?v("FieldMismatch","TooManyFields","Too many fields: expected "+c.length+" fields but parsed "+r,e):r<c.length&&v("FieldMismatch","TooFewFields","Too few fields: expected "+c.length+" fields but parsed "+r,e))}t.header&&p.meta&&(p.meta.fields=c);return p}()}function h(){return t.header&&0===c.length}function g(e,n){return o=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[o]&&(t.dynamicTyping[o]=t.dynamicTypingFunction(o)),!0===(t.dynamicTyping[o]||t.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(r=n,i.test(r)?parseFloat(r):r):n;var r,o}function v(t,e,n,r){p.errors.push({type:t,code:e,message:n,row:r})}this.parse=function(i,o,a){if(t.newline||(t.newline=function(t){var e=(t=t.substr(0,1048576)).split("\r"),n=t.split("\n"),r=n.length>1&&n[0].length<e[0].length;if(1===e.length||r)return"\n";for(var i=0,o=0;o<e.length;o++)"\n"===e[o][0]&&i++;return i>=e.length/2?"\r\n":"\r"}(i)),r=!1,t.delimiter)k(t.delimiter)&&(t.delimiter=t.delimiter(i),p.meta.delimiter=t.delimiter);else{var l=function(e,n,r){for(var i,o,a,s=[",","\t","|",";",u.RECORD_SEP,u.UNIT_SEP],l=0;l<s.length;l++){var c=s[l],p=0,d=0,f=0;a=void 0;for(var h=new m({delimiter:c,newline:n,preview:10}).parse(e),g=0;g<h.data.length;g++)if(r&&1===h.data[g].length&&0===h.data[g][0].length)f++;else{var v=h.data[g].length;d+=v,void 0!==a?v>1&&(p+=Math.abs(v-a),a=v):a=v}h.data.length>0&&(d/=h.data.length-f),(void 0===o||p<o)&&d>1.99&&(o=p,i=c)}return t.delimiter=i,{successful:!!i,bestDelimiter:i}}(i,t.newline,t.skipEmptyLines);l.successful?t.delimiter=l.bestDelimiter:(r=!0,t.delimiter=u.DefaultDelimiter),p.meta.delimiter=t.delimiter}var c=w(t);return t.preview&&t.header&&c.preview++,e=i,n=new m(c),p=n.parse(e,o,a),f(),s?{meta:{paused:!0}}:p||{meta:{paused:!1}}},this.paused=function(){return s},this.pause=function(){s=!0,n.abort(),e=e.substr(n.getCharIndex())},this.resume=function(){s=!1,o.streamer.parseChunk(e)},this.aborted=function(){return l},this.abort=function(){l=!0,n.abort(),p.meta.aborted=!0,k(t.complete)&&t.complete(p),e=""}}function m(t){var e=(t=t||{}).delimiter,n=t.newline,r=t.comments,i=t.step,o=t.preview,a=t.fastMode,s=t.quoteChar||'"';if(("string"!=typeof e||u.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),r===e)throw"Comment character same as delimiter";!0===r?r="#":("string"!=typeof r||u.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),"\n"!=n&&"\r"!=n&&"\r\n"!=n&&(n="\n");var l=0,c=!1;this.parse=function(t,u,p){if("string"!=typeof t)throw"Input must be a string";var d=t.length,f=e.length,h=n.length,g=r.length,m=k(i);l=0;var v=[],y=[],b=[],w=0;if(!t)return I();if(a||!1!==a&&-1===t.indexOf(s)){for(var $=t.split(n),C=0;C<$.length;C++){b=$[C];if(l+=b.length,C!==$.length-1)l+=n.length;else if(p)return I();if(!r||b.substr(0,g)!==r){if(m){if(v=[],D(b.split(e)),O(),c)return I()}else D(b.split(e));if(o&&C>=o)return v=v.slice(0,o),I(!0)}}return I()}for(var x=t.indexOf(e,l),T=t.indexOf(n,l),S=new RegExp(s+s,"g");;)if(t[l]!==s)if(r&&0===b.length&&t.substr(l,g)===r){if(-1===T)return I();l=T+h,T=t.indexOf(n,l),x=t.indexOf(e,l)}else if(-1!==x&&(x<T||-1===T))b.push(t.substring(l,x)),l=x+f,x=t.indexOf(e,l);else{if(-1===T)break;if(b.push(t.substring(l,T)),B(T+h),m&&(O(),c))return I();if(o&&v.length>=o)return I(!0)}else{var E=l;for(l++;;){if(-1===(E=t.indexOf(s,E+1)))return p||y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:v.length,index:l}),A();if(E===d-1)return A(t.substring(l,E).replace(S,s));if(t[E+1]!==s){if(t[E+1]===e){b.push(t.substring(l,E).replace(S,s)),l=E+1+f,x=t.indexOf(e,l),T=t.indexOf(n,l);break}if(t.substr(E+1,h)===n){if(b.push(t.substring(l,E).replace(S,s)),B(E+1+h),x=t.indexOf(e,l),m&&(O(),c))return I();if(o&&v.length>=o)return I(!0);break}y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:v.length,index:l}),E++}else E++}}return A();function D(t){v.push(t),w=l}function A(e){return p?I():(void 0===e&&(e=t.substr(l)),b.push(e),l=d,D(b),m&&O(),I())}function B(e){l=e,D(b),b=[],T=t.indexOf(n,l)}function I(t){return{data:v,errors:y,meta:{delimiter:e,linebreak:n,aborted:c,truncated:!!t,cursor:w+(u||0)}}}function O(){i(I()),v=[],y=[]}},this.abort=function(){c=!0},this.getCharIndex=function(){return l}}function v(t){var e=t.data,n=a[e.workerId],r=!1;if(e.error)n.userError(e.error,e.file);else if(e.results&&e.results.data){var i={abort:function(){r=!0,y(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:b,resume:b};if(k(n.userStep)){for(var o=0;o<e.results.data.length&&(n.userStep({data:[e.results.data[o]],errors:e.results.errors,meta:e.results.meta},i),!r);o++);delete e.results}else k(n.userChunk)&&(n.userChunk(e.results,i,e.file),delete e.results)}e.finished&&!r&&y(e.workerId,e.results)}function y(t,e){var n=a[t];k(n.userComplete)&&n.userComplete(e),n.terminate(),delete a[t]}function b(){throw"Not implemented."}function w(t){if("object"!=typeof t)return t;var e=t instanceof Array?[]:{};for(var n in t)e[n]=w(t[n]);return e}function $(t,e){return function(){t.apply(e,arguments)}}function k(t){return"function"==typeof t}return i?n.onmessage=function(t){var e=t.data;void 0===u.WORKER_ID&&e&&(u.WORKER_ID=e.workerId);if("string"==typeof e.input)n.postMessage({workerId:u.WORKER_ID,results:u.parse(e.input,e.config),finished:!0});else if(n.File&&e.input instanceof File||e.input instanceof Object){var r=u.parse(e.input,e.config);r&&n.postMessage({workerId:u.WORKER_ID,results:r,finished:!0})}}:u.WORKERS_SUPPORTED&&(e=document.getElementsByTagName("script"),t=e.length?e[e.length-1].src:"",document.body?document.addEventListener("DOMContentLoaded",function(){o=!0},!0):o=!0),p.prototype=Object.create(c.prototype),p.prototype.constructor=p,d.prototype=Object.create(c.prototype),d.prototype.constructor=d,f.prototype=Object.create(f.prototype),f.prototype.constructor=f,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,u}),"undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");function _init(){"use strict";$.AdminLTE.layout={activate:function(){var t=this;t.fix(),t.fixSidebar(),$("body, html, .wrapper").css("height","auto"),$(window,".wrapper").resize(function(){t.fix(),t.fixSidebar()})},fix:function(){$(".layout-boxed > .wrapper").css("overflow","hidden");var t=$(".main-footer").outerHeight()||0,e=$(".main-header").outerHeight()+t,n=$(window).height(),r=$(".sidebar").height()||0;if($("body").hasClass("fixed"))$(".content-wrapper, .right-side").css("min-height",n-t);else{var i;n>=r?($(".content-wrapper, .right-side").css("min-height",n-e),i=n-e):($(".content-wrapper, .right-side").css("min-height",r),i=r);var o=$($.AdminLTE.options.controlSidebarOptions.selector);void 0!==o&&o.height()>i&&$(".content-wrapper, .right-side").css("min-height",o.height())}},fixSidebar:function(){$("body").hasClass("fixed")?(void 0===$.fn.slimScroll&&window.console&&window.console.error("Error: the fixed layout requires the slimscroll plugin!"),$.AdminLTE.options.sidebarSlimScroll&&void 0!==$.fn.slimScroll&&($(".sidebar").slimScroll({destroy:!0}).height("auto"),$(".sidebar").slimScroll({height:$(window).height()-$(".main-header").height()+"px",color:"rgba(0,0,0,0.2)",size:"3px"}))):void 0!==$.fn.slimScroll&&$(".sidebar").slimScroll({destroy:!0}).height("auto")}},$.AdminLTE.pushMenu={activate:function(t){var e=$.AdminLTE.options.screenSizes;$(document).on("click",t,function(t){t.preventDefault(),$(window).width()>e.sm-1?$("body").hasClass("sidebar-collapse")?$("body").removeClass("sidebar-collapse").trigger("expanded.pushMenu"):$("body").addClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").hasClass("sidebar-open")?$("body").removeClass("sidebar-open").removeClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").addClass("sidebar-open").trigger("expanded.pushMenu")}),$(".content-wrapper").click(function(){$(window).width()<=e.sm-1&&$("body").hasClass("sidebar-open")&&$("body").removeClass("sidebar-open")}),($.AdminLTE.options.sidebarExpandOnHover||$("body").hasClass("fixed")&&$("body").hasClass("sidebar-mini"))&&this.expandOnHover()},expandOnHover:function(){var t=this,e=$.AdminLTE.options.screenSizes.sm-1;$(".main-sidebar").hover(function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-collapse")&&$(window).width()>e&&t.expand()},function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-expanded-on-hover")&&$(window).width()>e&&t.collapse()})},expand:function(){$("body").removeClass("sidebar-collapse").addClass("sidebar-expanded-on-hover")},collapse:function(){$("body").hasClass("sidebar-expanded-on-hover")&&$("body").removeClass("sidebar-expanded-on-hover").addClass("sidebar-collapse")}},$.AdminLTE.tree=function(t){var e=this,n=$.AdminLTE.options.animationSpeed;$(document).off("click",t+" li a").on("click",t+" li a",function(t){var r=$(this),i=r.next();if(i.is(".treeview-menu")&&i.is(":visible")&&!$("body").hasClass("sidebar-collapse"))i.slideUp(n,function(){i.removeClass("menu-open")}),i.parent("li").removeClass("active");else if(i.is(".treeview-menu")&&!i.is(":visible")){var o=r.parents("ul").first();o.find("ul:visible").slideUp(n).removeClass("menu-open");var a=r.parent("li");i.slideDown(n,function(){i.addClass("menu-open"),o.find("li.active").removeClass("active"),a.addClass("active"),e.layout.fix()})}i.is(".treeview-menu")&&t.preventDefault()})},$.AdminLTE.controlSidebar={activate:function(){var t=this,e=$.AdminLTE.options.controlSidebarOptions,n=$(e.selector);$(e.toggleBtnSelector).on("click",function(r){r.preventDefault(),n.hasClass("control-sidebar-open")||$("body").hasClass("control-sidebar-open")?t.close(n,e.slide):t.open(n,e.slide)});var r=$(".control-sidebar-bg");t._fix(r),$("body").hasClass("fixed")?t._fixForFixed(n):$(".content-wrapper, .right-side").height()<n.height()&&t._fixForContent(n)},open:function(t,e){e?t.addClass("control-sidebar-open"):$("body").addClass("control-sidebar-open")},close:function(t,e){e?t.removeClass("control-sidebar-open"):$("body").removeClass("control-sidebar-open")},_fix:function(t){var e=this;if($("body").hasClass("layout-boxed")){if(t.css("position","absolute"),t.height($(".wrapper").height()),e.hasBindedResize)return;$(window).resize(function(){e._fix(t)}),e.hasBindedResize=!0}else t.css({position:"fixed",height:"auto"})},_fixForFixed:function(t){t.css({position:"fixed","max-height":"100%",overflow:"auto","padding-bottom":"50px"})},_fixForContent:function(t){$(".content-wrapper, .right-side").css("min-height",t.height())}},$.AdminLTE.boxWidget={selectors:$.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,icons:$.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,animationSpeed:$.AdminLTE.options.animationSpeed,activate:function(t){var e=this;t||(t=document),$(t).on("click",e.selectors.collapse,function(t){t.preventDefault(),e.collapse($(this))}),$(t).on("click",e.selectors.remove,function(t){t.preventDefault(),e.remove($(this))})},collapse:function(t){var e=t.parents(".box").first(),n=e.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer");e.hasClass("collapsed-box")?(t.children(":first").removeClass(this.icons.open).addClass(this.icons.collapse),n.slideDown(this.animationSpeed,function(){e.removeClass("collapsed-box")})):(t.children(":first").removeClass(this.icons.collapse).addClass(this.icons.open),n.slideUp(this.animationSpeed,function(){e.addClass("collapsed-box")}))},remove:function(t){t.parents(".box").first().slideUp(this.animationSpeed)}}}$.AdminLTE={},$.AdminLTE.options={navbarMenuSlimscroll:!0,navbarMenuSlimscrollWidth:"3px",navbarMenuHeight:"200px",animationSpeed:500,sidebarToggleSelector:"[data-toggle='offcanvas']",sidebarPushMenu:!0,sidebarSlimScroll:!0,sidebarExpandOnHover:!1,enableBoxRefresh:!0,enableBSToppltip:!0,BSTooltipSelector:"[data-toggle='tooltip']",enableFastclick:!1,enableControlTreeView:!0,enableControlSidebar:!0,controlSidebarOptions:{toggleBtnSelector:"[data-toggle='control-sidebar']",selector:".control-sidebar",slide:!0},enableBoxWidget:!0,boxWidgetOptions:{boxWidgetIcons:{collapse:"fa-minus",open:"fa-plus",remove:"fa-times"},boxWidgetSelectors:{remove:'[data-widget="remove"]',collapse:'[data-widget="collapse"]'}},directChat:{enable:!0,contactToggleSelector:'[data-widget="chat-pane-toggle"]'},colors:{lightBlue:"#3c8dbc",red:"#f56954",green:"#00a65a",aqua:"#00c0ef",yellow:"#f39c12",blue:"#0073b7",navy:"#001F3F",teal:"#39CCCC",olive:"#3D9970",lime:"#01FF70",orange:"#FF851B",fuchsia:"#F012BE",purple:"#8E24AA",maroon:"#D81B60",black:"#222222",gray:"#d2d6de"},screenSizes:{xs:480,sm:768,md:992,lg:1200}},$(function(){"use strict";$("body").removeClass("hold-transition"),"undefined"!=typeof AdminLTEOptions&&$.extend(!0,$.AdminLTE.options,AdminLTEOptions);var t=$.AdminLTE.options;_init(),$.AdminLTE.layout.activate(),t.enableControlTreeView&&$.AdminLTE.tree(".sidebar"),t.enableControlSidebar&&$.AdminLTE.controlSidebar.activate(),t.navbarMenuSlimscroll&&void 0!==$.fn.slimscroll&&$(".navbar .menu").slimscroll({height:t.navbarMenuHeight,alwaysVisible:!1,size:t.navbarMenuSlimscrollWidth}).css("width","100%"),t.sidebarPushMenu&&$.AdminLTE.pushMenu.activate(t.sidebarToggleSelector),t.enableBSToppltip&&$("body").tooltip({selector:t.BSTooltipSelector,container:"body"}),t.enableBoxWidget&&$.AdminLTE.boxWidget.activate(),t.enableFastclick&&"undefined"!=typeof FastClick&&FastClick.attach(document.body),t.directChat.enable&&$(document).on("click",t.directChat.contactToggleSelector,function(){$(this).parents(".direct-chat").first().toggleClass("direct-chat-contacts-open")}),$('.btn-group[data-toggle="btn-toggle"]').each(function(){var t=$(this);$(this).find(".btn").on("click",function(e){t.find(".btn.active").removeClass("active"),$(this).addClass("active"),e.preventDefault()})})}),function(t){"use strict";t.fn.boxRefresh=function(e){var n=t.extend({trigger:".refresh-btn",source:"",onLoadStart:function(t){return t},onLoadDone:function(t){return t}},e),r=t('<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>');return this.each(function(){if(""!==n.source){var e=t(this);e.find(n.trigger).first().on("click",function(t){var i;t.preventDefault(),(i=e).append(r),n.onLoadStart.call(i),e.find(".box-body").load(n.source,function(){var t;(t=e).find(r).remove(),n.onLoadDone.call(t)})})}else window.console&&window.console.log("Please specify a source first - boxRefresh()")})}}(jQuery),function(t){"use strict";t.fn.activateBox=function(){t.AdminLTE.boxWidget.activate(this)},t.fn.toggleBox=function(){var e=t(t.AdminLTE.boxWidget.selectors.collapse,this);t.AdminLTE.boxWidget.collapse(e)},t.fn.removeBox=function(){var e=t(t.AdminLTE.boxWidget.selectors.remove,this);t.AdminLTE.boxWidget.remove(e)}}(jQuery),function(t){"use strict";t.fn.todolist=function(e){var n=t.extend({onCheck:function(t){return t},onUncheck:function(t){return t}},e);return this.each(function(){void 0!==t.fn.iCheck?(t("input",this).on("ifChecked",function(){var e=t(this).parents("li").first();e.toggleClass("done"),n.onCheck.call(e)}),t("input",this).on("ifUnchecked",function(){var e=t(this).parents("li").first();e.toggleClass("done"),n.onUncheck.call(e)})):t("input",this).on("change",function(){var e=t(this).parents("li").first();e.toggleClass("done"),t("input",e).is(":checked")?n.onCheck.call(e):n.onUncheck.call(e)})})}}(jQuery); -\ No newline at end of file +!function(t,e){"use strict";var n=window.angulartics||(window.angulartics={});function r(t){return["a:","button:","button:button","button:submit","input:button","input:submit"].indexOf(t.tagName.toLowerCase()+":"+(t.type||""))>=0}function i(t){var e=t.slice(9);return null!=e&&e.length>0?e.substring(0,1).toLowerCase()+e.substring(1):e}n.waitForVendorCount=0,n.waitForVendorApi=function(t,e,r,i,o){o||n.waitForVendorCount++,i||(i=r,r=void 0),!Object.prototype.hasOwnProperty.call(window,t)||void 0!==r&&void 0===window[t][r]?setTimeout(function(){n.waitForVendorApi(t,e,r,i,!0)},e):(n.waitForVendorCount--,i(window[t]))},t.module("angulartics",[]).provider("$analytics",function(){var e=this,r={pageTracking:{autoTrackFirstPage:!0,autoTrackVirtualPages:!0,trackRelativePath:!1,trackRoutes:!0,trackStates:!0,autoBasePath:!1,basePath:"",excludedRoutes:[],queryKeysWhitelisted:[],queryKeysBlacklisted:[]},eventTracking:{},bufferFlushDelay:1e3,trackExceptions:!1,optOut:!1,developerMode:!1},i=["pageTrack","eventTrack","exceptionTrack","transactionTrack","setAlias","setUsername","setUserProperties","setUserPropertiesOnce","setSuperProperties","setSuperPropertiesOnce","incrementProperty","userTimings","clearCookies"],o={},a={},s={};function u(e,n,r){return a[e]||(a[e]=[]),a[e].push(n),s[n]=r,function(){if(!this.settings.optOut){var n=Array.prototype.slice.apply(arguments);return this.$inject(["$q",t.bind(this,function(r){return r.all(a[e].map(function(e){var i=s[e]||{};if(i.async){var o=r.defer(),a=t.copy(n);return a.unshift(o.resolve),e.apply(this,a),o.promise}return r.when(e.apply(this,n))},this))})])}}}var l={settings:r};l.setOptOut=function(t){this.settings.optOut=t,g()},l.getOptOut=function(){return this.settings.optOut};var c={$get:["$injector",function(t){return d(t)}],api:l,settings:r,virtualPageviews:function(t){this.settings.pageTracking.autoTrackVirtualPages=t},trackStates:function(t){this.settings.pageTracking.trackStates=t},trackRoutes:function(t){this.settings.pageTracking.trackRoutes=t},excludeRoutes:function(t){this.settings.pageTracking.excludedRoutes=t},queryKeysWhitelist:function(t){this.settings.pageTracking.queryKeysWhitelisted=t},queryKeysBlacklist:function(t){this.settings.pageTracking.queryKeysBlacklisted=t},firstPageview:function(t){this.settings.pageTracking.autoTrackFirstPage=t},withBase:function(e){this.settings.pageTracking.basePath=e?t.element(document).find("base").attr("href"):""},withAutoBase:function(t){this.settings.pageTracking.autoBasePath=t},trackExceptions:function(t){this.settings.trackExceptions=t},developerMode:function(t){this.settings.developerMode=t}};function p(e,n,i){if(!r.developerMode){l[e]=u(e,n,i);var a=r[e],s=a?a.bufferFlushDelay:null,c=null!==s?s:r.bufferFlushDelay;t.forEach(o[e],function(t,e){var r,i;r=function(){n.apply(this,t)},(i=e*c)?setTimeout(r,i):r()})}}var d=function(e){return t.extend(l,{$inject:e.invoke})};function f(t){var e,r="register"+t.replace(/^./,function(t){return t.toUpperCase()});c[r]=function(e,n){p(t,e,n)},l[t]=u(t,(e=t,function(){n.waitForVendorCount&&(o[e]||(o[e]=[]),o[e].push(arguments))}))}function h(n,r,i){for(var o in t.forEach(r,i),n)e[o]=n[o]}var g=function(){h(c,i,f)};h(c,i,f)}).run(["$rootScope","$window","$analytics","$injector",function(e,n,r,i){function o(t,e,n){if(/\?/.test(t)&&e.length>0){for(var r=t.split("?"),i=r[0],o=r[1].split("&"),a=[],s=0;s<e.length;s++)for(var u=e[s],l=0;l<o.length;l++)(u instanceof RegExp&&u.test(o[l])||o[l].indexOf(u)>-1)&&a.push(o[l]);var c="white"==n?a:function(t,e){for(var n=[],r=0;r<t.length;r++)-1===e.indexOf(t[r])&&n.push(t[r]);return n}(o,a);return c.length>0?i+"?"+c.join("&"):i}return t}function a(t,e){(function(t){for(var e=0;e<r.settings.pageTracking.excludedRoutes.length;e++){var n=r.settings.pageTracking.excludedRoutes[e];if(n instanceof RegExp&&n.test(t)||t.indexOf(n)>-1)return!0}return!1})(t)||(t=o(t,r.settings.pageTracking.queryKeysWhitelisted,"white"),t=o(t,r.settings.pageTracking.queryKeysBlacklisted,"black"),r.pageTrack(t,e))}r.settings.pageTracking.autoTrackFirstPage&&i.invoke(["$location",function(t){var e=!0;if(i.has("$route")){var o=i.get("$route");if(o)for(var s in o.routes){e=!1;break}else null===o&&(e=!1)}else if(i.has("$state")){var u=i.get("$state");u.get().length>1&&(e=!1)}if(e)if(r.settings.pageTracking.autoBasePath&&(r.settings.pageTracking.basePath=n.location.pathname),r.settings.pageTracking.trackRelativePath){var l=r.settings.pageTracking.basePath+t.url();a(l,t)}else a(t.absUrl(),t)}]);r.settings.pageTracking.autoTrackVirtualPages&&i.invoke(["$location",function(t){r.settings.pageTracking.autoBasePath&&(r.settings.pageTracking.basePath=n.location.pathname+"#");var o=!0;if(r.settings.pageTracking.trackRoutes&&i.has("$route")){var s=i.get("$route");if(s)for(var u in s.routes){o=!1;break}else null===s&&(o=!1);e.$on("$routeChangeSuccess",function(e,n){if(!n||!(n.$$route||n).redirectTo){var i=r.settings.pageTracking.basePath+t.url();a(i,t)}})}r.settings.pageTracking.trackStates&&(i.has("$state")&&!i.has("$transitions")&&(o=!1,e.$on("$stateChangeSuccess",function(e,n){var i=r.settings.pageTracking.basePath+t.url();a(i,t)})),i.has("$state")&&i.has("$transitions")&&(o=!1,i.invoke(["$transitions",function(e){e.onSuccess({},function(e){var n=e.options();if(n.notify){var i=r.settings.pageTracking.basePath+t.url();a(i,t)}})}]))),o&&e.$on("$locationChangeSuccess",function(e,n){if(!n||!(n.$$route||n).redirectTo)if(r.settings.pageTracking.trackRelativePath){var i=r.settings.pageTracking.basePath+t.url();a(i,t)}else a(t.absUrl(),t)})}]);r.settings.developerMode&&t.forEach(r,function(t,e){"function"==typeof t&&(r[e]=function(){})})}]).directive("analyticsOn",["$analytics",function(e){return{restrict:"A",link:function(n,o,a){var s=a.analyticsOn||"click",u={};t.forEach(a.$attr,function(t,e){var n;"analytics"===(n=e).substr(0,9)&&-1===["On","Event","If","Properties","EventType"].indexOf(n.substr(9))&&(u[i(e)]=a[e],a.$observe(e,function(t){u[i(e)]=t}))}),t.element(o[0]).on(s,function(i){var s,l=a.analyticsEvent||(r(s=o[0])?s.innerText||s.value:s.id||s.name||s.tagName);u.eventType=i.type,a.analyticsIf&&!n.$eval(a.analyticsIf)||(a.analyticsProperties&&t.extend(u,n.$eval(a.analyticsProperties)),e.eventTrack(l,u))})}}}]).config(["$provide",function(t){t.decorator("$exceptionHandler",["$delegate","$injector",function(t,e){return function(n,r){var i=t(n,r),o=e.get("$analytics");return o.settings.trackExceptions&&o.exceptionTrack(n,r),i}}])}])}(angular),function(){var t;(t=angular.module("ui.bootstrap.showErrors",[])).directive("showErrors",["$timeout","showErrorsConfig","$interpolate",function(t,e,n){var r,i,o;return i=function(t){var n;return n=e.trigger,t&&null!=t.trigger&&(n=t.trigger),n},r=function(t){var n;return n=e.showSuccess,t&&null!=t.showSuccess&&(n=t.showSuccess),n},o=function(e,o,a,s){var u,l,c,p,d,f,h,g;if(u=!1,d=e.$eval(a.showErrors),f=r(d),g=i(d),l=o[0].querySelector(".form-control[name]"),p=angular.element(l),!(c=n(p.attr("name")||"")(e)))throw"show-errors element has no child input elements with a 'name' attribute and a 'form-control' class";return p.bind(g,function(){return u=!0,h(s[c].$invalid)}),e.$watch(function(){return s[c]&&s[c].$invalid},function(t){if(u)return h(t)}),e.$on("show-errors-check-validity",function(){return h(s[c].$invalid)}),e.$on("show-errors-reset",function(){return t(function(){return o.removeClass("has-error"),o.removeClass("has-success"),u=!1},0,!1)}),h=function(t){if(o.toggleClass("has-error",t),f)return o.toggleClass("has-success",!t)}},{restrict:"A",require:"^form",compile:function(t,e){if(-1===e.showErrors.indexOf("skipFormGroupCheck")&&!t.hasClass("form-group")&&!t.hasClass("input-group"))throw"show-errors element does not have the 'form-group' or 'input-group' class";return o}}}]),t.provider("showErrorsConfig",function(){var t,e;t=!1,e="blur",this.showSuccess=function(e){return t=e},this.trigger=function(t){return e=t},this.$get=function(){return{showSuccess:t,trigger:e}}})}.call(this),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).angularCreditCards=t()}}(function(){return function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}}()({1:[function(t,e,n){"use strict";var r=t("creditcards").cvc,i=t("function-bind");function o(t){return{restrict:"A",require:"ngModel",compile:function(e,n){return n.$set("maxlength",4),n.$set("pattern","[0-9]*"),n.$set("xAutocompletetype","cc-csc"),function(e,n,o,a){a.$validators.ccCvc=function(n){return a.$isEmpty(a.$viewValue)||r.isValid(n,t(o.ccType)(e))},o.ccType&&e.$watch(o.ccType,i.call(a.$validate,a))}}}}e.exports=o,o.$inject=["$parse"]},{creditcards:13,"function-bind":18}],2:[function(t,e,n){"use strict";var r=t("creditcards").expiration,i=r.month,o=r.year,a=t("ap");function s(t,e){var n={$setValidity:l},i=e.inheritedData("$formController")||n,o={year:{},month:{}};function a(t){var n=t.month,o=t.year,a=null==n&&null==o||!!n&&!!o&&!r.isPast(n,o);i.$setValidity("ccExp",a,e)}this.setMonth=function(t){o.month=t},this.setYear=function(t){o.year=t},this.$watch=function(){t.$watch(function(){return{month:o.month.$modelValue,year:o.year.$modelValue}},a,!0)}}n=e.exports=function(){return{restrict:"AE",require:"ccExp",controller:s,link:function(t,e,n,r){r.$watch()}}},s.$inject=["$scope","$element"];var u={setMonth:l,setYear:l};function l(){}n.month=function(){return{restrict:"A",require:["ngModel","^?ccExp"],compile:function(t,e){return e.$set("maxlength",2),e.$set("pattern","[0-9]*"),e.$set("xAutocompletetype","cc-exp-month"),function(t,e,n,r){var o=r[0];(r[1]||u).setMonth(o),o.$parsers.unshift(i.parse),o.$validators.ccExpMonth=function(t){return o.$isEmpty(o.$viewValue)||i.isValid(t)}}}}},n.year=function(){return{restrict:"A",require:["ngModel","^?ccExp"],compile:function(t,e){var n=void 0!==e.fullYear;return e.$set("maxlength",n?4:2),e.$set("pattern","[0-9]*"),e.$set("xAutocompletetype","cc-exp-year"),function(t,e,r,i){var s=i[0];(i[1]||u).setYear(s),s.$parsers.unshift(a.partialRight(o.parse,!n)),s.$formatters.unshift(function(t){return t?o.format(t,!n):""}),s.$validators.ccExpYear=function(t){return s.$isEmpty(s.$viewValue)||o.isValid(t)&&!o.isPast(t)}}}}}},{ap:5,creditcards:13}],3:[function(t,e,n){(function(n){"use strict";var r="undefined"!=typeof window?window.angular:void 0!==n?n.angular:null,i=t("creditcards"),o=t("./number"),a=t("./cvc"),s=t("./expiration");e.exports=r.module("credit-cards",[]).value("creditcards",i).directive("ccNumber",o).directive("ccExp",s).directive("ccExpMonth",s.month).directive("ccExpYear",s.year).directive("ccCvc",a).name}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cvc":1,"./expiration":2,"./number":4,creditcards:13}],4:[function(t,e,n){"use strict";var r=t("creditcards").card,i=t("cast-array"),o=t("ap").partial;function a(t,e){return{restrict:"A",require:["ngModel","ccNumber"],controller:function(){this.type=null,this.eagerType=null},compile:function(n,a){return a.$set("pattern","[0-9]*"),a.$set("xAutocompletetype","cc-number"),function(n,a,s,u){var l=u[0],c=u[1];function p(){return l.$viewValue}n.$watch(s.ngModel,function(t){l.$ccType=c.type=r.type(t)}),null!=s.ccEagerType&&n.$watch(p,function(t){t=r.parse(t),l.$ccEagerType=c.eagerType=r.type(t,!0)}),s.ccType&&n.$watch(s.ccType,function(){l.$validate()}),null!=s.ccFormat&&(l.$formatters.unshift(r.format),a.on("input",function(){var t=a.val(),n=p();if(t){var i,o,s=a[0],u=r.format(r.parse(t)),c=s.selectionEnd;l.$setViewValue(u),l.$render(),n&&n.length<u.length&&(c=u.length),i=s,o=c,e(function(){if(i.setSelectionRange)i.setSelectionRange(o,o);else if(i.createTextRange){var t=i.createTextRange();t.move("character",o),t.select()}},0)}})),l.$parsers.unshift(r.parse),l.$validators.ccNumber=function(t){return l.$isEmpty(l.$viewValue)||r.isValid(t)},l.$validators.ccNumberType=function(e){if(l.$isEmpty(l.$viewValue))return!0;var a=t(s.ccType)(n);return a||r.isValid(e),i(a).some(o(r.isValid,e))}}}}}e.exports=a,a.$inject=["$parse","$timeout"]},{ap:5,"cast-array":6,creditcards:13}],5:[function(t,e,n){function r(t,e){return function(){var n=[].slice.call(arguments),r=t.slice();return r.push.apply(r,n),e.apply(this,r)}}function i(t,e){return function(){var n=[].slice.call(arguments);return n.push.apply(n,t),e.apply(this,n)}}function o(t){return r([].slice.call(arguments,1),t)}function a(t){return i([].slice.call(arguments,1),t)}(n=e.exports=r).pa=i,n.apa=function(t,e,n){return function(){return n.apply(this,t.concat.apply(t,arguments).concat(e))}},n.partial=o,n.partialRight=a,n.curry=function(t){return o(o,t)},n.curryRight=function(t){return o(a,t)}},{}],6:[function(t,e,n){"use strict";var r=t("isarray");e.exports=function(t){return r(t)?t:[t]}},{isarray:22}],7:[function(t,e,n){"use strict";var r=n.types=t("./src/types");n.Type=t("./src/type"),n.find=function(t){for(var e in r){var n=r[e];if(t(n))return n}}},{"./src/type":8,"./src/types":9}],8:[function(t,e,n){"use strict";var r=t("xtend/mutable");function i(t,e){r(this,{name:t},e)}e.exports=i,i.prototype.cvcLength=3,i.prototype.luhn=!0,i.prototype.groupPattern=/(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?/,i.prototype.group=function(t){return(t.match(this.groupPattern)||[]).slice(1).filter(Boolean)},i.prototype.test=function(t,e){return this[e?"eagerPattern":"pattern"].test(t)}},{"xtend/mutable":30}],9:[function(t,e,n){"use strict";var r=t("./type"),i=/(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?(\d{1,3})?/;n.visa=new r("Visa",{pattern:/^4\d{12}(\d{3}|\d{6})?$/,eagerPattern:/^4/,groupPattern:i}),n.maestro=new r("Maestro",{pattern:/^(?:5[06789]\d\d|(?!6011[0234])(?!60117[4789])(?!60118[6789])(?!60119)(?!64[456789])(?!65)6\d{3})\d{8,15}$/,eagerPattern:/^(5(018|0[23]|[68])|6[37]|60111|60115|60117([56]|7[56])|60118[0-5]|64[0-3]|66)/,groupPattern:i}),n.forbrugsforeningen=new r("Forbrugsforeningen",{pattern:/^600722\d{10}$/,eagerPattern:/^600/}),n.dankort=new r("Dankort",{pattern:/^5019\d{12}$/,eagerPattern:/^5019/}),n.masterCard=new r("MasterCard",{pattern:/^(5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)\d{12}$/,eagerPattern:/^(2|5[1-5])/}),n.americanExpress=new r("American Express",{pattern:/^3[47]\d{13}$/,eagerPattern:/^3[47]/,groupPattern:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,cvcLength:4}),n.dinersClub=new r("Diners Club",{pattern:/^3(0[0-5]|[68]\d)\d{11}$/,eagerPattern:/^3(0|[68])/,groupPattern:/(\d{1,4})?(\d{1,6})?(\d{1,4})?/}),n.discover=new r("Discover",{pattern:/^6(011(0[0-9]|[2-4]\d|74|7[7-9]|8[6-9]|9[0-9])|4[4-9]\d{3}|5\d{4})\d{10}$/,eagerPattern:/^6(011(0[0-9]|[2-4]|74|7[7-9]|8[6-9]|9[0-9])|4[4-9]|5)/}),n.jcb=new r("JCB",{pattern:/^35\d{14}$/,eagerPattern:/^35/}),n.unionPay=new r("UnionPay",{pattern:/^62[0-5]\d{13,16}$/,eagerPattern:/^62/,groupPattern:i,luhn:!1}),n.troy=new r("Troy",{pattern:/^9792\d{12}$/,eagerPattern:/^9792/})},{"./type":8}],10:[function(t,e,n){"use strict";var r=t("fast-luhn"),i=t("./types");function o(t,e){return i.find(function(n){return n.test(t,e)})}e.exports={types:i,parse:function(t){return"string"!=typeof t?"":t.replace(/[^\d]/g,"")},format:function(t,e){var n=o(t,!0);return n?n.group(t).join(e||" "):t},type:function(t,e){var n=o(t,e);return n?n.name:void 0},luhn:r,isValid:function(t,e){e=e?i.get(e):o(t);return!!e&&(!e.luhn||r(t))&&e.test(t)}}},{"./types":14,"fast-luhn":16}],11:[function(t,e,n){"use strict";var r=t("./types"),i=/^\d{3,4}$/;e.exports={isValid:function(t,e){return!("string"!=typeof t||!i.test(t)||e&&r.get(e).cvcLength!==t.length)}}},{"./types":14}],12:[function(t,e,n){"use strict";var r=t("is-valid-month"),i=t("parse-int"),o=t("parse-year");e.exports={isPast:function(t,e){return Date.now()>=new Date(e,t)},month:{parse:function(t){return i(t)},isValid:r},year:{parse:o,format:function(t,e){return t=t.toString(),e?t.substr(2,4):t},isValid:function(t){return"number"==typeof t&&(t=i(t))>0},isPast:function(t){return(new Date).getFullYear()>t}}}},{"is-valid-month":21,"parse-int":24,"parse-year":25}],13:[function(t,e,n){"use strict";e.exports={card:t("./card"),cvc:t("./cvc"),expiration:t("./expiration")}},{"./card":10,"./cvc":11,"./expiration":12}],14:[function(t,e,n){"use strict";var r=t("creditcards-types"),i=t("to-camel-case"),o=t("xtend");e.exports=o(r,{get:function(t){return r.types[i(t)]}})},{"creditcards-types":7,"to-camel-case":26,xtend:29}],15:[function(t,e,n){"use strict";var r=t("zero-fill"),i=t("parse-int"),o=r(2);e.exports=function(t,e){var n=(e=e||new Date).getFullYear().toString().substr(0,2);return t=i(t),i(n+o(t))}},{"parse-int":24,"zero-fill":31}],16:[function(t,e,n){"use strict";var r;e.exports=(r=[0,2,4,6,8,1,3,5,7,9],function(t){if("string"!=typeof t)throw new TypeError("Expected string input");if(!t)return!1;for(var e,n=t.length,i=1,o=0;n;)e=parseInt(t.charAt(--n),10),o+=(i^=1)?r[e]:e;return!!o&&o%10==0})},{}],17:[function(t,e,n){"use strict";var r=Array.prototype.slice,i=Object.prototype.toString;e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,o=r.call(arguments,1),a=Math.max(0,e.length-o.length),s=[],u=0;u<a;u++)s.push("$"+u);if(n=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var i=e.apply(this,o.concat(r.call(arguments)));return Object(i)===i?i:this}return e.apply(t,o.concat(r.call(arguments)))}),e.prototype){var l=function(){};l.prototype=e.prototype,n.prototype=new l,l.prototype=null}return n}},{}],18:[function(t,e,n){"use strict";var r=t("./implementation");e.exports=Function.prototype.bind||r},{"./implementation":17}],19:[function(t,e,n){"use strict";var r=t("number-is-nan");e.exports=Number.isFinite||function(t){return!("number"!=typeof t||r(t)||t===1/0||t===-1/0)}},{"number-is-nan":23}],20:[function(t,e,n){var r=t("is-finite");e.exports=Number.isInteger||function(t){return"number"==typeof t&&r(t)&&Math.floor(t)===t}},{"is-finite":19}],21:[function(t,e,n){"use strict";var r=t("is-integer");e.exports=function(t){return!("number"!=typeof t||!r(t))&&(t>=1&&t<=12)}},{"is-integer":20}],22:[function(t,e,n){e.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},{}],23:[function(t,e,n){"use strict";e.exports=Number.isNaN||function(t){return t!=t}},{}],24:[function(t,e,n){"use strict";var r=t("is-integer");e.exports=function(t){return"number"==typeof t?r(t)?t:void 0:"string"==typeof t&&/^-?\d+$/.test(t)?parseInt(t,10):void 0}},{"is-integer":20}],25:[function(t,e,n){"use strict";var r=t("parse-int"),i=t("expand-year");e.exports=function(t,e,n){if(null!=(t=r(t)))return e?i(t,n):t}},{"expand-year":15,"parse-int":24}],26:[function(t,e,n){var r=t("to-space-case");e.exports=function(t){return r(t).replace(/\s(\w)/g,function(t,e){return e.toUpperCase()})}},{"to-space-case":28}],27:[function(t,e,n){e.exports=function(t){return r.test(t)?t.toLowerCase():i.test(t)?(n=t,n.replace(a,function(t,e){return e?" "+e:""})||t).toLowerCase():o.test(t)?(e=t,e.replace(s,function(t,e,n){return e+" "+n.toLowerCase().split("").join(" ")})).toLowerCase():t.toLowerCase();var e;var n};var r=/\s/,i=/(_|-|\.|:)/,o=/([a-z][A-Z]|[A-Z][a-z])/;var a=/[\W_]+(.|$)/g;var s=/(.)([A-Z]+)/g},{}],28:[function(t,e,n){var r=t("to-no-case");e.exports=function(t){return r(t).replace(/[\W_]+(.|$)/g,function(t,e){return e?" "+e:""}).trim()}},{"to-no-case":27}],29:[function(t,e,n){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],30:[function(t,e,n){e.exports=function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],31:[function(t,e,n){e.exports=function t(e,n,r){return void 0===n?function(n,r){return t(e,n,r)}:(void 0===r&&(r="0"),(e-=n.toString().length)>0?new Array(e+(/\./.test(n)?2:1)).join(r)+n:n+"")}},{}]},{},[3])(3)}),function(t,e){"use strict";function n(t,n,r){var i=r.baseHref(),o=t[0];return function(t,r,a){o.cookie=function(t,r,o){var a,s;s=(o=o||{}).expires,a=e.isDefined(o.path)?o.path:i,e.isUndefined(r)&&(s="Thu, 01 Jan 1970 00:00:00 GMT",r=""),e.isString(s)&&(s=new Date(s));var u=encodeURIComponent(t)+"="+encodeURIComponent(r);u+=a?";path="+a:"",u+=o.domain?";domain="+o.domain:"",u+=s?";expires="+s.toUTCString():"";var l=(u+=o.secure?";secure":"").length+1;return l>4096&&n.warn("Cookie '"+t+"' possibly not set or overflowed because it was too large ("+l+" > 4096 bytes)!"),u}(t,r,a)}}e.module("ngCookies",["ng"]).info({angularVersion:"1.6.7"}).provider("$cookies",[function(){var t=this.defaults={};function n(n){return n?e.extend({},t,n):t}this.$get=["$$cookieReader","$$cookieWriter",function(t,r){return{get:function(e){return t()[e]},getObject:function(t){var n=this.get(t);return n?e.fromJson(n):n},getAll:function(){return t()},put:function(t,e,i){r(t,e,n(i))},putObject:function(t,n,r){this.put(t,e.toJson(n),r)},remove:function(t,e){r(t,void 0,n(e))}}}]}]),e.module("ngCookies").factory("$cookieStore",["$cookies",function(t){return{get:function(e){return t.getObject(e)},put:function(e,n){t.putObject(e,n)},remove:function(e){t.remove(e)}}}]),n.$inject=["$document","$log","$browser"],e.module("ngCookies").provider("$$cookieWriter",function(){this.$get=n})}(window,window.angular),angular.module("angular-jwt",["angular-jwt.options","angular-jwt.interceptor","angular-jwt.jwt","angular-jwt.authManager"]),angular.module("angular-jwt.authManager",[]).provider("authManager",function(){this.$get=["$rootScope","$injector","$location","jwtHelper","jwtInterceptor","jwtOptions",function(t,e,n,r,i,o){var a=o.getConfig();function s(t){return Array.isArray(t)?e.invoke(t,this,{options:null}):t()}function u(t){if(Array.isArray(t)||angular.isFunction(t))return e.invoke(t,a,{});throw new Error("unauthenticatedRedirector must be a function")}function l(){t.isAuthenticated=!0}function c(){t.isAuthenticated=!1}t.isAuthenticated=!1;var p=e.has("$state")?"$stateChangeStart":"$routeChangeStart";return t.$on(p,function(t,e){if(!e)return!1;var n=e.$$route?e.$$route:e.data;if(n&&!0===n.requiresLogin){var i=s(a.tokenGetter);i&&!r.isTokenExpired(i)||(t.preventDefault(),u(a.unauthenticatedRedirector))}}),{authenticate:l,unauthenticate:c,getToken:function(){return s(a.tokenGetter)},redirect:function(){return u(a.unauthenticatedRedirector)},checkAuthOnRefresh:function(){t.$on("$locationChangeStart",function(){var e=s(a.tokenGetter);e&&(r.isTokenExpired(e)?t.$broadcast("tokenHasExpired",e):l())})},redirectWhenUnauthenticated:function(){t.$on("unauthenticated",function(){u(a.unauthenticatedRedirector),c()})},isAuthenticated:function(){var t=s(a.tokenGetter);if(t)return!r.isTokenExpired(t)}}}]}),angular.module("angular-jwt.interceptor",[]).provider("jwtInterceptor",function(){this.urlParam,this.authHeader,this.authPrefix,this.whiteListedDomains,this.tokenGetter;var t=this;this.$get=["$q","$injector","$rootScope","urlUtils","jwtOptions",function(e,n,r,i,o){var a=angular.extend({},o.getConfig(),t);return{request:function(t){if(t.skipAuthorization||!function(t){if(!i.isSameOrigin(t)&&!a.whiteListedDomains.length)throw new Error("As of v0.1.0, requests to domains other than the application's origin must be white listed. Use jwtOptionsProvider.config({ whiteListedDomains: [<domain>] }); to whitelist.");for(var e=i.urlResolve(t).hostname.toLowerCase(),n=0;n<a.whiteListedDomains.length;n++){var r=a.whiteListedDomains[n],o=r instanceof RegExp?r:new RegExp(r,"i");if(e.match(o))return!0}return!!i.isSameOrigin(t)}(t.url))return t;if(a.urlParam){if(t.params=t.params||{},t.params[a.urlParam])return t}else if(t.headers=t.headers||{},t.headers[a.authHeader])return t;return e.when(n.invoke(a.tokenGetter,this,{options:t})).then(function(e){return e&&(a.urlParam?t.params[a.urlParam]=e:t.headers[a.authHeader]=a.authPrefix+e),t})},responseError:function(t){return 401===t.status&&r.$broadcast("unauthenticated",t),e.reject(t)}}}]}),angular.module("angular-jwt.jwt",[]).service("jwtHelper",["$window",function(t){this.urlBase64Decode=function(e){var n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw"Illegal base64url string!"}return t.decodeURIComponent(escape(t.atob(n)))},this.decodeToken=function(t){var e=t.split(".");if(3!==e.length)throw new Error("JWT must have 3 parts");var n=this.urlBase64Decode(e[1]);if(!n)throw new Error("Cannot decode the token");return angular.fromJson(n)},this.getTokenExpirationDate=function(t){var e=this.decodeToken(t);if(void 0===e.exp)return null;var n=new Date(0);return n.setUTCSeconds(e.exp),n},this.isTokenExpired=function(t,e){var n=this.getTokenExpirationDate(t);return e=e||0,null!==n&&!(n.valueOf()>(new Date).valueOf()+1e3*e)}}]),angular.module("angular-jwt.options",[]).provider("jwtOptions",function(){var t={};this.config=function(e){t=e},this.$get=function(){var e={urlParam:null,authHeader:"Authorization",authPrefix:"Bearer ",whiteListedDomains:[],tokenGetter:function(){return null},loginPath:"/",unauthenticatedRedirectPath:"/",unauthenticatedRedirector:["$location",function(t){t.path(this.unauthenticatedRedirectPath)}]};function n(){this.config=angular.extend({},e,t)}return n.prototype.getConfig=function(){return this.config},new n}}),angular.module("angular-jwt.interceptor").service("urlUtils",function(){var t=document.createElement("a"),e=n(window.location.href);function n(e){var n=e;return t.setAttribute("href",n),n=t.href,t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return{urlResolve:n,isSameOrigin:function(t){var r=angular.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}}),function(t,e){"use strict";var n,r,i,o;function a(){return["$animate",function(t){return{restrict:"AE",transclude:"element",priority:1,terminal:!0,require:"^^ngMessages",link:function(e,n,i,o,a){var s,u,l,c=n[0],p=i.ngMessage||i.when,d=i.ngMessageExp||i.whenExp,f=function(t){s=t?r(t)?t:t.split(/[\s,]+/):null,o.reRender()};d?(f(e.$eval(d)),e.$watchCollection(d,f)):f(p),o.register(c,l={test:function(t){return function(t,e){if(t)return r(t)?t.indexOf(e)>=0:t.hasOwnProperty(e)}(s,t)},attach:function(){u||a(function(e,r){t.enter(e,null,n);var i=(u=e).$$attachId=o.getAttachId();u.on("$destroy",function(){u&&u.$$attachId===i&&(o.deregister(c),l.detach()),r.$destroy()})})},detach:function(){if(u){var e=u;u=null,t.leave(e)}}})}}}]}e.module("ngMessages",[],function(){n=e.forEach,r=e.isArray,i=e.isString,o=e.element}).info({angularVersion:"1.6.7"}).directive("ngMessages",["$animate",function(t){var e="ng-active",r="ng-inactive";return{require:"ngMessages",restrict:"AE",controller:["$element","$scope","$attrs",function(i,s,u){var l=this,c=0,p=0;this.getAttachId=function(){return p++};var d,f,h=this.messages={};function g(t,e){for(var n=e,r=[];n&&n!==t;){var i=n.$$ngMessageNode;if(i&&i.length)return h[i];n.childNodes.length&&-1===r.indexOf(n)?(r.push(n),n=n.childNodes[n.childNodes.length-1]):n.previousSibling?n=n.previousSibling:(n=n.parentNode,r.push(n))}}this.render=function(c){d=!1,f=c=c||{};for(var p=o(s,u.ngMessagesMultiple)||o(s,u.multiple),h=[],g={},m=l.head,v=!1,y=0;null!=m;){y++;var b=m.message,w=!1;v||n(c,function(t,e){if(!w&&a(t)&&b.test(e)){if(g[e])return;g[e]=!0,w=!0,b.attach()}}),w?v=!p:h.push(b),m=m.next}n(h,function(t){t.detach()}),h.length!==y?t.setClass(i,e,r):t.setClass(i,r,e)},s.$watchCollection(u.ngMessages||u.for,l.render),i.on("$destroy",function(){n(h,function(t){t.message.detach()})}),this.reRender=function(){d||(d=!0,s.$evalAsync(function(){d&&f&&l.render(f)}))},this.register=function(t,e){var n=c.toString();h[n]={message:e},function(t,e,n){var r=h[n];if(l.head){var i=g(t,e);i?(r.next=i.next,i.next=r):(r.next=l.head,l.head=r)}else l.head=r}(i[0],t,n),t.$$ngMessageNode=n,c++,l.reRender()},this.deregister=function(t){var e,n,r,o,a=t.$$ngMessageNode;delete t.$$ngMessageNode,e=i[0],n=t,r=h[a],(o=g(e,n))?o.next=r.next:l.head=r.next,delete h[a],l.reRender()}}]};function o(t,e){return i(e)&&0===e.length||a(t.$eval(e))}function a(t){return i(t)?t.length:!!t}}]).directive("ngMessagesInclude",["$templateRequest","$document","$compile",function(t,e,n){return{restrict:"AE",require:"^^ngMessages",link:function(e,o,a){var s=a.ngMessagesInclude||a.src;t(s).then(function(t){e.$$destroyed||(i(t)&&!t.trim()?r(o,s):n(t)(e,function(t){o.after(t),r(o,s)}))})}};function r(t,r){var i=n.$$createComment?n.$$createComment("ngMessagesInclude",r):e[0].createComment(" ngMessagesInclude: "+r+" "),a=o(i);t.after(a),t.remove()}}]).directive("ngMessage",a()).directive("ngMessageExp",a())}(window,window.angular);var app=angular.module("angular-promise-polyfill",[]).run(["$q","$window",function(t,e){e.Promise=function(e){return t(e)},e.Promise.all=t.all.bind(t),e.Promise.reject=t.reject.bind(t),e.Promise.resolve=t.when.bind(t),e.Promise.race=function(e){for(var n=t.defer(),r=0;r<e.length;r++)e[r].then(function(t){n&&(n.resolve(t),n=null)}),e[r].catch(function(t){n&&(n.reject(t),n=null)});return n.promise}}]);if("object"==typeof module&&(module.exports=app.name),function(t,e){"use strict";var n=e.$$minErr("$resource"),r=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;function i(t,i){if(null==(o=i)||""===o||"hasOwnProperty"===o||!r.test("."+o))throw n("badmember",'Dotted member path "@{0}" is invalid.',i);for(var o,a=i.split("."),s=0,u=a.length;s<u&&e.isDefined(t);s++){var l=a[s];t=null!==t?t[l]:void 0}return t}function o(t,n){for(var r in n=n||{},e.forEach(n,function(t,e){delete n[e]}),t)!t.hasOwnProperty(r)||"$"===r.charAt(0)&&"$"===r.charAt(1)||(n[r]=t[r]);return n}e.module("ngResource",["ng"]).info({angularVersion:"1.6.7"}).provider("$resource",function(){var t=/^https?:\/\/\[[^\]]*][^/]*/,r=this;this.defaults={stripTrailingSlashes:!0,cancellable:!1,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},delete:{method:"DELETE"}}},this.$get=["$http","$log","$q","$timeout",function(a,s,u,l){var c=e.noop,p=e.forEach,d=e.extend,f=e.copy,h=e.isArray,g=e.isDefined,m=e.isFunction,v=e.isNumber,y=e.$$encodeUriQuery,b=e.$$encodeUriSegment;function w(t,e){this.template=t,this.defaults=d({},r.defaults,e),this.urlParams={}}return w.prototype={setUrlParams:function(e,r,i){var o,a,s=this,u=i||s.template,l="",c=s.urlParams=Object.create(null);p(u.split(/\W/),function(t){if("hasOwnProperty"===t)throw n("badname","hasOwnProperty is not a valid parameter name.");!new RegExp("^\\d+$").test(t)&&t&&new RegExp("(^|[^\\\\]):"+t+"(\\W|$)").test(u)&&(c[t]={isQueryParamValue:new RegExp("\\?.*=:"+t+"(?:\\W|$)").test(u)})}),u=(u=u.replace(/\\:/g,":")).replace(t,function(t){return l=t,""}),r=r||{},p(s.urlParams,function(t,e){o=r.hasOwnProperty(e)?r[e]:s.defaults[e],g(o)&&null!==o?(a=t.isQueryParamValue?y(o,!0):b(o),u=u.replace(new RegExp(":"+e+"(\\W|$)","g"),function(t,e){return a+e})):u=u.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(t,e,n){return"/"===n.charAt(0)?n:e+n})}),s.defaults.stripTrailingSlashes&&(u=u.replace(/\/+$/,"")||"/"),u=u.replace(/\/\.(?=\w+($|\?))/,"."),e.url=l+u.replace(/\/(\\|%5C)\./,"/."),p(r,function(t,n){s.urlParams[n]||(e.params=e.params||{},e.params[n]=t)})}},function(t,e,y,b){var $=new w(t,b);function k(t){return t.resource}function C(t){o(t||{},this)}return y=d({},r.defaults.actions,y),C.prototype.toJSON=function(){var t=d({},this);return delete t.$promise,delete t.$resolved,delete t.$cancelRequest,t},p(y,function(t,r){var y=!0===t.hasBody||!1!==t.hasBody&&/^(POST|PUT|PATCH)$/i.test(t.method),b=t.timeout,w=g(t.cancellable)?t.cancellable:$.defaults.cancellable;b&&!v(b)&&(s.debug("ngResource:\n Only numeric values are allowed as `timeout`.\n Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),delete t.timeout,b=null),C[r]=function(s,g,v,x){var T,S,E,D={};switch(arguments.length){case 4:E=x,S=v;case 3:case 2:if(!m(g)){D=s,T=g,S=v;break}if(m(s)){S=s,E=g;break}S=g,E=v;case 1:m(s)?S=s:y?T=s:D=s;break;case 0:break;default:throw n("badargs","Expected up to 4 arguments [params, data, success, error], got {0} arguments",arguments.length)}var A,B,I,O,M,P=this instanceof C,_=P?T:t.isArray?[]:new C(T),R={},L=t.interceptor&&t.interceptor.response||k,N=t.interceptor&&t.interceptor.responseError||void 0,U=!!E,j=!!N;p(t,function(t,e){switch(e){default:R[e]=f(t);break;case"params":case"isArray":case"interceptor":case"cancellable":}}),!P&&w&&(A=u.defer(),R.timeout=A.promise,b&&(B=l(A.resolve,b))),y&&(R.data=T),$.setUrlParams(R,d({},(I=T,O=t.params||{},M={},O=d({},e,O),p(O,function(t,e){m(t)&&(t=t(I)),M[e]=t&&t.charAt&&"@"===t.charAt(0)?i(I,t.substr(1)):t}),M),D),t.url);var q=a(R).then(function(e){var i=e.data;if(i){if(h(i)!==!!t.isArray)throw n("badcfg","Error in resource configuration for action `{0}`. Expected response to contain an {1} but got an {2} (Request: {3} {4})",r,t.isArray?"array":"object",h(i)?"array":"object",R.method,R.url);if(t.isArray)_.length=0,p(i,function(t){"object"==typeof t?_.push(new C(t)):_.push(t)});else{var a=_.$promise;o(i,_),_.$promise=a}}return e.resource=_,e},function(t){return t.resource=_,u.reject(t)});return q=(q=q.finally(function(){_.$resolved=!0,!P&&w&&(_.$cancelRequest=c,l.cancel(B),A=B=R.timeout=null)})).then(function(t){var e=L(t);return(S||c)(e,t.headers,t.status,t.statusText),e},U||j?function(t){return U&&!j&&q.catch(c),U&&E(t),j?N(t):u.reject(t)}:void 0),P?q:(_.$promise=q,_.$resolved=!1,w&&(_.$cancelRequest=function(t){q.catch(c),null!==A&&A.resolve(t)}),_)},C.prototype["$"+r]=function(t,e,n){m(t)&&(n=e,e=t,t={});var i=C[r].call(this,t,this,e,n);return i.$promise||i}}),C}}]})}(window,window.angular),function(t,e){"use strict";var n,r,i,o,a,s,u,l,c,p=e.$$minErr("$sanitize");e.module("ngSanitize",[]).provider("$sanitize",function(){var d=!1;this.$get=["$$sanitizeUri",function(t){return d&&r(C,$),function(e){var n=[];return l(e,c(n,function(e,n){return!/^unsafe:/.test(t(e,n))})),n.join("")}}],this.enableSvg=function(t){return o(t)?(d=t,this):d},n=e.bind,r=e.extend,i=e.forEach,o=e.isDefined,a=e.lowercase,s=e.noop,l=function(t,e){null==t?t="":"string"!=typeof t&&(t=""+t);var n=A(t);if(!n)return"";var r=5;do{if(0===r)throw p("uinput","Failed to sanitize html because the input is unstable");r--,t=n.innerHTML,n=A(t)}while(t!==n.innerHTML);for(var i=n.firstChild;i;){switch(i.nodeType){case 1:e.start(i.nodeName.toLowerCase(),B(i.attributes));break;case 3:e.chars(i.textContent)}var o;if(!((o=i.firstChild)||(1===i.nodeType&&e.end(i.nodeName.toLowerCase()),o=O("nextSibling",i))))for(;null==o&&(i=O("parentNode",i))!==n;)o=O("nextSibling",i),1===i.nodeType&&e.end(i.nodeName.toLowerCase());i=o}for(;i=n.firstChild;)n.removeChild(i)},c=function(t,e){var r=!1,o=n(t,t.push);return{start:function(t,n){t=a(t),!r&&k[t]&&(r=t),r||!0!==C[t]||(o("<"),o(t),i(n,function(n,r){var i=a(r),s="img"===t&&"src"===i||"background"===i;!0!==E[i]||!0===x[i]&&!e(n,s)||(o(" "),o(r),o('="'),o(I(n)),o('"'))}),o(">"))},end:function(t){t=a(t),r||!0!==C[t]||!0===g[t]||(o("</"),o(t),o(">")),t==r&&(r=!1)},chars:function(t){r||o(I(t))}}},u=t.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))};var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,h=/([^#-~ |!])/g,g=D("area,br,col,hr,img,wbr"),m=D("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),v=D("rp,rt"),y=r({},v,m),b=r({},m,D("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),w=r({},v,D("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),$=D("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),k=D("script,style"),C=r({},g,b,w,y),x=D("background,cite,href,longdesc,src,xlink:href"),T=D("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),S=D("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),E=r({},x,S,T);function D(t,e){var n,r={},i=t.split(",");for(n=0;n<i.length;n++)r[e?a(i[n]):i[n]]=!0;return r}var A=function(e,n){var r;if(!n||!n.implementation)throw p("noinert","Can't create an inert html document");var i=((r=n.implementation.createHTMLDocument("inert")).documentElement||r.getDocumentElement()).querySelector("body");return i.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',i.querySelector("svg")?(i.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',i.querySelector("svg img")?function(t){t="<remove></remove>"+t;try{var n=(new e.DOMParser).parseFromString(t,"text/html").body;return n.firstChild.remove(),n}catch(t){return}}:function(e){return i.innerHTML=e,n.documentMode&&function e(n){for(;n;){if(n.nodeType===t.Node.ELEMENT_NODE)for(var r=n.attributes,i=0,o=r.length;i<o;i++){var a=r[i],s=a.name.toLowerCase();"xmlns:ns1"!==s&&0!==s.lastIndexOf("ns1:",0)||(n.removeAttributeNode(a),i--,o--)}var u=n.firstChild;u&&e(u),n=O("nextSibling",n)}}(i),i}):function(t){t="<remove></remove>"+t;try{t=encodeURI(t)}catch(t){return}var n=new e.XMLHttpRequest;n.responseType="document",n.open("GET","data:text/html;charset=utf-8,"+t,!1),n.send(null);var r=n.response.body;return r.firstChild.remove(),r}}(t,t.document);function B(t){for(var e={},n=0,r=t.length;n<r;n++){var i=t[n];e[i.name]=i.value}return e}function I(t){return t.replace(/&/g,"&amp;").replace(f,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(h,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function O(t,e){var n=e[t];if(n&&u.call(e,n))throw p("elclob","Failed to sanitize html because the element is clobbered: {0}",e.outerHTML||e.outerText);return n}}).info({angularVersion:"1.6.7"}),e.module("ngSanitize").filter("linky",["$sanitize",function(t){var n=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,r=/^mailto:/i,i=e.$$minErr("linky"),o=e.isDefined,a=e.isFunction,u=e.isObject,l=e.isString;return function(e,p,d){if(null==e||""===e)return e;if(!l(e))throw i("notstring","Expected string but received: {0}",e);for(var f,h,g,m=a(d)?d:u(d)?function(){return d}:function(){return{}},v=e,y=[];f=v.match(n);)h=f[0],f[2]||f[4]||(h=(f[3]?"http://":"mailto:")+h),g=f.index,b(v.substr(0,g)),w(h,f[0].replace(r,"")),v=v.substring(g+f[0].length);return b(v),t(y.join(""));function b(t){var e,n;t&&y.push((e=t,c(n=[],s).chars(e),n.join("")))}function w(t,e){var n,r=m(t);for(n in y.push("<a "),r)y.push(n+'="'+r[n]+'" ');!o(p)||"target"in r||y.push('target="',p,'" '),y.push('href="',t.replace(/"/g,"&quot;"),'">'),b(e),y.push("</a>")}}}])}(window,window.angular),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).angularStripe=t()}}(function(){return function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}}()({1:[function(t,e,n){(function(t){"use strict";var n="undefined"!=typeof window?window.angular:void 0!==t?t.angular:null;function r(t){return function(e){if("function"!=typeof t)throw new Error(e||"$q is not a function")}}e.exports=n.module("assert-q-constructor",[]).factory("assertQConstructor",r).name,r.$inject=["$q"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){(function(n){"use strict";var r=t("./promisify");e.exports=("undefined"!=typeof window?window.angular:void 0!==n?n.angular:null).module("promisify",[]).service("promisify",r).name}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./promisify":3}],3:[function(t,e,n){(function(n){"use strict";var r="undefined"!=typeof window?window.angular:void 0!==n?n.angular:null,i=t("assert-function"),o=t("to-array");function a(t,e){function n(n,r){function a(){var i=arguments;return t(function(t,a){var s,u,l,c=e.$apply.bind(e);try{n.apply(r,o(i).concat((s=c,u=t,l=a,function(t,e){var n=arguments;s(function(){return t?l(t):n.length<=2?u(e):void u(o(n,1))})})))}catch(t){setTimeout(function(){c(function(){a(t)})})}})}return r=r||{},"string"==typeof n&&(n=r[n]),i(n),a.__isPromisifed__=!0,a}return r.extend(n,{promisifyAll:function(t){return r.forEach(t,function(e,r){r+="Async",e&&"function"==typeof e&&!e.__isPromisifed__&&(t[r]=n(e,t))})}})}e.exports=a,a.$inject=["$q","$rootScope"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"assert-function":13,"to-array":36}],4:[function(t,e,n){(function(n){"use strict";var r="undefined"!=typeof window?window.angular:void 0!==n?n.angular:null,i=t("./provider");function o(t){t("angular-stripe: For Angular <= 1.2 support, first load https://github.com/bendrucker/angular-q-constructor")}e.exports=r.module("angular-stripe",[t("angular-q-promisify"),t("angular-assert-q-constructor")]).provider("stripe",i).run(o).name,o.$inject=["assertQConstructor"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./provider":6,"angular-assert-q-constructor":1,"angular-q-promisify":2}],5:[function(t,e,n){"use strict";var r=t("lazy-async"),i=t("dot-prop"),o=t("load-script-global"),a=t("stripe-errback");e.exports=function(t,e){var n=a.methods.async.concat(a.methods.sync),s=r(n,function(e){o({url:t,global:"Stripe"},function(t,n){if(t)return e(t);var r=a(n);r.setPublishableKey=(i=r.setPublishableKey,o=r,function(){var t=Array.prototype.pop.call(arguments);i.apply(o,arguments),t()}),e(null,r);var i,o})});return n.reduce(function(t,n){var r=i.get(s,n);return i.set(t,n,e(r)),t},{})}},{"dot-prop":20,"lazy-async":26,"load-script-global":28,"stripe-errback":35}],6:[function(t,e,n){"use strict";var r=t("./lazy");e.exports=function(){var t=null,e=null;this.url="https://js.stripe.com/v2/",this.setPublishableKey=function(e){t=e},this.$get=function(n,i){return e||((e=r(this.url,n)).setPublishableKey(t),e)},this.$get.$inject=["promisify","$exceptionHandler"]}},{"./lazy":5}],7:[function(t,e,n){var r=t("is-number"),i=t("array-slice");e.exports=function(t,e){if(!Array.isArray(t))throw new Error("array-last expects an array as the first argument.");if(0===t.length)return null;var n=i(t,t.length-(r(e)?+e:1));return 1==+e||null==e?n[0]:n}},{"array-slice":9,"is-number":8}],8:[function(t,e,n){"use strict";e.exports=function(t){return!!+t||0===t||"0"===t}},{}],9:[function(t,e,n){"use strict";function r(t,e,n){var r=t.length>>>0;return e=null==e?n||0:e<0?Math.max(r+e,0):Math.min(e,r)}e.exports=function(t,e,n){var i=t.length>>>0,o=[];for(e=r(t,e),n=r(t,n,i);e<n;)o.push(t[e++]);return o}},{}],10:[function(t,e,n){"use strict";var r=t("./raw"),i=[],o=[],a=r.makeRequestCallFromTimer(function(){if(o.length)throw o.shift()});function s(t){var e;(e=i.length?i.pop():new u).task=t,r(e)}function u(){this.task=null}e.exports=s,u.prototype.call=function(){try{this.task.call()}catch(t){s.onerror?s.onerror(t):(o.push(t),a())}finally{this.task=null,i[i.length]=this}}},{"./raw":11}],11:[function(t,e,n){(function(t){"use strict";function n(t){i.length||(r(),!0),i[i.length]=t}e.exports=n;var r,i=[],o=0,a=1024;function s(){for(;o<i.length;){var t=o;if(o+=1,i[t].call(),o>a){for(var e=0,n=i.length-o;e<n;e++)i[e]=i[e+o];i.length-=o,o=0}}i.length=0,o=0,!1}var u,l,c,p=void 0!==t?t:self,d=p.MutationObserver||p.WebKitMutationObserver;function f(t){return function(){var e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}"function"==typeof d?(u=1,l=new d(s),c=document.createTextNode(""),l.observe(c,{characterData:!0}),r=function(){u=-u,c.data=u}):r=f(s),n.requestFlush=r,n.makeRequestCallFromTimer=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(t,e,n){"use strict";var r=t("assert-ok"),i=t("simple-format"),o=t("print-value");e.exports=function(t,e){r(t===e,i("expected `%s` to equal `%s`",o(t),o(e)))}},{"assert-ok":14,"print-value":31,"simple-format":34}],13:[function(t,e,n){"use strict";e.exports=function(t){if("function"!=typeof t)throw new TypeError("Expected function, got: "+t)}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){if(!t)throw new Error(e||"Expected true, got "+t)}},{}],15:[function(t,e,n){"use strict";e.exports=function(t){return t=Array.isArray(t)?t:arguments,function(){for(var e=arguments,n=new Array(t.length),r=0,i=t.length;r<i;r++)n[r]=t[r].apply(null,e);return n}}},{}],16:[function(t,e,n){var r=t("./lib/fingerprint.js"),i=t("./lib/pad.js"),o=0,a=4,s=36,u=Math.pow(s,a);function l(){return i((Math.random()*u<<0).toString(s),a)}function c(){return o=o<u?o:0,++o-1}function p(){return"c"+(new Date).getTime().toString(s)+i(c().toString(s),a)+r()+(l()+l())}p.slug=function(){var t=(new Date).getTime().toString(36),e=c().toString(36).slice(-4),n=r().slice(0,1)+r().slice(-1),i=l().slice(-2);return t.slice(-2)+e+n+i},p.fingerprint=r,e.exports=p},{"./lib/fingerprint.js":17,"./lib/pad.js":18}],17:[function(t,e,n){var r=t("./pad.js"),i="object"==typeof window?window:self,o=Object.keys(i),a=r(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+o.toString(36),4);e.exports=function(){return a}},{"./pad.js":18}],18:[function(t,e,n){e.exports=function(t,e){var n="000000000"+t;return n.substr(n.length-e)}},{}],19:[function(t,e,n){var r=t("wrappy");e.exports=r(function(t){var e=!0;return i(function(){e=!1}),function(){var n=arguments,r=this;e?i(function(){t.apply(r,n)}):t.apply(r,n)}});var i=t("asap")},{asap:10,wrappy:37}],20:[function(t,e,n){"use strict";var r=t("is-obj");function i(t){for(var e=t.split("."),n=[],r=0;r<e.length;r++){for(var i=e[r];"\\"===i[i.length-1]&&void 0!==e[r+1];)i=i.slice(0,-1)+".",i+=e[++r];n.push(i)}return n}e.exports.get=function(t,e){if(!r(t)||"string"!=typeof e)return t;for(var n=i(e),o=0;o<n.length;o++){var a=Object.getOwnPropertyDescriptor(t,n[o])||Object.getOwnPropertyDescriptor(Object.prototype,n[o]);if(a&&!a.enumerable)return;if(null==(t=t[n[o]])){if(o!==n.length-1)return;break}}return t},e.exports.set=function(t,e,n){if(r(t)&&"string"==typeof e)for(var o=i(e),a=0;a<o.length;a++){var s=o[a];r(t[s])||(t[s]={}),a===o.length-1&&(t[s]=n),t=t[s]}},e.exports.delete=function(t,e){if(r(t)&&"string"==typeof e)for(var n=i(e),o=0;o<n.length;o++){var a=n[o];if(o===n.length-1)return void delete t[a];t=t[a]}},e.exports.has=function(t,e){if(!r(t)||"string"!=typeof e)return!1;for(var n=i(e),o=0;o<n.length;o++)if(void 0===(t=t[n[o]]))return!1;return!0}},{"is-obj":23}],21:[function(t,e,n){"use strict";var r=t("assert-function");e.exports=function(){var t=[];function e(){for(var e=arguments,n=0,r=t.length;n<r;n++){var i=t[n];i.apply(null,e)}}return e.add=function(e){return r(e),t.push(e),function(){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return void t.splice(n,1)}},e}},{"assert-function":13}],22:[function(t,e,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(t,e,n){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],24:[function(t,e,n){e.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},{}],25:[function(t,e,n){function r(t,e){var n=[],r=[];return null==e&&(e=function(t,e){return n[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(e)).join(".")+"]"}),function(i,o){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?r.splice(a,1/0,i):r.push(i),~n.indexOf(o)&&(o=e.call(this,i,o))}else n.push(o);return null==t?o:t.call(this,i,o)}}(e.exports=function(t,e,n,i){return JSON.stringify(t,r(e,i),n)}).getSerialize=r},{}],26:[function(t,e,n){"use strict";var r=t("assert-ok"),i=t("assert-equal"),o=t("dot-prop"),a=t("to-array"),s=t("array-last"),u=t("dezalgo"),l=t("call-all-fns");e.exports=function(t,e){r(Array.isArray(t),"methods are required"),i(typeof e,"function","load fn is required");var n=null,c=null,p=[];return e(function(t,e){c=t,n=e,l(p)(t,e),p=null}),t.reduce(function(t,e){var r;return o.set(t,e,(r=e,function(){var t=arguments;!function(t){if(t=u(t),n||c)return t(c,n);p.push(t)}(function(e,n){if(!e)return o.get(n,r).apply(null,t);var i=s(a(t));return"function"==typeof i?i(e):void 0})})),t},{})}},{"array-last":7,"assert-equal":12,"assert-ok":14,"call-all-fns":15,dezalgo:19,"dot-prop":27,"to-array":36}],27:[function(t,e,n){"use strict";var r=t("is-obj");function i(t){for(var e=t.split("."),n=[],r=0;r<e.length;r++){for(var i=e[r];"\\"===i[i.length-1];)i=i.slice(0,-1)+".",i+=e[++r];n.push(i)}return n}e.exports.get=function(t,e){if(!r(t)||"string"!=typeof e)return t;for(var n=i(e),o=0;o<n.length&&void 0!==(t=t[n[o]]);o++);return t},e.exports.set=function(t,e,n){if(r(t)&&"string"==typeof e)for(var o=i(e),a=0;a<o.length;a++){var s=o[a];r(t[s])||(t[s]={}),a===o.length-1&&(t[s]=n),t=t[s]}},e.exports.delete=function(t,e){if(r(t)&&"string"==typeof e)for(var n=i(e),o=0;o<n.length;o++){var a=n[o];if(o===n.length-1)return void delete t[a];t=t[a]}},e.exports.has=function(t,e){if(!r(t)||"string"!=typeof e)return!1;for(var n=i(e),o=0;o<n.length;o++)if(void 0===(t=t[n[o]]))return!1;return!0}},{"is-obj":23}],28:[function(t,e,n){"use strict";var r=t("load-script"),i=t("global/window"),o=t("xtend"),a=t("assert-ok"),s=t("dezalgo"),u=t("ear"),l=t("query-extend"),c=t("cuid");e.exports=function(t,e){if(a(t,"options required"),a(t.url,"url required"),a(t.global,"global required"),a(e,"callback required"),t=o(t),e=s(e),d(t))return e(null,d(t));if(!(e=function(t,e){return n()?void n().add(e):(r(u()),n().add(e),function(t,e){n()(t,e),r(u())});function n(){return p[t.global]}function r(e){p[t.global]=e}}(t,e)))return;if(t.jsonp){var n=(f=t,h=e,g=c(),i[g]=function(){h(null,d(f)),delete i[g]},g);t.url=l(t.url,{callback:n})}var f,h,g;r(t.url,t,function(n){if(n)return e(n);if(!t.jsonp){var r=d(t);if(!r)return e(new Error("expected: `window."+t.global+"`, actual: `"+r+"`"));e(null,r)}})};var p={};function d(t){return i[t.global]}},{"assert-ok":14,cuid:16,dezalgo:19,ear:21,"global/window":22,"load-script":29,"query-extend":33,xtend:38}],29:[function(t,e,n){function r(t,e){t.onload=function(){this.onerror=this.onload=null,e(null,t)},t.onerror=function(){this.onerror=this.onload=null,e(new Error("Failed to load "+this.src),t)}}function i(t,e){t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,e(null,t))}}e.exports=function(t,e,n){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},a.type=e.type||"text/javascript",a.charset=e.charset||"utf8",a.async=!("async"in e)||!!e.async,a.src=t,e.attrs&&function(t,e){for(var n in e)t.setAttribute(n,e[n])}(a,e.attrs),e.text&&(a.text=""+e.text),("onload"in a?r:i)(a,n),a.onload||r(a,n),o.appendChild(a)}},{}],30:[function(t,e,n){"use strict";e.exports=function(t){var e=1,n="",r=t.split("%"),i=r.length;i>0&&(n+=r[0]);for(var o=1;o<i;o++){if("s"===r[o][0]||"d"===r[o][0]){var a=arguments[e++];n+="d"===r[o][0]?Math.floor(a):a}else r[o][0]?n+="%"+r[o][0]:n+="%"+r[++o][0];n+=r[o].substring(1)}return n}},{}],31:[function(t,e,n){"use strict";var r=t("isobject"),i=t("json-stringify-safe");function o(t){return i(t,null,"")}e.exports=function(t){var e;return(r(e=t)||Array.isArray(e)?o:String)(t)}},{isobject:32,"json-stringify-safe":25}],32:[function(t,e,n){"use strict";var r=t("isarray");e.exports=function(t){return null!=t&&"object"==typeof t&&!r(t)}},{isarray:24}],33:[function(t,e,n){var r,i,o,a,s,u,l;r=this,i=function(t){var e=t.indexOf("[");return-1===e?{type:"string",val:t}:{type:"array",val:t.substr(0,e)}},o=function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t},s=function(){var t=Array.prototype.slice.call(arguments,0),e=!0===t[t.length-1],n="";if(!t.length)return n;e&&t.pop();var r=l(t,function(t){if("string"==typeof t){var e=(s=(a=t).lastIndexOf("?"),c=void 0,(l=-1!==s)&&s>0?c=a.substring(0,s):!l&&a&&a.length>0&&(c=a),{base:c,query:l?a.substring(s+1):void 0});return e.base&&(n=e.base),o={},(r=e.query)?(u(r.split("&"),function(t){var e=t.split("="),n=i(e[0]),r=decodeURIComponent(n.val),a=e[1]&&decodeURIComponent(e[1]);"array"===n.type?(o[r]||(o[r]=[]),o[r].push(a)):"string"===n.type&&(o[r]=a)}),o):o}var r,o,a,s,l,c;return t});return e?a.apply({},r):n+function(t){var e,n=[];for(var r in t)t.hasOwnProperty(r)&&(void 0!==t[r]?(e=encodeURIComponent(r),o(t[r])?u(t[r],function(t){n.push(e+"[]="+encodeURIComponent(t))}):n.push(e+"="+encodeURIComponent(t[r]))):n.push(encodeURIComponent(r)));return n.length?"?"+n.join("&"):""}(a.apply({},r))},u=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},l=function(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(e(t[r],r));return n},void 0!==e&&e.exports?e.exports=s:r.queryExtend=s},{}],34:[function(t,e,n){"use strict";var r=t("pff"),i=t("to-array"),o=/%[sdj]/;e.exports=function(t){return o.test(t)?r.apply(null,arguments):i(arguments).join(" ")}},{pff:30,"to-array":36}],35:[function(t,e,n){"use strict";var r=t("xtend/mutable"),i=t("dot-prop"),o=a.methods={async:["card.createToken","bankAccount.createToken","piiData.createToken","bitcoinReceiver.createReceiver","bitcoinReceiver.pollReceiver","bitcoinReceiver.getReceiver"],sync:["setPublishableKey","card.validateCardNumber","card.validateExpiry","card.validateCVC","card.cardType","bankAccount.validateRoutingNumber","bankAccount.validateAccountNumber","bitcoinReceiver.cancelReceiverPoll"]};function a(t){if("function"!=typeof t)throw new Error("Stripe.js must be provided");var e={};return o.async.forEach(function(n){var o,a,s=n.split("."),u=s[0],l=s[1];i.set(e,n,(o=l,a=t[u],function(){var t=Array.prototype.slice.call(arguments),e=t.pop();a[o].apply(a,t.concat(function(t,n){if(n.error)return e(r(new Error,n.error,{status:t}));e(null,n)}))}))}),o.sync.forEach(function(n){i.set(e,n,i.get(t,n))}),e}e.exports=a},{"dot-prop":20,"xtend/mutable":39}],36:[function(t,e,n){e.exports=function(t,e){for(var n=[],r=(e=e||0)||0;r<t.length;r++)n[r-e]=t[r];return n}},{}],37:[function(t,e,n){e.exports=function t(e,n){if(e&&n)return t(e)(n);if("function"!=typeof e)throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){r[t]=e[t]});return r;function r(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return"function"==typeof r&&r!==i&&Object.keys(i).forEach(function(t){r[t]=i[t]}),r}}},{}],38:[function(t,e,n){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],39:[function(t,e,n){e.exports=function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}]},{},[4])(4)}),function(){"use strict";function t(t,e,n,r,i,o,a){var s,u=0,l=[],c="",p={},d=a.defer();return{active:function(){return l.length},clear:function(t){if(1===arguments.length&&!t)return;if(t)f(t.toastId);else for(var e=0;e<l.length;e++)f(l[e].toastId)},error:function(t,e,n){return h(g().iconClasses.error,t,e,n)},info:function(t,e,n){return h(g().iconClasses.info,t,e,n)},remove:f,success:function(t,e,n){return h(g().iconClasses.success,t,e,n)},warning:function(t,e,n){return h(g().iconClasses.warning,t,e,n)},refreshTimer:function(t,e){t&&t.isOpened&&l.indexOf(t)>=0&&t.scope.refreshTimer(e)}};function f(e,n){var r=function(t){for(var e=0;e<l.length;e++)if(l[e].toastId===t)return l[e]}(e);r&&!r.deleting&&(r.deleting=!0,r.isOpened=!1,t.leave(r.el).then(function(){r.scope.options.onHidden&&r.scope.options.onHidden(!!n,r),r.scope.$destroy();var t=l.indexOf(r);delete p[r.scope.message],l.splice(t,1);var e=o.maxOpened;e&&l.length>=e&&l[e-1].open.resolve(),l.length||(s.remove(),s=null,d=a.defer())}))}function h(n,o,h,m){return angular.isObject(h)&&(m=h,h=null),function(n){var o=g();if(function(){var t=o.preventDuplicates&&n.message===c,e=o.preventOpenDuplicates&&p[n.message];if(t||e)return!0;return c=n.message,p[n.message]=!0,!1}())return;var h=function(){var t={toastId:u++,isOpened:!1,scope:r.$new(),open:a.defer()};t.iconClass=n.iconClass,n.optionsOverride&&(angular.extend(o,function(t){for(var e=["containerId","iconClasses","maxOpened","newestOnTop","positionClass","preventDuplicates","preventOpenDuplicates","templates"],n=0,r=e.length;n<r;n++)delete t[e[n]];return t}(n.optionsOverride)),t.iconClass=n.optionsOverride.iconClass||t.iconClass);return function(t,e,n){function r(e){if(n[e])return function(){n[e](t)}}n.allowHtml?(t.scope.allowHtml=!0,t.scope.title=i.trustAsHtml(e.title),t.scope.message=i.trustAsHtml(e.message)):(t.scope.title=e.title,t.scope.message=e.message),t.scope.toastType=t.iconClass,t.scope.toastId=t.toastId,t.scope.extraData=n.extraData,t.scope.options={extendedTimeOut:n.extendedTimeOut,messageClass:n.messageClass,onHidden:n.onHidden,onShown:r("onShown"),onTap:r("onTap"),progressBar:n.progressBar,tapToDismiss:n.tapToDismiss,timeOut:n.timeOut,titleClass:n.titleClass,toastClass:n.toastClass},n.closeButton&&(t.scope.options.closeHtml=n.closeHtml)}(t,n,o),t.el=(s=t.scope,l=angular.element("<div toast></div>"),e.get("$compile")(l)(s)),t;var s,l}();if(l.push(h),o.autoDismiss&&o.maxOpened&&l.length>o.maxOpened)for(var m=l.slice(0,l.length-o.maxOpened),v=0,y=m.length;v<y;v++)f(m[v].toastId);(o.maxOpened&&l.length<=o.maxOpened||!o.maxOpened)&&h.open.resolve();return h.open.promise.then(function(){(function(e){if(s)return d.promise;(s=angular.element("<div></div>")).attr("id",e.containerId),s.addClass(e.positionClass),s.css({"pointer-events":"auto"});var n=angular.element(document.querySelector(e.target));if(!n||!n.length)throw"Target for toasts doesn't exist";return t.enter(s,n).then(function(){d.resolve()}),d.promise})(o).then(function(){if(h.isOpened=!0,o.newestOnTop)t.enter(h.el,s).then(function(){h.scope.init()});else{var e=s[0].lastChild?angular.element(s[0].lastChild):null;t.enter(h.el,s,e).then(function(){h.scope.init()})}})}),h}({iconClass:n,message:o,optionsOverride:m,title:h})}function g(){return angular.extend({},o)}}angular.module("toastr",[]).factory("toastr",t),t.$inject=["$animate","$injector","$document","$rootScope","$sce","toastrConfig","$q"]}(),function(){"use strict";angular.module("toastr").constant("toastrConfig",{allowHtml:!1,autoDismiss:!1,closeButton:!1,closeHtml:"<button>&times;</button>",containerId:"toast-container",extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},maxOpened:0,messageClass:"toast-message",newestOnTop:!0,onHidden:null,onShown:null,onTap:null,positionClass:"toast-top-right",preventDuplicates:!1,preventOpenDuplicates:!1,progressBar:!1,tapToDismiss:!0,target:"body",templates:{toast:"directives/toast/toast.html",progressbar:"directives/progressbar/progressbar.html"},timeOut:5e3,titleClass:"toast-title",toastClass:"toast"})}(),function(){"use strict";function t(t){return{require:"^toast",templateUrl:function(){return t.templates.progressbar},link:function(t,e,n,r){var i,o,a;function s(){var t=(a-(new Date).getTime())/o*100;e.css("width",t+"%")}r.progressBar=t,t.start=function(t){i&&clearInterval(i),o=parseFloat(t),a=(new Date).getTime()+o,i=setInterval(s,10)},t.stop=function(){i&&clearInterval(i)},t.$on("$destroy",function(){clearInterval(i)})}}}angular.module("toastr").directive("progressBar",t),t.$inject=["toastrConfig"]}(),function(){"use strict";angular.module("toastr").controller("ToastController",function(){this.progressBar=null,this.startProgressBar=function(t){this.progressBar&&this.progressBar.start(t)},this.stopProgressBar=function(){this.progressBar&&this.progressBar.stop()}})}(),function(){"use strict";function t(t,e,n,r){return{templateUrl:function(){return n.templates.toast},controller:"ToastController",link:function(n,i,o,a){var s;if(n.toastClass=n.options.toastClass,n.titleClass=n.options.titleClass,n.messageClass=n.options.messageClass,n.progressBar=n.options.progressBar,n.options.closeHtml){var u=angular.element(n.options.closeHtml),l=t.get("$compile");u.addClass("toast-close-button"),u.attr("ng-click","close(true, $event)"),l(u)(n),i.children().prepend(u)}function c(t){return a.startProgressBar(t),e(function(){a.stopProgressBar(),r.remove(n.toastId)},t,1)}n.init=function(){n.options.timeOut&&(s=c(n.options.timeOut)),n.options.onShown&&n.options.onShown()},i.on("mouseenter",function(){n.progressBar=!1,a.stopProgressBar(),s&&e.cancel(s)}),n.tapToast=function(){angular.isFunction(n.options.onTap)&&n.options.onTap(),n.options.tapToDismiss&&n.close(!0)},n.close=function(t,e){e&&angular.isFunction(e.stopPropagation)&&e.stopPropagation(),r.remove(n.toastId,t)},n.refreshTimer=function(t){s&&(e.cancel(s),s=c(t||n.options.timeOut))},i.on("mouseleave",function(){0===n.options.timeOut&&0===n.options.extendedTimeOut||(n.$apply(function(){n.progressBar=n.options.progressBar}),s=c(n.options.extendedTimeOut))})}}}angular.module("toastr").directive("toast",t),t.$inject=["$injector","$interval","toastrConfig","toastr"]}(),function(){"use strict";function t(t,e,n,r,i,o,a){var s,u=0,l=[],c="",p={},d=a.defer();return{active:function(){return l.length},clear:function(t){if(1===arguments.length&&!t)return;if(t)f(t.toastId);else for(var e=0;e<l.length;e++)f(l[e].toastId)},error:function(t,e,n){return h(g().iconClasses.error,t,e,n)},info:function(t,e,n){return h(g().iconClasses.info,t,e,n)},remove:f,success:function(t,e,n){return h(g().iconClasses.success,t,e,n)},warning:function(t,e,n){return h(g().iconClasses.warning,t,e,n)},refreshTimer:function(t,e){t&&t.isOpened&&l.indexOf(t)>=0&&t.scope.refreshTimer(e)}};function f(e,n){var r=function(t){for(var e=0;e<l.length;e++)if(l[e].toastId===t)return l[e]}(e);r&&!r.deleting&&(r.deleting=!0,r.isOpened=!1,t.leave(r.el).then(function(){r.scope.options.onHidden&&r.scope.options.onHidden(!!n,r),r.scope.$destroy();var t=l.indexOf(r);delete p[r.scope.message],l.splice(t,1);var e=o.maxOpened;e&&l.length>=e&&l[e-1].open.resolve(),l.length||(s.remove(),s=null,d=a.defer())}))}function h(n,o,h,m){return angular.isObject(h)&&(m=h,h=null),function(n){var o=g();if(function(){var t=o.preventDuplicates&&n.message===c,e=o.preventOpenDuplicates&&p[n.message];if(t||e)return!0;return c=n.message,p[n.message]=!0,!1}())return;var h=function(){var t={toastId:u++,isOpened:!1,scope:r.$new(),open:a.defer()};t.iconClass=n.iconClass,n.optionsOverride&&(angular.extend(o,function(t){for(var e=["containerId","iconClasses","maxOpened","newestOnTop","positionClass","preventDuplicates","preventOpenDuplicates","templates"],n=0,r=e.length;n<r;n++)delete t[e[n]];return t}(n.optionsOverride)),t.iconClass=n.optionsOverride.iconClass||t.iconClass);return function(t,e,n){function r(e){if(n[e])return function(){n[e](t)}}n.allowHtml?(t.scope.allowHtml=!0,t.scope.title=i.trustAsHtml(e.title),t.scope.message=i.trustAsHtml(e.message)):(t.scope.title=e.title,t.scope.message=e.message),t.scope.toastType=t.iconClass,t.scope.toastId=t.toastId,t.scope.extraData=n.extraData,t.scope.options={extendedTimeOut:n.extendedTimeOut,messageClass:n.messageClass,onHidden:n.onHidden,onShown:r("onShown"),onTap:r("onTap"),progressBar:n.progressBar,tapToDismiss:n.tapToDismiss,timeOut:n.timeOut,titleClass:n.titleClass,toastClass:n.toastClass},n.closeButton&&(t.scope.options.closeHtml=n.closeHtml)}(t,n,o),t.el=(s=t.scope,l=angular.element("<div toast></div>"),e.get("$compile")(l)(s)),t;var s,l}();if(l.push(h),o.autoDismiss&&o.maxOpened&&l.length>o.maxOpened)for(var m=l.slice(0,l.length-o.maxOpened),v=0,y=m.length;v<y;v++)f(m[v].toastId);(o.maxOpened&&l.length<=o.maxOpened||!o.maxOpened)&&h.open.resolve();return h.open.promise.then(function(){(function(e){if(s)return d.promise;(s=angular.element("<div></div>")).attr("id",e.containerId),s.addClass(e.positionClass),s.css({"pointer-events":"auto"});var n=angular.element(document.querySelector(e.target));if(!n||!n.length)throw"Target for toasts doesn't exist";return t.enter(s,n).then(function(){d.resolve()}),d.promise})(o).then(function(){if(h.isOpened=!0,o.newestOnTop)t.enter(h.el,s).then(function(){h.scope.init()});else{var e=s[0].lastChild?angular.element(s[0].lastChild):null;t.enter(h.el,s,e).then(function(){h.scope.init()})}})}),h}({iconClass:n,message:o,optionsOverride:m,title:h})}function g(){return angular.extend({},o)}}angular.module("toastr",[]).factory("toastr",t),t.$inject=["$animate","$injector","$document","$rootScope","$sce","toastrConfig","$q"]}(),function(){"use strict";angular.module("toastr").constant("toastrConfig",{allowHtml:!1,autoDismiss:!1,closeButton:!1,closeHtml:"<button>&times;</button>",containerId:"toast-container",extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},maxOpened:0,messageClass:"toast-message",newestOnTop:!0,onHidden:null,onShown:null,onTap:null,positionClass:"toast-top-right",preventDuplicates:!1,preventOpenDuplicates:!1,progressBar:!1,tapToDismiss:!0,target:"body",templates:{toast:"directives/toast/toast.html",progressbar:"directives/progressbar/progressbar.html"},timeOut:5e3,titleClass:"toast-title",toastClass:"toast"})}(),function(){"use strict";function t(t){return{require:"^toast",templateUrl:function(){return t.templates.progressbar},link:function(t,e,n,r){var i,o,a;function s(){var t=(a-(new Date).getTime())/o*100;e.css("width",t+"%")}r.progressBar=t,t.start=function(t){i&&clearInterval(i),o=parseFloat(t),a=(new Date).getTime()+o,i=setInterval(s,10)},t.stop=function(){i&&clearInterval(i)},t.$on("$destroy",function(){clearInterval(i)})}}}angular.module("toastr").directive("progressBar",t),t.$inject=["toastrConfig"]}(),function(){"use strict";angular.module("toastr").controller("ToastController",function(){this.progressBar=null,this.startProgressBar=function(t){this.progressBar&&this.progressBar.start(t)},this.stopProgressBar=function(){this.progressBar&&this.progressBar.stop()}})}(),function(){"use strict";function t(t,e,n,r){return{templateUrl:function(){return n.templates.toast},controller:"ToastController",link:function(n,i,o,a){var s;if(n.toastClass=n.options.toastClass,n.titleClass=n.options.titleClass,n.messageClass=n.options.messageClass,n.progressBar=n.options.progressBar,n.options.closeHtml){var u=angular.element(n.options.closeHtml),l=t.get("$compile");u.addClass("toast-close-button"),u.attr("ng-click","close(true, $event)"),l(u)(n),i.children().prepend(u)}function c(t){return a.startProgressBar(t),e(function(){a.stopProgressBar(),r.remove(n.toastId)},t,1)}n.init=function(){n.options.timeOut&&(s=c(n.options.timeOut)),n.options.onShown&&n.options.onShown()},i.on("mouseenter",function(){n.progressBar=!1,a.stopProgressBar(),s&&e.cancel(s)}),n.tapToast=function(){angular.isFunction(n.options.onTap)&&n.options.onTap(),n.options.tapToDismiss&&n.close(!0)},n.close=function(t,e){e&&angular.isFunction(e.stopPropagation)&&e.stopPropagation(),r.remove(n.toastId,t)},n.refreshTimer=function(t){s&&(e.cancel(s),s=c(t||n.options.timeOut))},i.on("mouseleave",function(){0===n.options.timeOut&&0===n.options.extendedTimeOut||(n.$apply(function(){n.progressBar=n.options.progressBar}),s=c(n.options.extendedTimeOut))})}}}angular.module("toastr").directive("toast",t),t.$inject=["$injector","$interval","toastrConfig","toastr"]}(),angular.module("toastr").run(["$templateCache",function(t){t.put("directives/progressbar/progressbar.html",'<div class="toast-progress"></div>\n'),t.put("directives/toast/toast.html",'<div class="{{toastClass}} {{toastType}}" ng-click="tapToast()">\n <div ng-switch on="allowHtml">\n <div ng-switch-default ng-if="title" class="{{titleClass}}" aria-label="{{title}}">{{title}}</div>\n <div ng-switch-default class="{{messageClass}}" aria-label="{{message}}">{{message}}</div>\n <div ng-switch-when="true" ng-if="title" class="{{titleClass}}" ng-bind-html="title"></div>\n <div ng-switch-when="true" class="{{messageClass}}" ng-bind-html="message"></div>\n </div>\n <progress-bar ng-if="progressBar"></progress-bar>\n</div>\n')}]),angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.tabindex","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.multiMap","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(t,e,n,r){var i=r.has("$animateCss")?r.get("$animateCss"):null;return{link:function(r,o,a){var s=n(a.expanding),u=n(a.expanded),l=n(a.collapsing),c=n(a.collapsed),p=!1,d={},f={};function h(t){return p?{width:t.scrollWidth+"px"}:{height:t.scrollHeight+"px"}}function g(){o.removeClass("collapsing").addClass("collapse").css(d),u(r)}function m(){o.css(f),o.removeClass("collapsing").addClass("collapse"),c(r)}!function(){(p=!!("horizontal"in a))?(d={width:""},f={width:"0"}):(d={height:""},f={height:"0"});r.$eval(a.uibCollapse)||o.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css(d)}(),r.$watch(a.uibCollapse,function(n){n?function(){if(!o.hasClass("collapse")&&!o.hasClass("in"))return m();e.resolve(l(r)).then(function(){o.css(h(o[0])).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),i?i(o,{removeClass:"in",to:f}).start().finally(m):t.removeClass(o,"in",{to:f}).then(m)},angular.noop)}():o.hasClass("collapse")&&o.hasClass("in")||e.resolve(s(r)).then(function(){o.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),i?i(o,{addClass:"in",easing:"ease",css:{overflow:"hidden"},to:h(o[0])}).start().finally(g):t.addClass(o,"in",{css:{overflow:"hidden"},to:h(o[0])}).then(g)},angular.noop)})}}}]),angular.module("ui.bootstrap.tabindex",[]).directive("uibTabindexToggle",function(){return{restrict:"A",link:function(t,e,n){n.$observe("disabled",function(t){n.$set("tabindex",t?-1:null)})}}}),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse","ui.bootstrap.tabindex"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(t,e,n){this.groups=[],this.closeOthers=function(r){(angular.isDefined(e.closeOthers)?t.$eval(e.closeOthers):n.closeOthers)&&angular.forEach(this.groups,function(t){t!==r&&(t.isOpen=!1)})},this.addGroup=function(t){var e=this;this.groups.push(t),t.$on("$destroy",function(n){e.removeGroup(t)})},this.removeGroup=function(t){var e=this.groups.indexOf(t);-1!==e&&this.groups.splice(e,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,restrict:"A",templateUrl:function(t,e){return e.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(t){this.heading=t}},link:function(t,e,n,r){e.addClass("panel"),r.addGroup(t),t.openClass=n.openClass||"panel-open",t.panelClass=n.panelClass||"panel-default",t.$watch("isOpen",function(n){e.toggleClass(t.openClass,!!n),n&&r.closeOthers(t)}),t.toggleOpen=function(e){t.isDisabled||e&&32!==e.which||(t.isOpen=!t.isOpen)};var i="accordiongroup-"+t.$id+"-"+Math.floor(1e4*Math.random());t.headingId=i+"-tab",t.panelId=i+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(t,e,n,r,i){r.setHeading(i(t,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:"^uibAccordionGroup",link:function(t,e,n,r){t.$watch(function(){return r[n.uibAccordionTransclude]},function(t){if(t){var n=angular.element(e[0].querySelector("uib-accordion-header,data-uib-accordion-header,x-uib-accordion-header,uib\\:accordion-header,[uib-accordion-header],[data-uib-accordion-header],[x-uib-accordion-header]"));n.html(""),n.append(t)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$element","$attrs","$interpolate","$timeout",function(t,e,n,r,i){t.closeable=!!n.close,e.addClass("alert"),n.$set("role","alert"),t.closeable&&e.addClass("alert-dismissible");var o=angular.isDefined(n.dismissOnTimeout)?r(n.dismissOnTimeout)(t.$parent):null;o&&i(function(){t.close()},parseInt(o,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",restrict:"A",templateUrl:function(t,e){return e.templateUrl||"uib/template/alert/alert.html"},transclude:!0,scope:{close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(t){this.activeClass=t.activeClass||"active",this.toggleEvent=t.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(t){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(e,n,r,i){var o=i[0],a=i[1],s=t(r.uibUncheckable);n.find("input").css({display:"none"}),a.$render=function(){n.toggleClass(o.activeClass,angular.equals(a.$modelValue,e.$eval(r.uibBtnRadio)))},n.on(o.toggleEvent,function(){if(!r.disabled){var t=n.hasClass(o.activeClass);t&&!angular.isDefined(r.uncheckable)||e.$apply(function(){a.$setViewValue(t?null:e.$eval(r.uibBtnRadio)),a.$render()})}}),r.uibUncheckable&&e.$watch(s,function(t){r.$set("uncheckable",t?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(t,e,n,r){var i=r[0],o=r[1];function a(){return s(n.btnCheckboxTrue,!0)}function s(e,n){return angular.isDefined(e)?t.$eval(e):n}e.find("input").css({display:"none"}),o.$render=function(){e.toggleClass(i.activeClass,angular.equals(o.$modelValue,a()))},e.on(i.toggleEvent,function(){n.disabled||t.$apply(function(){o.$setViewValue(e.hasClass(i.activeClass)?s(n.btnCheckboxFalse,!1):a()),o.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(t,e,n,r,i){var o,a,s=this,u=s.slides=t.slides=[],l="uib-slideDirection",c=t.active,p=!1;function d(t){for(var e=0;e<u.length;e++)u[e].slide.active=e===t}function f(t){for(var e=0;e<u.length;e++)if(u[e].slide===t)return e}function h(){o&&(n.cancel(o),o=null)}function g(){h();var e=+t.interval;!isNaN(e)&&e>0&&(o=n(m,e))}function m(){var e=+t.interval;a&&!isNaN(e)&&e>0&&u.length?t.next():t.pause()}e.addClass("carousel"),s.addSlide=function(e,n){u.push({slide:e,element:n}),u.sort(function(t,e){return+t.slide.index-+e.slide.index}),(e.index===t.active||1===u.length&&!angular.isNumber(t.active))&&(t.$currentTransition&&(t.$currentTransition=null),c=e.index,t.active=e.index,d(c),s.select(u[f(e)]),1===u.length&&t.play())},s.getCurrentIndex=function(){for(var t=0;t<u.length;t++)if(u[t].slide.index===c)return t},s.next=t.next=function(){var e=(s.getCurrentIndex()+1)%u.length;if(0!==e||!t.noWrap())return s.select(u[e],"next");t.pause()},s.prev=t.prev=function(){var e=s.getCurrentIndex()-1<0?u.length-1:s.getCurrentIndex()-1;if(!t.noWrap()||e!==u.length-1)return s.select(u[e],"prev");t.pause()},s.removeSlide=function(e){var n=f(e);u.splice(n,1),u.length>0&&c===n?n>=u.length?(c=u.length-1,t.active=c,d(c),s.select(u[u.length-1])):(c=n,t.active=c,d(c),s.select(u[n])):c>n&&(c--,t.active=c),0===u.length&&(c=null,t.active=null)},s.select=t.select=function(n,r){var o=f(n.slide);void 0===r&&(r=o>s.getCurrentIndex()?"next":"prev"),n.slide.index===c||t.$currentTransition||function(n,r,o){if(p)return;if(angular.extend(n,{direction:o}),angular.extend(u[c].slide||{},{direction:o}),i.enabled(e)&&!t.$currentTransition&&u[r].element&&s.slides.length>1){u[r].element.data(l,n.direction);var a=s.getCurrentIndex();angular.isNumber(a)&&u[a].element&&u[a].element.data(l,n.direction),t.$currentTransition=!0,i.on("addClass",u[r].element,function(e,n){"close"===n&&(t.$currentTransition=null,i.off("addClass",e))})}t.active=n.index,c=n.index,d(r),g()}(n.slide,o,r)},t.indexOfSlide=function(t){return+t.slide.index},t.isActive=function(e){return t.active===e.slide.index},t.isPrevDisabled=function(){return 0===t.active&&t.noWrap()},t.isNextDisabled=function(){return t.active===u.length-1&&t.noWrap()},t.pause=function(){t.noPause||(a=!1,h())},t.play=function(){a||(a=!0,g())},e.on("mouseenter",t.pause),e.on("mouseleave",t.play),t.$on("$destroy",function(){p=!0,h()}),t.$watch("noTransition",function(t){i.enabled(e,!t)}),t.$watch("interval",g),t.$watchCollection("slides",function(e){e.length||(t.$currentTransition=null)}),t.$watch("active",function(t){if(angular.isNumber(t)&&c!==t){for(var e=0;e<u.length;e++)if(u[e].slide.index===t){t=e;break}u[t]&&(d(t),s.select(u[t]),c=t)}})}]).directive("uibCarousel",function(){return{transclude:!0,controller:"UibCarouselController",controllerAs:"carousel",restrict:"A",templateUrl:function(t,e){return e.templateUrl||"uib/template/carousel/carousel.html"},scope:{active:"=",interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}).directive("uibSlide",["$animate",function(t){return{require:"^uibCarousel",restrict:"A",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/carousel/slide.html"},scope:{actual:"=?",index:"=?"},link:function(e,n,r,i){n.addClass("item"),i.addSlide(e,n),e.$on("$destroy",function(){i.removeSlide(e)}),e.$watch("active",function(e){t[e?"addClass":"removeClass"](n,"active")})}}}]).animation(".item",["$animateCss",function(t){var e="uib-slideDirection";function n(t,e,n){t.removeClass(e),n&&n()}return{beforeAddClass:function(r,i,o){if("active"===i){var a=r.data(e),s="next"===a?"left":"right",u=n.bind(this,r,s+" "+a,o);return r.addClass(a),t(r,{addClass:s}).start().done(u),function(){!0}}o()},beforeRemoveClass:function(r,i,o){if("active"===i){var a="next"===r.data(e)?"left":"right",s=n.bind(this,r,a,o);return t(r,{addClass:a}).start().done(s),function(){!0}}o()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","dateFilter","orderByFilter","filterFilter",function(t,e,n,r,i){var o,a,s=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;function u(t){return i(a,{key:t},!0)[0]}function l(t,e,n){return function(){return t.substr(e+1,n-e-1)}}function c(t,e){for(var n=t.substr(e),r=0;r<a.length;r++)if(new RegExp("^"+a[r].key).test(n)){var i=a[r];return{endIdx:e+i.key.length,parser:i.formatter}}return{endIdx:e+1,parser:function(){return n.charAt(0)}}}function p(t){return parseInt(t,10)}function d(t,e){t=t.replace(/:/g,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function f(t,e){return(t=new Date(t.getTime())).setMinutes(t.getMinutes()+e),t}function h(t,e,n){n=n?-1:1;var r=t.getTimezoneOffset();return f(t,n*(d(e,r)-r))}this.init=function(){o=e.id,this.parsers={},this.formatters={},a=[{key:"yyyy",regex:"\\d{4}",apply:function(t){this.year=+t},formatter:function(t){var e=new Date;return e.setFullYear(Math.abs(t.getFullYear())),n(e,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(t){t=+t,this.year=t<69?t+2e3:t+1900},formatter:function(t){var e=new Date;return e.setFullYear(Math.abs(t.getFullYear())),n(e,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(t){this.year=+t},formatter:function(t){var e=new Date;return e.setFullYear(Math.abs(t.getFullYear())),n(e,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(t){this.month=t-1},formatter:function(t){var e=t.getMonth();return/^[0-9]$/.test(e)?n(t,"MM"):n(t,"M")}},{key:"MMMM",regex:e.DATETIME_FORMATS.MONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.MONTH.indexOf(t)},formatter:function(t){return n(t,"MMMM")}},{key:"MMM",regex:e.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.SHORTMONTH.indexOf(t)},formatter:function(t){return n(t,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(t){this.month=t-1},formatter:function(t){return n(t,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(t){this.month=t-1},formatter:function(t){return n(t,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t},formatter:function(t){var e=t.getDate();return/^[1-9]$/.test(e)?n(t,"dd"):n(t,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t},formatter:function(t){return n(t,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t},formatter:function(t){return n(t,"d")}},{key:"EEEE",regex:e.DATETIME_FORMATS.DAY.join("|"),formatter:function(t){return n(t,"EEEE")}},{key:"EEE",regex:e.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(t){return n(t,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(t){this.hours=+t},formatter:function(t){return n(t,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(t){this.minutes=+t},formatter:function(t){return n(t,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(t){this.minutes=+t},formatter:function(t){return n(t,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(t){this.milliseconds=+t},formatter:function(t){return n(t,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(t){this.seconds=+t},formatter:function(t){return n(t,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(t){this.seconds=+t},formatter:function(t){return n(t,"s")}},{key:"a",regex:e.DATETIME_FORMATS.AMPMS.join("|"),apply:function(t){12===this.hours&&(this.hours=0),"PM"===t&&(this.hours+=12)},formatter:function(t){return n(t,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(t){var e=t.match(/([+-])(\d{2})(\d{2})/),n=e[1],r=e[2],i=e[3];this.hours+=p(n+r),this.minutes+=p(n+i)},formatter:function(t){return n(t,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(t){return n(t,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(t){return n(t,"w")}},{key:"GGGG",regex:e.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(t){return n(t,"GGGG")}},{key:"GGG",regex:e.DATETIME_FORMATS.ERAS.join("|"),formatter:function(t){return n(t,"GGG")}},{key:"GG",regex:e.DATETIME_FORMATS.ERAS.join("|"),formatter:function(t){return n(t,"GG")}},{key:"G",regex:e.DATETIME_FORMATS.ERAS.join("|"),formatter:function(t){return n(t,"G")}}],angular.version.major>=1&&angular.version.minor>4&&a.push({key:"LLLL",regex:e.DATETIME_FORMATS.STANDALONEMONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.STANDALONEMONTH.indexOf(t)},formatter:function(t){return n(t,"LLLL")}})},this.init(),this.getParser=function(t){var e=u(t);return e&&e.apply||null},this.overrideParser=function(t,e){var n=u(t);n&&angular.isFunction(e)&&(this.parsers={},n.apply=e)}.bind(this),this.filter=function(t,n){return angular.isDate(t)&&!isNaN(t)&&n?(n=e.DATETIME_FORMATS[n]||n,e.id!==o&&this.init(),this.formatters[n]||(this.formatters[n]=function(t){for(var e,n,r=[],i=0;i<t.length;)if(angular.isNumber(n)){if("'"===t.charAt(i))(i+1>=t.length||"'"!==t.charAt(i+1))&&(r.push(l(t,n,i)),n=null);else if(i===t.length)for(;n<t.length;)e=c(t,n),r.push(e),n=e.endIdx;i++}else"'"!==t.charAt(i)?(e=c(t,i),r.push(e.parser),i=e.endIdx):(n=i,i++);return r}(n)),this.formatters[n].reduce(function(e,n){return e+n(t)},"")):""},this.parse=function(n,i,u){if(!angular.isString(n)||!i)return n;i=(i=e.DATETIME_FORMATS[i]||i).replace(s,"\\$&"),e.id!==o&&this.init(),this.parsers[i]||(this.parsers[i]=function(t){var e=[],n=t.split(""),i=t.indexOf("'");if(i>-1){var o=!1;t=t.split("");for(var s=i;s<t.length;s++)o?("'"===t[s]&&(s+1<t.length&&"'"===t[s+1]?(t[s+1]="$",n[s+1]=""):(n[s]="",o=!1)),t[s]="$"):"'"===t[s]&&(t[s]="$",n[s]="",o=!0);t=t.join("")}return angular.forEach(a,function(r){var i=t.indexOf(r.key);if(i>-1){t=t.split(""),n[i]="("+r.regex+")",t[i]="$";for(var o=i+1,a=i+r.key.length;o<a;o++)n[o]="",t[o]="$";t=t.join(""),e.push({index:i,key:r.key,apply:r.apply,matcher:r.regex})}}),{regex:new RegExp("^"+n.join("")+"$"),map:r(e,"index")}}(i));var l=this.parsers[i],c=l.regex,p=l.map,d=n.match(c),f=!1;if(d&&d.length){var h,g;angular.isDate(u)&&!isNaN(u.getTime())?h={year:u.getFullYear(),month:u.getMonth(),date:u.getDate(),hours:u.getHours(),minutes:u.getMinutes(),seconds:u.getSeconds(),milliseconds:u.getMilliseconds()}:(u&&t.warn("dateparser:","baseDate is not a valid date"),h={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var m=1,v=d.length;m<v;m++){var y=p[m-1];"Z"===y.matcher&&(f=!0),y.apply&&y.apply.call(h,d[m])}var b=f?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,w=f?Date.prototype.setUTCHours:Date.prototype.setHours;return function(t,e,n){if(n<1)return!1;if(1===e&&n>28)return 29===n&&(t%4==0&&t%100!=0||t%400==0);if(3===e||5===e||8===e||10===e)return n<31;return!0}(h.year,h.month,h.date)&&(!angular.isDate(u)||isNaN(u.getTime())||f?(g=new Date(0),b.call(g,h.year,h.month,h.date),w.call(g,h.hours||0,h.minutes||0,h.seconds||0,h.milliseconds||0)):(g=new Date(u),b.call(g,h.year,h.month,h.date),w.call(g,h.hours,h.minutes,h.seconds,h.milliseconds))),g}},this.toTimezone=function(t,e){return t&&e?h(t,e):t},this.fromTimezone=function(t,e){return t&&e?h(t,e,!0):t},this.timezoneToOffset=d,this.addDateMinutes=f,this.convertTimezoneToLocal=h}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(t){var e=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,n=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(r,i){var o=[],a=[],s={},u=i.uibIsClass.match(e),l=u[2],c=u[1].split(",");return function(e,r,i){o.push(e),a.push({scope:e,element:r}),c.forEach(function(r,i){!function(e,r){var i=e.match(n),o=r.$eval(i[1]),u=i[2],c=s[e];if(!c){var p=function(e){var n=null;a.some(function(t){var r=t.scope.$eval(l);if(r===e)return n=t,!0}),c.lastActivated!==n&&(c.lastActivated&&t.removeClass(c.lastActivated.element,o),n&&t.addClass(n.element,o),c.lastActivated=n)};s[e]=c={lastActivated:null,scope:r,watchFn:p,compareWithExp:u,watcher:r.$watch(u,p)}}c.watchFn(r.$eval(u))}(r,e)}),e.$on("$destroy",p)};function p(t){var e=t.targetScope,n=o.indexOf(e);if(o.splice(n,1),a.splice(n,1),o.length){var r=o[0];angular.forEach(s,function(t){t.scope===e&&(t.watcher=r.$watch(t.compareWithExp,t.watchFn),t.scope=r)})}else s={}}}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",monthColumns:3,ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$element","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(t,e,n,r,i,o,a,s,u,l,c,p){var d=this,f={$setViewValue:angular.noop},h={},g=[];e.addClass("uib-datepicker"),n.$set("role","application"),t.datepickerOptions||(t.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","monthColumns","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(e){switch(e){case"customClass":case"dateDisabled":t[e]=t.datepickerOptions[e]||angular.noop;break;case"datepickerMode":t.datepickerMode=angular.isDefined(t.datepickerOptions.datepickerMode)?t.datepickerOptions.datepickerMode:u.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":d[e]=angular.isDefined(t.datepickerOptions[e])?i(t.datepickerOptions[e])(t.$parent):u[e];break;case"monthColumns":case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":d[e]=angular.isDefined(t.datepickerOptions[e])?t.datepickerOptions[e]:u[e];break;case"startingDay":angular.isDefined(t.datepickerOptions.startingDay)?d.startingDay=t.datepickerOptions.startingDay:angular.isNumber(u.startingDay)?d.startingDay=u.startingDay:d.startingDay=(o.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":t.$watch("datepickerOptions."+e,function(t){t?angular.isDate(t)?d[e]=p.fromTimezone(new Date(t),h.getOption("timezone")):(l&&a.warn("Literal date support has been deprecated, please switch to date object usage"),d[e]=new Date(s(t,"medium"))):d[e]=u[e]?p.fromTimezone(new Date(u[e]),h.getOption("timezone")):null,d.refreshView()});break;case"maxMode":case"minMode":t.datepickerOptions[e]?t.$watch(function(){return t.datepickerOptions[e]},function(n){d[e]=t[e]=angular.isDefined(n)?n:t.datepickerOptions[e],("minMode"===e&&d.modes.indexOf(t.datepickerOptions.datepickerMode)<d.modes.indexOf(d[e])||"maxMode"===e&&d.modes.indexOf(t.datepickerOptions.datepickerMode)>d.modes.indexOf(d[e]))&&(t.datepickerMode=d[e],t.datepickerOptions.datepickerMode=d[e])}):d[e]=t[e]=u[e]||null}}),t.uniqueId="datepicker-"+t.$id+"-"+Math.floor(1e4*Math.random()),t.disabled=angular.isDefined(n.disabled)||!1,angular.isDefined(n.ngDisabled)&&g.push(t.$parent.$watch(n.ngDisabled,function(e){t.disabled=e,d.refreshView()})),t.isActive=function(e){return 0===d.compare(e.date,d.activeDate)&&(t.activeDateId=e.uid,!0)},this.init=function(e){h=function(e){var n;if(angular.version.minor<6)(n=e.$options||t.datepickerOptions.ngModelOptions||u.ngModelOptions||{}).getOption=function(t){return n[t]};else{var r=e.$options.getOption("timezone")||(t.datepickerOptions.ngModelOptions?t.datepickerOptions.ngModelOptions.timezone:null)||(u.ngModelOptions?u.ngModelOptions.timezone:null);n=e.$options.createChild(u.ngModelOptions).createChild(t.datepickerOptions.ngModelOptions).createChild(e.$options).createChild({timezone:r})}return n}(f=e),t.datepickerOptions.initDate?(d.activeDate=p.fromTimezone(t.datepickerOptions.initDate,h.getOption("timezone"))||new Date,t.$watch("datepickerOptions.initDate",function(t){t&&(f.$isEmpty(f.$modelValue)||f.$invalid)&&(d.activeDate=p.fromTimezone(t,h.getOption("timezone")),d.refreshView())})):d.activeDate=new Date;var n=f.$modelValue?new Date(f.$modelValue):new Date;this.activeDate=isNaN(n)?p.fromTimezone(new Date,h.getOption("timezone")):p.fromTimezone(n,h.getOption("timezone")),f.$render=function(){d.render()}},this.render=function(){if(f.$viewValue){var t=new Date(f.$viewValue);!isNaN(t)?this.activeDate=p.fromTimezone(t,h.getOption("timezone")):c||a.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){t.selectedDt=null,this._refreshView(),t.activeDt&&(t.activeDateId=t.activeDt.uid);var e=f.$viewValue?new Date(f.$viewValue):null;e=p.fromTimezone(e,h.getOption("timezone")),f.$setValidity("dateDisabled",!e||this.element&&!this.isDisabled(e))}},this.createDateObject=function(e,n){var r=f.$viewValue?new Date(f.$viewValue):null;r=p.fromTimezone(r,h.getOption("timezone"));var i=new Date;i=p.fromTimezone(i,h.getOption("timezone"));var o=this.compare(e,i),a={date:e,label:p.filter(e,n),selected:r&&0===this.compare(e,r),disabled:this.isDisabled(e),past:o<0,current:0===o,future:o>0,customClass:this.customClass(e)||null};return r&&0===this.compare(e,r)&&(t.selectedDt=a),d.activeDate&&0===this.compare(a.date,d.activeDate)&&(t.activeDt=a),a},this.isDisabled=function(e){return t.disabled||this.minDate&&this.compare(e,this.minDate)<0||this.maxDate&&this.compare(e,this.maxDate)>0||t.dateDisabled&&t.dateDisabled({date:e,mode:t.datepickerMode})},this.customClass=function(e){return t.customClass({date:e,mode:t.datepickerMode})},this.split=function(t,e){for(var n=[];t.length>0;)n.push(t.splice(0,e));return n},t.select=function(e){if(t.datepickerMode===d.minMode){var n=f.$viewValue?p.fromTimezone(new Date(f.$viewValue),h.getOption("timezone")):new Date(0,0,0,0,0,0,0);n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n=p.toTimezone(n,h.getOption("timezone")),f.$setViewValue(n),f.$render()}else d.activeDate=e,m(d.modes[d.modes.indexOf(t.datepickerMode)-1]),t.$emit("uib:datepicker.mode");t.$broadcast("uib:datepicker.focus")},t.move=function(t){var e=d.activeDate.getFullYear()+t*(d.step.years||0),n=d.activeDate.getMonth()+t*(d.step.months||0);d.activeDate.setFullYear(e,n,1),d.refreshView()},t.toggleMode=function(e){e=e||1,t.datepickerMode===d.maxMode&&1===e||t.datepickerMode===d.minMode&&-1===e||(m(d.modes[d.modes.indexOf(t.datepickerMode)+e]),t.$emit("uib:datepicker.mode"))},t.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};function m(e){t.datepickerMode=e,t.datepickerOptions.datepickerMode=e}t.$on("uib:datepicker.focus",function(){d.element[0].focus()}),t.keydown=function(e){var n=t.keys[e.which];if(n&&!e.shiftKey&&!e.altKey&&!t.disabled)if(e.preventDefault(),d.shortcutPropagation||e.stopPropagation(),"enter"===n||"space"===n){if(d.isDisabled(d.activeDate))return;t.select(d.activeDate)}else!e.ctrlKey||"up"!==n&&"down"!==n?(d.handleKeyDown(n,e),d.refreshView()):t.toggleMode("up"===n?1:-1)},e.on("keydown",function(e){t.$apply(function(){t.keydown(e)})}),t.$on("$destroy",function(){for(;g.length;)g.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(t,e,n){var r=[31,28,31,30,31,30,31,31,30,31,30,31];function i(t,e){return 1!==e||t%4!=0||t%100==0&&t%400!=0?r[e]:29}function o(t){var e=new Date(t);e.setDate(e.getDate()+4-(e.getDay()||7));var n=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((n-e)/864e5)/7)+1}this.step={months:1},this.element=e,this.init=function(e){angular.extend(e,this),t.showWeeks=e.showWeeks,e.refreshView()},this.getDates=function(t,e){for(var n,r=new Array(e),i=new Date(t),o=0;o<e;)n=new Date(i),r[o++]=n,i.setDate(i.getDate()+1);return r},this._refreshView=function(){var e=this.activeDate.getFullYear(),r=this.activeDate.getMonth(),i=new Date(this.activeDate);i.setFullYear(e,r,1);var a=this.startingDay-i.getDay(),s=a>0?7-a:-a,u=new Date(i);s>0&&u.setDate(1-s);for(var l=this.getDates(u,42),c=0;c<42;c++)l[c]=angular.extend(this.createDateObject(l[c],this.formatDay),{secondary:l[c].getMonth()!==r,uid:t.uniqueId+"-"+c});t.labels=new Array(7);for(var p=0;p<7;p++)t.labels[p]={abbr:n(l[p].date,this.formatDayHeader),full:n(l[p].date,"EEEE")};if(t.title=n(this.activeDate,this.formatDayTitle),t.rows=this.split(l,7),t.showWeeks){t.weekNumbers=[];for(var d=(11-this.startingDay)%7,f=t.rows.length,h=0;h<f;h++)t.weekNumbers.push(o(t.rows[h][d].date))}},this.compare=function(t,e){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n.setFullYear(t.getFullYear()),r.setFullYear(e.getFullYear()),n-r},this.handleKeyDown=function(t,e){var n=this.activeDate.getDate();if("left"===t)n-=1;else if("up"===t)n-=7;else if("right"===t)n+=1;else if("down"===t)n+=7;else if("pageup"===t||"pagedown"===t){var r=this.activeDate.getMonth()+("pageup"===t?-1:1);this.activeDate.setMonth(r,1),n=Math.min(i(this.activeDate.getFullYear(),this.activeDate.getMonth()),n)}else"home"===t?n=1:"end"===t&&(n=i(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(n)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(t,e,n){this.step={years:1},this.element=e,this.init=function(t){angular.extend(t,this),t.refreshView()},this._refreshView=function(){for(var e,r=new Array(12),i=this.activeDate.getFullYear(),o=0;o<12;o++)(e=new Date(this.activeDate)).setFullYear(i,o,1),r[o]=angular.extend(this.createDateObject(e,this.formatMonth),{uid:t.uniqueId+"-"+o});t.title=n(this.activeDate,this.formatMonthTitle),t.rows=this.split(r,this.monthColumns),t.yearHeaderColspan=this.monthColumns>3?this.monthColumns-2:1},this.compare=function(t,e){var n=new Date(t.getFullYear(),t.getMonth()),r=new Date(e.getFullYear(),e.getMonth());return n.setFullYear(t.getFullYear()),r.setFullYear(e.getFullYear()),n-r},this.handleKeyDown=function(t,e){var n=this.activeDate.getMonth();if("left"===t)n-=1;else if("up"===t)n-=this.monthColumns;else if("right"===t)n+=1;else if("down"===t)n+=this.monthColumns;else if("pageup"===t||"pagedown"===t){var r=this.activeDate.getFullYear()+("pageup"===t?-1:1);this.activeDate.setFullYear(r)}else"home"===t?n=0:"end"===t&&(n=11);this.activeDate.setMonth(n)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(t,e,n){var r,i;function o(t){return parseInt((t-1)/i,10)*i+1}this.element=e,this.yearpickerInit=function(){r=this.yearColumns,i=this.yearRows*r,this.step={years:i}},this._refreshView=function(){for(var e,n=new Array(i),a=0,s=o(this.activeDate.getFullYear());a<i;a++)(e=new Date(this.activeDate)).setFullYear(s+a,0,1),n[a]=angular.extend(this.createDateObject(e,this.formatYear),{uid:t.uniqueId+"-"+a});t.title=[n[0].label,n[i-1].label].join(" - "),t.rows=this.split(n,r),t.columns=r},this.compare=function(t,e){return t.getFullYear()-e.getFullYear()},this.handleKeyDown=function(t,e){var n=this.activeDate.getFullYear();"left"===t?n-=1:"up"===t?n-=r:"right"===t?n+=1:"down"===t?n+=r:"pageup"===t||"pagedown"===t?n+=("pageup"===t?-1:1)*i:"home"===t?n=o(this.activeDate.getFullYear()):"end"===t&&(n=o(this.activeDate.getFullYear())+i-1),this.activeDate.setFullYear(n)}}]).directive("uibDatepicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],restrict:"A",controller:"UibDatepickerController",controllerAs:"datepicker",link:function(t,e,n,r){var i=r[0],o=r[1];i.init(o)}}}).directive("uibDaypicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],restrict:"A",controller:"UibDaypickerController",link:function(t,e,n,r){var i=r[0];r[1].init(i)}}}).directive("uibMonthpicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],restrict:"A",controller:"UibMonthpickerController",link:function(t,e,n,r){var i=r[0];r[1].init(i)}}}).directive("uibYearpicker",function(){return{templateUrl:function(t,e){return e.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],restrict:"A",controller:"UibYearpickerController",link:function(t,e,n,r){var i=r[0];angular.extend(i,r[1]),i.yearpickerInit(),i.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(t,e){var n,r,i={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},o={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},a=/(HTML|BODY)/;return{getRawNode:function(t){return t.nodeName?t:t[0]||t},parseStyle:function(t){return t=parseFloat(t),isFinite(t)?t:0},offsetParent:function(n){var r,i=(n=this.getRawNode(n)).offsetParent||t[0].documentElement;for(;i&&i!==t[0].documentElement&&(r=i,"static"===(e.getComputedStyle(r).position||"static"));)i=i.offsetParent;return i||t[0].documentElement},scrollbarWidth:function(i){if(i){if(angular.isUndefined(r)){var o=t.find("body");o.addClass("uib-position-body-scrollbar-measure"),r=e.innerWidth-o[0].clientWidth,r=isFinite(r)?r:0,o.removeClass("uib-position-body-scrollbar-measure")}return r}if(angular.isUndefined(n)){var a=angular.element('<div class="uib-position-scrollbar-measure"></div>');t.find("body").append(a),n=a[0].offsetWidth-a[0].clientWidth,n=isFinite(n)?n:0,a.remove()}return n},scrollbarPadding:function(t){t=this.getRawNode(t);var n=e.getComputedStyle(t),r=this.parseStyle(n.paddingRight),i=this.parseStyle(n.paddingBottom),o=this.scrollParent(t,!1,!0),s=this.scrollbarWidth(a.test(o.tagName));return{scrollbarWidth:s,widthOverflow:o.scrollWidth>o.clientWidth,right:r+s,originalRight:r,heightOverflow:o.scrollHeight>o.clientHeight,bottom:i+s,originalBottom:i}},isScrollable:function(t,n){t=this.getRawNode(t);var r=n?i.hidden:i.normal,o=e.getComputedStyle(t);return r.test(o.overflow+o.overflowY+o.overflowX)},scrollParent:function(n,r,o){n=this.getRawNode(n);var a=r?i.hidden:i.normal,s=t[0].documentElement,u=e.getComputedStyle(n);if(o&&a.test(u.overflow+u.overflowY+u.overflowX))return n;var l="absolute"===u.position,c=n.parentElement||s;if(c===s||"fixed"===u.position)return s;for(;c.parentElement&&c!==s;){var p=e.getComputedStyle(c);if(l&&"static"!==p.position&&(l=!1),!l&&a.test(p.overflow+p.overflowY+p.overflowX))break;c=c.parentElement}return c},position:function(n,r){n=this.getRawNode(n);var i=this.offset(n);if(r){var o=e.getComputedStyle(n);i.top-=this.parseStyle(o.marginTop),i.left-=this.parseStyle(o.marginLeft)}var a=this.offsetParent(n),s={top:0,left:0};return a!==t[0].documentElement&&((s=this.offset(a)).top+=a.clientTop-a.scrollTop,s.left+=a.clientLeft-a.scrollLeft),{width:Math.round(angular.isNumber(i.width)?i.width:n.offsetWidth),height:Math.round(angular.isNumber(i.height)?i.height:n.offsetHeight),top:Math.round(i.top-s.top),left:Math.round(i.left-s.left)}},offset:function(n){var r=(n=this.getRawNode(n)).getBoundingClientRect();return{width:Math.round(angular.isNumber(r.width)?r.width:n.offsetWidth),height:Math.round(angular.isNumber(r.height)?r.height:n.offsetHeight),top:Math.round(r.top+(e.pageYOffset||t[0].documentElement.scrollTop)),left:Math.round(r.left+(e.pageXOffset||t[0].documentElement.scrollLeft))}},viewportOffset:function(n,r,i){i=!1!==i;var o=(n=this.getRawNode(n)).getBoundingClientRect(),a={top:0,left:0,bottom:0,right:0},s=r?t[0].documentElement:this.scrollParent(n),u=s.getBoundingClientRect();if(a.top=u.top+s.clientTop,a.left=u.left+s.clientLeft,s===t[0].documentElement&&(a.top+=e.pageYOffset,a.left+=e.pageXOffset),a.bottom=a.top+s.clientHeight,a.right=a.left+s.clientWidth,i){var l=e.getComputedStyle(s);a.top+=this.parseStyle(l.paddingTop),a.bottom-=this.parseStyle(l.paddingBottom),a.left+=this.parseStyle(l.paddingLeft),a.right-=this.parseStyle(l.paddingRight)}return{top:Math.round(o.top-a.top),bottom:Math.round(a.bottom-o.bottom),left:Math.round(o.left-a.left),right:Math.round(a.right-o.right)}},parsePlacement:function(t){var e=o.auto.test(t);return e&&(t=t.replace(o.auto,"")),(t=t.split("-"))[0]=t[0]||"top",o.primary.test(t[0])||(t[0]="top"),t[1]=t[1]||"center",o.secondary.test(t[1])||(t[1]="center"),t[2]=!!e,t},positionElements:function(t,n,r,i){t=this.getRawNode(t),n=this.getRawNode(n);var a=angular.isDefined(n.offsetWidth)?n.offsetWidth:n.prop("offsetWidth"),s=angular.isDefined(n.offsetHeight)?n.offsetHeight:n.prop("offsetHeight");r=this.parsePlacement(r);var u=i?this.offset(t):this.position(t),l={top:0,left:0,placement:""};if(r[2]){var c=this.viewportOffset(t,i),p=e.getComputedStyle(n),d=a+Math.round(Math.abs(this.parseStyle(p.marginLeft)+this.parseStyle(p.marginRight))),f=s+Math.round(Math.abs(this.parseStyle(p.marginTop)+this.parseStyle(p.marginBottom)));if(r[0]="top"===r[0]&&f>c.top&&f<=c.bottom?"bottom":"bottom"===r[0]&&f>c.bottom&&f<=c.top?"top":"left"===r[0]&&d>c.left&&d<=c.right?"right":"right"===r[0]&&d>c.right&&d<=c.left?"left":r[0],r[1]="top"===r[1]&&f-u.height>c.bottom&&f-u.height<=c.top?"bottom":"bottom"===r[1]&&f-u.height>c.top&&f-u.height<=c.bottom?"top":"left"===r[1]&&d-u.width>c.right&&d-u.width<=c.left?"right":"right"===r[1]&&d-u.width>c.left&&d-u.width<=c.right?"left":r[1],"center"===r[1])if(o.vertical.test(r[0])){var h=u.width/2-a/2;c.left+h<0&&d-u.width<=c.right?r[1]="left":c.right+h<0&&d-u.width<=c.left&&(r[1]="right")}else{var g=u.height/2-f/2;c.top+g<0&&f-u.height<=c.bottom?r[1]="top":c.bottom+g<0&&f-u.height<=c.top&&(r[1]="bottom")}}switch(r[0]){case"top":l.top=u.top-s;break;case"bottom":l.top=u.top+u.height;break;case"left":l.left=u.left-a;break;case"right":l.left=u.left+u.width}switch(r[1]){case"top":l.top=u.top;break;case"bottom":l.top=u.top+u.height-s;break;case"left":l.left=u.left;break;case"right":l.left=u.left+u.width-a;break;case"center":o.vertical.test(r[0])?l.left=u.left+u.width/2-a/2:l.top=u.top+u.height/2-s/2}return l.top=Math.round(l.top),l.left=Math.round(l.left),l.placement="center"===r[1]?r[0]:r[0]+"-"+r[1],l},adjustTop:function(t,e,n,r){if(-1!==t.indexOf("top")&&n!==r)return{top:e.top-r+"px"}},positionArrow:function(t,n){var r=(t=this.getRawNode(t)).querySelector(".tooltip-inner, .popover-inner");if(r){var i=angular.element(r).hasClass("tooltip-inner"),a=i?t.querySelector(".tooltip-arrow"):t.querySelector(".arrow");if(a){var s={top:"",bottom:"",left:"",right:""};if("center"!==(n=this.parsePlacement(n))[1]){var u="border-"+n[0]+"-width",l=e.getComputedStyle(a)[u],c="border-";o.vertical.test(n[0])?c+=n[0]+"-"+n[1]:c+=n[1]+"-"+n[0],c+="-radius";var p=e.getComputedStyle(i?r:t)[c];switch(n[0]){case"top":s.bottom=i?"0":"-"+l;break;case"bottom":s.top=i?"0":"-"+l;break;case"left":s.right=i?"0":"-"+l;break;case"right":s.left=i?"0":"-"+l}s[n[1]]=p,angular.element(a).css(s)}else angular.element(a).css(s)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(t,e,n,r,i,o,a,s,u,l,c,p,d,f,h,g){var m,v,y,b,w,$,k,C,x,T,S,E,D,A=!1,B=[];function I(e){var n=p.parse(e,m,t.date);if(isNaN(n))for(var r=0;r<D.length;r++)if(n=p.parse(e,D[r],t.date),!isNaN(n))return n;return n}function O(t){if(angular.isNumber(t)&&(t=new Date(t)),!t)return null;if(angular.isDate(t)&&!isNaN(t))return t;if(angular.isString(t)){var e=I(t);if(!isNaN(e))return p.toTimezone(e,S.getOption("timezone"))}return S.getOption("allowInvalid")?t:void 0}function M(t,e){var r=t||e;return!n.ngRequired&&!r||(angular.isNumber(r)&&(r=new Date(r)),!r||(!(!angular.isDate(r)||isNaN(r))||!!angular.isString(r)&&!isNaN(I(r))))}function P(n){if(t.isOpen||!t.disabled){var r=E[0],i=e[0].contains(n.target),o=void 0!==r.contains&&r.contains(n.target);!t.isOpen||i||o||t.$apply(function(){t.isOpen=!1})}}function _(n){27===n.which&&t.isOpen?(n.preventDefault(),n.stopPropagation(),t.$apply(function(){t.isOpen=!1}),e[0].focus()):40!==n.which||t.isOpen||(n.preventDefault(),n.stopPropagation(),t.$apply(function(){t.isOpen=!0}))}function R(){if(t.isOpen){var r=angular.element(E[0].querySelector(".uib-datepicker-popup")),i=n.popupPlacement?n.popupPlacement:d.placement,o=l.positionElements(e,r,i,y);r.css({top:o.top+"px",left:o.left+"px"}),r.hasClass("uib-position-measure")&&r.removeClass("uib-position-measure")}}this.init=function(i){if(S=function(t){var e;angular.version.minor<6?(e=angular.isObject(t.$options)?t.$options:{timezone:null}).getOption=function(t){return e[t]}:e=t.$options;return e}(T=i),v=angular.isDefined(n.closeOnDateSelection)?t.$parent.$eval(n.closeOnDateSelection):d.closeOnDateSelection,y=angular.isDefined(n.datepickerAppendToBody)?t.$parent.$eval(n.datepickerAppendToBody):d.appendToBody,b=angular.isDefined(n.onOpenFocus)?t.$parent.$eval(n.onOpenFocus):d.onOpenFocus,w=angular.isDefined(n.datepickerPopupTemplateUrl)?n.datepickerPopupTemplateUrl:d.datepickerPopupTemplateUrl,$=angular.isDefined(n.datepickerTemplateUrl)?n.datepickerTemplateUrl:d.datepickerTemplateUrl,D=angular.isDefined(n.altInputFormats)?t.$parent.$eval(n.altInputFormats):d.altInputFormats,t.showButtonBar=angular.isDefined(n.showButtonBar)?t.$parent.$eval(n.showButtonBar):d.showButtonBar,d.html5Types[n.type]?(m=d.html5Types[n.type],A=!0):(m=n.uibDatepickerPopup||d.datepickerPopup,n.$observe("uibDatepickerPopup",function(t,e){var n=t||d.datepickerPopup;if(n!==m&&(m=n,T.$modelValue=null,!m))throw new Error("uibDatepickerPopup must have a date format specified.")})),!m)throw new Error("uibDatepickerPopup must have a date format specified.");if(A&&n.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");(k=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>")).attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":w}),(C=angular.element(k.children()[0])).attr("template-url",$),t.datepickerOptions||(t.datepickerOptions={}),A&&"month"===n.type&&(t.datepickerOptions.datepickerMode="month",t.datepickerOptions.minMode="month"),C.attr("datepicker-options","datepickerOptions"),A?T.$formatters.push(function(e){return t.date=p.fromTimezone(e,S.getOption("timezone")),e}):(T.$$parserName="date",T.$validators.date=M,T.$parsers.unshift(O),T.$formatters.push(function(e){return T.$isEmpty(e)?(t.date=e,e):(angular.isNumber(e)&&(e=new Date(e)),t.date=p.fromTimezone(e,S.getOption("timezone")),p.filter(t.date,m))})),T.$viewChangeListeners.push(function(){t.date=I(T.$viewValue)}),e.on("keydown",_),E=r(k)(t),k.remove(),y?s.find("body").append(E):e.after(E),t.$on("$destroy",function(){for(!0===t.isOpen&&(u.$$phase||t.$apply(function(){t.isOpen=!1})),E.remove(),e.off("keydown",_),s.off("click",P),x&&x.off("scroll",R),angular.element(a).off("resize",R);B.length;)B.shift()()})},t.getText=function(e){return t[e+"Text"]||d[e+"Text"]},t.isDisabled=function(e){"today"===e&&(e=p.fromTimezone(new Date,S.getOption("timezone")));var n={};return angular.forEach(["minDate","maxDate"],function(e){t.datepickerOptions[e]?angular.isDate(t.datepickerOptions[e])?n[e]=new Date(t.datepickerOptions[e]):(g&&i.warn("Literal date support has been deprecated, please switch to date object usage"),n[e]=new Date(c(t.datepickerOptions[e],"medium"))):n[e]=null}),t.datepickerOptions&&n.minDate&&t.compare(e,n.minDate)<0||n.maxDate&&t.compare(e,n.maxDate)>0},t.compare=function(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate())-new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.dateSelection=function(n){t.date=n;var r=t.date?p.filter(t.date,m):null;e.val(r),T.$setViewValue(r),v&&(t.isOpen=!1,e[0].focus())},t.keydown=function(n){27===n.which&&(n.stopPropagation(),t.isOpen=!1,e[0].focus())},t.select=function(e,n){if(n.stopPropagation(),"today"===e){var r=new Date;angular.isDate(t.date)?(e=new Date(t.date)).setFullYear(r.getFullYear(),r.getMonth(),r.getDate()):(e=p.fromTimezone(r,S.getOption("timezone"))).setHours(0,0,0,0)}t.dateSelection(e)},t.close=function(n){n.stopPropagation(),t.isOpen=!1,e[0].focus()},t.disabled=angular.isDefined(n.disabled)||!1,n.ngDisabled&&B.push(t.$parent.$watch(o(n.ngDisabled),function(e){t.disabled=e})),t.$watch("isOpen",function(r){r?t.disabled?t.isOpen=!1:f(function(){R(),b&&t.$broadcast("uib:datepicker.focus"),s.on("click",P);var r=n.popupPlacement?n.popupPlacement:d.placement;y||l.parsePlacement(r)[2]?(x=x||angular.element(l.scrollParent(e)))&&x.on("scroll",R):x=null,angular.element(a).on("resize",R)},0,!1):(s.off("click",P),x&&x.off("scroll",R),angular.element(a).off("resize",R))}),t.$on("uib:datepicker.mode",function(){f(R,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(t,e,n,r){var i=r[0];r[1].init(i)}}}).directive("uibDatepickerPopupWrap",function(){return{restrict:"A",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(t){return function(e,n){var r;return function(){var i=this,o=Array.prototype.slice.call(arguments);r&&t.cancel(r),r=t(function(){e.apply(i,o)},n)}}}]),angular.module("ui.bootstrap.multiMap",[]).factory("$$multiMap",function(){return{createNew:function(){var t={};return{entries:function(){return Object.keys(t).map(function(e){return{key:e,value:t[e]}})},get:function(e){return t[e]},hasKey:function(e){return!!t[e]},keys:function(){return Object.keys(t)},put:function(e,n){t[e]||(t[e]=[]),t[e].push(n)},remove:function(e,n){var r=t[e];if(r){var i=r.indexOf(n);-1!==i&&r.splice(i,1),r.length||delete t[e]}}}}}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.multiMap","ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope","$$multiMap",function(t,e,n){var r=null,i=n.createNew();this.isOnlyOpen=function(t,e){var n=i.get(e);if(n&&n.reduce(function(e,n){return n.scope===t?n:e},{}))return 1===n.length;return!1},this.open=function(e,n,a){if(r||t.on("click",o),r&&r!==e&&(r.isOpen=!1),r=e,a){var s=i.get(a);if(s)-1===s.map(function(t){return t.scope}).indexOf(e)&&i.put(a,{scope:e});else i.put(a,{scope:e})}},this.close=function(e,n,a){if(r===e&&(t.off("click",o),t.off("keydown",this.keybindFilter),r=null),a){var s=i.get(a);if(s){var u=s.reduce(function(t,n){return n.scope===e?n:t},{});u&&i.remove(a,u)}}};var o=function(t){if(r&&r.isOpen&&!(t&&"disabled"===r.getAutoClose()||t&&3===t.which)){var n=r.getToggleElement();if(!(t&&n&&n[0].contains(t.target))){var i=r.getDropdownElement();t&&"outsideClick"===r.getAutoClose()&&i&&i[0].contains(t.target)||(r.focusToggleElement(),r.isOpen=!1,e.$$phase||r.$apply())}}};this.keybindFilter=function(t){if(r){var e=r.getDropdownElement(),n=r.getToggleElement(),i=e&&e[0].contains(t.target),a=n&&n[0].contains(t.target);27===t.which?(t.stopPropagation(),r.focusToggleElement(),o()):r.isKeynavEnabled()&&-1!==[38,40].indexOf(t.which)&&r.isOpen&&(i||a)&&(t.preventDefault(),t.stopPropagation(),r.focusDropdownEntry(t.which))}}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(t,e,n,r,i,o,a,s,u,l,c){var p,d,f=this,h=t.$new(),g=i.appendToOpenClass,m=i.openClass,v=angular.noop,y=n.onToggle?r(n.onToggle):angular.noop,b=!1,w=u.find("body");function $(){e.append(f.dropdownMenu)}e.addClass("dropdown"),this.init=function(){n.isOpen&&(d=r(n.isOpen),v=d.assign,t.$watch(d,function(t){h.isOpen=!!t})),b=angular.isDefined(n.keyboardNav)},this.toggle=function(t){return h.isOpen=arguments.length?!!t:!h.isOpen,angular.isFunction(v)&&v(h,h.isOpen),h.isOpen},this.isOpen=function(){return h.isOpen},h.getToggleElement=function(){return f.toggleElement},h.getAutoClose=function(){return n.autoClose||"always"},h.getElement=function(){return e},h.isKeynavEnabled=function(){return b},h.focusDropdownEntry=function(t){var n=f.dropdownMenu?angular.element(f.dropdownMenu).find("a"):e.find("ul").eq(0).find("a");switch(t){case 40:angular.isNumber(f.selectedOption)?f.selectedOption=f.selectedOption===n.length-1?f.selectedOption:f.selectedOption+1:f.selectedOption=0;break;case 38:angular.isNumber(f.selectedOption)?f.selectedOption=0===f.selectedOption?0:f.selectedOption-1:f.selectedOption=n.length-1}n[f.selectedOption].focus()},h.getDropdownElement=function(){return f.dropdownMenu},h.focusToggleElement=function(){f.toggleElement&&f.toggleElement[0].focus()},h.$watch("isOpen",function(i,d){var b=null,k=!1;if(angular.isDefined(n.dropdownAppendTo)){var C=r(n.dropdownAppendTo)(h);C&&(b=angular.element(C))}angular.isDefined(n.dropdownAppendToBody)&&(!1!==r(n.dropdownAppendToBody)(h)&&(k=!0));if(k&&!b&&(b=w),b&&f.dropdownMenu&&(i?(b.append(f.dropdownMenu),e.on("$destroy",$)):(e.off("$destroy",$),$())),b&&f.dropdownMenu){var x,T,S,E=s.positionElements(e,f.dropdownMenu,"bottom-left",!0),D=0;if(x={top:E.top+"px",display:i?"block":"none"},(T=f.dropdownMenu.hasClass("dropdown-menu-right"))?(x.left="auto",(S=s.scrollbarPadding(b)).heightOverflow&&S.scrollbarWidth&&(D=S.scrollbarWidth),x.right=window.innerWidth-D-(E.left+e.prop("offsetWidth"))+"px"):(x.left=E.left+"px",x.right="auto"),!k){var A=s.offset(b);x.top=E.top-A.top+"px",T?x.right=window.innerWidth-(E.left-A.left+e.prop("offsetWidth"))+"px":x.left=E.left-A.left+"px"}f.dropdownMenu.css(x)}var B=b||e,I=b?g:m,O=B.hasClass(I),M=o.isOnlyOpen(t,b);O===!i&&a[b?M?"removeClass":"addClass":i?"addClass":"removeClass"](B,I).then(function(){angular.isDefined(i)&&i!==d&&y(t,{open:!!i})});if(i)f.dropdownMenuTemplateUrl?c(f.dropdownMenuTemplateUrl).then(function(t){p=h.$new(),l(t.trim())(p,function(t){var e=t;f.dropdownMenu.replaceWith(e),f.dropdownMenu=e,u.on("keydown",o.keybindFilter)})}):u.on("keydown",o.keybindFilter),h.focusToggleElement(),o.open(h,e,b);else{if(o.close(h,e,b),f.dropdownMenuTemplateUrl){p&&p.$destroy();var P=angular.element('<ul class="dropdown-menu"></ul>');f.dropdownMenu.replaceWith(P),f.dropdownMenu=P}f.selectedOption=null}angular.isFunction(v)&&v(t,i)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(t,e,n,r){r.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(t,e,n,r){if(r&&!angular.isDefined(n.dropdownNested)){e.addClass("dropdown-menu");var i=n.templateUrl;i&&(r.dropdownMenuTemplateUrl=i),r.dropdownMenu||(r.dropdownMenu=e)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(t,e,n,r){if(r){e.addClass("dropdown-toggle"),r.toggleElement=e;var i=function(i){i.preventDefault(),e.hasClass("disabled")||n.disabled||t.$apply(function(){r.toggle()})};e.on("click",i),e.attr({"aria-haspopup":!0,"aria-expanded":!1}),t.$watch(r.isOpen,function(t){e.attr("aria-expanded",!!t)}),t.$on("$destroy",function(){e.off("click",i)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var t=[];return{add:function(e,n){t.push({key:e,value:n})},get:function(e){for(var n=0;n<t.length;n++)if(e===t[n].key)return t[n]},keys:function(){for(var e=[],n=0;n<t.length;n++)e.push(t[n].key);return e},top:function(){return t[t.length-1]},remove:function(e){for(var n=-1,r=0;r<t.length;r++)if(e===t[r].key){n=r;break}return t.splice(n,1)[0]},removeTop:function(){return t.pop()},length:function(){return t.length}}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.multiMap","ui.bootstrap.stackedMap","ui.bootstrap.position"]).provider("$uibResolve",function(){var t=this;this.resolver=null,this.setResolver=function(t){this.resolver=t},this.$get=["$injector","$q",function(e,n){var r=t.resolver?e.get(t.resolver):null;return{resolve:function(t,i,o,a){if(r)return r.resolve(t,i,o,a);var s=[];return angular.forEach(t,function(t){angular.isFunction(t)||angular.isArray(t)?s.push(n.resolve(e.invoke(t))):angular.isString(t)?s.push(n.resolve(e.get(t))):s.push(n.resolve(t))}),n.all(s).then(function(e){var n={},r=0;return angular.forEach(t,function(t,i){n[i]=e[r++]}),n})}}}]}).directive("uibModalBackdrop",["$animate","$injector","$uibModalStack",function(t,e,n){return{restrict:"A",compile:function(t,e){return t.addClass(e.backdropClass),r}};function r(e,r,i){i.modalInClass&&(t.addClass(r,i.modalInClass),e.$on(n.NOW_CLOSING_EVENT,function(n,o){var a=o();e.modalOptions.animation?t.removeClass(r,i.modalInClass).then(a):a()}))}}]).directive("uibModalWindow",["$uibModalStack","$q","$animateCss","$document",function(t,e,n,r){return{scope:{index:"@"},restrict:"A",transclude:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/modal/window.html"},link:function(i,o,a){o.addClass(a.windowTopClass||""),i.size=a.size,i.close=function(e){var n=t.getTop();n&&n.value.backdrop&&"static"!==n.value.backdrop&&e.target===e.currentTarget&&(e.preventDefault(),e.stopPropagation(),t.dismiss(n.key,"backdrop click"))},o.on("click",i.close),i.$isRendered=!0;var s=e.defer();i.$$postDigest(function(){s.resolve()}),s.promise.then(function(){var s=null;a.modalInClass&&(s=n(o,{addClass:a.modalInClass}).start(),i.$on(t.NOW_CLOSING_EVENT,function(t,e){var r=e();n(o,{removeClass:a.modalInClass}).start().then(r)})),e.when(s).then(function(){var e=t.getTop();if(e&&t.modalRendered(e.key),!r[0].activeElement||!o[0].contains(r[0].activeElement)){var n=o[0].querySelector("[autofocus]");n?n.focus():o[0].focus()}})})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(t,e){e.modalAnimation&&t.addClass(e.uibModalAnimationClass)}}}).directive("uibModalTransclude",["$animate",function(t){return{link:function(e,n,r,i,o){o(e.$parent,function(e){n.empty(),t.enter(e,n)})}}}]).factory("$uibModalStack",["$animate","$animateCss","$document","$compile","$rootScope","$q","$$multiMap","$$stackedMap","$uibPosition",function(t,e,n,r,i,o,a,s,u){var l,c,p,d="modal-open",f=s.createNew(),h=a.createNew(),g={NOW_CLOSING_EVENT:"modal.stack.now-closing"},m=0,v=null,y="data-bootstrap-modal-aria-hidden-count",b=/[A-Z]/g;function w(){for(var t=-1,e=f.keys(),n=0;n<e.length;n++)f.get(e[n]).value.backdrop&&(t=n);return t>-1&&t<m&&(t=m),t}function $(t,e){var n=f.get(t).value,r=n.appendTo;f.remove(t),(v=f.top())&&(m=parseInt(v.value.modalDomEl.attr("index"),10)),C(n.modalDomEl,n.modalScope,function(){var e=n.openedClass||d;h.remove(e,t);var i=h.hasKey(e);r.toggleClass(e,i),!i&&p&&p.heightOverflow&&p.scrollbarWidth&&(p.originalRight?r.css({paddingRight:p.originalRight+"px"}):r.css({paddingRight:""}),p=null),k(!0)},n.closedDeferred),function(){if(l&&-1===w()){C(l,c,function(){null}),l=void 0,c=void 0}}(),e&&e.focus?e.focus():r.focus&&r.focus()}function k(t){var e;f.length()>0&&(e=f.top().value).modalDomEl.toggleClass(e.windowTopClass||"",t)}function C(e,n,r,i){var a,s=null;return n.$broadcast(g.NOW_CLOSING_EVENT,function(){return a||(a=o.defer(),s=a.promise),function(){a.resolve()}}),o.when(s).then(function o(){if(o.done)return;o.done=!0;t.leave(e).then(function(){r&&r(),e.remove(),i&&i.resolve()});n.$destroy()})}function x(t){if(t.isDefaultPrevented())return t;var e=f.top();if(e)switch(t.which){case 27:e.value.keyboard&&(t.preventDefault(),i.$apply(function(){g.dismiss(e.key,"escape key press")}));break;case 9:var n=g.loadFocusElementList(e),r=!1;t.shiftKey?(g.isFocusInFirstItem(t,n)||g.isModalFocused(t,e))&&(r=g.focusLastFocusableElement(n)):g.isFocusInLastItem(t,n)&&(r=g.focusFirstFocusableElement(n)),r&&(t.preventDefault(),t.stopPropagation())}}function T(t,e,n){return!t.value.modalScope.$broadcast("modal.closing",e,n).defaultPrevented}function S(){Array.prototype.forEach.call(document.querySelectorAll("["+y+"]"),function(t){var e=parseInt(t.getAttribute(y),10)-1;t.setAttribute(y,e),e||(t.removeAttribute(y),t.removeAttribute("aria-hidden"))})}return i.$watch(w,function(t){c&&(c.index=t)}),n.on("keydown",x),i.$on("$destroy",function(){n.off("keydown",x)}),g.open=function(e,o){var a=n[0].activeElement,s=o.openedClass||d;k(!1),v=f.top(),f.add(e,{deferred:o.deferred,renderDeferred:o.renderDeferred,closedDeferred:o.closedDeferred,modalScope:o.scope,backdrop:o.backdrop,keyboard:o.keyboard,openedClass:o.openedClass,windowTopClass:o.windowTopClass,animation:o.animation,appendTo:o.appendTo}),h.put(s,e);var g,$=o.appendTo,C=w();C>=0&&!l&&((c=i.$new(!0)).modalOptions=o,c.index=C,(l=angular.element('<div uib-modal-backdrop="modal-backdrop"></div>')).attr({class:"modal-backdrop","ng-style":"{'z-index': 1040 + (index && 1 || 0) + index*10}","uib-modal-animation-class":"fade","modal-in-class":"in"}),o.backdropClass&&l.addClass(o.backdropClass),o.animation&&l.attr("modal-animation","true"),r(l)(c),t.enter(l,$),u.isScrollable($)&&(p=u.scrollbarPadding($)).heightOverflow&&p.scrollbarWidth&&$.css({paddingRight:p.right+"px"})),o.component?(g=document.createElement(o.component.name.replace(b,function(t,e){return(e?"-":"")+t.toLowerCase()})),(g=angular.element(g)).attr({resolve:"$resolve","modal-instance":"$uibModalInstance",close:"$close($value)",dismiss:"$dismiss($value)"})):g=o.content,m=v?parseInt(v.value.modalDomEl.attr("index"),10)+1:0;var x=angular.element('<div uib-modal-window="modal-window"></div>');x.attr({class:"modal","template-url":o.windowTemplateUrl,"window-top-class":o.windowTopClass,role:"dialog","aria-labelledby":o.ariaLabelledBy,"aria-describedby":o.ariaDescribedBy,size:o.size,index:m,animate:"animate","ng-style":"{'z-index': 1050 + $$topModalIndex*10, display: 'block'}",tabindex:-1,"uib-modal-animation-class":"fade","modal-in-class":"in"}).append(g),o.windowClass&&x.addClass(o.windowClass),o.animation&&x.attr("modal-animation","true"),$.addClass(s),o.scope&&(o.scope.$$topModalIndex=m),t.enter(r(x)(o.scope),$),f.top().value.modalDomEl=x,f.top().value.modalOpener=a,function t(e){if(!e||"BODY"===e[0].tagName)return;(n=e,r=n.parent()?n.parent().children():[],Array.prototype.filter.call(r,function(t){return t!==n[0]})).forEach(function(t){var e="true"===t.getAttribute("aria-hidden"),n=parseInt(t.getAttribute(y),10);n||(n=e?1:0),t.setAttribute(y,n+1),t.setAttribute("aria-hidden","true")});var n,r;return t(e.parent())}(x)},g.close=function(t,e){var n=f.get(t);return S(),n&&T(n,e,!0)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.resolve(e),$(t,n.value.modalOpener),!0):!n},g.dismiss=function(t,e){var n=f.get(t);return S(),n&&T(n,e,!1)?(n.value.modalScope.$$uibDestructionScheduled=!0,n.value.deferred.reject(e),$(t,n.value.modalOpener),!0):!n},g.dismissAll=function(t){for(var e=this.getTop();e&&this.dismiss(e.key,t);)e=this.getTop()},g.getTop=function(){return f.top()},g.modalRendered=function(t){var e=f.get(t);e&&e.value.renderDeferred.resolve()},g.focusFirstFocusableElement=function(t){return t.length>0&&(t[0].focus(),!0)},g.focusLastFocusableElement=function(t){return t.length>0&&(t[t.length-1].focus(),!0)},g.isModalFocused=function(t,e){if(t&&e){var n=e.value.modalDomEl;if(n&&n.length)return(t.target||t.srcElement)===n[0]}return!1},g.isFocusInFirstItem=function(t,e){return e.length>0&&(t.target||t.srcElement)===e[0]},g.isFocusInLastItem=function(t,e){return e.length>0&&(t.target||t.srcElement)===e[e.length-1]},g.loadFocusElementList=function(t){if(t){var e=t.value.modalDomEl;if(e&&e.length){var n=e[0].querySelectorAll("a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]");return n?Array.prototype.filter.call(n,function(t){return!!((e=t).offsetWidth||e.offsetHeight||e.getClientRects().length);var e}):n}}},g}]).provider("$uibModal",function(){var t={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(e,n,r,i,o,a,s){var u={};var l=null;return u.getPromiseChain=function(){return l},u.open=function(u){var c,p,d,f=n.defer(),h=n.defer(),g=n.defer(),m=n.defer(),v={result:f.promise,opened:h.promise,closed:g.promise,rendered:m.promise,close:function(t){return s.close(v,t)},dismiss:function(t){return s.dismiss(v,t)}};if((u=angular.extend({},t.options,u)).resolve=u.resolve||{},u.appendTo=u.appendTo||r.find("body").eq(0),!u.appendTo.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");if(!u.component&&!u.template&&!u.templateUrl)throw new Error("One of component or template or templateUrl options is required.");function y(){return c}return c=u.component?n.when(a.resolve(u.resolve,{},null,null)):n.all([(p=u,p.template?n.when(p.template):i(angular.isFunction(p.templateUrl)?p.templateUrl():p.templateUrl)),a.resolve(u.resolve,{},null,null)]),d=l=n.all([l]).then(y,y).then(function(t){var n=u.scope||e,r=n.$new();r.$close=v.close,r.$dismiss=v.dismiss,r.$on("$destroy",function(){r.$$uibDestructionScheduled||r.$dismiss("$uibUnscheduledDestruction")});var i,a,l={scope:r,deferred:f,renderDeferred:m,closedDeferred:g,animation:u.animation,backdrop:u.backdrop,keyboard:u.keyboard,backdropClass:u.backdropClass,windowTopClass:u.windowTopClass,windowClass:u.windowClass,windowTemplateUrl:u.windowTemplateUrl,ariaLabelledBy:u.ariaLabelledBy,ariaDescribedBy:u.ariaDescribedBy,size:u.size,openedClass:u.openedClass,appendTo:u.appendTo},c={},p={};function d(e,n,i,o){e.$scope=r,e.$scope.$resolve={},i?e.$scope.$uibModalInstance=v:e.$uibModalInstance=v;var a=n?t[1]:t;angular.forEach(a,function(t,n){o&&(e[n]=t),e.$scope.$resolve[n]=t})}u.component?(d(c,!1,!0,!1),c.name=u.component,l.component=c):u.controller&&(d(p,!0,!1,!0),a=o(u.controller,p,!0,u.controllerAs),u.controllerAs&&u.bindToController&&((i=a.instance).$close=r.$close,i.$dismiss=r.$dismiss,angular.extend(i,{$resolve:p.$scope.$resolve},n)),i=a(),angular.isFunction(i.$onInit)&&i.$onInit()),u.component||(l.content=t[0]),s.open(v,l),h.resolve(!0)},function(t){h.reject(t),f.reject(t)}).finally(function(){l===d&&(l=null)}),v},u}]};return t}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(t){return{create:function(e,n,r){e.setNumPages=r.numPages?t(r.numPages).assign:angular.noop,e.ngModelCtrl={$setViewValue:angular.noop},e._watchers=[],e.init=function(t,i){e.ngModelCtrl=t,e.config=i,t.$render=function(){e.render()},r.itemsPerPage?e._watchers.push(n.$parent.$watch(r.itemsPerPage,function(t){e.itemsPerPage=parseInt(t,10),n.totalPages=e.calculateTotalPages(),e.updatePage()})):e.itemsPerPage=i.itemsPerPage,n.$watch("totalItems",function(t,r){(angular.isDefined(t)||t!==r)&&(n.totalPages=e.calculateTotalPages(),e.updatePage())})},e.calculateTotalPages=function(){var t=e.itemsPerPage<1?1:Math.ceil(n.totalItems/e.itemsPerPage);return Math.max(t||0,1)},e.render=function(){n.page=parseInt(e.ngModelCtrl.$viewValue,10)||1},n.selectPage=function(t,r){r&&r.preventDefault(),(!n.ngDisabled||!r)&&n.page!==t&&t>0&&t<=n.totalPages&&(r&&r.target&&r.target.blur(),e.ngModelCtrl.$setViewValue(t),e.ngModelCtrl.$render())},n.getText=function(t){return n[t+"Text"]||e.config[t+"Text"]},n.noPrevious=function(){return 1===n.page},n.noNext=function(){return n.page===n.totalPages},e.updatePage=function(){e.setNumPages(n.$parent,n.totalPages),n.page>n.totalPages?n.selectPage(n.totalPages):e.ngModelCtrl.$render()},n.$on("$destroy",function(){for(;e._watchers.length;)e._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(t,e,n,r){t.align=angular.isDefined(e.align)?t.$parent.$eval(e.align):r.align,n.create(this,t,e)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(t){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],restrict:"A",controller:"UibPagerController",controllerAs:"pager",templateUrl:function(t,e){return e.templateUrl||"uib/template/pager/pager.html"},link:function(e,n,r,i){n.addClass("pager");var o=i[0],a=i[1];a&&o.init(a,t)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(t,e,n,r,i){var o=this,a=angular.isDefined(e.maxSize)?t.$parent.$eval(e.maxSize):i.maxSize,s=angular.isDefined(e.rotate)?t.$parent.$eval(e.rotate):i.rotate,u=angular.isDefined(e.forceEllipses)?t.$parent.$eval(e.forceEllipses):i.forceEllipses,l=angular.isDefined(e.boundaryLinkNumbers)?t.$parent.$eval(e.boundaryLinkNumbers):i.boundaryLinkNumbers,c=angular.isDefined(e.pageLabel)?function(n){return t.$parent.$eval(e.pageLabel,{$page:n})}:angular.identity;function p(t,e,n){return{number:t,text:e,active:n}}t.boundaryLinks=angular.isDefined(e.boundaryLinks)?t.$parent.$eval(e.boundaryLinks):i.boundaryLinks,t.directionLinks=angular.isDefined(e.directionLinks)?t.$parent.$eval(e.directionLinks):i.directionLinks,e.$set("role","menu"),r.create(this,t,e),e.maxSize&&o._watchers.push(t.$parent.$watch(n(e.maxSize),function(t){a=parseInt(t,10),o.render()}));var d=this.render;this.render=function(){d(),t.page>0&&t.page<=t.totalPages&&(t.pages=function(t,e){var n=[],r=1,i=e,o=angular.isDefined(a)&&a<e;o&&(s?(i=(r=Math.max(t-Math.floor(a/2),1))+a-1)>e&&(r=(i=e)-a+1):(r=(Math.ceil(t/a)-1)*a+1,i=Math.min(r+a-1,e)));for(var d=r;d<=i;d++){var f=p(d,c(d),d===t);n.push(f)}if(o&&a>0&&(!s||u||l)){if(r>1){if(!l||r>3){var h=p(r-1,"...",!1);n.unshift(h)}if(l){if(3===r){var g=p(2,"2",!1);n.unshift(g)}var m=p(1,"1",!1);n.unshift(m)}}if(i<e){if(!l||i<e-2){var v=p(i+1,"...",!1);n.push(v)}if(l){if(i===e-2){var y=p(e-1,e-1,!1);n.push(y)}var b=p(e,e,!1);n.push(b)}}}return n}(t.page,t.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(t,e){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],restrict:"A",controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(t,e){return e.templateUrl||"uib/template/pagination/pagination.html"},link:function(t,n,r,i){n.addClass("pagination");var o=i[0],a=i[1];a&&o.init(a,e)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){var t={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},e={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},n={};this.options=function(t){angular.extend(n,t)},this.setTriggers=function(t){angular.extend(e,t)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(r,i,o,a,s,u,l,c,p){var d=p.createNew();function f(t){if(27===t.which){var e=d.top();e&&(e.value.close(),e=null)}}return a.on("keyup",f),l.$on("$destroy",function(){a.off("keyup",f)}),function(r,l,p,f){function h(t){var n=(t||f.trigger||p).split(" ");return{show:n,hide:n.map(function(t){return e[t]||t})}}f=angular.extend({},t,n,f);var g=r.replace(/[A-Z]/g,function(t,e){return(e?"-":"")+t.toLowerCase()}),m=u.startSymbol(),v=u.endSymbol(),y="<div "+g+'-popup uib-title="'+m+"title"+v+'" '+(f.useContentExp?'content-exp="contentExp()" ':'content="'+m+"content"+v+'" ')+'origin-scope="origScope" class="uib-position-measure '+l+'" tooltip-animation-class="fade"uib-tooltip-classes ng-class="{ in: isOpen }" ></div>';return{compile:function(t,e){var n=i(y);return function(t,e,i,u){var p,g,m,v,y,b,w,$,k=!!angular.isDefined(f.appendToBody)&&f.appendToBody,C=h(void 0),x=angular.isDefined(i[l+"Enable"]),T=t.$new(!0),S=!1,E=!!angular.isDefined(i[l+"IsOpen"])&&c(i[l+"IsOpen"]),D=!!f.useContentExp&&c(i[r]),A=[],B=function(){p&&p.html()&&(b||(b=o(function(){var t=s.positionElements(e,p,T.placement,k),n=angular.isDefined(p.offsetHeight)?p.offsetHeight:p.prop("offsetHeight"),r=k?s.offset(e):s.position(e);p.css({top:t.top+"px",left:t.left+"px"});var i=t.placement.split("-");p.hasClass(i[0])||(p.removeClass($.split("-")[0]),p.addClass(i[0])),p.hasClass(f.placementClassPrefix+t.placement)||(p.removeClass(f.placementClassPrefix+$),p.addClass(f.placementClassPrefix+t.placement)),w=o(function(){var t=angular.isDefined(p.offsetHeight)?p.offsetHeight:p.prop("offsetHeight"),e=s.adjustTop(i,r,n,t);e&&p.css(e),w=null},0,!1),p.hasClass("uib-position-measure")?(s.positionArrow(p,t.placement),p.removeClass("uib-position-measure")):$!==t.placement&&s.positionArrow(p,t.placement),$=t.placement,b=null},0,!1)))};function I(){T.isOpen?M():O()}function O(){x&&!t.$eval(i[l+"Enable"])||(L(),function(){T.title=i[l+"Title"],T.content=D?D(t):i[r];T.popupClass=i[l+"Class"],T.placement=angular.isDefined(i[l+"Placement"])?i[l+"Placement"]:f.placement;var e=s.parsePlacement(T.placement);$=e[1]?e[0]+"-"+e[1]:e[0];var n=parseInt(i[l+"PopupDelay"],10),o=parseInt(i[l+"PopupCloseDelay"],10);T.popupDelay=isNaN(n)?f.popupDelay:n,T.popupCloseDelay=isNaN(o)?f.popupCloseDelay:o}(),T.popupDelay?v||(v=o(P,T.popupDelay,!1)):P())}function M(){_(),T.popupCloseDelay?y||(y=o(R,T.popupCloseDelay,!1)):R()}function P(){if(_(),L(),!T.content)return angular.noop;!function(){if(p)return;g=T.$new(),p=n(g,function(t){k?a.find("body").append(t):e.after(t)}),d.add(T,{close:R}),function(){A.length=0,D?(A.push(t.$watch(D,function(t){T.content=t,!t&&T.isOpen&&R()})),A.push(g.$watch(function(){S||(S=!0,g.$$postDigest(function(){S=!1,T&&T.isOpen&&B()}))}))):A.push(i.$observe(r,function(t){T.content=t,!t&&T.isOpen?R():B()}));A.push(i.$observe(l+"Title",function(t){T.title=t,T.isOpen&&B()})),A.push(i.$observe(l+"Placement",function(t){T.placement=t||f.placement,T.isOpen&&B()}))}()}(),T.$evalAsync(function(){T.isOpen=!0,U(!0),B()})}function _(){v&&(o.cancel(v),v=null),b&&(o.cancel(b),b=null)}function R(){T&&T.$evalAsync(function(){T&&(T.isOpen=!1,U(!1),T.animation?m||(m=o(N,150,!1)):N())})}function L(){y&&(o.cancel(y),y=null),m&&(o.cancel(m),m=null)}function N(){_(),L(),A.length&&(angular.forEach(A,function(t){t()}),A.length=0),p&&(p.remove(),p=null,w&&o.cancel(w)),d.remove(T),g&&(g.$destroy(),g=null)}function U(e){E&&angular.isFunction(E.assign)&&E.assign(t,e)}function j(t){T&&T.isOpen&&p&&(e[0].contains(t.target)||p[0].contains(t.target)||M())}function q(t){27===t.which&&M()}T.origScope=t,T.isOpen=!1,T.contentExp=function(){return T.content},i.$observe("disabled",function(t){t&&_(),t&&T.isOpen&&R()}),E&&t.$watch(E,function(t){T&&!t===T.isOpen&&I()});var F,V,z,H=function(){C.show.forEach(function(t){"outsideClick"===t?e.off("click",I):(e.off(t,O),e.off(t,I)),e.off("keypress",q)}),C.hide.forEach(function(t){"outsideClick"===t?a.off("click",j):e.off(t,M)})};F=[],V=[],z=t.$eval(i[l+"Trigger"]),H(),angular.isObject(z)?(Object.keys(z).forEach(function(t){F.push(t),V.push(z[t])}),C={show:F,hide:V}):C=h(z),"none"!==C.show&&C.show.forEach(function(t,n){"outsideClick"===t?(e.on("click",I),a.on("click",j)):t===C.hide[n]?e.on(t,I):t&&(e.on(t,O),e.on(C.hide[n],M)),e.on("keypress",q)});var K,W=t.$eval(i[l+"Animation"]);T.animation=angular.isDefined(W)?!!W:f.animation;var G=l+"AppendToBody";K=G in i&&void 0===i[G]||t.$eval(i[G]),k=angular.isDefined(K)?K:k,t.$on("$destroy",function(){H(),N(),T=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(t,e,n,r){return{link:function(i,o,a){var s,u,l,c=i.$eval(a.tooltipTemplateTranscludeScope),p=0,d=function(){u&&(u.remove(),u=null),s&&(s.$destroy(),s=null),l&&(t.leave(l).then(function(){u=null}),u=l,l=null)};i.$watch(e.parseAsResourceUrl(a.uibTooltipTemplateTransclude),function(e){var a=++p;e?(r(e,!0).then(function(r){if(a===p){var i=c.$new(),u=n(r)(i,function(e){d(),t.enter(e,o)});l=u,(s=i).$emit("$includeContentLoaded",e)}},function(){a===p&&(d(),i.$emit("$includeContentError",e))}),i.$emit("$includeContentRequested",e)):d()}),i.$on("$destroy",d)}}}]).directive("uibTooltipClasses",["$uibPosition",function(t){return{restrict:"A",link:function(e,n,r){if(e.placement){var i=t.parsePlacement(e.placement);n.addClass(i[0])}e.popupClass&&n.addClass(e.popupClass),e.animation&&n.addClass(r.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{restrict:"A",scope:{content:"@"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(t){return t("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{restrict:"A",scope:{contentExp:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(t){return t("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(t){return t("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{restrict:"A",scope:{uibTitle:"@",contentExp:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(t){return t("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&",uibTitle:"@"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(t){return t("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{restrict:"A",scope:{uibTitle:"@",content:"@"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(t){return t("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(t,e,n){var r=this,i=angular.isDefined(e.animate)?t.$parent.$eval(e.animate):n.animate;function o(){return angular.isDefined(t.maxParam)?t.maxParam:n.max}this.bars=[],t.max=o(),this.addBar=function(t,e,n){i||e.css({transition:"none"}),this.bars.push(t),t.max=o(),t.title=n&&angular.isDefined(n.title)?n.title:"progressbar",t.$watch("value",function(e){t.recalculatePercentage()}),t.recalculatePercentage=function(){var e=r.bars.reduce(function(t,e){return e.percent=+(100*e.value/e.max).toFixed(2),t+e.percent},0);e>100&&(t.percent-=e-100)},t.$on("$destroy",function(){e=null,r.removeBar(t)})},this.removeBar=function(t){this.bars.splice(this.bars.indexOf(t),1),this.bars.forEach(function(t){t.recalculatePercentage()})},t.$watch("maxParam",function(t){r.bars.forEach(function(t){t.max=o(),t.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(t,e,n,r){r.addBar(t,e,n)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(t,e,n,r){r.addBar(t,angular.element(e.children()[0]),{title:n.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(t,e,n){var r={$setViewValue:angular.noop},i=this;this.init=function(i){(r=i).$render=this.render,r.$formatters.push(function(t){return angular.isNumber(t)&&t<<0!==t&&(t=Math.round(t)),t}),this.stateOn=angular.isDefined(e.stateOn)?t.$parent.$eval(e.stateOn):n.stateOn,this.stateOff=angular.isDefined(e.stateOff)?t.$parent.$eval(e.stateOff):n.stateOff,this.enableReset=angular.isDefined(e.enableReset)?t.$parent.$eval(e.enableReset):n.enableReset;var o=angular.isDefined(e.titles)?t.$parent.$eval(e.titles):n.titles;this.titles=angular.isArray(o)&&o.length>0?o:n.titles;var a=angular.isDefined(e.ratingStates)?t.$parent.$eval(e.ratingStates):new Array(angular.isDefined(e.max)?t.$parent.$eval(e.max):n.max);t.range=this.buildTemplateObjects(a)},this.buildTemplateObjects=function(t){for(var e=0,n=t.length;e<n;e++)t[e]=angular.extend({index:e},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(e)},t[e]);return t},this.getTitle=function(t){return t>=this.titles.length?t+1:this.titles[t]},t.rate=function(e){if(!t.readonly&&e>=0&&e<=t.range.length){var n=i.enableReset&&r.$viewValue===e?0:e;r.$setViewValue(n),r.$render()}},t.enter=function(e){t.readonly||(t.value=e),t.onHover({value:e})},t.reset=function(){t.value=r.$viewValue,t.onLeave()},t.onKeydown=function(e){/(37|38|39|40)/.test(e.which)&&(e.preventDefault(),e.stopPropagation(),t.rate(t.value+(38===e.which||39===e.which?1:-1)))},this.render=function(){t.value=r.$viewValue,t.title=i.getTitle(t.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],restrict:"A",scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",link:function(t,e,n,r){var i=r[0],o=r[1];i.init(o)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(t){var e,n,r=this;function i(t){for(var e=0;e<r.tabs.length;e++)if(r.tabs[e].index===t)return e}r.tabs=[],r.select=function(t,o){if(!n){var a=i(e),s=r.tabs[a];if(s){if(s.tab.onDeselect({$event:o,$selectedIndex:t}),o&&o.isDefaultPrevented())return;s.tab.active=!1}var u=r.tabs[t];u?(u.tab.onSelect({$event:o}),u.tab.active=!0,r.active=u.index,e=u.index):!u&&angular.isDefined(e)&&(r.active=null,e=null)}},r.addTab=function(t){if(r.tabs.push({tab:t,index:t.index}),r.tabs.sort(function(t,e){return t.index>e.index?1:t.index<e.index?-1:0}),t.index===r.active||!angular.isDefined(r.active)&&1===r.tabs.length){var e=i(t.index);r.select(e)}},r.removeTab=function(t){for(var e,n=0;n<r.tabs.length;n++)if(r.tabs[n].tab===t){e=n;break}if(r.tabs[e].index===r.active){var i=e===r.tabs.length-1?e-1:e+1%r.tabs.length;r.select(i)}r.tabs.splice(e,1)},t.$watch("tabset.active",function(t){angular.isDefined(t)&&t!==e&&r.select(i(t))}),t.$on("$destroy",function(){n=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{},bindToController:{active:"=?",type:"@"},controller:"UibTabsetController",controllerAs:"tabset",templateUrl:function(t,e){return e.templateUrl||"uib/template/tabs/tabset.html"},link:function(t,e,n){t.vertical=!!angular.isDefined(n.vertical)&&t.$parent.$eval(n.vertical),t.justified=!!angular.isDefined(n.justified)&&t.$parent.$eval(n.justified)}}}).directive("uibTab",["$parse",function(t){return{require:"^uibTabset",replace:!0,templateUrl:function(t,e){return e.templateUrl||"uib/template/tabs/tab.html"},transclude:!0,scope:{heading:"@",index:"=?",classes:"@?",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(e,n,r,i,o){e.disabled=!1,r.disable&&e.$parent.$watch(t(r.disable),function(t){e.disabled=!!t}),angular.isUndefined(r.index)&&(i.tabs&&i.tabs.length?e.index=Math.max.apply(null,i.tabs.map(function(t){return t.index}))+1:e.index=0),angular.isUndefined(r.classes)&&(e.classes=""),e.select=function(t){if(!e.disabled){for(var n,r=0;r<i.tabs.length;r++)if(i.tabs[r].tab===e){n=r;break}i.select(n,t)}},i.addTab(e),e.$on("$destroy",function(){i.removeTab(e)}),e.$transcludeFn=o}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(t,e){t.$watch("headingElement",function(t){t&&(e.html(""),e.append(t))})}}}).directive("uibTabContentTransclude",function(){return{restrict:"A",require:"^uibTabset",link:function(t,e,n){var r=t.$eval(n.uibTabContentTransclude).tab;r.$transcludeFn(r.$parent,function(t){angular.forEach(t,function(t){var n;(n=t).tagName&&(n.hasAttribute("uib-tab-heading")||n.hasAttribute("data-uib-tab-heading")||n.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===n.tagName.toLowerCase()||"data-uib-tab-heading"===n.tagName.toLowerCase()||"x-uib-tab-heading"===n.tagName.toLowerCase()||"uib:tab-heading"===n.tagName.toLowerCase())?r.headingElement=t:e.append(t)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("uibTimepickerConfig",{hourStep:1,minuteStep:1,secondStep:1,showMeridian:!0,showSeconds:!1,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0,templateUrl:"uib/template/timepicker/timepicker.html"}).controller("UibTimepickerController",["$scope","$element","$attrs","$parse","$log","$locale","uibTimepickerConfig",function(t,e,n,r,i,o,a){var s,u,l,c=new Date,p=[],d={$setViewValue:angular.noop},f=angular.isDefined(n.meridians)?t.$parent.$eval(n.meridians):a.meridians||o.DATETIME_FORMATS.AMPMS,h=!angular.isDefined(n.padHours)||t.$parent.$eval(n.padHours);t.tabindex=angular.isDefined(n.tabindex)?n.tabindex:0,e.removeAttr("tabindex"),this.init=function(e,r){(d=e).$render=this.render,d.$formatters.unshift(function(t){return t?new Date(t):null});var i=r.eq(0),o=r.eq(1),c=r.eq(2);s=i.controller("ngModel"),u=o.controller("ngModel"),l=c.controller("ngModel"),(angular.isDefined(n.mousewheel)?t.$parent.$eval(n.mousewheel):a.mousewheel)&&this.setupMousewheelEvents(i,o,c),(angular.isDefined(n.arrowkeys)?t.$parent.$eval(n.arrowkeys):a.arrowkeys)&&this.setupArrowkeyEvents(i,o,c),t.readonlyInput=angular.isDefined(n.readonlyInput)?t.$parent.$eval(n.readonlyInput):a.readonlyInput,this.setupInputEvents(i,o,c)};var g=a.hourStep;n.hourStep&&p.push(t.$parent.$watch(r(n.hourStep),function(t){g=+t}));var m,v,y=a.minuteStep;n.minuteStep&&p.push(t.$parent.$watch(r(n.minuteStep),function(t){y=+t})),p.push(t.$parent.$watch(r(n.min),function(t){var e=new Date(t);m=isNaN(e)?void 0:e})),p.push(t.$parent.$watch(r(n.max),function(t){var e=new Date(t);v=isNaN(e)?void 0:e}));var b=!1;n.ngDisabled&&p.push(t.$parent.$watch(r(n.ngDisabled),function(t){b=t})),t.noIncrementHours=function(){var t=D(c,60*g);return b||t>v||t<c&&t<m},t.noDecrementHours=function(){var t=D(c,60*-g);return b||t<m||t>c&&t>v},t.noIncrementMinutes=function(){var t=D(c,y);return b||t>v||t<c&&t<m},t.noDecrementMinutes=function(){var t=D(c,-y);return b||t<m||t>c&&t>v},t.noIncrementSeconds=function(){var t=A(c,w);return b||t>v||t<c&&t<m},t.noDecrementSeconds=function(){var t=A(c,-w);return b||t<m||t>c&&t>v},t.noToggleMeridian=function(){return c.getHours()<12?b||D(c,720)>v:b||D(c,-720)<m};var w=a.secondStep;function $(){var e=+t.hours;if((t.showMeridian?e>0&&e<13:e>=0&&e<24)&&""!==t.hours)return t.showMeridian&&(12===e&&(e=0),t.meridian===f[1]&&(e+=12)),e}function k(){var e=+t.minutes;if(e>=0&&e<60&&""!==t.minutes)return e}function C(t,e){return null===t?"":angular.isDefined(t)&&t.toString().length<2&&!e?"0"+t:t.toString()}function x(t){T(),d.$setViewValue(new Date(c)),S(t)}function T(){s&&s.$setValidity("hours",!0),u&&u.$setValidity("minutes",!0),l&&l.$setValidity("seconds",!0),d.$setValidity("time",!0),t.invalidHours=!1,t.invalidMinutes=!1,t.invalidSeconds=!1}function S(e){if(d.$modelValue){var n=c.getHours(),r=c.getMinutes(),i=c.getSeconds();t.showMeridian&&(n=0===n||12===n?12:n%12),t.hours="h"===e?n:C(n,!h),"m"!==e&&(t.minutes=C(r)),t.meridian=c.getHours()<12?f[0]:f[1],"s"!==e&&(t.seconds=C(i)),t.meridian=c.getHours()<12?f[0]:f[1]}else t.hours=null,t.minutes=null,t.seconds=null,t.meridian=f[0]}function E(t){c=A(c,t),x()}function D(t,e){return A(t,60*e)}function A(t,e){var n=new Date(t.getTime()+1e3*e),r=new Date(t);return r.setHours(n.getHours(),n.getMinutes(),n.getSeconds()),r}function B(){return(null===t.hours||""===t.hours)&&(null===t.minutes||""===t.minutes)&&(!t.showSeconds||t.showSeconds&&(null===t.seconds||""===t.seconds))}n.secondStep&&p.push(t.$parent.$watch(r(n.secondStep),function(t){w=+t})),t.showSeconds=a.showSeconds,n.showSeconds&&p.push(t.$parent.$watch(r(n.showSeconds),function(e){t.showSeconds=!!e})),t.showMeridian=a.showMeridian,n.showMeridian&&p.push(t.$parent.$watch(r(n.showMeridian),function(e){if(t.showMeridian=!!e,d.$error.time){var n=$(),r=k();angular.isDefined(n)&&angular.isDefined(r)&&(c.setHours(n),x())}else S()})),this.setupMousewheelEvents=function(e,n,r){var i=function(t){t.originalEvent&&(t=t.originalEvent);var e=t.wheelDelta?t.wheelDelta:-t.deltaY;return t.detail||e>0};e.on("mousewheel wheel",function(e){b||t.$apply(i(e)?t.incrementHours():t.decrementHours()),e.preventDefault()}),n.on("mousewheel wheel",function(e){b||t.$apply(i(e)?t.incrementMinutes():t.decrementMinutes()),e.preventDefault()}),r.on("mousewheel wheel",function(e){b||t.$apply(i(e)?t.incrementSeconds():t.decrementSeconds()),e.preventDefault()})},this.setupArrowkeyEvents=function(e,n,r){e.on("keydown",function(e){b||(38===e.which?(e.preventDefault(),t.incrementHours(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementHours(),t.$apply()))}),n.on("keydown",function(e){b||(38===e.which?(e.preventDefault(),t.incrementMinutes(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementMinutes(),t.$apply()))}),r.on("keydown",function(e){b||(38===e.which?(e.preventDefault(),t.incrementSeconds(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementSeconds(),t.$apply()))})},this.setupInputEvents=function(e,n,r){if(t.readonlyInput)return t.updateHours=angular.noop,t.updateMinutes=angular.noop,void(t.updateSeconds=angular.noop);var i=function(e,n,r){d.$setViewValue(null),d.$setValidity("time",!1),angular.isDefined(e)&&(t.invalidHours=e,s&&s.$setValidity("hours",!1)),angular.isDefined(n)&&(t.invalidMinutes=n,u&&u.$setValidity("minutes",!1)),angular.isDefined(r)&&(t.invalidSeconds=r,l&&l.$setValidity("seconds",!1))};t.updateHours=function(){var t=$(),e=k();d.$setDirty(),angular.isDefined(t)&&angular.isDefined(e)?(c.setHours(t),c.setMinutes(e),c<m||c>v?i(!0):x("h")):i(!0)},e.on("blur",function(e){d.$setTouched(),B()?T():null===t.hours||""===t.hours?i(!0):!t.invalidHours&&t.hours<10&&t.$apply(function(){t.hours=C(t.hours,!h)})}),t.updateMinutes=function(){var t=k(),e=$();d.$setDirty(),angular.isDefined(t)&&angular.isDefined(e)?(c.setHours(e),c.setMinutes(t),c<m||c>v?i(void 0,!0):x("m")):i(void 0,!0)},n.on("blur",function(e){d.$setTouched(),B()?T():null===t.minutes?i(void 0,!0):!t.invalidMinutes&&t.minutes<10&&t.$apply(function(){t.minutes=C(t.minutes)})}),t.updateSeconds=function(){var e,n=(e=+t.seconds)>=0&&e<60?e:void 0;d.$setDirty(),angular.isDefined(n)?(c.setSeconds(n),x("s")):i(void 0,void 0,!0)},r.on("blur",function(e){B()?T():!t.invalidSeconds&&t.seconds<10&&t.$apply(function(){t.seconds=C(t.seconds)})})},this.render=function(){var e=d.$viewValue;isNaN(e)?(d.$setValidity("time",!1),i.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(e&&(c=e),c<m||c>v?(d.$setValidity("time",!1),t.invalidHours=!0,t.invalidMinutes=!0):T(),S())},t.showSpinners=angular.isDefined(n.showSpinners)?t.$parent.$eval(n.showSpinners):a.showSpinners,t.incrementHours=function(){t.noIncrementHours()||E(60*g*60)},t.decrementHours=function(){t.noDecrementHours()||E(60*-g*60)},t.incrementMinutes=function(){t.noIncrementMinutes()||E(60*y)},t.decrementMinutes=function(){t.noDecrementMinutes()||E(60*-y)},t.incrementSeconds=function(){t.noIncrementSeconds()||E(w)},t.decrementSeconds=function(){t.noDecrementSeconds()||E(-w)},t.toggleMeridian=function(){var e=k(),n=$();t.noToggleMeridian()||(angular.isDefined(e)&&angular.isDefined(n)?E(720*(c.getHours()<12?60:-60)):t.meridian=t.meridian===f[0]?f[1]:f[0])},t.blur=function(){d.$setTouched()},t.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(t){return{require:["uibTimepicker","?^ngModel"],restrict:"A",controller:"UibTimepickerController",controllerAs:"timepicker",scope:{},templateUrl:function(e,n){return n.templateUrl||t.templateUrl},link:function(t,e,n,r){var i=r[0],o=r[1];o&&i.init(o,e.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(t){var e=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(n){var r=n.match(e);if(!r)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+n+'".');return{itemName:r[3],source:t(r[4]),viewMapper:t(r[2]||r[1]),modelMapper:t(r[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(t,e,n,r,i,o,a,s,u,l,c,p,d){var f,h,g=[9,13,27,38,40],m=t.$eval(n.typeaheadMinLength);m||0===m||(m=1),t.$watch(n.typeaheadMinLength,function(t){m=t||0===t?t:1});var v=t.$eval(n.typeaheadWaitMs)||0,y=!1!==t.$eval(n.typeaheadEditable);t.$watch(n.typeaheadEditable,function(t){y=!1!==t});var b,w,$=i(n.typeaheadLoading).assign||angular.noop,k=n.typeaheadShouldSelect?i(n.typeaheadShouldSelect):function(t,e){var n=e.$event;return 13===n.which||9===n.which},C=i(n.typeaheadOnSelect),x=!!angular.isDefined(n.typeaheadSelectOnBlur)&&t.$eval(n.typeaheadSelectOnBlur),T=i(n.typeaheadNoResults).assign||angular.noop,S=n.typeaheadInputFormatter?i(n.typeaheadInputFormatter):void 0,E=!!n.typeaheadAppendToBody&&t.$eval(n.typeaheadAppendToBody),D=n.typeaheadAppendTo?t.$eval(n.typeaheadAppendTo):null,A=!1!==t.$eval(n.typeaheadFocusFirst),B=!!n.typeaheadSelectOnExact&&t.$eval(n.typeaheadSelectOnExact),I=i(n.typeaheadIsOpen).assign||angular.noop,O=t.$eval(n.typeaheadShowHint)||!1,M=i(n.ngModel),P=i(n.ngModel+"($$$p)"),_=d.parse(n.uibTypeahead),R=t.$new(),L=t.$on("$destroy",function(){R.$destroy()});R.$on("$destroy",L);var N,U,j="typeahead-"+R.$id+"-"+Math.floor(1e4*Math.random());e.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":j}),O&&((N=angular.element("<div></div>")).css("position","relative"),e.after(N),(U=e.clone()).attr("placeholder",""),U.attr("tabindex","-1"),U.val(""),U.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),e.css({position:"relative","vertical-align":"top","background-color":"transparent"}),U.attr("id")&&U.removeAttr("id"),N.append(U),U.after(e));var q=angular.element("<div uib-typeahead-popup></div>");q.attr({id:j,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(n.typeaheadTemplateUrl)&&q.attr("template-url",n.typeaheadTemplateUrl),angular.isDefined(n.typeaheadPopupTemplateUrl)&&q.attr("popup-template-url",n.typeaheadPopupTemplateUrl);var F=function(){R.matches=[],R.activeIdx=-1,e.attr("aria-expanded",!1),O&&U.val("")},V=function(t){return j+"-option-"+t};R.$watch("activeIdx",function(t){t<0?e.removeAttr("aria-activedescendant"):e.attr("aria-activedescendant",V(t))});var z=function(n,r){var i={$viewValue:n};$(t,!0),T(t,!1),o.when(_.source(t,i)).then(function(o){var a,s,u=n===f.$viewValue;if(u&&b)if(o&&o.length>0){R.activeIdx=A?0:-1,T(t,!1),R.matches.length=0;for(var l=0;l<o.length;l++)i[_.itemName]=o[l],R.matches.push({id:V(l),label:_.viewMapper(R,i),model:o[l]});if(R.query=n,G(),e.attr("aria-expanded",!0),B&&1===R.matches.length&&(a=n,s=0,R.matches.length>s&&a&&a.toUpperCase()===R.matches[s].label.toUpperCase())&&(angular.isNumber(R.debounceUpdate)||angular.isObject(R.debounceUpdate)?c(function(){R.select(0,r)},angular.isNumber(R.debounceUpdate)?R.debounceUpdate:R.debounceUpdate.default):R.select(0,r)),O){var p=R.matches[0].label;angular.isString(n)&&n.length>0&&p.slice(0,n.length).toUpperCase()===n.toUpperCase()?U.val(n+p.slice(n.length)):U.val("")}}else F(),T(t,!0);u&&$(t,!1)},function(){F(),$(t,!1),T(t,!0)})};E&&(angular.element(u).on("resize",W),s.find("body").on("scroll",W));var H,K=c(function(){R.matches.length&&G(),R.moveInProgress=!1},200);function W(){R.moveInProgress||(R.moveInProgress=!0,R.$digest()),K()}function G(){R.position=E?p.offset(e):p.position(e),R.position.top+=e.prop("offsetHeight")}R.moveInProgress=!1,R.query=void 0;var Y=function(){H&&a.cancel(H)};F(),R.assignIsOpen=function(e){I(t,e)},R.select=function(r,i){var o,s,u,l,c={};w=!0,c[_.itemName]=s=R.matches[r].model,o=_.modelMapper(t,c),u=t,l=o,angular.isFunction(M(t))&&h.getOption("getterSetter")?P(u,{$$$p:l}):M.assign(u,l),f.$setValidity("editable",!0),f.$setValidity("parse",!0),C(t,{$item:s,$model:o,$label:_.viewMapper(t,c),$event:i}),F(),!1!==R.$eval(n.typeaheadFocusOnSelect)&&a(function(){e[0].focus()},0,!1)},e.on("keydown",function(e){if(0!==R.matches.length&&-1!==g.indexOf(e.which)){var n,r=k(t,{$event:e});if(-1===R.activeIdx&&r||9===e.which&&e.shiftKey)return F(),void R.$digest();switch(e.preventDefault(),e.which){case 27:e.stopPropagation(),F(),t.$digest();break;case 38:R.activeIdx=(R.activeIdx>0?R.activeIdx:R.matches.length)-1,R.$digest(),(n=q[0].querySelectorAll(".uib-typeahead-match")[R.activeIdx]).parentNode.scrollTop=n.offsetTop;break;case 40:R.activeIdx=(R.activeIdx+1)%R.matches.length,R.$digest(),(n=q[0].querySelectorAll(".uib-typeahead-match")[R.activeIdx]).parentNode.scrollTop=n.offsetTop;break;default:r&&R.$apply(function(){angular.isNumber(R.debounceUpdate)||angular.isObject(R.debounceUpdate)?c(function(){R.select(R.activeIdx,e)},angular.isNumber(R.debounceUpdate)?R.debounceUpdate:R.debounceUpdate.default):R.select(R.activeIdx,e)})}}}),e.on("focus",function(t){b=!0,0!==m||f.$viewValue||a(function(){z(f.$viewValue,t)},0)}),e.on("blur",function(t){x&&R.matches.length&&-1!==R.activeIdx&&!w&&(w=!0,R.$apply(function(){angular.isObject(R.debounceUpdate)&&angular.isNumber(R.debounceUpdate.blur)?c(function(){R.select(R.activeIdx,t)},R.debounceUpdate.blur):R.select(R.activeIdx,t)})),!y&&f.$error.editable&&(f.$setViewValue(),R.$apply(function(){f.$setValidity("editable",!0),f.$setValidity("parse",!0)}),e.val("")),b=!1,w=!1});var Q=function(n){e[0]!==n.target&&3!==n.which&&0!==R.matches.length&&(F(),l.$$phase||t.$digest())};s.on("click",Q),t.$on("$destroy",function(){s.off("click",Q),(E||D)&&Z.remove(),E&&(angular.element(u).off("resize",W),s.find("body").off("scroll",W)),q.remove(),O&&N.remove()});var Z=r(q)(R);E?s.find("body").append(Z):D?angular.element(D).eq(0).append(Z):e.after(Z),this.init=function(e){h=function(t){var e;angular.version.minor<6?(e=t.$options||{}).getOption=function(t){return e[t]}:e=t.$options;return e}(f=e),R.debounceUpdate=i(h.getOption("debounce"))(t),f.$parsers.unshift(function(e){var n;return b=!0,0===m||e&&e.length>=m?v>0?(Y(),n=e,H=a(function(){z(n)},v)):z(e):($(t,!1),Y(),F()),y?e:e?void f.$setValidity("editable",!1):(f.$setValidity("editable",!0),null)}),f.$formatters.push(function(e){var n,r={};return y||f.$setValidity("editable",!0),S?(r.$model=e,S(t,r)):(r[_.itemName]=e,n=_.viewMapper(t,r),r[_.itemName]=void 0,n!==_.viewMapper(t,r)?n:e)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","uibTypeahead"],link:function(t,e,n,r){r[1].init(r[0])}}}).directive("uibTypeaheadPopup",["$$debounce",function(t){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(t,e){return e.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(e,n,r){e.templateUrl=r.templateUrl,e.isOpen=function(){var t=e.matches.length>0;return e.assignIsOpen({isOpen:t}),t},e.isActive=function(t){return e.active===t},e.selectActive=function(t){e.active=t},e.selectMatch=function(n,r){var i=e.debounce();angular.isNumber(i)||angular.isObject(i)?t(function(){e.select({activeIdx:n,evt:r})},angular.isNumber(i)?i:i.default):e.select({activeIdx:n,evt:r})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(t,e,n){return{scope:{index:"=",match:"=",query:"="},link:function(r,i,o){var a=n(o.templateUrl)(r.$parent)||"uib/template/typeahead/typeahead-match.html";t(a).then(function(t){var n=angular.element(t.trim());i.replaceWith(n),e(n)(r)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(t,e,n){var r;return r=e.has("$sanitize"),function(e,i){return!r&&/<.*>/g.test(e)&&n.warn("Unsafe use of typeahead please use ngSanitize"),e=i?(""+e).replace(new RegExp(i.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"gi"),"<strong>$&</strong>"):e,r||(e=t.trustAsHtml(e)),e}}]),angular.module("uib/template/accordion/accordion-group.html",[]).run(["$templateCache",function(t){t.put("uib/template/accordion/accordion-group.html",'<div role="tab" id="{{::headingId}}" aria-selected="{{isOpen}}" class="panel-heading" ng-keypress="toggleOpen($event)">\n <h4 class="panel-title">\n <a role="button" data-toggle="collapse" href aria-expanded="{{isOpen}}" aria-controls="{{::panelId}}" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading" ng-disabled="isDisabled" uib-tabindex-toggle><span uib-accordion-header ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n</div>\n<div id="{{::panelId}}" aria-labelledby="{{::headingId}}" aria-hidden="{{!isOpen}}" role="tabpanel" class="panel-collapse collapse" uib-collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/accordion/accordion.html",[]).run(["$templateCache",function(t){t.put("uib/template/accordion/accordion.html",'<div role="tablist" class="panel-group" ng-transclude></div>')}]),angular.module("uib/template/alert/alert.html",[]).run(["$templateCache",function(t){t.put("uib/template/alert/alert.html",'<button ng-show="closeable" type="button" class="close" ng-click="close({$event: $event})">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n</button>\n<div ng-transclude></div>\n')}]),angular.module("uib/template/carousel/carousel.html",[]).run(["$templateCache",function(t){t.put("uib/template/carousel/carousel.html",'<div class="carousel-inner" ng-transclude></div>\n<a role="button" href class="left carousel-control" ng-click="prev()" ng-class="{ disabled: isPrevDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-left"></span>\n <span class="sr-only">previous</span>\n</a>\n<a role="button" href class="right carousel-control" ng-click="next()" ng-class="{ disabled: isNextDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-right"></span>\n <span class="sr-only">next</span>\n</a>\n<ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:indexOfSlide track by $index" ng-class="{ active: isActive(slide) }" ng-click="select(slide)">\n <span class="sr-only">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if="isActive(slide)">, currently active</span></span>\n </li>\n</ol>\n')}]),angular.module("uib/template/carousel/slide.html",[]).run(["$templateCache",function(t){t.put("uib/template/carousel/slide.html",'<div class="text-center" ng-transclude></div>\n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/datepicker.html",'<div ng-switch="datepickerMode">\n <div uib-daypicker ng-switch-when="day" tabindex="0" class="uib-daypicker"></div>\n <div uib-monthpicker ng-switch-when="month" tabindex="0" class="uib-monthpicker"></div>\n <div uib-yearpicker ng-switch-when="year" tabindex="0" class="uib-yearpicker"></div>\n</div>\n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/day.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::5 + showWeeks}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></button></th>\n </tr>\n <tr>\n <th ng-if="showWeeks" class="text-center"></th>\n <th ng-repeat="label in ::labels track by $index" class="text-center"><small aria-label="{{::label.full}}">{{::label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-weeks" ng-repeat="row in rows track by $index" role="row">\n <td ng-if="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row" class="uib-day text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default btn-sm"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/month.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::yearHeaderColspan}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-months" ng-repeat="row in rows track by $index" role="row">\n <td ng-repeat="dt in row" class="uib-month text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/popup.html",'<div>\n <ul class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" class="uib-button-bar">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select(\'today\', $event)" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select(null, $event)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText(\'close\') }}</button>\n </li>\n </ul>\n</div>\n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepicker/year.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::columns - 2}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-years" ng-repeat="row in rows track by $index" role="row">\n <td ng-repeat="dt in row" class="uib-year text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/datepickerPopup/popup.html",'<ul role="presentation" class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" class="uib-button-bar">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select(\'today\', $event)" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select(null, $event)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')}]),angular.module("uib/template/modal/backdrop.html",[]).run(["$templateCache",function(t){t.put("uib/template/modal/backdrop.html",'<div class="modal-backdrop"\n uib-modal-animation-class="fade"\n modal-in-class="in"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("uib/template/modal/window.html",[]).run(["$templateCache",function(t){t.put("uib/template/modal/window.html","<div class=\"modal-dialog {{size ? 'modal-' + size : ''}}\"><div class=\"modal-content\" uib-modal-transclude></div></div>\n")}]),angular.module("uib/template/pager/pager.html",[]).run(["$templateCache",function(t){t.put("uib/template/pager/pager.html",'<li ng-class="{disabled: noPrevious()||ngDisabled, previous: align}"><a href ng-click="selectPage(page - 1, $event)" ng-disabled="noPrevious()||ngDisabled" uib-tabindex-toggle>{{::getText(\'previous\')}}</a></li>\n<li ng-class="{disabled: noNext()||ngDisabled, next: align}"><a href ng-click="selectPage(page + 1, $event)" ng-disabled="noNext()||ngDisabled" uib-tabindex-toggle>{{::getText(\'next\')}}</a></li>\n')}]),angular.module("uib/template/pagination/pagination.html",[]).run(["$templateCache",function(t){t.put("uib/template/pagination/pagination.html",'<li role="menuitem" ng-if="::boundaryLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-first"><a href ng-click="selectPage(1, $event)" ng-disabled="noPrevious()||ngDisabled" uib-tabindex-toggle>{{::getText(\'first\')}}</a></li>\n<li role="menuitem" ng-if="::directionLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-prev"><a href ng-click="selectPage(page - 1, $event)" ng-disabled="noPrevious()||ngDisabled" uib-tabindex-toggle>{{::getText(\'previous\')}}</a></li>\n<li role="menuitem" ng-repeat="page in pages track by $index" ng-class="{active: page.active,disabled: ngDisabled&&!page.active}" class="pagination-page"><a href ng-click="selectPage(page.number, $event)" ng-disabled="ngDisabled&&!page.active" uib-tabindex-toggle>{{page.text}}</a></li>\n<li role="menuitem" ng-if="::directionLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-next"><a href ng-click="selectPage(page + 1, $event)" ng-disabled="noNext()||ngDisabled" uib-tabindex-toggle>{{::getText(\'next\')}}</a></li>\n<li role="menuitem" ng-if="::boundaryLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-last"><a href ng-click="selectPage(totalPages, $event)" ng-disabled="noNext()||ngDisabled" uib-tabindex-toggle>{{::getText(\'last\')}}</a></li>\n')}]),angular.module("uib/template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-html-popup.html",'<div class="tooltip-arrow"></div>\n<div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n')}]),angular.module("uib/template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-popup.html",'<div class="tooltip-arrow"></div>\n<div class="tooltip-inner" ng-bind="content"></div>\n')}]),angular.module("uib/template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/tooltip/tooltip-template-popup.html",'<div class="tooltip-arrow"></div>\n<div class="tooltip-inner"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n')}]),angular.module("uib/template/popover/popover-html.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover-html.html",'<div class="arrow"></div>\n\n<div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind-html="contentExp()"></div>\n</div>\n')}]),angular.module("uib/template/popover/popover-template.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover-template.html",'<div class="arrow"></div>\n\n<div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')}]),angular.module("uib/template/popover/popover.html",[]).run(["$templateCache",function(t){t.put("uib/template/popover/popover.html",'<div class="arrow"></div>\n\n<div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind="content"></div>\n</div>\n')}]),angular.module("uib/template/progressbar/bar.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n')}]),angular.module("uib/template/progressbar/progress.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/progress.html",'<div class="progress" ng-transclude aria-labelledby="{{::title}}"></div>')}]),angular.module("uib/template/progressbar/progressbar.html",[]).run(["$templateCache",function(t){t.put("uib/template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/rating/rating.html",[]).run(["$templateCache",function(t){t.put("uib/template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}" aria-valuetext="{{title}}">\n <span ng-repeat-start="r in range track by $index" class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n <i ng-repeat-end ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')" ng-attr-title="{{r.title}}"></i>\n</span>\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(t){t.put("uib/template/tabs/tab.html",'<li ng-class="[{active: active, disabled: disabled}, classes]" class="uib-tab nav-item">\n <a href ng-click="select($event)" class="nav-link" uib-tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(t){t.put("uib/template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{tabset.type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane"\n ng-repeat="tab in tabset.tabs"\n ng-class="{active: tabset.active === tab.index}"\n uib-tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("uib/template/timepicker/timepicker.html",[]).run(["$templateCache",function(t){t.put("uib/template/timepicker/timepicker.html",'<table class="uib-timepicker">\n <tbody>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-increment hours"><a ng-click="incrementHours()" ng-class="{disabled: noIncrementHours()}" class="btn btn-link" ng-disabled="noIncrementHours()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-increment minutes"><a ng-click="incrementMinutes()" ng-class="{disabled: noIncrementMinutes()}" class="btn btn-link" ng-disabled="noIncrementMinutes()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-increment seconds"><a ng-click="incrementSeconds()" ng-class="{disabled: noIncrementSeconds()}" class="btn btn-link" ng-disabled="noIncrementSeconds()" tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group uib-time hours" ng-class="{\'has-error\': invalidHours}">\n <input type="text" placeholder="HH" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementHours()" ng-blur="blur()">\n </td>\n <td class="uib-separator">:</td>\n <td class="form-group uib-time minutes" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" placeholder="MM" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementMinutes()" ng-blur="blur()">\n </td>\n <td ng-show="showSeconds" class="uib-separator">:</td>\n <td class="form-group uib-time seconds" ng-class="{\'has-error\': invalidSeconds}" ng-show="showSeconds">\n <input type="text" placeholder="SS" ng-model="seconds" ng-change="updateSeconds()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementSeconds()" ng-blur="blur()">\n </td>\n <td ng-show="showMeridian" class="uib-time am-pm"><button type="button" ng-class="{disabled: noToggleMeridian()}" class="btn btn-default text-center" ng-click="toggleMeridian()" ng-disabled="noToggleMeridian()" tabindex="{{::tabindex}}">{{meridian}}</button></td>\n </tr>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-decrement hours"><a ng-click="decrementHours()" ng-class="{disabled: noDecrementHours()}" class="btn btn-link" ng-disabled="noDecrementHours()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-decrement minutes"><a ng-click="decrementMinutes()" ng-class="{disabled: noDecrementMinutes()}" class="btn btn-link" ng-disabled="noDecrementMinutes()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-decrement seconds"><a ng-click="decrementSeconds()" ng-class="{disabled: noDecrementSeconds()}" class="btn btn-link" ng-disabled="noDecrementSeconds()" tabindex="-1"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(t){t.put("uib/template/typeahead/typeahead-match.html",'<a href\n tabindex="-1"\n ng-bind-html="match.label | uibTypeaheadHighlight:query"\n ng-attr-title="{{match.label}}"></a>\n')}]),angular.module("uib/template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(t){t.put("uib/template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen() && !moveInProgress" ng-style="{top: position().top+\'px\', left: position().left+\'px\'}" role="listbox" aria-hidden="{{!isOpen()}}">\n <li class="uib-typeahead-match" ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index, $event)" role="option" id="{{::match.id}}">\n <div uib-typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>'),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-time input{width:50px;}</style>'),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>'),angular.$$uibTypeaheadCss=!0}),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(t,e,n){"use strict";var r,i=e.isDefined,o=e.isFunction,a=e.isString,s=e.isObject,u=e.isArray,l=e.forEach,c=e.extend,p=e.copy,d=e.toJson;function f(t,e){return c(new(c(function(){},{prototype:t})),e)}function h(t){return l(arguments,function(e){e!==t&&l(e,function(e,n){t.hasOwnProperty(n)||(t[n]=e)})}),t}function g(t){if(Object.keys)return Object.keys(t);var e=[];return l(t,function(t,n){e.push(n)}),e}function m(t,e){if(Array.prototype.indexOf)return t.indexOf(e,Number(arguments[2])||0);var n=t.length>>>0,r=Number(arguments[2])||0;for((r=r<0?Math.ceil(r):Math.floor(r))<0&&(r+=n);r<n;r++)if(r in t&&t[r]===e)return r;return-1}function v(t,e,n,r){var i,o=function(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}(n,r),a={},s=[];for(var u in o)if(o[u]&&o[u].params&&(i=g(o[u].params)).length)for(var l in i)m(s,i[l])>=0||(s.push(i[l]),a[i[l]]=t[i[l]]);return c({},a,e)}function y(t,e){var n={};return l(t,function(t){n[t]=e[t]}),n}function b(t){var e={},n=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return l(n,function(n){n in t&&(e[n]=t[n])}),e}function w(t){var e={},n=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var r in t)-1==m(n,r)&&(e[r]=t[r]);return e}function $(t,e){var n=u(t),r=n?[]:{};return l(t,function(t,i){e(t,i)&&(r[n?r.length:i]=t)}),r}function k(t,e){var n=u(t)?[]:{};return l(t,function(t,r){n[r]=e(t,r)}),n}function C(t){return t.then(n,function(){})&&t}function x(t,e){var r=1,o=2,u={},p=[],d=u,f=c(t.when(u),{$$promises:u,$$values:u});this.study=function(u){if(!s(u))throw new Error("'invocables' must be an object");var v=g(u||{}),y=[],b=[],$={};function k(t){return s(t)&&t.then&&t.$$promises}return l(u,function t(n,i){if($[i]!==o){if(b.push(i),$[i]===r)throw b.splice(0,m(b,i)),new Error("Cyclic dependency: "+b.join(" -> "));if($[i]=r,a(n))y.push(i,[function(){return e.get(n)}],p);else{var s=e.annotate(n);l(s,function(e){e!==i&&u.hasOwnProperty(e)&&t(u[e],e)}),y.push(i,n,s)}b.pop(),$[i]=o}}),u=b=$=null,function(r,o,a){if(k(r)&&a===n&&(a=o,o=r,r=null),r){if(!s(r))throw new Error("'locals' must be an object")}else r=d;if(o){if(!k(o))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else o=f;var u=t.defer(),p=C(u.promise),g=p.$$promises={},m=c({},r),b=1+y.length/3,$=!1;function x(){--b||($||h(m,o.$$values),p.$$values=m,p.$$promises=p.$$promises||!0,delete p.$$inheritedValues,u.resolve(m))}function T(t){p.$$failure=t,u.reject(t)}if(C(p),i(o.$$failure))return T(o.$$failure),p;o.$$inheritedValues&&h(m,w(o.$$inheritedValues,v)),c(g,o.$$promises),o.$$values?($=h(m,w(o.$$values,v)),p.$$inheritedValues=w(o.$$values,v),x()):(o.$$inheritedValues&&(p.$$inheritedValues=w(o.$$inheritedValues,v)),o.then(x,T));for(var S=0,E=y.length;S<E;S+=3)r.hasOwnProperty(y[S])?x():D(y[S],y[S+1],y[S+2]);function D(n,o,s){var u=t.defer(),c=0;function d(t){u.reject(t),T(t)}function f(){if(!i(p.$$failure))try{u.resolve(e.invoke(o,a,m)),u.promise.then(function(t){m[n]=t,x()},d)}catch(t){d(t)}}l(s,function(t){g.hasOwnProperty(t)&&!r.hasOwnProperty(t)&&(c++,g[t].then(function(e){m[t]=e,--c||f()},d))}),c||f(),g[n]=C(u.promise)}return p}},this.resolve=function(t,e,n,r){return this.study(t)(e,n,r)}}function T(t,e,i){e=c({params:{}},s(e)?e:{});var o,a,u,l,p=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,d=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h="^",g=0,m=this.segments=[],v=i?i.params:{},y=this.params=i?i.params.$$new():new r.ParamSet,b=[];function w(e,n,i,o){if(b.push(e),v[e])return v[e];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(e))throw new Error("Invalid parameter name '"+e+"' in pattern '"+t+"'");if(y[e])throw new Error("Duplicate parameter name '"+e+"' in pattern '"+t+"'");return y[e]=new r.Param(e,n,i,o),y[e]}function $(t,e,n,r){var i=["",""],o=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return o;switch(n){case!1:i=["(",")"+(r?"?":"")];break;case!0:o=o.replace(/\/$/,""),i=["(?:/(",")|/)?"];break;default:i=["("+n+"|",")?"]}return o+i[0]+e+i[1]}function k(i,o){var a,s,u,l,c;return a=i[2]||i[3],c=e.params[a],u=t.substring(g,i.index),(s=o?i[4]:i[4]||("*"==i[1]?".*":null))&&(l=r.type(s)||f(r.type("string"),{pattern:new RegExp(s,e.caseInsensitive?"i":n)})),{id:a,regexp:s,segment:u,type:l,cfg:c}}for(this.source=t;(o=p.exec(t))&&!((a=k(o,!1)).segment.indexOf("?")>=0);)u=w(a.id,a.type,a.cfg,"path"),h+=$(a.segment,u.type.pattern.source,u.squash,u.isOptional),m.push(a.segment),g=p.lastIndex;var C=(l=t.substring(g)).indexOf("?");if(C>=0){var x=this.sourceSearch=l.substring(C);if(l=l.substring(0,C),this.sourcePath=t.substring(0,g+C),x.length>0)for(g=0;o=d.exec(x);)u=w((a=k(o,!0)).id,a.type,a.cfg,"search"),g=p.lastIndex}else this.sourcePath=t,this.sourceSearch="";h+=$(l)+(!1===e.strict?"/?":"")+"$",m.push(l),this.regexp=new RegExp(h,e.caseInsensitive?"i":n),this.prefix=m[0],this.$$paramNames=b}function S(t){c(this,t)}function E(t,r){var s,l=[],p=null,d=!1;function f(t,e,n){if(!n)return!1;var r=t.invoke(e,e,{$match:n});return!i(r)||r}function h(r,i,o,u,c){var f,h=u.baseHref(),g=r.url();function m(t){if(!t||!t.defaultPrevented){f&&r.url();f=n;var e,i=l.length;for(e=0;e<i;e++)if(s(l[e]))return;p&&s(p)}function s(t){var e=t(o,r);return!!e&&(a(e)&&r.replace().url(e),!0)}}function v(){return s=s||i.$on("$locationChangeSuccess",m)}return d||v(),{sync:function(){m()},listen:function(){return v()},update:function(t){t?g=r.url():r.url()!==g&&(r.url(g),r.replace())},push:function(t,e,i){var o=t.format(e||{});null!==o&&e&&e["#"]&&(o+="#"+e["#"]),r.url(o),f=i&&i.$$avoidResync?r.url():n,i&&i.replace&&r.replace()},href:function(n,i,o){if(!n.validates(i))return null;var a=t.html5Mode();e.isObject(a)&&(a=a.enabled),a=a&&c.history;var s,u,l,p=n.format(i);if(o=o||{},a||null===p||(p="#"+t.hashPrefix()+p),null!==p&&i&&i["#"]&&(p+="#"+i["#"]),s=p,u=a,l=o.absolute,p="/"===h?s:u?h.slice(0,-1)+s:l?h.slice(1)+s:s,!o.absolute||!p)return p;var d=!a&&p?"/":"",f=r.port();return f=80===f||443===f?"":":"+f,[r.protocol(),"://",r.host(),f,d,p].join("")}}}this.rule=function(t){if(!o(t))throw new Error("'rule' must be a function");return l.push(t),this},this.otherwise=function(t){if(a(t)){var e=t;t=function(){return e}}else if(!o(t))throw new Error("'rule' must be a function");return p=t,this},this.when=function(t,e){var n,i=a(e);if(a(t)&&(t=r.compile(t)),!i&&!o(e)&&!u(e))throw new Error("invalid 'handler' in when()");var s={matcher:function(t,e){return i&&(n=r.compile(e),e=["$match",function(t){return n.format(t)}]),c(function(n,r){return f(n,e,t.exec(r.path(),r.search()))},{prefix:a(t.prefix)?t.prefix:""})},regex:function(t,e){if(t.global||t.sticky)throw new Error("when() RegExp must not be global or sticky");return i&&(n=e,e=["$match",function(t){return e=t,n.replace(/\$(\$|\d{1,2})/,function(t,n){return e["$"===n?0:Number(n)]});var e}]),c(function(n,r){return f(n,e,t.exec(r.path()))},{prefix:(r=t,o=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(r.source),null!=o?o[1].replace(/\\(.)/g,"$1"):"")});var r,o}},l={matcher:r.isMatcher(t),regex:t instanceof RegExp};for(var p in l)if(l[p])return this.rule(s[p](t,e));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(t){t===n&&(t=!0),d=t},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function D(t,d){var h,w,$={},x={},T="abstract",S={parent:function(t){if(i(t.parent)&&t.parent)return E(t.parent);var e=/^(.+)\.[^.]+$/.exec(t.name);return e?E(e[1]):h},data:function(t){return t.parent&&t.parent.data&&(t.data=t.self.data=f(t.parent.data,t.data)),t.data},url:function(t){var e=t.url,n={params:t.params||{}};if(a(e))return"^"==e.charAt(0)?d.compile(e.substring(1),n):(t.parent.navigable||h).url.concat(e,n);if(!e||d.isMatcher(e))return e;throw new Error("Invalid url '"+e+"' in state '"+t+"'")},navigable:function(t){return t.url?t:t.parent?t.parent.navigable:null},ownParams:function(t){var e=t.url&&t.url.params||new r.ParamSet;return l(t.params||{},function(t,n){e[n]||(e[n]=new r.Param(n,null,t,"config"))}),e},params:function(t){var e=b(t.ownParams,t.ownParams.$$keys());return t.parent&&t.parent.params?c(t.parent.params.$$new(),e):new r.ParamSet},views:function(t){var e={};return l(i(t.views)?t.views:{"":t},function(n,r){r.indexOf("@")<0&&(r+="@"+t.parent.name),n.resolveAs=n.resolveAs||t.resolveAs||"$resolve",e[r]=n}),e},path:function(t){return t.parent?t.parent.path.concat(t):[]},includes:function(t){var e=t.parent?c({},t.parent.includes):{};return e[t.name]=!0,e},$delegates:{}};function E(t,e){if(!t)return n;var r,i=a(t),o=i?t:t.name;if(0===(r=o).indexOf(".")||0===r.indexOf("^")){if(!e)throw new Error("No reference point given for path '"+o+"'");e=E(e);for(var s=o.split("."),u=0,l=s.length,c=e;u<l;u++)if(""!==s[u]||0!==u){if("^"!==s[u])break;if(!c.parent)throw new Error("Path '"+o+"' not valid for state '"+e.name+"'");c=c.parent}else c=e;s=s.slice(u).join("."),o=c.name+(c.name&&s?".":"")+s}var p=$[o];return!p||!i&&(i||p!==t&&p.self!==t)?n:p}function D(e){var n=(e=f(e,{self:e,resolve:e.resolve||{},toString:function(){return this.name}})).name;if(!a(n)||n.indexOf("@")>=0)throw new Error("State must have a valid name");if($.hasOwnProperty(n))throw new Error("State '"+n+"' is already defined");var r,i,u=-1!==n.indexOf(".")?n.substring(0,n.lastIndexOf(".")):a(e.parent)?e.parent:s(e.parent)&&a(e.parent.name)?e.parent.name:"";if(u&&!$[u])return r=u,i=e.self,x[r]||(x[r]=[]),void x[r].push(i);for(var l in S)o(S[l])&&(e[l]=S[l](e,S.$delegates[l]));return $[n]=e,!e[T]&&e.url&&t.when(e.url,["$match","$stateParams",function(t,n){w.$current.navigable==e&&function(t,e,n){if(!n)for(var r in n=[],t)n.push(r);for(var i=0;i<n.length;i++){var o=n[i];if(t[o]!=e[o])return!1}return!0}(t,n)||w.transitionTo(e,t,{inherit:!0,location:!1})}]),function(t){for(var e=x[t]||[];e.length;)D(e.shift())}(n),e}function A(t,d,x,S,D,A,B,I,O){var M=new Error("transition superseded"),P=C(d.reject(M)),_=C(d.reject(new Error("transition prevented"))),R=C(d.reject(new Error("transition aborted"))),L=C(d.reject(new Error("transition failed")));function N(t,n,r,i,a,s){var c=r?n:y(t.params.$$keys(),n),p={$stateParams:c};a.resolve=D.resolve(t.resolve,p,a.resolve,t);var f=[a.resolve.then(function(t){a.globals=t})];return i&&f.push(i),d.all(f).then(function(){var n=[];return l(t.views,function(r,i){var l=r.resolve&&r.resolve!==t.resolve?r.resolve:{};l.$template=[function(){return x.load(i,{view:r,locals:a.globals,params:c,notify:s.notify})||""}],n.push(D.resolve(l,a.globals,a.resolve,t).then(function(n){if(o(r.controllerProvider)||u(r.controllerProvider)){var s=e.extend({},l,a.globals);n.$$controller=S.invoke(r.controllerProvider,null,s)}else n.$$controller=r.controller;n.$$state=t,n.$$controllerAs=r.controllerAs,n.$$resolveAs=r.resolveAs,a[i]=n}))}),d.all(n).then(function(){return a.globals})}).then(function(t){return a})}return h.locals={resolve:null,globals:{$stateParams:{}}},(w={params:{},current:h.self,$current:h,transition:null}).reload=function(t){return w.transitionTo(w.current,A,{reload:t||!0,inherit:!1,notify:!0})},w.go=function(t,e,n){return w.transitionTo(t,e,c({inherit:!0,relative:w.$current},n))},w.transitionTo=function(e,n,o){n=n||{},o=c({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},o||{});var u=w.$current,l=w.params,g=u.path,m=E(e,o.relative),$=n["#"];if(!i(m)){var k={to:e,toParams:n,options:o},x=function(e,n,r,i){var o=t.$broadcast("$stateNotFound",e,n,r);if(o.defaultPrevented)return B.update(),R;if(!o.retry)return null;if(i.$retry)return B.update(),L;var a=w.transition=d.when(o.retry);return a.then(function(){return a!==w.transition?(t.$broadcast("$stateChangeCancel",e.to,e.toParams,n,r),P):(e.options.$retry=!0,w.transitionTo(e.to,e.toParams,e.options))},function(){return R}),B.update(),a}(k,u.self,l,o);if(x)return x;if(n=k.toParams,m=E(e=k.to,(o=k.options).relative),!i(m)){if(!o.relative)throw new Error("No such state '"+e+"'");throw new Error("Could not resolve '"+e+"' from state '"+o.relative+"'")}}if(m[T])throw new Error("Cannot transition to abstract state '"+e+"'");if(o.inherit&&(n=v(A,n||{},w.$current,m)),!m.params.$$validates(n))return L;n=m.params.$$values(n);var D=(e=m).path,I=0,O=D[I],U=h.locals,j=[];if(o.reload){if(a(o.reload)||s(o.reload)){if(s(o.reload)&&!o.reload.name)throw new Error("Invalid reload state object");var q=!0===o.reload?g[0]:E(o.reload);if(o.reload&&!q)throw new Error("No such reload state '"+(a(o.reload)?o.reload:o.reload.name)+"'");for(;O&&O===g[I]&&O!==q;)U=j[I]=O.locals,O=D[++I]}}else for(;O&&O===g[I]&&O.ownParams.$$equals(n,l);)U=j[I]=O.locals,O=D[++I];if(function(t,e,n,i,o,a){if(!a.reload&&t===n&&(o===n.locals||!1===t.self.reloadOnSearch&&function(t,e,n){var i=t.params.$$keys().filter(function(e){return"search"!=t.params[e].location}),o=b.apply({},[t.params].concat(i));return new r.ParamSet(o).$$equals(e,n)}(n,i,e)))return!0}(e,n,u,l,U,o))return $&&(n["#"]=$),w.params=n,p(w.params,A),p(y(e.params.$$keys(),A),e.locals.globals.$stateParams),o.location&&e.navigable&&e.navigable.url&&(B.push(e.navigable.url,n,{$$avoidResync:!0,replace:"replace"===o.location}),B.update(!0)),w.transition=null,d.when(w.current);if(n=y(e.params.$$keys(),n||{}),$&&(n["#"]=$),o.notify&&t.$broadcast("$stateChangeStart",e.self,n,u.self,l,o).defaultPrevented)return t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),null==w.transition&&B.update(),_;for(var F=d.when(U),V=I;V<D.length;O=D[++V])U=j[V]=f(U),F=N(O,n,O===e,F,U,o);var z=w.transition=F.then(function(){var r,i,a;if(w.transition!==z)return t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),P;for(r=g.length-1;r>=I;r--)(a=g[r]).self.onExit&&S.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(r=I;r<D.length;r++)(i=D[r]).locals=j[r],i.self.onEnter&&S.invoke(i.self.onEnter,i.self,i.locals.globals);return w.transition!==z?(t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),P):(w.$current=e,w.current=e.self,w.params=n,p(w.params,A),w.transition=null,o.location&&e.navigable&&B.push(e.navigable.url,e.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===o.location}),o.notify&&t.$broadcast("$stateChangeSuccess",e.self,n,u.self,l),B.update(!0),w.current)}).then(null,function(r){return r===M?P:w.transition!==z?(t.$broadcast("$stateChangeCancel",e.self,n,u.self,l),P):(w.transition=null,t.$broadcast("$stateChangeError",e.self,n,u.self,l,r).defaultPrevented||B.update(),d.reject(r))});return C(z),z},w.is=function(t,e,r){var o=E(t,(r=c({relative:w.$current},r||{})).relative);return i(o)?w.$current===o&&(!e||g(e).reduce(function(t,n){var r=o.params[n];return t&&!r||r.type.equals(A[n],e[n])},!0)):n},w.includes=function(t,e,r){if(r=c({relative:w.$current},r||{}),a(t)&&t.indexOf("*")>-1){if(!function(t){for(var e=t.split("."),n=w.$current.name.split("."),r=0,i=e.length;r<i;r++)"*"===e[r]&&(n[r]="*");return"**"===e[0]&&(n=n.slice(m(n,e[1]))).unshift("**"),"**"===e[e.length-1]&&(n.splice(m(n,e[e.length-2])+1,Number.MAX_VALUE),n.push("**")),e.length==n.length&&n.join("")===e.join("")}(t))return!1;t=w.$current.name}var o=E(t,r.relative);if(!i(o))return n;if(!i(w.$current.includes[o.name]))return!1;if(!e)return!0;for(var s=g(e),u=0;u<s.length;u++){var l=s[u],p=o.params[l];if(p&&!p.type.equals(A[l],e[l]))return!1}return g(e).reduce(function(t,n){var r=o.params[n];return t&&!r||r.type.equals(A[n],e[n])},!0)},w.href=function(t,e,r){var o=E(t,(r=c({lossy:!0,inherit:!0,absolute:!1,relative:w.$current},r||{})).relative);if(!i(o))return null;r.inherit&&(e=v(A,e||{},w.$current,o));var a=o&&r.lossy?o.navigable:o;return a&&a.url!==n&&null!==a.url?B.href(a.url,y(o.params.$$keys().concat("#"),e||{}),{absolute:r.absolute}):null},w.get=function(t,e){if(0===arguments.length)return k(g($),function(t){return $[t].self});var n=E(t,e||w.$current);return n&&n.self?n.self:null},w}(h=D({name:"",url:"^",views:null,abstract:!0})).navigable=null,this.decorator=function(t,e){if(a(t)&&!i(e))return S[t];if(!o(e)||!a(t))return this;S[t]&&!S.$delegates[t]&&(S.$delegates[t]=S[t]);return S[t]=e,this},this.state=function(t,e){s(t)?e=t:e.name=t;return D(e),this},this.$get=A,A.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function A(){function t(t,e){return{load:function(t,n){var r;return(n=c({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},n)).view&&(r=e.fromConfig(n.view,n.params,n.locals)),r}}}this.$get=t,t.$inject=["$rootScope","$templateFactory"]}function B(t,n,r,i,o){var a=n.has?function(t){return n.has(t)?n.get(t):null}:function(t){try{return n.get(t)}catch(t){return null}},s=a("$animator"),u=a("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(n,a,l){return function(n,a,c){var p,d,f,h,g=c.onload||"",m=c.autoscroll,v=function(t,n){if(u)return{enter:function(t,n,r){e.version.minor>2?u.enter(t,null,n).then(r):u.enter(t,null,n,r)},leave:function(t,n){e.version.minor>2?u.leave(t).then(n):u.leave(t,n)}};if(s){var r=s&&s(n,t);return{enter:function(t,e,n){r.enter(t,null,e),n()},leave:function(t,e){r.leave(t),e()}}}return{enter:function(t,e,n){e.after(t),n()},leave:function(t,e){t.remove(),e()}}}(c,n);a.inheritedData("$uiView");function y(s){var u,y=O(n,c,a,i),b=y&&t.$current&&t.$current.locals[y];if(s||b!==h){u=n.$new(),h=t.$current.locals[y],u.$emit("$viewContentLoading",y);var w=l(u,function(t){var i=o.defer(),s=o.defer(),u={$animEnter:i.promise,$animLeave:s.promise,$$animLeave:s};t.data("$uiViewAnim",u),v.enter(t,a,function(){i.resolve(),f&&f.$emit("$viewContentAnimationEnded"),(e.isDefined(m)&&!m||n.$eval(m))&&r(t)}),function(){if(p&&(p.remove(),p=null),f&&(f.$destroy(),f=null),d){var t=d.data("$uiViewAnim");v.leave(d,function(){t.$$animLeave.resolve(),p=null}),p=d,d=null}}()});d=w,(f=u).$emit("$viewContentLoaded",y),f.$eval(g)}}n.$on("$stateChangeSuccess",function(){y(!1)}),y(!0)}}}}function I(t,n,r,i){return{restrict:"ECA",priority:-400,compile:function(a){var s=a.html();return a.empty?a.empty():a[0].innerHTML=null,function(a,u,l){var c=r.$current,p=O(a,l,u,i),d=c&&c.locals[p];if(!d)return u.html(s),void t(u.contents())(a);u.data("$uiView",{name:p,state:d.$$state}),u.html(d.$template?d.$template:s);var f=e.extend({},d);a[d.$$resolveAs]=f;var h=t(u.contents());if(d.$$controller){d.$scope=a,d.$element=u;var g=n(d.$$controller,d);d.$$controllerAs&&(a[d.$$controllerAs]=g,a[d.$$controllerAs][d.$$resolveAs]=f),o(g.$onInit)&&g.$onInit(),u.data("$ngControllerController",g),u.children().data("$ngControllerController",g)}h(a)}}}}function O(t,e,n,r){var i=r(e.uiView||e.name||"")(t),o=n.inheritedData("$uiView");return i.indexOf("@")>=0?i:i+"@"+(o?o.state.name:"")}function M(t,e){var n,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t=e+"("+r[1]+")"),!(n=t.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==n.length)throw new Error("Invalid state ref '"+t+"'");return{state:n[1],paramExpr:n[3]||null}}function P(t){var e=t.parent().inheritedData("$uiView");if(e&&e.state&&e.state.name)return e.state}function _(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),n="FORM"===t[0].nodeName;return{attr:n?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!n}}function R(t,e,n,r,i){return function(o){var a=o.which||o.button,s=i();if(!(a>1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var u=n(function(){e.go(s.state,s.params,s.options)});o.preventDefault();var l=r.isAnchor&&!s.href?1:0;o.preventDefault=function(){l--<=0&&n.cancel(u)}}}}function L(t,n){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(r,i,o,a){var s,u,l=M(o.uiSref,t.current.name),p={state:l.state,href:null,params:null},d=_(i),f=a[1]||a[0],h=null;p.options=c((u=t,{relative:P(i)||u.$current,inherit:!0}),o.uiSrefOpts?r.$eval(o.uiSrefOpts):{});var g=function(n){n&&(p.params=e.copy(n)),p.href=t.href(l.state,p.params,p.options),h&&h(),f&&(h=f.$$addStateInfo(l.state,p.params)),null!==p.href&&o.$set(d.attr,p.href)};l.paramExpr&&(r.$watch(l.paramExpr,function(t){t!==p.params&&g(t)},!0),p.params=e.copy(r.$eval(l.paramExpr))),g(),d.clickable&&(s=R(i,t,n,d,function(){return p}),i[i.on?"on":"bind"]("click",s),r.$on("$destroy",function(){i[i.off?"off":"unbind"]("click",s)}))}}}function N(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,r,i,o){var a,s=_(r),u=o[1]||o[0],l="["+[i.uiState,i.uiStateParams||null,i.uiStateOpts||null].map(function(t){return t||"null"}).join(", ")+"]",c={state:null,params:null,options:null,href:null},p=null;function d(e){c.state=e[0],c.params=e[1],c.options=e[2],c.href=t.href(c.state,c.params,c.options),p&&p(),u&&(p=u.$$addStateInfo(c.state,c.params)),c.href&&i.$set(s.attr,c.href)}n.$watch(l,d,!0),d(n.$eval(l)),s.clickable&&(a=R(r,t,e,s,function(){return c}),r[r.on?"on":"bind"]("click",a),n.$on("$destroy",function(){r[r.off?"off":"unbind"]("click",a)}))}}}function U(t,e,n){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(e,r,i,o){var u,c,p=[],f={};u=n(i.uiSrefActiveEq||"",!1)(e);try{c=e.$eval(i.uiSrefActive)}catch(t){}function h(n,i,o){var u=t.get(n,P(r)),l=function(t,n){if(!a(t))throw new Error("state should be a string");if(s(n))return t+d(n);if(n=e.$eval(n),s(n))return t+d(n);return t}(n,i),c={state:u||{name:n},params:i,hash:l};return p.push(c),f[l]=o,function(){var t=p.indexOf(c);-1!==t&&p.splice(t,1)}}function g(){for(var e=0;e<p.length;e++)o=p[e].state,a=p[e].params,t.includes(o.name,a)?m(r,f[p[e].hash]):v(r,f[p[e].hash]),n=p[e].state,i=p[e].params,t.is(n.name,i)?m(r,u):v(r,u);var n,i,o,a}function m(t,e){o(function(){t.addClass(e)})}function v(t,e){t.removeClass(e)}c=c||n(i.uiSrefActive||"",!1)(e),s(c)&&l(c,function(n,r){if(a(n)){var i=M(n,t.current.name);h(i.state,e.$eval(i.paramExpr),r)}}),this.$$addStateInfo=function(t,e){if(!(s(c)&&p.length>0)){var n=h(t,e,c);return g(),n}},e.$on("$stateChangeSuccess",g),g()}]}}function j(t){var e=function(e,n){return t.is(e,n)};return e.$stateful=!0,e}function q(t){var e=function(e,n,r){return t.includes(e,n,r)};return e.$stateful=!0,e}e.module("ui.router.util",["ng"]),e.module("ui.router.router",["ui.router.util"]),e.module("ui.router.state",["ui.router.router","ui.router.util"]),e.module("ui.router",["ui.router.state"]),e.module("ui.router.compat",["ui.router"]),x.$inject=["$q","$injector"],e.module("ui.router.util").service("$resolve",x),e.module("ui.router.util").provider("$templateFactory",function(){var t=e.version.minor<3;this.shouldUnsafelyUseHttp=function(e){t=!!e},this.$get=["$http","$templateCache","$injector",function(e,n,r){return new function(t,e,n,r){this.fromConfig=function(t,e,n){return i(t.template)?this.fromString(t.template,e):i(t.templateUrl)?this.fromUrl(t.templateUrl,e):i(t.templateProvider)?this.fromProvider(t.templateProvider,e,n):null},this.fromString=function(t,e){return o(t)?t(e):t},this.fromUrl=function(i,a){return o(i)&&(i=i(a)),null==i?null:r?t.get(i,{cache:e,headers:{Accept:"text/html"}}).then(function(t){return t.data}):n.get("$templateRequest")(i)},this.fromProvider=function(t,e,r){return n.invoke(t,null,r||{params:e})}}(e,n,r,t)}]}),T.prototype.concat=function(t,e){var n={caseInsensitive:r.caseInsensitive(),strict:r.strictMode(),squash:r.defaultSquashPolicy()};return new T(this.sourcePath+t+this.sourceSearch,c(n,e),this)},T.prototype.toString=function(){return this.source},T.prototype.exec=function(t,e){var n=this.regexp.exec(t);if(!n)return null;e=e||{};var r,o,a,s,u,l=this.parameters(),c=l.length,p=this.segments.length-1,d={};if(p!==n.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");function f(t){function e(t){return t.split("").reverse().join("")}return k(k(e(t).split(/-(?!\\)/),e),function(t){return t.replace(/\\-/g,"-")}).reverse()}for(r=0;r<p;r++){for(a=l[r],s=this.params[a],u=n[r+1],o=0;o<s.replace.length;o++)s.replace[o].from===u&&(u=s.replace[o].to);u&&!0===s.array&&(u=f(u)),i(u)&&(u=s.type.decode(u)),d[a]=s.value(u)}for(;r<c;r++){for(d[a=l[r]]=this.params[a].value(e[a]),s=this.params[a],u=e[a],o=0;o<s.replace.length;o++)s.replace[o].from===u&&(u=s.replace[o].to);i(u)&&(u=s.type.decode(u)),d[a]=s.value(u)}return d},T.prototype.parameters=function(t){return i(t)?this.params[t]||null:this.$$paramNames},T.prototype.validates=function(t){return this.params.$$validates(t)},T.prototype.format=function(t){t=t||{};var e=this.segments,n=this.parameters(),r=this.params;if(!this.validates(t))return null;var i,o=!1,s=e.length-1,l=n.length,c=e[0];function p(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})}for(i=0;i<l;i++){var d=i<s,f=n[i],h=r[f],g=h.value(t[f]),m=h.isOptional&&h.type.equals(h.value(),g),v=!!m&&h.squash,y=h.type.encode(g);if(d){var b=e[i+1],w=i+1===s;if(!1===v)null!=y&&(u(y)?c+=k(y,p).join("-"):c+=encodeURIComponent(y)),c+=b;else if(!0===v){var $=c.match(/\/$/)?/\/?(.*)/:/(.*)/;c+=b.match($)[1]}else a(v)&&(c+=v+b);w&&!0===h.squash&&"/"===c.slice(-1)&&(c=c.slice(0,-1))}else{if(null==y||m&&!1!==v)continue;if(u(y)||(y=[y]),0===y.length)continue;c+=(o?"&":"?")+f+"="+(y=k(y,encodeURIComponent).join("&"+f+"=")),o=!0}}return c},S.prototype.is=function(t,e){return!0},S.prototype.encode=function(t,e){return t},S.prototype.decode=function(t,e){return t},S.prototype.equals=function(t,e){return t==e},S.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},S.prototype.pattern=/.*/,S.prototype.toString=function(){return"{Type:"+this.name+"}"},S.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},S.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new function(t,e){function r(t,e){return function(){return t[e].apply(t,arguments)}}function o(t){return u(t)?t:i(t)?[t]:[]}function a(t){return!t}function s(t,r){return function(i){if(u(i)&&0===i.length)return i;var s=k(i=o(i),t);return!0===r?0===$(s,a).length:function(t){switch(t.length){case 0:return n;case 1:return"auto"===e?t[0]:t;default:return t}}(s)}}var l;this.encode=s(r(t,"encode")),this.decode=s(r(t,"decode")),this.is=s(r(t,"is"),!0),this.equals=(l=r(t,"equals"),function(t,e){var n=o(t),r=o(e);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!l(n[i],r[i]))return!1;return!0}),this.pattern=t.pattern,this.$normalize=s(r(t,"$normalize")),this.name=t.name,this.$arrayMode=e}(this,t)},e.module("ui.router.util").provider("$urlMatcherFactory",function t(){r=this;var p=!1,d=!0,h=!1;function v(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t}var y,b={},w=!0,C=[],x={string:{encode:v,decode:function(t){return null!=t?t.toString().replace(/(~~|~2F)/g,function(t){return{"~~":"~","~2F":"/"}[t]}):t},is:function(t){return null==t||!i(t)||"string"==typeof t},pattern:/[^/]*/},int:{encode:v,decode:function(t){return parseInt(t,10)},is:function(t){return t!==n&&null!==t&&this.decode(t.toString())===t},pattern:/\d+/},bool:{encode:function(t){return t?1:0},decode:function(t){return 0!==parseInt(t,10)},is:function(t){return!0===t||!1===t},pattern:/0|1/},date:{encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):n},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):n},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return this.is(t)&&this.is(e)&&t.toISOString()===e.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:e.toJson,decode:e.fromJson,is:e.isObject,equals:e.equals,pattern:/[^/]*/},any:{encode:e.identity,decode:e.identity,equals:e.equals,pattern:/.*/}};function E(t){return o(t)||u(t)&&o(t[t.length-1])}function D(){for(;C.length;){var t=C.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");e.extend(b[t.name],y.invoke(t.def))}}function A(t){c(this,t||{})}t.$$getDefaultValue=function(t){if(!E(t.value))return t.value;if(!y)throw new Error("Injectable functions cannot be called at configuration time");return y.invoke(t.value)},this.caseInsensitive=function(t){return i(t)&&(p=t),p},this.strictMode=function(t){return i(t)&&(d=t),d},this.defaultSquashPolicy=function(t){if(!i(t))return h;if(!0!==t&&!1!==t&&!a(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return h=t,t},this.compile=function(t,e){return new T(t,c({strict:d,caseInsensitive:p},e))},this.isMatcher=function(t){if(!s(t))return!1;var e=!0;return l(T.prototype,function(n,r){o(n)&&(e=e&&i(t[r])&&o(t[r]))}),e},this.type=function(t,e,n){if(!i(e))return b[t];if(b.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return b[t]=new S(c({name:t},e)),n&&(C.push({name:t,def:n}),w||D()),this},l(x,function(t,e){b[e]=new S(c({name:e},t))}),b=f(b,{}),this.$get=["$injector",function(t){return y=t,w=!1,D(),l(x,function(t,e){b[e]||(b[e]=new S(t))}),this}],this.Param=function(t,r,o,l){var p,d,f=this;-1===m(d=s(p=o)?g(p):[],"value")&&-1===m(d,"type")&&-1===m(d,"squash")&&-1===m(d,"array")&&(p={value:p}),p.$$fn=E(p.value)?p.value:function(){return p.value},r=function(n,r,i){if(n.type&&r)throw new Error("Param '"+t+"' has two type configurations.");return r||(n.type?e.isString(n.type)?b[n.type]:n.type instanceof S?n.type:new S(n.type):"config"===i?b.any:b.string)}(o=p,r,l);var v,w,C=(v={array:"search"===l&&"auto"},w=t.match(/\[\]$/)?{array:!0}:{},c(v,w,o).array);"string"!==(r=C?r.$asArray(C,"search"===l):r).name||C||"path"!==l||o.value!==n||(o.value="");var x,T,D,A,B,I,O,M=o.value!==n,P=function(t,e){var n=t.squash;if(!e||!1===n)return!1;if(!i(n)||null==n)return h;if(!0===n||a(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}(o,M),_=(T=C,A=P,O=[{from:"",to:(D=M)||T?n:""},{from:null,to:D||T?n:""}],B=u((x=o).replace)?x.replace:[],a(A)&&B.push({from:A,to:n}),I=k(B,function(t){return t.from}),$(O,function(t){return-1===m(I,t.from)}).concat(B));c(this,{id:t,type:r,location:l,array:C,squash:P,replace:_,isOptional:M,value:function(t){var e,r,a;return e=t,t=(a=k($(f.replace,(r=e,function(t){return t.from===r})),function(t){return t.to})).length?a[0]:e,i(t)?f.type.$normalize(t):function(){if(!y)throw new Error("Injectable functions cannot be called at configuration time");var t=y.invoke(o.$$fn);if(null!==t&&t!==n&&!f.type.is(t))throw new Error("Default value ("+t+") for parameter '"+f.id+"' is not an instance of Type ("+f.type.name+")");return t}()},dynamic:n,config:o,toString:function(){return"{Param:"+t+" "+r+" squash: '"+P+"' optional: "+M+"}"}})},A.prototype={$$new:function(){return f(this,c(new A,{$$parent:this}))},$$keys:function(){for(var t=[],e=[],n=this,r=g(A.prototype);n;)e.push(n),n=n.$$parent;return e.reverse(),l(e,function(e){l(g(e),function(e){-1===m(t,e)&&-1===m(r,e)&&t.push(e)})}),t},$$values:function(t){var e={},n=this;return l(n.$$keys(),function(r){e[r]=n[r].value(t&&t[r])}),e},$$equals:function(t,e){var n=!0,r=this;return l(r.$$keys(),function(i){var o=t&&t[i],a=e&&e[i];r[i].type.equals(o,a)||(n=!1)}),n},$$validates:function(t){var r,i,o,a,s,u=this.$$keys();for(r=0;r<u.length&&(i=this[u[r]],(o=t[u[r]])!==n&&null!==o||!i.isOptional);r++){if(a=i.type.$normalize(o),!i.type.is(a))return!1;if(s=i.type.encode(a),e.isString(s)&&!i.type.pattern.exec(s))return!1}return!0},$$parent:n},this.ParamSet=A}),e.module("ui.router.util").run(["$urlMatcherFactory",function(t){}]),E.$inject=["$locationProvider","$urlMatcherFactoryProvider"],e.module("ui.router.router").provider("$urlRouter",E),D.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],e.module("ui.router.state").factory("$stateParams",function(){return{}}).constant("$state.runtime",{autoinject:!0}).provider("$state",D).run(["$injector",function(t){t.get("$state.runtime").autoinject&&t.get("$state")}]),A.$inject=[],e.module("ui.router.state").provider("$view",A),e.module("ui.router.state").provider("$uiViewScroll",function(){var t=!1;this.useAnchorScroll=function(){t=!0},this.$get=["$anchorScroll","$timeout",function(e,n){return t?e:function(t){return n(function(){t[0].scrollIntoView()},0,!1)}}]}),B.$inject=["$state","$injector","$uiViewScroll","$interpolate","$q"],I.$inject=["$compile","$controller","$state","$interpolate"],e.module("ui.router.state").directive("uiView",B),e.module("ui.router.state").directive("uiView",I),L.$inject=["$state","$timeout"],N.$inject=["$state","$timeout"],U.$inject=["$state","$stateParams","$interpolate"],e.module("ui.router.state").directive("uiSref",L).directive("uiSrefActive",U).directive("uiSrefActiveEq",U).directive("uiState",N),j.$inject=["$state"],q.$inject=["$state"],e.module("ui.router.state").filter("isState",j).filter("includedByState",q)}(window,window.angular),function(t,e,n){"use strict";e.module("angulartics.google.analytics",["angulartics"]).config(["$analyticsProvider",function(n){n.settings.pageTracking.trackRelativePath=!0,n.settings.ga={additionalAccountNames:void 0,additionalAccountHitTypes:{pageview:!0,event:!0,exception:!1,ecommerce:!1,userTiming:!1,setUserProperties:!1,userId:!1},disableEventTracking:null,disablePageTracking:null,enhancedEcommerce:!1,transport:null,userId:null},n.registerPageTrack(function(t,i){i=i||{},n.settings.ga.disablePageTracking||r("pageview","send",e.extend({},i,{hitType:"pageview",page:t}))}),n.registerEventTrack(function(i,o){if(!n.settings.ga.disableEventTracking&&(i||i+""=="0")){if((o=o||{}).category=o.category||"Event",o.value){var a=parseInt(o.value,10);o.value=isNaN(a)?0:a}e.isFunction(o.hitCallback)||(o.hitCallback=null),o.nonInteraction=o.nonInteraction||o.noninteraction,r("event","send",e.extend({},o,{hitType:"event",eventCategory:o.category,eventAction:i,eventLabel:o.label,eventValue:o.value,nonInteraction:o.nonInteraction,page:o.page||t.location.hash.substring(1)||t.location.pathname,hitCallback:o.hitCallback}))}}),n.registerExceptionTrack(function(e,n){r("exception","send",{hitType:"event",eventCategory:"Exceptions",eventAction:e.toString(),eventLabel:e.stack,nonInteraction:!0,page:t.location.hash.substring(1)||t.location.pathname,isException:!0})}),n.registerSetUsername(function(t){n.settings.ga.userId=t}),n.registerSetUserProperties(function(t){t&&r("setUserProperties","set",function(t){var e,n={};for(e in t)e.indexOf("dimension")&&e.indexOf("metric")||(n[e]=t[e]);return n}(t))}),n.registerUserTimings(function(n){if(!e.isObject(n)||e.isArray(n))return console.log("Required argument properties is missing or not an object");e.forEach(["timingCategory","timingVar","timingValue"],function(t){if(e.isUndefined(n[t]))return console.log("Argument properties missing required property "+t)}),r("userTiming","send",{hitType:"timing",timingCategory:n.timingCategory,timingVar:n.timingVar,timingValue:n.timingValue,timingLabel:n.timingLabel,optSampleRate:n.optSampleRate,page:n.page||t.location.hash.substring(1)||t.location.pathname})}),n.registerTransactionTrack(function(t){var n,i;if(r("ecommerce","require","ecommerce"),r("ecommerce","ecommerce:addTransaction",t),t.products)for(i=0;i<t.products.length;i++)(n=t.products[i]).sku=n.id,n.id=t.id,r("ecommerce","ecommerce:addItem",t.products[i]);t.currencyCode&&r("ecommerce","_set",t.currencyCode),r("ecommerce","ecommerce:send",e.copy(t))});var r=function(){var r,i;return e.isUndefined(t._gaq)||(r=function(r,i,o){if("set"===r)return console.log('Classic Analytics does not support the "set" command or Custom Dimensions. Command ignored.');var a;if("send"===r)switch(i.hitType){case"pageview":a=["_trackPageview",i.page];break;case"event":a=["_trackEvent",i.category,i.action,i.label,i.value,i.nonInteraction];break;case"timing":a=["_trackTiming",i.timingCategory,i.timingVar,i.timingValue,i.timingLabel,i.optSampleRate]}"ecommerce:addTransaction"===r&&(a=["_addTrans",i.id,i.affiliation,i.revenue,i.tax,i.shipping,i.billingCity,i.billingRegion,i.billingCountry]);"ecommerce:addItem"===r&&(a=["_addItem",i.id,i.sku,i.name,i.category,i.price,i.quantity]);"_set"===r&&(a=["_set","currencyCode",i]);"ecommerce:send"===r&&(a=["_trackTrans"]);if(!a)return console.log("Unable to find command "+r+" or fieldsObj missing required properties. Command ignored.");t._gaq.push(a),o&&e.forEach(n.settings.ga.additionalAccountNames,function(e){var n=[].slice.call(a);n[0]=e+"."+n[0],t._gaq.push(n)})}),(i=t.GoogleAnalyticsObject)&&t[i]&&(r=function(t,r,i){var a,s=n.settings.ga.userId;if("require"===t&&"ecommerce"===r)return a=r,n.settings.ga.enhancedEcommerce&&(a="ec"),o([t,a],i);s&&e.isObject(r)&&(r.userId=s);n.settings.ga.transport&&(r.transport=n.settings.ga.transport);if(t.indexOf("ecommerce:")>-1&&n.settings.ga.enhancedEcommerce)switch(t){case"ecommerce:addTransaction":t=["ec:setAction","purchase"];break;case"ecommerce:addItem":t="ec:addProduct",r.id=r.sku;break;case"ecommerce:send":t="send",r.hitType="event",r.eventCategory="Angulartics Enhanced Ecommerce",r.eventAction="Purchase",r.nonInteraction=!0}o(t instanceof Array?t.concat(r):[t,r],i)}),r?function(t,e,i){var o=n.settings.ga.additionalAccountHitTypes[t];r(e,i,o)}:e.noop;function o(r,i){var o,a=n.settings.ga.userId,s=t.GoogleAnalyticsObject;t[s].apply(this,r),i&&(o=e.copy(r),a&&!n.settings.ga.additionalAccountHitTypes.userId&&o[2]&&"object"==typeof o[2]&&delete o[2].userId,e.forEach(n.settings.ga.additionalAccountNames,function(e){o[0]=e+"."+o[0],t[s].apply(this,o)}))}}()}])}(window,window.angular),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Clipboard=t()}}(function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){var r=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}e.exports=function(t,e){for(;t&&t.nodeType!==r;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},{}],2:[function(t,e,n){var r=t("./closest");e.exports=function(t,e,n,i,o){var a=function(t,e,n,i){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&i.call(t,n)}}.apply(this,arguments);return t.addEventListener(n,a,o),{destroy:function(){t.removeEventListener(n,a,o)}}}},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){var r=t("./is"),i=t("delegate");e.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!r.string(e))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(t))return d=e,f=n,(p=t).addEventListener(d,f),{destroy:function(){p.removeEventListener(d,f)}};if(r.nodeList(t))return u=t,l=e,c=n,Array.prototype.forEach.call(u,function(t){t.addEventListener(l,c)}),{destroy:function(){Array.prototype.forEach.call(u,function(t){t.removeEventListener(l,c)})}};if(r.string(t))return o=t,a=e,s=n,i(document.body,o,a,s);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,a,s,u,l,c,p,d,f}},{"./is":3,delegate:2}],5:[function(t,e,n){e.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(t),r.removeAllRanges(),r.addRange(i),e=r.toString()}return e}},{}],6:[function(t,e,n){function r(){}r.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function i(){r.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,a=r.length;o<a;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}},e.exports=r},{}],7:[function(t,e,n){!function(r,i){if(void 0!==n)i(e,t("select"));else{var o={exports:{}};i(o,r.select),r.clipboardAction=o.exports}}(this,function(t,e){"use strict";var n,r=(n=e)&&n.__esModule?n:{default:n};var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},{select:5}],8:[function(t,e,n){!function(r,i){if(void 0!==n)i(e,t("./clipboard-action"),t("tiny-emitter"),t("good-listener"));else{var o={exports:{}};i(o,r.clipboardAction,r.tinyEmitter,r.goodListener),r.clipboard=o.exports}}(this,function(t,e,n,r){"use strict";var i=s(e),o=s(n),a=s(r);function s(t){return t&&t.__esModule?t:{default:t}}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var l=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var c=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.resolveOptions(n),r.listenClick(t),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),l(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===u(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,a.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return p("action",t)}},{key:"defaultTarget",value:function(t){var e=p("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return p("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}();function p(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=c})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var n=e();n._onReady(n.init),t.Duo=n}}(this,function(){var t,e,n,r,i,o=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/,a=/^ERR\|[\w\s\.\(\)]+$/,s=/^DUO_OPEN_WINDOW\|/,u=["duo.com","duosecurity.com","duomobile.s3-us-west-1.amazonaws.com"],l="duo_iframe",c="",p="sig_response";function d(t,e){throw new Error("Duo Web SDK error: "+t+(e?"\nSee "+e+" for more information":""))}function f(t,e){return"dataset"in t?t.dataset[e]:t.getAttribute("data-"+e.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase())}function h(t,e,n,r){"addEventListener"in window?t.addEventListener(e,r,!1):t.attachEvent(n,r)}function g(t,e,n,r){"removeEventListener"in window?t.removeEventListener(e,r,!1):t.detachEvent(n,r)}function m(t){h(document,"DOMContentLoaded","onreadystatechange",t)}function v(t){g(document,"DOMContentLoaded","onreadystatechange",t)}function y(t){if(t){0===t.indexOf("ERR|")&&d(t.split("|")[1]),-1!==t.indexOf(":")&&2===t.split(":").length||d("Duo was given a bad token. This might indicate a configuration problem with one of Duo's client libraries.","https://www.duosecurity.com/docs/duoweb#first-steps");var r=t.split(":");return t,e=r[0],n=r[1],{sigRequest:t,duoSig:r[0],appSig:r[1]}}}function b(){if(!(r=document.getElementById(l)))throw new Error('This page does not contain an iframe for Duo to use.Add an element like <iframe id="duo_iframe"></iframe> to this page. See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe for more information.');k(),v(b)}function w(e){return Boolean(e.origin==="https://"+t&&"string"==typeof e.data&&(e.data.match(o)||e.data.match(a)||e.data.match(s)))}function $(t){if(w(t))if(t.data.match(s)){var e=t.data.substring("DUO_OPEN_WINDOW|".length);(function(t){if(!t)return!1;var e=document.createElement("a");{if(e.href=t,"duotrustedendpoints:"===e.protocol)return!0;if("https:"!==e.protocol)return!1}for(var n=0;n<u.length;n++)if(e.hostname.endsWith("."+u[n])||e.hostname===u[n])return!0;return!1})(e)&&window.open(e,"_self")}else C(t.data),g(window,"message","onmessage",$)}function k(){t||(t=f(r,"host"))||d("No API hostname is given for Duo to use. Be sure to pass a `host` parameter to Duo.init, or through the `data-host` attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe"),e&&n||(y(f(r,"sigRequest")),e&&n||d("No valid signed request is given. Be sure to give the `sig_request` parameter to Duo.init, or use the `data-sig-request` attribute on the iframe element.","https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe")),""===c&&(c=f(r,"postAction")||c),"sig_response"===p&&(p=f(r,"postArgument")||p),r.src=["https://",t,"/frame/web/v1/auth?tx=",e,"&parent=",encodeURIComponent(document.location.href),"&v=2.6"].join(""),h(window,"message","onmessage",$)}function C(t){var e=document.createElement("input");e.type="hidden",e.name=p,e.value=t+":"+n;var o=document.getElementById("duo_form");o||(o=document.createElement("form"),r.parentElement.insertBefore(o,r.nextSibling)),o.method="POST",o.action=c,o.appendChild(e),"function"==typeof i?i.call(null,o):o.submit()}return{init:function e(n){n&&(n.host&&(t=n.host),n.sig_request&&y(n.sig_request),n.post_action&&(c=n.post_action),n.post_argument&&(p=n.post_argument),n.iframe&&(n.iframe.tagName?r=n.iframe:"string"==typeof n.iframe&&(l=n.iframe)),"function"==typeof n.submit_callback&&(i=n.submit_callback)),(r=document.getElementById(l))?k():m(b),v(e)},_onReady:m,_parseSigRequest:y,_isDuoMessage:w,_doPostBack:C}}),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.forge=e():t.forge=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,n){var r=n(0),i=t.exports=r.util=r.util||{};function o(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function a(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(i.isArrayBuffer(t)||i.isArrayBufferView(t)){var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var n=0;n<e.length;++n)this.putByte(e[n])}}else(t instanceof a||"object"==typeof t&&"string"==typeof t.data&&"number"==typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick)return i.nextTick=process.nextTick,void("function"==typeof setImmediate?i.setImmediate=setImmediate:i.setImmediate=i.nextTick);if("function"==typeof setImmediate)return i.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(i.nextTick=function(t){return setImmediate(t)});if(i.setImmediate=function(t){setTimeout(t,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var t="forge.setImmediate",e=[];i.setImmediate=function(n){e.push(n),1===e.length&&window.postMessage(t,"*")},window.addEventListener("message",function(n){if(n.source===window&&n.data===t){n.stopPropagation();var r=e.slice();e.length=0,r.forEach(function(t){t()})}},!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),r=!0,o=document.createElement("div");e=[];new MutationObserver(function(){var t=e.slice();e.length=0,t.forEach(function(t){t()})}).observe(o,{attributes:!0});var a=i.setImmediate;i.setImmediate=function(t){Date.now()-n>15?(n=Date.now(),a(t)):(e.push(t),1===e.length&&o.setAttribute("a",r=!r))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},i.isArrayBufferView=function(t){return t&&i.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},i.ByteBuffer=a,i.ByteStringBuffer=a;i.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},i.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var n=this.data;e>0;)1&e&&(n+=t),(e>>>=1)>0&&(t+=t);return this.data=n,this._optimizeConstructedString(e),this},i.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},i.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(i.encodeUtf8(t))},i.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},i.ByteStringBuffer.prototype.putInt=function(t,e){o(e);var n="";do{e-=8,n+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(n)},i.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},i.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},i.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},i.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},i.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t},i.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t},i.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},i.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t},i.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t},i.ByteStringBuffer.prototype.getInt=function(t){o(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},i.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),n=2<<t-2;return e>=n&&(e-=n<<1),e},i.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},i.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},i.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},i.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var t=i.createBuffer(this.data);return t.read=this.read,t},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var n=this.data.charCodeAt(e);n<16&&(t+="0"),t+=n.toString(16)}return t},i.ByteStringBuffer.prototype.toString=function(){return i.decodeUtf8(this.bytes())},i.DataBuffer=function(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var n=i.isArrayBuffer(t),r=i.isArrayBufferView(t);if(n||r)return this.data=n?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)},i.DataBuffer.prototype.length=function(){return this.write-this.read},i.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},i.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var n=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+e);return r.set(n),this.data=new DataView(r.buffer),this},i.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},i.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var n=0;n<e;++n)this.data.setUint8(t);return this},i.DataBuffer.prototype.putBytes=function(t,e){if(i.isArrayBufferView(t)){var n=(r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-r.byteOffset;return this.accommodate(n),new Uint8Array(this.data.buffer,this.write).set(r),this.write+=n,this}if(i.isArrayBuffer(t)){var r=new Uint8Array(t);return this.accommodate(r.byteLength),new Uint8Array(this.data.buffer).set(r,this.write),this.write+=r.byteLength,this}if(t instanceof i.DataBuffer||"object"==typeof t&&"number"==typeof t.read&&"number"==typeof t.write&&i.isArrayBufferView(t.data)){r=new Uint8Array(t.data.byteLength,t.read,t.length());return this.accommodate(r.byteLength),new Uint8Array(t.data.byteLength,this.write).set(r),this.write+=r.byteLength,this}if(t instanceof i.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"==typeof t){var o;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.hex.decode(t,o,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.base64.decode(t,o,this.write),this;if("utf8"===e&&(t=i.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.raw.decode(o),this;if("utf16"===e)return this.accommodate(2*t.length),o=new Uint16Array(this.data.buffer,this.write),this.write+=i.text.utf16.encode(o),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},i.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},i.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},i.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},i.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(t,e){o(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},i.DataBuffer.prototype.putSignedInt=function(t,e){return o(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},i.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},i.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},i.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},i.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},i.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},i.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},i.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},i.DataBuffer.prototype.getInt=function(t){o(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},i.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),n=2<<t-2;return e>=n&&(e-=n<<1),e},i.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},i.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},i.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},i.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var n=this.data.getUint8(e);n<16&&(t+="0"),t+=n.toString(16)}return t},i.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return i.binary.raw.encode(e);if("hex"===t)return i.binary.hex.encode(e);if("base64"===t)return i.binary.base64.encode(e);if("utf8"===t)return i.text.utf8.decode(e);if("utf16"===t)return i.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},i.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=i.encodeUtf8(t)),new i.ByteBuffer(t)},i.fillString=function(t,e){for(var n="";e>0;)1&e&&(n+=t),(e>>>=1)>0&&(t+=t);return n},i.xorBytes=function(t,e,n){for(var r="",i="",o="",a=0,s=0;n>0;--n,++a)i=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(r+=o,o="",s=0),o+=String.fromCharCode(i),++s;return r+=o},i.hexToBytes=function(t){var e="",n=0;for(!0&t.length&&(n=1,e+=String.fromCharCode(parseInt(t[0],16)));n<t.length;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e},i.bytesToHex=function(t){return i.createBuffer(t).toHex()},i.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];i.encode64=function(t,e){for(var n,r,i,o="",a="",u=0;u<t.length;)n=t.charCodeAt(u++),r=t.charCodeAt(u++),i=t.charCodeAt(u++),o+=s.charAt(n>>2),o+=s.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=s.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":s.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},i.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,n,r,i,o="",a=0;a<t.length;)e=u[t.charCodeAt(a++)-43],n=u[t.charCodeAt(a++)-43],r=u[t.charCodeAt(a++)-43],i=u[t.charCodeAt(a++)-43],o+=String.fromCharCode(e<<2|n>>4),64!==r&&(o+=String.fromCharCode((15&n)<<4|r>>2),64!==i&&(o+=String.fromCharCode((3&r)<<6|i)));return o},i.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},i.decodeUtf8=function(t){return decodeURIComponent(escape(t))},i.binary={raw:{},hex:{},base64:{}},i.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},i.binary.raw.decode=function(t,e,n){var r=e;r||(r=new Uint8Array(t.length));for(var i=n=n||0,o=0;o<t.length;++o)r[i++]=t.charCodeAt(o);return e?i-n:r},i.binary.hex.encode=i.bytesToHex,i.binary.hex.decode=function(t,e,n){var r=e;r||(r=new Uint8Array(Math.ceil(t.length/2)));var i=0,o=n=n||0;for(1&t.length&&(i=1,r[o++]=parseInt(t[0],16));i<t.length;i+=2)r[o++]=parseInt(t.substr(i,2),16);return e?o-n:r},i.binary.base64.encode=function(t,e){for(var n,r,i,o="",a="",u=0;u<t.byteLength;)n=t[u++],r=t[u++],i=t[u++],o+=s.charAt(n>>2),o+=s.charAt((3&n)<<4|r>>4),isNaN(r)?o+="==":(o+=s.charAt((15&r)<<2|i>>6),o+=isNaN(i)?"=":s.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},i.binary.base64.decode=function(t,e,n){var r,i,o,a,s=e;s||(s=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var l=0,c=n=n||0;l<t.length;)r=u[t.charCodeAt(l++)-43],i=u[t.charCodeAt(l++)-43],o=u[t.charCodeAt(l++)-43],a=u[t.charCodeAt(l++)-43],s[c++]=r<<2|i>>4,64!==o&&(s[c++]=(15&i)<<4|o>>2,64!==a&&(s[c++]=(3&o)<<6|a));return e?c-n:s.subarray(0,c)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(t,e,n){t=i.encodeUtf8(t);var r=e;r||(r=new Uint8Array(t.length));for(var o=n=n||0,a=0;a<t.length;++a)r[o++]=t.charCodeAt(a);return e?o-n:r},i.text.utf8.decode=function(t){return i.decodeUtf8(String.fromCharCode.apply(null,t))},i.text.utf16.encode=function(t,e,n){var r=e;r||(r=new Uint8Array(2*t.length));for(var i=new Uint16Array(r.buffer),o=n=n||0,a=n,s=0;s<t.length;++s)i[a++]=t.charCodeAt(s),o+=2;return e?o-n:r},i.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},i.deflate=function(t,e,n){if(e=i.decode64(t.deflate(i.encode64(e)).rval),n){var r=2;32&e.charCodeAt(1)&&(r=6),e=e.substring(r,e.length-4)}return e},i.inflate=function(t,e,n){var r=t.inflate(i.encode64(e)).rval;return null===r?null:i.decode64(r)};var l=function(t,e,n){if(!t)throw new Error("WebStorage not available.");var r;if(null===n?r=t.removeItem(e):(n=i.encode64(JSON.stringify(n)),r=t.setItem(e,n)),void 0!==r&&!0!==r.rval){var o=new Error(r.error.message);throw o.id=r.error.id,o.name=r.error.name,o}},c=function(t,e){if(!t)throw new Error("WebStorage not available.");var n=t.getItem(e);if(t.init)if(null===n.rval){if(n.error){var r=new Error(n.error.message);throw r.id=n.error.id,r.name=n.error.name,r}n=null}else n=n.rval;return null!==n&&(n=JSON.parse(i.decode64(n))),n},p=function(t,e,n,r){var i=c(t,e);null===i&&(i={}),i[n]=r,l(t,e,i)},d=function(t,e,n){var r=c(t,e);return null!==r&&(r=n in r?r[n]:null),r},f=function(t,e,n){var r=c(t,e);if(null!==r&&n in r){delete r[n];var i=!0;for(var o in r){i=!1;break}i&&(r=null),l(t,e,r)}},h=function(t,e){l(t,e,null)},g=function(t,e,n){var r,i=null;void 0===n&&(n=["web","flash"]);var o=!1,a=null;for(var s in n){r=n[s];try{if("flash"===r||"both"===r){if(null===e[0])throw new Error("Flash local storage not available.");i=t.apply(this,e),o="flash"===r}"web"!==r&&"both"!==r||(e[0]=localStorage,i=t.apply(this,e),o=!0)}catch(t){a=t}if(o)break}if(!o)throw a;return i};i.setItem=function(t,e,n,r,i){g(p,arguments,i)},i.getItem=function(t,e,n,r){return g(d,arguments,r)},i.removeItem=function(t,e,n,r){g(f,arguments,r)},i.clearItems=function(t,e,n){g(h,arguments,n)},i.parseUrl=function(t){var e=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;e.lastIndex=0;var n=e.exec(t),r=null===n?null:{full:t,scheme:n[1],host:n[2],port:n[3],path:n[4]};return r&&(r.fullHost=r.host,r.port?80!==r.port&&"http"===r.scheme?r.fullHost+=":"+r.port:443!==r.port&&"https"===r.scheme&&(r.fullHost+=":"+r.port):"http"===r.scheme?r.port=80:"https"===r.scheme&&(r.port=443),r.full=r.scheme+"://"+r.fullHost),r};var m=null;i.getQueryVariables=function(t){var e,n=function(t){for(var e={},n=t.split("&"),r=0;r<n.length;r++){var i,o,a=n[r].indexOf("=");a>0?(i=n[r].substring(0,a),o=n[r].substring(a+1)):(i=n[r],o=null),i in e||(e[i]=[]),i in Object.prototype||null===o||e[i].push(unescape(o))}return e};return void 0===t?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?n(window.location.search.substring(1)):{}),e=m):e=n(t),e},i.parseFragment=function(t){var e=t,n="",r=t.indexOf("?");r>0&&(e=t.substring(0,r),n=t.substring(r+1));var o=e.split("/");return o.length>0&&""===o[0]&&o.shift(),{pathString:e,queryString:n,path:o,query:""===n?{}:i.getQueryVariables(n)}},i.makeRequest=function(t){var e=i.parseFragment(t),n={path:e.pathString,query:e.queryString,getPath:function(t){return void 0===t?e.path:e.path[t]},getQuery:function(t,n){var r;return void 0===t?r=e.query:(r=e.query[t])&&void 0!==n&&(r=r[n]),r},getQueryLast:function(t,e){var r=n.getQuery(t);return r?r[r.length-1]:e}};return n},i.makeLink=function(t,e,n){t=jQuery.isArray(t)?t.join("/"):t;var r=jQuery.param(e||{});return n=n||"",t+(r.length>0?"?"+r:"")+(n.length>0?"#"+n:"")},i.setPath=function(t,e,n){if("object"==typeof t&&null!==t)for(var r=0,i=e.length;r<i;){var o=e[r++];if(r==i)t[o]=n;else{var a=o in t;(!a||a&&"object"!=typeof t[o]||a&&null===t[o])&&(t[o]={}),t=t[o]}}},i.getPath=function(t,e,n){for(var r=0,i=e.length,o=!0;o&&r<i&&"object"==typeof t&&null!==t;){var a=e[r++];(o=a in t)&&(t=t[a])}return o?t:n},i.deletePath=function(t,e){if("object"==typeof t&&null!==t)for(var n=0,r=e.length;n<r;){var i=e[n++];if(n==r)delete t[i];else{if(!(i in t)||"object"!=typeof t[i]||null===t[i])break;t=t[i]}}},i.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},i.format=function(t){for(var e,n,r=/%./g,i=0,o=[],a=0;e=r.exec(t);){(n=t.substring(a,r.lastIndex-2)).length>0&&o.push(n),a=r.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(t.substring(a)),o.join("")},i.formatNumber=function(t,e,n,r){var i=t,o=isNaN(e=Math.abs(e))?2:e,a=void 0===n?",":n,s=void 0===r?".":r,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-l).toFixed(o).slice(2):"")},i.formatSize=function(t){return t=t>=1073741824?i.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?i.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?i.formatNumber(t/1024,0)+" KiB":i.formatNumber(t,0)+" bytes"},i.bytesFromIP=function(t){return-1!==t.indexOf(".")?i.bytesFromIPv4(t):-1!==t.indexOf(":")?i.bytesFromIPv6(t):null},i.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=i.createBuffer(),n=0;n<t.length;++n){var r=parseInt(t[n],10);if(isNaN(r))return null;e.putByte(r)}return e.getBytes()},i.bytesFromIPv6=function(t){for(var e=0,n=2*(8-(t=t.split(":").filter(function(t){return 0===t.length&&++e,!0})).length+e),r=i.createBuffer(),o=0;o<8;++o)if(t[o]&&0!==t[o].length){var a=i.hexToBytes(t[o]);a.length<2&&r.putByte(0),r.putBytes(a)}else r.fillWithByte(0,n),n=0;return r.getBytes()},i.bytesToIP=function(t){return 4===t.length?i.bytesToIPv4(t):16===t.length?i.bytesToIPv6(t):null},i.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e.join(".")},i.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],n=[],r=0,o=0;o<t.length;o+=2){for(var a=i.bytesToHex(t[o]+t[o+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=n[n.length-1],u=e.length;s&&u===s.end+1?(s.end=u,s.end-s.start>n[r].end-n[r].start&&(r=n.length-1)):n.push({start:u,end:u})}e.push(a)}if(n.length>0){var l=n[r];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),0===l.start&&e.unshift(""),7===l.end&&e.push(""))}return e.join(":")},i.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in i&&!t.update)return e(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,e(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,e(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,e(null,i.cores);var n=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),n=e+4;Date.now()<n;);self.postMessage({st:e,et:n})})}.toString(),")()"],{type:"application/javascript"}));!function t(r,o,a){if(0===o){var s=Math.floor(r.reduce(function(t,e){return t+e},0)/r.length);return i.cores=Math.max(1,s),URL.revokeObjectURL(n),e(null,i.cores)}!function(t,e){for(var r=[],i=[],o=0;o<t;++o){var a=new Worker(n);a.addEventListener("message",function(n){if(i.push(n.data),i.length===t){for(var o=0;o<t;++o)r[o].terminate();e(null,i)}}),r.push(a)}for(var o=0;o<t;++o)r[o].postMessage(o)}(a,function(e,n){r.push(function(t,e){for(var n=[],r=0;r<t;++r)for(var i=e[r],o=n[r]=[],a=0;a<t;++a)if(r!==a){var s=e[a];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&o.push(a)}return n.reduce(function(t,e){return Math.max(t,e.length)},0)}(a,n)),t(r,o-1,a)})}([],5,16)}},function(t,e,n){var r=n(0);t.exports=r.md=r.md||{},r.md.algorithms=r.md.algorithms||{}},function(t,e,n){var r=n(0);n(6),n(9),n(17),n(1),r.random&&r.random.getBytes?t.exports=r.random:function(e){var n={},i=new Array(4),o=r.util.createBuffer();function a(){var t=r.prng.create(n);return t.getBytes=function(e,n){return t.generate(e,n)},t.getBytesSync=function(e){return t.generate(e)},t}n.formatKey=function(t){var e=r.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),r.aes._expandKey(t,!1)},n.formatSeed=function(t){var e=r.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},n.cipher=function(t,e){return r.aes._updateBlock(t,e,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},n.increment=function(t){return++t[3],t},n.md=r.md.sha256;var s=a(),u=null;if("undefined"!=typeof window){var l=window.crypto||window.msCrypto;l&&l.getRandomValues&&(u=function(t){return l.getRandomValues(t)})}if(r.options.usePureJavaScript||!r.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var c="";for(var p in navigator)try{"string"==typeof navigator[p]&&(c+=navigator[p])}catch(t){}s.collect(c),c=null}e&&(e().mousemove(function(t){s.collectInt(t.clientX,16),s.collectInt(t.clientY,16)}),e().keypress(function(t){s.collectInt(t.charCode,8)}))}if(r.random)for(var p in s)r.random[p]=s[p];else r.random=s;r.random.createInstance=a,t.exports=r.random}("undefined"!=typeof jQuery?jQuery:null)},function(t,e,n){var r=n(0);n(2),n(1),(t.exports=r.hmac=r.hmac||{}).create=function(){var t=null,e=null,n=null,i=null,o={start:function(o,a){if(null!==o)if("string"==typeof o){if(!((o=o.toLowerCase())in r.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');e=r.md.algorithms[o].create()}else e=o;if(null===a)a=t;else{if("string"==typeof a)a=r.util.createBuffer(a);else if(r.util.isArray(a)){var s=a;a=r.util.createBuffer();for(var u=0;u<s.length;++u)a.putByte(s[u])}var l=a.length();l>e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),n=r.util.createBuffer(),i=r.util.createBuffer(),l=a.length();for(u=0;u<l;++u){s=a.at(u);n.putByte(54^s),i.putByte(92^s)}if(l<e.blockLength)for(s=e.blockLength-l,u=0;u<s;++u)n.putByte(54),i.putByte(92);t=a,n=n.bytes(),i=i.bytes()}e.start(),e.update(n)},update:function(t){e.update(t)},getMac:function(){var t=e.digest().bytes();return e.start(),e.update(i),e.update(t),e.digest()}};return o.digest=o.getMac,o}},function(t,e){},function(t,e,n){var r=n(0);function i(t,e){r.cipher.registerAlgorithm(t,function(){return new r.aes.Algorithm(t,e)})}n(12),n(13),n(1),t.exports=r.aes=r.aes||{},r.aes.startEncrypting=function(t,e,n,r){var i=g({key:t,output:n,decrypt:!1,mode:r});return i.start(e),i},r.aes.createEncryptionCipher=function(t,e){return g({key:t,output:null,decrypt:!1,mode:e})},r.aes.startDecrypting=function(t,e,n,r){var i=g({key:t,output:n,decrypt:!0,mode:r});return i.start(e),i},r.aes.createDecryptionCipher=function(t,e){return g({key:t,output:null,decrypt:!0,mode:e})},r.aes.Algorithm=function(t,e){c||d();var n=this;n.name=t,n.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return h(n._w,t,e,!1)},decrypt:function(t,e){return h(n._w,t,e,!0)}}}),n._init=!1},r.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,n=t.key;if("string"!=typeof n||16!==n.length&&24!==n.length&&32!==n.length){if(r.util.isArray(n)&&(16===n.length||24===n.length||32===n.length)){e=n,n=r.util.createBuffer();for(var i=0;i<e.length;++i)n.putByte(e[i])}}else n=r.util.createBuffer(n);if(!r.util.isArray(n)){e=n,n=[];var o=e.length();if(16===o||24===o||32===o){o>>>=2;for(i=0;i<o;++i)n.push(e.getInt32())}}if(!r.util.isArray(n)||4!==n.length&&6!==n.length&&8!==n.length)throw new Error("Invalid key parameter.");var a=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=f(n,t.decrypt&&!s),this._init=!0}},r.aes._expandKey=function(t,e){return c||d(),f(t,e)},r.aes._updateBlock=h,i("AES-ECB",r.cipher.modes.ecb),i("AES-CBC",r.cipher.modes.cbc),i("AES-CFB",r.cipher.modes.cfb),i("AES-OFB",r.cipher.modes.ofb),i("AES-CTR",r.cipher.modes.ctr),i("AES-GCM",r.cipher.modes.gcm);var o,a,s,u,l,c=!1,p=4;function d(){c=!0,s=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;o=new Array(256),a=new Array(256),u=new Array(4),l=new Array(4);for(e=0;e<4;++e)u[e]=new Array(256),l[e]=new Array(256);var n,r,i,p,d,f,h,g=0,m=0;for(e=0;e<256;++e){p=(p=m^m<<1^m<<2^m<<3^m<<4)>>8^255&p^99,o[g]=p,a[p]=g,f=(d=t[p])<<24^p<<16^p<<8^p^d,h=((n=t[g])^(r=t[n])^(i=t[r]))<<24^(g^i)<<16^(g^r^i)<<8^g^n^i;for(var v=0;v<4;++v)u[v][g]=f,l[v][p]=h,f=f<<24|f>>>8,h=h<<24|h>>>8;0===g?g=m=1:(g=n^t[t[t[n^i]]],m^=t[t[m]])}}function f(t,e){for(var n,r=t.slice(0),i=1,a=r.length,u=p*(a+6+1),c=a;c<u;++c)n=r[c-1],c%a==0?(n=o[n>>>16&255]<<24^o[n>>>8&255]<<16^o[255&n]<<8^o[n>>>24]^s[i]<<24,i++):a>6&&c%a==4&&(n=o[n>>>24]<<24^o[n>>>16&255]<<16^o[n>>>8&255]<<8^o[255&n]),r[c]=r[c-a]^n;if(e){for(var d,f=l[0],h=l[1],g=l[2],m=l[3],v=r.slice(0),y=(c=0,(u=r.length)-p);c<u;c+=p,y-=p)if(0===c||c===u-p)v[c]=r[y],v[c+1]=r[y+3],v[c+2]=r[y+2],v[c+3]=r[y+1];else for(var b=0;b<p;++b)d=r[y+b],v[c+(3&-b)]=f[o[d>>>24]]^h[o[d>>>16&255]]^g[o[d>>>8&255]]^m[o[255&d]];r=v}return r}function h(t,e,n,r){var i,s,c,p,d,f,h,g,m,v,y,b,w=t.length/4-1;r?(i=l[0],s=l[1],c=l[2],p=l[3],d=a):(i=u[0],s=u[1],c=u[2],p=u[3],d=o),f=e[0]^t[0],h=e[r?3:1]^t[1],g=e[2]^t[2],m=e[r?1:3]^t[3];for(var $=3,k=1;k<w;++k)v=i[f>>>24]^s[h>>>16&255]^c[g>>>8&255]^p[255&m]^t[++$],y=i[h>>>24]^s[g>>>16&255]^c[m>>>8&255]^p[255&f]^t[++$],b=i[g>>>24]^s[m>>>16&255]^c[f>>>8&255]^p[255&h]^t[++$],m=i[m>>>24]^s[f>>>16&255]^c[h>>>8&255]^p[255&g]^t[++$],f=v,h=y,g=b;n[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[g>>>8&255]<<8^d[255&m]^t[++$],n[r?3:1]=d[h>>>24]<<24^d[g>>>16&255]<<16^d[m>>>8&255]<<8^d[255&f]^t[++$],n[2]=d[g>>>24]<<24^d[m>>>16&255]<<16^d[f>>>8&255]<<8^d[255&h]^t[++$],n[r?1:3]=d[m>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[255&g]^t[++$]}function g(t){var e,n="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?r.cipher.createDecipher(n,t.key):r.cipher.createCipher(n,t.key)).start;return e.start=function(t,n){var o=null;n instanceof r.util.ByteBuffer&&(o=n,n={}),(n=n||{}).output=o,n.iv=t,i.call(e,n)},e}},function(t,e,n){var r=n(0);r.pki=r.pki||{};var i=t.exports=r.pki.oids=r.oids=r.oids||{};function o(t,e){i[t]=e,i[e]=t}function a(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.16.840.1.113730.1.1","nsCertType"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e,n){var r,i=n(0);t.exports=i.jsbn=i.jsbn||{};function o(t,e,n){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new o(null)}function s(t,e,n,r,i,o){for(var a=16383&e,s=e>>14;--o>=0;){var u=16383&this.data[t],l=this.data[t++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+n.data[r]+i)>>28)+(c>>14)+s*l,n.data[r++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"==typeof navigator?(o.prototype.am=s,r=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,n,r,i,o){for(var a=32767&e,s=e>>15;--o>=0;){var u=32767&this.data[t],l=this.data[t++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+n.data[r]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),n.data[r++]=1073741823&u}return i},r=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,n,r,i,o){for(;--o>=0;){var a=e*this.data[t++]+n.data[r]+i;i=Math.floor(a/67108864),n.data[r++]=67108863&a}return i},r=26):(o.prototype.am=s,r=28),o.prototype.DB=r,o.prototype.DM=(1<<r)-1,o.prototype.DV=1<<r;o.prototype.FV=Math.pow(2,52),o.prototype.F1=52-r,o.prototype.F2=2*r-52;var u,l,c="0123456789abcdefghijklmnopqrstuvwxyz",p=new Array;for(u="0".charCodeAt(0),l=0;l<=9;++l)p[u++]=l;for(u="a".charCodeAt(0),l=10;l<36;++l)p[u++]=l;for(u="A".charCodeAt(0),l=10;l<36;++l)p[u++]=l;function d(t){return c.charAt(t)}function f(t,e){var n=p[t.charCodeAt(e)];return null==n?-1:n}function h(t){var e=a();return e.fromInt(t),e}function g(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function m(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function y(t,e){return t&e}function b(t,e){return t|e}function w(t,e){return t^e}function $(t,e){return t&~e}function k(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function C(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function x(){}function T(t){return t}function S(t){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}m.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},m.prototype.revert=function(t){return t},m.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},m.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},m.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.convert=function(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},v.prototype.revert=function(t){var e=a();return t.copyTo(e),this.reduce(e),e},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t.data[e],r=n*this.mpl+((n*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t.data[n]+=this.m.am(0,r,t,e,0,this.m.t);t.data[n]>=t.DV;)t.data[n]-=t.DV,t.data[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},o.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,a=0;--r>=0;){var s=8==n?255&t[r]:f(t,r);s<0?"-"==t.charAt(r)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+n>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this.data[this.t++]=s>>this.DB-a):this.data[this.t-1]|=s<<a,(a+=n)>=this.DB&&(a-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e.data[n+t]=this.data[n];for(n=t-1;n>=0;--n)e.data[n]=0;e.t=this.t+t,e.s=this.s},o.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e.data[n-t]=this.data[n];e.t=Math.max(this.t-t,0),e.s=this.s},o.prototype.lShiftTo=function(t,e){var n,r=t%this.DB,i=this.DB-r,o=(1<<i)-1,a=Math.floor(t/this.DB),s=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e.data[n+a+1]=this.data[n]>>i|s,s=(this.data[n]&o)<<r;for(n=a-1;n>=0;--n)e.data[n]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,o=(1<<r)-1;e.data[0]=this.data[n]>>r;for(var a=n+1;a<this.t;++a)e.data[a-n-1]|=(this.data[a]&o)<<i,e.data[a-n]=this.data[a]>>r;r>0&&(e.data[this.t-n-1]|=(this.s&o)<<i),e.t=this.t-n,e.clamp()}},o.prototype.subTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this.data[n]-t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e.data[n++]=this.DV+r:r>0&&(e.data[n++]=r),e.t=n,e.clamp()},o.prototype.multiplyTo=function(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e.data[i]=0;for(i=0;i<r.t;++i)e.data[i+n.t]=n.am(0,r.data[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&o.ZERO.subTo(e,e)},o.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t.data[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e.data[n],t,2*n,0,1);(t.data[n+e.t]+=e.am(n+1,2*e.data[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t.data[n+e.t]-=e.DV,t.data[n+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(n,e.data[n],t,2*n,0,1)),t.s=0,t.clamp()},o.prototype.divRemTo=function(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=a());var s=a(),u=this.s,l=t.s,c=this.DB-g(r.data[r.t-1]);c>0?(r.lShiftTo(c,s),i.lShiftTo(c,n)):(r.copyTo(s),i.copyTo(n));var p=s.t,d=s.data[p-1];if(0!=d){var f=d*(1<<this.F1)+(p>1?s.data[p-2]>>this.F2:0),h=this.FV/f,m=(1<<this.F1)/f,v=1<<this.F2,y=n.t,b=y-p,w=null==e?a():e;for(s.dlShiftTo(b,w),n.compareTo(w)>=0&&(n.data[n.t++]=1,n.subTo(w,n)),o.ONE.dlShiftTo(p,w),w.subTo(s,s);s.t<p;)s.data[s.t++]=0;for(;--b>=0;){var $=n.data[--y]==d?this.DM:Math.floor(n.data[y]*h+(n.data[y-1]+v)*m);if((n.data[y]+=s.am(0,$,n,b,0,p))<$)for(s.dlShiftTo(b,w),n.subTo(w,n);n.data[y]<--$;)n.subTo(w,n)}null!=e&&(n.drShiftTo(p,e),u!=l&&o.ZERO.subTo(e,e)),n.t=p,n.clamp(),c>0&&n.rShiftTo(c,n),u<0&&o.ZERO.subTo(n,n)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var n=a(),r=a(),i=e.convert(this),s=g(t)-1;for(i.copyTo(n);--s>=0;)if(e.sqrTo(n,r),(t&1<<s)>0)e.mulTo(r,i,n);else{var u=n;n=r,r=u}return e.revert(n)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%e;if(a-- >0)for(s<this.DB&&(n=this.data[a]>>s)>0&&(i=!0,o=d(n));a>=0;)s<e?(n=(this.data[a]&(1<<s)-1)<<e-s,n|=this.data[--a]>>(s+=this.DB-e)):(n=this.data[a]>>(s-=e)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=d(n));return i?o:"0"},o.prototype.negate=function(){var t=a();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this.data[n]-t.data[n]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+g(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new m(e):new v(e),this.exp(t,n)},o.ZERO=h(0),o.ONE=h(1),x.prototype.convert=T,x.prototype.revert=T,x.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},x.prototype.sqrTo=function(t,e){t.squareTo(e)},S.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e},S.prototype.revert=function(t){return t},S.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},S.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},S.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var E=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],D=(1<<26)/E[E.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),r=h(n),i=a(),o=a(),s="";for(this.divRemTo(r,i,o);i.signum()>0;)s=(n+o.intValue()).toString(t).substr(1)+s,i.divRemTo(r,i,o);return o.intValue().toString(t)+s},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),r=Math.pow(e,n),i=!1,a=0,s=0,u=0;u<t.length;++u){var l=f(t,u);l<0?"-"==t.charAt(u)&&0==this.signum()&&(i=!0):(s=e*s+l,++a>=n&&(this.dMultiply(r),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var r=new Array,i=7&t;r.length=1+(t>>3),e.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}},o.prototype.bitwiseTo=function(t,e,n){var r,i,o=Math.min(t.t,this.t);for(r=0;r<o;++r)n.data[r]=e(this.data[r],t.data[r]);if(t.t<this.t){for(i=t.s&this.DM,r=o;r<this.t;++r)n.data[r]=e(this.data[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<t.t;++r)n.data[r]=e(i,t.data[r]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},o.prototype.changeBit=function(t,e){var n=o.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},o.prototype.addTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this.data[n]+t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t.data[n],e.data[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e.data[n++]=r:r<-1&&(e.data[n++]=this.DV+r),e.t=n,e.clamp()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},o.prototype.multiplyLowerTo=function(t,e,n){var r,i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n.data[--i]=0;for(r=n.t-this.t;i<r;++i)n.data[i+this.t]=this.am(0,t.data[i],n,i,0,this.t);for(r=Math.min(t.t,e);i<r;++i)this.am(0,t.data[i],n,i,0,e-i);n.clamp()},o.prototype.multiplyUpperTo=function(t,e,n){--e;var r=n.t=this.t+t.t-e;for(n.s=0;--r>=0;)n.data[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)n.data[this.t+r-e]=this.am(e-r,t.data[r],n,0,0,this.t+r-e);n.clamp(),n.drShiftTo(1,n)},o.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this.data[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this.data[r])%t;return n},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),n=e.getLowestSetBit();if(n<=0)return!1;for(var r,i=e.shiftRight(n),a={nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(256*Math.random())}},s=0;s<t;++s){do{r=new o(this.bitLength(),a)}while(r.compareTo(o.ONE)<=0||r.compareTo(e)>=0);var u=r.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var l=1;l++<n&&0!=u.compareTo(e);)if(0==(u=u.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0},o.prototype.clone=function(){var t=a();return this.copyTo(t),t},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r<this.DB&&(n=this.data[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this.data[t]&(1<<r)-1)<<8-r,n|=this.data[--t]>>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=a();return this.bitwiseTo(t,y,e),e},o.prototype.or=function(t){var e=a();return this.bitwiseTo(t,b,e),e},o.prototype.xor=function(t){var e=a();return this.bitwiseTo(t,w,e),e},o.prototype.andNot=function(t){var e=a();return this.bitwiseTo(t,$,e),e},o.prototype.not=function(){for(var t=a(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t},o.prototype.shiftLeft=function(t){var e=a();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},o.prototype.shiftRight=function(t){var e=a();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},o.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this.data[t])return t*this.DB+k(this.data[t]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=C(this.data[n]^e);return t},o.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this.data[e]&1<<t%this.DB)},o.prototype.setBit=function(t){return this.changeBit(t,b)},o.prototype.clearBit=function(t){return this.changeBit(t,$)},o.prototype.flipBit=function(t){return this.changeBit(t,w)},o.prototype.add=function(t){var e=a();return this.addTo(t,e),e},o.prototype.subtract=function(t){var e=a();return this.subTo(t,e),e},o.prototype.multiply=function(t){var e=a();return this.multiplyTo(t,e),e},o.prototype.divide=function(t){var e=a();return this.divRemTo(t,e,null),e},o.prototype.remainder=function(t){var e=a();return this.divRemTo(t,null,e),e},o.prototype.divideAndRemainder=function(t){var e=a(),n=a();return this.divRemTo(t,e,n),new Array(e,n)},o.prototype.modPow=function(t,e){var n,r,i=t.bitLength(),o=h(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new m(e):e.isEven()?new S(e):new v(e);var s=new Array,u=3,l=n-1,c=(1<<n)-1;if(s[1]=r.convert(this),n>1){var p=a();for(r.sqrTo(s[1],p);u<=c;)s[u]=a(),r.mulTo(p,s[u-2],s[u]),u+=2}var d,f,y=t.t-1,b=!0,w=a();for(i=g(t.data[y])-1;y>=0;){for(i>=l?d=t.data[y]>>i-l&c:(d=(t.data[y]&(1<<i+1)-1)<<l-i,y>0&&(d|=t.data[y-1]>>this.DB+i-l)),u=n;0==(1&d);)d>>=1,--u;if((i-=u)<0&&(i+=this.DB,--y),b)s[d].copyTo(o),b=!1;else{for(;u>1;)r.sqrTo(o,w),r.sqrTo(w,o),u-=2;u>0?r.sqrTo(o,w):(f=o,o=w,w=f),r.mulTo(w,s[d],o)}for(;y>=0&&0==(t.data[y]&1<<i);)r.sqrTo(o,w),f=o,o=w,w=f,--i<0&&(i=this.DB-1,--y)}return r.revert(o)},o.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return o.ZERO;for(var n=t.clone(),r=this.clone(),i=h(1),a=h(0),s=h(0),u=h(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;r.isEven();)r.rShiftTo(1,r),e?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(r)>=0?(n.subTo(r,n),e&&i.subTo(s,i),a.subTo(u,a)):(r.subTo(n,r),e&&s.subTo(i,s),u.subTo(a,u))}return 0!=r.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new x)},o.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},o.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n.data[0]<=E[E.length-1]){for(e=0;e<E.length;++e)if(n.data[0]==E[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<E.length;){for(var r=E[e],i=e+1;i<E.length&&r<D;)r*=E[i++];for(r=n.modInt(r);e<i;)if(r%E[e++]==0)return!1}return n.millerRabin(t)}},function(t,e,n){var r=n(0);n(2),n(1);var i=t.exports=r.sha256=r.sha256||{};r.md.sha256=r.md.algorithms.sha256=i,i.create=function(){a||(o=String.fromCharCode(128),o+=r.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0);var t=null,e=r.util.createBuffer(),n=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,o=0;o<n;++o)i.fullMessageLength.push(0);return e=r.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=r.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=s[1],s[1]=s[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),u(t,n,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=r.util.createBuffer();a.putBytes(e.bytes());var s,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],p=0;p<i.fullMessageLength.length-1;++p)c+=(s=8*i.fullMessageLength[p+1])/4294967296>>>0,a.putInt32(c>>>0),c=s>>>0;a.putInt32(c);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(d,n,a);var f=r.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f.putInt32(d.h5),f.putInt32(d.h6),f.putInt32(d.h7),f},i};var o=null,a=!1,s=null;function u(t,e,n){for(var r,i,o,a,u,l,c,p,d,f,h,g,m,v=n.length();v>=64;){for(u=0;u<16;++u)e[u]=n.getInt32();for(;u<64;++u)r=((r=e[u-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=((i=e[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=r+e[u-7]+i+e[u-16]|0;for(l=t.h0,c=t.h1,p=t.h2,d=t.h3,f=t.h4,h=t.h5,g=t.h6,m=t.h7,u=0;u<64;++u)o=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),a=l&c|p&(l^c),r=m+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(g^f&(h^g))+s[u]+e[u],m=g,g=h,h=f,f=d+r>>>0,d=p,p=c,c=l,l=r+(i=o+a)>>>0;t.h0=t.h0+l|0,t.h1=t.h1+c|0,t.h2=t.h2+p|0,t.h3=t.h3+d|0,t.h4=t.h4+f|0,t.h5=t.h5+h|0,t.h6=t.h6+g|0,t.h7=t.h7+m|0,v-=64}}},function(t,e,n){n(11),n(6),n(14),n(4),n(9),n(3),t.exports=n(0)},function(t,e,n){var r=n(0);n(4),n(2),n(1);var i,o=r.pkcs5=r.pkcs5||{};r.util.isNodejs&&!r.options.usePureJavaScript&&(i=n(5)),t.exports=r.pbkdf2=o.pbkdf2=function(t,e,n,o,a,s){if("function"==typeof a&&(s=a,a=null),r.util.isNodejs&&!r.options.usePureJavaScript&&i.pbkdf2&&(null===a||"object"!=typeof a)&&(i.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),t=new Buffer(t,"binary"),e=new Buffer(e,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(t,e,n,o,function(t,e){if(t)return s(t);s(null,e.toString("binary"))}):i.pbkdf2(t,e,n,o,a,function(t,e){if(t)return s(t);s(null,e.toString("binary"))}):4===i.pbkdf2Sync.length?i.pbkdf2Sync(t,e,n,o).toString("binary"):i.pbkdf2Sync(t,e,n,o,a).toString("binary");if(null==a&&(a="sha1"),"string"==typeof a){if(!(a in r.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=r.md[a].create()}var u=a.digestLength;if(o>4294967295*u){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var c=Math.ceil(o/u),p=o-(c-1)*u,d=r.hmac.create();d.start(a,t);var f,h,g,m="";if(!s){for(var v=1;v<=c;++v){d.start(null,null),d.update(e),d.update(r.util.int32ToBytes(v)),f=g=d.digest().getBytes();for(var y=2;y<=n;++y)d.start(null,null),d.update(g),h=d.digest().getBytes(),f=r.util.xorBytes(f,h,u),g=h;m+=v<c?f:f.substr(0,p)}return m}v=1;function b(){if(v>c)return s(null,m);d.start(null,null),d.update(e),d.update(r.util.int32ToBytes(v)),f=g=d.digest().getBytes(),y=2,w()}function w(){if(y<=n)return d.start(null,null),d.update(g),h=d.digest().getBytes(),f=r.util.xorBytes(f,h,u),g=h,++y,r.util.setImmediate(w);m+=v<c?f:f.substr(0,p),++v,b()}b()}},function(t,e,n){var r=n(0);n(1),t.exports=r.cipher=r.cipher||{},r.cipher.algorithms=r.cipher.algorithms||{},r.cipher.createCipher=function(t,e){var n=t;if("string"==typeof n&&(n=r.cipher.getAlgorithm(n))&&(n=n()),!n)throw new Error("Unsupported algorithm: "+t);return new r.cipher.BlockCipher({algorithm:n,key:e,decrypt:!1})},r.cipher.createDecipher=function(t,e){var n=t;if("string"==typeof n&&(n=r.cipher.getAlgorithm(n))&&(n=n()),!n)throw new Error("Unsupported algorithm: "+t);return new r.cipher.BlockCipher({algorithm:n,key:e,decrypt:!0})},r.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),r.cipher.algorithms[t]=e},r.cipher.getAlgorithm=function(t){return(t=t.toUpperCase())in r.cipher.algorithms?r.cipher.algorithms[t]:null};var i=r.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};i.prototype.start=function(t){t=t||{};var e={};for(var n in t)e[n]=t[n];e.decrypt=this._decrypt,this._finish=!1,this._input=r.util.createBuffer(),this.output=t.output||r.util.createBuffer(),this.mode.start(e)},i.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(t){!t||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(e){return t(this.blockSize,e,!1)},this.mode.unpad=function(e){return t(this.blockSize,e,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,e)))}},function(t,e,n){var r=n(0);n(1),r.cipher=r.cipher||{};var i=t.exports=r.cipher.modes=r.cipher.modes||{};function o(t){if("string"==typeof t&&(t=r.util.createBuffer(t)),r.util.isArray(t)&&t.length>4){var e=t;t=r.util.createBuffer();for(var n=0;n<e.length;++n)t.putByte(e[n])}return r.util.isArray(t)||(t=[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]),t}function a(t){t[t.length-1]=t[t.length-1]+1&4294967295}function s(t){return[t/4294967296|0,4294967295&t]}i.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(t){},i.ecb.prototype.encrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._outBlock[r])},i.ecb.prototype.decrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._outBlock[r])},i.ecb.prototype.pad=function(t,e){var n=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(n,n),!0},i.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var n=t.length(),r=t.at(n-1);return!(r>this.blockSize<<2)&&(t.truncate(r),!0)},i.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._outBlock[r]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(t,e,n){if(t.length()<this.blockSize&&!(n&&t.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(r=0;r<this._ints;++r)e.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(t,e){var n=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(n,n),!0},i.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var n=t.length(),r=t.at(n-1);return!(r>this.blockSize<<2)&&(t.truncate(r),!0)},i.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},i.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,n){var r=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(o>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=r.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,n=r.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?r.util.createBuffer(t.additionalData):r.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=r.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=n.length();if(12===i)this._j0=[n.getInt32(),n.getInt32(),n.getInt32(),1];else{for(this._j0=[0,0,0,0];n.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[n.getInt32(),n.getInt32(),n.getInt32(),n.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,e=r.util.createBuffer(e),this._aDataLength=s(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,n){var r=t.length();if(0===r)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&r>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(0===o||n){if(n){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(t,e,n){var r=t.length();if(r<this.blockSize&&!(n&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^this._hashBlock[i]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(t,e){var n=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=r.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^o[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(n=!1),n},i.gcm.prototype.multiply=function(t,e){for(var n=[0,0,0,0],r=e.slice(0),i=0;i<128;++i){t[i/32|0]&1<<31-i%32&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),this.pow(r,r)}return n},i.gcm.prototype.pow=function(t,e){for(var n=1&t[3],r=3;r>0;--r)e[r]=t[r]>>>1|(1&t[r-1])<<31;e[0]=t[0]>>>1,n&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],n=0;n<32;++n){var r=t[n/8|0]>>>4*(7-n%8)&15,i=this._m[n][r];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.gcm.prototype.ghash=function(t,e,n){return e[0]^=n[0],e[1]^=n[1],e[2]^=n[2],e[3]^=n[3],this.tableMultiply(e)},i.gcm.prototype.generateHashTable=function(t,e){for(var n=8/e,r=4*n,i=16*n,o=new Array(i),a=0;a<i;++a){var s=[0,0,0,0],u=(r-1-a%r)*e;s[a/r|0]=1<<e-1<<u,o[a]=this.generateSubHashTable(this.multiply(s,t),e)}return o},i.gcm.prototype.generateSubHashTable=function(t,e){var n=1<<e,r=n>>>1,i=new Array(n);i[r]=t.slice(0);for(var o=r>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<r;){for(var a=1;a<o;++a){var s=i[o],u=i[a];i[o+a]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=r+1;o<n;++o){var l=i[o^r];i[o]=[t[0]^l[0],t[1]^l[1],t[2]^l[2],t[3]^l[3]]}return i}},function(t,e,n){var r=n(0);if(n(15),n(8),n(7),n(16),n(19),n(3),n(1),void 0===i)var i=r.jsbn.BigInteger;var o=r.asn1;r.pki=r.pki||{},t.exports=r.pki.rsa=r.rsa=r.rsa||{};var a=r.pki,s=[6,4,2,4,2,4,6,2],u={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},c={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=r.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(t){var e;if(!(t.algorithm in a.oids)){var n=new Error("Unknown message digest algorithm.");throw n.algorithm=t.algorithm,n}e=a.oids[t.algorithm];var r=o.oidToDer(e).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);s.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,r)),s.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var u=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(u),o.toDer(i).getBytes()},f=function(t,e,n){if(n)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(r.util.bytesToHex(r.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var a=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(s)<0;)a=a.add(e.p);var u=a.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return u=u.multiply(o.modInverse(e.n)).mod(e.n)};function h(t,e,n){var i=r.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=o-11,a}i.putByte(0),i.putByte(n);var s,u=o-3-t.length;if(0===n||1===n){s=0===n?0:255;for(var l=0;l<u;++l)i.putByte(s)}else for(;u>0;){var c=0,p=r.random.getBytes(u);for(l=0;l<u;++l)0===(s=p.charCodeAt(l))?++c:i.putByte(s);u=c}return i.putByte(0),i.putBytes(t),i}function g(t,e,n,i){var o=Math.ceil(e.n.bitLength()/8),a=r.util.createBuffer(t),s=a.getByte(),u=a.getByte();if(0!==s||n&&0!==u&&1!==u||!n&&2!=u||n&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var l=0;if(0===u){l=o-3-i;for(var c=0;c<l;++c)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(l=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++l}else if(2===u)for(l=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++l}if(0!==a.getByte()||l!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function m(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var n=r.util.hexToBytes(e);return n.length>1&&(0===n.charCodeAt(0)&&0==(128&n.charCodeAt(1))||255===n.charCodeAt(0)&&128==(128&n.charCodeAt(1)))?n.substr(1):n}function v(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function y(t){return"undefined"!=typeof window&&"object"==typeof window.crypto&&"object"==typeof window.crypto.subtle&&"function"==typeof window.crypto.subtle[t]}function b(t){return"undefined"!=typeof window&&"object"==typeof window.msCrypto&&"object"==typeof window.msCrypto.subtle&&"function"==typeof window.msCrypto.subtle[t]}function w(t){for(var e=r.util.hexToBytes(t.toString(16)),n=new Uint8Array(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}a.rsa.encrypt=function(t,e,n){var o,a=n,s=Math.ceil(e.n.bitLength()/8);!1!==n&&!0!==n?(a=2===n,o=h(t,e,n)):(o=r.util.createBuffer()).putBytes(t);for(var u=new i(o.toHex(),16),l=f(u,e,a).toString(16),c=r.util.createBuffer(),p=s-Math.ceil(l.length/2);p>0;)c.putByte(0),--p;return c.putBytes(r.util.hexToBytes(l)),c.getBytes()},a.rsa.decrypt=function(t,e,n,o){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=a,s}var u=new i(r.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=f(u,e,n).toString(16),c=r.util.createBuffer(),p=a-Math.ceil(l.length/2);p>0;)c.putByte(0),--p;return c.putBytes(r.util.hexToBytes(l)),!1!==o?g(c.getBytes(),e,n):c.getBytes()},a.rsa.createKeyPairGenerationState=function(t,e,n){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var o,a=(n=n||{}).prng||r.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),n=0;n<t.length;++n)t[n]=e.charCodeAt(n)}},u=n.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(o={algorithm:u,state:0,bits:t,rng:s,eInt:e||65537,e:new i(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},a.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var n=new i(null);n.fromInt(30);for(var r,o=0,u=function(t,e){return t|e},l=+new Date,c=0;null===t.keys&&(e<=0||c<e);){if(0===t.state){var p=null===t.p?t.pBits:t.qBits,d=p-1;0===t.pqState?(t.num=new i(p,t.rng),t.num.testBit(d)||t.num.bitwiseTo(i.ONE.shiftLeft(d),u,t.num),t.num.dAddOffset(31-t.num.mod(n).byteValue(),0),o=0,++t.pqState):1===t.pqState?t.num.bitLength()>p?t.pqState=0:t.num.isProbablePrime(v(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(s[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var f=t.e.modInverse(t.phi);t.keys={privateKey:a.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:a.rsa.setPublicKey(t.n,t.e)}}c+=(r=+new Date)-l,l=r}return null!==t.keys},a.rsa.generateKeyPair=function(t,e,n,s){if(1===arguments.length?"object"==typeof t?(n=t,t=void 0):"function"==typeof t&&(s=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(s=e,e=void 0):"number"!=typeof e&&(n=e,e=void 0):(n=t,s=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof n&&(s=n,n=void 0):(s=n,n=e,e=void 0)),n=n||{},void 0===t&&(t=n.bits||2048),void 0===e&&(e=n.e||65537),!r.options.usePureJavaScript&&s&&t>=256&&t<=16384&&(65537===e||3===e)){if(y("generateKey")&&y("exportKey"))return window.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:w(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return window.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){s(t)}).then(function(t){if(t){var e=a.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(t)));s(null,{privateKey:e,publicKey:a.setRsaPublicKey(e.n,e.e)})}});if(b("generateKey")&&b("exportKey")){var u=window.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:w(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(t){var e=t.target.result,n=window.msCrypto.subtle.exportKey("pkcs8",e.privateKey);n.oncomplete=function(t){var e=t.target.result,n=a.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(e)));s(null,{privateKey:n,publicKey:a.setRsaPublicKey(n.n,n.e)})},n.onerror=function(t){s(t)}},void(u.onerror=function(t){s(t)})}}var l=a.rsa.createKeyPairGenerationState(t,e,n);if(!s)return a.rsa.stepKeyPairGenerationState(l,0),l.keys;!function(t,e,n){"function"==typeof e&&(n=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(o.prng=e.prng);function s(){u(t.pBits,function(e,r){return e?n(e):(t.p=r,null!==t.q?l(e,t.q):void u(t.qBits,l))})}function u(t,e){r.prime.generateProbablePrime(t,o,e)}function l(e,r){if(e)return n(e);if(t.q=r,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void s();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void u(t.qBits,l);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void s();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void u(t.qBits,l);var c=t.e.modInverse(t.phi);t.keys={privateKey:a.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:a.rsa.setPublicKey(t.n,t.e)},n(null,t.keys)}s()}(l,n,s)},a.setRsaPublicKey=a.rsa.setPublicKey=function(t,e){var n={n:t,e:e,encrypt:function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,n){return h(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return r.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,n,!0);return a.rsa.encrypt(o,n,!0)},verify:function(t,e,r){"string"==typeof r?r=r.toUpperCase():void 0===r&&(r="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===r?r={verify:function(t,e){return e=g(e,n,!0),t===o.fromDer(e).value[1].value}}:"NONE"!==r&&"NULL"!==r&&null!==r||(r={verify:function(t,e){return t===(e=g(e,n,!0))}});var i=a.rsa.decrypt(e,n,!0,!1);return r.verify(t,i,n.n.bitLength())}};return n},a.setRsaPrivateKey=a.rsa.setPrivateKey=function(t,e,n,i,o,s,u,l){var c={n:t,e:e,d:n,p:i,q:o,dP:s,dQ:u,qInv:l,decrypt:function(t,e,n){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=a.rsa.decrypt(t,c,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:g};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return r.pkcs1.decode_rsa_oaep(e,t,n)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,c,!1)},sign:function(t,e){var n=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:d},n=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},n=1);var r=e.encode(t,c.n.bitLength());return a.rsa.encrypt(r,c,n)}};return c},a.wrapRsaPrivateKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(t).getBytes())])},a.privateKeyFromAsn1=function(t){var e,n,s,c,p,d,f,h,g={},m=[];if(o.validate(t,u,g,m)&&(t=o.fromDer(r.util.createBuffer(g.privateKey))),g={},m=[],!o.validate(t,l,g,m)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=m,v}return e=r.util.createBuffer(g.privateKeyModulus).toHex(),n=r.util.createBuffer(g.privateKeyPublicExponent).toHex(),s=r.util.createBuffer(g.privateKeyPrivateExponent).toHex(),c=r.util.createBuffer(g.privateKeyPrime1).toHex(),p=r.util.createBuffer(g.privateKeyPrime2).toHex(),d=r.util.createBuffer(g.privateKeyExponent1).toHex(),f=r.util.createBuffer(g.privateKeyExponent2).toHex(),h=r.util.createBuffer(g.privateKeyCoefficient).toHex(),a.setRsaPrivateKey(new i(e,16),new i(n,16),new i(s,16),new i(c,16),new i(p,16),new i(d,16),new i(f,16),new i(h,16))},a.privateKeyToAsn1=a.privateKeyToRSAPrivateKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.qInv))])},a.publicKeyFromAsn1=function(t){var e={},n=[];if(o.validate(t,p,e,n)){var s,u=o.derToOid(e.publicKeyOid);if(u!==a.oids.rsaEncryption)throw(s=new Error("Cannot read public key. Unknown OID.")).oid=u,s;t=e.rsaPublicKey}if(n=[],!o.validate(t,c,e,n))throw(s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=n,s;var l=r.util.createBuffer(e.publicKeyModulus).toHex(),d=r.util.createBuffer(e.publicKeyExponent).toHex();return a.setRsaPublicKey(new i(l,16),new i(d,16))},a.publicKeyToAsn1=a.publicKeyToSubjectPublicKeyInfo=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[a.publicKeyToRSAPublicKey(t)])])},a.publicKeyToRSAPublicKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,m(t.e))])}},function(t,e,n){var r=n(0);n(1),n(7);var i=t.exports=r.asn1=r.asn1||{};function o(t,e,n){if(n>e){var r=new Error("Too few bytes to parse DER.");throw r.available=t.length(),r.remaining=e,r.requested=n,r}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(t,e,n,o,a){if(r.util.isArray(o)){for(var s=[],u=0;u<o.length;++u)void 0!==o[u]&&s.push(o[u]);o=s}var l={tagClass:t,type:e,constructed:n,composed:n||r.util.isArray(o),value:o};return a&&"bitStringContents"in a&&(l.bitStringContents=a.bitStringContents,l.original=i.copy(l)),l},i.copy=function(t,e){var n;if(r.util.isArray(t)){n=[];for(var o=0;o<t.length;++o)n.push(i.copy(t[o],e));return n}return"string"==typeof t?t:(n={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:i.copy(t.value,e)},e&&!e.excludeBitStringContents&&(n.bitStringContents=t.bitStringContents),n)},i.equals=function(t,e,n){if(r.util.isArray(t)){if(!r.util.isArray(e))return!1;if(t.length!==e.length)return!1;for(var o=0;o<t.length;++o)return!!i.equals(t[o],e[o])}if(typeof t!=typeof e)return!1;if("string"==typeof t)return t===e;var a=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&i.equals(t.value,e.value);return n&&n.includeBitStringContents&&(a=a&&t.bitStringContents===e.bitStringContents),a},i.getBerValueLength=function(t){var e=t.getByte();if(128!==e)return 128&e?t.getInt((127&e)<<3):e};var a=function(t,e){var n=t.getByte();if(128!==n){var r;if(128&n){var i=127&n;o(t,--e,i),r=t.getInt(i<<3)}else r=n;if(r<0)throw new Error("Negative length: "+r);return r}};i.fromDer=function(t,e){return void 0===e&&(e={strict:!0,decodeBitStrings:!0}),"boolean"==typeof e&&(e={strict:e,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"string"==typeof t&&(t=r.util.createBuffer(t)),function t(e,n,r,s){var u;o(e,n,2);var l=e.getByte();n--;var c=192&l;var p=31&l;u=e.length();var d=a(e,n);n-=u-e.length();if(void 0!==d&&d>n){if(s.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=e.length(),f.remaining=n,f.requested=d,f}d=n}var h;var g;var m=32==(32&l);if(m)if(h=[],void 0===d)for(;;){if(o(e,n,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),n-=2;break}u=e.length(),h.push(t(e,n,r+1,s)),n-=u-e.length()}else for(;d>0;)u=e.length(),h.push(t(e,d,r+1,s)),n-=u-e.length(),d-=u-e.length();void 0===h&&c===i.Class.UNIVERSAL&&p===i.Type.BITSTRING&&(g=e.bytes(d));if(void 0===h&&s.decodeBitStrings&&c===i.Class.UNIVERSAL&&p===i.Type.BITSTRING&&d>1){var v=e.read,y=n,b=0;if(p===i.Type.BITSTRING&&(o(e,n,1),b=e.getByte(),n--),0===b)try{u=e.length();var w={verbose:s.verbose,strict:!0,decodeBitStrings:!0},$=t(e,n,r+1,w),k=u-e.length();n-=k,p==i.Type.BITSTRING&&k++;var C=$.tagClass;k!==d||C!==i.Class.UNIVERSAL&&C!==i.Class.CONTEXT_SPECIFIC||(h=[$])}catch(t){}void 0===h&&(e.read=v,n=y)}if(void 0===h){if(void 0===d){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=n}if(p===i.Type.BMPSTRING)for(h="";d>0;d-=2)o(e,n,2),h+=String.fromCharCode(e.getInt16()),n-=2;else h=e.getBytes(d)}var x=void 0===g?null:{bitStringContents:g};return i.create(c,p,m,h,x)}(t,t.length(),0,e)},i.toDer=function(t){var e=r.util.createBuffer(),n=t.tagClass|t.type,o=r.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=i.equals(t,t.original))),a)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?n|=32:o.putByte(0);for(var s=0;s<t.value.length;++s)void 0!==t.value[s]&&o.putBuffer(i.toDer(t.value[s]))}else if(t.type===i.Type.BMPSTRING)for(s=0;s<t.value.length;++s)o.putInt16(t.value.charCodeAt(s));else t.type===i.Type.INTEGER&&t.value.length>1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(n),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);e.putByte(128|l.length);for(s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,n,i,o,a=t.split("."),s=r.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u<a.length;++u){e=!0,n=[],i=parseInt(a[u],10);do{o=127&i,i>>>=7,e||(o|=128),n.push(o),e=!1}while(i>0);for(var l=n.length-1;l>=0;--l)s.putByte(n[l])}return s},i.derToOid=function(t){var e;"string"==typeof t&&(t=r.util.createBuffer(t));var n=t.getByte();e=Math.floor(n/40)+"."+n%40;for(var i=0;t.length()>0;)i<<=7,128&(n=t.getByte())?i+=127&n:(e+="."+(i+n),i=0);return e},i.utcTimeToDate=function(t){var e=new Date,n=parseInt(t.substr(0,2),10);n=n>=50?1900+n:2e3+n;var r=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),l+=2)}if(e.setUTCFullYear(n,r,i),e.setUTCHours(o,a,s,0),l&&("+"===(u=t.charAt(l))||"-"===u)){var c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},i.generalizedTimeToDate=function(t){var e=new Date,n=parseInt(t.substr(0,4),10),r=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,l=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var p=t.length-5,d=t.charAt(p);"+"!==d&&"-"!==d||(l=60*parseInt(t.substr(p+1,2),10)+parseInt(t.substr(p+4,2),10),l*=6e4,"+"===d&&(l*=-1),c=!0);return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(n,r,i),e.setUTCHours(o,a,s,u),e.setTime(+e+l)):(e.setFullYear(n,r,i),e.setHours(o,a,s,u)),e},i.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",n=[];n.push((""+t.getUTCFullYear()).substr(2)),n.push(""+(t.getUTCMonth()+1)),n.push(""+t.getUTCDate()),n.push(""+t.getUTCHours()),n.push(""+t.getUTCMinutes()),n.push(""+t.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(e+="0"),e+=n[r];return e+="Z"},i.dateToGeneralizedTime=function(t){if("string"==typeof t)return t;var e="",n=[];n.push(""+t.getUTCFullYear()),n.push(""+(t.getUTCMonth()+1)),n.push(""+t.getUTCDate()),n.push(""+t.getUTCHours()),n.push(""+t.getUTCMinutes()),n.push(""+t.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(e+="0"),e+=n[r];return e+="Z"},i.integerToDer=function(t){var e=r.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var n=new Error("Integer too large; max is 32-bits.");throw n.integer=t,n},i.derToInteger=function(t){"string"==typeof t&&(t=r.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,n,o){var a=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(a=!0,e.value&&r.util.isArray(e.value))for(var s=0,u=0;a&&u<e.value.length;++u)a=e.value[u].optional||!1,t.value[s]&&((a=i.validate(t.value[s],e.value[u],n,o))?++s:e.value[u].optional&&(a=!0)),!a&&o&&o.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(a&&n)if(e.capture&&(n[e.capture]=t.value),e.captureAsn1&&(n[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(n[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t)if(t.bitStringContents.length<2)n[e.captureBitStringValue]="";else{if(0!==t.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");n[e.captureBitStringValue]=t.bitStringContents.slice(1)}}else o&&o.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');return a};var s=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(t,e,n){var o="";n=n||2,(e=e||0)>0&&(o+="\n");for(var a="",u=0;u<e*n;++u)a+=" ";switch(o+=a+"Tag: ",t.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(t.tagClass===i.Class.UNIVERSAL)switch(o+=t.type,t.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=t.type;if(o+="\n",o+=a+"Constructed: "+t.constructed+"\n",t.composed){var l=0,c="";for(u=0;u<t.value.length;++u)void 0!==t.value[u]&&(l+=1,c+=i.prettyPrint(t.value[u],e+1,n),u+1<t.value.length&&(c+=","));o+=a+"Sub values: "+l+c}else{if(o+=a+"Value: ",t.type===i.Type.OID){var p=i.derToOid(t.value);o+=p,r.pki&&r.pki.oids&&p in r.pki.oids&&(o+=" ("+r.pki.oids[p]+") ")}if(t.type===i.Type.INTEGER)try{o+=i.derToInteger(t.value)}catch(e){o+="0x"+r.util.bytesToHex(t.value)}else if(t.type===i.Type.BITSTRING){if(t.value.length>1?o+="0x"+r.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);1==d?o+=" (1 unused bit shown)":d>1&&(o+=" ("+d+" unused bits shown)")}}else t.type===i.Type.OCTETSTRING?(s.test(t.value)||(o+="("+t.value+") "),o+="0x"+r.util.bytesToHex(t.value)):t.type===i.Type.UTF8?o+=r.util.decodeUtf8(t.value):t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:s.test(t.value)?o+="0x"+r.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},function(t,e,n){var r=n(0);n(1),n(3),n(18);var i=t.exports=r.pkcs1=r.pkcs1||{};function o(t,e,n){n||(n=r.md.sha1.create());for(var i="",o=Math.ceil(e/n.digestLength),a=0;a<o;++a){var s=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);n.start(),n.update(t+s),i+=n.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,n){var i,a,s,u;"string"==typeof n?(i=n,a=arguments[3]||void 0,s=arguments[4]||void 0):n&&(i=n.label||void 0,a=n.seed||void 0,s=n.md||void 0,n.mgf1&&n.mgf1.md&&(u=n.mgf1.md)),s?s.start():s=r.md.sha1.create(),u||(u=s);var l=Math.ceil(t.n.bitLength()/8),c=l-2*s.digestLength-2;if(e.length>c)throw(m=new Error("RSAES-OAEP input message length is too long.")).length=e.length,m.maxLength=c,m;i||(i=""),s.update(i,"raw");for(var p=s.digest(),d="",f=c-e.length,h=0;h<f;h++)d+="\0";var g=p.getBytes()+d+""+e;if(a){if(a.length!==s.digestLength){var m;throw(m=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,m.digestLength=s.digestLength,m}}else a=r.random.getBytes(s.digestLength);var v=o(a,l-s.digestLength-1,u),y=r.util.xorBytes(g,v,g.length),b=o(y,s.digestLength,u);return"\0"+r.util.xorBytes(a,b,a.length)+y},i.decode_rsa_oaep=function(t,e,n){var i,a,s;"string"==typeof n?(i=n,a=arguments[3]||void 0):n&&(i=n.label||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(s=n.mgf1.md));var u=Math.ceil(t.n.bitLength()/8);if(e.length!==u)throw(v=new Error("RSAES-OAEP encoded message length is invalid.")).length=e.length,v.expectedLength=u,v;if(void 0===a?a=r.md.sha1.create():a.start(),s||(s=a),u<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var l=a.digest().getBytes(),c=e.charAt(0),p=e.substring(1,a.digestLength+1),d=e.substring(1+a.digestLength),f=o(d,a.digestLength,s),h=o(r.util.xorBytes(p,f,p.length),u-a.digestLength-1,s),g=r.util.xorBytes(d,h,d.length),m=g.substring(0,a.digestLength),v="\0"!==c,y=0;y<a.digestLength;++y)v|=l.charAt(y)!==m.charAt(y);for(var b=1,w=a.digestLength,$=a.digestLength;$<g.length;$++){var k=g.charCodeAt($);v|=k&(b?65534:0),w+=b&=1&k^1}if(v||1!==g.charCodeAt(w))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(w+1)}},function(t,e,n){var r=n(0);n(1);var i=null;!r.util.isNodejs||r.options.usePureJavaScript||process.versions["node-webkit"]||(i=n(5)),(t.exports=r.prng=r.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0},n=t.md,o=new Array(32),a=0;a<32;++a)o[a]=n.create();function s(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){var t=e.plugin.md.create();t.update(e.pools[0].digest().getBytes()),e.pools[0].start();for(var n=1,r=1;r<32;++r)(n=31===n?2147483648:n<<2)%e.reseeds==0&&(t.update(e.pools[r].digest().getBytes()),e.pools[r].start());var i=t.digest().getBytes();t.start(),t.update(i);var o=t.digest().getBytes();e.key=e.plugin.formatKey(i),e.seed=e.plugin.formatSeed(o),e.reseeds=4294967295===e.reseeds?0:e.reseeds+1,e.generated=0}function l(t){var e=null;if("undefined"!=typeof window){var n=window.crypto||window.msCrypto;n&&n.getRandomValues&&(e=function(t){return n.getRandomValues(t)})}var i=r.util.createBuffer();if(e)for(;i.length()<t;){var o=Math.max(1,Math.min(t-i.length(),65536)/4),a=new Uint32Array(Math.floor(o));try{e(a);for(var s=0;s<a.length;++s)i.putInt32(a[s])}catch(t){if(!("undefined"!=typeof QuotaExceededError&&t instanceof QuotaExceededError))throw t}}if(i.length()<t)for(var u,l,c,p=Math.floor(65536*Math.random());i.length()<t;){l=16807*(65535&p),l+=(32767&(u=16807*(p>>16)))<<16,p=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(s=0;s<3;++s)c=p>>>(s<<3),c^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&c))}return i.getBytes(t)}return e.pools=o,e.pool=0,e.generate=function(t,n){if(!n)return e.generateSync(t);var i=e.plugin.cipher,o=e.plugin.increment,a=e.plugin.formatKey,s=e.plugin.formatSeed,l=r.util.createBuffer();e.key=null,function c(p){if(p)return n(p);if(l.length()>=t)return n(null,l.getBytes(t));e.generated>1048575&&(e.key=null);if(null===e.key)return r.util.nextTick(function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var n=32-e.pools[0].messageLength<<5;e.seedFile(n,function(n,r){if(n)return t(n);e.collect(r),u(),t()})}(c)});var d=i(e.key,e.seed);e.generated+=d.length;l.putBytes(d);e.key=a(i(e.key,o(e.seed)));e.seed=s(i(e.key,e.seed));r.util.setImmediate(c)}()},e.generateSync=function(t){var n=e.plugin.cipher,i=e.plugin.increment,o=e.plugin.formatKey,a=e.plugin.formatSeed;e.key=null;for(var u=r.util.createBuffer();u.length()<t;){e.generated>1048575&&(e.key=null),null===e.key&&s();var l=n(e.key,e.seed);e.generated+=l.length,u.putBytes(l),e.key=o(n(e.key,i(e.seed))),e.seed=a(n(e.key,e.seed))}return u.getBytes(t)},i?(e.seedFile=function(t,e){i.randomBytes(t,function(t,n){if(t)return e(t);e(null,n.toString())})},e.seedFileSync=function(t){return i.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,l(t))}catch(t){e(t)}},e.seedFileSync=l),e.collect=function(t){for(var n=t.length,r=0;r<n;++r)e.pools[e.pool].update(t.substr(r,1)),e.pool=31===e.pool?0:e.pool+1},e.collectInt=function(t,n){for(var r="",i=0;i<n;i+=8)r+=String.fromCharCode(t>>i&255);e.collect(r)},e.registerWorker=function(t){if(t===self)e.seedFile=function(t,e){self.addEventListener("message",function t(n){var r=n.data;r.forge&&r.forge.prng&&(self.removeEventListener("message",t),e(r.forge.prng.err,r.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:t}}})};else{t.addEventListener("message",function(n){var r=n.data;r.forge&&r.forge.prng&&e.seedFile(r.forge.prng.needed,function(e,n){t.postMessage({forge:{prng:{err:e,bytes:n}}})})})}},e}},function(t,e,n){var r=n(0);n(2),n(1);var i=t.exports=r.sha1=r.sha1||{};r.md.sha1=r.md.algorithms.sha1=i,i.create=function(){a||(o=String.fromCharCode(128),o+=r.util.fillString(String.fromCharCode(0),64),a=!0);var t=null,e=r.util.createBuffer(),n=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var n=i.messageLengthSize/4,o=0;o<n;++o)i.fullMessageLength.push(0);return e=r.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=r.util.encodeUtf8(o));var u=o.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=u[1],u[1]=u[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),s(t,n,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=r.util.createBuffer();a.putBytes(e.bytes());var u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],p=0;p<i.fullMessageLength.length-1;++p)c+=(u=8*i.fullMessageLength[p+1])/4294967296>>>0,a.putInt32(c>>>0),c=u>>>0;a.putInt32(c);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};s(d,n,a);var f=r.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f},i};var o=null,a=!1;function s(t,e,n){for(var r,i,o,a,s,u,l,c=n.length();c>=64;){for(i=t.h0,o=t.h1,a=t.h2,s=t.h3,u=t.h4,l=0;l<16;++l)r=n.getInt32(),e[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<20;++l)r=(r=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|r>>>31,e[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<32;++l)r=(r=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|r>>>31,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<40;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<60;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;for(;l<80;++l)r=(r=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|r>>>30,e[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=r;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,c-=64}}},function(t,e,n){var r=n(0);n(1),n(8),n(3),function(){if(r.prime)t.exports=r.prime;else{var e=t.exports=r.prime=r.prime||{},n=r.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new n(null);o.fromInt(30);var a=function(t,e){return t|e};e.generateProbablePrime=function(t,e,i){"function"==typeof e&&(i=e,e={});var o=(e=e||{}).algorithm||"PRIMEINC";"string"==typeof o&&(o={name:o}),o.options=o.options||{};var a=e.prng||r.random,l={nextBytes:function(t){for(var e=a.getBytesSync(t.length),n=0;n<t.length;++n)t[n]=e.charCodeAt(n)}};if("PRIMEINC"===o.name)return function(t,e,i,o){if("workers"in i)return function(t,e,i,o){if("undefined"==typeof Worker)return s(t,e,i,o);var a=u(t,e),l=i.workers,c=i.workLoad||100,p=30*c/8,d=i.workerScript||"forge/prime.worker.js";if(-1===l)return r.util.estimateCores(function(t,e){t&&(e=2),l=e-1,f()});function f(){l=Math.max(1,l);for(var r=[],i=0;i<l;++i)r[i]=new Worker(d);for(var i=0;i<l;++i)r[i].addEventListener("message",f);var s=!1;function f(i){if(!s){0;var l=i.data;if(l.found){for(var d=0;d<r.length;++d)r[d].terminate();return s=!0,o(null,new n(l.prime,16))}a.bitLength()>t&&(a=u(t,e));var f=a.toString(16);i.target.postMessage({hex:f,workLoad:c}),a.dAddOffset(p,0)}}}f()}(t,e,i,o);return s(t,e,i,o)}(t,l,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function s(t,e,n,o){var a,s=u(t,e),l=(a=s.bitLength())<=100?27:a<=150?18:a<=200?15:a<=250?12:a<=300?9:a<=350?8:a<=400?7:a<=500?6:a<=600?5:a<=800?4:a<=1250?3:2;"millerRabinTests"in n&&(l=n.millerRabinTests);var c=10;"maxBlockTime"in n&&(c=n.maxBlockTime),function t(e,n,o,a,s,l,c){var p=+new Date;do{if(e.bitLength()>n&&(e=u(n,o)),e.isProbablePrime(s))return c(null,e);e.dAddOffset(i[a++%8],0)}while(l<0||+new Date-p<l);r.util.setImmediate(function(){t(e,n,o,a,s,l,c)})}(s,t,e,0,l,c,o)}function u(t,e){var r=new n(t,e),i=t-1;return r.testBit(i)||r.bitwiseTo(n.ONE.shiftLeft(i),a,r),r.dAddOffset(31-r.mod(o).byteValue(),0),r}}()}])}),function(){"use strict";var t,e,n="ngclipboard";"object"==typeof module&&module.exports?(t=require("angular"),e=require("clipboard"),module.exports=n):(t=window.angular,e=window.Clipboard),t.module(n,[]).directive("ngclipboard",function(){return{restrict:"A",scope:{ngclipboardSuccess:"&",ngclipboardError:"&"},link:function(t,n){var r=new e(n[0]);r.on("success",function(e){t.$apply(function(){t.ngclipboardSuccess({e:e})})}),r.on("error",function(e){t.$apply(function(){t.ngclipboardError({e:e})})})}}})}(),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["angular"],e):t.hasOwnProperty("angular")?e(t.angular):"object"==typeof exports&&(module.exports=e(require("angular")))}(this,function(t){"use strict";function e(t,e){var n;try{n=t[e]}catch(t){n=!1}if(n){var r="__"+Math.round(1e7*Math.random());try{t[e].setItem(r,r),t[e].removeItem(r,r)}catch(t){n=!1}}return n}return(t=t&&t.module?t:window.angular).module("ngStorage",[]).provider("$localStorage",n("localStorage")).provider("$sessionStorage",n("sessionStorage"));function n(n){var r=e(window,n);return function(){var i="ngStorage-";this.setKeyPrefix=function(t){if("string"!=typeof t)throw new TypeError("[ngStorage] - "+n+"Provider.setKeyPrefix() expects a String.");i=t};var o=t.toJson,a=t.fromJson;this.setSerializer=function(t){if("function"!=typeof t)throw new TypeError("[ngStorage] - "+n+"Provider.setSerializer expects a function.");o=t},this.setDeserializer=function(t){if("function"!=typeof t)throw new TypeError("[ngStorage] - "+n+"Provider.setDeserializer expects a function.");a=t},this.supported=function(){return!!r},this.get=function(t){return r&&a(r.getItem(i+t))},this.set=function(t,e){return r&&r.setItem(i+t,o(e))},this.remove=function(t){r&&r.removeItem(i+t)},this.$get=["$rootScope","$window","$log","$timeout","$document",function(r,s,u,l,c){var p,d,f=i.length,h=e(s,n),g=h||(u.warn("This browser does not support Web Storage!"),{setItem:t.noop,getItem:t.noop,removeItem:t.noop}),m={$default:function(e){for(var n in e)t.isDefined(m[n])||(m[n]=t.copy(e[n]));return m.$sync(),m},$reset:function(t){for(var e in m)"$"===e[0]||delete m[e]&&g.removeItem(i+e);return m.$default(t)},$sync:function(){for(var t,e=0,n=g.length;e<n;e++)(t=g.key(e))&&i===t.slice(0,f)&&(m[t.slice(f)]=a(g.getItem(t)))},$apply:function(){var e;if(d=null,!t.equals(m,p)){for(var n in e=t.copy(p),t.forEach(m,function(n,r){t.isDefined(n)&&"$"!==r[0]&&(g.setItem(i+r,o(n)),delete e[r])}),e)g.removeItem(i+n);p=t.copy(m)}},$supported:function(){return!!h}};return m.$sync(),p=t.copy(m),r.$watch(function(){d||(d=l(m.$apply,100,!1))}),s.addEventListener&&s.addEventListener("storage",function(e){if(e.key){var n=c[0];n.hasFocus&&n.hasFocus()||i!==e.key.slice(0,f)||(e.newValue?m[e.key.slice(f)]=a(e.newValue):delete m[e.key.slice(f)],p=t.copy(m),r.$apply())}}),s.addEventListener&&s.addEventListener("beforeunload",function(){m.$apply()}),m}]}}}),function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&"undefined"!=typeof exports?module.exports=e():t.Papa=e()}(this,function(){"use strict";var t,e,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},r=!n.document&&!!n.postMessage,i=r&&/(\?|&)papaworker(=|&|$)/.test(n.location.search),o=!1,a={},s=0,u={parse:function(e,r){var i=(r=r||{}).dynamicTyping||!1;k(i)&&(r.dynamicTypingFunction=i,i={});if(r.dynamicTyping=i,r.worker&&u.WORKERS_SUPPORTED){var l=function(){if(!u.WORKERS_SUPPORTED)return!1;if(!o&&null===u.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var e=u.SCRIPT_PATH||t;e+=(-1!==e.indexOf("?")?"&":"?")+"papaworker";var r=new n.Worker(e);return r.onmessage=v,r.id=s++,a[r.id]=r,r}();return l.userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=k(r.step),r.chunk=k(r.chunk),r.complete=k(r.complete),r.error=k(r.error),delete r.worker,void l.postMessage({input:e,config:r,workerId:l.id})}var c=null;"string"==typeof e?c=r.download?new p(r):new f(r):!0===e.readable&&k(e.read)&&k(e.on)?c=new h(r):(n.File&&e instanceof File||e instanceof Object)&&(c=new d(r));return c.stream(e)},unparse:function(t,e){var n=!1,r=!0,i=",",o="\r\n",a='"';!function(){if("object"!=typeof e)return;"string"==typeof e.delimiter&&1===e.delimiter.length&&-1===u.BAD_DELIMITERS.indexOf(e.delimiter)&&(i=e.delimiter);("boolean"==typeof e.quotes||e.quotes instanceof Array)&&(n=e.quotes);"string"==typeof e.newline&&(o=e.newline);"string"==typeof e.quoteChar&&(a=e.quoteChar);"boolean"==typeof e.header&&(r=e.header)}();var s=new RegExp(a,"g");"string"==typeof t&&(t=JSON.parse(t));if(t instanceof Array){if(!t.length||t[0]instanceof Array)return c(null,t);if("object"==typeof t[0])return c(l(t[0]),t)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),t.data instanceof Array&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=t.data[0]instanceof Array?t.fields:l(t.data[0])),t.data[0]instanceof Array||"object"==typeof t.data[0]||(t.data=[t.data])),c(t.fields||[],t.data||[]);throw"exception: Unable to serialize unrecognized input";function l(t){if("object"!=typeof t)return[];var e=[];for(var n in t)e.push(n);return e}function c(t,e){var n="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var a=t instanceof Array&&t.length>0,s=!(e[0]instanceof Array);if(a&&r){for(var u=0;u<t.length;u++)u>0&&(n+=i),n+=p(t[u],u);e.length>0&&(n+=o)}for(var l=0;l<e.length;l++){for(var c=a?t.length:e[l].length,d=0;d<c;d++){d>0&&(n+=i);var f=a&&s?t[d]:d;n+=p(e[l][f],d)}l<e.length-1&&(n+=o)}return n}function p(t,e){if(null==t)return"";t=t.toString().replace(s,a+a);var r="boolean"==typeof n&&n||n instanceof Array&&n[e]||function(t,e){for(var n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return!0;return!1}(t,u.BAD_DELIMITERS)||t.indexOf(i)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1);return r?a+t+a:t}}};if(u.RECORD_SEP=String.fromCharCode(30),u.UNIT_SEP=String.fromCharCode(31),u.BYTE_ORDER_MARK="\ufeff",u.BAD_DELIMITERS=["\r","\n",'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!n.Worker,u.SCRIPT_PATH=null,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=m,u.ParserHandle=g,u.NetworkStreamer=p,u.FileStreamer=d,u.StringStreamer=f,u.ReadableStreamStreamer=h,n.jQuery){var l=n.jQuery;l.fn.parse=function(t){var e=t.config||{},r=[];return this.each(function(t){if(!("INPUT"===l(this).prop("tagName").toUpperCase()&&"file"===l(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return!0;for(var i=0;i<this.files.length;i++)r.push({file:this.files[i],inputElem:this,instanceConfig:l.extend({},e)})}),i(),this;function i(){if(0!==r.length){var e,n,i,a,s=r[0];if(k(t.before)){var c=t.before(s.file,s.inputElem);if("object"==typeof c){if("abort"===c.action)return e="AbortError",n=s.file,i=s.inputElem,a=c.reason,void(k(t.error)&&t.error({name:e},n,i,a));if("skip"===c.action)return void o();"object"==typeof c.config&&(s.instanceConfig=l.extend(s.instanceConfig,c.config))}else if("skip"===c)return void o()}var p=s.instanceConfig.complete;s.instanceConfig.complete=function(t){k(p)&&p(t,s.file,s.inputElem),o()},u.parse(s.file,s.instanceConfig)}else k(t.complete)&&t.complete()}function o(){r.splice(0,1),i()}}}function c(t){this._handle=null,this._paused=!1,this._finished=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=w(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new g(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t){if(this.isFirstChunk&&k(this._config.beforeFirstChunk)){var e=this._config.beforeFirstChunk(t);void 0!==e&&(t=e)}this.isFirstChunk=!1;var r=this._partialLine+t;this._partialLine="";var o=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var a=o.meta.cursor;this._finished||(this._partialLine=r.substring(a-this._baseIndex),this._baseIndex=a),o&&o.data&&(this._rowCount+=o.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(i)n.postMessage({results:o,workerId:u.WORKER_ID,finished:s});else if(k(this._config.chunk)){if(this._config.chunk(o,this._handle),this._paused)return;o=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(o.data),this._completeResults.errors=this._completeResults.errors.concat(o.errors),this._completeResults.meta=o.meta),!s||!k(this._config.complete)||o&&o.meta.aborted||this._config.complete(this._completeResults,this._input),s||o&&o.meta.paused||this._nextChunk(),o}},this._sendError=function(t){k(this._config.error)?this._config.error(t):i&&this._config.error&&n.postMessage({workerId:u.WORKER_ID,error:t,finished:!1})}}function p(t){var e;(t=t||{}).chunkSize||(t.chunkSize=u.RemoteChunkSize),c.call(this,t),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),r||(e.onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)),e.open("GET",this._input,!r),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var n in t)e.setRequestHeader(n,t[n])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+i),e.setRequestHeader("If-None-Match","webkit-no-cache")}try{e.send()}catch(t){this._chunkError(t.message)}r&&0===e.status?this._chunkError():this._start+=this._config.chunkSize}},this._chunkLoaded=function(){4==e.readyState&&(e.status<200||e.status>=400?this._chunkError():(this._finished=!this._config.chunkSize||this._start>function(t){var e=t.getResponseHeader("Content-Range");if(null===e)return-1;return parseInt(e.substr(e.lastIndexOf("/")+1))}(e),this.parseChunk(e.responseText)))},this._chunkError=function(t){var n=e.statusText||t;this._sendError(n)}}function d(t){var e,n;(t=t||{}).chunkSize||(t.chunkSize=u.LocalChunkSize),c.call(this,t);var r="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,n=t.slice||t.webkitSlice||t.mozSlice,r?((e=new FileReader).onload=$(this._chunkLoaded,this),e.onerror=$(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var i=Math.min(this._start+this._config.chunkSize,this._input.size);t=n.call(t,this._start,i)}var o=e.readAsText(t,this._config.encoding);r||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function f(t){var e;t=t||{},c.call(this,t),this.stream=function(t){return t,e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,n=t?e.substr(0,t):e;return e=t?e.substr(t):"",this._finished=!e,this.parseChunk(n)}}}function h(t){t=t||{},c.call(this,t);var e=[],n=!0;this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._nextChunk=function(){e.length?this.parseChunk(e.shift()):n=!0},this._streamData=$(function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),n&&(n=!1,this.parseChunk(e.shift()))}catch(t){this._streamError(t)}},this),this._streamError=$(function(t){this._streamCleanUp(),this._sendError(t.message)},this),this._streamEnd=$(function(){this._streamCleanUp(),this._finished=!0,this._streamData("")},this),this._streamCleanUp=$(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function g(t){var e,n,r,i=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,o=this,a=0,s=!1,l=!1,c=[],p={data:[],errors:[],meta:{}};if(k(t.step)){var d=t.step;t.step=function(e){if(p=e,h())f();else{if(f(),0===p.data.length)return;a+=e.data.length,t.preview&&a>t.preview?n.abort():d(p,o)}}}function f(){if(p&&r&&(v("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),r=!1),t.skipEmptyLines)for(var e=0;e<p.data.length;e++)1===p.data[e].length&&""===p.data[e][0]&&p.data.splice(e--,1);return h()&&function(){if(!p)return;for(var t=0;h()&&t<p.data.length;t++)for(var e=0;e<p.data[t].length;e++)c.push(p.data[t][e]);p.data.splice(0,1)}(),function(){if(!p||!t.header&&!t.dynamicTyping)return p;for(var e=0;e<p.data.length;e++){for(var n=t.header?{}:[],r=0;r<p.data[e].length;r++){var i=r,o=p.data[e][r];t.header&&(i=r>=c.length?"__parsed_extra":c[r]),o=g(i,o),"__parsed_extra"===i?(n[i]=n[i]||[],n[i].push(o)):n[i]=o}p.data[e]=n,t.header&&(r>c.length?v("FieldMismatch","TooManyFields","Too many fields: expected "+c.length+" fields but parsed "+r,e):r<c.length&&v("FieldMismatch","TooFewFields","Too few fields: expected "+c.length+" fields but parsed "+r,e))}t.header&&p.meta&&(p.meta.fields=c);return p}()}function h(){return t.header&&0===c.length}function g(e,n){return o=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[o]&&(t.dynamicTyping[o]=t.dynamicTypingFunction(o)),!0===(t.dynamicTyping[o]||t.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(r=n,i.test(r)?parseFloat(r):r):n;var r,o}function v(t,e,n,r){p.errors.push({type:t,code:e,message:n,row:r})}this.parse=function(i,o,a){if(t.newline||(t.newline=function(t){var e=(t=t.substr(0,1048576)).split("\r"),n=t.split("\n"),r=n.length>1&&n[0].length<e[0].length;if(1===e.length||r)return"\n";for(var i=0,o=0;o<e.length;o++)"\n"===e[o][0]&&i++;return i>=e.length/2?"\r\n":"\r"}(i)),r=!1,t.delimiter)k(t.delimiter)&&(t.delimiter=t.delimiter(i),p.meta.delimiter=t.delimiter);else{var l=function(e,n,r){for(var i,o,a,s=[",","\t","|",";",u.RECORD_SEP,u.UNIT_SEP],l=0;l<s.length;l++){var c=s[l],p=0,d=0,f=0;a=void 0;for(var h=new m({delimiter:c,newline:n,preview:10}).parse(e),g=0;g<h.data.length;g++)if(r&&1===h.data[g].length&&0===h.data[g][0].length)f++;else{var v=h.data[g].length;d+=v,void 0!==a?v>1&&(p+=Math.abs(v-a),a=v):a=v}h.data.length>0&&(d/=h.data.length-f),(void 0===o||p<o)&&d>1.99&&(o=p,i=c)}return t.delimiter=i,{successful:!!i,bestDelimiter:i}}(i,t.newline,t.skipEmptyLines);l.successful?t.delimiter=l.bestDelimiter:(r=!0,t.delimiter=u.DefaultDelimiter),p.meta.delimiter=t.delimiter}var c=w(t);return t.preview&&t.header&&c.preview++,e=i,n=new m(c),p=n.parse(e,o,a),f(),s?{meta:{paused:!0}}:p||{meta:{paused:!1}}},this.paused=function(){return s},this.pause=function(){s=!0,n.abort(),e=e.substr(n.getCharIndex())},this.resume=function(){s=!1,o.streamer.parseChunk(e)},this.aborted=function(){return l},this.abort=function(){l=!0,n.abort(),p.meta.aborted=!0,k(t.complete)&&t.complete(p),e=""}}function m(t){var e=(t=t||{}).delimiter,n=t.newline,r=t.comments,i=t.step,o=t.preview,a=t.fastMode,s=t.quoteChar||'"';if(("string"!=typeof e||u.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),r===e)throw"Comment character same as delimiter";!0===r?r="#":("string"!=typeof r||u.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),"\n"!=n&&"\r"!=n&&"\r\n"!=n&&(n="\n");var l=0,c=!1;this.parse=function(t,u,p){if("string"!=typeof t)throw"Input must be a string";var d=t.length,f=e.length,h=n.length,g=r.length,m=k(i);l=0;var v=[],y=[],b=[],w=0;if(!t)return I();if(a||!1!==a&&-1===t.indexOf(s)){for(var $=t.split(n),C=0;C<$.length;C++){b=$[C];if(l+=b.length,C!==$.length-1)l+=n.length;else if(p)return I();if(!r||b.substr(0,g)!==r){if(m){if(v=[],D(b.split(e)),O(),c)return I()}else D(b.split(e));if(o&&C>=o)return v=v.slice(0,o),I(!0)}}return I()}for(var x=t.indexOf(e,l),T=t.indexOf(n,l),S=new RegExp(s+s,"g");;)if(t[l]!==s)if(r&&0===b.length&&t.substr(l,g)===r){if(-1===T)return I();l=T+h,T=t.indexOf(n,l),x=t.indexOf(e,l)}else if(-1!==x&&(x<T||-1===T))b.push(t.substring(l,x)),l=x+f,x=t.indexOf(e,l);else{if(-1===T)break;if(b.push(t.substring(l,T)),B(T+h),m&&(O(),c))return I();if(o&&v.length>=o)return I(!0)}else{var E=l;for(l++;;){if(-1===(E=t.indexOf(s,E+1)))return p||y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:v.length,index:l}),A();if(E===d-1)return A(t.substring(l,E).replace(S,s));if(t[E+1]!==s){if(t[E+1]===e){b.push(t.substring(l,E).replace(S,s)),l=E+1+f,x=t.indexOf(e,l),T=t.indexOf(n,l);break}if(t.substr(E+1,h)===n){if(b.push(t.substring(l,E).replace(S,s)),B(E+1+h),x=t.indexOf(e,l),m&&(O(),c))return I();if(o&&v.length>=o)return I(!0);break}y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:v.length,index:l}),E++}else E++}}return A();function D(t){v.push(t),w=l}function A(e){return p?I():(void 0===e&&(e=t.substr(l)),b.push(e),l=d,D(b),m&&O(),I())}function B(e){l=e,D(b),b=[],T=t.indexOf(n,l)}function I(t){return{data:v,errors:y,meta:{delimiter:e,linebreak:n,aborted:c,truncated:!!t,cursor:w+(u||0)}}}function O(){i(I()),v=[],y=[]}},this.abort=function(){c=!0},this.getCharIndex=function(){return l}}function v(t){var e=t.data,n=a[e.workerId],r=!1;if(e.error)n.userError(e.error,e.file);else if(e.results&&e.results.data){var i={abort:function(){r=!0,y(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:b,resume:b};if(k(n.userStep)){for(var o=0;o<e.results.data.length&&(n.userStep({data:[e.results.data[o]],errors:e.results.errors,meta:e.results.meta},i),!r);o++);delete e.results}else k(n.userChunk)&&(n.userChunk(e.results,i,e.file),delete e.results)}e.finished&&!r&&y(e.workerId,e.results)}function y(t,e){var n=a[t];k(n.userComplete)&&n.userComplete(e),n.terminate(),delete a[t]}function b(){throw"Not implemented."}function w(t){if("object"!=typeof t)return t;var e=t instanceof Array?[]:{};for(var n in t)e[n]=w(t[n]);return e}function $(t,e){return function(){t.apply(e,arguments)}}function k(t){return"function"==typeof t}return i?n.onmessage=function(t){var e=t.data;void 0===u.WORKER_ID&&e&&(u.WORKER_ID=e.workerId);if("string"==typeof e.input)n.postMessage({workerId:u.WORKER_ID,results:u.parse(e.input,e.config),finished:!0});else if(n.File&&e.input instanceof File||e.input instanceof Object){var r=u.parse(e.input,e.config);r&&n.postMessage({workerId:u.WORKER_ID,results:r,finished:!0})}}:u.WORKERS_SUPPORTED&&(e=document.getElementsByTagName("script"),t=e.length?e[e.length-1].src:"",document.body?document.addEventListener("DOMContentLoaded",function(){o=!0},!0):o=!0),p.prototype=Object.create(c.prototype),p.prototype.constructor=p,d.prototype=Object.create(c.prototype),d.prototype.constructor=d,f.prototype=Object.create(f.prototype),f.prototype.constructor=f,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,u}),"undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");function _init(){"use strict";$.AdminLTE.layout={activate:function(){var t=this;t.fix(),t.fixSidebar(),$("body, html, .wrapper").css("height","auto"),$(window,".wrapper").resize(function(){t.fix(),t.fixSidebar()})},fix:function(){$(".layout-boxed > .wrapper").css("overflow","hidden");var t=$(".main-footer").outerHeight()||0,e=$(".main-header").outerHeight()+t,n=$(window).height(),r=$(".sidebar").height()||0;if($("body").hasClass("fixed"))$(".content-wrapper, .right-side").css("min-height",n-t);else{var i;n>=r?($(".content-wrapper, .right-side").css("min-height",n-e),i=n-e):($(".content-wrapper, .right-side").css("min-height",r),i=r);var o=$($.AdminLTE.options.controlSidebarOptions.selector);void 0!==o&&o.height()>i&&$(".content-wrapper, .right-side").css("min-height",o.height())}},fixSidebar:function(){$("body").hasClass("fixed")?(void 0===$.fn.slimScroll&&window.console&&window.console.error("Error: the fixed layout requires the slimscroll plugin!"),$.AdminLTE.options.sidebarSlimScroll&&void 0!==$.fn.slimScroll&&($(".sidebar").slimScroll({destroy:!0}).height("auto"),$(".sidebar").slimScroll({height:$(window).height()-$(".main-header").height()+"px",color:"rgba(0,0,0,0.2)",size:"3px"}))):void 0!==$.fn.slimScroll&&$(".sidebar").slimScroll({destroy:!0}).height("auto")}},$.AdminLTE.pushMenu={activate:function(t){var e=$.AdminLTE.options.screenSizes;$(document).on("click",t,function(t){t.preventDefault(),$(window).width()>e.sm-1?$("body").hasClass("sidebar-collapse")?$("body").removeClass("sidebar-collapse").trigger("expanded.pushMenu"):$("body").addClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").hasClass("sidebar-open")?$("body").removeClass("sidebar-open").removeClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").addClass("sidebar-open").trigger("expanded.pushMenu")}),$(".content-wrapper").click(function(){$(window).width()<=e.sm-1&&$("body").hasClass("sidebar-open")&&$("body").removeClass("sidebar-open")}),($.AdminLTE.options.sidebarExpandOnHover||$("body").hasClass("fixed")&&$("body").hasClass("sidebar-mini"))&&this.expandOnHover()},expandOnHover:function(){var t=this,e=$.AdminLTE.options.screenSizes.sm-1;$(".main-sidebar").hover(function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-collapse")&&$(window).width()>e&&t.expand()},function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-expanded-on-hover")&&$(window).width()>e&&t.collapse()})},expand:function(){$("body").removeClass("sidebar-collapse").addClass("sidebar-expanded-on-hover")},collapse:function(){$("body").hasClass("sidebar-expanded-on-hover")&&$("body").removeClass("sidebar-expanded-on-hover").addClass("sidebar-collapse")}},$.AdminLTE.tree=function(t){var e=this,n=$.AdminLTE.options.animationSpeed;$(document).off("click",t+" li a").on("click",t+" li a",function(t){var r=$(this),i=r.next();if(i.is(".treeview-menu")&&i.is(":visible")&&!$("body").hasClass("sidebar-collapse"))i.slideUp(n,function(){i.removeClass("menu-open")}),i.parent("li").removeClass("active");else if(i.is(".treeview-menu")&&!i.is(":visible")){var o=r.parents("ul").first();o.find("ul:visible").slideUp(n).removeClass("menu-open");var a=r.parent("li");i.slideDown(n,function(){i.addClass("menu-open"),o.find("li.active").removeClass("active"),a.addClass("active"),e.layout.fix()})}i.is(".treeview-menu")&&t.preventDefault()})},$.AdminLTE.controlSidebar={activate:function(){var t=this,e=$.AdminLTE.options.controlSidebarOptions,n=$(e.selector);$(e.toggleBtnSelector).on("click",function(r){r.preventDefault(),n.hasClass("control-sidebar-open")||$("body").hasClass("control-sidebar-open")?t.close(n,e.slide):t.open(n,e.slide)});var r=$(".control-sidebar-bg");t._fix(r),$("body").hasClass("fixed")?t._fixForFixed(n):$(".content-wrapper, .right-side").height()<n.height()&&t._fixForContent(n)},open:function(t,e){e?t.addClass("control-sidebar-open"):$("body").addClass("control-sidebar-open")},close:function(t,e){e?t.removeClass("control-sidebar-open"):$("body").removeClass("control-sidebar-open")},_fix:function(t){var e=this;if($("body").hasClass("layout-boxed")){if(t.css("position","absolute"),t.height($(".wrapper").height()),e.hasBindedResize)return;$(window).resize(function(){e._fix(t)}),e.hasBindedResize=!0}else t.css({position:"fixed",height:"auto"})},_fixForFixed:function(t){t.css({position:"fixed","max-height":"100%",overflow:"auto","padding-bottom":"50px"})},_fixForContent:function(t){$(".content-wrapper, .right-side").css("min-height",t.height())}},$.AdminLTE.boxWidget={selectors:$.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,icons:$.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,animationSpeed:$.AdminLTE.options.animationSpeed,activate:function(t){var e=this;t||(t=document),$(t).on("click",e.selectors.collapse,function(t){t.preventDefault(),e.collapse($(this))}),$(t).on("click",e.selectors.remove,function(t){t.preventDefault(),e.remove($(this))})},collapse:function(t){var e=t.parents(".box").first(),n=e.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer");e.hasClass("collapsed-box")?(t.children(":first").removeClass(this.icons.open).addClass(this.icons.collapse),n.slideDown(this.animationSpeed,function(){e.removeClass("collapsed-box")})):(t.children(":first").removeClass(this.icons.collapse).addClass(this.icons.open),n.slideUp(this.animationSpeed,function(){e.addClass("collapsed-box")}))},remove:function(t){t.parents(".box").first().slideUp(this.animationSpeed)}}}$.AdminLTE={},$.AdminLTE.options={navbarMenuSlimscroll:!0,navbarMenuSlimscrollWidth:"3px",navbarMenuHeight:"200px",animationSpeed:500,sidebarToggleSelector:"[data-toggle='offcanvas']",sidebarPushMenu:!0,sidebarSlimScroll:!0,sidebarExpandOnHover:!1,enableBoxRefresh:!0,enableBSToppltip:!0,BSTooltipSelector:"[data-toggle='tooltip']",enableFastclick:!1,enableControlTreeView:!0,enableControlSidebar:!0,controlSidebarOptions:{toggleBtnSelector:"[data-toggle='control-sidebar']",selector:".control-sidebar",slide:!0},enableBoxWidget:!0,boxWidgetOptions:{boxWidgetIcons:{collapse:"fa-minus",open:"fa-plus",remove:"fa-times"},boxWidgetSelectors:{remove:'[data-widget="remove"]',collapse:'[data-widget="collapse"]'}},directChat:{enable:!0,contactToggleSelector:'[data-widget="chat-pane-toggle"]'},colors:{lightBlue:"#3c8dbc",red:"#f56954",green:"#00a65a",aqua:"#00c0ef",yellow:"#f39c12",blue:"#0073b7",navy:"#001F3F",teal:"#39CCCC",olive:"#3D9970",lime:"#01FF70",orange:"#FF851B",fuchsia:"#F012BE",purple:"#8E24AA",maroon:"#D81B60",black:"#222222",gray:"#d2d6de"},screenSizes:{xs:480,sm:768,md:992,lg:1200}},$(function(){"use strict";$("body").removeClass("hold-transition"),"undefined"!=typeof AdminLTEOptions&&$.extend(!0,$.AdminLTE.options,AdminLTEOptions);var t=$.AdminLTE.options;_init(),$.AdminLTE.layout.activate(),t.enableControlTreeView&&$.AdminLTE.tree(".sidebar"),t.enableControlSidebar&&$.AdminLTE.controlSidebar.activate(),t.navbarMenuSlimscroll&&void 0!==$.fn.slimscroll&&$(".navbar .menu").slimscroll({height:t.navbarMenuHeight,alwaysVisible:!1,size:t.navbarMenuSlimscrollWidth}).css("width","100%"),t.sidebarPushMenu&&$.AdminLTE.pushMenu.activate(t.sidebarToggleSelector),t.enableBSToppltip&&$("body").tooltip({selector:t.BSTooltipSelector,container:"body"}),t.enableBoxWidget&&$.AdminLTE.boxWidget.activate(),t.enableFastclick&&"undefined"!=typeof FastClick&&FastClick.attach(document.body),t.directChat.enable&&$(document).on("click",t.directChat.contactToggleSelector,function(){$(this).parents(".direct-chat").first().toggleClass("direct-chat-contacts-open")}),$('.btn-group[data-toggle="btn-toggle"]').each(function(){var t=$(this);$(this).find(".btn").on("click",function(e){t.find(".btn.active").removeClass("active"),$(this).addClass("active"),e.preventDefault()})})}),function(t){"use strict";t.fn.boxRefresh=function(e){var n=t.extend({trigger:".refresh-btn",source:"",onLoadStart:function(t){return t},onLoadDone:function(t){return t}},e),r=t('<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>');return this.each(function(){if(""!==n.source){var e=t(this);e.find(n.trigger).first().on("click",function(t){var i;t.preventDefault(),(i=e).append(r),n.onLoadStart.call(i),e.find(".box-body").load(n.source,function(){var t;(t=e).find(r).remove(),n.onLoadDone.call(t)})})}else window.console&&window.console.log("Please specify a source first - boxRefresh()")})}}(jQuery),function(t){"use strict";t.fn.activateBox=function(){t.AdminLTE.boxWidget.activate(this)},t.fn.toggleBox=function(){var e=t(t.AdminLTE.boxWidget.selectors.collapse,this);t.AdminLTE.boxWidget.collapse(e)},t.fn.removeBox=function(){var e=t(t.AdminLTE.boxWidget.selectors.remove,this);t.AdminLTE.boxWidget.remove(e)}}(jQuery),function(t){"use strict";t.fn.todolist=function(e){var n=t.extend({onCheck:function(t){return t},onUncheck:function(t){return t}},e);return this.each(function(){void 0!==t.fn.iCheck?(t("input",this).on("ifChecked",function(){var e=t(this).parents("li").first();e.toggleClass("done"),n.onCheck.call(e)}),t("input",this).on("ifUnchecked",function(){var e=t(this).parents("li").first();e.toggleClass("done"),n.onUncheck.call(e)})):t("input",this).on("change",function(){var e=t(this).parents("li").first();e.toggleClass("done"),t("input",e).is(":checked")?n.onCheck.call(e):n.onUncheck.call(e)})})}}(jQuery); +\ No newline at end of file diff --git a/web-vault/u2f-connector.html b/web-vault/u2f-connector.html @@ -5,6 +5,6 @@ <title>U2F Connector</title> </head> <body> - <script src="js/u2f.min.js?v=twgcvb"></script> + <script src="js/u2f.min.js?v=h5k6l8"></script> </body> </html>