(function(){var n,t;angular.module("lodash",[]).factory("_",["$window",function(t){return n=n||t._,delete t._,n}]);t=angular.module("etm",["ui.bootstrap","ngSanitize","textAngular","lodash"]);t.config(["$httpProvider",function(n){n.defaults.headers.common["X-Requested-With"]="XMLHttpRequest"}])})(),function(n){"use strict";n.config(["$provide",function(n){n.decorator("taOptions",["taRegisterTool","$delegate","$window","$log","$timeout",function(n,t,i){return n("subscript",{iconclass:"fa fa-subscript",action:function(){this.$editor().wrapSelection("subscript")}}),n("superscript",{iconclass:"fa fa-superscript",action:function(){this.$editor().wrapSelection("superscript")}}),n("markFB",{buttontext:"[Mark selected word]","class":"btn btn-primary",action:function(){var t=this.$editor(),n=i.getSelection(),r=n.anchorOffset<n.focusOffset?n.anchorOffset:n.focusOffset,u=n.anchorOffset>n.focusOffset?n.anchorOffset:n.focusOffset,f=n.anchorNode.textContent;t.wrapSelection("insertHTML","["+n+"]",!0)}}),t.toolbar=[["bold","italics","underline","subscript","superscript"],["justifyLeft","justifyCenter","justifyRight","justifyFull"],["clear"]],t.classes={focussed:"focussed",toolbar:"btn-toolbar",toolbarGroup:"btn-group btn-group-sm",toolbarButton:"btn btn-default",toolbarButtonActive:"active",disabled:"disabled",textEditor:"form-control",htmlEditor:"form-control"},t}])}]);n.config(["$provide",function(n){n.decorator("taOptions",["taRegisterTool","$delegate",function(n,t){return t}])}])}(angular.module("etm")),function(n){n.filter("boolLabel",function(){return function(n,t,i,r){return n===!0?t||"Yes":n===!1?i||"No":r||""}})}(angular.module("etm")),function(n){"use strict";function t(n,t,i){return{restrict:"A",link:function(n,r){function u(){var n=$(i).outerHeight(!0),t=$(r).offset().top,u=n-t;$(r).height(u-18)}$(window).resize(u);t(u,25)}}}n.directive("etmDivFillWindowHeight",["$log","$timeout","$window",t])}(angular.module("etm")),function(n){function t(n,t){function i(t){var i=t?t.data?t.data:t.statusText?t.statusText:"Error "+t.status:"Application Error (Uknown)";return i=i+"",i.length>201&&(i=i.substring(0,200)),n.error(i,t),i}function r(i){i&&i.status==401&&(n.warn("Unauthorized, redirecting to login page.",i),t.location.href="/LogIn")}return{getMessage:i,handleUnauthorized:r}}n.factory("errorHelper",["$log","$window",t])}(angular.module("etm")),function(n){function t(n){return{restrict:"A",link:function(t,i,r){t.$watch(r.focus,function(n){n&&i[0].focus()});i.bind("blur",function(){n(function(){t.$apply(r.focus+"=false")},0)});i.bind("focus",function(){n(function(){t.$apply(r.focus+"=true")},0)})}}}n.directive("focus",["$timeout",t])}(angular.module("etm")),function(n){"use strict";function t(n,t){return{restrict:"A",link:function(n,i,r){function h(){u=$(window).outerHeight(!0);u-=parseInt(f.css("margin-top"),10);u-=parseInt(f.css("margin-top"),10);u-=15;u-=c.outerHeight(!0);u-=o?o.outerHeight(!0)+15:0;u-=l.outerHeight(!0);e.css("max-height",u);e.css("min-height",100);e.css("overflow","auto");e.find(".row").css("margin-right","0px")}var s=$(i),f=s.closest(".modal-dialog"),c=f.find(".modal-header"),l=f.find(".modal-footer"),a=r.isTabModal&&r.isTabModal.toLowerCase()==="true",u=500,o=null,e=s;$(window).resize(h);t(function(){a===!0&&(o=f.find(".nav-tabs"),e=f.find(".tab-pane"));h()},25)}}}n.directive("etmModalMaxHeight",["$log","$timeout",t])}(angular.module("etm")),function(n){function t(){function n(n,t,i){for(i=i||" ";n.toString().length<t;)n=i+n;return n}return{padLeft:n}}n.factory("StringHelper",["$log",t])}(angular.module("etm")),function(n){"use strict";function t(n,t,i){function u(){if(r.errorMsg=null,!r.username){r.errorMsg="You must enter your username to reset your password.";return}r.isResettingPassword=!0;t.post("/LogIn/ResetPassword",{username:r.username}).then(function(t){n.log(t.data);t.data.status==="success"?r.isPasswordReset=!0:r.errorMsg=t.data.message}).catch(function(n){r.errorMsg=i.getMessage(n)}).finally(function(){r.isResettingPassword=!1})}function f(){if(r.errorMsg=null,!r.email){r.errorMsg="You must enter your email to request your username.";return}r.isRequestingUsername=!0;t.post("/LogIn/RequestUsername",{email:r.email}).then(function(t){n.log(t.data);t.data.status==="success"?r.isUsernameRequested=!0:r.errorMsg=t.data.message}).catch(function(n){r.errorMsg=i.getMessage(n)}).finally(function(){r.isRequestingUsername=!1})}var r=this;r.errorMsg=null;r.username=null;r.isResettingPassword=!1;r.resetPassword=u;r.isPasswordReset=!1;r.email=null;r.isRequestingUsername=!1;r.requestUsername=f;r.isUsernameRequested=!1}n.controller("LoginForgetController",["$log","$http","errorHelper",t])}(angular.module("etm")),function(n){"use strict";function t(){function t(){n.isLoggingIn=!0}var n=this;n.isLoggingIn=!1;n.formSubmit=t}n.controller("LoginIndexController",["$log","$http","$uibModal",t])}(angular.module("etm")),function(n){"use strict";function t(n,t,i,r,u,f,e){function h(){o.isWorking=!0;t.post("/SignUp/SignUp",o.form).then(function(t){n.log(t.data);t.data.status==="success"?i.location="/SignUp/Complete/"+t.data.planName:o.errorMsg=t.data.message}).catch(function(n){e.handleUnauthorized(n);o.errorMsg=e.getMessage(n)}).finally(function(){o.isWorking=!1})}var o=this,s=f.find(r,{name:"United States"});o.isWorking=!1;o.countries=r;o.plans=u;o.signUp=h;o.form={firstName:"",lastName:"",email:"",organization:"",postalCode:"",countryId:s?s.countryId:null,username:"",password:"",passwordConfirm:"",planId:o.plans[0].planId}}n.controller("SignUpIndexController",["$log","$http","$window","countries","plans","_","errorHelper",t])}(angular.module("etm")),function(n){"use strict";function t(n,t){function r(){var n=$("#paymentDataReceivedButton");i.acceptUiResponse=n.data("acceptUiResponse")}function u(){if(i.errorMessages=[],i.acceptUiResponse===null){i.errorMessages.push("Credit card information is required.");return}if(i.acceptUiResponse.messages.resultCode==="Error"){for(var n=0;n<i.acceptUiResponse.messages.message.length;)i.errorMessages.push(i.acceptUiResponse.messages.message[n].text),n=n+1;return}i.isProcessing=!0;i.acceptUiResponse.billTo=i.billTo;t.post("/Payment/ProcessPayment",i.acceptUiResponse).then(function(n){var t=n.data;t.isApproved?i.isApproved=!0:(i.isApproved=!1,i.errorMessages=t.messages,t.cardInfoWasUsed===!0&&(i.acceptUiResponse=null))},function(n){i.errorMessages.push(n.statusText||"An error occured, your payment was not processed.")}).finally(function(){i.isProcessing=!1})}var i=this;i.processPayment=u;i.readPaymentData=r;i.isProcessing=!1;i.isApproved=!1;i.errorMessages=[];i.acceptUiResponse=null;i.billTo={address:"",city:"",state:"",zip:"",country:""}}n.controller("PayController",["$timeout","$http",t])}(angular.module("etm"))