module.exports = "(function(e,t,i){var a=i(5894),n=i(7358),s=i(3888),r=i(843),o=i(9404),c=i(4527),d=i(4438),v=i(5510),u=i(1571),g=i(4810),p=i(2818),l=c.get(\"stores/event_data\"),A=c.get(\"stores/plugins\"),T=c.get(\"stores/rum\"),m=c.get(\"stores/view\"),w=c.get(\"stores/view_data\");t.parseViewTags=function(e){var i=t.evaluateViewTags(e);t.setParsedViewTags(e.id,i)},t.updateAllViewTags=function(){var e=m.getActiveViewStates();a.each(e,(function(e){var i=w.get(e.id);t.parseViewTags(i)}))},t.evaluateViewTags=function(e){return e.tags?a.reduce(e.tags,(function(e,t){try{e[t.apiName]=p.getTagValue(t)}catch(e){i=e,(null!=(a=p.Error)&&\"undefined\"!=typeof Symbol&&a[Symbol.hasInstance]?a[Symbol.hasInstance](i):i instanceof a)?g.warn(\"Page / Ignoring unparseable tag\",t,e):g.error(e)}var i,a;return e}),{}):{}},t.createViewTicket=function(){var e={};return a.each(A.getAllPlugins(d.PluginTypes.viewProviders),(function(t){e[t.provides]=c.evaluate(t.getter)})),e},t.registerViews=function(e){u.dispatch(n.REGISTER_VIEWS,{views:e})},t.activateViaAPI=function(e,i){i&&t.setUserSuppliedViewTags(e.id,i),t.activateMultiple([e],i)},t.getViewsAndActivate=function(e){var i=w.getAllViewsForActivationType(e);t.activateMultiple(i)},t.activateMultiple=function(e,r){var o=[];return a.each(e,(function(e){var c=m.getViewState(e.id),v=t.createViewTicket();(__PROFILE__||__RUM_VERBOSE__)&&i(9256).time(\"setupViewActivation\"),c.isActive;try{if(!t.hasValidStaticConditions(e,v))return a.isBoolean(c.isActive)||t.setViewActiveState(e,!1),g.log(\"Page / Failed to match page conditions for \"+t.description(e),e.staticConditions),void 0}catch(i){return a.isBoolean(c.isActive)||t.setViewActiveState(e,!1),g.error(\"Page / Error evaluating whether to activate page \",t.description(e),i),void 0}if(o.push(e),t.setViewActiveState(e,!0),g.log(\"Activated Page\",t.description(e)),s.emitViewActivated({view:e,metadata:r}),T.getSampleRum()){var p=e.activationType||d.ViewActivationTypes.immediate;u.dispatch(n.RECORD_ACTIVATION_TYPE_USAGE,{activationType:p,entityId:e.id})}var A=l.getByPageId(e.id);t.toggleEventImplementations(A,!0),(__PROFILE__||__RUM_VERBOSE__)&&i(9256).timeEnd(\"setupViewActivation\")})),a.isEmpty(o)||s.emitViewsActivated({views:o}),o},t.deactivate=function(e){if(!m.getViewState(e.id).isActive)return g.log(\"Not deactivating Page, already inactive \",t.description(e)),void 0;t.setViewActiveState(e,!1),g.log(\"Deactivated Page\",t.description(e)),s.emitPageDeactivated({page:e});var i=l.getByPageId(e.id);t.toggleEventImplementations(i,!1)},t.setViewActiveState=function(e,t){u.dispatch(n.SET_VIEW_ACTIVE_STATE,{view:e,timestamp:o.now(),isActive:t})},t.setGlobalTags=function(e){u.dispatch(n.SET_GLOBAL_TAGS,e)},t.setParsedViewTags=function(e,t){u.dispatch(n.UPDATE_PARSED_VIEW_METADATA,{pageId:e,metadata:t})},t.setUserSuppliedViewTags=function(e,t){u.dispatch(n.UPDATE_USER_SUPPLIED_METADATA,{pageId:e,metadata:t})},t.hasValidStaticConditions=function(e,t){var i={};if(a.isEmpty(e.staticConditions))return!0;var s=A.getAllPlugins(d.PluginTypes.viewMatchers);g.groupCollapsed(\"Page / Evaluating staticConditions:\",e.staticConditions),g.debug(\"Matching to current value:\",t);var o=r.evaluate(e.staticConditions,(function(e){var a=e.type,n=s[a];if(!n)throw new Error(\"Page / No matcher found for type=\"+a);return n&&(i[e.type]||(i[e.type]=!0)),n.match(t,e)}));return g.groupEnd(),T.getSampleRum()&&o&&u.dispatch(n.RECORD_VIEW_FEATURE_USAGE,{featuresUsed:a.keys(i),entityId:e.id}),o},t.description=function(e){return'\"'+e.name+'\" ('+e.id+\")\"},t.toggleEventImplementations=function(e,t){a.forEach(e,(function(e){if(e.eventType!==v.CUSTOM){var i=A.getPlugin(d.PluginTypes.eventImplementations,e.eventType);i?t?i.attach(e):i.detach(e):g.warn(\"No implementation found for event type:\",e.eventType,\"needed for event:\",e)}}))},t.isActivationTypeImmediate=function(e){return e===d.ViewActivationTypes.immediate||!e},t.shouldTriggerImmediately=function(e){return e===d.ViewActivationTypes.DOMChanged||e===d.ViewActivationTypes.URLChanged||e===d.ViewActivationTypes.immediate||!e},t.create=function(e,t){var a={id:e,apiName:t,category:\"other\"};return __INVARIANT__&&i(2048).isType(\"View\",a),a},t.createState=function(e){var t={id:e,isActive:!0,metadata:{},parsedMetadata:{},userSuppliedMetadata:{}};return __INVARIANT__&&i(2048).isType(\"ViewState\",t),t}})";