{"version":3,"sources":["webpack://mfModules.[name]/./src/mobile.editor.ve/mobile.editor.ve.js","webpack://mfModules.[name]/./src/mobile.editor.ve/schemaVisualEditorFeatureUse.js"],"names":["schemaVisualEditorFeatureUse","require","ve","init","mw","MobileArticleTarget","static","parseSaveError","trackSubscribe","topic","data","track","extendObject","feature","split","editing_session_id","target","overlay","sessionId","module","exports","trackdebug","util","getParamValue","loader","getState","using","then","Schema","eventLog","sampleRate","config","get","event","action","editingSessionId","console","log","apply","arguments"],"mappings":"2LACA,IAAIA,EAA+BC,EAAS,0DAI5CC,GAAGC,KAAKC,GAAGC,oBAAoBC,OAAOC,eACrCN,EAAS,iDAEVD,IAEAE,GAAGM,eAAgB,YAAa,SAAWC,EAAOC,GACjDN,GAAGO,MAAO,kCAAmCT,GAAGU,aAAcF,GAC7DG,QAASJ,EAAMK,MAAO,KAAO,GAE7BC,mBAAoBb,GAAGC,KAAKa,OAAOC,QAAQC,uFCd7CC,EAAOC,QAAU,WAChB,IAAIC,IAAejB,GAAGkB,KAAKC,cAAe,eAEqB,OAA1DnB,GAAGoB,OAAOC,SAAU,kCAA+CJ,IAQxEjB,GAAGoB,OAAOE,OAAS,gCAAkCC,KAAM,WAC1D,IACCC,EAASxB,GAAGyB,SAASD,OACrBE,EAAa1B,GAAG2B,OAAOC,IAAK,0CAK5BhC,EAA+B,IAAI4B,EAClC,yBACAE,GAUF1B,GAAGI,eAAgB,kCAAmC,SAAWC,EAAOC,GACvE,IAAIuB,GACHpB,QAASH,EAAKG,QACdqB,OAAQxB,EAAKwB,OACbC,iBAAkBzB,EAAKK,oBAGnBM,EAdN,WAICe,QAAQC,IAAIC,MAAOF,QAASG,WAW3BF,CAAK5B,EAAOwB,GAEZjC,EAA6BqC,IAAKJ,EACjC7B,GAAG2B,OAAOC,IAAK,yCAC4C,iBAA3D5B,GAAG2B,OAAOC,IAAK,wCAC4C,QAA3D5B,GAAG2B,OAAOC,IAAK,uCACZ,EAAIF","file":"mobile.editor.ve.js","sourcesContent":["/* global ve */\nvar schemaVisualEditorFeatureUse = require( './schemaVisualEditorFeatureUse' );\n\n// FIXME Figure out a way to make this method public on some other class,\n// so that VisualEditor can call it without us overriding it like this\nve.init.mw.MobileArticleTarget.static.parseSaveError =\n\trequire( '../mobile.editor.overlay/parseSaveError' );\n\nschemaVisualEditorFeatureUse();\n// Hook up activity-tracking from VE's system to mobilefrontend's system\nve.trackSubscribe( 'activity.', function ( topic, data ) {\n\tmw.track( 'mf.schemaVisualEditorFeatureUse', ve.extendObject( data, {\n\t\tfeature: topic.split( '.' )[ 1 ],\n\t\t// eslint-disable-next-line camelcase\n\t\tediting_session_id: ve.init.target.overlay.sessionId\n\t} ) );\n} );\n","module.exports = function () {\n\tvar trackdebug = !!mw.util.getParamValue( 'trackdebug' );\n\n\tif ( mw.loader.getState( 'schema.VisualEditorFeatureUse' ) === null && !trackdebug ) {\n\t\treturn;\n\t}\n\n\t// VisualEditorFeatureUse is intended to log whenever EditAttemptStep\n\t// does, so this file references its config for sampling rates and\n\t// oversampling.\n\n\tmw.loader.using( [ 'ext.eventLogging.subscriber' ] ).then( function () {\n\t\tvar // Schema provided by ext.eventLogging.subscriber class\n\t\t\tSchema = mw.eventLog.Schema, // resource-modules-disable-line\n\t\t\tsampleRate = mw.config.get( 'wgWMESchemaEditAttemptStepSamplingRate' ),\n\t\t\t/**\n\t\t\t * Feature use schema\n\t\t\t * https://meta.wikimedia.org/wiki/Schema:VisualEditorFeatureUse\n\t\t\t */\n\t\t\tschemaVisualEditorFeatureUse = new Schema(\n\t\t\t\t'VisualEditorFeatureUse',\n\t\t\t\tsampleRate\n\t\t\t);\n\n\t\tfunction log() {\n\t\t\t// mw.log is a no-op unless resource loader is in debug mode, so\n\t\t\t// this allows trackdebug to work independently (T211698)\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.log.apply( console, arguments );\n\t\t}\n\n\t\tmw.trackSubscribe( 'mf.schemaVisualEditorFeatureUse', function ( topic, data ) {\n\t\t\tvar event = {\n\t\t\t\tfeature: data.feature,\n\t\t\t\taction: data.action,\n\t\t\t\teditingSessionId: data.editing_session_id\n\t\t\t};\n\n\t\t\tif ( trackdebug ) {\n\t\t\t\tlog( topic, event );\n\t\t\t} else {\n\t\t\t\tschemaVisualEditorFeatureUse.log( event, (\n\t\t\t\t\tmw.config.get( 'wgWMESchemaEditAttemptStepOversample' ) ||\n\t\t\t\t\tmw.config.get( 'wgMFSchemaEditAttemptStepOversample' ) === 'visualeditor' ||\n\t\t\t\t\tmw.config.get( 'wgMFSchemaEditAttemptStepOversample' ) === 'all'\n\t\t\t\t) ? 1 : sampleRate );\n\t\t\t}\n\t\t} );\n\n\t} );\n};\n"],"sourceRoot":""}