
$(function(){'use strict';var Captcha={useCaptcha:!window.wgUserSignupDisableCaptcha,init:function(){this.loadCaptcha();},loadCaptcha:function(){if(this.useCaptcha){$.loadReCaptcha().fail(this.handleCaptchaLoadError.bind(this));}},handleCaptchaLoadError:function(){this.loadAndInsertFancyCaptcha();this.trackFailedReCaptcha();},loadAndInsertFancyCaptcha:function(){$.when($.getResources([$.getSassCommonURL('extensions/wikia/Captcha/styles/FancyCaptcha.scss')])).done($.nirvana.sendRequest({controller:'CaptchaController',method:'getFancyCaptcha',type:'GET',callback:function(data){this.insertFancyCaptcha(data);}.bind(this)}));},insertFancyCaptcha:function(data){$('.g-recaptcha').replaceWith(data.form);},trackFailedReCaptcha:function(){Wikia.Tracker.track({action:Wikia.Tracker.ACTIONS.ERROR,category:'captcha',label:'captcha-load-fail',trackingMethod:'analytics',country:Wikia.geo.getCountryCode()});}};Captcha.init();});;