importgetStandardContextfrom'./get_standard_context';exportfunctiondispatchSnowplowEvent(category=document.body.dataset.page,action='generic',data={},){if(!category){/* eslint-disable-next-line @gitlab/require-i18n-strings */thrownewError('Tracking: no category provided for tracking.');}const{label,property,value,extra={}}=data;conststandardContext=getStandardContext({extra});constcontexts=[standardContext];if(data.context){contexts.push(data.context);}returnwindow.snowplow('trackStructEvent',category,action,label,property,value,contexts);}