mw.loader.using( 'ext.visualEditor.targetLoader' ).then( function () { mw.libs.ve.targetLoader.addPlugin( function () { ve.init.mw.TurnstileSaveErrorHandler = function () {}; OO.inheritClass( ve.init.mw.TurnstileSaveErrorHandler, ve.init.mw.SaveErrorHandler ); ve.init.mw.TurnstileSaveErrorHandler.static.name = 'confirmEditTurnstile'; ve.init.mw.TurnstileSaveErrorHandler.static.getReadyPromise = function () { const onLoadFn = 'onTurnstileLoadCallback' + Date.now(); let deferred, config, scriptURL, params; if ( !this.readyPromise ) { deferred = $.Deferred(); config = mw.config.get( 'wgConfirmEditConfig' ); scriptURL = new mw.Uri( config.turnstileScriptURL ); params = { onload: onLoadFn, render: 'explicit' }; scriptURL.query = $.extend( scriptURL.query, params ); this.readyPromise = deferred.promise(); window[ onLoadFn ] = deferred.resolve; mw.loader.load( scriptURL.toString() ); } return this.readyPromise; }; ve.init.mw.TurnstileSaveErrorHandler.static.matchFunction = function ( data ) { const captchaData = ve.getProp( data, 'visualeditoredit', 'edit', 'captcha' ); return !!( captchaData && captchaData.type === 'turnstile' ); }; ve.init.mw.TurnstileSaveErrorHandler.static.process = function ( data, target ) { const self = this, config = mw.config.get( 'wgConfirmEditConfig' ), siteKey = config.turnstileSiteKey, $container = $( '