var __decorate=(this&&this.__decorate)||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r;};define(["require","exports","dojo/Evented","dijit/_Widget","@core/model","@core/declareDecorator","@core/utils"],function(require,exports,Evented,_Widget,CoreModel,declareDecorator_1,utils_1){Object.defineProperty(exports,"__esModule",{value:true});var Routes;(function(Routes){Routes["v1_log_out"]="log-out";Routes["v1_check_session"]="check-session";Routes["v1_auth_token"]="get/authToken";Routes["v1_schemas"]="schemas";Routes["v1_init_forgot_password"]="sendForgotPassEmail";Routes["v2_init_recover_account"]="recover-account-init";Routes["v1_init_invitation"]="sendInvitationEmail";Routes["v1_verify_password_tokens"]="verify-password-tokens";Routes["v1_verify_recover_account_tokens"]="verify-recover-account-tokens";Routes["v1_reset_password"]="doResetPass";Routes["v1_create_password_tokens"]="create-password-tokens";Routes["v1_create_password"]="create-password";Routes["v1_create_user"]="createUser";Routes["v2_employee_offers__token__"]="employee-offers/{token}";Routes["v2_accept_employee_offer"]="accept-employee-offer";Routes["v2_document_smart_fields"]="document-smart-fields";Routes["v2_signatories__token__"]="signatories/{token}";Routes["futa_pay_selection__token__"]="futa-pay-selection/{token}";Routes["futa_pay_selection"]="futa-pay-selection";Routes["verify_action__token__"]="verify-action/{token}";})(Routes=exports.Routes||(exports.Routes={}));var LoginApi=(function(){function LoginApi(){} LoginApi.prototype.postCreate=function(){this.inherited(arguments);return this;};LoginApi.prototype.logOut=function(args,sync,callback,errorCallBack){this.__doGET(utils_1.mixinRouteParameters(Routes.v1_log_out),args,sync,callback,errorCallBack||this.xhrError);};LoginApi.prototype.checkSession=function(args,sync,callback,errorCallBack){this.__doGET(utils_1.mixinRouteParameters(Routes.v1_check_session),args,sync,callback,errorCallBack||this.xhrError);};LoginApi.prototype.user_getAuthToken=function(args,sync,callback,errorCallBack){this.__doPOST(utils_1.mixinRouteParameters(Routes.v1_auth_token),args,sync,callback,errorCallBack||this.xhrError);};LoginApi.prototype.getSchemas=function(args,sync,callback,errorCallBack){this.__doGET(utils_1.mixinRouteParameters(Routes.v1_schemas),args,sync,callback,errorCallBack||this.xhrError);};;LoginApi.prototype.send_forgotPassEmail=function(args,sync,callback,errorCallBack){this.__doPOST(utils_1.mixinRouteParameters(Routes.v1_init_forgot_password),args,sync,callback,errorCallBack||this.xhrError);};;LoginApi.prototype.recoverAccountInit=function(args,sync,callback,errorCallBack){this.__doPOST(utils_1.mixinRouteParameters(Routes.v2_init_recover_account),args,sync,callback,errorCallBack||this.xhrError);};;LoginApi.prototype.send_invitationEmail=function(args,sync,callback,errorCallBack){this.__doPOST(utils_1.mixinRouteParameters(Routes.v1_init_invitation),args,sync,callback,errorCallBack||this.xhrError);};;LoginApi.prototype.checkResetPasswordTokens=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.v1_verify_password_tokens),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.checkRecoverAccountTokens=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.v1_verify_recover_account_tokens),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.doResetPass=function(args,sync,callback,errorCallBack){this.__doPOST(utils_1.mixinRouteParameters(Routes.v1_reset_password),args,sync,callback,errorCallBack||this.xhrError);};LoginApi.prototype.checkCreatePasswordTokens=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.v1_create_password_tokens),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.createPassword=function(args,sync,callback,errorCallback){this.__doPOST(utils_1.mixinRouteParameters(Routes.v1_create_password),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.newAccountInfoInit=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.v1_create_user),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.listEmployeeOffer=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.v2_employee_offers__token__,{token:args.token}),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.acceptEmployeeOffer=function(args,sync,callback,errorCallback){this.__doPOST(utils_1.mixinRouteParameters(Routes.v2_accept_employee_offer),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.listSmartFields=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.v2_document_smart_fields),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.listSignatories=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.v2_signatories__token__,{token:args.token}),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.html2pdf=function(args,sync,callback,errorCallback){this.__doPOST('html2pdf',args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.signOfferLetter=function(args,sync,callback,errorCallback){this.__doPOST('offer-letter/sign',args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.sendEnableMfaCode=function(args,sync,callback,errorCallback){this.__doPOST('send-enable-mfa-code',args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.initPhoneVerification=function(args,sync,callback,errorCallback){this.__doPOST('init-phone-verification',args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.sendPhoneVerificationCode=function(args,sync,callback,errorCallback){this.__doPOST('send-phone-verification-code',args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.initGoogleAuthenticator=function(args,sync,callback,errorCallback){this.__doPOST('init-google-authenticator',args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.getFutaPaySelection=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.futa_pay_selection__token__,{token:args.token}),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.submitFutaPaySelection=function(args,sync,callback,errorCallback){this.__doPOST(utils_1.mixinRouteParameters(Routes.futa_pay_selection__token__,{token:args.token}),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.getVerifyAction=function(args,sync,callback,errorCallback){this.__doGET(utils_1.mixinRouteParameters(Routes.verify_action__token__,{token:args.token}),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.submitVerifyAction=function(args,sync,callback,errorCallback){this.__doPOST(utils_1.mixinRouteParameters(Routes.verify_action__token__,{token:args.token}),args,sync,callback,errorCallback||this.xhrError);};LoginApi.prototype.xhrError=function(error){console.error(error);var text="";if(typeof error==="string"){text=error;} else{text=error.data.error_message;} alert(text);};LoginApi=__decorate([declareDecorator_1.default(_Widget,Evented,CoreModel)],LoginApi);return LoginApi;}());exports.default=LoginApi;});