angular.module("Wizdom365.ProfileProgress",[]);
!function(){function e(e){return{scope:{},template:'<div class="wizdom-profileProgress bootstrap-wrapper" ng-class="responsiveClass">\n                            <div class="webpart-edit-button-container" ng-if="editMode">\n                                <button class="editWebpartButton btn" ng-click="editWebpart()" type="button" title=\'{{"Edit Webpart" | translate}}\'>\n                                    <span class="ms-Icon ms-Icon--Edit"></span><span class="editWebpartButtonText">{{"Edit" | translate}}</span>\n                                </button>\n                            </div>\n                            <div ng-show="dataReady">\n                                <div wizdom-include=\'webpartProperties.templateUrl\'></div>\n                            </div>\n                            <div ng-hide="dataReady">\n                            </div>\n                        </div>',controller:t}}function t(e,t,r,a,o,s,i,p,n,d,l){function c(){e.webpartId=l.getWebpartId(t),e.editMode=l.isInEditMode(t),l.hideEditCode(t),l.toggleWebpart(t,!1),e.$watch("hideWebpart",function(e,r){void 0!=e&&l.toggleWebpart(t,!e)},!0);var a=r.webpartProperties?JSON.parse(r.webpartProperties):null;e.webpartProperties={props:a&&a.props||[],templateUrl:a&&a.templateUrl||"ProfileProgress/Templates/ViewTemplates/default.html"}}function u(){var r=$("#SuiteNavUserName").html(),i=d.getItem("profileProgress:"+e.webpartId);e.data={procent:0,user:{accountName:a.userLoginName,name:r}},r&&null!=i&&(e.data.procent=i,e.dataReady=!0),e.data.procent<100&&(e.hideWebpart=!1),$.isArray(e.webpartProperties.props)||(e.webpartProperties.props=[]),o.progress.getProfileProgress(e.webpartId,e.webpartProperties.props).then(function(r){e.data.editLink=r.editLink,e.data.user.accountName||(e.data.user.accountName=r.user.accountName),e.data.user.name||(e.data.user.name=r.user.name),e.data.user.email||(e.data.user.email=r.user.email),e.data.user.publicUrl||(e.data.user.publicUrl=r.user.publicUrl),e.data.user.pictureURL||(e.data.user.pictureURL=r.user.pictureURL);var a=r.procent;d.setItem("profileProgress:"+e.webpartId,a),s(function(){e.data.procent=a},300),r.procent<100&&(e.hideWebpart=!1),e.dataReady=!0,n.onResponsizeChange(t,function(t){e.responsiveClass=t,e.$applyAsync()})})}c(),e.dataReady=!1,e.editWebpart=function(){p.open({templateUrl:"ProfileProgress/Templates/Dialogs/editWebpart.html",controller:"Wizdom365ProfileProgressEditWebpartController",windowClass:"bootstrap-wrapper",resolve:{webpartId:function(){return e.webpartId}}}).result.then(function(t){t&&(e.webpartProperties=t,u())},function(e){})},e.data={user:{}},e.clearCache=function(){$.isArray(e.webpartProperties.props)||(e.webpartProperties.props=[]),o.progress.clearCache(e.webpartId,e.webpartProperties.props)},u()}angular.module("Wizdom365.ProfileProgress").directive("wizdom365ProfileProgress",e),e.$inject=["webpartPropertiesService"],t.$inject=["$scope","$element","$attrs","contextInfo","profileProgressApi","$timeout","$filter","$modal","responsive","localStorageService","webpartPropertiesService"]}();
!function(){function r(r){var e={progress:{baseUrl:"api/wizdom/profileProgress/progress",getProfileProgress:function(e,o){return r.getAppCached(this.baseUrl+"/"+e+"?props="+o)},clearCache:function(e,o){return r.put(this.baseUrl+"/"+e+"/ClearCache?props="+o)}},properties:{baseUrl:"api/wizdom/profileProgress/properties",getProfileProperties:function(){return r.get(this.baseUrl)}}};return e}angular.module("Wizdom365.ProfileProgress").factory("profileProgressApi",r),r.$inject=["webapiService"]}();
angular.module("Wizdom365").requires.push("Wizdom365.ProfileProgress");
angular.module("Wizdom365").run(["$templateCache", function($templateCache) {if($templateCache.get('ProfileProgress/Templates/ViewTemplates/default.html') == null) $templateCache.put('ProfileProgress/Templates/ViewTemplates/default.html','<div ng-show=\"dataReady\" class=\"wizdom-profileProgress-main\">\r\n    <div class=\"wizdom-profileProgress-row\">\r\n        <div class=\"wizdom-profileProgress-imgColumn\">\r\n            <!--<div wizdom365-presence-picture size=\"AVATAR\" accountname=\"data.user.accountName\" name=\"data.user.name\"></div>-->\r\n            <div wizdom365-presence-picture\r\n                 size=\"AVATAR\"\r\n                 email=\"data.user.email\"\r\n                 accountname=\"data.user.accountName\"\r\n                 name=\"data.user.name\"\r\n                 url=\"data.user.publicUrl\"\r\n                 image=\"data.user.pictureURL\"></div>\r\n        </div>\r\n        <div class=\"wizdom-profileProgress-textColumn\">\r\n            <div class=\"name\">{{data.user.name}}</div>\r\n            <section>\r\n                <div class=\"wizdom-profileProgress-bar-container\">\r\n                    <div class=\"wizdom-profileProgress-colored-bar\" ng-class=\"{zero: data.procent==0, mid:30<data.procent && data.procent<70, high:70<data.procent}\" ng-style=\"{width: data.procent == 0 ? \'100%\' : data.procent + \'%\'}\">\r\n                        {{data.procent}}%\r\n                    </div>\r\n                </div>\r\n            </section>\r\n        </div>\r\n    </div>\r\n</div>\r\n<div ng-show=\"dataReady\" class=\"container-fluid wizdom-profileProgress-editProfile wizdom-fullwidth\">\r\n    <div class=\"row\">\r\n        <a ng-click=\"clearCache()\" ng-href=\"{{data.editLink}}\" target=\"_blank\">{{\'Add information to your profile\' | translate}}</a>\r\n    </div>\r\n</div>');}]);