{"version":3,"sources":["webpack://App.[name]/./login.js"],"names":["baseInit","analytics","vf","validator","$","init","bsValidateForm","validateField","val","test","length","on","hasErrors","$form","formVal","name","find","trackUser","trackEvent","validate","onkeyup","rules","email","required","messages","showErrors","errors","fieldId","hasOwnProperty","addClass","attr","tooltip","placement","trigger","minlength","equalTo"],"mappings":"sJAAA,EAAQ,QACR,0BAAQ,mBAAE,UAAc,UAAkB,UAAuB,YAAiD,SAAWA,EAAUC,EAAWC,EAAIC,GAClJ,aAEAC,GAAE,WACEJ,EAASK,OAETD,EAAE,cAAcE,gBAAe,SAASH,GACpCA,EAAUI,cAAc,kBAAkB,SAASC,GAC/C,MAAY,KAARA,EACO,WAED,iBAAiBC,KAAKD,GAGzB,GAFI,aAIfL,EAAUI,cAAc,qBAAqB,SAASC,GAClD,MAAY,KAARA,EACO,WAEFA,EAAIE,OAAS,EACX,UAEJ,SAGfN,EAAE,cAAcO,GAAG,yBAAyB,SAASC,EAAWC,GAC5D,GAAID,EACA,OAAO,EAGP,IAAIE,EAAU,SAASC,GACnB,OAAOF,EAAMG,KAAK,UAAYD,EAAO,MAAMP,OAO/C,OALAP,EAAUgB,UAAUH,EAAQ,UAC5Bb,EAAUiB,WAAW,QAAS,CAC1B,aAAgBJ,EAAQ,SACxB,OAAUA,EAAQ,YAEf,KAGfV,EAAE,eAAee,SAAS,CACtBC,SAAS,EACTC,MAAO,CACH,MAAS,CAACC,OAAO,EAAMC,UAAS,IAEpCC,SAAU,GACVC,WAAY,SAASC,GACjB,IAAI,IAAIC,KAAWD,EACXA,EAAOE,eAAeD,KACtBvB,EAAE,IAAKuB,EAAS,kBAAkBE,SAAS,aAC3CzB,EAAE,IAAKuB,EAAS,wBAAwBG,KAAK,aAAcJ,EAAOC,IAClEvB,EAAE,IAAKuB,EAAS,wBAAwBI,QAAQ,CAC5CC,UAAW,QACXC,QAAS,WACVF,QAAQ,YAM3B3B,EAAE,4BAA4Be,SAAS,CACnCC,SAAS,EACTC,MAAO,CACH,YAAe,CAACa,UAAW,EAAGX,UAAS,GACvC,aAAgB,CAACY,QAAS,eAAgBZ,UAAS,IAEvDC,SAAU,CACN,YAAe,CAACU,UAAW,2CAC3B,aAAgB,CAACC,QAAS,2BAE9BV,WAAY,SAASC,GACjB,IAAI,IAAIC,KAAWD,EACXA,EAAOE,eAAeD,KACtBvB,EAAE,IAAKuB,EAAS,kBAAkBE,SAAS,aAC3CzB,EAAE,IAAKuB,EAAS,wBAAwBG,KAAK,aAAcJ,EAAOC,IAClEvB,EAAE,IAAKuB,EAAS,wBAAwBI,QAAQ,CAC5CC,UAAW,QACXC,QAAS,WACVF,QAAQ,iBAOlC,sD","file":"28.chunk.js?v=af74d8df669162a3b395","sourcesContent":["require('./content.less');\nrequire([ './baseInit', './js/analytics', './js/bsValidateForm', './vendor/jquery-validation/jquery.validate.min'], function(baseInit, analytics, vf, validator) {\n    'use strict';\n\n    $(function() {\n        baseInit.init();\n\n        $('#loginform').bsValidateForm(function(validator) {\n            validator.validateField('[name=\"email\"]', function(val) {\n                if (val === '') {\n                    return 'required';\n                }\n                else if (!/^.*?@.*?\\..+?$/.test(val)) {\n                    return 'invalid';\n                }\n                return '';\n            });\n            validator.validateField('[name=\"password\"]', function(val) {\n                if (val === '') {\n                    return 'required';\n                }\n                else if (val.length < 7) {\n                    return 'invalid';\n                }\n                return '';\n            });\n        });\n        $('#loginform').on('bsValidateFormHandler', function(hasErrors, $form) {\n            if (hasErrors) {\n                return false;\n            }\n            else {\n                var formVal = function(name){\n                    return $form.find('[name=\"' + name + '\"]').val();\n                };\n                analytics.trackUser(formVal('email'));\n                analytics.trackEvent('login', {\n                    '$distinct_id': formVal('email'),\n                    '$email': formVal('email')\n                });\n                return true;\n            }\n        });\n        $('#forgotform').validate({\n            onkeyup: false,\n            rules: {\n                'email': {email: true, required:true}\n            },\n            messages: {},\n            showErrors: function(errors) {\n                for(var fieldId in errors){\n                    if (errors.hasOwnProperty(fieldId)) {\n                        $('#'+ fieldId +'_control_group').addClass('has-error');\n                        $('#'+ fieldId +'_control_group label').attr('data-title', errors[fieldId]);\n                        $('#'+ fieldId +'_control_group label').tooltip({\n                            placement: \"right\",\n                            trigger: \"submit\"\n                        }).tooltip('show');\n                    }\n                }\n            }\n        });\n\n        $('#updatePasswordResetForm').validate({\n            onkeyup: false,\n            rules: {\n                'newpassword': {minlength: 7, required:true},\n                'newpassword2': {equalTo: '#newpassword', required:true}\n            },\n            messages: {\n                'newpassword': {minlength: 'Password must be at least 7 characters.'},\n                'newpassword2': {equalTo: 'Passwords don\\'t match.'}\n            },\n            showErrors: function(errors) {\n                for(var fieldId in errors){\n                    if (errors.hasOwnProperty(fieldId)) {\n                        $('#'+ fieldId +'_control_group').addClass('has-error');\n                        $('#'+ fieldId +'_control_group label').attr('data-title', errors[fieldId]);\n                        $('#'+ fieldId +'_control_group label').tooltip({\n                            placement: \"right\",\n                            trigger: \"submit\"\n                        }).tooltip('show');\n                    }\n                }\n            }\n        });\n\n    });\n});\n"],"sourceRoot":""}