33 * See COPYING.txt for license details.
44 */
55
6- /* eslint-disable no-undef */
7- // jscs:disable jsDoc
6+ /* global grecaptcha */
87define (
98 [
109 'uiComponent' ,
1110 'jquery' ,
1211 'ko' ,
12+ 'underscore' ,
1313 'Magento_ReCaptchaFrontendUi/js/registry' ,
1414 'Magento_ReCaptchaFrontendUi/js/reCaptchaScriptLoader' ,
15- 'Magento_ReCaptchaFrontendUi/js/nonInlineReCaptchaRenderer' ,
16- ] ,
17- function ( Component , $ , ko , registry , reCaptchaLoader , nonInlineReCaptchaRenderer ) {
15+ 'Magento_ReCaptchaFrontendUi/js/nonInlineReCaptchaRenderer'
16+ ] , function ( Component , $ , ko , _ , registry , reCaptchaLoader , nonInlineReCaptchaRenderer ) {
1817 'use strict' ;
1918
2019 return Component . extend ( {
@@ -24,6 +23,9 @@ define(
2423 reCaptchaId : 'recaptcha'
2524 } ,
2625
26+ /**
27+ * @inheritdoc
28+ */
2729 initialize : function ( ) {
2830 this . _super ( ) ;
2931 this . _loadApi ( ) ;
@@ -116,7 +118,7 @@ define(
116118 ) ;
117119
118120 if ( parameters . size === 'invisible' && parameters . badge !== 'inline' ) {
119- nonInlineReCaptchaRenderer . add ( $reCaptcha , parameters )
121+ nonInlineReCaptchaRenderer . add ( $reCaptcha , parameters ) ;
120122 }
121123
122124 // eslint-disable-next-line no-undef
@@ -161,6 +163,11 @@ define(
161163 }
162164 } ,
163165
166+ /**
167+ * Validates reCAPTCHA
168+ * @param {* } state
169+ * @returns {jQuery }
170+ */
164171 validateReCaptcha : function ( state ) {
165172 if ( ! this . getIsInvisibleRecaptcha ( ) ) {
166173 return $ ( document ) . find ( 'input[type=checkbox].required-captcha' ) . prop ( 'checked' , state ) ;
@@ -188,5 +195,4 @@ define(
188195 return this . reCaptchaId ;
189196 }
190197 } ) ;
191- }
192- ) ;
198+ } ) ;
0 commit comments