!(function(e){function t(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)})([(function(e,t,i){function n(){function e(e){var t=i(148),n=[t];n.push(i(150)),n.push(i(156)),n.push(i(159)),n.push(i(162)),n.push(i(164)),n.push(i(173)),n.push(i(176)),n.push(i(179)),n.push(i(183)),n.push(i(186)),n.push(i(190)),n.push(i(194)),n.push(i(198)),n.push(i(203)),n.push(i(204)),n.push(i(207)),n.push(i(208)),n.push(i(213)),n.push(i(214)),p.initializePlugins(n)}function t(e,t,i){return"/dist/preview_data.js?token=__TOKEN__&preview_layer_ids=__PREVIEW_LAYER_IDS__".replace("__TOKEN__",e).replace("__PROJECT_ID__",t).replace("__PREVIEW_LAYER_IDS__",i.join(",")).replace("__GET_ONLY_PREVIEW_LAYERS__",!0)}window.performance&&window.performance.mark&&window.performance.mark("optimizely:blockBegin");var n=i(1);n.initialize();var r=i(83),a=i(23),o=i(16);i(127);var s=o.get("stores/directive"),u=i(87);if(!u.isCORSSupported())throw new Error("CORS is not supported on this browser, aborting.");var c,l=i(129),d=i(116),f=i(130),g={"layers": [{"holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "viewIds": ["20093665037"], "experiments": [{"weightDistributions": [{"entityId": "20099394694", "endOfRange": 10000}], "audienceName": null, "name": null, "bucketingStrategy": null, "variations": [{"id": "20099394694", "actions": [{"viewId": "20093665037", "changes": [{"dependencies": [], "type": "custom_code", "id": "C4B243F7-CD0B-4490-BA9D-FA12D378BEF5", "value": function($){$(document).ready(function() { var $ = window.$; console.log("QA Shared Chat Variation 1 Ready"); console.log("08/23/21 04"); var adId; TT(['context', 'context/ui'], function(ctx) { adId = ctx.adId; }); var content = [ {"adId":"2240173917", "intro": [ "Starting a new Disaster Recovery project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "It sounds like defining my RPO and RTO are critical before moving forward. Help me get my head around this so I can describe it to my team.", "I need a template to help get me started on a DR plan.", "I'm worried we're not prepared. How can I evaluate our ability to recover from a disaster?", "What's the difference between a hot site and cold site for DR?" ], "answers":[ "Yes, defining your recovery objectives is an important step. Here's an article that helps explain these terms and how they fit into a recovery plan.", "We have a free template that could help you get started.", "It's important to test your recovery plan. We have some expert advice that might help put your plan to the test.", "Here's an article that can help describe the difference between hot and cold sites." ] }, {"adId":"4500277568", "intro": [ "Starting a new IoT Device project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "What other IoT concepts should know about before my next meeting?", "What does the future hold for IoT?" ], "answers":[ "Security is critical to any IoT plans. Read our comprehensive definition for IoT security and get up to speed on the latest threats and strategies to protect your network of connected devices.", "Security and privacy remain top concerns, but we expect IoT adoption will continue to grow. Learn more and read about the latest trends here." ] }, {"adId":"1356520", "intro": [ "Starting a new Hybrid Cloud project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "It sounds like hybrid cloud and multi cloud are different concepts. How can I help my team understand the difference and why it matters?", "I'm concerned about managing the cost of my hybrid cloud deployment. How do I manage costs in a hybrid environment?" ], "answers":[ "While these terms are sometimes used interchangeably, there are important distinctions. Read this article to learn more about the differences between hybrid cloud and multi cloud.", "Gone unchecked, cloud spending can spiral out of control. Read this expert tip to learn about cloud cost management tactics that really work." ] }, {"adId":"1249137", "intro": [ "Starting a new Multifactor Authentication project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "I think I will need a multifactor authentication tool to help improve my company's security. How should I get started comparing options?", "It sounds like biometric authentication is growing in popularity. What should I know about this emerging trend?", "Is there anything I can do to set up multifactor authentication to better protect employee laptops and mobile devices at my company right now?" ], "answers":[ "Multifactor authentication can provide some important benefits. Start here by reading more about four of the top multifactor authentication tool providers.", "Yes, many security experts expect to see growing interest in biometric authentication in the coming years. We have a recent article you may be interested in that explains the pros and cons of biometrics in MFA and what's behind this emerging trend.", "If your company uses Office 365 you may be able to enable multifactor authentication for the fleet of end-user devices that you manage. Read this expert tip to learn how to enable MFA for Office 365 on end-user devices." ] }, {"adId":"450427532", "intro": [ "Starting a new Low-code and No-code Development Platforms project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "I'm not sure if a low-code platform would be a good fit for what I need. Are there some examples about what type of apps I can build with these platforms?", "I think a low-code platform might be a good fit for my company, but I need more information about the limitations of these tools." ], "answers":[ "Low-code platforms can help companies develop a range of applications. Learn more by reading about these 9 common low-code use cases.", "As with any technology, low-code platforms can't do it all. Read this expert tip about the potential limitations of low code platforms." ] }, {"adId":"213299", "intro": [ "Starting a new Virtual LAN project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "I now work remotely because of the pandemic, can I use a VLAN to manage my home network traffic?", "How can I set up a VLAN to take advantage of its security benefits?", "I'm a little unclear about the difference between a VLAN and subnet. Can you help me?" ], "answers":[ "VLANs are normally used by businesses, but this expert tip explains how to set up a VLAN to manage home network traffic.", "When constructing a VLAN for security reasons, you could follow several strategies, including the popular department-based VLAN. Find out more in this expert tip", "The terms VLAN and subnet could be used interchangeably, but this article explains the differences between the two technologies." ] }, {"adId":"820947", "intro": [ "Starting a new Business Impact Analysis project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "I've completed a risk analysis for my company. Do I need to do a business impact analysis as well?", "I'd like to get started on the business impact analysis. Is there more information on filling out the BIA template?" ], "answers":[ "The business impact analysis and risk analysis are similar, but they have enough differences that it's valuable to perform both. Here's more information on how the two compare and work together.", "Great! Here's a guide to help you create and document a successful business impact analysis. " ] }, {"adId":"2240036059", "intro": [ "Starting a new Cloud Storage project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "I'm ready to get started with cloud storage. What should I look for in a provider?", "I'd like to use more cloud storage but I'm still concerned about security – should I be?", "What are the differences between cloud backup and cloud storage?" ], "answers":[ "There is a variety of different options for cloud storage, from consumer-oriented platforms such as Dropbox and Google Drive to full-scale infrastructure as a service from the likes of AWS, Microsoft Azure and Google Cloud. Check out this feature that details key questions to ask.", "Cloud storage security has improved over the years, but yes, there are still issues to consider, including access control and cyberthreats. However, we have you covered with a collection of articles that can help you overcome common security challenges.", "The distinction between cloud backup and cloud storage can appear confusing. But don't worry, we have in-depth advice on the clear and important differences between the two." ] }, {"adId":"2240208643", "intro": [ "Starting a new NVMe project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "I love the speed of NVMe but it uses up so much power. How can I overcome that issue?", "I'd like to learn more about the differences between NVMe and SAS interfaces." ], "answers":[ "Thankfully, the NVMe specification provides numerous power management features. Read the best practices here to help with implementation.", "We have you covered: Here's an in-depth look at how NVMe and SAS compare in such areas as performance and scalability." ] }, {"adId":"252443594", "intro": [ "Starting a new Risk Mitigation project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "How can I determine which risks my company faces?", "What's the difference between a risk assessment and a business impact analysis?", "My disaster recovery team is on a budget. Is extensive risk mitigation worth it if a disaster hasn't happened yet?", "Is there a simple way to prioritize my risk mitigation plan?" ], "answers":[ "Risks vary in likelihood and severity for different organizations. Determine your biggest threats with our free risk assessment template.", "Risk assessments and business impact analyses are both key tools for risk mitigation. Read this article to learn more about the differences.", "Don't get caught unprepared when a disaster strikes. Risk assessment costs vary, but are worth the expense. This article explains why they might even save money in the long run.", "A risk map is an easy way to visualize which risks present the biggest threat. Read our comprehensive definition to learn more about what a risk map is and how to create one." ] }, {"adId":"1518281", "intro": [ "Starting a new Incremental Backup project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "How does incremental backup differ from other backup types?", "With so many different types of backup, how do I know incremental is right for my organization?", "My team is backing up to the cloud. Is incremental the right choice for us?", "What's the difference between incremental backups and continuous data protection (CDP)?" ], "answers":[ "Other major backup types include differential, full, synthetic and incremental-forever. This expert tip can help you better understand each one.", "All backup methods have pros and cons. Read our comparison to choose the right one for you.", "It's not always a clear-cut decision. Read this article to learn more about benefits and drawbacks of using incremental backups in the cloud.", "Most CDP platforms work by creating incremental backups. To learn more, read our definition about continuous data protection and how it compares to other types of backup." ] }, {"adId":"752089", "intro": [ "Starting a new Disaster Recovery Plan (DRP) project can be so daunting with so much to consider.", "Now that you have an understanding of what is involved, what's next for you?" ], "questions":[ "Is testing critical to a DRP?", "Ransomware has been a growing threat to my organization. How do I incorporate that into my overall DRP?", "My DR team was unprepared for how COVID-19 affected our organization. How can we work pandemic planning into our DRP?", "A risk assessment and business impact analysis (BIA) look pretty similar. Do I need to do both?" ], "answers":[ "Testing a DR plan will help you ensure that your organization is completely covered in a crisis. This article explains why testing is necessary.", "Ransomware is one of the top DR concerns today, and always evolving. Learn more about how the rise of ransomware should change your thinking about DR plans.", "A pandemic plan can be a separate strategy or worked into an overall disaster recovery plan. Here is a template to help you get started.", "Risk assessments and BIAs serve two different and equally important functions in a DRP. This article outlines their differences." ] } ]; console.log("adId is " + adId); // This is the data from content JSON that we will use var contentN = 0; // Look for match for(var i = 0; i < content.length; i++){ console.log("content.length is " + content.length); if(content[i].adId == adId) { contentN = i; console.log("contentN is " + contentN); } } var questions = content[contentN].questions; var questionsLeft = questions.length; var answers = content[contentN].answers; // This is the beginning structure of the Q&A chat area var structureHTML = '
' + questions[i] + '
' + questions[i] + '
1)for(var i=1;i-1;case"regex":try{if(a&&r){var s=new RegExp(e);return s.test(String(i))}return!1}catch(e){}return!1;case"range":var u=e.split(":"),c=parseFloat(u[0]),l=parseFloat(u[1]),d=parseFloat(i);return d>=c&&d<=l;default:return!1}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22),o=i(23);e.exports={initialize:function(){this.L={actions:{},actionState:{}},this.on(r.DATA_LOADED,this.k),this.on(r.ACTION_EXECUTED,this.F),this.on(r.SET_CHANGE_APPLIER,this.M),this.on(r.REMOVE_ACTION_STATE,this.U)},k:function(e){var t=this;n.isEmpty(e.data.layers)||(n.each(e.data.layers,(function(e){var i;if(e.changes){var r="layerId:"+e.id;i={id:r,layerId:e.id,changeSet:e.changes,type:"layer"},a.deepFreeze(i),t.L.actions[r]=i}n.each(e.experiments,(function(r){if(r.changes){var o="experimentId:"+r.id;i={id:o,layerId:e.id,experimentId:r.id,changeSet:r.changes,type:"experiment"},a.deepFreeze(i),t.L.actions[o]=i}n.each(r.variations,(function(o){n.each(o.actions,(function(n){var s=n.pageId||n.viewId,u=r.id+":"+o.id+":"+s;i={id:u,layerId:e.id,experimentId:r.id,variationId:o.id,pageId:s,changeSet:n.changes,type:"variation"},a.deepFreeze(i),t.L.actions[u]=i}))}))}))})),this.emitChange())},F:function(e){var t=e.actionId;n.isUndefined(t)||this.L.actionState[t]||(this.L.actionState[t]={})},M:function(e){var t=e.actionId,i=e.changeId;return this.L.actionState[t]?void(this.L.actionState[t][i]=e.changeApplier):void o.warn("Action Data / Attempted to set changeApplier for inactive action: ",t)},U:function(e){delete this.L.actionState[e.actionId]},get:function(e){return a.safeReference(this.L.actions[e])},getActionState:function(e){return a.safeReference(this.L.actionState[e])},getByChangeId:function(e){return n.find(this.L.actions,{changeSet:[{id:e}]})},getAllActionIdsByPageId:function(e){return n.map(n.filter(this.L.actions,{pageId:e}),"id")},getChangeApplier:function(e,t){var i=this.L.actionState[t];if(i)return i[e]},getExperimentVariationActions:function(e,t){return a.safeReference(n.filter(this.L.actions,{experimentId:e,variationId:t}))},getLayerActions:function(e){return a.safeReference(n.filter(this.L.actions,{id:"layerId:"+e}))},getExperimentActions:function(e){return a.safeReference(n.filter(this.L.actions,{id:"experimentId:"+e}))},getAll:function(){return a.safeReference(n.values(this.L.actions))}}}),(function(e,t,i){var n=i(2),r=!1;t.deepFreeze=function e(t){r&&n.isObject(t)&&!n.isFunction(t)&&(n.forOwn(t,e),Object.freeze(t))},t.safeReference=function e(t){return r?!n.isObject(t)||n.isFunction(t)||Object.isFrozen(t)?t:n.isArray(t)?n.map(t,e):n.reduce(t,(function(t,i,n){return t[n]=e(i),t}),{}):n.cloneDeep(t)}}),(function(e,t,i){function n(){this.logLevel=null,this.logMatch=null,this.logs=[],this.timebase=o.now()}var r=i(2),a=i(7),o=i(24),s=i(25),u=i(9),c=i(26);n.prototype.G=function(){return!r.isNull(this.logLevel)},n.prototype.setLogLevel=function(e){var t=this.B(e);null===t?console.error("Unknown log level: "+e):this.logLevel!==t&&(this.log("Setting log level to "+t),this.logLevel=t,this.flush())},n.prototype.setLogMatcher=function(e){r.isString(e)?this.logMatcher=e:this.logMatcher="",this.logGroup=0},n.prototype.shouldLog=function(e){return this.G()&&this.logLevel>=e},n.prototype.matchesLogMessage=function(e,t){var i=this.logMatcher;if(!this.logMatcher)return!0;if(this.logGroup)return"GROUPSTART"===e?this.logGroup++:"GROUPEND"===e&&this.logGroup--,!0;var n=r.some(t,(function(e){if(!r.isString(e))try{e=c.stringify(e)}catch(e){}return r.isString(e)&&r.includes(e,i)}));return n&&"GROUPSTART"===e&&this.logGroup++,n},n.prototype.storeLog=function(e,t){var i={logLevel:e,logMessage:t};u.dispatch(a.LOG,i)},n.prototype.flush=function(){var e=i(16),t=e.get("stores/log");this.logGroup=0;var n=t.getLogs();r.each(n,r.bind((function(e){this.z(e.logLevel,e.logMessage,!0)}),this))},n.prototype.z=function(e,t,i){var n,a=e;if(console)switch(e){case"GROUPSTART":n=console.groupCollapsed,a=s.LogLevel.DEBUG;break;case"GROUPEND":n=console.groupEnd,a=s.LogLevel.DEBUG;break;case s.LogLevel.ERROR:n=console.error;break;case s.LogLevel.WARN:n=console.warn;break;case s.LogLevel.DEBUG:n=console.debug;break;default:n=console.log}try{i||this.G()&&!this.shouldLog(a)||(r.isArray(t)&&r.isString(t[0])&&(t=this.j(t)),this.storeLog(e,t)),n&&this.shouldLog(a)&&this.matchesLogMessage(e,t)&&n.apply(console,t)}catch(e){console&&(console.error?console.error(e):console.log(e))}},n.prototype.debug=function(){this.z(s.LogLevel.DEBUG,[].slice.call(arguments))},n.prototype.log=function(){this.z(s.LogLevel.INFO,[].slice.call(arguments))},n.prototype.logAlways=function(){var e=this.j([].slice.call(arguments));console&&console.log&&console.log.apply&&console.log.apply(console,e),this.storeLog(s.LogLevel.INFO,e)},n.prototype.warn=function(){this.z(s.LogLevel.WARN,[].slice.call(arguments))},n.prototype.error=function(e){var t=[].slice.call(arguments);1===t.length&&e.stack?(this.z(s.LogLevel.ERROR,[this.H(),e]),this.z(s.LogLevel.INFO,[e.stack])):this.z(s.LogLevel.ERROR,t)},n.prototype.groupCollapsed=function(){this.z("GROUPSTART",[].slice.call(arguments))},n.prototype.groupEnd=function(){this.z("GROUPEND",[].slice.call(arguments))},n.prototype.j=function(e){var t=this.H().toString();return t.length<6&&(t=(" "+t).slice(-6)),[t+"| Optly / "+e[0]].concat(e.slice(1))},n.prototype.H=function(){return this.timebase?o.now()-this.timebase:0},n.prototype.B=function(e){return e&&(e=e.toUpperCase(),"TRUE"===e&&(e="INFO"),"FALSE"===e&&(e="OFF"),"ALL"===e&&(e="DEBUG"),!r.isUndefined(s.LogLevel[e]))?s.LogLevel[e]:null},e.exports=new n}),(function(e,t){t.now=function(){return+new Date}}),(function(e,t,i){var n=i(2),r=i(8);t.COOKIES={OPT_OUT:"optimizelyOptOut",PREVIEW:"optimizelyPreview",REDIRECT:"optimizelyRedirectData",SESSION_STATE:"optimizelySessionState",TOKEN:"optimizelyToken",VISITOR_ID:"optimizelyEndUserId",VISITOR_UUID:"optimizelyPPID"},t.LayerActivationTypes={CONDITIONAL:"conditional",IMMEDIATE:"immediate",MANUAL:"manual",READY:"ready",TIMEOUT:"timeout"},t.LogLevel={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},t.Lifecycle=r({preActivate:null,postVisitorProfileLoad:null,postViewsActivated:null,postActivate:null}),t.ViewActivationTypes={immediate:"immediate",manual:"manual",callback:"callback",polling:"polling",URLChanged:"url_changed",DOMChanged:"dom_changed"},t.StorageKeys={PENDING_EVENTS:"pending_events",RELAYED_EVENTS:"relayed_events"},t.PluginTypes=r({visitorProfileProviders:null,viewProviders:null,audienceMatchers:null,viewMatchers:null,analyticsTrackers:null,viewTagLocators:null,userFeatureDefs:null,apiModules:null,changeAppliers:null,deciders:null,eventImplementations:null,viewTriggers:null}),t.ResourceTimingAttributes=r({connectStart:null,connectEnd:null,decodedBodySize:null,domainLookupStart:null,domainLookupEnd:null,duration:null,encodedBodySize:null,fetchStart:null,requestStart:null,responseStart:null,responseEnd:null,secureConnectionStart:null,startTime:null,transferSize:null,serverTiming:null}),t.RUMPerformanceTimingAttributes=r({blockTime:null}),t.AttributionTypes=r({FIRST_TOUCH:null,LAST_TOUCH:null}),t.SandboxedFunctions=r({XMLHttpRequest:null}),t.PerformanceData=r({performance_marks:null,resource_timing:null,performance_timing:null}),t.PerformanceCounters=r({mutation_observer_invocation:null,polling_invocation:null,match_selector_invocation:null}),t.VisitorStorageKeys={EVENTS:"events",EVENT_QUEUE:"event_queue",LAYER_MAP:"layer_map",LAYER_STATES:"layer_states",SESSION_STATE:"session_state",VISITOR_PROFILE:"visitor_profile",VARIATION_MAP:"variation_map",TRACKER_OPTIMIZELY:"tracker_optimizely"},t.AllStorageKeys=n.assign({},t.StorageKeys,t.VisitorStorageKeys),t.ListTargetingKeyTypes={COOKIE:"c",QUERY:"q",JS_VARIABLE:"j"},t.VisitorIdLocatorType={COOKIE:"cookie",JS_VARIABLE:"js",LOCALSTORAGE:"localStorage",QUERY:"query"}}),(function(e,t,i){function n(e){var t=[Array.prototype],i=[];r.each(t,(function(e){r.isUndefined(e.toJSON)||(i.push(e.toJSON),delete e.toJSON)}));var n,a;try{n=e()}catch(e){a=e}finally{r.each(i,(function(e,i){t[i].toJSON=e}))}if(a)throw a;return n}var r=i(2);t.stringify=function(){return n(r.bind((function(){return JSON.stringify.apply(null,this)}),arguments))},t.parse=JSON.parse}),(function(e,t,i){var n=i(7);e.exports={initialize:function(){this.L={},this.on(n.REGISTER_ASYNC_DEFERRED,this.K),this.on(n.RESOLVE_DEFERRED,this.Y),this.on(n.REJECT_DEFERRED,this.q)},getRequest:function(e){return this.L[e]},getPromise:function(e){var t=this.getRequest(e);if(t)return t.promise},K:function(e){this.L[e.source]={promise:e.promise,resolver:e.resolver,rejecter:e.rejecter}},Y:function(e){var t=this.getRequest(e.source);if(!t)throw new Error("No request registered for source: "+e.source);t.resolver(e.resolveWith)},q:function(e){var t=this.getRequest(e.source);if(!t)throw new Error("No request registered for source: "+e.source);if(!t.rejecter)throw new Error("No rejecter registered for source: "+e.source);t.rejecter(e.rejectWith)}}}),(function(e,t,i){function n(e,t){return t||(t={}),e?(r.each(e,(function(e){if(!r.isString(e)){if(r.isObject(e)){var i=e.type,a=e.name||"_";t[i]||(t[i]={}),t[i][a]=!0}r.isArray(e)&&n(e,t)}})),t):t}var r=i(2),a=i(7),o=i(22);e.exports={initialize:function(){this.L={audiences:{},featuresNeeded:{}},this.on(a.DATA_LOADED,this.k)},k:function(e){r.isEmpty(e.data.audiences)||(r.each(e.data.audiences,r.bind((function(e){o.deepFreeze(e),r.merge(this.L.featuresNeeded,n(e.conditions)),this.L.audiences[e.id]=e}),this)),this.emitChange())},getAll:function(){return o.safeReference(r.values(this.L.audiences))},getFeaturesNeeded:function(e){return o.safeReference(this.L.featuresNeeded[e]||{})},getAudiencesMap:function(){return o.safeReference(this.L.audiences)},get:function(e){return o.safeReference(this.L.audiences[e])},getAudienceName:function(e){var t=r.find(r.values(this.L.audiences),{id:e});return t.name||"Aud "+e}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22);e.exports={initialize:function(){this.L={},this.on(r.ADD_CHANGE,this.W),this.on(r.DATA_LOADED,this.k)},getChange:function(e){return this.L[e]},k:function(e){n.isEmpty(e.data.changes)||n.each(e.data.changes,n.bind(this.W,this))},W:function(e){a.deepFreeze(e),this.L[e.id]=e,this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(25);e.exports={initialize:function(){this.L={},n.each(a.Lifecycle,n.bind((function(e){this.L[e]=[]}),this)),this.on(r.ADD_CLEANUP_FN,this.X),this.on(r.CLEAR_CLEANUP_FN,this.Q)},getCleanupFns:function(e){return n.cloneDeep(this.L[e])},X:function(e){this.L[e.lifecycle].push(e.cleanupFn),this.emitChange()},Q:function(e){var t=this.L[e.lifecycle];if(e.cleanupFn){var i=t.indexOf(e.cleanupFn);i>-1&&(t.splice(i,1),this.emitChange())}else this.L[e.lifecycle]=[],this.emitChange()}}}),(function(e,t,i){var n=i(7),r=i(32);e.exports={initialize:function(){this.L={name:r.NAME,version:r.VERSION},this.on(n.SET_CLIENT_NAME,this.$),this.on(n.SET_CLIENT_VERSION,this.J)},getClientName:function(){return this.L.name},getClientVersion:function(){return this.L.version},$:function(e){e&&(this.L.name=e),this.emitChange()},J:function(e){e&&(this.L.version=e),this.emitChange()}}}),(function(e,t,i){t.VERSION="0.166.0",t.NAME="js"}),(function(e,t,i){var n=i(7),r=15552e3,a=!0;e.exports={initialize:function(){this.L={currentDomain:null,defaultAgeSeconds:r,autoRefresh:a},this.on(n.SET_COOKIE_DOMAIN,this.Z),this.on(n.SET_COOKIE_AGE,this.ee),this.on(n.SET_COOKIE_AUTO_REFRESH,this.te)},getCurrentDomain:function(){return this.L.currentDomain},getDefaultAgeInSeconds:function(){return this.L.defaultAgeSeconds},getAutoRefresh:function(){return this.L.autoRefresh},Z:function(e){this.L.currentDomain=e,this.emitChange()},ee:function(e){this.L.defaultAgeSeconds=e,this.emitChange()},te:function(e){this.L.autoRefresh=e,this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22);e.exports={initialize:function(){this.L={},this.on(r.DATA_LOADED,this.k)},getAll:function(){return a.safeReference(n.values(this.L))},getEventsMap:function(){return a.safeReference(this.L)},get:function(e){return a.safeReference(this.L[e])},getByApiName:function(e){return a.safeReference(n.find(n.values(this.L),{apiName:e}))},getByPageId:function(e){return a.safeReference(n.filter(this.L,{pageId:e}))},k:function(e){n.isEmpty(e.data.events)||(n.each(e.data.events,n.bind((function(e){e.pageId||(e.pageId=e.viewId),a.deepFreeze(e),this.L[e.id]=e}),this)),this.emitChange())}}}),(function(e,t,i){function n(e){var t=[];return e&&r.isObject(e)?(e.type&&t.push(e.type),t.push(o),e.type&&e.name&&t.push(e.name),t.join("")):o}var r=i(2),a=i(7),o="|";e.exports={initialize:function(){this.L={handlers:{}},this.on(a.ADD_EMITTER_HANDLER,this.ne),this.on(a.REMOVE_EMITTER_HANDLER,this.re)},getHandlers:function(e,t){var i=[null,{type:e.type},{type:e.type,name:e.name}],a=[];return r.each(i,r.bind((function(e){var t=n(e),i=this.L.handlers[t];i&&(a=a.concat(i))}),this)),t&&(a=r.filter(a,(function(e){return!e.publicOnly}))),a},ne:function(e){var t=n(e.filter);this.L.handlers[t]||(this.L.handlers[t]=[]),this.L.handlers[t].push({handler:e.handler,token:e.token,publicOnly:!!e.publicOnly,emitErrors:!!e.emitErrors}),this.emitChange()},re:function(e){var t=!1,i=e.token;r.forOwn(this.L.handlers,r.bind((function(e,n){var a=r.filter(e,(function(e){return e.token!==i}));a.length!==e.length&&(t=!0,this.L.handlers[n]=a)}),this)),t&&this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22);e.exports={initialize:function(){this.L={},this.on(r.DATA_LOADED,this.k)},k:function(e){n.isEmpty(e.data.dimensions)||(n.each(e.data.dimensions,n.bind((function(e){a.deepFreeze(e),this.L[e.id]=e}),this)),this.emitChange())},getAll:function(){return a.safeReference(n.values(this.L))},getById:function(e){return a.safeReference(this.L[e])},getByApiName:function(e){return a.safeReference(n.find(n.values(this.L),{apiName:e}))}}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.L={disabled:!1,forceAudienceIds:[],forceVariationIds:[],alreadyInitialized:!1,mutationObserverAPISupported:!1,isEditor:!1,isPreview:!1,isLegacyPreview:!1,isSlave:!1,previewLayerIds:[],projectToken:null,shouldOptOut:!1,trackingDisabled:!1,isRunningInV2Editor:!1,isRunningInDesktopApp:!1,forceTracking:!1},this.on(r.LOAD_DIRECTIVE,this.ae)},getAll:function(){return n.cloneDeep(this.L)},conflictInObservingChanges:function(){return!this.L.mutationObserverAPISupported},isDisabled:function(){return this.L.disabled},isEditor:function(){return this.L.isEditor},clientHasAlreadyInitialized:function(){return this.L.alreadyInitialized},getForceAudienceIds:function(){return this.L.forceAudienceIds},getForceVariationIds:function(){return this.L.forceVariationIds},getPreviewLayerIds:function(){return this.L.previewLayerIds},getProjectToken:function(){return this.L.projectToken},getForceTracking:function(){return this.L.forceTracking},shouldActivate:function(){return!this.L.isEditor&&!this.isDisabled()},shouldBootstrapDataForPreview:function(){return this.L.isPreview},shouldBootstrapDataForEditor:function(){return this.L.isEditor},shouldInitialize:function(){return!(this.shouldLoadPreview()||this.isDisabled()||this.getProjectToken())},shouldLoadPreview:function(){return!(this.L.isPreview||this.L.isLegacyPreview||!this.getProjectToken()||this.L.isEditor)},shouldBailForDesktopApp:function(){return!this.L.isEditor&&this.L.isRunningInDesktopApp},shouldLoadInnie:function(){return!this.L.isSlave&&!this.L.isEditor&&this.L.isRunningInV2Editor},shouldObserveChangesIndefinitely:function(){return this.L.mutationObserverAPISupported},shouldObserveChangesUntilTimeout:function(){return!this.shouldObserveChangesIndefinitely()},shouldOptOut:function(){return this.L.shouldOptOut},shouldSendTrackingData:function(){return!this.L.trackingDisabled&&(!!this.L.forceTracking||!this.L.isPreview&&n.isEmpty(this.getForceVariationIds())&&n.isEmpty(this.getForceAudienceIds()))},isSlave:function(){return this.L.isSlave},isRunningInDesktopApp:function(){return this.L.isRunningInDesktopApp},isRunningInV2Editor:function(){return this.L.isRunningInV2Editor},ae:function(e){n.extend(this.L,e),this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22);e.exports={initialize:function(){this.L={holdback:0,isGlobalHoldback:null,listTargetingKeys:[],revision:null,projectId:null,accountId:null,namespace:null,activationId:null,activationTimestamp:null,dcpServiceId:null,dcpKeyfieldLocators:[],recommenderServices:[],anonymizeIP:null,projectJS:null,snippetId:null,plugins:[],domContentLoaded:!1,experimental:{}},this.on(r.DATA_LOADED,this.oe),this.on(r.ACTIVATE,this.se),this.on(r.RECORD_GLOBAL_DECISION,this.ue),this.on(r.SET_DOMCONTENTLOADED,this.ce)},getRevision:function(){return this.L.revision},getGlobalHoldbackThreshold:function(){return this.L.holdback},getProjectId:function(){return this.L.projectId},getSnippetId:function(){return this.L.snippetId},getAccountId:function(){return this.L.accountId},getNamespace:function(){return this.L.namespace},getActivationId:function(){return this.L.activationId},getActivationTimestamp:function(){return this.L.activationTimestamp},getAnonymizeIP:function(){return this.L.anonymizeIP},isGlobalHoldback:function(){return!!this.L.isGlobalHoldback},getListTargetingKeys:function(){return this.L.listTargetingKeys.slice()},getDCPServiceId:function(){return this.L.dcpServiceId},getDCPKeyfieldLocators:function(){return this.L.dcpKeyfieldLocators},getRecommenderServices:function(){return this.L.recommenderServices},getProjectJS:function(){return this.L.projectJS},getPlugins:function(){return this.L.plugins},getExperimental:function(){return a.safeReference(this.L.experimental)},domContentLoadedHasFired:function(){return this.L.domContentLoaded},se:function(e){this.L.activationId=e.activationId,this.L.activationTimestamp=e.activationTimestamp,this.L.isGlobalHoldback=null},ue:function(e){var t=e.isGlobalHoldback;if(null!==this.L.isGlobalHoldback&&this.L.isGlobalHoldback!==t)throw new Error("Attempted to change already set global holdback!");this.L.isGlobalHoldback=t,this.emitChange()},oe:function(e){var t=n.pick(e.data,["holdback","accountId","projectId","snippetId","namespace","revision","listTargetingKeys","dcpServiceId","dcpKeyfieldLocators","recommenderServices","anonymizeIP","plugins","projectJS","experimental"]);if(0!==n.keys(t).length){var i={listTargetingKeys:[],dcpServiceId:null,dcpKeyfieldLocators:[]};n.extend(this.L,i,t),this.emitChange()}},ce:function(){this.L.domContentLoaded=!0,this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(40);e.exports={initialize:function(){this.L={originalPushState:null,originalReplaceState:null},this.on(r.ENSURE_ORIGINAL_PUSHSTATE,this.le),this.on(r.ENSURE_ORIGINAL_REPLACESTATE,this.de)},getOriginalPushState:function(){return this.L.originalPushState},getOriginalReplaceState:function(){return this.L.originalReplaceState},le:function(){this.L.originalPushState||(this.L.originalPushState=n.bind(a.getGlobal("history").pushState,a.getGlobal("history")))},de:function(){this.L.originalReplaceState||(this.L.originalReplaceState=n.bind(a.getGlobal("history").replaceState,a.getGlobal("history")))}}}),(function(e,t,i){var n=i(2),r=i(23);t.getUserAgent=function(){return window.navigator.userAgent},t.getLocationSearch=function(){return window.location.search},t.getNavigatorLanguage=function(){return window.navigator.language||window.navigator.userLanguage},t.getHref=function(){return window.location.href},t.getLocation=function(){return window.location},t.setLocation=function(e){window.location.replace(e)},t.setGlobal=function(e,t){window[e]=t},t.getGlobal=function(e){return window[e]},t.getGlobalByPath=function(e){for(var t=e.split("."),i=window;t.length;)try{i=i[t.shift()]}catch(t){throw r.error("Attempted to access nonexistent property. Path ",e),new Error("Attempted to access nonexistent property. Path ",e)}return i},t.addEventListener=function(){return window.addEventListener.apply(window,arguments)},t.removeEventListener=function(){return window.removeEventListener.apply(window,arguments)},t.isMutationObserverAPISupported=function(){return!n.isUndefined(window.MutationObserver)},t.alert=function(e){alert(e)},t.setTimeout=function(e,t){return setTimeout((function(){try{e()}catch(e){r.warn("Deferred function threw error:",e)}}),t)},t.setInterval=function(e,t){return setInterval((function(){try{e()}catch(e){r.warn("Polling function threw error:",e)}}),t)}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.L={},this.on(r.DATA_LOADED,this.k),this.on(r.SET_INTEGRATION_SETTINGS,this.fe)},k:function(e){n.isEmpty(e.data.integrationSettings)||(n.each(e.data.integrationSettings,n.bind((function(e){this.L[e.id]=e}),this)),this.emitChange())},fe:function(e){var t=this.L[e.id];t?n.extend(t,e):this.L[e.id]=e},getAll:function(){return n.cloneDeep(n.values(this.L))},get:function(e){return n.cloneDeep(this.L[e])},getReference:function(e){return this.L[e]}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(23),o="*";e.exports={initialize:function(){this.L={},this.on(r.LOAD_PERSISTED_LAYER_STATES,this.ge),this.on(r.RECORD_LAYER_DECISION,this.pe),this.on(r.RECORD_LAYER_DECISION_EVENT_ID,this.he)},getLayerState:function(e,t){if(this.L[e]){var i=this.L[e];if(n.keys(i).length>1&&!t)throw new Error("View Id must be specified when more than one layerState for layer.");return t?n.cloneDeep(n.find(i,{pageId:t})):n.cloneDeep(i[o])}},getLayerStates:function(e){var t=[];for(var i in this.L)n.forEach(this.L[i],(function(i){(n.isUndefined(e)||i.namespace===e)&&t.push(n.cloneDeep(i))}));return t},getLayerStatesForAnalytics:function(){var e=[];for(var t in this.L)n.forEach(this.L[t],(function(t){e.push(n.pick(t,["layerId","decision","decisionEventId"]))}));return e},ge:function(e){e.merge||(this.L={}), n.each(e.layerStates,n.bind((function(e){var t=e.layerId;e.pageId||(e.pageId=e.viewId);var i=e.pageId||o,r=this.L[t];if(n.isUndefined(r))this.L[t]={},this.L[t][i]=e;else{var a=r[i];(!a||e.decisionTimestamp>(a.decisionTimestamp||0))&&(this.L[t][i]=e)}}),this)),this.emitChange()},pe:function(e){var t={layerId:e.layerId,revision:e.revision,namespace:e.namespace,pageId:e.pageId,decisionTicket:e.decisionTicket,decision:e.decision,decisionActivationId:e.activationId,decisionTimestamp:e.timestamp,decisionEventId:null},i=this.L[e.layerId]||{};e.pageId?(delete i[o],i[e.pageId]=t):(i={},i[o]=t),this.L[e.layerId]=i,this.emitChange()},he:function(e){var t=e.layerId,i=e.pageId||o;return this.L[t]?this.L[t][i]?(this.L[t][i].decisionEventId=e.decisionId,void this.emitChange()):void a.warn("Not recording decision event: Layer state not found for view",i):void a.warn("Not recording decision event: Campaign not registered",t)}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22),o=i(44);e.exports={initialize:function(){this.L={layers:{},experiments:{},variations:{}},this.on(r.DATA_LOADED,this.k)},k:function(e){if(!n.isEmpty(e.data.layers)){var t=this;n.each(e.data.layers,(function(e){n.each(e.experiments,(function(i){e.pageIds||(e.pageIds=e.viewIds),i.campaignName||o.isSingleExperimentPolicy(e.policy)?o.isSingleExperimentPolicy(e.policy)&&e.groupId&&(i.groupId=e.groupId):i.campaignName=e.name,n.each(i.variations,(function(e){n.each(e.actions,(function(e){e.pageId||(e.pageId=e.viewId)})),t.L.variations[e.id]=e})),t.L.experiments[i.id]=i})),a.deepFreeze(e),t.L.layers[e.id]=e})),this.emitChange()}},getAll:function(){return a.safeReference(n.values(this.L.layers))},getCampaignsMap:function(){return a.safeReference(this.L.layers)},getExperimentsMap:function(){return a.safeReference(this.L.experiments)},getVariationsMap:function(){return a.safeReference(this.L.variations)},getCount:function(){return n.keys(this.L.layers).length},getAllByPageIds:function(e){return a.safeReference(n.filter(this.L.layers,(function(t){return n.some(e,n.partial(n.includes,t.pageIds))})))},get:function(e){return a.safeReference(this.L.layers[e])},getLayerByExperimentId:function(e){var t=n.find(this.L.layers,(function(t){return n.find(t.experiments,{id:e})}));return a.safeReference(t)},getExperimentByVariationId:function(e){var t;return n.some(this.L.layers,(function(i){return n.some(i.experiments,(function(i){return n.find(i.variations,{id:e})&&(t=i),t})),t})),a.safeReference(t)}}}),(function(e,t){var i="single_experiment",n="multivariate";t.isSingleExperimentPolicy=function(e){return e===i||e===n}}),(function(e,t,i){var n=i(7);e.exports={initialize:function(){this.L={logs:[]},this.on(n.LOG,this._e)},getLogs:function(){return this.L.logs},_e:function(e){this.L.logs.push(e),this.emitChange()},R:function(){return this.L.logs.slice()}}}),(function(e,t,i){var n=i(7),r=i(22);e.exports={initialize:function(){this.L={data:null,hasTracked:null},this.on(n.LOAD_REDIRECT_DATA,this.ve),this.on(n.REGISTER_TRACKED_REDIRECT_DATA,this.Ee)},get:function(){return r.safeReference(this.L.data)},hasTracked:function(){return this.L.hasTracked},ve:function(e){r.deepFreeze(e),this.L.data=e,this.L.hasTracked=!1,this.emitChange()},Ee:function(){this.L.hasTracked=!0}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(26),o=1e3;e.exports={initialize:function(){this.L={},this.on(r.SET_PENDING_EVENT,this.me),this.on(r.REMOVE_PENDING_EVENT,this.Ie),this.on(r.LOAD_PENDING_EVENTS,this.ye)},getEvents:function(){return this.L},getEventsString:function(){return a.stringify(this.L)},me:function(e){n.keys(this.L).length>=o&&this.Se();var t=e.id,i=e.retryCount;this.L[t]&&this.L[t].retryCount===i||(this.L[t]={id:t,timeStamp:e.timeStamp,data:e.data,retryCount:i},this.emitChange())},Ie:function(e){delete this.L[e.id],this.emitChange()},ye:function(e){this.L=e.events,this.Se(),this.emitChange()},Se:function(){for(var e=n.sortBy(this.L,"timeStamp"),t=0;t<=e.length-o;t++)delete this.L[e[t].id];this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(25);e.exports={initialize:function(){this.L={},this.L[a.PerformanceData.performance_marks]={},this.on(r.SET_PERFORMANCE_MARKS_DATA,this.Te)},Te:function(e){n.isUndefined(this.L[a.PerformanceData.performance_marks][e.name])&&(this.L[a.PerformanceData.performance_marks][e.name]=[]),this.L[a.PerformanceData.performance_marks][e.name].push(e.data),this.emitChange()},getMarks:function(){return n.mapValues(this.L[a.PerformanceData.performance_marks],(function(e){return n.map(e,(function(e){return[e.startTime,e.duration]}))}))},getDurationsFor:function(e){return n.reduce(e,n.bind((function(e,t){var i=this.L[a.PerformanceData.performance_marks][t];return i&&(e[t]=Math.round(n.reduce(i,(function(e,t){return e+t.duration}),0))),e}),this),{})}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(25),o=i(23);e.exports={initialize:function(){this.L=n.mapValues(a.PluginTypes,(function(){return{}})),this.on(r.REGISTER_PLUGIN,this.Ae)},Ae:function(e){var t=e.type,i=e.name,n=e.plugin;if(!t||!i)throw new Error("Missing information needed to register plugins: "+t+":"+i);if(!this.L[t])throw new Error("Invalid plugin type specified: "+t);this.L[t][i]=n,o.debug("Plugin Store: Registering Plugin :",e)},getAllPlugins:function(e){if(e){if(this.L[e])return this.L[e];throw new Error("Invalid plugin type: "+e)}return this.L},getPlugin:function(e,t){if(!t||!e)throw new Error("Missing plugin parameters");var i=this.getAllPlugins(e);return i[t]||null}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(19);e.exports={initialize:function(){this.L={},this.on(r.SET_VISITOR_ATTRIBUTE_PENDING,this.we)},getPendingAttributeValue:function(e){return e=n.isArray(e)?e.concat("pending"):[e,"pending"],a.getFieldValue(this.L,e)},we:function(e){a.setFieldValue(this.L,e.key,{pending:e.pending}),this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.L={layerId:null},this.on(r.ANNOUNCE_PENDING_REDIRECT,this.ve)},isExpectingRedirect:function(){return n.isString(this.L.layerId)},getLayerId:function(){return this.L.layerId},ve:function(e){this.isExpectingRedirect()||(this.L.layerId=e.layerId,this.emitChange())}}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.L={inRumSample:!1,id:null,src:null,RumHost:null,data:{extras:{}},apis:{},DOMObservation:{},featuresNeeded:{}},this.on(r.SET_RUM_DATA,this.Re),this.on(r.RECORD_API_USAGE,this.De),this.on(r.INITIALIZE_CHANGE_METRICS,this.be),this.on(r.RECORD_ACTIVATION_TYPE_USAGE,this.Oe),this.on(r.RECORD_AUDIENCE_USAGE,this.Ne),this.on(r.RECORD_CHANGE_MACROTASK_RATE,this.Ce),this.on(r.RECORD_CHANGE_OVERHEATED,this.Pe),this.on(r.RECORD_CHANGE_TYPE_USAGE,this.Le),this.on(r.RECORD_DOM_OBSERVATION_OCCURENCE,this.Ve),this.on(r.RECORD_INTEGRATION_USAGE,this.ke),this.on(r.RECORD_LAYER_FEATURE_USAGE,this.xe),this.on(r.RECORD_LAYER_POLICY_USAGE,this.Fe),this.on(r.RECORD_VIEW_FEATURE_USAGE,this.Me),this.on(r.RECORD_VIEWS_INITIALLY_ACTIVATED_COUNT,this.Ue),this.on(r.RECORD_VISITOR_ID_LOCATOR_USAGE,this.Ge),this.on(r.RECORD_VISITOR_ID_ERROR,this.Be),this.on(r.RECORD_STICKY_BUCKETING_FEATURE,this.ze)},Re:function(e){n.merge(this.L,e),this.emitChange()},De:function(e){this.L.apis[e.methodName]||(this.L.apis[e.methodName]=0),this.L.apis[e.methodName]++,this.emitChange()},be:function(){n.isUndefined(this.L.data.extras.changeMacrotaskRate)&&(this.L.data.extras.changeMacrotaskRate=0),n.isUndefined(this.L.data.extras.numOverheatedChanges)&&(this.L.data.extras.numOverheatedChanges=0)},Ce:function(e){n.isUndefined(this.L.data.extras.changeMacrotaskRate)&&(this.L.data.extras.changeMacrotaskRate=0),e.changeMacrotaskRate>this.L.data.extras.changeMacrotaskRate&&(this.L.data.extras.changeMacrotaskRate=e.changeMacrotaskRate),this.emitChange()},Pe:function(){n.isUndefined(this.L.data.extras.numOverheatedChanges)&&(this.L.data.extras.numOverheatedChanges=0),this.L.data.extras.numOverheatedChanges++,this.emitChange()},Ve:function(e){this.L.DOMObservation[e.counterName]||(this.L.DOMObservation[e.counterName]=0),this.L.DOMObservation[e.counterName]++,this.emitChange()},je:function(e,t,i){n.isUndefined(this.L.featuresNeeded[e])&&(this.L.featuresNeeded[e]={});var r=this.L.featuresNeeded[e];n.each(t,(function(e){r[e]||(r[e]={}),r[e][i]||(r[e][i]=!0)}))},ke:function(e){this.je("integrations",e.integrations,e.layerId)},Le:function(e){this.je("changeTypes",e.changeTypes,e.layerId)},Oe:function(e){this.je("activationTypes",[e.activationType],e.entityId),this.emitChange()},Me:function(e){this.je("viewFeatures",e.featuresUsed,e.entityId),this.emitChange()},xe:function(e){this.je("layerFeatures",[e.feature],e.entityId),this.emitChange()},Fe:function(e){this.je("policy",[e.policy],e.layerId),this.emitChange()},Ne:function(e){this.je("audiences",e.audienceTypes,e.layerId),this.emitChange()},Ue:function(e){this.L.data.extras.viewsInitiallyActivatedCount=e.viewsInitiallyActivatedCount,this.emitChange()},Ge:function(e){this.je("visitorIdLocatorType",[e.visitorIdLocatorType],e.entityId),this.emitChange()},Be:function(e){this.L.data.extras.errorCustomVisitorId=e.isError,this.emitChange()},ze:function(e){this.je("stickyBucketing",[e.feature],e.id)},getSampleRum:function(){return this.L.inRumSample},getRumId:function(){return this.L.id},getRumHost:function(){return this.L.RumHost},getApiData:function(){return this.L.apis},getDOMObservationData:function(){return this.L.DOMObservation},getRumData:function(){return n.cloneDeep(this.L.data)},getScriptSrc:function(){return this.L.src},getFeaturesNeededData:function(){var e=this.L.featuresNeeded,t={};return n.forOwn(e,(function(e,i){var r=n.keys(e);n.isEmpty(r)||(t[i]={}),n.forEach(r,(function(r){t[i][r]=n.keys(e[r]).length}))})),t}}}),(function(e,t,i){var n=i(7);e.exports={initialize:function(){this.L={initialized:!1,natives:{}},this.on(n.SANDBOXED_FUNCTIONS_ADDED,this.He)},He:function(e){if(!e.sandboxedFunctions)throw new Error("No sandboxedFunctions found in payload");this.L.natives=e.sandboxedFunctions,this.L.initialized=!0,this.emitChange()},getAll:function(){return this.L.natives},get:function(e){if(!e)throw new Error("Missing name parameter");return this.L.natives[e]||null},isInitialized:function(){return this.L.initialized}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(24),o=i(5),s=18e5;e.exports={initialize:function(){this.L={lastSessionTimestamp:0,sessionId:null},this.on(r.REFRESH_SESSION,this.Ke),this.on(r.LOAD_SESSION_STATE,this.Ye)},getState:function(){return n.cloneDeep(this.L)},getSessionId:function(){return this.L.sessionId},Ye:function(e){this.L.sessionId=e.sessionId,this.L.lastSessionTimestamp=e.lastSessionTimestamp,this.emitChange()},Ke:function(){var e=a.now(),t=this.L.lastSessionTimestamp;(!this.L.sessionId||e-t>s)&&(this.L.sessionId=o.generate()),this.L.lastSessionTimestamp=e,this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.qe(),this.on(r.FINALIZE_BATCH_SNAPSHOT,this.We),this.on(r.REGISTER_PREVIOUS_BATCH,this.Xe),this.on(r.REGISTER_TRACKER_VISITOR,this.Qe),this.on(r.REGISTER_TRACKER_EVENT,this.$e),this.on(r.REGISTER_TRACKER_DECISION,this.Je),this.on(r.RESET_TRACKER_EVENTS,this.Ze),this.on(r.RESET_TRACKER_STORE,this.qe),this.on(r.RESET_TRACKER_PREVIOUS_BATCHES,this.et),this.on(r.SET_TRACKER_POLLING,this.tt),this.on(r.SET_TRACKER_BATCHING,this.it),this.on(r.SET_TRACKER_SEND_EVENTS,this.nt),this.on(r.SET_TRACKER_PERSISTABLE_STATE,this.rt),this.on(r.SET_TRACKER_DIRTY,this.at),this.on(r.UPDATE_TRACKER_VISITOR_ATTRIBUTES,this.ot)},getPersistableState:function(){return this.L.isDirty?this.hasEventsToSend()||this.hasPreviousBatchesToSend()?{data:this.L.data,decisions:this.L.decisions,decisionEvents:this.L.decisionEvents,previousBatches:this.L.previousBatches}:{}:null},rt:function(e){n.isEmpty(this.L.data)||n.isEmpty(e.data)||(this.We(),this.L.previousBatches.push(this.getEventBatch())),this.L.data=e.data||{},this.L.decisions=e.decisions||[],this.L.decisionEvents=e.decisionEvents||[],n.isEmpty(this.L.previousBatches)||n.isEmpty(e.previousBatches)?this.L.previousBatches=e.previousBatches||[]:this.L.previousBatches=this.L.previousBatches.concat(e.previousBatches),this.emitChange()},at:function(e){this.L.isDirty=e,this.emitChange()},$e:function(e){var t=this.st();!n.isEmpty(t.snapshots)&&n.isEmpty(this.L.decisionEvents)||this.ut(),this.ct().events.push(e.event),this.L.decisions=e.decisions,this.at(!0)},Je:function(e){this.L.decisionEvents.push(e.decisionEvent),this.L.decisions=e.decisions,this.at(!0)},Qe:function(e){n.isEmpty(this.L.data)?this.L.data=e.data:this.We(),this.L.data.visitors.push(e.visitor),this.L.decisions=e.decisions,this.L.decisionEvents=[],this.at(!0)},Xe:function(e){this.L.previousBatches.push(e),this.at(!0)},qe:function(){this.L={polling:!1,shouldBatch:!0,data:{},decisions:[],decisionEvents:[],canSend:!1,isDirty:!1,previousBatches:[]},this.emitChange()},Ze:function(){var e=this.st();this.L.data.visitors=[e],e.snapshots=[],this.at(!0)},et:function(){this.L.previousBatches=[],this.at(!0)},tt:function(e){this.L.polling=e,this.emitChange()},it:function(e){this.L.shouldBatch=e,this.emitChange()},nt:function(e){this.L.canSend=e,this.emitChange()},getEventBatch:function(){return n.cloneDeep(this.L.data)},getPreviousBatches:function(){return n.cloneDeep(this.L.previousBatches)},dt:function(){return this.L.decisionEvents.slice()},ft:function(){this.L.decisionEvents=[]},pt:function(){return this.L.decisions.slice()},isPolling:function(){return this.L.polling},shouldBatch:function(){return this.L.shouldBatch},ct:function(){return n.last(this.st().snapshots)},st:function(){return n.last(this.L.data.visitors)},ut:function(){var e=this.dt(),t=this.st();t.snapshots.push({decisions:this.pt(),events:e}),this.ft(),this.at(!0)},We:function(){this.L.decisionEvents.length>0&&this.ut()},hasEventsToSend:function(){if(!n.isEmpty(this.L.decisionEvents))return!0;if(!n.isEmpty(this.L.data)){var e=n.some(this.L.data.visitors||[],(function(e){return e.snapshots.length>0}));if(e)return!0}return!1},hasPreviousBatchesToSend:function(){return!n.isEmpty(this.L.previousBatches)},canSend:function(){return this.L.canSend},ot:function(e){var t=this.st();t&&(t.attributes=e.attributes)}}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.L={},this.on(r.SET_UA_DATA,this.k)},k:function(e){n.isEmpty(this.L)&&(this.L=e.data)},get:function(){return n.cloneDeep(this.L)}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(23),o=!0,s={globalTags:{},viewStates:{},shouldBatch:!1};e.exports={initialize:function(){this.L=n.cloneDeep(s),this.on(r.REGISTER_VIEWS,this.ht),this.on(r.SET_VIEW_ACTIVE_STATE,this._t),this.on(r.UPDATE_PARSED_VIEW_METADATA,this.vt),this.on(r.UPDATE_USER_SUPPLIED_METADATA,this.Et),this.on(r.TRACK_VIEW_ACTIVATED_EVENT,this.mt),this.on(r.SET_GLOBAL_TAGS,this.It),this.on(r.RESET_VIEW_STATES,this.yt),this.on(r.SET_VIEW_BATCHING,this.it)},getAll:function(){var e={};for(var t in this.L.viewStates)e[t]=this.getViewState(t);return e},shouldBatch:function(){return this.L.shouldBatch},getViewState:function(e){var t=n.cloneDeep(this.L.viewStates[e]),i=this.L.globalTags;return t.metadata=n.extend({},t.parsedMetadata,i,t.userSuppliedMetadata),t},getActiveViewTags:function(){var e=this.getActiveViewStates(),t=n.map(e,(function(e){return e.metadata})),i=[{}].concat(t);return n.extend.apply(n,i)},getActivationEventId:function(e){return this.L.viewStates[e]?this.L.viewStates[e].activationEventId:null},getActiveViewStates:function(){return n.reduce(this.L.viewStates,n.bind((function(e,t,i){return this.isViewActive(i)&&e.push(this.getViewState(i)),e}),this),[])},isViewActive:function(e){var t=this.L.viewStates[e];return t||a.warn("No Page registered with id",e),!!t.isActive},getGlobalTags:function(){return n.cloneDeep(this.L.globalTags)},yt:function(){this.L.viewStates={},this.emitChange()},ht:function(e){n.each(e.views,n.bind((function(e){var t=e.id;o&&this.L.viewStates[t]||(this.L.viewStates[t]={id:t,isActive:n.isBoolean(e.isActive)?e.isActive:null,activatedTimestamp:null,activationEventId:null,parsedMetadata:{},userSuppliedMetadata:{}})}),this)),this.emitChange()},_t:function(e){var t=e.view.id;if(!this.L.viewStates[t])throw new Error("No view exists with id "+t);this.L.viewStates[t].isActive=e.isActive,e.isActive?this.L.viewStates[t].activatedTimestamp=e.timestamp:(this.L.viewStates[t].parsedMetadata={},this.L.viewStates[t].userSuppliedMetadata={}),this.emitChange()},vt:function(e){var t=e.pageId;if(!this.L.viewStates[t])throw new Error("No view exists with id "+t);n.assign(this.L.viewStates[t].parsedMetadata,e.metadata),this.emitChange()},Et:function(e){var t=e.pageId;if(!this.L.viewStates[t])throw new Error("No view exists with id "+t);n.assign(this.L.viewStates[t].userSuppliedMetadata,e.metadata),this.emitChange()},mt:function(e){var t=e.pageId;this.L.viewStates[t]&&(this.L.viewStates[t].activationEventId=e.eventData.eventId,this.emitChange())},It:function(e){n.extend(this.L.globalTags,e),this.emitChange()},it:function(e){this.L.shouldBatch=e,this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22);e.exports={initialize:function(){this.L={views:{},apiNamesToViews:{}},this.on(r.DATA_LOADED,this.k)},getAll:function(){return a.safeReference(n.values(this.L.views))},getPagesMap:function(){return a.safeReference(this.L.views)},get:function(e){return a.safeReference(this.L.views[e])},getByApiName:function(e){return a.safeReference(this.L.apiNamesToViews[e])},apiNameToId:function(e){var t=this.L.apiNamesToViews[e];if(t)return t.id},idToApiName:function(e){var t=this.L.views[e];if(t)return t.apiName},getNumberOfPages:function(){return n.keys(this.L.views).length},getAllViewsForActivationType:function(e){return n.filter(this.L.views,{activationType:e})},k:function(e){n.isEmpty(e.data.views)||(n.each(e.data.views,n.bind((function(e){a.deepFreeze(e),this.L.views[e.id]=e,this.L.apiNamesToViews[e.apiName]=e}),this)),this.emitChange())}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(19);e.exports={initialize:function(){this.L={profile:{},metadata:{},visitorId:null},this.on(r.SET_VISITOR_ID_VIA_API,this.St),this.on(r.SET_VISITOR_ATTRIBUTES,this.Tt),this.on(r.LOAD_EXISTING_VISITOR_PROFILE,this.At)},getVisitorProfile:function(){return this.L.profile},getVisitorProfileMetadata:function(){return this.L.metadata},getAttribute:function(e){var t=this.L.profile;return n.cloneDeep(a.getFieldValue(t,e))},getAttributeMetadata:function(e){return n.cloneDeep(this.L.metadata[e])},getVisitorIdFromAPI:function(){return this.L.visitorId},At:function(e){this.L.profile=e.profile,this.L.metadata=e.metadata,this.emitChange()},Tt:function(e){n.each(e.attributes,n.bind((function(e){var t=e.key;a.setFieldValue(this.L.profile,t,e.value),e.metadata&&n.forOwn(e.metadata,n.bind((function(e,i){a.setFieldValue(this.L.metadata,t.concat(i),e)}),this))}),this)),this.emitChange()},St:function(e){this.L.visitorId=e,this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.L={},this.on(r.DATA_LOADED,this.wt)},getCustomBehavioralAttributes:function(){return n.filter(this.L,(function(e){return!!e.rule_json}))},getVisitorAttribute:function(e){var t=n.values(this.L);if(e.datasourceId&&(t=n.filter(t,{dcp_datasource_id:String(e.datasourceId)})),e.attributeName&&e.attributeId)throw new Error("Must not specify both attribute name and attribute ID");if(e.attributeId){var i=this.L[e.attributeId];if(!i)throw new Error("Unrecognized attribute ID: "+e.attributeId);return i}if(e.attributeName){var r=n.filter(t,{name:e.attributeName});if(!r.length)throw new Error("Unrecognized attribute name: "+e.attributeName);if(r.length>1)throw new Error("Too many attributes with name: "+e.attributeName);return r[0]}throw new Error("Must specify attribute name or attribute ID")},wt:function(e){n.isEmpty(e.data.visitorAttributes)||(n.each(e.data.visitorAttributes,n.bind((function(e){this.L[e.id]=e}),this)),this.emitChange())}}}),(function(e,t,i){var n=(i(2),i(7));i(62).Event;e.exports={initialize:function(){this.L={events:[],foreignEvents:{},foreignEventQueues:{}},this.on(n.SET_VISITOR_EVENTS,this.k),this.on(n.SET_FOREIGN_VISITOR_EVENTS,this.Rt),this.on(n.SET_FOREIGN_VISITOR_EVENT_QUEUE,this.Dt)},getEvents:function(){return this.L.events},getForeignEvents:function(){return this.L.foreignEvents},getForeignEventQueues:function(){return this.L.foreignEventQueues},k:function(e){this.L.events=e,this.emitChange()},Rt:function(e){this.L.foreignEvents[e.key]=e.value},Dt:function(e){this.L.foreignEventQueues[e.key]=e.value}}}),(function(e,t,i){function n(e,t,i,n,r){this[o.FIELDS.NAME]=e,this[o.FIELDS.TYPE]=t,a.isString(i)&&i.trim().length>0&&(this[o.FIELDS.CATEGORY]=i),n&&a.keys(n).length>0&&(this[o.FIELDS.OPTIONS]=n),a.isUndefined(r)||(this[o.FIELDS.REVENUE]=r)}function r(e,t,i,n){this.eventBase=e,this[o.FIELDS.TIME]=t,a.isUndefined(i)||(this[o.FIELDS.SESSION_ID]=i),a.isUndefined(n)||(this[o.FIELDS.SESSION_INDEX]=n)}var a=i(2),o=i(63),s=i(19).getFieldValue,u=i(64);t.EventBase=n,n.prototype.digest=function(){var e=function(e,t){return encodeURIComponent(e)+"="+encodeURIComponent(t)},t=[];if(t.push(e(o.FIELDS.NAME,this[o.FIELDS.NAME])),t.push(e(o.FIELDS.TYPE,this[o.FIELDS.TYPE])),this[o.FIELDS.CATEGORY]&&t.push(e(o.FIELDS.CATEGORY,this[o.FIELDS.CATEGORY])),this[o.FIELDS.REVENUE]&&t.push(e(o.FIELDS.REVENUE,this[o.FIELDS.REVENUE])),!this[o.FIELDS.OPTIONS])return t.join("&");var i=this[o.FIELDS.OPTIONS]||{},n=a.filter(a.keys(i),(function(e){return i.hasOwnProperty(e)}));n=n.sort();for(var r=0;r >>16).toString(16)+(65535&i).toString(16)},u=function(e,t){var i=n(e,t);return(i>>>0)/a},c=function(e){var t=String.fromCharCode;return e.replace(/[\S\s]/gi,(function(e){e=e.charCodeAt(0);var i=t(255&e);return e>255&&(i=t(e>>>8&255)+i),e>65535&&(i=t(e>>>16)+i),i}))};e.exports={Seed:r,hashToHex:s,hashToInt:o,hashToReal:u,toByteString:c}}),(function(e,t,i){!(function(){function t(e,t){for(var i,n=e.length,r=t^n,a=0;n>=4;)i=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24,i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16),i^=i>>>24,i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^i,n-=4,++a;switch(n){case 3:r^=(255&e.charCodeAt(a+2))<<16;case 2:r^=(255&e.charCodeAt(a+1))<<8;case 1:r^=255&e.charCodeAt(a),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)}return r^=r>>>13,r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16),r^=r>>>15,r>>>0}function i(e,t){var i,n,r,a,o,s,u,c;for(i=3&e.length,n=e.length-i,r=t,o=3432918353,s=461845907,c=0;c >>16)*o&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u,r=r<<13|r>>>19,a=5*(65535&r)+((5*(r>>>16)&65535)<<16)&4294967295,r=(65535&a)+27492+(((a>>>16)+58964&65535)<<16);switch(u=0,i){case 3:u^=(255&e.charCodeAt(c+2))<<16;case 2:u^=(255&e.charCodeAt(c+1))<<8;case 1:u^=255&e.charCodeAt(c),u=(65535&u)*o+(((u>>>16)*o&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u}return r^=e.length,r^=r>>>16,r=2246822507*(65535&r)+((2246822507*(r>>>16)&65535)<<16)&4294967295,r^=r>>>13,r=3266489909*(65535&r)+((3266489909*(r>>>16)&65535)<<16)&4294967295,r^=r>>>16,r>>>0}var n=i;n.v2=t,n.v3=i;e.exports=n})()}),(function(e,t,i){var n=i(7);e.exports={initialize:function(){this.L={baseMap:{},eventQueue:[],lastEvent:null,initialized:!1,cleared:!1},this.on(n.UPDATE_BEHAVIOR_STORE,this.bt)},getBaseMap:function(){return this.L.baseMap},getEventQueue:function(){return this.L.eventQueue},getLastEvent:function(){return this.L.lastEvent},getCleared:function(){return this.L.cleared},getInitialized:function(){return this.L.initialized},bt:function(e){this.L[e.key]=e.value}}}),(function(e,t,i){var n=i(2),r=i(7);e.exports={initialize:function(){this.L={randomId:null,visitorIdLocator:null},this.on(r.SET_VISITOR_ID,this.k),this.on(r.DATA_LOADED,this.Ot)},getBucketingId:function(){return this.getRandomId()},getRandomId:function(){return this.L.randomId},getVisitorIdLocator:function(){return this.L.visitorIdLocator},k:function(e){n.extend(this.L,e),this.emitChange()},Ot:function(e){n.isEmpty(e.data.visitorIdLocator)||(this.L.visitorIdLocator=e.data.visitorIdLocator,this.emitChange())}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(26);e.exports={initialize:function(){this.L={variationIdMap:{},preferredLayerMap:{}},this.on(r.UPDATE_VARIATION_ID_MAP,this.Nt),this.on(r.MERGE_VARIATION_ID_MAP,this.Ct),this.on(r.UPDATE_PREFERRED_LAYER_MAP,this.Pt),this.on(r.MERGE_PREFERRED_LAYER_MAP,this.Lt)},getVariationIdMap:function(){return n.cloneDeep(this.L.variationIdMap)},getVariationIdMapString:function(){return a.stringify(this.L.variationIdMap)},Nt:function(e){var t=this.L.variationIdMap,i=t[e.layerId]||{};i[e.experimentId]!==e.variationId&&(i[e.experimentId]=e.variationId,this.L.variationIdMap[e.layerId]=i,this.emitChange())},Ct:function(e){var t=this.getVariationIdMap(),i=e.variationIdMap;n.each(t||{},(function(e,t){i[t]?n.assign(i[t],e):i[t]=e})),this.L.variationIdMap=i,this.emitChange()},getPreferredLayerMap:function(){return n.cloneDeep(this.L.preferredLayerMap)},getPreferredLayerMapString:function(){return a.stringify(this.L.preferredLayerMap)},getPreferredLayerId:function(e){return this.L.preferredLayerMap[e]},Pt:function(e){this.L.preferredLayerMap[e.groupId]!==e.layerId&&(this.L.preferredLayerMap[e.groupId]=e.layerId,this.emitChange())},Lt:function(e){var t=this.getPreferredLayerMap(),i=e.preferredLayerMap;n.assign(i,t),this.L.preferredLayerMap=i,this.emitChange()}}}),(function(e,t,i){var n=i(2),r=i(23),a=i(7),o=1e3;e.exports={initialize:function(){this.L={frames:[],defaultFrame:null,messages:[],subscribers:[],canonicalOrigins:null,disabled:!1},this.on(a.XDOMAIN_SET_DEFAULT_FRAME,this.Vt),this.on(a.XDOMAIN_ADD_FRAME,this.kt),this.on(a.XDOMAIN_SET_MESSAGE,this.xt),this.on(a.XDOMAIN_ADD_SUBSCRIBER,this.Ft),this.on(a.XDOMAIN_SET_CANONICAL_ORIGINS,this.Mt),this.on(a.XDOMAIN_SET_DISABLED,this.Ut)},getMessages:function(){return n.cloneDeep(this.L.messages)},getOffset:function(){return 0===this.L.messages.length?0:this.L.messages[0].data.id},getNextMessageId:function(){return this.L.messages.length+this.getOffset()},getMessageById:function(e){return this.L.messages[e-this.getOffset()]},getSubscribers:function(){return this.L.subscribers},getFrames:function(){return this.L.frames},getNextFrameId:function(){return this.L.frames.length},getDefaultFrame:function(){return this.L.defaultFrame},getCanonicalOrigins:function(){return n.cloneDeep(this.L.canonicalOrigins)},isDisabled:function(){return this.L.disabled},Vt:function(e){this.L.defaultFrame=e},kt:function(e){this.L.frames.push(e)},xt:function(e){for(this.L.messages[e.messageId-this.getOffset()]=e.message;this.L.messages.length>o;){var t=this.L.messages.shift();r.debug("XDomainStorage: Cleared old message: "+t.data.id)}},Ft:function(e){this.L.subscribers.push(e.subscriber)},Mt:function(e){this.L.canonicalOrigins=e.canonicalOrigins},Ut:function(e){this.L.disabled=e.disabled}}}),(function(e,t,i){var n=i(2),r=i(7),a=i(22);e.exports={initialize:function(){this.L={},this.on(r.DATA_LOADED,this.k)},k:function(e){n.isEmpty(e.data.groups)||(n.each(e.data.groups,n.bind((function(e){a.deepFreeze(e),this.L[e.id]=e}),this)),this.emitChange())},getAll:function(){return a.safeReference(n.values(this.L))},getGroupsMap:function(){return a.safeReference(this.L)},get:function(e){return a.safeReference(this.L[e])}}}),(function(e,t,i){var n=i(72);t.initializeStore=n.initialize,t.addEvent=n.addEvent,t.getEvents=n.getEvents,t.getEventCount=n.getEventCount}),(function(e,t,i){function n(e){I.dispatch(v.SET_VISITOR_EVENTS,e)}function r(e){I.dispatch(v.UPDATE_BEHAVIOR_STORE,{key:"baseMap",value:e})}function a(e){I.dispatch(v.UPDATE_BEHAVIOR_STORE,{key:"eventQueue",value:e})}function o(e){I.dispatch(v.UPDATE_BEHAVIOR_STORE,{key:"lastEvent",value:e})}function s(e){I.dispatch(v.UPDATE_BEHAVIOR_STORE,{key:"cleared",value:e})}function u(){I.dispatch(v.UPDATE_BEHAVIOR_STORE,{key:"initialized",value:!0})}function c(){return O.getEvents()}function l(){return N.getBaseMap()}function d(){return N.getEventQueue()}function f(){return N.getLastEvent()}function g(){return N.getCleared()}function p(){return N.getInitialized()}function h(){var e=c().concat(d()),t=!1;return e.length>P&&(e=e.slice(-P),t=!0),n(e),a([]),t}var _=i(2),v=i(7),E=i(24),m=i(73),I=i(9),y=i(23),S=i(74),T=t,A=i(62).Event,w=i(63),R=i(62).EventBase,D=i(85),b=i(16),O=b.get("stores/visitor_events"),N=b.get("stores/visitor_events_manager"),C={EVENTBASE:"eb",HASH:"h",TIMEBASE:"tb",TIMESTAMPS:"ts", DELTA:"d",INDEX:"i"},P=1e3;t.initialize=function(e,t){if(!p()){T.Gt(e,t);var i=c();i.length>0&&o(i[i.length-1]);var n=d();n.length>0&&o(n[n.length-1]),u()}},t.addEvent=function(e){y.debug("Behavior store: adding event",e);var t=T.Bt(e);o(t),a(d().concat(t)),D.reindexIfNecessary(f(),c(),d()),T.zt(d())},t.getEvents=function(){return d().length>0&&(h()&&D.sessionize(c()),T.jt(c()),T.zt(d())),c()},t.getEventCount=function(){return d().length+c().length},T.Gt=function(e,t){T.Ht(e,t)&&(T.jt(c()),T.zt(d())),D.sessionize(c())},T.Ht=function(e,t){if(0===e.length&&0===t.length)return n([]),a([]),!1;var i=!1,r=e[0]||t[0];return C.EVENTBASE in r?(n(T.Kt(e)),a(T.Kt(t))):(i=!0,n(T.Yt(e)),a(T.Yt(t))),d().length>0&&(h(),i=!0),n(T._updateBaseMapAndMaybeDedupe(c())),T._migrateEventBasesAndUpdateStore()&&(i=!0),i},T.Yt=function(e){for(var t=[],i=0;i =a||i===V.AttributionTypes.LAST_TOUCH&&a>=n||R.isUndefined(n)&&a)&&(s.data=s.data||{},s.data[t]=e,a&&(s.metadata=s.metadata||{},s.metadata[t]=s.metadata[t]||{},s.metadata[t].lastModified=a))})),s}function v(e){var t=e.split("$$")[0];return t.indexOf("://")>0}function E(){var e=$.getVisitorProfile(),t=$.getVisitorProfileMetadata(),i=Y.getAllPlugins(V.PluginTypes.visitorProfileProviders);if(i){var n=R.reduce(i,(function(e,t){return t.provides&&(e[t.provides]=t),e}),{});e=R.omitBy(e,(function(e,t){var i=n[t];return i&&i.isTransient}))}return{profile:e,metadata:t}}function m(e,t){O.initializeStore(e,t)}function I(e){D.dispatch(b.LOAD_PERSISTED_LAYER_STATES,{layerStates:R.filter(e,(function(e){return!!e.decision}))})}function y(e){e=R.extend({lastSessionTimestamp:0,sessionId:null},e),D.dispatch(b.LOAD_SESSION_STATE,e)}function S(e){var t,i=e.name;switch(e.type){case V.VisitorIdLocatorType.COOKIE:t=C.get(i);break;case V.VisitorIdLocatorType.JS_VARIABLE:t=z.getGlobalByPath(i);break;case V.VisitorIdLocatorType.LOCALSTORAGE:try{var n=z.getGlobal("localStorage");t=n.getItem(i)}catch(e){throw new Error("Unable to read localStorage: "+e.toString())}break;case V.VisitorIdLocatorType.QUERY:t=G.getQueryParamValue(i)}try{if(!t)throw M.error("Visitor / Customer provided visitor id cannot be found. Type:",e.type," Name:",i),new Error("Failure to obtain visitor id from "+e.type);if(!R.isString(t)&&!R.isNumber(t))throw M.error("Visitor / Customer provided visitor id is not a string or number. Type:",e.type," Name:",i," Id Type:",typeof t),new Error("Customer provided visitor id is not a string or number")}catch(e){throw q.getSampleRum()&&D.dispatch(b.RECORD_VISITOR_ID_ERROR,{isError:!0}),e}return q.getSampleRum()&&(D.dispatch(b.RECORD_VISITOR_ID_ERROR,{isError:!1}),D.dispatch(b.RECORD_VISITOR_ID_LOCATOR_USAGE,{visitorIdLocatorType:e.type,entityId:t})),String(t)}function T(){return"oeu"+P.now()+"r"+Math.random()}function A(e){var t,i,n=Y.getAllPlugins(V.PluginTypes.visitorProfileProviders),r=R.filter(n,(function(e){return R.isFunction(e.restorer)}));e.profile&&e.metadata?(t=e.profile,i=e.metadata):(t=e,i={}),t=R.reduce(t,(function(e,t,i){var n=t,a=R.find(r,{provides:i});return a&&(n=a.restorer(t)),e[i]=n,e}),{}),D.dispatch(b.LOAD_EXISTING_VISITOR_PROFILE,{profile:t,metadata:i})}function w(e){try{return k.parse(e)}catch(t){return M.debug("Failed to parse: ",e,t),null}}var R=i(2),D=i(9),b=i(7),O=i(71),N=i(72),C=i(75),P=i(24),L=i(16),V=i(25),k=i(26),x=i(19),F=i(81).LocalStorage,M=i(23),U=i(12).Promise,G=i(84),B=i(25).VisitorStorageKeys,z=i(40),j=L.get("stores/cookie_options"),H=L.get("stores/global"),K=L.get("stores/layer"),Y=L.get("stores/plugins"),q=L.get("stores/rum"),W=L.get("stores/session"),X=L.get("stores/visitor_id"),Q=L.get("stores/visitor_bucketing"),$=L.get("stores/visitor"),J=L.get("stores/provider_status"),Z=!0;t.getOrGenerateId=function(){return{randomId:t.getCurrentId()||T()}},t.getCurrentId=function(){var e=X.getVisitorIdLocator();return e?S(e):$.getVisitorIdFromAPI()||C.get(V.COOKIES.VISITOR_ID)},t.hasSomeData=function(){return F.keys().length>0},t.setId=function(e){var i=X.getBucketingId();D.dispatch(b.SET_VISITOR_ID,e),X.getBucketingId()!==i&&(u(),t.deleteOldLocalData());try{X.getVisitorIdLocator()||t.maybePersistVisitorId(e)}catch(e){if(M.error("Visitor / Unable to persist visitorId, disabling tracking"),D.dispatch(b.LOAD_DIRECTIVE,{trackingDisabled:!0}),e instanceof C.MismatchError)throw M.error("Visitor / Cookie not set to correct value:",e),new Error("Cookie mismatch error while persisting visitorId");throw e}t.refreshSession()},t.getVariationIdMap=function(){return c(B.VARIATION_MAP)||{}},t.updateVariationIdMap=function(e,t,i){D.dispatch(b.UPDATE_VARIATION_ID_MAP,{layerId:e,experimentId:t,variationId:i})},t.persistVariationIdMap=function(){var e=Q.getVariationIdMapString();g(B.VARIATION_MAP,e,!0)},t.getPreferredLayerMap=n,t.updatePreferredLayerMap=r,t.persistTrackerOptimizelyData=function(e){g(B.TRACKER_OPTIMIZELY,e)},t.refreshSession=function(){D.dispatch(b.REFRESH_SESSION)},t.populateEagerVisitorData=function(e,i){var n=R.filter(e,(function(e){return!e.isLazy})),r=t.populateVisitorData(n,i);return r},t.populateLazyVisitorData=function(e,i){var n=R.filter(e,(function(e){return e.isLazy}));return t.populateVisitorData(n,i)},t.populateVisitorData=function(e,t){t=t||{};var i=R.partial(s,t),n=R(e).filter({isAsync:!0}).map(i).filter().value();return R.forEach(R.filter(e,(function(e){return!e.isAsync})),i),n.length>0?U.all(n):U.resolve()},t.persistBehaviorEvents=function(e){g(B.EVENTS,e)},t.persistBehaviorEventQueue=function(e){g(B.EVENT_QUEUE,e)},t.getPersistedBehaviorEventCount=function(){var e=c(B.EVENTS)||[],t=c(B.EVENT_QUEUE)||[];return N.deserialize(e).length+N.deserialize(t).length},t.persistLayerStates=function(){var e=K.getLayerStates(t.getNamespace());e=R.map(e,(function(e){return R.omit(e,"namespace")})),g(B.LAYER_STATES,e)},t.persistSessionState=function(){g(B.SESSION_STATE,W.getState())},t.persistVisitorProfile=function(){g(B.VISITOR_PROFILE,E())},t.persistVisitorBucketingStore=function(){t.persistVariationIdMap(),a()},t.getUserIdFromKey=function(e,i){var n;return R.includes(e,i)&&R.includes(e,"_")&&R.includes(e,"$$")&&R.includes(e.slice(e.indexOf("$$")),t.getNamespace())&&(n=e.slice(e.indexOf("_")+1,e.indexOf("$$"))),n},t.maybePersistVisitorId=function(e){e.randomId&&(j.getAutoRefresh()||t.getCurrentId()!==e.randomId?(C.set(V.COOKIES.VISITOR_ID,e.randomId),M.log("Persisting visitorId:",e.randomId)):M.log("Not persisting visitorId: value is not changed and also auto-refresh is disabled"))},t.getAttribute=function(e){return $.getAttribute(e)},t.getPendingAttributeValue=function(e){return J.getPendingAttributeValue(e)},t.isForeignKey=v,t.checkKeyForVisitorId=function(e){var i=X.getBucketingId()||t.getCurrentId(),n=t.getIdFromKey(e);return!n||n===i},t.getIdFromKey=function(e){var i=e.split("$$")[0],n=t.getStorageKeyFromKey(e),r=R.includes(V.StorageKeys,n);if(r)return null;var a=i.indexOf("_"),o=a===-1;return o?i:i.substring(a+1)},t.getStorageKeyFromKey=function(e){var t,i=e.split("$$").pop(),n=i.indexOf("://")>-1;if(n){var r=i.indexOf("_");t=i.substring(r+1)}else t=i;return R.includes(R.values(V.AllStorageKeys),t)?t:null},t.deleteOldLocalData=function(){var e=F.keys();R.each(e,(function(e){t.isForeignKey(e)||t.checkKeyForVisitorId(e)||F.removeItem(e)}))},t.deleteOldForeignData=function(){var e=F.keys();R.each(e,(function(e){t.isForeignKey(e)&&F.removeItem(e)}))},t.loadForeignData=function(){R.each(F.keys(),(function(e){var t=F.getItem(e);t&&h(e,t)}))},t.getNamespace=function(){return H.getNamespace()},t.serializeFieldKey=function(e){return R.isArray(e)?e.join("$$"):e},t.removeLegacySessionStateCookies=function(){var e=C.getAll();R.forEach(R.keys(e),(function(e){0===e.indexOf(V.COOKIES.SESSION_STATE+"$$")&&C.remove(e)}))}}),(function(e,t,i){function n(e,i){i!==!1&&(i=!0);for(var n,a,o=e.hostname.split("."),s=[],u=null,l=o.length-1;l>=0;l--)if(s.unshift(o[l]),n=s.join("."),!r.includes(h,n)){a={domain:i?"."+n:n};try{t.set(_,Math.random().toString(),a),t.remove(_,a),u=a.domain;break}catch(e){}}return d.dispatch(c.SET_COOKIE_DOMAIN,u),u}var r=i(2),a=i(76).create,o=i(24),s=i(80),u=i(40),c=i(7),l=i(16),d=i(9),f=l.get("stores/cookie_options"),g=t.SetError=a("CookieSetError"),p=t.MismatchError=a("CookieMismatchError");t.getAll=function(e){r.isUndefined(e)&&(e=!0);var i,n,a,o,u;i=s.getCookieString().split(/\s*;\s*/);var c={};for(a=0;a 0&&(u=t.safeDecodeURIComponent(n.substring(0,o)),void 0===c[u])){var l=n.substring(o+1);e&&(l=t.safeDecodeURIComponent(l)),c[u]=l}return c},t.safeDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(t){return e}},t.get=function(e,i){var n=t.getAll(i);return n[e]},t.set=function(e,i,a,c){a=r.extend({encodeValue:!0},a),c!==!1&&(c=!0);var l=[];if(r.isUndefined(a.domain)){var d=f.getCurrentDomain();d||(d=n(u.getLocation(),!0)),a.domain=d}if(a.domain&&l.push("domain="+a.domain),r.isUndefined(a.path)&&(a.path="/"),a.path&&l.push("path="+a.path),r.isUndefined(a.expires)){var h=r.isUndefined(a.maxAge)?f.getDefaultAgeInSeconds():a.maxAge;a.expires=new Date(o.now()+1e3*h)}if(r.isUndefined(a.expires)||l.push("expires="+a.expires.toUTCString()),a.secure&&l.push("secure"),l=l.join(";"),s.setCookie(e+"="+(a.encodeValue?encodeURIComponent(i):i)+";"+l),c){var _=a.encodeValue,v=t.get(e,_);if(v!==i){if(!v)throw new g('Failed to set cookie "'+e+'"');throw new p('Expected "'+i+'" for "'+e+'", got "'+v+'"')}}},t.remove=function(e,i){for(var n=u.getLocation().hostname.split(".");n.length>0;)t.set(e,null,r.extend({},i,{domain:"."+n.join("."),expires:new Date(0)}),!1),n.shift()};var h=["optimizely.test"],_="optimizelyDomainTestCookie"}),(function(e,t,i){var n=i(77),r=n("InternalError");t.BaseError=r,t.create=function(e){return n(e,r)}}),(function(e,t,i){function n(e,t){function i(t){if(!(this instanceof i))return new i(t);try{throw new Error(t)}catch(t){t.name=e,this.stack=t.stack}r&&this.stack&&(this.stack=a(this.stack,e,t)),this.message=t||"",this.name=e}return i.prototype=new(t||Error),i.prototype.constructor=i,i.prototype.inspect=function(){return this.message?"["+e+": "+this.message+"]":"["+e+"]"},i.prototype.name=e,i}var r=i(78)(),a=i(79);e.exports=n}),(function(e,t){"use strict";e.exports=function(){var e=new Error("yep");return!!e.stack&&"Error: yep\n"===e.stack.substr(0,11)}}),(function(e,t){"use strict";e.exports=function(e,t,i){var n=t;return i&&(n+=": "+i),e=n+e.slice(e.indexOf("\n"))}}),(function(e,t,i){function n(){return"loading"===t.getReadyState()}var r=i(16),a=r.get("stores/global");t.getDocumentElement=function(){return document.documentElement},t.getCookieString=function(){return document.cookie||""},t.setCookie=function(e){document.cookie=e},t.querySelector=function(e){return document.querySelector(e)},t.querySelectorAll=function(e){return document.querySelectorAll(e)},t.parseUri=function(e){var i=t.createElement("a");return i.href=e,i},t.childrenOf=function(e){return Array.prototype.slice.call(e.querySelectorAll("*"))},t.createElement=function(e){return document.createElement(e)},t.isReady=function(){return a.domContentLoadedHasFired()||"interactive"===document.readyState||"complete"===document.readyState},t.isLoaded=function(){return"complete"===document.readyState},t.addReadyHandler=function(e){return document.addEventListener("DOMContentLoaded",e),function(){t.removeReadyHandler(e)}},t.removeReadyHandler=function(e){return function(){document.removeEventListener("DOMContentLoaded",e)}},t.getReferrer=function(){return document.referrer},t.getReadyState=function(){return document.readyState},t.write=function(e){if(!n())throw new Error("Aborting attempt to write to already-loaded document");document.write(e)},t.appendToHead=function(e){return t.appendTo(document.head,e)},t.appendTo=function(e,t){e.appendChild(t)},t.addEventListener=function(e,t,i){return document.addEventListener(e,t,i),function(){document.removeEventListener(e,t,i)}},t.getCurrentScript=function(){if(document.currentScript)return document.currentScript},t.parentElement=function(e){for(var t=e.parentNode;t.nodeType!==Node.ELEMENT_NODE;)t=t.parentNode;return t}}),(function(e,t,i){var n,r,a="optimizely_data",o=i(76).create,s=i(82),u=i(40),c=t.Error=o("StorageError");try{r=u.getGlobal("localStorage")}catch(e){throw new c("Unable to read localStorage: "+e.toString())}if(!r)throw new c("localStorage is undefined");n=s.create(r,a),t.LocalStorage=n,t.isOptimizelyKey=function(e){return e.slice(0,a.length)===a}}),(function(e,t,i){function n(e,t){this.Zt=e,this.ei=t}var r=i(2),a=i(23),o="$$";n.prototype.ti=function(e){return[this.ei,e].join(o)},n.prototype.ii=function(e){return e.replace(this.ei+o,"")},n.prototype.setItem=function(e,t){try{this.Zt.setItem(this.ti(e),t)}catch(t){a.warn("Failed to save",e,"to localStorage:",t)}},n.prototype.removeItem=function(e){this.Zt.removeItem(this.ti(e))},n.prototype.getItem=function(e){var t=null;try{t=this.Zt.getItem(this.ti(e))}catch(e){}return t},n.prototype.keys=function(){var e=r.keys(this.Zt);return r.map(r.filter(e,r.bind((function(e){return r.includes(e,this.ei)}),this)),r.bind(this.ii,this))},n.prototype.allKeys=function(){return r.keys(this.Zt)},n.prototype.allValues=function(){return r.values(this.Zt)},e.exports={create:function(e,t){return new n(e,t)},mockStorage:{keys:function(){},getItem:function(e){},removeItem:function(e){},setItem:function(e,t){}}}}),(function(e,t,i){function n(){return u.getGlobal("performance")}var r=i(7),a=i(76).create,o=i(24),s=i(9),u=i(40),c=i(16),l=c.get("stores/rum"),d="optimizely:",f=t.Error=a("PerformanceError");t.time=function(e){if(l.getSampleRum()){var t=n();if(t&&t.mark){var i=d+e;t.clearMarks(i+"Begin"),t.mark(i+"Begin")}}},t.timeEnd=function(e){if(l.getSampleRum()){var t=n();if(t&&t.mark){var i=d+e,a=t.getEntriesByName(i+"Begin");if(0===a.length)throw new f("Called timeEnd without matching time: "+e);t.clearMarks(i+"End"),t.mark(i+"End");var o=t.getEntriesByName(i+"End"),u=e+"Time",c=o[0].startTime-a[0].startTime;s.dispatch(r.SET_PERFORMANCE_MARKS_DATA,{name:u,data:{startTime:Math.round(1e3*a[0].startTime)/1e3,duration:Math.round(1e3*c)/1e3}})}}},t.now=function(){var e=n();return e?e.now():o.now()}}),(function(e,t,i){var n=i(2),r=i(40);t.getQueryParams=function(){var e=r.getLocationSearch()||"";if(0===e.indexOf("?")&&(e=e.substring(1)),0===e.length)return[];for(var t=e.split("&"),i=[],n=0;n 0&&(a=s[0]),s.length>1&&(o=s[1]),i.push([a,o])}return i},t.getQueryParamValue=function(e){for(var i=t.getQueryParams(),n=0;n c&&(u+=1),e[i-1].setFieldValue(s.FIELDS.SESSION_INDEX,u);for(var a=i-1;a>0;a--)r(e[a],e[a-1],!0)}},t.reindexIfNecessary=function(e,t,i){function n(e){for(var t=0;t =l?(o.dispatch(r.REMOVE_PENDING_EVENT,{id:i}),u.warn("Event ",f," could not be sent after ",l," attempts.")):(f.retryCount++,o.dispatch(r.SET_PENDING_EVENT,f),u.debug("Event ",f," failed to send, with error ",e," It will be retried ",l-s," times.")),e}))},t.sendBeacon=t.request}),(function(e,t,i){var n=i(2),r=i(7),a=i(24),o=i(16),s=i(80),u=i(25),c=i(9),l=i(23),d=o.get("stores/sandbox"),f=i(40);t.shouldSandbox=function(){return!1},t.get=function(e){if(!e)throw new Error("Name is required");if(t.shouldSandbox()){d.isInitialized()||g();var i=d.get(e);if(i)return i}return f.getGlobal(e)};var g=function(){try{var e="optimizely_"+a.now(),t=s.createElement("iframe");t.name=e,t.style.display="none",s.appendToHead(t);var i=t.contentWindow,o=t.contentDocument;o.write(""),o.close();var d=n.mapValues(u.SandboxedFunctions,(function(e){return i[e]}));c.dispatch(r.SANDBOXED_FUNCTIONS_ADDED,{sandboxedFunctions:d}),t.parentNode.removeChild(t)}catch(e){l.warn("Unable to create a sandbox: ",e)}}}),(function(e,t,i){var n=i(2),r=i(23),a=i(90),o=i(16),s=o.get("stores/plugins"),u=i(7),c=i(25),l=i(9),d=!0,f=[i(105),i(106),i(126)],g=["clientMetadata","cookieDomain","disable","load","optOut","rum"];t.push=function(e,t){var i,a,o,s;if(!n.isArray(e)&&n.isObject(e))s=n.isUndefined(e.version)?1:e.version,i=e.type,o=[e];else if(n.isArray(e))s=0,i=e[0],o=e.slice(1);else{if(!n.isString(e))return r.warn("API / Ignoring non-array/object/string argument:",e),!1;s=0,i=e,o=[]}if(f[s]&&(a=f[s][i]),t&&g.indexOf(i)===-1)return r.debug("API / Ignoring non high priority function:",i,o),!1;if(!a)return r.warn('API / No function found for "'+i+'" (v'+s+") with arguments:",o),!1;r.log('API / Executing: "'+i,'" with arguments:',o);try{a.apply(null,o),l.dispatch(u.RECORD_API_USAGE,{methodName:s?"v"+s+"."+i:i})}catch(e){r.error(e)}return!0},t.get=function(e){if(d&&"state"!==e)return void r.warn('Module "'+e+'" not found.');r.log('API / Getting module: "'+e+'"');var t=a[e];return t?n.isArray(t)&&(t=o.evaluate(t)):t=s.getPlugin(c.PluginTypes.apiModules,e),t?(l.dispatch(u.RECORD_API_USAGE,{methodName:"get."+e}),t):void r.warn('Module "'+e+'" not found.')}}),(function(e,t,i){function n(e,t,i,n){var r=e.getLayerState(n),a=t.get(n),s=i.get();if(!r||!a)return s?{layer:{name:s.layerName,id:s.layerId,policy:s.layerPolicy,integrationStringVersion:s.integrationStringVersion},experiment:{name:s.experimentName,id:s.experimentId},variation:{name:s.variationName,id:s.variationId},isLayerHoldback:!1}:null;if(l.isSingleExperimentPolicy(a.policy)&&r.decision.isLayerHoldback)return null;var u=r.decision.experimentId,c=r.decision.variationId;if(!u||!c)return null;var d,f;return(d=o.find(a.experiments,{id:u}))?(f=o.find(d.variations,{id:c}),f?{layer:{name:a.name,id:a.id,policy:a.policy,integrationStringVersion:a.integrationStringVersion},experiment:{name:d.name,id:d.id},variation:{name:f.name,id:f.id},isLayerHoldback:r.decision.isLayerHoldback}:null):null}function r(e,t,i,n,r,s){var u=[],c=e.getLayerStates();s.onlySingleExperiments&&(c=o.filter(c,(function(e){var i=t.get(e.layerId);return i&&l.isSingleExperimentPolicy(i.policy)})));var f=o.map(c,(function(e){var t=!!e.decision.variationId,i=e.decisionActivationId&&e.decisionActivationId===n.getActivationId(),r=d.getExperimentAndVariation(),a=r?r.variationId:null,s=t&&e.decision.variationId===a;return o.extend(e,{isActive:t&&i||s,visitorRedirected:s})})),g=r?o.filter(f,r):f;return o.each(g,(function(e){var n=a(e,t,i,s.includeOfferConsistency);n&&u.push(n)})),u}function a(e,t,i,n){var r,a,s=e.layerId,u=t.get(s)||{},c=o.map(u.experiments,(function(e){return o.pick(e,["id","name"])}));if(n||!u.decisionMetadata||!u.decisionMetadata.offerConsistency){var l={id:s,campaignName:u.name||null,experiment:null,allExperiments:c,variation:null,reason:e.decision.reason,isActive:!!e.isActive,visitorRedirected:e.visitorRedirected,isInCampaignHoldback:e.decision.isLayerHoldback};e.decision&&e.decision.experimentId&&(r=o.find(u.experiments,{id:e.decision.experimentId})),r&&(l.experiment=o.pick(r,["id","name","campaignName"])),r&&e.decision.variationId&&(a=o.find(r.variations,{id:e.decision.variationId})),a&&(l.variation=o.pick(a,["id","name"]));var d=o.map(e.decisionTicket.audienceIds,(function(e){return o.pick(i.get(e),["id","name"])}));return l.audiences=d,u.decisionMetadata&&u.decisionMetadata.offerConsistency&&(l.pageId=e.pageId),l}}var o=i(2),s=i(91),u=i(92),c=i(94),l=i(44),d=i(95);t.data=["stores/audience_data","stores/client_metadata","stores/event_data","stores/layer_data","stores/view_data","stores/group_data","stores/interest_group","stores/tag_group","stores/global",function(e,t,i,n,r,a,s,l,d){var f={},g={},p={},h={audiences:e.getAudiencesMap(),events:i.getEventsMap(),campaigns:f,pages:r.getPagesMap(),experiments:g,variations:p,projectId:d.getProjectId(),snippetId:d.getSnippetId(),accountId:d.getAccountId(),dcpServiceId:d.getDCPServiceId(),revision:d.getRevision(),clientName:t.getClientName(),clientVersion:t.getClientVersion()},_=c.dereferenceChangeId;return o.each(n.getAll(),(function(e){u.defineProperty(f,e.id,(function(){var t=o.extend({},e);return u.defineProperty(t,"changes",(function(){return o.map(e.changes,_)}),"campaign"),u.defineProperty(t,"experiments",(function(){return o.map(e.experiments,(function(e){return g[e.id]}))}),"campaign"),t}),"campaignMap","byId"),o.each(e.experiments,(function(e){u.defineProperty(g,e.id,(function(){var t=o.extend({},e);return u.defineProperty(t,"changes",(function(){return o.map(e.changes,_)}),"experiment"),u.defineProperty(t,"variations",(function(){return o.map(e.variations,(function(e){return p[e.id]}))}),"experiment"),t}),"experimentMap","byId"),o.each(e.variations,(function(e){u.defineProperty(p,e.id,(function(){var t=o.extend({},e);return u.defineProperty(t,"actions",(function(){return o.map(e.actions,(function(e){return o.extend({},e,{changes:o.map(e.changes,_)})}))}),"variation"),t}),"variationMap","byId")}))}))})),h.groups=a.getGroupsMap(),h}],t.visitor=["stores/visitor",function(e){return o.cloneDeep(e.getVisitorProfile())}],t.visitor_id=["stores/visitor_id",function(e){return{randomId:e.getRandomId()}}],t.state=["stores/audience_data","stores/layer_data","stores/layer","stores/view_data","stores/view","stores/global","stores/observed_redirect",function(e,t,i,a,u,c,f){return{getCampaignStates:function(n){var a={},s=r(i,t,e,c,n,{includeOfferConsistency:!1});return o.each(s,(function(e){a[e.id]=e})),a},getExperimentStates:function(n){var a=r(i,t,e,c,n,{includeOfferConsistency:!1,onlySingleExperiments:!0}),s=["audiences","variation","reason","visitorRedirected","isActive"],u=o.reduce(a,(function(e,t){var i=t.allExperiments[0];return e[i.id]=o.extend({},o.pick(t,s),{id:i.id,experimentName:i.name,isInExperimentHoldback:t.isInCampaignHoldback}),e}),{});return u},getCampaignStateLists:function(n){var a={},s=r(i,t,e,c,n,{includeOfferConsistency:!0});return o.each(s,(function(e){var t=e.id;a[t]||(a[t]=[]),a[t].push(e)})),a},getPageStates:function(e){var t=u.getAll(),i=o.reduce(t,(function(e,t){var i=a.get(t.id);return e[t.id]=o.extend({},o.pick(i,["id","name","apiName","category","staticConditions","tags"]),o.pick(t,["isActive","metadata"])),e[t.id].isActive=!!e[t.id].isActive,e}),{});return e?o.pickBy(i,e):i},isGlobalHoldback:function(){return c.isGlobalHoldback()},getActivationId:function(){return c.getActivationId()},getVariationMap:function(){var e=i.getLayerStates(),n={};return o.each(e,(function(e){var i=t.get(e.layerId);if(e.decision&&e.decision.experimentId&&(n[e.decision.experimentId]={id:e.decision.variationId,name:null,index:null},i)){var r=o.find(i.experiments,{id:e.decision.experimentId});if(r&&e.decision.variationId)var a=o.find(r.variations,{id:e.decision.variationId}),s=o.findIndex(r.variations,{id:e.decision.variationId});a&&(n[e.decision.experimentId]={ id:e.decision.variationId,name:a.name,index:s})}})),n},getActiveExperimentIds:function(){var e={};return o.each(this.getCampaignStateLists({isActive:!0}),(function(t){o.each(t,(function(t){e[t.experiment.id]=!0}))})),o.keys(e)},getRedirectInfo:function(){var e=d.getExperimentAndVariation();return e&&(e.referrer=d.getReferrer()),e},getDecisionString:function(e){if(!e)throw new Error("Must pass a config to getDecisionString");e=o.extend({maxLength:255,shouldCleanString:!1},e);var r=n(i,t,f,e.campaignId);return r?s.generateAnalyticsString(r.layer,r.experiment,r.variation,r.isLayerHoldback,e.maxLength,e.shouldCleanString):null},getDecisionObject:function(e){if(!e)throw new Error("Must pass a config to getDecisionObject");e=o.extend({maxLength:255,shouldCleanString:!1},e);var r=n(i,t,f,e.campaignId);if(!r)return null;var a=s.formatNamesAndIdsForAnalytics(r.layer,r.experiment,r.variation,e.shouldCleanString),u=o.mapValues(a.names,(function(t,i){return s.combineAndTruncateIdAndName(t,a.idStrings[i],e.maxLength)})),c={experiment:u.experiment,variation:u.variation};return l.isSingleExperimentPolicy(r.layer.policy)||o.extend(c,{campaign:u.layer,holdback:r.isLayerHoldback}),c}}}],t.utils=i(96).create(),t.jquery=["env/jquery",function(e){return e}],t.event_emitter=i(102)}),(function(e,t,i){function n(e){return e.replace(/[^a-zA-Z0-9\.\~\!\*\(\)\']+/g,"_")}function r(e){return!u.isEmpty(e)&&u.includes(["and","or","not"],e[0])}function a(e,t){var i="";return u.isEmpty(t)?i=d:(i=u.reduce(t,(function(t,i){var r=e.get(i);return r?t+n(r.name?r.name:r.id)+",":t}),""),i=i.slice(0,-1)),i}function o(e,i,n,r,a,o){if(!_.isSingleExperimentPolicy(e.policy)||!r){var s=!_.isSingleExperimentPolicy(e.policy)&&r,c=t.formatNamesAndIdsForAnalytics(e,i,n,o),d=[c.names.experiment,c.names.variation],g=[c.idStrings.experiment,c.idStrings.variation];_.isSingleExperimentPolicy(e.policy)||(d.unshift(c.names.layer),g.unshift(c.idStrings.layer));var p=u.reduce(g,(function(e,t){return e+t.length}),0),h=d.length-1+(s?1:0),v=h*l.length,E=p+v;if(s&&(E+=f.length),E>a)throw new Error("The analytics string size is too low to send the entity IDs.");for(var m=a-E,I=d.length,y=[],S=d.length-1;S>=0;S--){var T=d[S],A=Math.min(T.length,Math.floor(m/I));m-=A,I--,y.unshift(T.substring(0,A))}var w=u.map(y,(function(e,t){return e+g[t]}));return s&&w.push(f),w.join(l)}}function s(e,i,n,r,a,o){var s=r?f:g,c=3*l.length,d=t.formatNamesAndIdsForAnalytics(e,i,n,o),p=d.names,h=d.idStrings,v=u.reduce(h,(function(e,t){return e+t.length}),0);if(v+c+s.length>a)throw new Error("The analytics string size is too low to send the campaign, experiment, and variation IDs.");var E=a-v-c-s.length,m={};m.variation=Math.min(p.variation.length,Math.floor(E/3)),E-=m.variation,m.experiment=Math.min(p.experiment.length,Math.floor(E/2)),E-=m.experiment,m.layer=E;var I={};u.each(p,(function(e,t){I[t]=e.substring(0,m[t])}));var y=[];return _.isSingleExperimentPolicy(e.policy)||y.push(I.layer+h.layer),y=y.concat([I.experiment+h.experiment,I.variation+h.variation,s]),y.join(l)}var u=i(2),c=i(16),l=":",d="everyone_else",f="holdback",g="treatment",p="",h=i(23),_=i(44),v=!1;t.formatNamesAndIdsForAnalytics=function(e,t,i,o){var s={layer:e.name||p,experiment:t.name||p,variation:i.name||p};o&&(s=u.mapValues(s,n));var l=v?1===e.integrationStringVersion:!e.integrationStringVersion||1===e.integrationStringVersion;if(s.experiment===p&&l)if(r(t.audienceIds))s.experiment="Exp";else{var d=c.get("stores/audience_data");s.experiment=a(d,t.audienceIds)}var f={layer:"("+n(e.id)+")",experiment:"("+n(t.id)+")",variation:"("+n(i.id)+")"};return{names:s,idStrings:f}},t.combineAndTruncateIdAndName=function(e,t,i){var n=i-t.length;if(n<0&&(h.warn("maxLength must be at least long enough to fit the entity ID, which is length"+t.length+". Defaulting to only use entity ID as name."),e=p),e===p)return t;if(e.length>n){var r=Math.min(e.length,n);return e=e.substring(0,r),e+t}return e+" "+t},t.generateAnalyticsString=function(e,t,i,n,r,a){return e.integrationStringVersion&&2===e.integrationStringVersion?o(e,t,i,n,r,a):s(e,t,i,n,r,a)}}),(function(e,t,i){var n=i(93),r=i(7),a=i(9),o=i(23);t.defineProperty=function(e,t,i,s,u){n(e,t,(function(){var e=["prop",s,u||t].join(".");return o.debug('Evaluating getter: "'+e+'"'),a.dispatch(r.RECORD_API_USAGE,{methodName:e}),i()}),!0)}}),(function(e,t){"use strict";function i(e,t,i,n){Object.defineProperty(e,t,{get:function(){var e=i.call(this);return Object.defineProperty(this,t,{value:e,enumerable:!!n,writable:!0}),e},set:function(e){return Object.defineProperty(this,t,{value:e,enumerable:!!n,writable:!0}),e},enumerable:!!n,configurable:!0})}e.exports=i}),(function(e,t,i){function n(e){var i=r.cloneDeep(e);return i.changes&&(i.changes=r.map(i.changes,t.dereferenceChangeId)),i.experiments&&r.each(i.experiments,(function(e){e.changes&&(e.changes=r.map(e.changes,t.dereferenceChangeId)),e.variations&&r.each(e.variations,(function(e){e.actions&&r.each(e.actions,(function(e){e.changes&&(e.changes=r.map(e.changes,t.dereferenceChangeId))}))}))})),i}var r=i(2),a=i(16),o=i(22),s=i(92),u=a.get("stores/change_data");t.translateDecisionToCampaignDecision=function(e){return c(r.cloneDeep(e),{layerId:"campaignId",isLayerHoldback:"isCampaignHoldback"})},t.translateLayerEventToCampaignEvent=function(e){var t={};return s.defineProperty(t,"campaign",(function(){var t=n(e.data.layer);return t}),"campaignEvent"),t.decisionTicket=e.data.decisionTicket,t.decision=this.translateDecisionToCampaignDecision(e.data.decision),t.audiences=e.data.audiences,{type:"lifecycle",name:"campaignDecided",data:t}},t.translateViewActivatedToPageActivated=function(e){return{type:"lifecycle",name:"pageActivated",data:{page:e.data.view}}},t.dereferenceChangeId=function(e){var t=u.getChange(e);return t?o.safeReference(t):e};var c=function(e,t){var i=r.omit(e,r.keys(t));return r.each(t,(function(t,n){i[t]=e[n]})),i}}),(function(e,t,i){var n=i(2),r=i(16),a=r.get("stores/observed_redirect");t.getReferrer=function(){var e=a.get();return e?e.referrer:null},t.getExperimentAndVariation=function(){var e=a.get();return e&&n.isString(e.variationId)?n.pick(e,["experimentId","variationId"]):null}}),(function(e,t,i){var n=i(12).Promise,r=i(97).observeSelector,a=i(98).poll,o=i(100).waitForElement,s=i(101).waitUntil;t.create=function(){return{observeSelector:r,poll:a,Promise:n,waitForElement:o,waitUntil:s}}}),(function(e,t,i){function n(){if(f.shouldObserveChangesIndefinitely()){var e={attributes:!0,childList:!0,subtree:!0,characterData:!0},t=g.getDocumentElement(),i=new MutationObserver(function(){this.disconnect(),l.each(l.keys(E),a),this.observe(t,e)});return function(n){var r=E[n];i.observe(t,e),r.cancelObservation=function(){delete E[n],l.isEmpty(E)&&i.disconnect()}}}return function(e){var t=h.poll(l.partial(a,e));E[e].cancelObservation=function(){t(),delete E[e]}}}function r(e){var t=E[e];t&&t.cancelObservation&&t.cancelObservation()}function a(e){if(E[e]){if(o(E[e]))return 0===E[e].matchedCount&&l.isFunction(E[e].options.onTimeout)&&E[e].options.onTimeout(),void r(e);var t=document.querySelectorAll(E[e].selector);t.length&&(l.each(t,(function(t){t.ni&&t.ni[e]||E[e].callbackQueue.push(t)})),s(e))}}function o(e){var t=e.options.timeout;if(null!==t)if("function"==typeof t)try{return t()}catch(e){}else if(Date.now()-e.startTime>t)return!0;return!1}function s(e){for(;E[e]&&E[e].callbackQueue.length;){var t=E[e].callbackQueue.shift();if(u(t,e),E[e].matchedCount=E[e].matchedCount+1,E[e].callback(t),E[e]&&E[e].options.once)return void r(e)}}function u(e,t){e.ni||(e.ni={}),e.ni[t]=!0}function c(e){try{document.querySelector(e)}catch(e){return!1}return!0}var l=i(2),d=(i(7),i(16)),f=d.get("stores/directive"),g=i(80),p=(i(25),i(9),i(5).generate),h=i(98),_=i(40),v=(d.get("stores/rum"),{once:!1,onTimeout:null,timeout:null}),E={},m=function(e){(m=n())(e)};t.observeSelector=function(e,t,i){if(!c(e))throw new Error("observeSelector expects a valid css selector as its first argument");if(!l.isFunction(t))throw new Error("observeSelector expects a function as its second argument");if(i&&(!l.isObject(i)||l.isFunction(i)))throw new Error("observeSelector expects an object as its third argument");var n=p();return i=l.assign({},v,i||{}),E[n]={callback:t,callbackQueue:[],matchedCount:0,options:i,selector:e,startTime:Date.now()},m(n),_.setTimeout(l.bind(a,null,n),0),l.partial(r,n)}}),(function(e,t,i){function n(e){l[e]&&a.each(l[e].callbacks,(function(e){e.call(null)}))}function r(e,t){l[t]&&l[t].callbacks[e]&&(delete l[t].callbacks[e],a.some(l[t].callbacks)||(clearInterval(l[t].id),delete l[t]))}var a=i(2),o=(i(7),i(16)),s=(i(25),i(9),i(5).generate),u=i(40),c=i(99).DEFAULT_INTERVAL,l=(o.get("stores/rum"),{});t.poll=function(e,t){a.isNumber(t)||(t=c),l[t]||(l[t]={callbacks:{},id:u.setInterval(a.partial(n,t),t)});var i=s();return l[t].callbacks[i]=e,a.partial(r,i,t)},t.cancelAll=function(){a.each(l,(function(e,t){clearInterval(e.id),delete l[t]}))}}),(function(e,t){e.exports={DEFAULT_INTERVAL:20}}),(function(e,t,i){var n=i(12).Promise,r=i(97).observeSelector;t.waitForElement=function(e){return new n(function(t,i){r(e,t,{once:!0})})}}),(function(e,t,i){var n=i(12).Promise,r=i(98).poll;t.waitUntil=function(e){return new n(function(t,i){if(e())return void t();var n=r((function(){e()&&(n(),t())}))})}}),(function(e,t,i){var n=i(103);t.on=function(e){return e.publicOnly=!0,n.on(e)},t.off=n.off,t.emit=function(e){n.emit(e)}}),(function(e,t,i){var n=i(2),r=i(5),a=i(7),o=i(104),s=i(16),u=i(9),c=i(23),l=s.get("stores/event_emitter");t.on=function(e){return e.token||(e.token=r.generate()),u.dispatch(a.ADD_EMITTER_HANDLER,e),e.token},t.off=function(e){u.dispatch(a.REMOVE_EMITTER_HANDLER,{token:e})},t.emit=function(e,t,i){var r=l.getHandlers(e,t);n.each(r,(function(n){try{n.handler.call({$di:s},e)}catch(r){!i&&n.emitErrors?(c.error("Error in handler for event:",e,r),o.emitError(r,null,t)):c.warn("Suppressed error in handler for event:",e,r)}}))}}),(function(e,t,i){var n=i(103);t.emitError=function(e,t,i){var r=!0;n.emit({type:"error",name:e.name||"Error",data:{error:e,metadata:t}},i||!1,r)},t.emitInternalError=function(e,i){t.emitError(e,i,!0)},t.emitAnalyticsEvent=function(e,t){var i={type:"analytics",name:"trackEvent",data:e};n.emit(i,t)}}),(function(e,t,i){function n(e){var t,i={};if(e)if(r(e))t=Number(e);else{if("object"!=typeof e)throw new Error("tracker","Revenue argument",e,"not a number.");if(i=a.extend({},e),"revenue"in i){if(!r(i["revenue"]))throw new Error("tracker","Revenue value",i["revenue"],"not a number.");t=Number(i["revenue"]),delete i["revenue"]}}return a.isUndefined(t)||(i.revenue=t),i}function r(e){return a.isNumber(e)||a.isString(e)&&Number(e)==e}var a=i(2),o=i(106);t.activateGeoDelayedExperiments=function(e,t){t||(t=e.lists?"odds":"cdn3"),o.dataFromSource({data:e,source:t})},t.activateSiteCatalyst=function(e){e&&e.sVariable&&o.integrationSettings({id:"adobe_analytics",settings:{sVariableReference:e.sVariable}})},t.bucketUser=t.bucketVisitor=function(e,t){if(e&&t){var i={experimentId:String(e)};t>256?i.variationId=String(t):i.variationIndex=String(t),o.bucketVisitor(i)}},t.disable=function(e){o.disable({scope:e})},t.log=function(e){a.isUndefined(e)&&(e=!0),o.log({level:e?"INFO":"OFF"})},t.optOut=function(e){a.isUndefined(e)&&(e=!0),o.optOut({isOptOut:e})},t.setCookieDomain=function(e){o.cookieDomain({cookieDomain:e})},t.setCookieExpiration=function(e){o.cookieExpiration({cookieExpirationDays:e})},t.setDimensionValue=function(e,t){var i={};i[e]=t,o.user({attributes:i})},t.setUserId=function(e){o.user({userId:e})},t.storeThirdPartyData=function(e,t){o.dataFromSource({source:e,data:t})},t.trackEvent=function(e,t){o.event({eventName:e,tags:n(t)})}}),(function(e,t,i){function n(e){var t;return e.eventId&&(t=I.create(e.eventId,e.eventName,"custom")),b.updateAllViewTags(),function(){var i=g.trackCustomEvent(e.eventName,e.tags,t);i?w.log("API / Tracking custom event:",e.eventName,e.tags):w.log("API / Not tracking custom event:",e.eventName)}}function r(e){var t;return e.eventData&&(t=I.create(e.eventData.id,e.eventData.apiName,"click",e.eventData)),function(){var e=g.trackClickEvent(t);e?w.log("API / Tracking click event:",e):w.log("API / Not tracking click event:",e)}}function a(e){var t=e.eventData,i=A.createLayerState(t.layerId,t.experimentId,t.variationId,t.isLayerHoldback),n=A.createSingle(t.layerId,t.experimentId,t.variationId);return function(){A.recordLayerDecision(i.layerId,i.decisionTicket,i.decision),w.log("API / Tracking decision event:",i),g.trackDecisionEvent(i.decision,i.decisionTicket,n)}}function o(e){var t=b.create(e.eventData.id,e.eventData.apiName),i=b.createState(t.id);return function(){var e=g.trackViewActivation(t,i);e?w.log("API / Tracking pageview event:",e):w.log("API / Not tracking pageview event:",e)}}var s=i(2),u=i(7),c=i(89),l=i(90),d=i(107),f=i(25),g=i(108),p=i(115),h=i(6),_=i(76).create,v=i(24),E=i(116),m=i(118),I=i(119),y=i(103),S=i(9),T=i(26),A=i(111),w=i(23),R=i(120),D=i(112),b=i(121),O=i(74),N=i(16),C=N.get("stores/dimension_data"),P=N.get("stores/view"),L=N.get("stores/view_data"),V=N.get("stores/visitor_id"),k=N.get("stores/layer_data"),x=N.get("stores/directive"),F=!0,M=!1,U=F||M,G=86400,B=90,z=t.ApiListenerError=_("ApiListenerError");t.event=function(e){var t;switch(e.eventType){case"click":t=r(e);break;case"decision":t=a(e);break;case"pageview":t=o(e);break;case"custom":default:t=n(e)}V.getBucketingId()?t():S.dispatch(u.ADD_CLEANUP_FN,{lifecycle:f.Lifecycle.postActivate,cleanupFn:t})},t.clientMetadata=function(e){U&&(S.dispatch(u.SET_CLIENT_NAME,e.clientName),S.dispatch(u.SET_CLIENT_VERSION,e.clientVersion)),F&&e.forceVariationIds&&S.dispatch(u.LOAD_DIRECTIVE,{forceVariationIds:e.forceVariationIds})},t.priorRedirectString=function(e){U&&D.load(e.value)},t.microsnippetError=function(e){if(U){var t=e.errorData.metadata&&e.errorData.metadata.err||{};t.name=e.errorData.code;var i={engine:e.engine,msVersion:e.errorData.msVersion,requestId:e.errorData.requestId,projectId:e.errorData.projectId,snippetKey:e.errorData.snippetKey,args:e.errorData.args};m.handleError(t,i)}},t.rum=function(e){S.dispatch(u.SET_RUM_DATA,e.eventData)},t.initialViewStates=function(e){var t=s.map(e.states,(function(e,t){return{id:t,isActive:e}}));b.registerViews(t)},t.page=function(e){var t=L.getByApiName(e.pageName);if(!t)throw new Error('Unknown page "'+e.pageName+'"');var i=!e.hasOwnProperty("isActive")||e.isActive,n=function(){i?b.activateViaAPI(t,e.tags):(b.deactivate(t),w.log("API / Deactivated Page",b.description(t)))};V.getBucketingId()?n():S.dispatch(u.ADD_CLEANUP_FN,{lifecycle:f.Lifecycle.postViewsActivated,cleanupFn:n})},t.tags=function(e){b.setGlobalTags(e.tags)},t.user=function(e){U&&e.visitorId&&(V.getBucketingId()?(w.log("API / Setting visitor Id:",e.visitorId),O.setId({randomId:e.visitorId})):(w.log("API / Setting visitor Id for activation:",e.visitorId),S.dispatch(u.SET_VISITOR_ID_VIA_API,e.visitorId))),F&&s.each(["IP","location","queryParams","url"],(function(t){e[t]&&(w.log("API / Setting",t,":",e[t]),j(t,e[t],!1))})),w.log("API / Setting visitor custom attributes:",e.attributes),s.each(e.attributes,(function(e,t){var i,n,r=t,a=C.getById(t)||C.getByApiName(t);a&&(r=a.id,i=a.apiName,n=a.segmentId||a.id);var o={id:n,value:e};i&&(o.name=i),j(r,o,!0)}))};var j=function(e,t,i){var n=[{key:i?["custom",e]:[e],value:t,metadata:{lastModified:v.now()}}],r=function(){S.dispatch(u.SET_VISITOR_ATTRIBUTES,{attributes:n})};V.getBucketingId()?r():S.dispatch(u.ADD_CLEANUP_FN,{lifecycle:f.Lifecycle.postVisitorProfileLoad,cleanupFn:r})};t.optOut=function(e){var t=!e.hasOwnProperty("isOptOut")||e.isOptOut;E.setOptOut(t)},t.cookieExpiration=function(e){var t=e.cookieExpirationDays;t');var s=n.querySelector("#"+o);if(!s)throw new Error("Document.write failed to append script");s.onload=i,s.onerror=function(n){r.warn("Failed to load script ("+e+") synchronously:",n),t.addScriptAsync(e,i)}}catch(n){r.debug("Document.write failed for "+e+": "+n.message);var u=function(e){var t=new Function(e.responseText);t(),i&&i()};return a.request({url:e,async:!1,contentType:"text/plain",success:u})["catch"]((function(n){r.error("Failed to load "+e+" via synchronous XHR: "+n.message),t.addScriptAsync(e,i)}))}}}),(function(e,t,i){function n(){var e=null;D.isNumber(e)&&0===_e.getCount()?($.log("Activating after delay of",e,"ms because no Experiments are running"),q.dispatch(P.SET_RUM_DATA,{data:{activateDfd:!0}}),ue.setTimeout(V.emitActivateEvent,e)):V.emitActivateEvent()}function r(e){be.handleError(e.data.error,e.data.metadata)}function a(){D.isArray(window.optimizely)&&(window.optimizely=D.filter(window.optimizely,(function(e){var t=!0;return!De.push(e,t)})))}function o(){var e=i(146),n=!!se.getCurrentId(),r=!!n&&se.hasSomeData();n?r?$.log("xd / Existing visitor; has data on this origin"):$.log("xd / Existing visitor; new to this origin"):$.log("xd / New visitor");var a=pe.getAccountId(),o="https://__SUBDOMAIN__cdn.optimizely.com".replace("__SUBDOMAIN__","a"+a+"."),u="/client_storage/a"+a+".html";e.subscribe((function(e,t){se.checkKeyForVisitorId(e)&&Q.setItem(e,t)}));var c=e.fetchAll().then((function(t){if(!Ae.getVisitorIdLocator()){var i=Re.getCanonicalOrigins();if(i){var n=e.getXDomainUserId(t,i);n&&($.log("Syncing cross-origin visitor randomId:",n),se.maybePersistVisitorId({randomId:n}))}}return se.deleteOldForeignData(),t})).then(t.persistItemsWithId).then((function(e){if(se.loadForeignData(),n&&!r){var t=!D.isEmpty(e);$.debug("xd / Loaded foreign data? ",t),s(t)}$.log("Loaded visitor data from foreign origins"),V.emitOriginsSyncedEvent()}),(function(e){throw n&&!r&&($.debug("xd / Failed to load foreign data:",e),s(!1,e)),e}));return ie.all([e.load(o,u)["catch"]((function(e){throw $.debug("xd / Failed to load iframe:",e),n&&!r&&s(!1,e),e})),c["catch"]((function(e){$.debug("xd / Ignored error syncing foreign data (expected if waitForOriginSync used):",e.message),$.debug("xd / Enqueuing sync to happen after visitorId set."),q.dispatch(P.ADD_CLEANUP_FN,{lifecycle:j.Lifecycle.postVisitorProfileLoad,cleanupFn:V.emitOriginsSyncedEvent})}))])}function s(e,t){q.dispatch(P.SET_RUM_DATA,{data:{extras:{xdAttempt:e,xdError:t?t.toString():void 0}}})}function u(e){var t=ye.getVisitorProfile();return se.populateEagerVisitorData(e,t)}function c(e,t,i){e=e||[];var n=me.getAllPlugins(j.PluginTypes.visitorProfileProviders),r=pe.getGlobalHoldbackThreshold(),a=ye.getVisitorProfile();se.populateLazyVisitorData(n,a);var o=Ae.getBucketingId();if(!o)throw new Error("bucketingId not set");var s,u=ye.getVisitorProfile();if(t&&!Pe){var c=we.getVariationIdMap();s=c[t.id]}var l={bucketingId:o,visitorProfile:u,audiences:e,globalHoldback:r,preferredVariationMap:s,layer:t};return t&&i&&U.isPageIdRelevant(t)?D.map(i,(function(e){return U.createTicket(D.extend({},l,{pageId:e}))})):[U.createTicket(l)]}function l(e){return{bucketingId:Ae.getBucketingId(),preferredLayerId:we.getPreferredLayerMap()[e.id]}}function d(e){var i=_e.getAllByPageIds(e),n=ge.getForceVariationIds(),r=ge.getForceAudienceIds(),a=!D.isEmpty(n);a&&$.log("Force variations are in use. Disabling mutual exclusivity.");var o=a?{individual:i}:D.reduce(i,(function(e,t){return t.groupId?e.groups[t.groupId]||(e.groups[t.groupId]=he.get(t.groupId)):e.individual.push(t),e}),{groups:{},individual:[]});$.log("Deciding Campaigns/Experiments for Page(s)",e);var s=D.map(o.groups,W.description).join(", ");$.log("Groups:",s);var u=D.map(o.individual,X.description).join(", ");$.log("Campaigns/Experiments not in Groups (by Campaign id):",u);var c=D.map(o.groups,D.partial(f,n,r,e))||[],l=D.map(o.individual,(function(i){var a=D.filter(i.pageIds,D.partial(D.includes,e));return t.decideAndExecuteLayerASAP(n,r,a,i)})),d=c.concat(l);return ie.all(d).then((function(t){var i=D.filter(t,(function(e){return!!e}));return $.log("All Campaigns/Experiments for Page(s) (by Campaign id)",e,"resolved:",D.map(i,X.description).join(", ")),i}))}function f(e,i,n,r){try{var a=l(r),o=U.decideGroup(r,a);if(o.reason)return $.debug("Not activating Group",W.description(r),"; reason:",o.reason),Ie.getSampleRum()&&q.dispatch(P.RECORD_LAYER_FEATURE_USAGE,{feature:"mutex",entityId:r.id}),ie.resolve();var s=_e.get(o.layerId);if(!s)return $.debug("Visitor was bucketed into a Campaign ("+o.layerId+") which is not in this snippet"),ie.resolve();var u=D.filter(s.pageIds,D.partial(D.includes,n));return D.isEmpty(u)?($.debug("Not activating Group",W.description(r),"; reason: visitor was bucketed into a Campaign/Experiment not related to the currently-activating Page(s)"),ie.resolve()):(Ie.getSampleRum()&&q.dispatch(P.RECORD_LAYER_FEATURE_USAGE,{feature:"mutex",entityId:r.id}),t.decideAndExecuteLayerASAP(e,i,u,s))}catch(e){return $.error("Error getting decision for Group",W.description(r),"; ",e),ie.reject(e)}}function g(e,t,i,n){return new ie(function(r,a){try{E(n,e,t,i,(function(a){D.each(a,(function(r){var a=r.pageId?[r.pageId]:i;$.debug("Deciding layer: ",n,"with decisionTicket: ",r,"and actionViewIds: ",a),p(n,e,t,a,r)})),r(n)}))}catch(e){$.error("Error getting decision for Campaign: "+X.description(n),e),a(e)}})}function p(e,i,n,r,a){var o=X.description(e);$.log("Activating Campaign",o,"on Page(s)",r),n.length&&($.log("Applying force audienceIds:",n,"to Campaign",o),a=D.cloneDeep(a),a.audienceIds=n);var s=t.decideLayer(e,a,i),u=!(!i.length&&!n.length),c=t.getActionsForDecision(e,s,u),l=R(c.actions,r);if(c.maybeExecute&&h(l,e,s,r),D.forEach(r,(function(){L.trackDecisionEvent(s,a)})),V.emitLayerDecided({layer:e,decisionTicket:a,decision:s}),s.error)throw s.error;if(Ie.getSampleRum()){q.dispatch(P.RECORD_LAYER_POLICY_USAGE,{policy:e.policy,layerId:e.id});var d=v(c.actions);q.dispatch(P.RECORD_CHANGE_TYPE_USAGE,{changeTypes:D.keys(d),layerId:e.id}),D.isEmpty(e.integrationSettings)||q.dispatch(P.RECORD_INTEGRATION_USAGE,{integrations:X.getIntegrationTypes(e),layerId:e.id})}return U.isInCohort(s)?void(c.maybeExecute&&_(l,e,s,r)):void $.log("Not activating Campaign: "+X.description(e)+"; not in the cohort because:",s.reason)}function h(e,t,i,n){var r=X.description(t);$.log("Preparing actions",e,"for Campaign",r,"on Page(s)",n),D.forEach(e,C.prepareAction)}function _(e,t,i,n){var r=X.description(t);return $.log("Executing actions",e,"for Campaign",r,"on Page(s)",n),ie.all(D.map(e,(function(e){return C.executePreparedAction(e).then(D.partial(V.emitActionAppliedEvent,e))}))).then((function(){$.log("All page actions for",i,"applied:",e),V.emitActionsForDecisionAppliedEvent(i,e)}))["catch"]((function(e){$.warn("Error evaluating page actions for decision",i,"because:",e)}))}function v(e){var t={};return D.each(e,(function(e){D.each(e.changeSet,(function(e){t[e.type]||(t[e.type]=!0)}))})),t}function E(e,t,i,n,r){if(t.length||i.length)return void r(c([],void 0,n));var a=X.relatedAudienceIds(e),o=D.reduce(a,(function(e,t){var i=le.get(t);return i&&e.push(i),e}),[]),s=me.getAllPlugins(j.PluginTypes.audienceMatchers);if(Ie.getSampleRum()){var u={};if(D.each(o,(function(e){D.extend(u,m(e.conditions,s))})),!D.isEmpty(u)){var l=D.keys(u);q.dispatch(P.RECORD_AUDIENCE_USAGE,{audienceTypes:l,layerId:e.id})}}S(o,s,X.getActivationTimeout(e),(function(){var t=c(o,e,n);D.map(t,(function(t){I(t,o,e)})),r(t)}))}function m(e,t){var i={};return D.each(e,(function(e){D.isArray(e)?D.extend(i,m(e,t)):D.isObject(e)&&t[e.type]&&(i[e.type]=!0)})),i}function I(e,t,i){var n=D.map(e.audienceIds,D.bind(le.get,le)),r=D.filter(t,(function(t){return!D.includes(e.audienceIds,t.id)}));$.log("When deciding Campaign",X.description(i),"visitor is in audiences:",y(n),"and not in audiences:",y(r))}function y(e){var t=[];return D.each(e,(function(e){t.push(e.name,e)})),t}function S(e,t,i,n){var r=D.reduce(e,(function(e,i){return D.extend(e,k.requiredAudienceFieldsForConditions(i.conditions,t))}),{}),a=D.reduce(r,(function(e,t){if(D.isUndefined(se.getAttribute(t))){var i=se.getPendingAttributeValue(t);D.isUndefined(i)||e.push(i)}return e}),[]);if(0===a.length)return n();var o=[].concat(e),s=ne.firstToResolve(D.map(a,(function(e){return ie.resolve(e).then((function(){var e=ye.getVisitorProfile();if(o=D.filter(o,(function(i){return D.isUndefined(k.isInAudience(e,i,t))})),!D.isEmpty(o))throw new Error("At least one audience is still pending")}))})));ie.race([s,new ie(function(e,t){ue.setTimeout(t,i)})]).then((function(){$.log("Activating Campaign after pending Audiences resolved",e),n()}),(function(){$.log("Activating Campaign after timeout on Audiences",e),n()}))}function T(e,t,i){var n,r=X.description(e);return n=i.length?U.getDummyLayerDecision(e,i):U.decideLayer(e,t),$.log("Recording decision for Campaign",r,t,"->",n),X.recordLayerDecision(e.id,t,n),Pe||(n.variationId&&n.experimentId&&se.updateVariationIdMap(e.id,n.experimentId,n.variationId),e.groupId&&se.updatePreferredLayerMap(e.groupId,e.id)),n}function A(e){var t=fe.getCleanupFns(e);if(t.length>0){for(;t.length>0;)t.shift()();q.dispatch(P.CLEAR_CLEANUP_FN,{lifecycle:e})}}function w(e,t,i){var n=X.description(e),r="NOT applying changes for Campaign",a={actions:[],maybeExecute:!1};return a.actions=[].concat(de.getLayerActions(t.layerId)||[],de.getExperimentActions(t.experimentId)||[],de.getExperimentVariationActions(t.experimentId,t.variationId)||[]),!i&&pe.isGlobalHoldback()?($.log(r,n,"(visitor is in global holdback)"),a):t.isLayerHoldback?($.log(r,n,"(visitor is in layer holdback)"),a):t.experimentId&&t.variationId?(a.maybeExecute=!0,$.log("Got Actions for Campaign:",n,a.actions),a):($.log(r,n,"(visitor is not eligible for any Experiments)"),a)}function R(e,t){return D.filter(e,(function(e){return D.isUndefined(e.pageId)||D.includes(t,e.pageId)}))}var D=i(2),b=i(76).create,O=t.ActivationCodeError=b("ActivationCodeError"),N=t.ProjectJSError=b("ProjectJSError"),C=i(132),P=i(7),L=i(108),V=i(115),k=i(136),x=i(104),F=i(107),M=i(24),U=i(137),G=i(16),B=i(116),z=i(80),j=i(25),H=i(103),K=i(109),Y=i(142),q=i(9),W=i(141),X=i(111),Q=i(81).LocalStorage,$=i(23),J=i(143),Z=i(83),ee=i(120),te=i(144),ie=i(12).Promise,ne=i(145),re=i(112),ae=(i(114),i(134)),oe=i(121),se=i(74),ue=i(40),G=i(16),ce=G.get("stores/session"),le=G.get("stores/audience_data"),de=G.get("stores/action_data"),fe=G.get("stores/cleanup"),ge=G.get("stores/directive"),pe=G.get("stores/global"),he=G.get("stores/group_data"),_e=G.get("stores/layer_data"),ve=G.get("stores/layer"),Ee=G.get("stores/pending_events"),me=G.get("stores/plugins"),Ie=G.get("stores/rum"),ye=G.get("stores/visitor"),Se=G.get("stores/view_data"),Te=G.get("stores/view"),Ae=G.get("stores/visitor_id"),we=G.get("stores/visitor_bucketing"),Re=G.get("stores/xdomain"),De=i(89),be=i(118),Oe=i(1),Ne=1e3,Ce=!1,Pe=!0,Le=!1,Ve=Pe||Le,ke=t;t.initialize=function(e){return this.initGlobalStore(e.clientData),this.initializePlugins(e.plugins)},t.initGlobalStore=function(e){var e=e;F.normalizeClientData(e),H.on({filter:{type:"error"},handler:r}),q.dispatch(P.DATA_LOADED,{data:e}),$.log("Initialized with DATA:",e)},t.initializePlugins=function(e){if(a(),B.setOptOut(ge.shouldOptOut()),ge.isDisabled()||ge.shouldOptOut())return void $.log("Controller / Is disabled");if(Oe.queueBeacons(),z.isReady()?q.dispatch(P.SET_DOMCONTENTLOADED):z.addReadyHandler((function(){q.dispatch(P.SET_DOMCONTENTLOADED)})),!Ve){Z.time("projectJS");var i=pe.getProjectJS();if(D.isFunction(i))try{Y.apply(i)}catch(e){$.error("Error while executing projectJS: ",e),x.emitError(new N(e))}Z.timeEnd("projectJS")}D.each(e||[],(function(e){try{e(ee)}catch(e){x.emitInternalError(e)}})),D.each(pe.getPlugins()||[],(function(e){try{Y.apply(e,[ee])}catch(e){x.emitError(e)}})),re.load();var r=H.on({filter:{type:"lifecycle",name:"activated" },handler:function(){ye.observe(se.persistVisitorProfile),ve.observe(se.persistLayerStates),ce.observe(se.persistSessionState),Ee.observe(J.persistPendingEvents),Pe||we.observe(se.persistVisitorBucketingStore),H.off(r)}});H.on({filter:{type:"lifecycle",name:"viewsActivated"},handler:t.onViewsActivated}),H.on({filter:{type:"lifecycle",name:"pageDeactivated"},handler:t.onPageDeactivated}),t.initializeApi();var o=J.getPendingEvents();if(o&&(q.dispatch(P.LOAD_PENDING_EVENTS,{events:o}),J.retryPendingEvents(o)),H.on({filter:{type:"lifecycle",name:"activate"},handler:t.activate}),V.emitInitializedEvent(),!ge.shouldActivate())return ie.resolve();var s=[];return n(),ie.all(s)},t.activate=function(){try{var e=[];$.log("Activated client"),A(j.Lifecycle.preActivate);var t=M.now();q.dispatch(P.ACTIVATE,{activationId:String(t),activationTimestamp:t});var i=Se.getAll();oe.registerViews(i),se.setId(se.getOrGenerateId()),e.push(L.trackPostRedirectDecisionEvent()),q.dispatch(P.MERGE_VARIATION_ID_MAP,{variationIdMap:se.getVariationIdMap()}),q.dispatch(P.MERGE_PREFERRED_LAYER_MAP,{preferredLayerMap:se.getPreferredLayerMap()}),A(j.Lifecycle.postVisitorProfileLoad),e.push(u(me.getAllPlugins(j.PluginTypes.visitorProfileProviders)).then((function(){$.log("Populated visitor profile")})));var n=c(),r=U.decideGlobal(n);$.log("Made global decision",n,"->",r),q.dispatch(P.RECORD_GLOBAL_DECISION,r);var a=L.trackClientActivation();a?$.log("Tracked activation event",a):$.log("Not tracking activation event");var o=ke.setUpViewActivation(i),s=[];return Ce?s=oe.activateMultiple(o):D.each(o,(function(e){s=s.concat(oe.activateMultiple([e]))})),Pe&&Ie.getSampleRum()&&q.dispatch(P.RECORD_VIEWS_INITIALLY_ACTIVATED_COUNT,{viewsInitiallyActivatedCount:s.length}),A(j.Lifecycle.postViewsActivated),A(j.Lifecycle.postActivate),V.emitActivatedEvent(),ie.all(e).then((function(){H.emit({type:K.TYPES.LIFECYCLE,name:"activateDeferredDone"}),$.log("All immediate effects of activation resolved")}),x.emitError)}catch(e){return x.emitError(e),ie.reject(e)}},ke.setUpViewActivation=function(e){var t=[];return D.each(e,(function(e){D.isBoolean(Te.getViewState(e.id).isActive)&&oe.isActivationTypeImmediate(e.activationType)?$.debug("Skipping page: already evaluated, presumably at the edge",oe.description(e)):oe.shouldTriggerImmediately(e.activationType)?t.push(e):e.activationType===j.ViewActivationTypes.callback?($.debug("Setting up conditional activation for Page",oe.description(e)),ke.activateViewOnCallback(e)):e.activationType===j.ViewActivationTypes.polling?($.debug("Setting up polling activation for Page",oe.description(e)),te.pollFor(D.partial(Y.apply,e.activationCode),null,D.partial(ae.isTimedOut,M.now())).then((function(){oe.activateMultiple([e])}))["catch"]((function(t){$.warn("Failed to activate view ",e,t)}))):e.activationType!==j.ViewActivationTypes.manual&&x.emitError(new Error("Unknown view activationType: "+e.activationType))})),t},ke.activateViewOnCallback=function(e){var t=function(t){var i=D.extend({},t,{pageName:e.apiName,type:"page"});De.push(i)},i={pageId:e.id};Object.defineProperty(i,"isActive",{get:function(){return Te.isViewActive(e.id)}});try{Y.apply(e.activationCode,[t,i])}catch(t){var n=new O("("+t.toString()+") in activationCode for "+oe.description(e));x.emitError(n,{originalError:t,userError:!0})}},t.onViewsActivated=function(e){var t,i=e.data.views,n=D.map(i,"id");try{if(!Ae.getBucketingId())throw new Error("View activated with no visitorId set");var r=d(n)["catch"](x.emitError);return t=ie.all(D.map(i,(function(e){var t=function(){oe.parseViewTags(e);var t=L.trackViewActivation(e);t?$.log("Tracked activation for Page",oe.description(e),t):$.log("Not Tracking activation for Page",oe.description(e))};return z.isReady()?ie.resolve(t()):te.pollFor(z.isReady,Ne).then(t)}))),ie.all([r,t])}catch(e){x.emitError(e)}},t.onPageDeactivated=function(e){var t=e.data.page,i=de.getAllActionIdsByPageId(t.id);D.each(i,(function(e){var i=de.getActionState(e);i&&(D.each(i,(function(e,i){if(e.cancel)try{e.cancel(),$.debug("Controller / Canceled change",i,"observation due to deactivation of page:",t)}catch(e){$.error("Controller / Error canceling change",i,"observation upon deactivation of page.",e)}if(t.undoOnDeactivation&&e.undo)try{e.undo(),$.debug("Controller / Undid change",i,"due to deactivation of page:",t)}catch(e){$.error("Controller / Error undoing change upon deactivation of page.",e)}})),q.dispatch(P.REMOVE_ACTION_STATE,{actionId:e}),$.debug("Controller / Undid changes and/or canceled change observation due to deactivation of page:",t,e))}))},t.initializeApi=function(){var e={push:De.push};Le||(e.get=De.get);var t=window.optimizely;D.isArray(t)&&D.each(t,(function(t){e.push(t)})),e.data={note:"Obsolete, use optimizely.get('data') instead"},e.state={},window.optimizely=e},t.persistItemsWithId=function(e){return D.each(e,(function(e,t){se.checkKeyForVisitorId(t)&&Q.setItem(t,e)})),e},t.initializeXDomainStorage=o,t.decideAndExecuteLayerASAP=g,t.decideLayer=T,t.getActionsForDecision=w}),(function(e,t,i){function n(e,t,i){var n=v.getActionState(t.id);if(!n)return void g.warn("Action / Attempted to prepare change for inactive action: ",t);var r=v.getChangeApplier(e.id,t.id);if(!a.isUndefined(r))return void g.warn("Action / Attempted to prepare a change which is already being applied: ",e);var s={changeId:e.id,actionId:t.id,changeApplier:I.create(e,t,i)};f.dispatch(o.SET_CHANGE_APPLIER,s)}function r(e,t,i,o){if(a.includes(o,t))return void g.error("Change with id "+t+" has circular dependencies: "+o.concat(t));if(!e[t]){var c=E.getChange(t);if(!c){var d="Change with id "+t+" is absent";return o.length&&(d+=" but listed as a dependency for "+o[o.length-1]),void g.warn(d)}e[t]=new p(function(d){var f=a.map(c.dependencies||[],(function(n){return r(e,n,i,o.concat([t]))}));if(c.src){var _="change_"+c.src,m=u.makeAsyncRequest(_,(function(){return h.addScriptAsync("https://cdn.optimizely.com/public/148927072/data"+c.src,(function(){u.resolveRequest(_)}))})).then((function(){var e=E.getChange(c.id);e||s.emitError(new S("Failed to load async change from src: "+c.src)),n(e,i,l.now())}));f.push(m)}p.all(f).then((function(){var e=l.now(),n=v.getChangeApplier(t,i.id);return n?(g.debug("Action / Applying change:",c),n.apply().then((function(t){t?g.log(t):g.debug("Action / Applied change for the first time in "+(l.now()-e)+"ms:",c),d()}))):(g.debug("Action / Not applying change ",t," - No changeApplier found."),void d())}))["catch"]((function(e){g.error("Action / Failed to apply change:",c,e),d()}))})}return e[t]}var a=i(2),o=i(7),s=i(104),u=i(6),c=i(76).create,l=i(24),d=i(16),f=i(9),g=i(23),p=i(12).Promise,h=i(130),_=d.get("stores/global"),v=d.get("stores/action_data"),E=d.get("stores/change_data"),m=d.get("stores/session"),I=i(133),y=i(134);y.initialize();var S=c("ActionError");t.prepareAction=function(e){g.debug("Action / Preparing:",e),f.dispatch(o.ACTION_EXECUTED,{actionId:e.id,sessionId:m.getSessionId(),layerId:e.layerId,pageId:e.pageId,timestamp:l.now(),activationId:_.getActivationId()});var t=l.now();a.forEach(e.changeSet,(function(i){var r=a.isObject(i)?i.id:i,s=E.getChange(r);s||(f.dispatch(o.ADD_CHANGE,i),s=E.getChange(i.id)),s.src||n(s,e,t)}))},t.executePreparedAction=function(e){g.debug("Action / Executing:",e);var t={},i=a.map(e.changeSet,(function(i){var n=a.isObject(i)?i.id:i;return r(t,n,e,[])}));return p.all(i).then((function(){g.debug("changes for action id="+e.id+" applied")}))}}),(function(e,t,i){var n=i(13).Promise,r=i(24),a=i(16),o=a.get("stores/plugins"),s=i(25),u=i(23);t.create=function(e,t,i){var a={identifier:e.id,action:t,startTime:i||r.now()};try{var c=o.getPlugin(s.PluginTypes.changeAppliers,e.type);if(!c)throw new Error("Unrecognized change type "+e.type);return new c(e,a)}catch(e){u.error("Change applier was never properly constructed:",e);var l={apply:function(){return n.reject(e)}};return l}}}),(function(e,t,i){function n(){"interactive"!==document.readyState&&"complete"!==document.readyState||(t.domReadyTime=Date.now())}var r=i(135),a=i(16).get("stores/directive");t.domReadyTime=null,t.initialize=function(){n(),document.addEventListener("readystatechange",n,!0)},t.isTimedOut=function(e){var i=Date.now();if(!t.domReadyTime||!e)return!1;var n=Math.max(e,t.domReadyTime);return a.isEditor()&&(n=t.domReadyTime),!(i-n -1)return{experimentId:e.experiments[i].id,variationId:e.experiments[i].variations[n].id};return null}function a(e){var t=y.getPlugin(h.PluginTypes.deciders,e);if(s.isEmpty(t))throw new Error("No deciders found for policy: "+e);return t}function o(e,t){var i=y.getAllPlugins(h.PluginTypes.audienceMatchers);return s.reduce(t,(function(t,n){return l.isInAudience(e,n,i)&&t.push(n.id),t}),[])}var s=i(2),u=i(7),c=i(104),l=i(136),d=i(138),f=i(139),g=i(140).DecisionError,p=i(16),h=i(25),_=i(9),v=i(141),E=i(111),m=i(23),I=i(44),y=p.get("stores/plugins"),S=p.get("stores/global"),T=p.get("stores/layer_data");t.isPageIdRelevant=function(e){if(!e)return!1;var t=a(e.policy);return s.isFunction(t.includePageIdInDecisionTicket)?t.includePageIdInDecisionTicket(e):t.includePageIdInDecisionTicket===!0},t.createTicket=function(e){var t=s.pick(e,["bucketingId","globalHoldback","preferredVariationMap","pageId"]);return s.extend(t,{audienceIds:o(e.visitorProfile,e.audiences),activationId:S.getActivationId()}),t},t.decideGlobal=function(e){var t=d.isHoldback(e.bucketingId,{id:null,holdback:e.globalHoldback});return{isGlobalHoldback:t}},t.decideGroup=n,t.decideLayer=function(e,t){m.debug("Deciding: ",e,t);var i,n,r=a(e.policy),o={layerId:e.id,experimentId:null,variationId:null,isLayerHoldback:d.isHoldback(t.bucketingId,e)};if(s.isEmpty(e.experiments))throw new g("No experiments in layer.");try{if(r.decideLayer){m.debug("Decision / Using decider's custom decideLayer.");var u=r.decideLayer(e,t);i=u.experiment,n=u.variation}else m.debug("Decision / Using default decideLayer behavior."),i=r.selectExperiment(e,t.audienceIds,t.bucketingId),n=f.selectVariation(i,t.audienceIds,t.bucketingId,t.activationId,t.preferredVariationMap)}catch(e){e instanceof g?o.reason=e.message:o.error=e}return o.experimentId=i?i.id:null,o.variationId=n?n.id:null,o.error&&(o.error.name="DecisionEngineError",c.emitError(o.error)),o},t.getDummyLayerDecision=function(e,t){var i,n=r(e,t);return n?(m.log("Decision / Applying force variation:",n.variationId,"to Campaign",E.description(e)),i={layerId:e.id,variationId:n.variationId,experimentId:n.experimentId,isLayerHoldback:!1,reason:"force"}):(m.log("No variation matches ids:",t,"in Campaign",E.description(e)),i={layerId:e.id,variationId:null,experimentId:null,isLayerHoldback:!1,reason:"force"}),i},t.isInCohort=function(e){if(!e.experimentId||!e.variationId)return!1;var t=T.get(e.layerId);return!(I.isSingleExperimentPolicy(t.policy)&&e.isLayerHoldback)}}),(function(e,t,i){var n=i(64),r=t.TOTAL_POINTS=1e4;t.bucketingNumber=function(e,t,i){var a=n.hashToInt(e+t,i,r);return a},t.isHoldback=function(e,i){return t.bucketingNumber(e,i.id,n.Seed.IGNORING)<(i.holdback||0)},t.chooseWeightedCandidate=function(e,i,r){for(var a=t.bucketingNumber(e,i,n.Seed.BUCKETING),o=0;o a)return r[o].entityId;throw new Error("Unable to choose candidate")}}),(function(e,t,i){var n=i(2),r=i(7),a=i(138),o=i(122),s=i(140).DecisionError,u=i(9),c=i(23),l="impression";t.isValidExperiment=function(e,t){var i,r=n.partial(n.includes,e);return c.groupCollapsed("Decision / Evaluating audiences for experiment:",t,e),i=!t.audienceIds||o.evaluate(t.audienceIds,r),c.groupEnd(),c.debug("Decision / Experiment",t,"is valid?",i),i},t.selectVariation=function(e,t,i,o,d){if(!e.variations||0===e.variations.length)throw new s('No variations in selected experiment "'+e.id+'"');if(!e.weightDistributions&&e.variations.length>1)throw new s('On selected experiment "'+e.id+'", weightDistributions must be defined if # variations > 1');var f;if(e.bucketingStrategy&&e.bucketingStrategy===l)if(1===e.variations.length)f=e.variations[0].id;else{var g=o;f=a.chooseWeightedCandidate(i+g,e.id,e.weightDistributions)}else if(f=1===e.variations.length?e.variations[0].id:a.chooseWeightedCandidate(i,e.id,e.weightDistributions),d&&d[e.id]){c.debug("Decision / Using preferredVariationMap to select variation for experiment:",e.id);var p=d[e.id];if(!n.find(e.variations,{id:p}))return u.dispatch(r.RECORD_STICKY_BUCKETING_FEATURE,{feature:"stoppedVariation",id:e.id}),c.debug("Decision / Preferred variation:",p,"not found on experiment:",e.id,". Visitor not bucketed."),null;p!==f&&(u.dispatch(r.RECORD_STICKY_BUCKETING_FEATURE,{feature:"preferredVariation",id:e.id}),f=p)}var h=n.find(e.variations,{id:f});if(h)return c.debug("Decision / Selected variation:",h),h;throw new s('Unable to find selected variation: "'+f+'".')},t.getExperimentById=function(e,t){var i=n.find(e.experiments,{id:t});if(i)return i;throw new s("Unable to find selected experiment.")},t.hasVariationActionsOnView=function(e,t){return c.debug("Decision / Checking variation:",e,"for actions on pageId:",t),!!n.find(e.actions,(function(e){return e.pageId===t&&!n.isEmpty(e.changes)}))}}),(function(e,t){function i(e){this.message=e}i.prototype=new Error,t.DecisionError=i}),(function(e,t,i){function n(e){return r.map(e.weightDistributions,"entityId")}var r=i(2);t.description=function(e){var t=!!e.name,i=t?'"'+e.name+'" ':"",r=n(e).join(", ");return i+"(id "+e.id+", campaigns: "+r+")"}}),(function(module,exports,__webpack_require__){var createError=__webpack_require__(77),di=__webpack_require__(16),Logger=__webpack_require__(23),CSP_MODE=!1,EXEC_WITH_JQUERY=!0,ExecError=exports.Error=createError("ExecError");exports.apply=function(e,t){t=t||[],EXEC_WITH_JQUERY&&(t=t.concat(di.get("env/jquery")));try{return e.apply(void 0,t)}catch(i){throw Logger.warn("Error applying function",e,"with args:",t,i),new ExecError(i)}},exports.eval=function(str){if(CSP_MODE)throw new ExecError("eval is not supported in CSP mode");try{return EXEC_WITH_JQUERY&&(str="var $ = optimizely.get('jquery');"+str),eval(str)}catch(e){throw Logger.warn("Error executing JS:",str,e),new ExecError(e)}}}),(function(e,t,i){var n=i(2),r=i(104),a=i(25),o=i(26),s=i(81).LocalStorage,u=i(23),c=i(87),l=i(16),d=l.get("stores/pending_events"),f=a.StorageKeys.PENDING_EVENTS;t.persistPendingEvents=function(){try{var e=d.getEventsString();s.setItem(f,e)}catch(e){u.warn("PendingEvents / Unable to set localStorage key, error was: ",e),r.emitInternalError(e)}},t.getPendingEvents=function(){try{return o.parse(s.getItem(f))}catch(e){return null}},t.retryPendingEvents=function(e){n.forOwn(e,(function(e,t){c.retryableRequest(e.data,t,e.retryCount)})),n.isEmpty(e)||u.log("Retried pending events: ",e)}}),(function(e,t,i){var n=i(2),r=i(12).Promise,a=i(40),o=100,s=50;t.pollFor=function(e,t,i){var u,c;return n.isFunction(i)?c=i:(u=i||o,c=function(){return u--,u<-1}),t=t||s,new r(function(i,n){!(function r(){var o;if(!c()){try{var s=e();if(s)return i(s)}catch(e){o=e}return a.setTimeout(r,t)}n(o||new Error("Poll timed out"))})()})}}),(function(e,t,i){var n=i(2),r=i(12).Promise;t.firstToResolve=function(e){return new r(function(t){n.each(e,(function(e){r.resolve(e).then(t,(function(){}))}))})}}),(function(e,t,i){function n(e){var t;if(!o.find(I.getFrames(),{origin:e.origin}))return void m.debug("XDomain","No frame found for origin: "+e.origin);try{t=h.parse(e.data)}catch(t){return void m.debug("XDomain","Ignoring malformed message event:",e)}if("ERROR"===t.type)l.dispatch(u.XDOMAIN_SET_DISABLED,{disabled:!0}),d.emitInternalError(new y("Xdomain Error: "+t.response));else if("SYNC"===t.type)o.each(I.getSubscribers(),(function(e){e(t.response.key,t.response.value)}));else{var i=I.getMessageById(t.id);if(!i){if(m.warn("XDomain","No stored message found for ID",t.id),o.isNumber(t.id)){var n=I.getNextMessageId();t.id>=n?d.emitInternalError(new y("Message ID is greater than expected maximum ID ("+t.id+">"+n+")")):t.id<0?d.emitInternalError(new y("Message ID is < 0: "+t.id)):d.emitInternalError(new y("No stored message found for message ID: "+t.id))}else d.emitInternalError(new y("Message ID is not a number: "+t.id));return}if(!i.resolver)return void m.warn("XDomain","Message already resolved, ignoring:",t.id);i.resolver(t.response),l.dispatch(u.XDOMAIN_SET_MESSAGE,{messageId:t.id,message:{data:{id:t.id,type:i.data.type,key:i.data.key},startTime:i.startTime,endTime:g.now()}})}}function r(e,t){return t||(t=I.getDefaultFrame()),new s(function(i){var n={data:o.extend({},e,{id:I.getNextMessageId()}),resolver:i};t?I.isDisabled()||a(n,t):l.dispatch(u.XDOMAIN_SET_MESSAGE,{messageId:n.data.id,message:n})})}function a(e,t){var i=e.data;l.dispatch(u.XDOMAIN_SET_MESSAGE,{messageId:e.data.id,message:o.extend({},e,{startTime:g.now()})}),t.target.postMessage(h.stringify(i),t.origin)}var o=i(2),s=i(12).Promise,u=i(7),c=i(16),l=i(9),d=i(104),f=i(76).create,g=i(24),p=i(80),h=i(26),_=i(144),v=i(74),E=i(40),m=i(23),I=c.get("stores/xdomain"),y=t.Error=f("XDomainStorageError");t.setItem=function(e,t,i){return r({type:"PUT",key:e,value:t},i)},t.getItem=function(e,t){return r({type:"GET",key:e},t)},t.fetchAll=function(e){return r({type:"GETALL"},e)},t.deleteData=function(e,t){return r({type:"DELETE",visitorId:e},t)},t.subscribe=function(e){l.dispatch(u.XDOMAIN_ADD_SUBSCRIBER,{subscriber:e})},t.loadIframe=function(e,t){return new s(function(i){var n=p.createElement("iframe");n.src=e+t,n.hidden=!0,n.setAttribute("tabindex","-1"),n.setAttribute("title","Optimizely Internal Frame"),n.style.display="none",n.height=0,n.width=0,n.onload=function(){var r={id:I.getNextFrameId(),target:n.contentWindow,origin:e,path:t};l.dispatch(u.XDOMAIN_ADD_FRAME,r),i(r)},p.appendTo(p.querySelector("body"),n)})},t.getXDomainUserId=function(e,t){var i,n={},r=o.keys(e);return o.each(t,(function(e){n[e]=[],o.each(r,(function(t){var r=v.getUserIdFromKey(t,e);!i&&r&&(i=r),r&&!o.includes(n[e],r)&&n[e].push(r)}))})),m.debug("XDomain: Found userIds:",n),i},t.load=function(e,i){E.addEventListener("message",n);var r=function(){return!!p.querySelector("body")},s=function(){return t.loadIframe(e,i)};return _.pollFor(r).then(s).then((function(e){l.dispatch(u.XDOMAIN_SET_DEFAULT_FRAME,e),I.isDisabled()||o.each(I.getMessages(),(function(t){t.startTime||a(t,e)}))}))}}),(function(e,t,i){function n(e){var t=!1;if(a.isArray(window.optimizely)&&a.each(window.optimizely,(function(i){a.isArray(i)&&"verifyPreviewProject"===i[0]&&String(i[1])===e&&(t=!0)})),!t)throw new Error("Preview projectId: "+e+" does not match expected")}function r(){s.on({filter:{type:u.TYPES.ANALYTICS,name:"trackEvent"},handler:f}),s.on({filter:{type:u.TYPES.LIFECYCLE,name:"viewActivated"},handler:f}),s.on({filter:{type:u.TYPES.LIFECYCLE,name:"layerDecided"},handler:f}),s.on({filter:{type:"error"},publicOnly:!0,handler:f})}var a=i(2),o=i(16),s=i(103),u=i(109),c=i(40),l=o.get("stores/directive"),d="optimizelyPreview",f=function(e){var t=c.getGlobal(d);t.push(e)};t.initialize=function(e){l.isSlave()&&n(e),r()},t.setupPreviewGlobal=function(){c.getGlobal(d)||c.setGlobal(d,[])},t.pushToPreviewGlobal=function(e){f(e)}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(149))}}),(function(e,t){e.exports={provides:"visitorId",getter:["stores/visitor_id",function(e){return e.getRandomId()}]}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(151)),e.registerAudienceMatcher("behavior",i(153))}}),(function(e,t,i){var n=i(152);e.exports={provides:"events",isTransient:!0,getter:[function(){return n.getEvents()}]}}),(function(e,t,i){var n=i(2),r=i(72),a=i(16),o=a.get("stores/visitor_events"),s=1e3;t.getEvents=function(){var e=r.getEvents(),t=[].concat.apply([],n.values(o.getForeignEvents())),i=[].concat.apply([],n.values(o.getForeignEventQueues())),a=r.mergeAllEvents([e,t,i]);return a.slice(a.length-s)}}),(function(e,t,i){var n=i(2),r=i(26),a=i(154),o=i(155);e.exports={fieldsNeeded:["events"],match:function(e,t){var i=[],s=r.parse(t.value);return i=n.isUndefined(s.version)?[s]:a.buildFromSpecV0_1(s),n.every(i,(function(t){return o.isSatisfied(t,e.events)}))}}}),(function(e,t,i){function n(e){return e=(e||"").toString().trim(),g[e]||e}function r(e,t,i){var n={where:t};if(e.count&&(n["limit"]=e.count),e.modifier===s.FREQUENCY_FILTERS.MOST_FREQUENT){var r=s.getFieldKeyPathForSource(e.name,i),a=s.aggregate("count"),o=s.aggregateField("count"),l=s.groupField(r);return u.extend(n,{select:[{field:l}],groupBy:s.groupBy([r]),aggregate:[a],orderBy:[{field:o,direction:"DESC"}]})}return u.extend(n,{orderBy:[{field:[c.FIELDS.TIME],direction:"DESC"}]})}function a(e){var t=[];if(u.isUndefined(e))throw new Error("rule is undefined");if(!u.isObject(e))throw new Error("rule is not an Object");"0.2"!==e["version"]&&t.push('version: not "0.2"'),e["filter"]&&(u.isArray(e["filter"])?u.each(e["filter"],(function(e,i){var n=s.validateFieldKeyPathV0_2(e["field"],s.FieldPurpose.FILTER);n&&t.push("filter["+i+"]: "+n);var r=s.validateComparatorAndValue(e["comparator"],e["value"]);r&&t.push("filter["+i+"]: "+r)})):t.push("filter: not an array"));var i=[],n=[];if(e["sort"]&&(e["reduce"]&&e["reduce"]["aggregator"]&&"nth"!==e["reduce"]["aggregator"]&&t.push("sort: superfluous because we can apply aggregator "+l.stringify(e["reduce"]["aggregator"])+" to unsorted items"),u.isArray(e["sort"])?u.each(e["sort"],(function(e,r){var a=s.validateFieldKeyPathV0_2(e["field"],s.FieldPurpose.SORT);a&&t.push("sort["+r+"]: "+a),e["field"]&&"frequency"===e["field"][0]?i.push(e):n.push(e);var u=o(e["direction"]);u&&t.push("sort["+r+"]: "+u)})):t.push("sort: not an array"),i.length&&n.length&&t.push('sort: sorting by non-["frequency"] field is pointless because we are going to sort the picked values by ["frequency"]'),i.length&&!e["pick"]&&t.push('sort: sorting by ["frequency"] is impossible because no values have been picked')),e["pick"]){e["reduce"]&&"count"===e["reduce"]["aggregator"]&&t.push('pick: superfluous because we can apply aggregator "count" to raw events');var r=s.validateFieldKeyPathV0_2(e["pick"]["field"]);r&&t.push("pick: "+r)}if(e["reduce"]){var a=e["reduce"]["aggregator"],c="aggregator "+(l.stringify(a)||String(a)),d=e["reduce"]["n"],f="index "+(l.stringify(d)||String(d));u.includes(["sum","avg","max","min","count","nth"],a)||t.push("reduce: "+c+" is unknown"),u.includes(["sum","avg","max","min"],a)&&(e["pick"]||t.push("reduce: "+c+" is impossible to use because no values have been picked")),"nth"===a?((!u.isNumber(d)||isNaN(d)||parseInt(d,10)!==d||d<0)&&t.push("reduce: "+f+" is not a non-negative integer (mandated by "+c+")"),e["sort"]||t.push('reduce: aggregator "nth" is meaningless without a specific sort order')):u.isUndefined(d)||t.push("reduce: "+f+" is defined (not mandated by "+c+")")}if(t.length)throw new Error(t.join("\n"))}function o(e){var t="direction "+(l.stringify(e)||String(e));if(!u.includes(["ascending","descending"],e))return t+' is not "ascending" or "descending"'}var s=t,u=i(2),c={FIELDS:i(63).FIELDS,FIELDS_V0_2:i(63).FIELDS_V0_2},l=i(26),d=i(23),f=i(155);s.MILLIS_IN_A_DAY=864e5,s.aggregateField=function(e,t){return u.isString(t)&&(t=[t]),t=t||f.DEFAULT_FIELD,[f.generateAlias(e,t)]},s.groupField=function(e){return u.isString(e)&&(e=[e]),e=e||f.DEFAULT_FIELD,[e.join(".")]};var g={"<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","==":"eq"};s.fieldComparison=function(e,t,i){return e=n(e),u.isString(t)&&(t=[t]),"exists"===e?{op:e,args:[{field:t}]}:{op:e,args:[{field:t},{value:i}]}},s.relativeTimeComparison=function(e,t){return{op:n(e),args:[{op:"-",args:[{eval:"now"},{field:[c.FIELDS.TIME]}]},{value:t*s.MILLIS_IN_A_DAY}]}},s.rangeTimeComparison=function(e){return u.isArray(e)?{op:"between",args:[{field:[c.FIELDS.TIME]},{value:[e[0]||+new Date(0),e[1]||+new Date]}]}:(d.error("Rule builder","rangeTimeComparison passed invalid range",e),null)},s.groupBy=function(e){for(var t=[],i=0;i 0)throw new Error('A "pick" clause must not be specified with "count" or "most_recent", "most_frequent" modifiers'+l.stringify(e));return[r(e.pick,t,e.source)]}return i.length>0?i:[{where:t}]},s.buildFromSpecV0_2=function(e){a(e);var t={where:{op:"and",args:u.map(e["filter"]||[],(function(e){return"age"===e["field"][0]?s.relativeTimeComparison(e["comparator"]||"eq",e["value"]/s.MILLIS_IN_A_DAY):s.fieldComparison(e["comparator"]||"eq",s.convertFieldKeyPathFromSpecV0_2(e["field"]),e["value"])}))}};if(e["reduce"]&&"count"===e["reduce"]["aggregator"])return u.extend(t,{aggregate:[{op:"count",args:[{field:["*"]}]}],select:[{field:["_count_*"]}]});var i=[],n=[];if(e["sort"]&&(u.each(e["sort"],(function(e){u.includes(["ascending","descending"],e["direction"])&&(u.includes(["time","age"],e["field"][0])&&n.push(e),"frequency"===e["field"][0]&&i.push(e))})),n.length&&!i.length&&(t["orderBy"]=u.filter(u.map(n,(function(e){return"time"===e["field"][0]?{field:s.convertFieldKeyPathFromSpecV0_2(["time"]),direction:"ascending"===e["direction"]?"ASC":"DESC"}:"age"===e["field"][0]?{field:s.convertFieldKeyPathFromSpecV0_2(["time"]),direction:"ascending"===e["direction"]?"DESC":"ASC"}:void 0}))))),e["pick"]&&e["pick"]["field"]){var r=s.convertFieldKeyPathFromSpecV0_2(e["pick"]["field"]);if(e["reduce"]&&u.includes(["avg","max","min","sum"],e["reduce"]["aggregator"]))return u.extend(t,{aggregate:[{op:e["reduce"]["aggregator"],args:[{field:r}]}],select:[{field:[f.generateAlias(e["reduce"]["aggregator"],r)]}]});t=i.length?u.extend(t,{groupBy:[{field:r}],aggregate:[{op:"count",args:[{field:["*"]}]}],orderBy:[{field:["_count_*"],direction:"ascending"===i[0]["direction"]?"ASC":"DESC"}],select:[{field:[r.join(".")]}]}):u.extend(t,{select:[{field:r}]})}if(e["reduce"]&&"nth"===e["reduce"]["aggregator"]){var o=e["reduce"]["n"];if(u.isNumber(o)&&o>=0&&Number(o)===Math.floor(Number(o)))return u.extend(t,{offset:o,limit:1})}return t},s.convertFieldKeyPathFromSpecV0_2=function(e){return"tags"===e[0]&&"revenue"===e[1]?["r"]:[c.FIELDS_V0_2[e[0]]].concat(e.slice(1))},s.FieldPurpose={FILTER:"filter",SORT:"sort",PICK:"pick"},s.validateFieldKeyPathV0_2=function(e,t){var i="field "+(l.stringify(e)||String(e));if(!u.isArray(e)||!u.every(e,u.isString))return i+" is not an array of strings";if("tags"===e[0]&&e.length>2||"tags"!==e[0]&&e.length>1)return i+" includes too many strings";if("tags"===e[0]&&e.length<2)return i+" does not specify an exact tag";if(e.length<1)return i+" does not specify a top-level field";var n=u.keys(c.FIELDS_V0_2),r=["age","frequency"];return t===s.FieldPurpose.FILTER&&(n.push("age"),r=["frequency"]),t===s.FieldPurpose.SORT&&(n=["time","age","frequency"],r=["name","type","category","tags"]),u.includes(r,e[0])?i+" is not supported here":u.includes(n,e[0])?void 0:i+" is unknown"},s.validateComparatorAndValue=function(e,t){var i="comparator "+(l.stringify(e)||String(e)),n="value "+(l.stringify(t)||String(t));if(!u.isString(e)&&!u.isUndefined(e))return i+" is not a string";switch(e){case void 0:case"eq":case"is":case"contains":break;case"lt":case"gt":case"lte":case"gte":if(!u.isNumber(t))return n+" is not a number (mandated by "+i+")";break;case"in":if(!u.isArray(t))return n+" is not an array (mandated by "+i+")";break;case"between":if(!(u.isArray(t)&&2===t.length&&u.isNumber(t[0])&&u.isNumber(t[1])&&t[0]<=t[1]))return n+" is not a pair of increasing numbers (mandated by "+i+")";break;case"regex":if(!(u.isString(t)||u.isArray(t)&&2===t.length&&u.isString(t[0])&&u.isString(t[1])))return n+" is not a pattern string or a [pattern string, flags string] array (mandated by "+i+")";break;case"exists":if(!u.isUndefined(t))return n+" is not undefined (mandated by "+i+")"; break;default:return i+" is unknown"}}}),(function(e,t,i){var n=i(2),r=i(25),a=i(23),o=n.bind(a.log,a),s=i(24),u=i(19).getFieldValue,c=i(26),l=function(e,t,i){if(e.getValueOrDefault)return e.getValueOrDefault(t,i);if(!n.isArray(t))return i;var r=u(e,t);return"undefined"==typeof r&&(r=i),r},d=function(e){return"string"==typeof e?e.trim().toLowerCase():e};t.clause={WHERE:"where",GROUP_BY:"groupBy",AGGREGATE:"aggregate",HAVING:"having",ORDER_BY:"orderBy",SELECT:"select",OFFSET:"offset",LIMIT:"limit",FROM:"from"},t.DEFAULT_FIELD=["*"],t.booleanOperators={eq:function(e){var t=n.map(e,d);return t[0]==t[1]},is:function(e){return e[0]===e[1]},gt:function(e){return e[0]>e[1]},lt:function(e){return e[0] =e[1]},lte:function(e){return e[0]<=e[1]},"in":function(e){var t=n.map(e[1]||[],d);return n.includes(t,d(e[0]))},between:function(e){return e[1][0]<=e[0]&&e[0]<=e[1][1]},contains:function(e){var t=n.map(e,(function(e){return"string"==typeof e?e.toLowerCase():e}));return(t[0]||"").indexOf(t[1])!==-1},regex:function(e){try{var t,i;return n.isString(e[1])?(t=e[1],i="i"):(t=e[1][0]||"",i=e[1][1]||""),new RegExp(t,i).test(e[0])}catch(e){return a.error("Rules",'In operator "regex", error: '+(e.message||"invalid RegExp /"+[t,i].join("/"))),!1}},exists:function(e){return"undefined"!=typeof e[0]},and:function(e){return n.every(e,(function(e){return e}))},or:function(e){return n.some(e,(function(e){return e}))},not:function(e){return!e[0]}},t.arithmeticOperators={"+":function(e){return(e[0]||0)+(e[1]||0)},"-":function(e){return(e[0]||0)-(e[1]||0)},"/":function(e){return(e[0]||0)/(e[1]||1)},"%":function(e){return(e[0]||0)%(e[1]||1)}},t.aggregateOperators={sum:function(e,i){for(var n=e[0]||t.DEFAULT_FIELD,r=0,a=0;a c)return o}return 0})):(o("Rules","groupBy rule must be an array"),t)};t.rewrite=function(e){function i(e,s){if(n.isArray(e)&&("and"!==e[0]&&"or"!==e[0]&&"not"!==e[0]&&a.error("Rules","Unexpected operation "+e[0]+". Continuing optimistically."),e={op:e[0],args:e.slice(1)}),e.hasOwnProperty("field")||e.hasOwnProperty("value")||e.hasOwnProperty("eval"))return e;if(s&&e["op"]in t.aggregateOperators){var u=(e["args"]&&e["args"][0]||{})["field"]||t.DEFAULT_FIELD,c=t.generateAlias(e["op"],u);return c in o||(r.push({op:e["op"],args:e["args"]}),o[c]=!0),{field:[c]}}for(var l=[],d=e["args"]||[],f=0;f 0)&&(s[t.clause.AGGREGATE]=(e[t.clause.AGGREGATE]||[]).concat(r));for(var u=[t.clause.GROUP_BY,t.clause.ORDER_BY,t.clause.SELECT,t.clause.OFFSET,t.clause.LIMIT],c=0;c 0&&(r=n.map(r,(function(e){return"Sub-rule "+i+": "+e}))),e.hasOwnProperty(t.clause.FROM)&&(r=r.concat(m(e[t.clause.FROM],i+1))),r},I=function(e,t){return n.map(t,(function(t){return n.map(e,(function(e){return p(t,e)}))}))},y=function(e,i){var r=i;if(e.hasOwnProperty(t.clause.FROM)&&(a.debug("Evaluating FROM clause:",e[t.clause.FROM]),r=y(e[t.clause.FROM],r),a.debug("Results after FROM:",r)),a.debug("Evaluating WHERE clause:",e[t.clause.WHERE]),r=n.filter(r,(function(i){return p(i,e[t.clause.WHERE])})),a.debug("Results after WHERE:",r),e.hasOwnProperty(t.clause.AGGREGATE)){a.debug("Evaluating AGGREGATE clause:",e[t.clause.AGGREGATE]);var o=h(e[t.clause.GROUP_BY],r),s=_(e[t.clause.AGGREGATE],o);r=v(o,s),a.debug("Results after AGGREGATE:",r)}e.hasOwnProperty(t.clause.HAVING)&&(a.debug("Evaluating HAVING clause:",e[t.clause.HAVING]),r=n.filter(r,(function(i){return p(i,e[t.clause.HAVING])})),a.debug("Results after HAVING:",r)),e.hasOwnProperty(t.clause.ORDER_BY)&&(a.debug("Evaluating ORDER_BY clause:",e[t.clause.ORDER_BY]),r=E(e[t.clause.ORDER_BY],r),a.debug("Results after ORDER_BY:",r));var u=0;e.hasOwnProperty(t.clause.OFFSET)&&(a.debug("Evaluating OFFSET clause:",e[t.clause.OFFSET]),u=Number(e[t.clause.OFFSET]));var c;return e.hasOwnProperty(t.clause.LIMIT)&&(a.debug("Evaluating LIMIT clause:",e[t.clause.LIMIT]),c=u+Number(e[t.clause.LIMIT])),(u>0||!n.isUndefined(c))&&(r=r.slice(u,c),a.debug("Results after OFFSET/LIMIT:",r)),e.hasOwnProperty(t.clause.SELECT)&&(a.debug("Evaluating SELECT clause:",e[t.clause.SELECT]),r=I(e[t.clause.SELECT],r),a.debug("Results after SELECT:",r)),r};t.execute=function(e,i){e=t.rewrite(e),a.shouldLog(r.LogLevel.DEBUG)&&a.groupCollapsed("Evaluating Behavioral Rule"),a.debug("Rule:",e,c.stringify(e)),a.debug("Events:",i);var n=m(e);if(n.length>0)throw new Error("Rule "+c.stringify(e)+" has violations: "+n.join("\n"));var o=y(e,i);return a.debug("Rule result:",o),a.shouldLog(r.LogLevel.DEBUG)&&a.groupEnd(),o},t.isSatisfied=function(e,i){try{return t.execute(e,i).length>0}catch(t){return a.error("Rules","Error "+t.toString()+" while evaluating rule "+c.stringify(e)),!1}}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(157))}}),(function(e,t,i){var n=i(2),r=i(158),a=i(152),o=i(26),s=i(154);e.exports={provides:"customBehavior",shouldTrack:!0,isLazy:!1,getter:["stores/global","stores/visitor_attribute_entity",function(e,t){var i=e.getProjectId(),u=n.filter(n.map(t.getCustomBehavioralAttributes(i),(function(e){try{return{id:e.id,granularity:r.GRANULARITY.ALL,rule:s.buildFromSpecV0_2(o.parse(e.rule_json))}}catch(e){return}}))),c=a.getEvents();return r.evaluate(u,c)}]}}),(function(e,t,i){function n(e){if(0===e.length)return[];for(var t=e.length-1,i=o.FIELDS.SESSION_ID,n=e[t][i];t>0&&n===e[t-1][i];)t--;return e.slice(t)}function r(e,t){if(0===e.length||t<=0)return[];var i=+new Date-t*s.MILLIS_IN_A_DAY;i-=i%s.MILLIS_IN_A_DAY;for(var n=e.length;n>0&&i<=e[n-1][o.FIELDS.TIME];)n--;return e.slice(n)}var a=i(23),o={FIELDS:i(63).FIELDS},s=i(154),u=i(155);t.GRANULARITY={ALL:"all",CURRENT_SESSION:"current_session",LAST_30_DAYS:"last_30_days",LAST_60_DAYS:"last_60_days"},t.evaluate=function(e,i){var o={};if(0===i.length){for(var s=0;s 0){var t=e[0],i=a(t,[n.FIELDS.SESSION_INDEX]);return i===o}return!0}]}}),(function(e,t){e.exports={fieldsNeeded:["first_session"],match:function(e){return!!e.first_session}}}),(function(e,t,i){e.exports=function(e){e.registerApiModule("behavior",i(163))}}),(function(e,t,i){function n(e,t){var i=d.buildFromSpecV0_1(t);if(1!==i.length)throw new Error("Invalid query descriptor; verify that no aggregators are specified");return f.execute(i[0],e)}function r(e,t){return c.map(e,(function(e){return c.isFunction(e.toObject)?e.toObject(t):e}))}function a(e,t){if(!e)return["Descriptor not defined"];var i=[];return e.count&&i.push('Unexpected "count" clause specified'),e.pick&&e.pick.modifier&&t.indexOf(e.pick.modifier)===-1&&i.push('Invalid "pick" modifier "'+e.pick.modifier+'"'),c.each(e.filters,(function(e){c.isUndefined(e.modifier)||i.push('Unexpected "filter" modifier "'+e.modifier+'"')})),i.length>0?i:void 0}function o(e,t){var i,o={revenueAsTag:!1,timeAsTimestamp:!0};if(c.isUndefined(t))return i=l.getEvents(e),r(i,o);if(c.isNumber(t)){if(t<=0)throw new Error("Count must be a positive integer, got "+t);return i=l.getEvents(e),r(i.slice(-t),o)}var s=a(t,c.values(d.RECENCY_FILTERS));if(s)throw new Error(s.join("\n"));return i=l.getEvents(e),r(n(i,t),o)}function s(e,t){if(t=c.cloneDeep(t)||{},!t.pick)throw new Error('No "pick" clause provided in query descriptor');if(!t.pick.name)throw new Error('No field name provided in "pick" clause');t.pick.modifier=t.pick.modifier||d.FREQUENCY_FILTERS.MOST_FREQUENT;var i=a(t,c.values(d.FREQUENCY_FILTERS));if(i)throw new Error(i.join("\n"));var r=l.getEvents(e);return n(r,t)}function u(e,t){var i=d.buildFromSpecV0_2(t),n=l.getEvents(e),a=r(f.execute(i,n),{revenueAsTag:!0,timeAsTimestamp:!1});return(t.pick||t.reduce&&"count"===t.reduce.aggregator)&&(a=c.flatten(a)),t.reduce&&(a=a[0]),a}var c=i(2),l=i(152),d=i(154),f=i(155);e.exports=["stores/visitor_events",function(e){return{getEvents:c.partial(o,e),getByFrequency:c.partial(s,e),query:c.partial(u,e)}}]}),(function(e,t,i){e.exports=function(e){e.registerDependency("sources/browser_id",i(165)),e.registerVisitorProfileProvider(i(169)),e.registerVisitorProfileProvider(i(170)),e.registerAudienceMatcher("browser_version",i(171))}}),(function(e,t,i){var n=i(166);t.getId=function(){return n.get().browser.id},t.getVersion=function(){return n.get().browser.version}}),(function(e,t,i){var n=i(2),r=i(167),a=i(40),o=i(7),s=i(16),u=i(9),c=s.get("stores/ua_data");t.get=function(){var e=c.get();return n.isEmpty(e)&&(e=r.parseUA(a.getUserAgent()),u.dispatch(o.SET_UA_DATA,{data:e})),e}}),(function(e,t,i){function n(e){if(e=(e||"").toLowerCase(),e in u)return e;var t=a.keys(u);return a.find(t,(function(t){var i=u[t];return a.includes(i,e)}))||"unknown"}function r(e,t,i){return t?t:"unknown"===e?"unknown":i?"mobile":"desktop_laptop"}var a=i(2),o=i(168);t.parseUA=function(e){var t=new o(e),i=t.getBrowser(),a=t.getOS(),u=t.getDevice(),l=(a.name||"unknown").toLowerCase(),d=(i.name||"unknown").toLowerCase(),f=s(u.type,d,l);return{browser:{id:n(i.name),version:i.version},platform:{name:l,version:a.version},device:{model:c[u.model]||"unknown",type:r(d,u.type,f),isMobile:f}}};var s=function(e,t,i){if(a.includes(["mobile","tablet"],e))return!0;if(a.includes(["opera mini"],t))return!0;var n=["android","blackberry","ios","windows phone"];return!!a.includes(n,i)},u={gc:["chrome","chromium","silk","yandex","maxthon","chrome webview"],edge:["edge"],ie:["internet explorer","iemobile"],ff:["firefox","iceweasel"],opera:["opera","opera mini","opera tablet"],safari:["safari","mobile safari","webkit"],ucbrowser:["uc browser"]},c={iPhone:"iphone",iPad:"ipad"}}),(function(e,t,i){var n;/*! * UAParser.js v0.7.24 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * * Copyright © 2012-2021 Faisal Salman * Licensed under MIT License */ !(function(r,a){"use strict";var o="0.7.24",s="",u="?",c="function",l="undefined",d="object",f="string",g="major",p="model",h="name",_="type",v="vendor",E="version",m="architecture",I="console",y="mobile",S="tablet",T="smarttv",A="wearable",w="embedded",R={extend:function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2===0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i},has:function(e,t){return"string"==typeof e&&t.toLowerCase().indexOf(e.toLowerCase())!==-1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===f?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},D={rgx:function(e,t){for(var i,n,r,o,s,u,l=0;l 0?2==o.length?typeof o[1]==c?this[o[0]]=o[1].call(this,u):this[o[0]]=o[1]:3==o.length?typeof o[1]!==c||o[1].exec&&o[1].test?this[o[0]]=u?u.replace(o[1],o[2]):a:this[o[0]]=u?o[1].call(this,u,o[2]):a:4==o.length&&(this[o[0]]=u?o[3].call(this,u.replace(o[1],o[2])):a):this[o]=u?u:a;l+=2}},str:function(e,t){for(var i in t)if(typeof t[i]===d&&t[i].length>0){for(var n=0;n Number(i[a]))return 1}}return 0}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(174)),e.registerAudienceMatcher("campaign",i(175))}}),(function(e,t,i){var n=i(117);e.exports={provides:"campaign",shouldTrack:!0,isSticky:!0,getter:[function(){return n.getQueryParamValue("utm_campaign")}]}}),(function(e,t,i){var n=i(20);e.exports={fieldsNeeded:["campaign"],match:function(e,t){return n.hasMatch(t.value,t.match,e.campaign)}}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(177));var t=i(178);e.registerAudienceMatcher("custom_attribute",t),e.registerAudienceMatcher("custom_dimension",t)}}),(function(e,t,i){var n=i(2),r=i(25),a=i(23),o=i(16),s=o.get("stores/dimension_data");e.exports={provides:"custom",attributionType:r.AttributionTypes.LAST_TOUCH,restorer:function(e){return n.reduce(e,(function(e,t,i){var r=i,o=s.getByApiName(i),u=s.getById(i),c=u;return n.isObject(t)?(!t.id&&o&&(c=o,r=o.id,n.extend(t,{id:c.segmentId||c.id})),t.name||c&&c.apiName&&(t.name=c.apiName),t.id||c||a.warn("Unable to determine ID for custom attribute:",i,"; segmentation is disabled."),e[r]=t,e):(a.error('Unable to restore custom attribute "'+i+'" because value is not an object'),e)}),{})},shouldTrack:!0}}),(function(e,t,i){var n=i(2),r=i(20);t.match=function(e,t){var i;return e.custom&&(i=e.custom[t.name]),n.isObject(i)&&(i=i.value),r.hasMatch(t.value,t.match,i)}}),(function(e,t,i){e.exports=function(e){e.registerDependency("sources/device",i(180)),e.registerVisitorProfileProvider(i(181)),e.registerAudienceMatcher("device",i(182))}}),(function(e,t,i){var n=i(166);t.getDevice=function(){var e=n.get().device;return"unknown"!==e.model?e.model:"tablet"===e.type?"tablet":e.isMobile?"mobile":"desktop"}}),(function(e,t){e.exports={provides:"device",shouldTrack:!0,isSticky:!0,getter:["sources/device",function(e){return e.getDevice()}]}}),(function(e,t){e.exports={fieldsNeeded:["device"],match:function(e,t){return e.device===t.value}}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(184)),e.registerAudienceMatcher("device_type",i(185))}}),(function(e,t,i){var n=i(166);e.exports={provides:"device_type",shouldTrack:!0,isSticky:!0,getter:[function(){var e=n.get().device;switch(e.type){case"mobile":return"phone";case"tablet":case"desktop_laptop":return e.type;default:return"other"}}]}}),(function(e,t){e.exports={fieldsNeeded:["device_type"],match:function(e,t){return e.device_type===t.value}}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(187)),e.registerAudienceMatcher("location",i(189))}}),(function(e,t,i){var n=i(188);e.exports={provides:"location",isAsync:!0,getter:[function(){return n.getIPDerivedGeolocation()}]}}),(function(e,t,i){function n(){a.addScriptAsync(s)}var r=i(6),a=i(130),o="cdn3";t.getIP=function(){return r.makeAsyncRequest(o,n).then((function(e){return e.ip}))},t.getIPDerivedGeolocation=function(){return r.makeAsyncRequest(o,n).then((function(e){return e.location}))};var s="//cdn3.optimizely.com/js/geo2.js"}),(function(e,t){t.fieldsNeeded=["location"],t.match=function(e,t){if(!e.hasOwnProperty("location"))return!1;var i=e.location,n=t.value,r=n.split("|"),a=(r[0]||"").trim(),o=(r[1]||"").trim(),s=(r[2]||"").trim(),u=(r[3]||"").trim();switch(r.length){case 1:if(i.country===a)return!0;break;case 2:if(i.region===o&&i.country===a)return!0;break;case 3:if(i.city===s&&(i.region===o||""===o)&&i.country===a)return!0;break;case 4:if(i.continent===u)return!0}return!1}}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(191)),e.registerAudienceMatcher("referrer",i(192))}}),(function(e,t,i){var n=i(80),r=i(95);e.exports={provides:"referrer",shouldTrack:!0,isSticky:!0,getter:[function(){var e=r.getReferrer()||n.getReferrer();return""===e&&(e=null),e}]}}),(function(e,t,i){var n=i(193);t.fieldsNeeded=["referrer"],t.match=function(e,t){return null!==e.referrer&&n(e.referrer,t)}}),(function(e,t,i){function n(e){var t=e.indexOf("?");return t!==-1&&(e=e.substring(0,t)),t=e.indexOf("#"),t!==-1&&(e=e.substring(0,t)),e}function r(e){return a(n(e))}function a(e,t){e=e.replace("/?","?"),e=e.toLowerCase().replace(/[\/&?]+$/,"");var i=l.slice(0);t||(i=i.concat(u));for(var n=i.length,r=0;r 0&&(t[1]="?"+o.join("&")),r&&(t[1]+="#"+r),t.join("")}return e}var s=i(2);e.exports=function(e,t){e=o(e);var i=t.value;switch(t.match){case"exact":return e=a(e),e===a(i);case"regex":try{return Boolean(e.match(i))}catch(e){}return!1;case"simple":return e=r(e),i=r(i),e===i;case"substring":return e=a(e,!0),i=a(i,!0),e.indexOf(i)!==-1;default:return!1}};var u=["www."],c="optimizely_",l=["https?://.*?.?optimizelyedit.(com|test)/","https?://.*.?optimizelypreview.(com|test)/","https?://(edit|preview)(-hrd|-devel)?.optimizely.(com|test)/","https?://.*?.?optimizelyedit(-hrd)?.appspot.com/","https?://"]}),(function(e,t,i){e.exports=function(e){e.registerVisitorProfileProvider(i(195)),e.registerAudienceMatcher("source_type",i(197))}}),(function(e,t,i){var n=i(117),r=i(80),a=i(95),o=i(196),s=["google\\.\\w{2,3}(\\.\\w{2,3})?/(search|url)","bing\\.\\w{2,3}(\\.\\w{2,3})?/(search|url)","yahoo\\.\\w{2,3}(\\.\\w{2,3})?/search","baidu\\.\\w{2,3}(\\.\\w{2,3})?/","https://(www)?\\.google\\..*?/?$","https://search\\.yahoo\\..*?/?$","https://(www)?\\.bing\\..*?/?$"];e.exports={provides:"source_type",shouldTrack:!0,isSticky:!1,getter:[function(){return function(e,t){var i=function(){if(n.getQueryParamValue("utm_source")||n.getQueryParamValue("gclid")||n.getQueryParamValue("otm_source"))return"campaign";for(var e=a.getReferrer()||r.getReferrer(),t=0;t =s&&c<=u&&a.includes(o.days,l)}}),(function(e,t,i){function n(e){function t(e,t,i){try{u(t),e[i]=t}catch(e){C.emitError(new X("Bad value for eventTags["+i+"]: "+e.message))}return e}var i=N.keys(ie),n=N.omit(e,i),r=N.pick(e,i),a=N.reduce(n,t,{}),o=N.reduce(r,(function(e,i,n){var r=ie[n];r.excludeFeature||t(a,i,n);try{r.validate(i),e[n]=r.sanitize(i),a[n]=e[n]}catch(e){C.emitError(new X("Bad value for eventMetrics["+n+"]: "+e.message))}return e}),{});return o.tags=a,o}function r(e){var t=N.extend({entity_id:e.pageId,key:e.pageApiName,timestamp:e.timestamp,uuid:e.eventId,type:J},n(e.eventTags));return t}function a(e){return N.extend({entity_id:e.eventEntityId,key:e.eventApiName,timestamp:e.timestamp,uuid:e.eventId,type:e.eventCategory},n(e.eventTags))}function o(e){return N.extend({entity_id:e.eventEntityId,key:e.eventApiName,timestamp:e.timestamp,uuid:e.eventId,type:e.eventCategory},n(e.eventTags))}function s(e){return{entity_id:null,type:Q,uuid:e.eventId,timestamp:e.timestamp}}function u(e){if(null==e)throw new Error("Feature value is null");if("object"==typeof e){var t;try{t=x.stringify(e)}catch(e){}throw new Error('Feature value is complex: "'+t||'[object]"')}}function c(e){if(null==e)throw new Error("Metric value is null");if(!N.isNumber(e))throw new Error("Metric value is not numeric")}function l(e){return N.reduce(e,(function(e,t){try{u(t.value),e.push({entity_id:t.id||null,key:t.name,type:t.type,value:t.value})}catch(e){F.warn("Error evaluating user feature",t,e)}return e}),[])}function d(e,t,i){Y.dispatch(V.REGISTER_TRACKER_EVENT,{event:e,decisions:i}),f(t),D()}function f(e){var t=l(e);Y.dispatch(V.UPDATE_TRACKER_VISITOR_ATTRIBUTES,{attributes:t})}function g(e){var t=l(e.userFeatures),i={account_id:e.accountId,anonymize_ip:e.anonymizeIP,client_name:e.clientName,client_version:e.clientVersion,project_id:e.projectId,visitors:[{session_id:h(e.sessionId),visitor_id:e.visitorId,attributes:t,snapshots:[{decisions:[{campaign_id:e.layerId,experiment_id:e.experimentId,variation_id:e.variationId,is_campaign_holdback:e.isLayerHoldback}],events:[{uuid:e.decisionId,entity_id:e.layerId,timestamp:e.timestamp,type:$}]}]}]};Y.dispatch(V.REGISTER_PREVIOUS_BATCH,i),D()}function p(e){var t=N.isNull(q.getAnonymizeIP())?void 0:q.getAnonymizeIP(),i={account_id:e.accountId,anonymize_ip:t,client_name:e.clientName,client_version:e.clientVersion,project_id:e.projectId,visitors:[]};i.revision=e.revision,Z&&(i.enrich_decisions=!0);var n={session_id:h(e.sessionId),visitor_id:e.visitorId,attributes:[],snapshots:[]},r=b(e.layerStates);Y.dispatch(V.REGISTER_TRACKER_VISITOR,{data:i,visitor:n,decisions:r}),D()}function h(e){return oe?ae:e}function _(e){var t={entity_id:e.layerId,type:$,uuid:e.decisionId,timestamp:e.timestamp};Y.dispatch(V.REGISTER_TRACKER_DECISION,{decisionEvent:t,decisions:b(e.layerStates)}),f(e.userFeatures),D()}function v(){if(!W.canSend())return void F.debug("Not sending events (holding)");var e=W.hasEventsToSend(),t=W.hasPreviousBatchesToSend();return e||t?(t&&(N.each(W.getPreviousBatches(),E),Y.dispatch(V.RESET_TRACKER_PREVIOUS_BATCHES)),void(e&&(Y.dispatch(V.FINALIZE_BATCH_SNAPSHOT),E(W.getEventBatch()),Y.dispatch(V.RESET_TRACKER_EVENTS)))):void F.debug("Not sending events because there are no events to send")}function E(e){F.debug("Sending ticket:",e);var t=P.generate();B.retryableRequest({url:L,method:"POST",data:m(e)},t)}function m(e){var t=N.extend({},N.pick(e,["account_id","anonymize_ip","client_name","client_version","enrich_decisions","project_id","revision"]),{visitors:N.map(e.visitors,I)});return t}function I(e){return{visitor_id:e.visitor_id,session_id:ae,attributes:N.map(e.attributes,y),snapshots:N.map(e.snapshots,S)}}function y(e){return R(e,{entity_id:"e",key:"k",type:"t",value:"v"})}function S(e){var t=e.events;return t=T(t),{activationTimestamp:q.getActivationTimestamp(),decisions:N.map(e.decisions,A),events:N.map(t,w)}}function T(e){var t=N.reduce(e,(function(e,t){var i,n=t.type===J&&N.isEmpty(t.tags)&&N.isEmpty(N.pick(t,N.keys(ie)));if(i=n?t.type:t.uuid,e[i]){var r=e[i].timestamp;t.timestamp>r&&(r=t.timestamp),e[i]=N.extend({},e[i],{key:e[i].key+"-"+(t.key||""),entity_id:e[i].entity_id+"-"+t.entity_id,timestamp:r})}else e[i]=t;return e}),{});return N.values(t)}function A(e){return R(e,{campaign_id:"c",experiment_id:"x",is_campaign_holdback:"h",variation_id:"v"})}function w(e){return e.key===$&&(e.type=$,delete e.key),R(e,{entity_id:"e",key:"k",quantity:"q",revenue:"$",tags:"a",timestamp:"t",uuid:"u",value:"v",type:"y"})}function R(e,t){return N.reduce(e,(function(e,i,n){return n in t&&(e[t[n]||n]=i),e}),{})}function D(){function e(){var t=!ne||j.isLoaded();t&&v(),W.isPolling()&&G.setTimeout(e,te)}return W.shouldBatch()?void(W.isPolling()||(G.setTimeout(e,te),Y.dispatch(V.SET_TRACKER_POLLING,!0),G.setTimeout((function(){Y.dispatch(V.SET_TRACKER_BATCHING,!1),Y.dispatch(V.SET_TRACKER_POLLING,!1)}),ee))):void v()}function b(e){return N.map(e,(function(e){return{campaign_id:e.layerId,experiment_id:e.decision.experimentId,variation_id:e.decision.variationId,is_campaign_holdback:e.decision.isLayerHoldback}}))}function O(){var e=W.getPersistableState();if(e)try{F.debug("Persisting pending batch:",e),U.persistTrackerOptimizelyData(e),Y.dispatch(V.SET_TRACKER_DIRTY,!1)}catch(e){F.debug("Failed to persist pending batch:",e)}}var N=i(2),C=i(104),P=i(5),L="https://logx.optimizely.com/v1/events",V=i(7),k=i(76).create,x=i(26),F=i(23),M=i(113),U=i(74),G=i(40),B=i(87),z=i(16),j=i(80),H=i(103),K=i(109),Y=i(9),q=z.get("stores/global"),W=z.get("stores/tracker_optimizely"),X=t.Error=k("OptimizelyTrackerError"),Q="client_activation",$="campaign_activated",J="view_activated",Z=!0,ee=1e4,te=1e3,ie={revenue:{validate:c,sanitize:Math.floor,excludeFeature:!0},quantity:{validate:c,sanitize:Math.floor,excludeFeature:!0},value:{validate:c,sanitize:N.identity}},ne=!1,re=!1,ae="AUTO",oe=!0,se=function(e){e.timing===M.TrackLayerDecisionTimingFlags.postRedirectPolicy?g(e):_(e)},ue=[function(){return function(e){d(r(e),e.userFeatures,b(e.layerStates))}}],ce=[function(){return function(e){p(e),d(s(e),e.userFeatures,b(e.layerStates))}}],le=[function(){return function(e){d(o(e),e.userFeatures,b(e.layerStates))}}],de=[function(){return function(e){d(a(e),e.userFeatures,b(e.layerStates))}}],fe={trackLayerDecision:se,postRedirectPolicy:M.PostRedirectPolicies.TRACK_AFTER_SYNC,nonRedirectPolicy:M.NonRedirectPolicies.TRACK_IMMEDIATELY,onPageActivated:ue,onClientActivation:ce,onClickEvent:de,onCustomEvent:le};e.exports=function(e){e.registerAnalyticsTracker("optimizely",fe),H.on({filter:{type:K.TYPES.ANALYTICS,name:"sendEvents"},handler:function(){Y.dispatch(V.SET_TRACKER_SEND_EVENTS,!0),W.isPolling()||v()}}),H.on({filter:{type:K.TYPES.ANALYTICS,name:"holdEvents"},handler:function(){Y.dispatch(V.SET_TRACKER_SEND_EVENTS,!1)}}),Y.dispatch(V.SET_TRACKER_SEND_EVENTS,!re);var t=H.on({filter:{type:"lifecycle",name:"activated"},handler:function(){W.observe(O),H.off(t)}})}}),(function(e,t,i){e.exports=function(e){e.registerViewProvider(i(205)),e.registerViewMatcher("url",i(206))}}),(function(e,t,i){var n=i(117);e.exports={provides:"url",getter:[function(){return n.getUrl()}]}}),(function(e,t,i){var n=i(193);e.exports={fieldsNeeded:["url"],match:function(e,t){return n(e.url,t)}}}),(function(e,t,i){var n=i(142),r="custom_code",a={match:function(e,t){return n.apply(t.value)}};e.exports=function(e){e.registerViewMatcher(r,a)}}),(function(e,t,i){function n(e,t){if(this.change=e,this.identifier=t.identifier,this.startTime=t.startTime,d.shouldObserveChangesIndefinitely()){p.dispatch(a.INITIALIZE_CHANGE_METRICS),this.rateMeter=new _(m.MOVING_WINDOW_MILLISECONDS);var i=r.isNull(m.MAX_MACROTASKS_IN_MOVING_WINDOW)?Number.POSITIVE_INFINITY:m.MAX_MACROTASKS_IN_MOVING_WINDOW;this.rateMeter.addListener(i,r.bind((function(){h.warn("AppendChange",this,"has overheated and will no longer apply or reapply"),this.cancel(),p.dispatch(a.RECORD_CHANGE_OVERHEATED),o.emitError(new I("Change "+this.identifier+" has overheated"),{layerId:t.action&&t.action.layerId,experimentId:t.action&&t.action.experimentId,variationId:t.action&&t.action.variationId,changeId:e.id,changeType:e.type,movingWindowMilliseconds:m.MOVING_WINDOW_MILLISECONDS,maxMacroTasksInMovingWindow:i})}),this));for(var n=Math.min(i,50),s=0;s<=n;s++)this.rateMeter.addListener(s,r.partial((function(e){p.dispatch(a.RECORD_CHANGE_MACROTASK_RATE,{changeMacrotaskRate:e})}),s))}}var r=i(2),a=i(7),o=i(104),s=i(135),u=i(76).create,c=i(209),l=i(210),d=i(16).get("stores/directive"),f=i(80),g=i(211),p=i(9),h=i(23),_=i(212),v=i(134),E=i(96).create(),m={ MOVING_WINDOW_MILLISECONDS:1e3,MAX_MACROTASKS_IN_MOVING_WINDOW:10},I=u("ChangeOverheatError");n.prototype.numberOfRootNodes=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes.length},n.prototype.getSiblingElements=function(e,t,i){for(var n=e,r=[],a=0;a