module.exports = "(function(e,t,i){var n=i(5894),a=i(4527).get(\"stores/audience_data\"),d=i(3896),c=i(4021),p=i(6457),v=i(7380);function A(e){var t=[\"type\",\"selector\",\"attributes\",\"value\"],i=n.extend({},e);return i.changeSet=n.map(e.changeSet,(function(e){return n.pick(v.dereferenceChangeId(e),t)})),i}t.emitLayerDecided=function(e){var t=e.decisionTicket?e.decisionTicket.audienceIds:[],p=n.map(t,(function(e){return{id:e,name:a.get(e).name}})),A={type:c.TYPES.LIFECYCLE,name:\"layerDecided\",data:n.extend(e,{audiences:p})};__INVARIANT__&&i(2048).isType(\"LayerDecidedApiEvent\",A);var E=v.translateLayerEventToCampaignEvent(A);__INVARIANT__&&i(2048).isType(\"CampaignDecidedApiEvent\",E),d.emit(A),d.emit(E)},t.emitViewActivated=function(e){var t={type:c.TYPES.LIFECYCLE,name:\"viewActivated\",data:e};__INVARIANT__&&i(2048).isType(\"ViewActivatedApiEvent\",t);var n=v.translateViewActivatedToPageActivated(t);__INVARIANT__&&i(2048).isType(\"PageActivatedApiEvent\",n),d.emit(t),d.emit(n)},t.emitViewsActivated=function(e){var t={type:c.TYPES.LIFECYCLE,name:\"viewsActivated\",data:e};__INVARIANT__&&i(2048).isType(\"ViewsActivatedApiEvent\",t),d.emit(t)},t.emitPageDeactivated=function(e){var t={type:c.TYPES.LIFECYCLE,name:\"pageDeactivated\",data:e};__INVARIANT__&&i(2048).isType(\"PageDeactivatedApiEvent\",t),d.emit(t)},t.emitActivateEvent=function(){d.emit({type:c.TYPES.LIFECYCLE,name:\"activate\"},!0)},t.emitActivatedEvent=function(){d.emit({type:c.TYPES.LIFECYCLE,name:\"activated\"})},t.emitInitializedEvent=function(){var e={type:c.TYPES.LIFECYCLE,name:\"initialized\"};__INVARIANT__&&i(2048).isType(\"InitializedApiEvent\",e),__GLOBAL__&&(__GLOBAL__.initialized=!0),d.emit(e)},t.emitOriginsSyncedEvent=function(){var e={type:c.TYPES.LIFECYCLE,name:\"originsSynced\"};__INVARIANT__&&i(2048).isType(\"OriginsSyncedEvent\",e),d.emit(e)},t.emitActionAppliedEvent=function(e){var t={type:e.type,campaignId:e.layerId,pageId:e.pageId,experimentId:e.experimentId,variationId:e.variationId};p.defineProperty(t,\"changes\",(function(){return A(e).changeSet}),\"actionAppliedEvent\");var n={type:c.TYPES.ACTION,name:\"applied\",data:t};__INVARIANT__&&i(2048).isType(\"ActionAppliedApiEvent\",n),d.emit(n)},t.emitActionsForDecisionAppliedEvent=function(e,t){var a={decision:e};p.defineProperty(a,\"actions\",(function(){return n.map(t,A)}),\"appliedAllForDecisionEvent\");var v={type:c.TYPES.ACTION,name:\"appliedAllForDecision\",data:a};__INVARIANT__&&i(2048).isType(\"ActionsForDecisionAppliedApiEvent\",v),d.emit(v)},t.emitSendEvents=function(){var e={type:c.TYPES.ANALYTICS,name:\"sendEvents\"};__INVARIANT__&&i(2048).isType(\"SendEventsApiEvent\",e),d.emit(e)},t.emitHoldEvents=function(){var e={type:c.TYPES.ANALYTICS,name:\"holdEvents\"};d.emit(e)}})";