{"version":3,"sources":["registrationForm_A.js","registrationSsoForm_A.js","registrationB2BForm_A.js","resetPasswordForm_A.js"],"names":["Vendd","Scripts","load","$submitButton","form","formData","$form","$","$loyaltyErrorWrapper","length","getQueryStringValueByName","hide","show","User","ClearClientModel","window","location","loyaltyMemberCardNumberIsValid","loyaltyMemberCardNumberIsEnabled","data","verifyemail","toString","toLowerCase","get","importEmailForRegistration","title","text","firstName","val","lastName","email","trim","username","password","passwordConfirmation","newsletter","reCaptchaCode","redirectUrl","phone","mobilephone","socialSecurityNumber","birthdate","registerToLoyalty","isLoyaltyMember","loyaltyRequest","loyaltyMemberId","ReceiveEinvoice","alreadyRegisteredToLoyalty","loyaltyMemberCardNumber","postalCode","registrationSetData","captchaWidgetId","useEmailAsLoginName","areas","$captchaElement","find","$captchaContainer","captchaEnabled","initRecaptcha","sitekey","grecaptcha","render","callback","recaptchaCallback","on","e","preventDefault","this","hasClass","removeClass","siblings","prop","addClass","validateRecaptcha","res","resetRecaptcha","reset","removeRecaptcha","remove","getAreasForPostCode","envelope","message","valOpts","isGreekPostalCode","config","rf","validateField","setRegistrationData","$sets","each","set","$set","setData","Name","Id","Values","input","is","setValues","push","loading","onSuccess","response","success","code","LhApp","Context","IsConsentsEnabled","checkConsents","LoyaltyRegistrationUrl","MessageBus","publishAsync","Loyalty","Messages","CheckByMobile","animate","scrollTop","fbPixelTracker","fbPixelCanTrack","Properties","FacebookPixelId","fbq","offset","top","updatePasswordBar","onFailure","submit","einvoiceVal","Register","field","value","score","Helpers","textStrength","i","css","match","join","datepicker","changeMonth","changeYear","yearRange","maxDate","setIsRegistered","isRegistered","sessionStorage","setItem","fn","validationEngine","validations","passwordStrength","Validations","el","inputName","attr","required","consentType","checkboxRequired","_","extend","isEmail","venddProjectConfigs","phoneLocalizationEnabled","isValidPhoneLocalized","validator","type","Registration","GreekPhoneValidation","isGreekPhone","isPhoneNumber","GreekMobileValidation","isGreekMobile","limit","matchField","isSocialSecurityNumber","prevLoyaltyMemberCardNumber","$formRow","closest","replace","GetMemberByLoyaltyNumber","loyaltyCheckboxes","removeAttr","off","$this","fieldName","validate","$text","fancybox","open","maxWidth","padding","modal","afterShow","consentForm","scrollContForm","closeButton","acceptButton","mCustomScrollbar","scrollbarPosition","scrollInertia","timeout","theme","mouseWheel","callbacks","onTotalScrollOffset","onTotalScroll","onInit","onCreate","setTimeout","click","height","close","afterClose","trigger","stopPropagation","val1","val2","first","checkboxes","chkbx","source","approved","ConsentsManager","insertConsents","setField","keyCode","debounce","GetAreasForPostCode","not","isLoyaltyRegistered","$chkbx","chkbxId","undefined","removeField","addField","JSON","parse","addEventListener","subscribe","RegisterSuccess","RegisterFailure","Plugins","RecaptcaLoaded","CheckByMobileSuccess","StatusCode","loyaltyErrorWrapper","html","ResponseMessage","origin","CheckByMobileFailure","toastr","error","LoginSuccess","returnUrl","decodeURIComponent","Function","QueryString","getValueOf","href","document","GetMemberByLoyaltyNumberSuccess","model","ErrorCode","GetMemberByLoyaltyNumberFailed","GetAreasForPostCodeSuccess","Widget","BindControl","mobilePhone","CompleteSsoRegistration","Consents","InsertConsents","companyName","occupation","taxAgency","taxIdentifier","officerName","vatstatus","emailConfirmation","town","address","number","storesNumber","phoneTwo","mobile","fax","siteUrl","acceptTerms","store","CompanyCategory","OpeningHours","area","prefecture","officerLastName","officerPosition","countryCode","Country","areaAutoCompleteEnabled","invoiceAutoComplete","areaLabel","cyprusAreasEnabled","CyprusAreasAutoCompletedEnabled","Handlebars","empty","append","City","isCypriotPostalCode","updatePostalCode","valOptPostalCode","hideLoader","B2BRegister","resetAddressFields","TaxIdentifierValidationEnabled","isGreekTaxIdentifier","focus","Service","call","url","request","country","vat","isValid","name","vatInfoService","openEffect","closeEffect","helpers","overlay","locked","closeClick","B2BRegisterSuccess","B2BRegisterFailure","notificationType","ResetPassword","ResetPasswordSuccess","ResetPasswordFailure","onResendSuccess","onResendFailure","resend","ResendActivationCode","ResendActivationCodeSuccess","ResendActivationCodeFailure","rpf"],"mappings":"AA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,YAAAD,iBAEA/I,EAAA,qBAAAD,OAAAG,OAAA,GACAH,MAAA8I,iBAAA,CACAnH,SAAA,CACA0H,SAAA,oBACAL,iBAAA,CACAc,UAAA,gBACAhF,OAAA,CACAwF,MAAAtK,MAAAa,KAAA,oBAOAZ,EAAA,6BAAAD,OAAAG,OAAA,GACAH,MAAA8I,iBAAA,CACAlH,qBAAA,CACAyH,SAAA,4BACAnB,MAAA,CACA4B,UAAA,yBACAS,WAAA,eAMA,IAAAwK,IAAA/U,MAAAa,KAAA,oBAEAb,MAAA0D,GAAA,QAAA,oBAAA,SAAAC,GACAA,EAAAC,iBACAD,EAAAqJ,kBAEA+H,IAAA5J,YACArL,KAAA0H,WAGAxH,MAAA0D,GAAA,QAAA,oBAAA,SAAAC,GACAA,EAAAC,iBACAD,EAAAqJ,kBAEAlN,KAAA6U,WAGA3U,MAAA0D,GAAA,QAAA,cAAA,SAAAC,GAEA,GAAA,IAAAA,EAAAgK,QAMA,OALAhK,EAAAC,iBACAD,EAAAqJ,uBAEAnN,cAAA8M,QAKA,IAAA1B,MAAAhL,EAAA4D,MACAqH,UAAAD,MAAA7B,KAAA,QAEA,aAAA8B,WACApL,KAAAwH,kBAAA2D,MAAA3J,OAGAvB,SAAAmL,WAAAD,MAAA3J,MAEAyT,IAAA5J,SAAAD,aAGAlL,MAAA0D,GAAA,QAAA,sBAAA,SAAAC,GACAA,EAAAC,iBACA3D,EAAA4D,MAAAC,SAAA,SACA7D,EAAA4D,MAAAE,YAAA,SAAAC,SAAA,SAAAC,KAAA,OAAA,YAEAhE,EAAA4D,MAAAK,SAAA,SAAAF,SAAA,SAAAC,KAAA,OAAA","file":"scripts-user.js","sourcesContent":["Vendd.Scripts.load(function () {\n var $form = $('.x-registration-form'), $submitButton, form, formData, $loyaltyErrorWrapper = $('.loyalty-error-container'), loyaltyRegistrationUrl;\n\n if ($form.length < 1)\n return;\n\n var token = getQueryStringValueByName(\"vtoken\");\n if (token != '') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-content', $form).hide();\n $('.js-success', $form).show();\n $('.js-need-verification', $form).hide();\n\n Vendd.User.ClearClientModel();\n\n window.location = '/';\n }\n\n var loyaltyMemberCardNumberIsValid = true, loyaltyMemberCardNumberIsEnabled = $form.data('loyaltymembercardnumberisenabled');\n var verifyemail = $form.data('verifyemail').toString().toLowerCase() === 'true';\n\n $submitButton = $('.js-submit-button', $form);\n\n form = $form.get(0);\n\n importEmailForRegistration();\n\n formData = {\n \"title\": $(\"option:selected\", 'select[name=title]').text(),\n \"firstName\": $('input[name=\"firstName\"]').val(),\n \"lastName\": $('input[name=\"lastName\"]').val(),\n \"email\": $('input[name=\"email\"]').val().trim(),\n \"username\": ($('input[name=\"username\"]').length > 0 ? $('input[name=\"username\"]').val() : ''),\n \"password\": \"\",\n \"passwordConfirmation\": \"\",\n \"newsletter\": false,\n \"reCaptchaCode\": \"\",\n \"redirectUrl\": $form.data('redirect') || \"\",\n \"phone\": $('input[name=\"phone\"]').val(),\n \"mobilephone\": \"\", //$('input[name=\"mobilephone\"]').val()\n \"socialSecurityNumber\": $('input[name=\"socialSecurityNumber\"]').val(),\n \"birthdate\": \"\",\n \"registerToLoyalty\": false,\n \"isLoyaltyMember\": false,\n \"loyaltyRequest\": false,\n \"loyaltyMemberId\": \"\",\n \"ReceiveEinvoice\": null,\n \"alreadyRegisteredToLoyalty\": false,\n \"loyaltyMemberCardNumber\": \"\",\n \"postalCode\": \"\",\n \"registrationSetData\": registrationSetData || null\n };\n\n var useEmailAsLoginName = $form.data('useemailasloginname').toString().toLowerCase() === 'true';\n\n var areas = [];\n\n var registrationSetData = [];\n\n // reCAPTCHA\n var captchaWidgetId;\n var captchaId = \"registrationCaptcha\";\n var $captchaElement = $form.find(\"#\" + captchaId);\n var $captchaContainer = $form.find('.recaptcha-container');\n var captchaEnabled = $captchaElement.length > 0 ? true : false;\n\n form.initRecaptcha = function () {\n\n if (!captchaEnabled)\n return;\n\n var sitekey = $captchaElement.data(\"sitekey\");\n if (sitekey) {\n captchaEnabled = true;\n captchaWidgetId = grecaptcha.render(captchaId, {\n 'sitekey': sitekey,\n 'callback': form.recaptchaCallback\n });\n }\n };\n\n $form.on('click', '.js-password-reveal', function (e) {\n e.preventDefault();\n if ($(this).hasClass('shown')) {\n $(this).removeClass('shown').siblings('input').prop('type', 'password');\n } else {\n $(this).addClass('shown').siblings('input').prop('type', 'text');\n }\n });\n\n form.validateRecaptcha = function () {\n if (!captchaEnabled)\n return true;\n\n formData.reCaptchaCode = $captchaElement.find('.g-recaptcha-response').val();\n\n var res = false;\n\n if (formData.reCaptchaCode) {\n $captchaContainer.find('.recaptcha-required').removeClass('error');\n res = true;\n }\n else {\n $captchaContainer.find('.recaptcha-required').addClass('error');\n }\n\n return res;\n };\n\n form.resetRecaptcha = function () {\n // Website must only verify the user's reCAPTCHA response token (g-recaptcha-response) once. \n // If a verify attempt has been made with a particular token, it cannot be used again. \n // Call grecaptcha.reset() to ask the end user to verify with reCAPTCHA again.\n if (captchaEnabled)\n grecaptcha.reset(captchaWidgetId);\n };\n\n form.removeRecaptcha = function () {\n $captchaElement.remove();\n };\n\n form.recaptchaCallback = function () {\n form.validateRecaptcha();\n };\n\n form.getAreasForPostCode = function (envelope) {\n\n areas = envelope.message.data;\n\n //validate postal code.\n if (valOpts.postalCode && valOpts.postalCode.isGreekPostalCode) {\n valOpts.postalCode.isGreekPostalCode.config.areas = areas;\n }\n rf.validateField(\"postalCode\");\n };\n\n form.setRegistrationData = function () {\n\n var $sets = $('.js-registration-set', $form);\n\n if ($sets.length < 1) return;\n\n //init array\n registrationSetData = [];\n\n $.each($sets, function (e, set) {\n var $set = $(set);\n\n var setData = {\n Name: $set.data('set-name'),\n Id: $set.data('set-id'),\n Values: []\n }\n\n $.each($('input[type=\"checkbox\"]', $set), function (e, input) {\n if ($(input).is(':checked')) {\n var setValues = {\n Id: $(input).data('id'),\n Name: $(input).data('name')\n }\n\n setData.Values.push(setValues); \n }\n });\n\n if (setData.Values.length > 0)\n registrationSetData.push(setData);\n });\n\n if (registrationSetData.length > 0)\n formData.registrationSetData = registrationSetData;\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function (envelope) {\n form.loading(false);\n var response = envelope.message.data;\n\n if (response.success && response.code === \"Registration_OperationSuccesful\") {\n //insert consents after registration success\n if (LhApp.Context.IsConsentsEnabled) {\n form.checkConsents();\n }\n\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-content', $form).hide();\n $('.js-need-verification', $form).hide();\n $('.js-success', $form).hide();\n\n if (verifyemail) {\n $('.js-need-verification', $form).show();\n } else {\n $('.js-success', $form).show();\n }\n\n var isLoyaltyActivated = (formData.alreadyRegisteredToLoyalty || formData.registerToLoyalty);\n if (isLoyaltyActivated && formData.mobilephone) {\n loyaltyRegistrationUrl = response.data.LoyaltyRegistrationUrl;\n Vendd.MessageBus.publishAsync(Vendd.Loyalty, new Vendd.Loyalty.Messages.CheckByMobile(formData.mobilephone));\n }\n\n\n $('html,body').animate({ scrollTop: 0 }, 300);\n\n /* Track User Registration */\n if (typeof fbPixelTracker !== 'undefined' && typeof fbPixelCanTrack !== 'undefined') {\n if (fbPixelTracker && fbPixelTracker.Properties.FacebookPixelId && fbPixelCanTrack) {\n fbq('track', 'CompleteRegistration');\n }\n }\n /* END Track User Registration */\n\n } else {\n\n if (response.code === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n }\n\n form.removeRecaptcha();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n form.updatePasswordBar($('input[name=\"password\"]', $form));\n };\n\n form.onFailure = function (envelope) {\n form.loading(false);\n\n var response = envelope.message.data;\n if (response.code === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n form.updatePasswordBar($('input[name=\"password\"]', $form));\n };\n\n form.submit = function () {\n form.loading(true);\n\n formData.newsletter = $('#chkNewsletter').prop(\"checked\");\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n\n formData.isLoyaltyMember = $('#isLoyaltyMember').prop(\"checked\");\n formData.loyaltyRequest = $('#loyaltyRequest').prop(\"checked\");\n\n var einvoiceVal = $(\"input:radio[name='einvoice']:checked\").val();\n\n if (einvoiceVal === \"true\") {\n formData.ReceiveEinvoice = true;\n } else if (einvoiceVal === \"false\") {\n formData.ReceiveEinvoice = false;\n } else {\n formData.ReceiveEinvoice = null;\n }\n\n form.setRegistrationData();\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.Register(\n formData.firstName,\n formData.lastName,\n formData.email,\n formData.username,\n formData.password,\n formData.passwordConfirmation,\n formData.newsletter,\n formData.reCaptchaCode,\n formData.redirectUrl,\n formData.phone,\n formData.mobilephone,\n formData.socialSecurityNumber,\n formData.birthdate,\n formData.isLoyaltyMember,\n formData.loyaltyRequest,\n formData.ReceiveEinvoice,\n formData.loyaltyMemberId,\n formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty,\n formData.loyaltyMemberCardNumber,\n formData.postalCode,\n formData.registrationSetData ));\n };\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-success', $form).hide();\n $('.js-need-verification', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"firstName\"]', $form).val(\"\");\n $('input[name=\"lastName\"]', $form).val(\"\");\n $('input[name=\"email\"]', $form).val(\"\");\n $('input[name=\"username\"]', $form).val(\"\");\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n\n $('input[name=\"phone\"]', $form).val(\"\");\n $('input[name=\"mobilephone\"]', $form).val(\"\");\n $('input[name=\"socialSecurityNumber\"]', $form).val(\"\");\n $('input[name=\"birthdate\"]', $form).val(\"\");\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n\n rf.reset();\n };\n\n form.updatePasswordBar = function (field) {\n var value = field.val();\n var score = Vendd.Helpers.textStrength(value);\n\n var $passwordStrength = $('#chkPassLabel, #chkPassText');\n\n $passwordStrength.removeClass(function (i, css) {\n return (css.match(/(^|\\s)level\\S+/g) || []).join(' ');\n }).addClass('level' + score);\n };\n\n $(\".js-datepicker\", $form).datepicker({\n changeMonth: true,\n changeYear: true,\n yearRange: \"-100:+0\",\n maxDate: \"0\"\n });\n\n form.setIsRegistered = function (isRegistered) {\n sessionStorage.setItem('LoyaltyIsRegistered', isRegistered);\n };\n $.fn.validationEngine.validations.passwordStrength = Vendd.Validations.passwordStrength;\n\n //init validation options\n var valOpts = {};\n\n //add required validations\n $.each($('input[data-required], textarea[data-required], select[data-required]', $form), function (e, el) {\n var inputName = $(el).attr('name');\n valOpts[inputName] = { required: inputName + '-required' };\n });\n\n //add consent validations\n $.each($('div.consent.checkbox[data-required]'), function (e, el) {\n var consentType = $('input', el).attr('name');\n valOpts[consentType] = { checkboxRequired: consentType + '-required' };\n });\n\n //add email validation\n if ($('input[name=\"email\"]', $form).length > 0) {\n valOpts.email = valOpts.email || {};\n _.extend(valOpts.email, { isEmail: 'email-invalid' });\n }\n\n //add phone validation\n if ($('input[name=\"phone\"]', $form).length > 0) {\n valOpts.phone = valOpts.phone || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.phone, { isValidPhoneLocalized: { validator: 'phone-invalid', config: { type: 'phone' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekPhoneValidation) {\n _.extend(valOpts.phone, { isGreekPhone: 'phone-invalid' });\n } else {\n _.extend(valOpts.phone, { isPhoneNumber: 'phone-invalid' });\n }\n }\n }\n\n //add mobile validation\n if ($('input[name=\"mobilephone\"]', $form).length > 0) {\n valOpts.mobilephone = valOpts.mobilephone || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.mobilephone, { isValidPhoneLocalized: { validator: 'mobilephone-invalid', config: { type: 'mobile' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekMobileValidation) {\n _.extend(valOpts.mobilephone, { isGreekMobile: 'mobilephone-invalid' });\n } else {\n _.extend(valOpts.mobilephone, { isPhoneNumber: 'mobilephone-invalid' });\n }\n }\n }\n\n //add password strength validation\n if ($('input[name=\"password\"]', $form).length > 0) {\n valOpts.password = valOpts.password || {};\n _.extend(valOpts.password, { passwordStrength: { validator: 'password-weak', config: { limit: $form.data('pwdstrength') } } });\n }\n\n //add confirmation password match validation\n if ($('input[name=\"passwordConfirmation\"]', $form).length > 0) {\n valOpts.passwordConfirmation = valOpts.passwordConfirmation || {};\n _.extend(valOpts.passwordConfirmation, { match: { validator: 'passwordConfirmation-match', matchField: 'password' } });\n }\n\n //add social security number validation\n if ($('input[name=\"socialSecurityNumber\"]', $form).length > 0) {\n valOpts.socialSecurityNumber = { isSocialSecurityNumber: 'socialSecurityNumber-invalid' };\n }\n\n //add postalCode validation\n //if ($('input[name=\"postalCode\"]', $form).length > 0) {\n // valOpts.postalCode = valOpts.postalCode || {};\n // _.extend(valOpts.email, { isGreekPostalCode: { validator: 'postalCode-invalid', config: { areas: areas } } });\n //}\n\n var prevLoyaltyMemberCardNumber = '';\n\n if (loyaltyMemberCardNumberIsEnabled) {\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).on('blur', function () {\n var loyaltyMemberCardNumber = $(this).val();\n var $formRow = $(this).closest('.form-row');\n loyaltyMemberCardNumber = loyaltyMemberCardNumber.replace(/\\s/g, '');\n $(this).val(loyaltyMemberCardNumber);\n if (loyaltyMemberCardNumber == '') {\n $('.loyaltyMemberCardNumber-invalid', $formRow).hide();\n $formRow.removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n }\n else {\n if (loyaltyMemberCardNumber != prevLoyaltyMemberCardNumber) {\n $('.js-submit-button', $form).attr('disabled', 'disabled');\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetMemberByLoyaltyNumber(loyaltyMemberCardNumber));\n prevLoyaltyMemberCardNumber = loyaltyMemberCardNumber;\n }\n }\n });\n }\n\n var clickedCheckbox;\n var loyaltyCheckboxes = $('.js-loyalty-checkbox .checkbox-wrapper input', $form);\n loyaltyCheckboxes.removeAttr('disabled');\n\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper > input', el);\n\n $chkbx.off('click').on('click', function () {\n var $this = $(this);\n\n if (!$this.is(':checked')) {\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n return;\n }\n\n var $text = $('.consent-text-wrapper', el);\n $.fancybox.open($text, {\n maxWidth: 900,\n padding: 0,\n modal: true,\n afterShow: function () {\n var consentForm = $('.js-consent-form');\n var scrollContForm = $('.js-scrollbar', consentForm);\n var closeButton = $('.js-consent-decline-button', consentForm);\n var acceptButton = $('.js-consent-accept-button', consentForm);\n\n scrollContForm.mCustomScrollbar({\n scrollbarPosition: \"outside\",\n scrollInertia: 400,\n timeout: 1000,\n theme: \"dark-2\",\n mouseWheel: { preventDefault: true },\n callbacks: {\n onTotalScrollOffset: 25,\n onTotalScroll: function () {\n consentForm.addClass('has-scrolled');\n $('.js-consent-accept-button', consentForm).prop('disabled', false);\n $('.js-tooltip', consentForm).addClass('hidden');\n },\n onInit: function () {\n $('.js-scroll-btn', consentForm).addClass('show');\n },\n onCreate: function () {\n setTimeout(function () {\n if (scrollContForm.hasClass('mCS_no_scrollbar')) {\n consentForm.addClass('has-scrolled');\n $('.js-consent-accept-button', consentForm).prop('disabled', false);\n $('.js-tooltip', consentForm).addClass('hidden');\n }\n }, 100);\n }\n }\n });\n\n $('.js-scroll-btn', consentForm).click(function () {\n scrollContForm.mCustomScrollbar('scrollTo', '-=' + (scrollContForm.height()));\n });\n\n closeButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", false);\n //$this.prop(\"checked\", false);\n $.fancybox.close(true);\n });\n acceptButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", true);\n //$this.prop(\"checked\", true);\n $.fancybox.close(true);\n });\n },\n afterClose: function () {\n\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n },\n });\n });\n });\n\n loyaltyCheckboxes.click(function (e) {\n clickedCheckbox = $(this);\n $('.consent-wrapper.loyalty .checkbox-wrapper > input', $form).trigger('click');\n });\n\n if (!useEmailAsLoginName) {\n valOpts.username = {\n required: 'username-required'\n };\n\n }\n\n $form.validationEngine(valOpts);\n var rf = $form.data('validationEngine');\n\n $.each($('.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el);\n consentType.on('change', function () {\n rf.validate(consentType.attr('name'));\n });\n });\n\n $form.on('click', '.js-submit-button', function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n var val1 = form.validateRecaptcha();\n var val2 = rf.validate();\n\n if (val1 && val2 && loyaltyMemberCardNumberIsValid) {\n form.submit();\n } else {\n if ($('.form-row.with-error', $form).length > 0) {\n $('html,body').animate({ scrollTop: $('.form-row.with-error', $form).first().offset().top - 100 }, 600);\n }\n }\n });\n\n form.checkConsents = function () {\n var data = [];\n var checkboxes = $('.form-row.consent.checkbox', $form);\n $.each(checkboxes, function (e, el) {\n var chkbx = $('.checkbox-wrapper input', el);\n data.push({ type: chkbx.attr('id'), source: 'Registration Form', approved: chkbx.prop(\"checked\") });\n });\n\n if (data.length > 0) {\n window.ConsentsManager.insertConsents(data);\n }\n };\n\n $form.on('change', 'select[name]', function (e) {\n form.setField($(this));\n });\n\n $form.on('change', '.js-datepicker', function (e) {\n $(this).trigger('keyup');\n });\n\n $form.on('keyup', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n if (e.keyCode === 13) {\n e.preventDefault();\n e.stopPropagation();\n\n $submitButton.click();\n\n return;\n }\n\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n form.setField($(this)); \n });\n\n $form.on('blur', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n form.setField($(this));\n });\n\n form.setField = function (field) {\n var fieldName = field.attr('name');\n formData[fieldName] = (fieldName === 'email') ? field.val().trim() : field.val();\n rf.validate(fieldName);\n };\n\n $form.on('keyup', 'input[name = \"postalCode\"]', $.debounce(400, function () {\n var $this = $(this);\n var postalCode = $this.val();\n\n if (postalCode === null) return;\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetAreasForPostCode(\"GR\", postalCode, \"\"));\n }));\n\n $form.on('click', 'input.single-check', function () {\n $('input.single-check').not(this).prop('checked', false);\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n var isLoyaltyRegistered = formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty;\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper input', el);\n var chkbxId = $chkbx.attr('id');\n if (chkbxId != undefined && chkbxId != \"\") {\n valOpts = $form.validationEngine();\n formData[chkbxId] = $chkbx.prop(\"checked\");\n valOpts[chkbxId] = isLoyaltyRegistered ? { checkboxRequired: (chkbxId + '-required') } : {};\n $form.validationEngine(valOpts);\n }\n if (isLoyaltyRegistered) {\n $form.data('validationEngine').removeField(chkbxId);\n $form.data('validationEngine').addField(JSON.parse(\"{\\\"\" + chkbxId + \"\\\" : { \\\"checkboxRequired\\\" : \\\"\" + chkbxId + \"-required\\\" }}\"));\n $chkbx.prop(\"checked\", true);\n } else {\n $('.' + chkbxId + '-required', $form).removeClass(\"error\");\n $form.data('validationEngine').removeField(chkbxId);\n $chkbx.prop(\"checked\", false);\n }\n });\n });\n\n $form.on('click', '.js-clear-loyalty', function () {\n $('input.single-check:checked').prop('checked', false);\n });\n\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n if ($('input[name=\"phone\"]', $form).length > 0) {\n $('input[name=\"phone\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.phone = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('phone');\n });\n }\n if ($('input[name=\"mobilephone\"]', $form).length > 0) {\n $('input[name=\"mobilephone\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.mobilephone = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('mobilephone');\n });\n }\n }\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterSuccess, form, form.onSuccess);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterFailure, form, function (envelope) {\n form.onFailure(envelope);\n form.resetRecaptcha();\n });\n\n Vendd.MessageBus.subscribe(Vendd.Plugins.Messages.RecaptcaLoaded, form, form.initRecaptcha);\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileSuccess, form, function (envelope) {\n var data = envelope.message.data;\n\n //if status 409 mobile exists in multiple members\n if (data.StatusCode === 409) {\n var loyaltyErrorWrapper = $loyaltyErrorWrapper.get(0);\n $('span.error-message', loyaltyErrorWrapper).html(data.ResponseMessage);\n $loyaltyErrorWrapper.show();\n\n return;\n }\n\n form.setIsRegistered(data.StatusCode === 200);\n sessionStorage.setItem('LoyaltyMobilePhone', formData.mobilephone);\n window.location = window.location.origin + data.LoyaltyRegistrationUrl;\n });\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileFailure, form, function () {\n form.loading(false);\n toastr.error('Something went wrong');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.LoginSuccess, form, function (envelope) {\n var returnUrl = decodeURIComponent(LhApp.Function.QueryString.getValueOf('ReturnUrl', window.location.href));\n if (returnUrl) {\n document.location.href = returnUrl;\n }\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberSuccess, form, function (envelope) {\n var data = envelope.message.data.model.data;\n if (data.ErrorCode) {\n $('.loyaltyMemberCardNumber-invalid', $form).show().closest('.form-row').addClass('with-error');\n loyaltyMemberCardNumberIsValid = false;\n }\n else {\n $('.loyaltyMemberCardNumber-invalid', $form).hide().closest('.form-row').removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n }\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberFailed, form, function (envelope) {\n var message = envelope.message.data.model.message;\n toastr.error(message);\n loyaltyMemberCardNumberIsValid = false;\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetAreasForPostCodeSuccess, form, form.getAreasForPostCode);\n\n Vendd.MessageBus.publishAsync(form, new Vendd.Widget.Messages.BindControl($form));\n\n});\n","Vendd.Scripts.load(function () {\n\n var $form = $('.x-registration-form-sso'), $submitButton, form, formData, $loyaltyErrorWrapper = $('.loyalty-error-container'),\n loyaltyRegistrationUrl;\n\n if ($form.length < 1)\n return;\n\n var loyaltyMemberCardNumberIsValid = true, loyaltyMemberCardNumberIsEnabled = $form.data('loyaltymembercardnumberisenabled');\n\n $submitButton = $('.js-submit-button', $form);\n\n form = $form.get(0);\n\n importEmailForRegistration();\n\n formData = {\n \"title\": $(\"option:selected\", 'select[name=title]').text(),\n \"newsletter\": false,\n \"redirectUrl\": $form.data('redirect') || \"\",\n \"phone\": $('input[name=\"phone\"]').val(),\n \"mobilePhone\": \"\", //$('input[name=\"mobilePhone\"]').val()\n \"socialSecurityNumber\": $('input[name=\"socialSecurityNumber\"]').val(),\n \"registerToLoyalty\": false,\n \"isLoyaltyMember\": false,\n \"loyaltyRequest\": false,\n \"loyaltyMemberId\": \"\",\n \"alreadyRegisteredToLoyalty\": false,\n \"loyaltyMemberCardNumber\": \"\",\n \"postalCode\": \"\"\n };\n\n var areas = [];\n\n form.getAreasForPostCode = function (envelope) {\n\n areas = envelope.message.data;\n\n //validate postal code.\n if (valOpts.postalCode && valOpts.postalCode.isGreekPostalCode) {\n valOpts.postalCode.isGreekPostalCode.config.areas = areas;\n }\n rf.validateField(\"postalCode\");\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function (envelope) {\n form.loading(false);\n\n var response = envelope.message.data;\n if (response.success && response.code === \"Registration_OperationSuccesful\") {\n $('.js-error', $form).hide();\n $('.js-content', $form).hide();\n\n var isLoyaltyActivated = (formData.alreadyRegisteredToLoyalty || formData.registerToLoyalty);\n if (isLoyaltyActivated && formData.mobilePhone) {\n loyaltyRegistrationUrl = response.data.LoyaltyRegistrationUrl;\n Vendd.MessageBus.publishAsync(Vendd.Loyalty, new Vendd.Loyalty.Messages.CheckByMobile(formData.mobilePhone));\n } else {\n $('.js-success', $form).show();\n }\n\n $('.js-success', $form).show();\n\n $('html,body').animate({scrollTop: 0}, 300);\n\n /* Track User Registration */\n if (typeof fbPixelTracker !== 'undefined' && typeof fbPixelCanTrack !== 'undefined') {\n if (fbPixelTracker && fbPixelTracker.Properties.FacebookPixelId && fbPixelCanTrack) {\n fbq('track', 'CompleteRegistration');\n }\n }\n /* END Track User Registration */\n\n } else {\n\n $('.js-error', $form).show();\n $('html,body').animate({scrollTop: $('.js-error', $form).offset().top - 100}, 300);\n\n }\n };\n\n form.onFailure = function (envelope) {\n form.loading(false);\n\n $('.js-error', $form).show();\n $('html,body').animate({scrollTop: $('.js-error', $form).offset().top - 100}, 300);\n };\n\n form.submit = function () {\n form.loading(true);\n\n formData.newsletter = $('#chkNewsletter').prop(\"checked\");\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n\n formData.isLoyaltyMember = $('#isLoyaltyMember').prop(\"checked\");\n formData.loyaltyRequest = $('#loyaltyRequest').prop(\"checked\");\n\n Vendd.MessageBus.publishAsync(\n form,\n new Vendd.User.Messages.CompleteSsoRegistration(\n formData.newsletter,\n formData.redirectUrl,\n formData.phone,\n formData.mobilePhone,\n formData.socialSecurityNumber,\n formData.isLoyaltyMember,\n formData.loyaltyRequest,\n formData.loyaltyMemberId,\n formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty,\n formData.loyaltyMemberCardNumber,\n formData.postalCode\n )\n );\n };\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-success', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"phone\"]', $form).val(\"\");\n $('input[name=\"mobilePhone\"]', $form).val(\"\");\n $('input[name=\"socialSecurityNumber\"]', $form).val(\"\");\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n rf.reset();\n };\n\n $(\".js-datepicker\", $form).datepicker({\n changeMonth: true,\n changeYear: true,\n yearRange: \"-100:+0\",\n maxDate: \"0\"\n });\n\n form.setIsRegistered = function (isRegistered) {\n sessionStorage.setItem('LoyaltyIsRegistered', isRegistered);\n };\n\n var valOpts = {\n phone: {\n required: 'phone-required'\n },\n mobilePhone: {\n required: 'mobilePhone-required'\n },\n /*postalCode: {\n isGreekPostalCode: { validator: 'postalCode-invalid', config: { areas: areas } }\n }*/\n };\n\n if ($('input[name=\"postalCode\"]', $form).length > 0 && $('.postalCode-required', $form).length > 0) {\n _.extend(valOpts.postalCode, {required: 'postalCode-required'});\n }\n\n if ($('input[name=\"socialSecurityNumber\"]', $form).length > 0) {\n valOpts.socialSecurityNumber = {\n isSocialSecurityNumber: 'social-security-number'\n };\n }\n\n var prevLoyaltyMemberCardNumber = '';\n\n if (loyaltyMemberCardNumberIsEnabled) {\n $('input[name=\"loyaltyMemberCardNumber\"]', $form).on('blur', function () {\n var loyaltyMemberCardNumber = $(this).val();\n var $formRow = $(this).closest('.form-row');\n loyaltyMemberCardNumber = loyaltyMemberCardNumber.replace(/\\s/g, '');\n $(this).val(loyaltyMemberCardNumber);\n if (loyaltyMemberCardNumber == '') {\n $('.loyaltyMemberCardNumber-invalid', $formRow).hide();\n $formRow.removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n } else {\n if (loyaltyMemberCardNumber != prevLoyaltyMemberCardNumber) {\n $('.js-submit-button', $form).attr('disabled', 'disabled');\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetMemberByLoyaltyNumber(loyaltyMemberCardNumber));\n prevLoyaltyMemberCardNumber = loyaltyMemberCardNumber;\n }\n }\n });\n }\n\n //Validate Phone only if config parameter is true\n if (venddProjectConfigs.Registration.GreekPhoneValidation) {\n _.extend(valOpts.phone, {isGreekPhone: 'phone-invalid'});\n } else {\n _.extend(valOpts.phone, {isPhoneNumber: 'phone-invalid'});\n }\n\n //Validate Mobile only if config parameter is true\n if (venddProjectConfigs.Registration.GreekMobileValidation) {\n _.extend(valOpts.mobilePhone, {isGreekMobile: 'mobilePhone-invalid'});\n } else {\n _.extend(valOpts.mobilePhone, {isPhoneNumber: 'mobilePhone-invalid'});\n }\n\n //add consent validations\n $.each($('div.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el).attr('name');\n valOpts[consentType] = {\n checkboxRequired: consentType + '-required'\n };\n });\n\n var clickedCheckbox;\n var loyaltyCheckboxes = $('.js-loyalty-checkbox .checkbox-wrapper input', $form);\n loyaltyCheckboxes.removeAttr('disabled');\n\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper > input', el);\n\n $chkbx.off('click').on('click', function () {\n var $this = $(this);\n\n if (!$this.is(':checked')) {\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n return;\n }\n\n var $text = $('.consent-text-wrapper', el);\n $.fancybox.open($text, {\n maxWidth: 900,\n padding: 0,\n modal: true,\n afterShow: function () {\n var consentForm = $('.js-consent-form');\n var scrollContForm = $('.js-scrollbar', consentForm);\n var closeButton = $('.js-consent-decline-button', consentForm);\n var acceptButton = $('.js-consent-accept-button', consentForm);\n\n scrollContForm.mCustomScrollbar({\n scrollbarPosition: \"outside\",\n scrollInertia: 400,\n timeout: 1000,\n theme: \"dark-2\",\n mouseWheel: {preventDefault: true},\n callbacks: {\n onTotalScrollOffset: 25,\n onTotalScroll: function () {\n consentForm.addClass('has-scrolled');\n $('.js-consent-accept-button', consentForm).prop('disabled', false);\n $('.js-tooltip', consentForm).addClass('hidden');\n },\n onInit: function () {\n $('.js-scroll-btn', consentForm).addClass('show');\n },\n onCreate: function () {\n setTimeout(function () {\n if (scrollContForm.hasClass('mCS_no_scrollbar')) {\n consentForm.addClass('has-scrolled');\n $('.js-consent-accept-button', consentForm).prop('disabled', false);\n $('.js-tooltip', consentForm).addClass('hidden');\n }\n }, 100);\n }\n }\n });\n\n $('.js-scroll-btn', consentForm).click(function () {\n scrollContForm.mCustomScrollbar('scrollTo', '-=' + (scrollContForm.height()));\n });\n\n closeButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", false);\n //$this.prop(\"checked\", false);\n $.fancybox.close(true);\n });\n acceptButton.off('click').on('click', function () {\n //clickedCheckbox.prop(\"checked\", true);\n //$this.prop(\"checked\", true);\n $.fancybox.close(true);\n });\n },\n afterClose: function () {\n\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.is(':checked');\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n },\n });\n });\n });\n\n loyaltyCheckboxes.click(function (e) {\n clickedCheckbox = $(this);\n $('.consent-wrapper.loyalty .checkbox-wrapper > input', $form).trigger('click');\n });\n\n $form.validationEngine(valOpts);\n var rf = $form.data('validationEngine');\n\n var val3 = true;\n $form.on('click', '.js-submit-button', function (e) {\n valOpts = $form.validationEngine();\n\n $form.validationEngine(valOpts);\n rf = $form.data('validationEngine');\n\n e.preventDefault();\n e.stopPropagation();\n\n var val1 = true;//form.validateRecaptcha();\n var val2 = rf.validate();\n\n if (val1 && val2 && val3 && loyaltyMemberCardNumberIsValid) {\n if (LhApp.Context.IsConsentsEnabled) {\n form.checkConsents();\n } else {\n form.submit();\n }\n } else {\n if ($('.form-row.with-error', $form).length > 0) {\n $('html,body').animate({scrollTop: $('.form-row.with-error', $form).first().offset().top - 100}, 600);\n }\n }\n });\n\n form.checkConsents = function () {\n var data = [];\n var checkboxes = $('.form-row.consent.checkbox');\n $.each(checkboxes, function (e, el) {\n var chkbx = $('.checkbox-wrapper input', el);\n data.push({type: chkbx.attr('id'), source: 'Registration Form', approved: chkbx.prop(\"checked\")});\n });\n\n if (data.length > 0) {\n window.ConsentsManager.insertConsents(data);\n } else {\n form.submit();\n }\n };\n\n $form.on('change', 'select[name]', function (e) {\n var $this = $(this);\n var fieldName = $this.attr('name');\n formData[fieldName] = $(\"option:selected\", $this).text();\n\n });\n\n $form.on('change', '.js-datepicker', function (e) {\n $(this).trigger('keyup');\n });\n\n $form.on('keyup', 'input[name]', function (e) {\n\n if (e.keyCode === 13) {\n e.preventDefault();\n e.stopPropagation();\n\n $submitButton.click();\n\n return;\n }\n\n var $this = $(this);\n var fieldName = $this.attr('name');\n\n formData[fieldName] = $this.val();\n rf = $form.data('validationEngine');\n rf.validate(fieldName);\n });\n\n $form.on('keyup', 'input[name = \"postalCode\"]', $.debounce(400, function () {\n var $this = $(this);\n var postalCode = $this.val();\n\n if (postalCode === null) return;\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetAreasForPostCode(\"GR\", postalCode, \"\"));\n }));\n\n $form.on('click', 'input.single-check', function () {\n $('input.single-check').not(this).prop('checked', false);\n formData.registerToLoyalty = $('#chkRegisterToLoyaltyPoints').prop(\"checked\");\n formData.alreadyRegisteredToLoyalty = $('#chkAlreadyRegisteredToLoyaltyPoints').prop(\"checked\");\n var isLoyaltyRegistered = formData.registerToLoyalty || formData.alreadyRegisteredToLoyalty;\n $('.consent-wrapper', $form).each(function (e, el) {\n var $chkbx = $('.checkbox-wrapper input', el);\n var chkbxId = $chkbx.attr('id');\n if (chkbxId != undefined && chkbxId != \"\") {\n valOpts = $form.validationEngine();\n formData[chkbxId] = $chkbx.prop(\"checked\");\n valOpts[chkbxId] = isLoyaltyRegistered ? {checkboxRequired: (chkbxId + '-required')} : {};\n $form.validationEngine(valOpts);\n }\n if (isLoyaltyRegistered) {\n $form.data('validationEngine').removeField(chkbxId);\n $form.data('validationEngine').addField(JSON.parse(\"{\\\"\" + chkbxId + \"\\\" : { \\\"checkboxRequired\\\" : \\\"\" + chkbxId + \"-required\\\" }}\"));\n $chkbx.prop(\"checked\", true);\n } else {\n $('.' + chkbxId + '-required', $form).removeClass(\"error\");\n $form.data('validationEngine').removeField(chkbxId);\n $chkbx.prop(\"checked\", false);\n }\n });\n });\n\n $form.on('click', '.js-clear-loyalty', function () {\n $('input.single-check:checked').prop('checked', false);\n });\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterSuccess, form, form.onSuccess);\n Vendd.MessageBus.subscribe(Vendd.User.Messages.RegisterFailure, form, function (envelope) {\n form.onFailure(envelope);\n });\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileSuccess, form, function (envelope) {\n var data = envelope.message.data;\n\n //if status 409 mobile exists in multiple members\n if (data.StatusCode === 409) {\n var loyaltyErrorWrapper = $loyaltyErrorWrapper.get(0);\n $('span.error-message', loyaltyErrorWrapper).html(data.ResponseMessage);\n $loyaltyErrorWrapper.show();\n\n return;\n }\n\n form.setIsRegistered(data.StatusCode === 200);\n sessionStorage.setItem('LoyaltyMobilePhone', formData.mobilePhone);\n window.location = window.location.origin + data.LoyaltyRegistrationUrl;\n });\n\n Vendd.MessageBus.subscribe(Vendd.Loyalty.Messages.CheckByMobileFailure, form, function () {\n form.loading(false);\n toastr.error('Something went wrong');\n });\n Vendd.MessageBus.subscribe(Vendd.User.Messages.LoginSuccess, form, function (envelope) {\n var returnUrl = decodeURIComponent(LhApp.Function.QueryString.getValueOf('ReturnUrl', window.location.href));\n if (returnUrl) {\n document.location.href = returnUrl;\n }\n });\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberSuccess, form, function (envelope) {\n var data = envelope.message.data.model.data;\n if (data.ErrorCode) {\n $('.loyaltyMemberCardNumber-invalid', $form).show().closest('.form-row').addClass('with-error');\n loyaltyMemberCardNumberIsValid = false;\n } else {\n $('.loyaltyMemberCardNumber-invalid', $form).hide().closest('.form-row').removeClass('with-error');\n loyaltyMemberCardNumberIsValid = true;\n }\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetMemberByLoyaltyNumberFailed, form, function (envelope) {\n var message = envelope.message.data.model.message;\n toastr.error(message);\n loyaltyMemberCardNumberIsValid = false;\n $('.js-submit-button', $form).removeAttr('disabled');\n });\n Vendd.MessageBus.subscribe(Vendd.Consents.Messages.InsertConsents, form, form.submit);\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetAreasForPostCodeSuccess, form, form.getAreasForPostCode);\n});\n","Vendd.Scripts.load(function () {\n\n var $form = $('.x-registration-b2b-form'), $submitButton, form, formData;\n\n if ($form.length < 1)\n return;\n\n $submitButton = $('.js-submit-button', $form);\n\n form = $form.get(0);\n\n importEmailForRegistration();\n\n formData = {\n companyName: \"\",\n occupation: \"\",\n taxAgency: $('select[name=\"taxAgency\"]').val() || \"\",\n taxIdentifier: \"\",\n officerName: \"\",\n vatstatus: 0,\n email: $('input[name=\"email\"]').val().trim() || \"\",\n emailConfirmation: \"\",\n username: \"\",\n\n town: \"\",\n address: \"\",\n number: \"\",\n postalCode: \"\",\n phone: \"\",\n password: \"\",\n passwordConfirmation: \"\",\n\n storesNumber: \"\",\n phoneTwo: \"\",\n mobile: \"\",\n socialSecurityNumber: \"\",\n fax: \"\",\n siteUrl: \"\",\n message: \"\",\n\n newsletter: false,\n reCaptchaCode: \"\",\n redirectUrl: $form.data('redirect') || \"\",\n acceptTerms: false,\n\n store: \"\",\n CompanyCategory: \"\",\n OpeningHours: \"\",\n area: $('select[name=\"area\"]').val() || \"\",\n prefecture: \"\",\n ReceiveEinvoice: null,\n officerLastName: \"\",\n officerPosition: \"\",\n\n countryCode: $('select[name=\"countryCode\"]').val() || LhApp.Context.Country,\n\n registrationSetData: registrationSetData || null\n };\n\n var useEmailAsLoginName = $form.data('useemailasloginname').toString().toLowerCase() === 'true';\n var areaAutoCompleteEnabled = $form.data('areaautocomplete').toString().toLowerCase() === 'true';\n var invoiceAutoComplete = $form.data('invoiceautocomplete').toString().toLowerCase() === 'true';\n\n var areaLabel = $form.data('arealabel');\n var areas = [];\n var cyprusAreasEnabled = venddProjectConfigs.Registration.CyprusAreasAutoCompletedEnabled;\n\n var registrationSetData = [];\n\n // reCAPTCHA\n var captchaWidgetId;\n var captchaId = \"registrationCaptcha\";\n var $captchaElement = $form.find(\"#\" + captchaId);\n var $captchaContainer = $form.find('.recaptcha-container');\n var captchaEnabled = $captchaElement.length > 0 ? true : false;\n\n form.initRecaptcha = function () {\n\n if (!captchaEnabled)\n return;\n\n var sitekey = $captchaElement.data(\"sitekey\");\n if (sitekey) {\n captchaEnabled = true;\n captchaWidgetId = grecaptcha.render(captchaId, {\n 'sitekey': sitekey,\n 'callback': form.recaptchaCallback\n });\n }\n };\n\n form.validateRecaptcha = function () {\n if (!captchaEnabled)\n return true;\n\n formData.reCaptchaCode = $captchaElement.find('.g-recaptcha-response').val();\n\n var res = false;\n\n if (formData.reCaptchaCode) {\n $captchaContainer.find('.recaptcha-required').removeClass('error');\n res = true;\n }\n else {\n $captchaContainer.find('.recaptcha-required').addClass('error');\n }\n\n return res;\n };\n\n form.resetRecaptcha = function () {\n // Website must only verify the user's reCAPTCHA response token (g-recaptcha-response) once.\n // If a verify attempt has been made with a particular token, it cannot be used again.\n // Call grecaptcha.reset() to ask the end user to verify with reCAPTCHA again.\n if (captchaEnabled)\n grecaptcha.reset(captchaWidgetId);\n };\n\n form.removeRecaptcha = function () {\n $captchaElement.remove();\n };\n\n form.recaptchaCallback = function () {\n form.validateRecaptcha();\n };\n\n form.getAreasForPostCode = function (envelope) {\n\n areas = envelope ? envelope.message.data : [];\n\n var html = Vendd.Handlebars.parse(\"registrationB2BArea_A\", areas);\n $('.form-row.area .js-area-wrapper').html(html);\n\n //add new validation for area select\n var valOptArea = { area: { required: 'area-required' } };\n rf.removeField(\"area\");\n rf.addField(valOptArea);\n\n if (areas.length < 1) {\n $('.form-row.area').removeClass('select');\n $('.form-row.area label').empty().append(areaLabel);\n\n } else {\n $('.form-row.area').addClass('select');\n\n //submit value in formData\n if (areas.length === 1) {\n formData.area = areas[0].Name;\n rf.validate(\"area\");\n }\n\n //if City exists, submit the value in formData\n if (areas.length > 0 && areas[0].City.length > 0) {\n $('input[name = \"town\"]:text').val(areas[0].City);\n formData.town = areas[0].City;\n }\n }\n\n //validate postal code\n if (formData.countryCode === \"GR\")\n valOpts.postalCode.isGreekPostalCode.config.areas = areas;\n\n if (formData.countryCode === \"CY\")\n valOpts.postalCode.isCypriotPostalCode.config.areas = areas;\n };\n\n form.updatePostalCode = function (countryCode) {\n\n //delete validations related to country\n delete valOpts.postalCode.isGreekPostalCode;\n delete valOpts.postalCode.isCypriotPostalCode;\n\n //add validation\n if (countryCode === \"GR\")\n _.extend(valOpts.postalCode, { isGreekPostalCode: { validator: 'postalCode-invalid', config: { areas: areas } } });\n\n if (countryCode === \"CY\")\n _.extend(valOpts.postalCode, { isCypriotPostalCode: { validator: 'postalCode-invalid', config: { areas: areas } } });\n\n //update validation field\n var valOptPostalCode = { postalCode: valOpts.postalCode };\n rf.removeField(\"postalCode\");\n rf.addField(valOptPostalCode);\n\n };\n\n form.setRegistrationData = function () {\n\n var $sets = $('.js-registration-set', $form);\n\n if ($sets.length < 1) return;\n\n //init array\n registrationSetData = [];\n\n $.each($sets, function (e, set) {\n var $set = $(set);\n\n var setData = {\n Name: $set.data('set-name'),\n Id: $set.data('set-id'),\n Values: []\n }\n\n $.each($('input[type=\"checkbox\"]', $set), function (e, input) {\n if ($(input).is(':checked')) {\n var setValues = {\n Id: $(input).data('id'),\n Name: $(input).data('name')\n }\n\n setData.Values.push(setValues);\n }\n });\n\n if (setData.Values.length > 0)\n registrationSetData.push(setData);\n });\n\n if (registrationSetData.length > 0)\n formData.registrationSetData = registrationSetData;\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function (envelope) {\n form.loading(false);\n\n var response = envelope.message.data;\n\n if (response.success && response.code === \"Registration_OperationSuccesful\") {\n //insert consents after registration success\n if (LhApp.Context.IsConsentsEnabled) {\n form.checkConsents();\n }\n\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-content', $form).hide();\n\n form.removeRecaptcha();\n\n $('.js-success', $form).show();\n $('html,body').animate({ scrollTop: 0 }, 300);\n\n /* Track User Registration */\n if (typeof fbPixelTracker !== 'undefined' && typeof fbPixelCanTrack !== 'undefined') {\n if (fbPixelTracker && fbPixelTracker.Properties.FacebookPixelId && fbPixelCanTrack) {\n fbq('track', 'CompleteRegistration');\n }\n }\n /* END Track User Registration */\n\n } else {\n\n if (response.code === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n form.resetRecaptcha();\n }\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n form.updatePasswordBar($('input[name=\"password\"]', $form));\n };\n\n form.onFailure = function (envelope) {\n form.hideLoader();\n\n var response = envelope.message.data;\n if (response === 'Registration_EmailExists') {\n $('.js-error', $form).hide();\n $('.js-exists', $form).show();\n $('html,body').animate({ scrollTop: $('.js-exists', $form).offset().top - 100 }, 300);\n } else {\n $('.js-exists', $form).hide();\n $('.js-error', $form).show();\n $('html,body').animate({ scrollTop: $('.js-error', $form).offset().top - 100 }, 300);\n }\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n form.updatePasswordBar($('input[name=\"password\"]', $form));\n };\n\n form.submit = function () {\n form.loading(true);\n\n formData.vatstatus = $('select[name=\"vatstatus\"]').val();\n formData.newsletter = $('#chkNewsletter').prop(\"checked\");\n\n var einvoiceVal = $(\"input:radio[name='einvoice']:checked\").val();\n\n if (einvoiceVal === \"true\") {\n formData.ReceiveEinvoice = true;\n } else if (einvoiceVal === \"false\") {\n formData.ReceiveEinvoice = false;\n } else {\n formData.ReceiveEinvoice = null;\n }\n\n form.setRegistrationData();\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.B2BRegister(\n formData.companyName,\n formData.occupation,\n formData.taxAgency,\n formData.taxIdentifier,\n formData.officerName,\n formData.vatstatus,\n formData.email,\n formData.emailConfirmation,\n formData.username,\n formData.town,\n formData.address,\n formData.number,\n formData.postalCode,\n formData.phone,\n formData.password,\n formData.passwordConfirmation,\n formData.storesNumber,\n formData.phoneTwo,\n formData.mobile,\n formData.socialSecurityNumber,\n formData.fax,\n formData.siteUrl,\n formData.store,\n formData.CompanyCategory,\n formData.OpeningHours,\n formData.area,\n formData.prefecture,\n formData.officerLastName,\n formData.officerPosition,\n formData.message,\n formData.newsletter,\n formData.ReceiveEinvoice,\n formData.reCaptchaCode,\n formData.redirectUrl,\n formData.countryCode,\n formData.registrationSetData));\n };\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-exists', $form).hide();\n $('.js-success', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"companyName\"]', $form).val(\"\");\n $('input[name=\"occupation\"]', $form).val(\"\");\n $('input[name=\"taxAgency\"]', $form).val(\"\");\n $('input[name=\"taxIdentifier\"]', $form).val(\"\");\n $('input[name=\"officerName\"]', $form).val(\"\");\n $('input[name=\"vatstatus\"]', $form).val(\"\");\n $('input[name=\"email\"]', $form).val(\"\");\n $('input[name=\"emailConfirmation\"]', $form).val(\"\");\n $('input[name=\"username\"]', $form).val(\"\");\n $('input[name=\"town\"]', $form).val(\"\");\n $('input[name=\"address\"]', $form).val(\"\");\n $('input[name=\"number\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n\n $('input[name=\"phone\"]', $form).val(\"\");\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n $('select[name=\"storesNumber\"]', $form).val(\"\");\n $('input[name=\"phoneTwo\"]', $form).val(\"\");\n $('input[name=\"mobile\"]', $form).val(\"\");\n $('input[name=\"socialSecurityNumber\"]', $form).val(\"\");\n\n $('input[name=\"fax\"]', $form).val(\"\");\n $('input[name=\"siteUrl\"]', $form).val(\"\");\n $('input[name=\"message\"]', $form).val(\"\");\n $('input[name=\"store\"]', $form).val(\"\");\n $('input[name=\"CompanyCategory\"]', $form).val(\"\");\n $('input[name=\"OpeningHours\"]', $form).val(\"\");\n $('input[name=\"area\"]', $form).val(\"\");\n $('select[name=\"area\"]', $form).val(\"\");\n $('input[name=\"prefecture\"]', $form).val(\"\");\n\n $('input[name=\"officerLastName\"]', $form).val(\"\");\n $('input[name=\"officerPosition\"]', $form).val(\"\");\n\n rf.reset();\n };\n\n form.resetAddressFields = function () {\n\n $('input[name=\"address\"]', $form).val(\"\");\n $('input[name=\"number\"]', $form).val(\"\");\n $('input[name=\"postalCode\"]', $form).val(\"\");\n $('input[name=\"town\"]', $form).val(\"\");\n $('input[name=\"area\"]', $form).val(\"\");\n $('select[name=\"area\"]', $form).val(\"\");\n $('input[name=\"prefecture\"]', $form).val(\"\");\n\n form.getAreasForPostCode();\n\n };\n\n form.updatePasswordBar = function (field) {\n var value = field.val();\n var score = Vendd.Helpers.textStrength(value);\n\n var $passwordStrength = $('#chkPassLabel, #chkPassText');\n\n $passwordStrength.removeClass(function (i, css) {\n return (css.match(/(^|\\s)level\\S+/g) || []).join(' ');\n }).addClass('level' + score); \n };\n\n $.fn.validationEngine.validations.passwordStrength = Vendd.Validations.passwordStrength;\n\n //init validation options\n var valOpts = {};\n\n //add required validations\n $.each($('input[data-required], textarea[data-required], select[data-required]', $form), function (e, el) {\n var inputName = $(el).attr('name');\n valOpts[inputName] = { required: inputName + '-required' };\n });\n\n //add consent validations\n $.each($('.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el).attr('name');\n valOpts[consentType] = { checkboxRequired: consentType + '-required' };\n });\n\n //add AFM validation only if config parameter is true\n if (venddProjectConfigs.TaxIdentifierValidationEnabled && $('input[name=\"taxIdentifier\"]', $form).length > 0) {\n valOpts.taxIdentifier = valOpts.taxIdentifier || {};\n _.extend(valOpts.taxIdentifier, { isGreekTaxIdentifier: 'taxIdentifier-invalid' });\n }\n\n //add email validation\n if ($('input[name=\"email\"]', $form).length > 0) {\n valOpts.email = valOpts.email || {};\n _.extend(valOpts.email, { isEmail: 'email-invalid' });\n }\n\n //add email confirmation validation\n if ($('input[name=\"emailConfirmation\"]', $form).length > 0) {\n valOpts.emailConfirmation = valOpts.emailConfirmation || {};\n _.extend(valOpts.emailConfirmation, { isEmail: 'emailConfirmation-invalid', match: { validator: 'emailConfirmation-match', matchField: 'email' } });\n }\n\n //add phone validation\n if ($('input[name=\"phone\"]', $form).length > 0) {\n valOpts.phone = valOpts.phone || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.phone, { isValidPhoneLocalized: { validator: 'phone-invalid', config: { type: 'phone' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekPhoneValidation) {\n _.extend(valOpts.phone, { isGreekPhone: 'phone-invalid' });\n } else {\n _.extend(valOpts.phone, { isPhoneNumber: 'phone-invalid' });\n }\n }\n }\n\n //add mobile validation\n if ($('input[name=\"mobile\"]', $form).length > 0) {\n valOpts.mobile = valOpts.mobile || {};\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n _.extend(valOpts.mobile, { isValidPhoneLocalized: { validator: 'mobile-invalid', config: { type: 'mobile' } } });\n } else {\n if (venddProjectConfigs.Registration.GreekMobileValidation) {\n _.extend(valOpts.mobile, { isGreekMobile: 'mobile-invalid' });\n } else {\n _.extend(valOpts.mobile, { isPhoneNumber: 'mobile-invalid' });\n }\n }\n }\n\n //add password strength validation\n if ($('input[name=\"password\"]', $form).length > 0) {\n valOpts.password = valOpts.password || {};\n _.extend(valOpts.password, { passwordStrength: { validator: 'password-weak', config: { limit: $form.data('pwdstrength') } } });\n }\n\n //add confirmation password match validation\n if ($('input[name=\"passwordConfirmation\"]', $form).length > 0) {\n valOpts.passwordConfirmation = valOpts.passwordConfirmation || {};\n _.extend(valOpts.passwordConfirmation, { match: { validator: 'passwordConfirmation-match', matchField: 'password' } });\n }\n\n //add social security number validation\n if ($('input[name=\"socialSecurityNumber\"]', $form).length > 0) {\n valOpts.socialSecurityNumber = { isSocialSecurityNumber: 'socialSecurityNumber-invalid' };\n }\n \n //add postalCode validation only if config parameter is true\n if (areaAutoCompleteEnabled && $('[name=\"area\"]').length > 0) {\n valOpts.postalCode = valOpts.postalCode || {};\n\n if (formData.countryCode === \"GR\")\n _.extend(valOpts.postalCode, { isGreekPostalCode: { validator: 'postalCode-invalid', config: { areas: areas } } });\n\n if (formData.countryCode === \"CY\")\n _.extend(valOpts.postalCode, { isCypriotPostalCode: { validator: 'postalCode-invalid', config: { areas: areas } } });\n }\n\n $form.validationEngine(valOpts);\n var rf = $form.data('validationEngine');\n\n $.each($('.consent.checkbox[data-required]', $form), function (e, el) {\n var consentType = $('input', el);\n consentType.on('change', function () {\n rf.validate(consentType.attr('name'));\n });\n });\n\n $form.on('click', '.js-submit-button', function (e) {\n\n e.preventDefault();\n e.stopPropagation();\n\n var val1 = form.validateRecaptcha();\n var val2 = rf.validate();\n\n if (val1 && val2) {\n form.submit();\n } else {\n if ($('.form-row.with-error', $form).length > 0) {\n $('html,body').animate({ scrollTop: $('.form-row.with-error', $form).first().offset().top - 100 }, 600);\n }\n }\n });\n\n form.checkConsents = function () {\n var data = [];\n var checkboxes = $('.form-row.consent.checkbox', $form);\n $.each(checkboxes, function (e, el) {\n var chkbx = $('.checkbox-wrapper input', el);\n data.push({ type: chkbx.attr('id'), source: 'Registration Form', approved: chkbx.prop(\"checked\") });\n });\n\n if (data.length > 0) {\n window.ConsentsManager.insertConsents(data);\n }\n };\n\n $form.on('click', '.js-password-reveal', function (e) {\n e.preventDefault();\n if ($(this).hasClass('shown')) {\n $(this).removeClass('shown').siblings('input').prop('type', 'password');\n } else {\n $(this).addClass('shown').siblings('input').prop('type', 'text');\n }\n });\n\n $form.on('change', 'select[name]', function (e) {\n //update validation for postal code\n if ($(this).attr('name') === \"countryCode\") {\n\n var countryCode = $(this).val();\n\n if (countryCode === formData.countryCode) return;\n\n form.resetAddressFields();\n form.updatePostalCode(countryCode);\n }\n\n form.setField($(this));\n });\n\n $form.on('keyup', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n //if (e.keyCode === 13) {\n // e.preventDefault();\n // e.stopPropagation();\n\n // $submitButton.click();\n\n // return;\n //}\n\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n form.setField($(this));\n });\n\n $form.on('blur', 'input[name]:not([type=\"checkbox\"]), textarea[name]', function (e) {\n if ($(this).attr('name') === \"password\") {\n form.updatePasswordBar($(this));\n rf.validate(\"passwordConfirmation\");\n }\n\n form.setField($(this));\n });\n\n form.setField = function (field) {\n var fieldName = field.attr('name');\n formData[fieldName] = (fieldName === 'email' || fieldName === 'emailConfirmation') ? field.val().trim() : field.val();\n rf.validate(fieldName);\n };\n\n if (areaAutoCompleteEnabled && $('[name=\"area\"]', $form).length > 0) {\n $form.on('keyup', 'input[name=\"postalCode\"]', $.debounce(400, function () {\n var $this = $(this);\n var postalCode = $this.val();\n\n if (postalCode === null ||\n postalCode.length < 5 && formData.countryCode == \"GR\" ||\n (postalCode.length < 4 || !cyprusAreasEnabled) && formData.countryCode == \"CY\")\n return;\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.GetAreasForPostCode(formData.countryCode, postalCode, \"\"));\n }));\n\n $form.on('focus', 'input[name=\"area\"]', function (e) {\n e.preventDefault();\n\n if (formData.countryCode === \"GR\" || (formData.countryCode === \"CY\" && cyprusAreasEnabled)) {\n $('input[name=\"postalCode\"]', $form).focus();\n }\n });\n }\n\n if (invoiceAutoComplete) {\n $form.on('keyup', 'input[name = \"taxIdentifier\"]', $.debounce(400, function () {\n var $this = $(this);\n var taxIdentifier = $this.val();\n //ajax call for Vat Info Service\n vatInfoService(taxIdentifier);\n }));\n }\n\n if (venddProjectConfigs.phoneLocalizationEnabled) {\n if ($('input[name=\"phone\"]', $form).length > 0) {\n $('input[name=\"phone\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.phone = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('phone');\n });\n }\n if ($('input[name=\"mobile\"]', $form).length > 0) {\n $('input[name=\"mobile\"]', $form).get(0).addEventListener(\"countrychange\", function () {\n formData.mobile = $(this).val();\n rf = $form.data('validationEngine');\n rf.validate('mobile');\n });\n }\n }\n\n function vatInfoService(taxIdentifier) {\n\n if (taxIdentifier == null || taxIdentifier == '')\n return;\n\n Vendd.Service.call({\n url: 'EcomService.svc/GetVatInfo',\n data: {\n request: {\n country: 'GR',\n vat: taxIdentifier\n }\n },\n onSuccess: function (res) {\n if (res.isValid) {\n if (res.name) {\n $('input[name = \"companyName\"]:text').val(res.name);\n formData.companyName = res.name;\n }\n if (res.occupation) {\n $('input[name = \"occupation\"]:text').val(res.occupation);\n formData.occupation = res.occupation;\n }\n if (res.taxAgency) {\n $('select[name=\"taxAgency\"]').val(res.taxAgency);\n formData.taxAgency = res.taxAgency; \n }\n }\n },\n onFailure: function (res) {\n return;\n }\n });\n\n }\n\n $(\".view-terms\").fancybox({\n openEffect: 'none',\n closeEffect: 'none',\n maxWidth: 940,\n helpers: {\n overlay: {\n locked: true,\n closeClick: false\n }\n },\n });\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.B2BRegisterSuccess, form, form.onSuccess);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.B2BRegisterFailure, form, form.onFailure);\n\n Vendd.MessageBus.subscribe(Vendd.Plugins.Messages.RecaptcaLoaded, form, form.initRecaptcha);\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.GetAreasForPostCodeSuccess, form, form.getAreasForPostCode);\n\n});","Vendd.Scripts.load(function () {\n\n var $form = $('.x-resetpassword-form'),\n $submitButton,\n form, formData;\n\n if ($form.length < 1)\n return;\n\n $submitButton = $('.js-submit-button', $form);\n\n form = $form.get(0);\n\n formData = {\n code: $form.data('code'),\n notificationType: $form.data('notification-type'),\n password: \"\",\n passwordConfirmation: \"\"\n };\n\n form.loading = function (loading) {\n if (loading) {\n $form.addClass('x-loading');\n } else {\n $form.removeClass('x-loading');\n }\n };\n\n form.onSuccess = function(envelope) {\n form.loading(false);\n\n var data = envelope.message.data;\n if (data.success && data.code === \"ResetPassword_OperationSuccesful\") {\n $('.js-error', $form).hide();\n $('.js-expired', $form).hide();\n $('.js-content', $form).hide();\n\n $('.js-success', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n } else {\n if (data.code === 'ResetPassword_CodeExpired') {\n $('.js-error', $form).hide();\n $('.js-expired', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n\n } else {\n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n };\n };\n };\n\n form.onFailure = function(envelope) {\n form.loading(false);\n\n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n };\n\n form.submit = function () {\n form.loading(true);\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.ResetPassword(formData.code, formData.password, formData.passwordConfirmation));\n };\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResetPasswordSuccess, form, form.onSuccess);\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResetPasswordFailure, form, form.onFailure);\n\n form.onResendSuccess = function (envelope) {\n form.loading(false);\n\n var data = envelope.message.data;\n if (data.success) {\n $('.js-error', $form).hide();\n $('.js-expired', $form).hide();\n $('.js-content', $form).hide();\n\n $('.js-resend-success', $form).show();\n } else { \n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n };\n };\n\n form.onResendFailure = function (envelope) {\n form.loading(false);\n\n $('.js-expired', $form).hide();\n $('.js-error', $form).show();\n };\n\n form.resend = function () {\n form.loading(true);\n\n Vendd.MessageBus.publishAsync(form, new Vendd.User.Messages.ResendActivationCode(formData.code, formData.notificationType));\n };\n\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResendActivationCodeSuccess, form, form.onResendSuccess);\n Vendd.MessageBus.subscribe(Vendd.User.Messages.ResendActivationCodeFailure, form, form.onResendFailure);\n\n form.reset = function () {\n $('.js-error', $form).hide();\n $('.js-expired', $form).hide();\n $('.js-success', $form).hide();\n $('.js-content', $form).show();\n\n $('input[name=\"password\"]', $form).val(\"\");\n $('input[name=\"passwordConfirmation\"]', $form).val(\"\");\n\n rpf.reset();\n };\n\n form.updatePasswordBar = function (value) {\n var score = Vendd.Helpers.textStrength(value);\n\n var $passwordStrength = $('#chkPassLabel, #chkPassText');\n\n $passwordStrength.removeClass (function (i, css) {\n return (css.match (/(^|\\s)level\\S+/g) || []).join(' ');\n }).addClass('level' + score);\n };\n\n $.fn.validationEngine.validations.passwordStrength = Vendd.Validations.passwordStrength;\n\n if ($('.form-row.password', $form).length > 0) {\n $form.validationEngine({\n password: {\n required: 'password-required',\n passwordStrength: {\n validator: 'password-weak',\n config: {\n limit: $form.data('pwdstrength')\n }\n }\n }\n });\n }\n\n if ($('.form-row.password-confirm', $form).length > 0) {\n $form.validationEngine({\n passwordConfirmation: {\n required: 'password-confirm-required',\n match: {\n validator: 'password-confirm-match',\n matchField: 'password'\n }\n }\n });\n }\n \n var rpf = $form.data('validationEngine');\n\n $form.on('click', '.js-submit-button', function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (rpf.validate())\n form.submit();\n });\n\n $form.on('click', '.js-resend-button', function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n form.resend(); \n });\n\n $form.on('keyup', 'input[name]', function (e) {\n\n if (e.keyCode == 13) {\n e.preventDefault();\n e.stopPropagation();\n\n $submitButton.click();\n\n return;\n };\n\n var $this = $(this);\n var fieldName = $this.attr('name');\n\n if (fieldName === \"password\") {\n form.updatePasswordBar($this.val());\n };\n\n formData[fieldName] = $this.val();\n\n rpf.validate(fieldName);\n });\n\n $form.on('click', '.js-password-reveal', function (e) {\n e.preventDefault();\n if ($(this).hasClass('shown')) {\n $(this).removeClass('shown').siblings('input').prop('type', 'password');\n } else {\n $(this).addClass('shown').siblings('input').prop('type', 'text');\n }\n });\n});\n"]}