UNPKG

pip-webui

Version:

HTML5 UI for LOB applications

1 lines 30.8 kB
!function(e){"use strict";e.module("pipSettings",["pipSettings.Service","pipSettings.Page"])}(window.angular),function(e){try{e=angular.module("pipSettings.Templates")}catch(t){e=angular.module("pipSettings.Templates",[])}e.run(["$templateCache",function(e){e.put("settings_page/settings_page.html",'<md-toolbar class="pip-appbar-ext"></md-toolbar><pip-document width="800" min-height="400" class="pip-settings"><div class="pip-menu-container" ng-hide="manager === false || !tabs || tabs.length < 1"><md-list class="pip-menu pip-simple-list hide-xs" pip-selected="selected.tabIndex" pip-selected-watch="selected.navId" pip-select="onNavigationSelect($event.id)"><md-list-item class="pip-simple-list-item pip-selectable flex" ng-repeat="tab in tabs track by tab.state" ng-if="$party.id == $user.id || tab.state == \'settings.basic_info\'|| tab.state ==\'settings.contact_info\' || tab.state ==\'settings.blacklist\'" md-ink-ripple="" pip-id="{{:: tab.state }}"><p>{{::tab.title | translate}}</p></md-list-item></md-list><div class="pip-content-container" ng-if="selected.tab"><pip-dropdown class="hide-gt-xs" pip-actions="tabs" pip-dropdown-select="onDropdownSelect" pip-active-index="selected.tabIndex"></pip-dropdown><div class="pip-body tp24-flex layout-column" ui-view=""></div></div></div><div class="layout-column layout-align-center-center flex" ng-show="manager === false || !tabs || tabs.length < 1">{{::\'ERROR_400\' | translate}}</div></pip-document>')}])}(),function(e){try{e=angular.module("pipSettings.Templates")}catch(t){e=angular.module("pipSettings.Templates",[])}e.run(["$templateCache",function(e){e.put("user_settings/user_settings_basic_info.html",'<form name="form" class="w-stretch" novalidate=""><md-progress-linear class="pip-progress-top" ng-show="transaction.busy()" md-mode="indeterminate"></md-progress-linear><div class="layout-row bm12"><div class="md-tile-left"><pip-avatar-edit pip-party-id="$party.id" pip-created="onPictureCreated($event)" pip-changed="onPictureChanged($control, $event)"></pip-avatar-edit></div><div class="md-tile-content tp0 layout-align-center"><h3 class="tm16 bm8 text-one-line">{{ nameCopy }}</h3><p class="text-primary text-overflow m0">{{::\'SETTINGS_BASIC_INFO_FROM\' | translate}} {{$user.signup | formatLongDate }}</p></div></div><md-input-container class="md-block"><label>{{::\'SETTINGS_BASIC_INFO_FULL_NAME\' | translate}}</label> <input name="fullName" step="any" type="text" tabindex="0" required="" ng-model="$party.name" ng-disabled="transaction.busy()" ng-change="onChangeBasicInfo()"><div class="hint" ng-if="errorsWithHint(form, form.fullName).hint">{{::\'ERROR_FULLNAME_INVALID\' | translate}}</div></md-input-container><md-input-container class="md-block bm0"><label>{{::\'SETTINGS_BASIC_INFO_PRIMARY_EMAIL\' | translate}}</label> <input name="email" type="email" required="" ng-model="$party.email" ng-change="onChangeBasicInfo()" pip-email-unique="{{$party.email}}"><div class="hint" ng-if="errorsWithHint(form, form.email).hint && !$user.email_ver">{{::\'SETTINGS_BASIC_INFO_VERIFY_HINT\' | translate}}</div><div ng-messages="errorsWithHint(form.email)" ng-hide="$party.type ==\'team\'"><div ng-message="email">{{::\'ERROR_EMAIL_INVALID\' | translate}}</div><div ng-message="emailUnique">{{::\'ERROR_EMAIL_INVALID\' | translate}}</div></div></md-input-container><md-button class="md-raised bm16 tm8 rm8" ng-click="onVerifyEmail($event)" ng-hide="$user.email_ver || $party.type ==\'team\'">{{::\'SETTINGS_BASIC_INFO_VERIFY_CODE\' | translate}}</md-button><md-button ng-click="onChangePassword($event)" class="md-raised bm16 tm8" ng-hide="$party.type ==\'team\'">{{::\'SETTINGS_BASIC_INFO_CHANGE_PASSWORD\' | translate}}</md-button><md-input-container class="md-block flex"><label>{{::\'SETTINGS_BASIC_INFO_WORDS_ABOUT_ME\' | translate }}</label> <textarea ng-model="$party.about" columns="1" ng-change="onChangeBasicInfo()"></textarea></md-input-container><md-input-container class="md-block" ng-hide="$party.type ==\'team\'"><label>{{::\'GENDER\' | translate}}</label><md-select ng-model="$party.gender" ng-change="onChangeBasicInfo()" placeholder="{{\'GENDER\' | translate}}"><md-option ng-value="gender.id" ng-repeat="gender in genders">{{gender.name}}</md-option></md-select></md-input-container><div ng-hide="$party.type ==\'team\'"><p class="text-caption text-grey tm0 bm0">{{::\'SETTINGS_BASIC_INFO_BIRTHDAY\' | translate}}</p><pip-date ng-model="$party.birthday" ng-change="onChangeBasicInfo()" pip-time-mode="past time-mode=" past"=""></pip-date></div><md-input-container class="md-block" ng-hide="$party.type ==\'team\'"><label>{{::\'LANGUAGE\' | translate}}</label><md-select placeholder="{{\'LANGUAGE\' | translate}}" ng-model="$user.language" ng-change="onChangeUser()"><md-option ng-value="language.id" ng-repeat="language in languages">{{language.name}}</md-option></md-select></md-input-container><md-input-container class="md-block" ng-if="$party.type !=\'team\'"><label>{{::\'THEME\' | translate}}</label><md-select class="w-stretch theme-text-primary" ng-model="$user.theme" ng-change="onChangeUser()" ng-disabled="transaction.busy()"><md-option ng-value="theme" ng-repeat="theme in themes" ng-selected="$theme == theme ? true : false">{{ theme | translate }}</md-option></md-select></md-input-container><pip-location-edit class="map-edit bm24-flex" ng-hide="$party.type ==\'team\'" pip-changed="onChangeBasicInfo()" pip-location-name="$party.loc_name" pip-location-pos="loc_pos"></pip-location-edit></form>')}])}(),function(e){try{e=angular.module("pipSettings.Templates")}catch(t){e=angular.module("pipSettings.Templates",[])}e.run(["$templateCache",function(e){e.put("user_settings/user_settings_change_password.html",'<md-dialog class="pip-dialog layout-column" width="440"><form name="form" ng-submit="onApply()"><div class="pip-header"><h3 class="m0">{{::\'SETTINGS_CHANGE_PASSWORD_TITLE\' | translate : module}}</h3></div><div class="pip-body"><div class="pip-content"><div class="text-error bm8" ng-messages="form.$serverError"><div ng-message="ERROR_UNKNOWN">{{ form.$serverError.ERROR_UNKNOWN | translate }}</div></div><md-input-container class="md-block"><label>{{::\'SETTINGS_CHANGE_PASSWORD_CURRENT_PASSWORD\' | translate }}</label> <input name="oldPassword" type="password" ng-model="changePasData.old_password" ng-required="change_password.$submitted" pip-clear-errors=""><div ng-messages="errorsWithHint(form, form.oldPassword)"><div ng-message="required">{{::\'ERROR_REQUIRED\' | translate }}</div><div ng-message="ERROR_1107">{{::\'ERROR_WRONG_PASSWORD\' | translate }}</div></div></md-input-container><md-input-container class="md-block"><label>{{\'SETTINGS_CHANGE_PASSWORD_NEW_PASSWORD\' | translate }}</label> <input name="newPassword" type="password" ng-model="changePasData.new_password" ng-change="onCheckRepeatPassword()" ng-required="change_password.$submitted" ng-minlength="6" pip-clear-errors=""><div class="hint" ng-if="errorsWithHint(form, form.newPassword).hint">{{ \'HINT_PASSWORD\' | translate }}</div><div ng-messages="errorsWithHint(form, form.newPassword)"><div ng-message="required">{{::\'ERROR_REQUIRED\' | translate}}</div><div ng-message="minlength">{{::\'HINT_PASSWORD\' | translate }}</div><div ng-message="ERROR_1105">{{::\'ERROR_IDENTICAL_PASSWORDS\' | translate }}</div></div></md-input-container><md-input-container class="md-block"><label>{{ \'SETTINGS_CHANGE_PASSWORD_REPEAT_RASSWORD\' | translate }}</label> <input name="repeat" type="password" ng-model="repeat" ng-change="onCheckRepeatPassword()" ng-required="change_password.$submitted" ng-minlength="6"><div class="hint" ng-if="errorsRepeatWithHint(form.repeat).hint">{{::\'HINT_REPEAT_PASSWORD\' | translate }}</div><div ng-messages="errorsRepeatWithHint(form.repeat)"><div ng-message="required">{{::\'ERROR_REQUIRED\' | translate }}</div><div ng-message="minlength">{{::\'HINT_PASSWORD\' | translate }}</div><div ng-message="repeat">{{::\'REPEAT_PASSWORD_INVALID\' | translate }}</div></div></md-input-container></div></div><div class="pip-footer"><div><md-button aria-label="xxx" ng-click="onCancel()">{{::\'CANCEL\' | translate }}</md-button><md-button type="submit" class="md-accent" aria-label="xxx">{{::\'APPLY\' | translate : module}}</md-button></div></div></form></md-dialog>')}])}(),function(e){try{e=angular.module("pipSettings.Templates")}catch(t){e=angular.module("pipSettings.Templates",[])}e.run(["$templateCache",function(e){e.put("user_settings/user_settings_sessions.html",'<md-progress-linear ng-show="transaction.busy()" md-mode="indeterminate" class="pip-progress-top"></md-progress-linear><div class="pip-details-title pip-sessions"><p class="pip-title bm16">{{::\'SETTINGS_ACTIVE_SESSIONS_TITLE\' | translate}}</p><p class="pip-subtitle">{{::\'SETTINGS_ACTIVE_SESSIONS_SUBTITLE\' | translate}}</p></div><md-list class="w-stretch"><div ng-repeat="session in sessions"><div class="layout-row" ng-init="showBlock = session.id != sessionId" ng-click="showBlock = !showBlock"><p class="m0 text-subhead2 text-overflow max-w50-stretch">{{::session.client}}</p><p class="m0 lp4 text-body1 color-secondary-text flex">{{::\'SETTINGS_ACTIVE_SESSION_ACTIVE\' | translate}}</p><p class="m0 text-body1 color-secondary-text">{{::country}}<md-icon ng-if="showBlock" md-svg-icon="icons:triangle-up"></md-icon><md-icon ng-if="!showBlock" md-svg-icon="icons:triangle-down"></md-icon></p></div><div class="layout-row bm8 bp8" ng-class="{\'divider-bottom\':!$last}"><div class="flex-50"><p class="m0 bm4 text-body1 text-overflow color-secondary-text">{{session.last_req | date : \'medium\'}}</p><p class="m0 bm4 text-body1 text-overflow color-secondary-text" ng-show="showBlock">{{::\'SETTINGS_ACTIVE_SESSION_OS\' | translate}}{{::session.platform}}</p><p class="m0 bm4 text-body1 text-overflow color-secondary-text" ng-show="showBlock">{{::\'SETTINGS_ACTIVE_SESSION_IP\' | translate}}{{::session.address}}</p><md-button class="md-raised" ng-show="showBlock && session.id != sessionId" ng-click="onRemove(session)">{{::\'SETTINGS_ACTIVE_SESSIONS_CLOSE_SESSION\' | translate}}</md-button></div><pip-location-ip class="map-edit flex-50" ng-if="showBlock" pip-ipaddress="session.address" pip-extra-info="country = extraInfo.country"></pip-location-ip></div></div></md-list><div class="layout-row layout-align-end-center"><md-button class="md-raised" ng-show="sessions.length > 1" ng-click="onRemoveAll()">{{::\'SETTINGS_ACTIVE_SESSIONS_CLOSE_ACTIVE_SESSIONS\' | translate}}</md-button></div>')}])}(),function(e){try{e=angular.module("pipSettings.Templates")}catch(t){e=angular.module("pipSettings.Templates",[])}e.run(["$templateCache",function(e){e.put("user_settings/user_settings_verify_email.html",'<md-dialog class="pip-dialog layout-column" width="440"><div class="pip-body"><div class="pip-content"><md-progress-linear ng-show="transaction.busy()" md-mode="indeterminate" class="pip-progress-top"></md-progress-linear><h2>{{::\'VERIFY_EMAIL_TITLE\' | translate}}</h2><p class="title-padding">{{::\'VERIFY_EMAIL_TEXT_1\' | translate}}</p><form name="form" novalidate=""><div ng-messages="form.$serverError" class="text-error bm8"><div ng-message="ERROR_UNKNOWN">{{ form.$serverError.ERROR_UNKNOWN | translate }}</div></div><md-input-container class="display bp4 md-block"><label>{{::\'EMAIL\' | translate}}</label> <input name="email" type="email" ng-model="data.email" required="" step="any" pip-clear-errors="" tabindex="1" ng-disabled="transaction.busy()" pip-test="input-email"><div class="hint" ng-if="errorsWithHint(form, form.email).hint">{{::\'HINT_EMAIL\' | translate}}</div><div ng-messages="errorsWithHint(form, form.email)" xng-if="!form.email.$pristine"><div ng-message="required">{{::\'ERROR_EMAIL_INVALID\' | translate }}</div><div ng-message="ERROR_1106">{{::\'ERROR_USER_NOT_FOUND\' | translate}}</div></div></md-input-container><md-input-container class="md-block"><label>{{::\'ENTRY_VERIFICATION_CODE\' | translate}}</label> <input name="code" ng-disabled="transaction.busy()" tabindex="0" ng-model="data.code" required="" pip-clear-errors=""><div ng-messages="errorsWithHint(form, form.code)"><div ng-message="required">{{::\'ERROR_CODE_INVALID\' | translate }}</div><div ng-message="ERROR_1103">{{::\'ERROR_CODE_WRONG\' | translate }}</div></div></md-input-container><p>{{::\'VERIFY_EMAIL_TEXT_21\' | translate}} <a ng-click="onRequestVerificationClick()" class="pointer" tabindex="0">{{::\'VERIFY_EMAIL_RESEND\' | translate}}</a> {{::\'VERIFY_EMAIL_TEXT_22\' | translate}}</p></form></div></div><div class="pip-footer"><md-button ng-click="onCancel()" ng-hide="transaction.busy()" aria-label="xxx">{{::\'CANCEL\' | translate}}</md-button><md-button class="md-accent" ng-click="onVerify()" ng-hide="transaction.busy()" tabindex="0" aria-label="xxx" ng-disabled="data.code.length == 0 || data.email.length == 0 || (!data.email && form.$pristine) || (!data.code)">{{::\'VERIFY\' | translate}}</md-button><md-button class="md-warn" ng-show="transaction.busy()" ng-click="transaction.abort()" tabindex="0" aria-label="xxx">{{::\'CANCEL\' | translate}}</md-button></div></md-dialog>')}])}(),function(e,t){"use strict";var n=e.module("pipSettings.Page",["pipState","pipSettings.Service","pipAppBar","pipSelected","pipTranslate","pipSettings.Templates"]);n.config(["pipAuthStateProvider",function(e){e.state("settings",{url:"/settings?party_id",auth:!0,controller:"pipSettingsPageController",templateUrl:"settings_page/settings_page.html"})}]),n.controller("pipSettingsPageController",["$scope","$state","$rootScope","$timeout","pipAppBar","pipSettings",function(e,n,a,i,s,r){function o(){s.showMenuNavIcon(),s.showTitleText("SETTINGS_TITLE"),s.showLocalActions(null,[]),s.showShadowSm(),s.hideSearch()}function l(e){d(e.state)}function d(t){p(t),e.selected.tab&&n.go(t)}function p(n){e.selected.tab=t.find(e.tabs,function(e){return e.state===n}),e.selected.tabIndex=t.indexOf(e.tabs,e.selected.tab),e.selected.tabId=n}e.tabs=t.filter(r.getTabs(),function(e){if(e.visible===!0&&(!e.access||e.access(a.$user,e)))return e}),e.tabs=t.sortBy(e.tabs,"index"),e.selected={},"settings"!==n.current.name&&p(n.current.name),"settings"===n.current.name&&r.getDefaultTab()?p(r.getDefaultTab().state):i(function(){r.getDefaultTab()&&p(r.getDefaultTab().state),!r.getDefaultTab()&&e.tabs.length>0&&p(e.tabs[0].state)}),o(),e.onNavigationSelect=d,e.onDropdownSelect=l}])}(window.angular,window._),function(e,t){"use strict";var n=e.module("pipSettings.Service",[]);n.provider("pipSettings",["pipAuthStateProvider",function(e){function n(e){return"settings."+e}function a(){return t.clone(d,!0)}function i(){var e;return e=t.find(d,function(t){return t.state===e}),t.clone(e,!0)}function s(a){var i;if(o(a),i=t.find(d,function(e){return e.state===n(a.state)}))throw new Error('Tab with state name "'+a.state+'" is already registered');d.push({state:n(a.state),title:a.title,index:a.index||1e5,access:a.access,visible:a.visible!==!1,stateConfig:t.clone(a.stateConfig,!0)}),e.state(n(a.state),a.stateConfig),"undefined"==typeof l&&1===d.length&&r(a.state)}function r(a){if(!t.find(d,function(e){return e.state===n(a)}))throw new Error('Tab with state name "'+a+'" is not registered');l=n(a),e.redirect("settings",n(a))}function o(e){if(!e||!t.isObject(e))throw new Error("Invalid object");if(null===e.state||""===e.state)throw new Error("Tab should have valid Angular UI router state name");if(e.access&&!t.isFunction(e.access))throw new Error('"access" should be a function');if(!e.stateConfig||!t.isObject(e.stateConfig))throw new Error("Invalid state configuration object")}var l,d=[];return{addTab:s,getTabs:a,setDefaultTab:r,getDefaultTab:i,$get:function(){return{getTabs:a,addTab:s,getDefaultTab:i,setDefaultTab:r}}}}])}(window.angular,window._),function(e){"use strict";e.module("pipUserSettings",["ngMaterial","pipData","pipSettings.Service","pipSettings.Page","pipUserSettings.Data","pipUserSettings.Strings","pipUserSettings.Sessions","pipUserSettings.BasicInfo","pipSettings.Templates"])}(window.angular),function(e,t){"use strict";var n=e.module("pipUserSettings.BasicInfo",["pipUserSettings.ChangePassword","pipUserSettings.VerifyEmail","pipSettings.Service","pipSettings.Page"]);n.config(["pipSettingsProvider",function(e){e.addTab({state:"basic_info",index:1,title:"SETTINGS_BASIC_INFO_TITLE",stateConfig:{url:"/basic_info",controller:"pipUserSettingsBasicInfoController",templateUrl:"user_settings/user_settings_basic_info.html",auth:!0}}),e.setDefaultTab("basic_info")}]),n.controller("pipUserSettingsBasicInfoController",["$scope","$rootScope","$mdDialog","$state","$window","$timeout","$mdTheming","pipTranslate","pipTransaction","pipTheme","pipToasts","pipUserSettingsTabData","pipFormErrors",function(n,a,i,s,r,o,l,d,p,c,S,_,m){function u(){n.picture.save(function(){a.$broadcast("pipPartyAvatarUpdated")},function(e){return new Error(e)})}function T(e){n.picture=e.sender,n.picture.save(function(){a.$broadcast("pipPartyAvatarUpdated")},function(e){return new Error(e)})}function g(){if(n.form&&n.form.$setSubmitted(),a.$party){if("person"===a.$party.type&&n.form.$invalid)return;a.$party.loc_pos=n.loc_pos;try{var t=e.toJson(a.$party)}catch(e){throw e}t!==n.originalParty&&_.updateParty(n.transaction,a.$party,function(e){n.originalParty=t,n.nameCopy=e.name},function(t){n.message=String()+"ERROR_"+t.status||t.data.status_code,a.$party=e.fromJson(n.originalParty)})}}function I(){a.$user.id===a.$party.id&&_.updateUser(n.transaction,a.$user,function(e){d.use(e.language),a.$user.language=e.language,a.$user.theme=e.theme,a.$user.theme&&c.setCurrentTheme(a.$user.theme,!0)},function(e){var t;t=String()+"ERROR_"+e.status||e.data.status_code,S.showNotification(d.translate(t),null,null,null)})}function E(e){var t;i.show({templateUrl:"user_settings/user_settings_change_password.html",controller:"pipUserSettingsChangePasswordController",targetEvent:e,locals:{email:a.$party.email}}).then(function(e){e&&(t=String()+"RESET_PWD_SUCCESS_TEXT",S.showNotification(d.translate(t),null,null,null))})}function N(e){var t;i.show({templateUrl:"user_settings/user_settings_verify_email.html",controller:"pipUserSettingsVerifyEmailController",targetEvent:e,locals:{email:a.$party.email}}).then(function(e){n.user.email_ver=e,e&&(t=String()+"VERIFY_EMAIL_SUCCESS_TEXT",S.showNotification(d.translate(t),null,null,null))})}try{n.originalParty=e.toJson(a.$party)}catch(e){throw e}n.nameCopy=a.$party.name,o(function(){n.loc_pos=a.$party.loc_pos}),n.genders=d.translateSet(["male","female","n/s"]),n.languages=d.translateSet(["ru","en"]),n.transaction=p("settings.basic_info",n),n.themes=t.keys(t.omit(l.THEMES,"default")),s.get("settings.basic_info").onExit=g,n.errorsWithHint=m.errorsWithHint,n.onChangePassword=E,n.onVerifyEmail=N,n.onPictureCreated=T,n.onPictureChanged=u,n.onChangeUser=t.debounce(I,2e3),n.onChangeBasicInfo=t.debounce(g,2e3)}])}(window.angular,window._),function(e){"use strict";var t=e.module("pipUserSettings.ChangePassword",[]);t.controller("pipUserSettingsChangePasswordController",["$scope","$rootScope","$mdDialog","email","pipRest","pipTransaction","pipFormErrors",function(e,t,n,a,i,s,r){function o(){n.cancel()}function l(){e.changePasData&&(e.repeat!==e.changePasData.new_password&&""!==e.repeat&&e.repeat?(e.showRepeatHint=!0,e.form.repeat.$setValidity("repeat",!1)):(e.form.repeat.$setValidity("repeat",!0),e.repeat===e.changePasData.new_password?e.showRepeatHint=!1:e.showRepeatHint=!0))}function d(){e.onCheckRepeatPassword(),e.form.$invalid||e.transaction.begin("CHANGE_PASSWORD")&&(e.changePasData.email=a,i.changePassword().call(e.changePasData,function(){e.transaction.end(),n.hide(!0)},function(t){e.transaction.end(t),r.setFormError(e.form,t,{1107:"oldPassword",1105:"newPassword"})}))}e.transaction=s("settings.change_password",e),e.errorsRepeatWithHint=function(t,n){return e.showRepeatHint?r.errorsWithHint(t,n):{}},e.showRepeatHint=!0,e.changePasData={},e.errorsWithHint=r.errorsWithHint,e.onCancel=o,e.onCheckRepeatPassword=l,e.onApply=d}])}(window.angular),function(e){"use strict";var t=e.module("pipUserSettings.Data",["pipDataModel"]);t.provider("pipUserSettingsTabData",function(){this.readContactsResolver=["$stateParams","pipRest",function(e,t){return t.getOwnContacts().get({party_id:t.partyId(e),session_id:t.sessionId()}).$promise}],this.readBlocksResolver=["$stateParams","pipRest",function(e,t){return t.connectionBlocks().query({party_id:t.partyId(e)}).$promise}],this.readSessionsResolver=["$stateParams","pipRest",function(e,t){return t.userSessions().query({party_id:t.partyId(e)}).$promise}],this.readActivitiesResolver=["$stateParams","pipRest",function(e,t){return t.partyActivities().tab({party_id:t.partyId(e),paging:1,skip:0,take:25}).$promise}],this.readSettingsResolver=["$stateParams","pipRest",function(e,t){return t.partySettings().get({party_id:t.partyId(e)}).$promise}],this.readSessionIdResolver=["$stateParams","pipRest",function(e,t){return t.sessionId()}],this.$get=["pipRest","$stateParams",function(e,t){return{partyId:e.partyId,updateParty:function(t,n,a,i){var s=t.begin("UPDATING");s&&e.parties().update(n,function(e){t.aborted(s)||(t.end(),a&&a(e))},function(e){t.end(e),i&&i(e)})},saveContacts:function(t,n,a,i){var s=t.begin("SAVING");s&&e.contacts().save(n,function(e){t.aborted(s)||(t.end(),a&&a(e))},function(e){t.end(e),i&&i(e)})},updateContact:function(t,n,a,i){var s=t.begin("UPDATING");s&&e.contacts().update(n,function(e){t.aborted(s)||(t.end(),a&&a(e))},function(e){t.end(e),i&&i(e)})},updateUser:function(t,n,a,i){var s=t.begin("UPDATING");s&&e.users().update(n,function(e){t.aborted(s)||(t.end(),a&&a(e))},function(e){t.end(e),i&&i(e)})},removeBlock:function(t,n,a,i){var s=t.begin("REMOVING");s&&e.connectionBlocks().remove(n,function(e){t.aborted(s)||(t.end(),a&&a(e))},function(e){t.end(e),i&&i(e)})},removeSession:function(n,a,i,s){var r=n.begin("REMOVING");r&&e.userSessions().remove({id:a.id,party_id:e.partyId(t)},function(e){n.aborted(r)||(n.end(),i&&i(e))},function(e){n.end(e),s&&s(e)})},requestEmailVerification:function(n){var a=n.begin("RequestEmailVerification");a&&e.requestEmailVerification().get({party_id:e.partyId(t)},function(){n.aborted(a)||n.end()},function(e){n.end(e)})},verifyEmail:function(t,n,a,i){var s=t.begin("Verifying");s&&e.verifyEmail().call(n,function(e){t.aborted(s)||(t.end(),a&&a(e))},function(e){t.end(e),i&&i(e)})},saveSettings:function(t,n,a,i){var s=t.begin("SAVING");s&&e.partySettings().save(n,function(e){t.aborted(s)||(t.end(),a&&a(e))},function(e){t.end(e),i&&i(e)})},getPreviousActivities:function(n,a,i,s){var r=n.begin("SAVING");r&&e.partyActivities().tab({party_id:e.partyId(t),paging:1,skip:a,take:25},function(e){n.aborted(r)||(n.end(),i&&i(e))},function(e){n.end(e),s&&s(e)})},getRefPreviousEventsActivities:function(n,a,i,s,r,o){var l=n.begin("SAVING");l&&e.partyActivities().tab({party_id:e.partyId(t),paging:1,skip:a,ref_type:i,ref_id:s.id,take:25},function(e){n.aborted(l)||(n.end(),r&&r(e))},function(e){n.end(e),o&&o(e)})}}}]})}(window.angular),function(e,t,n){"use strict";var a=e.module("pipUserSettings.Sessions",["pipSettings.Service","pipSettings.Page"]);a.config(["pipSettingsProvider","pipUserSettingsTabDataProvider",function(e,t){e.addTab({state:"sessions",index:3,title:"SETTINGS_ACTIVE_SESSIONS_TITLE",stateConfig:{url:"/sessions",controller:"pipUserSettingsSessionsController",templateUrl:"user_settings/user_settings_sessions.html",auth:!0,resolve:{sessions:t.readSessionsResolver,sessionId:t.readSessionIdResolver}}})}]),a.controller("pipUserSettingsSessionsController",["$scope","pipTransaction","pipUserSettingsTabData","sessions","sessionId",function(e,a,i,s,r){function o(){n.each(e.sessions,function(t){t.id!==e.sessionId&&e.onRemove(t)})}function l(n){n.id!==e.sessionId&&i.removeSession(e.transaction,n,function(){e.sessions=t.without(e.sessions,n)},function(t){e.message="ERROR_"+t.status||t.data.status_code})}e.sessionId=r,e.transaction=a("settings.sessions",e),e.sessions=s,e.onRemoveAll=o,e.onRemove=l}])}(window.angular,window._,window.async),function(e){"use strict";var t=e.module("pipUserSettings.Strings",["pipTranslate"]);t.config(["pipTranslateProvider",function(e){e.translations("en",{SETTINGS_TITLE:"Settings",SETTINGS_BASIC_INFO_TITLE:"Basic info",SETTINGS_ACTIVE_SESSIONS_TITLE:"Active sessions",SETTINGS_BASIC_INFO_FULL_NAME:"Full name",SETTINGS_BASIC_INFO_VERIFY_HINT:"Please, verify your email address.",SETTINGS_BASIC_INFO_VERIFY_CODE:"Verify email address",SETTINGS_BASIC_INFO_DATE_CHANGE_PASSWORD:"Your password was changed on ",SETTINGS_BASIC_INFO_CHANGE_PASSWORD:"Change your password",SETTINGS_BASIC_INFO_NAME_HINT:"Please, use your real name to let other people know who you are.",SETTINGS_BASIC_INFO_WORDS_ABOUT_ME:"Few words about yourself",SETTINGS_BASIC_INFO_GENDER:"Gender",SETTINGS_BASIC_INFO_BIRTHDAY:"Birthday",SETTINGS_BASIC_INFO_LOCATION:"Current location",SETTINGS_BASIC_INFO_PRIMARY_EMAIL:"Primary email",SETTINGS_BASIC_INFO_FROM:"User since ",SETTINGS_BASIC_INFO_USER_ID:"User ID",SETTINGS_CHANGE_PASSWORD_TITLE:"Change password",SETTINGS_CHANGE_PASSWORD_NEW_PASSWORD:"New password",SETTINGS_CHANGE_PASSWORD_REPEAT_RASSWORD:"Repeat password",SETTINGS_CHANGE_PASSWORD_CURRENT_PASSWORD:"Current password",SETTINGS_ACTIVE_SESSIONS_SUBTITLE:' If you notice any unfamiliar devices or locations, click"Close Session" to end the session.',SETTINGS_ACTIVE_SESSIONS_CLOSE_SESSION:"Close session",SETTINGS_ACTIVE_SESSIONS_CLOSE_ACTIVE_SESSIONS:"Close active sessions",SETTINGS_ACTIVE_SESSION_OS:"OS: ",SETTINGS_ACTIVE_SESSION_IP:"IP: ",SETTINGS_ACTIVE_SESSION_ACTIVE:"active",SETTINGS_BLACKLIST_TITLE:"Blacklist",SETTINGS_BLACKLIST_SUBTITLE:"Parties from blacklist will not be able to send you invitations and private messages.",SETTINGS_BLACKLIST_UNBLOCK:"Unblock",SETTINGS_BLACKLIST_EMPTY:"You have no blocked parties",SETTINGS_CONTACT_INFO_TITLE:"Contact info",SETTINGS_CONTACT_INFO_EMAIL:"Email",SETTINGS_CONTACT_INFO_ADD_EMAIL:"Add email",SETTINGS_CONTACT_INFO_ADD_PHONE:"Add phone",SETTINGS_CONTACT_INFO_ADD_ADDRESS:"Add address",SETTINGS_CONTACT_INFO_ADD_ACCOUNT:"Add account",SETTINGS_CONTACT_INFO_ADD_URL:"Add URL",SETTINGS_CONTACT_INFO_ADDRESS:"Address",SETTINGS_CONTACT_INFO_PHONE:"Phone",SETTINGS_CONTACT_INFO_ACCOUNT_NAME:"Account name",SETTINGS_CONTACT_INFO_URL:"URL",THEME:"Theme",HINT_PASSWORD:"Minimum 6 characters",HINT_REPEAT_PASSWORD:"Repeat password",ERROR_WRONG_PASSWORD:"Wrong password",ERROR_IDENTICAL_PASSWORDS:"Old and new passwords are identical",REPEAT_PASSWORD_INVALID:"Password does not match",ERROR_EMAIL_INVALID:"Please, enter a valid email"}),e.translations("ru",{SETTINGS_TITLE:"Настройки",SETTINGS_BASIC_INFO_TITLE:"Основные данные",SETTINGS_ACTIVE_SESSIONS_TITLE:"Активные сессии",SETTINGS_BASIC_INFO_FULL_NAME:"Полное имя",SETTINGS_BASIC_INFO_NAME_HINT:"Пожалуйста, используйте реальное имя, чтоб люди могли вас узнать",SETTINGS_BASIC_INFO_VERIFY_HINT:"Пожалуйста, подтвердите адрес своей электронной почты",SETTINGS_BASIC_INFO_VERIFY_CODE:"Подтвердите адрес эл.почты",SETTINGS_BASIC_INFO_DATE_CHANGE_PASSWORD:"Ваш пароль был изменен ",SETTINGS_BASIC_INFO_CHANGE_PASSWORD:"Поменять пароль",SETTINGS_BASIC_INFO_WORDS_ABOUT_ME:"Несколько слов о себе",SETTINGS_BASIC_INFO_GENDER:"Пол",SETTINGS_BASIC_INFO_BIRTHDAY:"Дата рождения",SETTINGS_BASIC_INFO_LOCATION:"Текущее местонахождение",SETTINGS_BASIC_INFO_PRIMARY_EMAIL:"Основной адрес эл. почты",SETTINGS_BASIC_INFO_FROM:"Начиная с",SETTINGS_BASIC_INFO_USER_ID:"Личный код",SETTINGS_CHANGE_PASSWORD_TITLE:"Изменить пароль",SETTINGS_CHANGE_PASSWORD_NEW_PASSWORD:"Новый пароль",SETTINGS_CHANGE_PASSWORD_REPEAT_RASSWORD:"Повтор",SETTINGS_CHANGE_PASSWORD_CURRENT_PASSWORD:"Текущий пароль",SETTINGS_ACTIVE_SESSIONS_SUBTITLE:'Если вы заметили какие-либо незнакомые устройства или месторасположение, нажмите кнопку "Закончить сеанс", чтобы завершить сеанс.',SETTINGS_ACTIVE_SESSIONS_CLOSE_SESSION:"Закрыть сессию",SETTINGS_ACTIVE_SESSIONS_CLOSE_ACTIVE_SESSIONS:"Закрыть активные сессии",SETTINGS_ACTIVE_SESSION_OS:"ОС: ",SETTINGS_ACTIVE_SESSION_IP:"IP: ",SETTINGS_ACTIVE_SESSION_ACTIVE:"Активно",SETTINGS_BLACKLIST_TITLE:"Блокировки",SETTINGS_BLACKLIST_SUBTITLE:"Участники из черного списка не смогут посылать вам приглашения и личные сообщения.",SETTINGS_BLACKLIST_UNBLOCK:"Разблокировать",SETTINGS_BLACKLIST_EMPTY:"У вас нет заблокированных участников",SETTINGS_CONTACT_INFO_TITLE:"Контакты",SETTINGS_CONTACT_INFO_EMAIL:"Адрес электронной почты",SETTINGS_CONTACT_INFO_ADD_EMAIL:"Добавить адрес эл. почты",SETTINGS_CONTACT_INFO_ADD_PHONE:"Добавить телефон",SETTINGS_CONTACT_INFO_ADD_ADDRESS:"Добавить адрес",SETTINGS_CONTACT_INFO_ADD_ACCOUNT:"Добавить аккаунт",SETTINGS_CONTACT_INFO_ADD_URL:"Добавить веб-сайт",SETTINGS_CONTACT_INFO_ADDRESS:"Адрес",SETTINGS_CONTACT_INFO_PHONE:"Телефон",SETTINGS_CONTACT_INFO_ACCOUNT_NAME:"Учетка в мессенджере",SETTINGS_CONTACT_INFO_URL:"Веб сайт",THEME:"Тема",HINT_PASSWORD:"Минимум 6 знаков",HINT_REPEAT_PASSWORD:"Повторите пароль",ERROR_WRONG_PASSWORD:"Неправильный пароль",ERROR_IDENTICAL_PASSWORDS:"Старый и новый пароли идентичны",REPEAT_PASSWORD_INVALID:"Пароль не совпадает",ERROR_EMAIL_INVALID:"Пожалуйста, введите правильный почт.адрес"})}])}(window.angular),function(e){"use strict";var t=e.module("pipUserSettings.VerifyEmail",[]);t.controller("pipUserSettingsVerifyEmailController",["$scope","$rootScope","$mdDialog","pipTransaction","pipFormErrors","pipUserSettingsTabData","email",function(e,t,n,a,i,s,r){function o(){e.transaction.abort()}function l(){n.cancel()}function d(){s.requestEmailVerification(e.transaction)}function p(){e.form.$setSubmitted(),e.form.$invalid||s.verifyEmail(e.transaction,e.data,function(){n.hide(!0)},function(t){i.setFormError(e.form,t,{1106:"email",1103:"code"})})}e.emailVerified=!1,e.data={email:r,code:""},e.transaction=a("settings.verify_email",e),e.onAbort=o,e.onRequestVerificationClick=d,e.errorsWithHint=i.errorsWithHint,e.onVerify=p,e.onCancel=l}])}(window.angular);