{"version":3,"sources":["assets/src/js/Services/GoogleRecaptchaService.js"],"names":["GoogleRecaptcha","resultDomElement","widgetId","apiKey","$","val","initialize","onloadCallback","recaptchas","document","querySelectorAll","grecaptcha","render","id","sitekey","callback","getResponse"],"mappings":"AAAA,IAAIA,gBAAkB,WAGlB,IAEIC,EACAC,EAHAC,EAASC,EAAE,2CAA2CC,MAiB1D,MAAO,CAEHC,WAAY,SAAUH,EAAQF,EAAkBC,GAbhDC,EAcuBA,EAbvBF,EAa+BA,EAZ/BC,EAYiDA,GAGjDK,eAAgB,WACZ,IAAIC,EAAaC,SAASC,iBAAiB,0BAE9BC,WAAWC,OAAOJ,EAAWN,GAAUW,GAAI,CACpDC,QAAWX,EACXY,SAAY,WAjBF,IAASd,EAAkBC,EAAlBD,EAkBQA,EAlBUC,EAkBQA,EAjBZ,KAArCS,WAAWK,YAAYd,IACvBE,EAAEH,GAAkBI,IAAI","file":"GoogleRecaptchaService.js","sourcesContent":["var GoogleRecaptcha = function () {\r\n\r\n //var apiKey = '6LeCowsTAAAAAK129629i_6KEOcI7PlsHLc5g8It';\r\n var apiKey = $('#mi-corpo-contact-form-google-recaptcha').val();\r\n\r\n var resultDomElement;\r\n var widgetId;\r\n\r\n function initializeCallback (key, result, id) {\r\n apiKey = key;\r\n resultDomElement = result;\r\n widgetId = id;\r\n }\r\n\r\n var captchaCallback = function(resultDomElement, widgetId) {\r\n if (grecaptcha.getResponse(widgetId) !== '') {\r\n $(resultDomElement).val(\"valid\");\r\n }\r\n }\r\n\r\n return {\r\n \r\n initialize: function (apiKey, resultDomElement, widgetId) {\r\n initializeCallback(apiKey, resultDomElement, widgetId);\r\n },\r\n\r\n onloadCallback: function () {\r\n var recaptchas = document.querySelectorAll('div[class=g-recaptcha]');\r\n // ToDo: Change API Key\r\n var widget = grecaptcha.render(recaptchas[widgetId].id, {\r\n 'sitekey': apiKey,\r\n 'callback': function () {\r\n return captchaCallback(resultDomElement, widgetId);\r\n }\r\n });\r\n }\r\n }\r\n\r\n};"]}