Skip to content

Instantly share code, notes, and snippets.

@nbohara2329
Created July 24, 2019 05:03
Show Gist options
  • Save nbohara2329/cd5eff0d16323d8bdd97da71d3edc8d6 to your computer and use it in GitHub Desktop.
Save nbohara2329/cd5eff0d16323d8bdd97da71d3edc8d6 to your computer and use it in GitHub Desktop.
/**
* @license
* Adobe Visitor API for JavaScript version: 4.3.0
* Copyright 2019 Adobe, Inc. All Rights Reserved
* More info available at https://marketing.adobe.com/resources/help/en_US/mcvid/
*/
var e=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(){return{callbacks:{},add:function(e,t){this.callbacks[e]=this.callbacks[e]||[];var n=this.callbacks[e].push(t)-1,i=this;return function(){i.callbacks[e].splice(n,1)}},execute:function(e,t){if(this.callbacks[e]){t=void 0===t?[]:t,t=t instanceof Array?t:[t];try{for(;this.callbacks[e].length;){var n=this.callbacks[e].shift();"function"==typeof n?n.apply(null,t):n instanceof Array&&n[1].apply(n[0],t)}delete this.callbacks[e]}catch(e){}}},executeAll:function(e,t){(t||e&&!j.isObjectEmpty(e))&&Object.keys(this.callbacks).forEach(function(t){var n=void 0!==e[t]?e[t]:"";this.execute(t,n)},this)},hasCallbacks:function(){return Boolean(Object.keys(this.callbacks).length)}}}function i(e){for(var t=/^\d+$/,n=0,i=e.length;n<i;n++)if(!t.test(e[n]))return!1;return!0}function r(e,t){for(;e.length<t.length;)e.push("0");for(;t.length<e.length;)t.push("0")}function a(e,t){for(var n=0;n<e.length;n++){var i=parseInt(e[n],10),r=parseInt(t[n],10);if(i>r)return 1;if(r>i)return-1}return 0}function o(e,t){if(e===t)return 0;var n=e.toString().split("."),o=t.toString().split(".");return i(n.concat(o))?(r(n,o),a(n,o)):NaN}function s(e){return e===Object(e)&&0===Object.keys(e).length}function l(e){return"function"==typeof e||e instanceof Array&&e.length}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};this.log=he("log",e,t),this.warn=he("warn",e,t),this.error=he("error",e,t)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isEnabled,n=e.cookieName,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.cookies;return t&&n&&r?{remove:function(){r.remove(n)},get:function(){var e=r.get(n),t={};try{t=JSON.parse(e)}catch(e){t={}}return t},set:function(e,t){t=t||{},r.set(n,JSON.stringify(e),{domain:t.optInCookieDomain||"",cookieLifetime:t.optInStorageExpiry||3419e4,expires:!0})}}:{get:Te,set:Te,remove:Te}}function d(e){this.name=this.constructor.name,this.message=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}function f(){function e(e,t){var n=ve(e);return n.length?n.every(function(e){return!!t[e]}):De(t)}function t(){M(y),O(le.COMPLETE),_(h.status,h.permissions),m.set(h.permissions,{optInCookieDomain:l,optInStorageExpiry:c}),C.execute(Ne)}function n(e){return function(n,i){if(!Se(n))throw new Error("[OptIn] Invalid category(-ies). Please use the `OptIn.Categories` enum.");return O(le.CHANGED),Object.assign(y,be(ve(n),e)),i||t(),h}}var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i.doesOptInApply,a=i.previousPermissions,o=i.preOptInApprovals,s=i.isOptInStorageEnabled,l=i.optInCookieDomain,c=i.optInStorageExpiry,d=i.isIabContext,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=f.cookies,p=Le(a);Pe(p,"Invalid `previousPermissions`!"),Pe(o,"Invalid `preOptInApprovals`!");var m=u({isEnabled:!!s,cookieName:"adobeujs-optin"},{cookies:g}),h=this,_=se(h),C=ge(),I=Oe(p),v=Oe(o),D=m.get(),S={},b=function(e,t){return Me(e)||t&&Me(t)?le.COMPLETE:le.PENDING}(I,D),A=function(e,t,n){var i=be(fe,!r);return r?Object.assign({},i,e,t,n):i}(v,I,D),y=Ae(A),O=function(e){return b=e},M=function(e){return A=e};h.deny=n(!1),h.approve=n(!0),h.denyAll=h.deny.bind(h,fe),h.approveAll=h.approve.bind(h,fe),h.isApproved=function(t){return e(t,h.permissions)},h.isPreApproved=function(t){return e(t,v)},h.fetchPermissions=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t?h.on(le.COMPLETE,e):Te;return!r||r&&h.isComplete||!!o?setTimeout(e(h.permissions),0):t||C.add(Ne,function(){return e(h.permissions)}),n},h.complete=function(){h.status===le.CHANGED&&t()},h.registerPlugin=function(e){if(!e||!e.name||"function"!=typeof e.onRegister)throw new Error(xe);S[e.name]||(S[e.name]=e,e.onRegister.call(e,h))},h.execute=Fe(S),Object.defineProperties(h,{permissions:{get:function(){return A}},status:{get:function(){return b}},Categories:{get:function(){return ce}},doesOptInApply:{get:function(){return!!r}},isPending:{get:function(){return h.status===le.PENDING}},isComplete:{get:function(){return h.status===le.COMPLETE}},__plugins:{get:function(){return Object.keys(S)}},isIabContext:{get:function(){return d}}})}function g(e,t){function n(){r=null,e.call(e,new d("The call took longer than you wanted!"))}function i(){r&&(clearTimeout(r),e.apply(e,arguments))}if(void 0===t)return e;var r=setTimeout(n,t);return i}function p(){if(window.__cmp)return window.__cmp;var e=window;if(e===window.top)return void Ce.error("__cmp not found");for(var t;!t;){e=e.parent;try{e.frames.__cmpLocator&&(t=e)}catch(e){}if(e===window.top)break}if(!t)return void Ce.error("__cmp not found");var n={};return window.__cmp=function(e,i,r){var a=Math.random()+"",o={__cmpCall:{command:e,parameter:i,callId:a}};n[a]=r,t.postMessage(o,"*")},window.addEventListener("message",function(e){var t=e.data;if("string"==typeof t)try{t=JSON.parse(e.data)}catch(e){}if(t.__cmpReturn){var i=t.__cmpReturn;n[i.callId]&&(n[i.callId](i.returnValue,i.success),delete n[i.callId])}},!1),window.__cmp}function m(){var e=this;e.name="iabPlugin",e.version="0.0.1";var t=ge(),n={allConsentData:null},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n[e]=t};e.fetchConsentData=function(e){var t=e.callback,n=e.timeout,i=g(t,n);r({callback:i})},e.isApproved=function(e){var t=e.callback,i=e.category,a=e.timeout;if(n.allConsentData)return t(null,s(i,n.allConsentData.vendorConsents,n.allConsentData.purposeConsents));var o=g(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.vendorConsents,a=n.purposeConsents;t(e,s(i,r,a))},a);r({category:i,callback:o})},e.onRegister=function(t){var n=Object.keys(ue),i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.purposeConsents,a=i.gdprApplies,o=i.vendorConsents;!e&&a&&o&&r&&(n.forEach(function(e){var n=s(e,o,r);t[n?"approve":"deny"](e,!0)}),t.complete())};e.fetchConsentData({callback:i})};var r=function(e){var r=e.callback;if(n.allConsentData)return r(null,n.allConsentData);t.add("FETCH_CONSENT_DATA",r);var s={};o(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.purposeConsents,o=e.gdprApplies,l=e.vendorConsents;(arguments.length>1?arguments[1]:void 0)&&(s={purposeConsents:r,gdprApplies:o,vendorConsents:l},i("allConsentData",s)),a(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(arguments.length>1?arguments[1]:void 0)&&(s.consentString=e.consentData,i("allConsentData",s)),t.execute("FETCH_CONSENT_DATA",[null,n.allConsentData])})})},a=function(e){var t=p();t&&t("getConsentData",null,e)},o=function(e){var t=Re(ue),n=p();n&&n("getVendorConsents",t,e)},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!!t[ue[e]];return i&&function(){return de[e].every(function(e){return n[e]})}()}}function h(e,t,n){var i=null==e?void 0:e[t];return void 0===i?n:i}var _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Object.assign=Object.assign||function(e){for(var t,n,i=1;i<arguments.length;++i){n=arguments[i];for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e};var C,I,v={HANDSHAKE:"HANDSHAKE",GETSTATE:"GETSTATE",PARENTSTATE:"PARENTSTATE"},D={MCMID:"MCMID",MCAID:"MCAID",MCAAMB:"MCAAMB",MCAAMLH:"MCAAMLH",MCOPTOUT:"MCOPTOUT",CUSTOMERIDS:"CUSTOMERIDS"},S={MCMID:"getMarketingCloudVisitorID",MCAID:"getAnalyticsVisitorID",MCAAMB:"getAudienceManagerBlob",MCAAMLH:"getAudienceManagerLocationHint",MCOPTOUT:"getOptOut",ALLFIELDS:"getVisitorValues"},b={CUSTOMERIDS:"getCustomerIDs"},A={MCMID:"getMarketingCloudVisitorID",MCAAMB:"getAudienceManagerBlob",MCAAMLH:"getAudienceManagerLocationHint",MCOPTOUT:"getOptOut",MCAID:"getAnalyticsVisitorID",CUSTOMERIDS:"getCustomerIDs",ALLFIELDS:"getVisitorValues"},y={MC:"MCMID",A:"MCAID",AAM:"MCAAMB"},O={MCMID:"MCMID",MCOPTOUT:"MCOPTOUT",MCAID:"MCAID",MCAAMLH:"MCAAMLH",MCAAMB:"MCAAMB"},M={UNKNOWN:0,AUTHENTICATED:1,LOGGED_OUT:2},k={GLOBAL:"global"},E={MESSAGES:v,STATE_KEYS_MAP:D,ASYNC_API_MAP:S,SYNC_API_MAP:b,ALL_APIS:A,FIELDGROUP_TO_FIELD:y,FIELDS:O,AUTH_STATE:M,OPT_OUT:k},T=E.STATE_KEYS_MAP,L=function(e){function t(){}function n(t,n){var i=this;return function(){var r=e(0,t),a={};return a[t]=r,i.setStateAndPublish(a),n(r),r}}var i=this;this.getMarketingCloudVisitorID=function(e){e=e||t;var i=this.findField(T.MCMID,e),r=n.call(this,T.MCMID,e);return void 0!==i?i:r()},this.getVisitorValues=function(e){i.getMarketingCloudVisitorID(function(t){e({MCMID:t})})}},P=E.MESSAGES,w=E.ASYNC_API_MAP,R=E.SYNC_API_MAP,F=function(){function e(){}function t(e,t){var n=this;return function(){return n.callbackRegistry.add(e,t),n.messageParent(P.GETSTATE),""}}function n(n){this[w[n]]=function(i){i=i||e;var r=this.findField(n,i),a=t.call(this,n,i);return void 0!==r?r:a()}}function i(t){this[R[t]]=function(){return this.findField(t,e)||{}}}Object.keys(w).forEach(n,this),Object.keys(R).forEach(i,this)},N=E.ASYNC_API_MAP,x=function(){Object.keys(N).forEach(function(e){this[N[e]]=function(t){this.callbackRegistry.add(e,t)}},this)},j=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(t,n){n.isObjectEmpty=function(e){return e===Object(e)&&0===Object.keys(e).length},n.isValueEmpty=function(e){return""===e||n.isObjectEmpty(e)},n.getIeVersion=function(){if(document.documentMode)return document.documentMode;for(var e=7;e>4;e--){var t=document.createElement("div");if(t.innerHTML="\x3c!--[if IE "+e+"]><span></span><![endif]--\x3e",t.getElementsByTagName("span").length)return t=null,e;t=null}return null},n.encodeAndBuildRequest=function(e,t){return e.map(encodeURIComponent).join(t)},n.isObject=function(t){return null!==t&&"object"===e(t)&&!1===Array.isArray(t)},n.defineGlobalNamespace=function(){return window.adobe=n.isObject(window.adobe)?window.adobe:{},window.adobe},n.pluck=function(e,t){return t.reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},Object.create(null))},n.parseOptOut=function(e,t,n){t||(t=n,e.d_optout&&e.d_optout instanceof Array&&(t=e.d_optout.join(",")));var i=parseInt(e.d_ottl,10);return isNaN(i)&&(i=7200),{optOut:t,d_ottl:i}},n.normalizeBoolean=function(e){var t=e;return"true"===e?t=!0:"false"===e&&(t=!1),t}}),V=(j.isObjectEmpty,j.isValueEmpty,j.getIeVersion,j.encodeAndBuildRequest,j.isObject,j.defineGlobalNamespace,j.pluck,j.parseOptOut,j.normalizeBoolean,n),U=E.MESSAGES,H={0:"prefix",1:"orgID",2:"state"},B=function(e,t){this.parse=function(e){try{var t={};return e.data.split("|").forEach(function(e,n){if(void 0!==e){t[H[n]]=2!==n?e:JSON.parse(e)}}),t}catch(e){}},this.isInvalid=function(n){var i=this.parse(n);if(!i||Object.keys(i).length<2)return!0;var r=e!==i.orgID,a=!t||n.origin!==t,o=-1===Object.keys(U).indexOf(i.prefix);return r||a||o},this.send=function(n,i,r){var a=i+"|"+e;r&&r===Object(r)&&(a+="|"+JSON.stringify(r));try{n.postMessage(a,t)}catch(e){}}},G=E.MESSAGES,q=function(e,t,n,i){function r(e){Object.assign(g,e)}function a(e){Object.assign(g.state,e),Object.assign(g.state.ALLFIELDS,e),g.callbackRegistry.executeAll(g.state)}function o(e){if(!h.isInvalid(e)){m=!1;var t=h.parse(e);g.setStateAndPublish(t.state)}}function s(e){!m&&p&&(m=!0,h.send(i,e))}function l(){r(new L(n._generateID)),g.getMarketingCloudVisitorID(),g.callbackRegistry.executeAll(g.state,!0),_.removeEventListener("message",c)}function c(e){if(!h.isInvalid(e)){var t=h.parse(e);m=!1,_.clearTimeout(g._handshakeTimeout),_.removeEventListener("message",c),r(new F(g)),_.addEventListener("message",o),g.setStateAndPublish(t.state),g.callbackRegistry.hasCallbacks()&&s(G.GETSTATE)}}function u(){p&&postMessage?(_.addEventListener("message",c),s(G.HANDSHAKE),g._handshakeTimeout=setTimeout(l,250)):l()}function d(){_.s_c_in||(_.s_c_il=[],_.s_c_in=0),g._c="Visitor",g._il=_.s_c_il,g._in=_.s_c_in,g._il[g._in]=g,_.s_c_in++}function f(){function e(e){0!==e.indexOf("_")&&"function"==typeof n[e]&&(g[e]=function(){})}Object.keys(n).forEach(e),g.getSupplementalDataID=n.getSupplementalDataID,g.isAllowed=function(){return!0}}var g=this,p=t.whitelistParentDomain;g.state={ALLFIELDS:{}},g.version=n.version,g.marketingCloudOrgID=e,g.cookieDomain=n.cookieDomain||"",g._instanceType="child";var m=!1,h=new B(e,p);g.callbackRegistry=V(),g.init=function(){d(),f(),r(new x(g)),u()},g.findField=function(e,t){if(g.state[e])return t(g.state[e]),g.state[e]},g.messageParent=s,g.setStateAndPublish=a},Y=E.MESSAGES,X=E.ALL_APIS,z=E.ASYNC_API_MAP,W=E.FIELDGROUP_TO_FIELD,J=function(e,t){function n(){var t={};return Object.keys(X).forEach(function(n){var i=X[n],r=e[i]();j.isValueEmpty(r)||(t[n]=r)}),t}function i(){var t=[];return e._loading&&Object.keys(e._loading).forEach(function(n){if(e._loading[n]){var i=W[n];t.push(i)}}),t.length?t:null}function r(t){return function n(r){var a=i();if(a){var o=z[a[0]];e[o](n,!0)}else t()}}function a(e,i){var r=n();t.send(e,i,r)}function o(e){l(e),a(e,Y.HANDSHAKE)}function s(e){r(function(){a(e,Y.PARENTSTATE)})()}function l(n){function i(i){r.call(e,i),t.send(n,Y.PARENTSTATE,{CUSTOMERIDS:e.getCustomerIDs()})}var r=e.setCustomerIDs;e.setCustomerIDs=i}return function(e){if(!t.isInvalid(e)){(t.parse(e).prefix===Y.HANDSHAKE?o:s)(e.source)}}},K=function(e,t){function n(e){return function(n){i[e]=n,r++,r===a&&t(i)}}var i={},r=0,a=Object.keys(e).length;Object.keys(e).forEach(function(t){var i=e[t];if(i.fn){var r=i.args||[];r.unshift(n(t)),i.fn.apply(i.context||null,r)}})},Q=function(e){var t;if(!e&&_.location&&(e=_.location.hostname),t=e)if(/^[0-9.]+$/.test(t))t="";else{var n=",ac,ad,ae,af,ag,ai,al,am,an,ao,aq,ar,as,at,au,aw,ax,az,ba,bb,be,bf,bg,bh,bi,bj,bm,bo,br,bs,bt,bv,bw,by,bz,ca,cc,cd,cf,cg,ch,ci,cl,cm,cn,co,cr,cu,cv,cw,cx,cz,de,dj,dk,dm,do,dz,ec,ee,eg,es,et,eu,fi,fm,fo,fr,ga,gb,gd,ge,gf,gg,gh,gi,gl,gm,gn,gp,gq,gr,gs,gt,gw,gy,hk,hm,hn,hr,ht,hu,id,ie,im,in,io,iq,ir,is,it,je,jo,jp,kg,ki,km,kn,kp,kr,ky,kz,la,lb,lc,li,lk,lr,ls,lt,lu,lv,ly,ma,mc,md,me,mg,mh,mk,ml,mn,mo,mp,mq,mr,ms,mt,mu,mv,mw,mx,my,na,nc,ne,nf,ng,nl,no,nr,nu,nz,om,pa,pe,pf,ph,pk,pl,pm,pn,pr,ps,pt,pw,py,qa,re,ro,rs,ru,rw,sa,sb,sc,sd,se,sg,sh,si,sj,sk,sl,sm,sn,so,sr,st,su,sv,sx,sy,sz,tc,td,tf,tg,th,tj,tk,tl,tm,tn,to,tp,tr,tt,tv,tw,tz,ua,ug,uk,us,uy,uz,va,vc,ve,vg,vi,vn,vu,wf,ws,yt,",i=t.split("."),r=i.length-1,a=r-1;if(r>1&&i[r].length<=2&&(2===i[r-1].length||n.indexOf(","+i[r]+",")<0)&&a--,a>0)for(t="";r>=a;)t=i[r]+(t?".":"")+t,r--}return t},$={compare:o,isLessThan:function(e,t){return o(e,t)<0},areVersionsDifferent:function(e,t){return 0!==o(e,t)},isGreaterThan:function(e,t){return o(e,t)>0},isEqual:function(e,t){return 0===o(e,t)}},Z=!!_.postMessage,ee={postMessage:function(e,t,n){var i=1;t&&(Z?n.postMessage(e,t.replace(/([^:]+:\/\/[^\/]+).*/,"$1")):t&&(n.location=t.replace(/#.*$/,"")+"#"+ +new Date+i+++"&"+e))},receiveMessage:function(e,t){var n;try{Z&&(e&&(n=function(n){if("string"==typeof t&&n.origin!==t||"[object Function]"===Object.prototype.toString.call(t)&&!1===t(n.origin))return!1;e(n)}),_.addEventListener?_[e?"addEventListener":"removeEventListener"]("message",n):_[e?"attachEvent":"detachEvent"]("onmessage",n))}catch(e){}}},te=function(e){var t,n,i="0123456789",r="",a="",o=8,s=10,l=10;if(1==e){for(i+="ABCDEF",t=0;16>t;t++)n=Math.floor(Math.random()*o),r+=i.substring(n,n+1),n=Math.floor(Math.random()*o),a+=i.substring(n,n+1),o=16;return r+"-"+a}for(t=0;19>t;t++)n=Math.floor(Math.random()*s),r+=i.substring(n,n+1),0===t&&9==n?s=3:(1==t||2==t)&&10!=s&&2>n?s=10:2<t&&(s=10),n=Math.floor(Math.random()*l),a+=i.substring(n,n+1),0===t&&9==n?l=3:(1==t||2==t)&&10!=l&&2>n?l=10:2<t&&(l=10);return r+a},ne=function(e,t){return{corsMetadata:function(){var e="none",t=!0;return"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest===Object(XMLHttpRequest)&&("withCredentials"in new XMLHttpRequest?e="XMLHttpRequest":"undefined"!=typeof XDomainRequest&&XDomainRequest===Object(XDomainRequest)&&(t=!1),Object.prototype.toString.call(_.HTMLElement).indexOf("Constructor")>0&&(t=!1)),{corsType:e,corsCookiesEnabled:t}}(),getCORSInstance:function(){return"none"===this.corsMetadata.corsType?null:new _[this.corsMetadata.corsType]},fireCORS:function(t,n,i){function r(e){var n;try{if((n=JSON.parse(e))!==Object(n))return void a.handleCORSError(t,null,"Response is not JSON")}catch(e){return void a.handleCORSError(t,e,"Error parsing response as JSON")}try{for(var i=t.callback,r=_,o=0;o<i.length;o++)r=r[i[o]];r(n)}catch(e){a.handleCORSError(t,e,"Error forming callback function")}}var a=this;n&&(t.loadErrorHandler=n);try{var o=this.getCORSInstance();o.open("get",t.corsUrl+"&ts="+(new Date).getTime(),!0),"XMLHttpRequest"===this.corsMetadata.corsType&&(o.withCredentials=!0,o.timeout=e.loadTimeout,o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.onreadystatechange=function(){4===this.readyState&&200===this.status&&r(this.responseText)}),o.onerror=function(e){a.handleCORSError(t,e,"onerror")},o.ontimeout=function(e){a.handleCORSError(t,e,"ontimeout")},o.send(),e._log.requests.push(t.corsUrl)}catch(e){this.handleCORSError(t,e,"try-catch")}},handleCORSError:function(t,n,i){e.CORSErrors.push({corsData:t,error:n,description:i}),t.loadErrorHandler&&("ontimeout"===i?t.loadErrorHandler(!0):t.loadErrorHandler(!1))}}},ie={POST_MESSAGE_ENABLED:!!_.postMessage,DAYS_BETWEEN_SYNC_ID_CALLS:1,MILLIS_PER_DAY:864e5,ADOBE_MC:"adobe_mc",ADOBE_MC_SDID:"adobe_mc_sdid",VALID_VISITOR_ID_REGEX:/^[0-9a-fA-F\-]+$/,ADOBE_MC_TTL_IN_MIN:5,VERSION_REGEX:/vVersion\|((\d+\.)?(\d+\.)?(\*|\d+))(?=$|\|)/,FIRST_PARTY_SERVER_COOKIE:"s_ecid"},re=function(e,t){var n=_.document;return{THROTTLE_START:3e4,MAX_SYNCS_LENGTH:649,throttleTimerSet:!1,id:null,onPagePixels:[],iframeHost:null,getIframeHost:function(e){if("string"==typeof e){var t=e.split("/");return t[0]+"//"+t[2]}},subdomain:null,url:null,getUrl:function(){var t,i="http://fast.",r="?d_nsid="+e.idSyncContainerID+"#"+encodeURIComponent(n.location.origin);return this.subdomain||(this.subdomain="nosubdomainreturned"),e.loadSSL&&(i=e.idSyncSSLUseAkamai?"https://fast.":"https://"),t=i+this.subdomain+".demdex.net/dest5.html"+r,this.iframeHost=this.getIframeHost(t),this.id="destination_publishing_iframe_"+this.subdomain+"_"+e.idSyncContainerID,t},checkDPIframeSrc:function(){var t="?d_nsid="+e.idSyncContainerID+"#"+encodeURIComponent(n.location.href);"string"==typeof e.dpIframeSrc&&e.dpIframeSrc.length&&(this.id="destination_publishing_iframe_"+(e._subdomain||this.subdomain||(new Date).getTime())+"_"+e.idSyncContainerID,this.iframeHost=this.getIframeHost(e.dpIframeSrc),this.url=e.dpIframeSrc+t)},idCallNotProcesssed:null,doAttachIframe:!1,startedAttachingIframe:!1,iframeHasLoaded:null,iframeIdChanged:null,newIframeCreated:null,originalIframeHasLoadedAlready:null,iframeLoadedCallbacks:[],regionChanged:!1,timesRegionChanged:0,sendingMessages:!1,messages:[],messagesPosted:[],messagesReceived:[],messageSendingInterval:ie.POST_MESSAGE_ENABLED?null:100,onPageDestinationsFired:[],jsonForComparison:[],jsonDuplicates:[],jsonWaiting:[],jsonProcessed:[],canSetThirdPartyCookies:!0,receivedThirdPartyCookiesNotification:!1,readyToAttachIframePreliminary:function(){return!(e.idSyncDisableSyncs||e.disableIdSyncs||e.idSyncDisable3rdPartySyncing||e.disableThirdPartyCookies||e.disableThirdPartyCalls)},readyToAttachIframe:function(){return this.readyToAttachIframePreliminary()&&(this.doAttachIframe||e._doAttachIframe)&&(this.subdomain&&"nosubdomainreturned"!==this.subdomain||e._subdomain)&&this.url&&!this.startedAttachingIframe},attachIframe:function(){function e(){r=n.createElement("iframe"),r.sandbox="allow-scripts allow-same-origin",r.title="Adobe ID Syncing iFrame",r.id=i.id,r.name=i.id+"_name",r.style.cssText="display: none; width: 0; height: 0;",r.src=i.url,i.newIframeCreated=!0,t(),n.body.appendChild(r)}function t(e){r.addEventListener("load",function(){r.className="aamIframeLoaded",i.iframeHasLoaded=!0,i.fireIframeLoadedCallbacks(e),i.requestToProcess()})}this.startedAttachingIframe=!0;var i=this,r=n.getElementById(this.id);r?"IFRAME"!==r.nodeName?(this.id+="_2",this.iframeIdChanged=!0,e()):(this.newIframeCreated=!1,"aamIframeLoaded"!==r.className?(this.originalIframeHasLoadedAlready=!1,t("The destination publishing iframe already exists from a different library, but hadn't loaded yet.")):(this.originalIframeHasLoadedAlready=!0,this.iframeHasLoaded=!0,this.iframe=r,this.fireIframeLoadedCallbacks("The destination publishing iframe already exists from a different library, and had loaded alresady."),this.requestToProcess())):e(),this.iframe=r},fireIframeLoadedCallbacks:function(e){this.iframeLoadedCallbacks.forEach(function(t){"function"==typeof t&&t({message:e||"The destination publishing iframe was attached and loaded successfully."})}),this.iframeLoadedCallbacks=[]},requestToProcess:function(t){function n(){r.jsonForComparison.push(t),r.jsonWaiting.push(t),r.processSyncOnPage(t)}var i,r=this;if(t===Object(t)&&t.ibs)if(i=JSON.stringify(t.ibs||[]),this.jsonForComparison.length){var a,o,s,l=!1;for(a=0,o=this.jsonForComparison.length;a<o;a++)if(s=this.jsonForComparison[a],i===JSON.stringify(s.ibs||[])){l=!0;break}l?this.jsonDuplicates.push(t):n()}else n();if((this.receivedThirdPartyCookiesNotification||!ie.POST_MESSAGE_ENABLED||this.iframeHasLoaded)&&this.jsonWaiting.length){var c=this.jsonWaiting.shift();this.process(c),this.requestToProcess()}e.idSyncDisableSyncs||e.disableIdSyncs||!this.iframeHasLoaded||!this.messages.length||this.sendingMessages||(this.throttleTimerSet||(this.throttleTimerSet=!0,setTimeout(function(){r.messageSendingInterval=ie.POST_MESSAGE_ENABLED?null:150},this.THROTTLE_START)),this.sendingMessages=!0,this.sendMessages())},getRegionAndCheckIfChanged:function(t,n){var i=e._getField("MCAAMLH"),r=t.d_region||t.dcs_region;return i?r&&(e._setFieldExpire("MCAAMLH",n),e._setField("MCAAMLH",r),parseInt(i,10)!==r&&(this.regionChanged=!0,this.timesRegionChanged++,e._setField("MCSYNCSOP",""),e._setField("MCSYNCS",""),i=r)):(i=r)&&(e._setFieldExpire("MCAAMLH",n),e._setField("MCAAMLH",i)),i||(i=""),i},processSyncOnPage:function(e){var t,n,i,r;if((t=e.ibs)&&t instanceof Array&&(n=t.length))for(i=0;i<n;i++)r=t[i],r.syncOnPage&&this.checkFirstPartyCookie(r,"","syncOnPage")},process:function(e){var t,n,i,r,a,o=encodeURIComponent,s=!1;if((t=e.ibs)&&t instanceof Array&&(n=t.length))for(s=!0,i=0;i<n;i++)r=t[i],a=[o("ibs"),o(r.id||""),o(r.tag||""),j.encodeAndBuildRequest(r.url||[],","),o(r.ttl||""),"","",r.fireURLSync?"true":"false"],r.syncOnPage||(this.canSetThirdPartyCookies?this.addMessage(a.join("|")):r.fireURLSync&&this.checkFirstPartyCookie(r,a.join("|")));s&&this.jsonProcessed.push(e)},checkFirstPartyCookie:function(t,n,i){var r="syncOnPage"===i,a=r?"MCSYNCSOP":"MCSYNCS";e._readVisitor();var o,s,l=e._getField(a),c=!1,u=!1,d=Math.ceil((new Date).getTime()/ie.MILLIS_PER_DAY);l?(o=l.split("*"),s=this.pruneSyncData(o,t.id,d),c=s.dataPresent,u=s.dataValid,c&&u||this.fireSync(r,t,n,o,a,d)):(o=[],this.fireSync(r,t,n,o,a,d))},pruneSyncData:function(e,t,n){var i,r,a,o=!1,s=!1;for(r=0;r<e.length;r++)i=e[r],a=parseInt(i.split("-")[1],10),i.match("^"+t+"-")?(o=!0,n<a?s=!0:(e.splice(r,1),r--)):n>=a&&(e.splice(r,1),r--);return{dataPresent:o,dataValid:s}},manageSyncsSize:function(e){if(e.join("*").length>this.MAX_SYNCS_LENGTH)for(e.sort(function(e,t){return parseInt(e.split("-")[1],10)-parseInt(t.split("-")[1],10)});e.join("*").length>this.MAX_SYNCS_LENGTH;)e.shift()},fireSync:function(t,n,i,r,a,o){var s=this;if(t){if("img"===n.tag){var l,c,u,d,f=n.url,g=e.loadSSL?"https:":"http:";for(l=0,c=f.length;l<c;l++){u=f[l],d=/^\/\//.test(u);var p=new Image;p.addEventListener("load",function(t,n,i,r){return function(){s.onPagePixels[t]=null,e._readVisitor();var o,l=e._getField(a),c=[];if(l){o=l.split("*");var u,d,f;for(u=0,d=o.length;u<d;u++)f=o[u],f.match("^"+n.id+"-")||c.push(f)}s.setSyncTrackingData(c,n,i,r)}}(this.onPagePixels.length,n,a,o)),p.src=(d?g:"")+u,this.onPagePixels.push(p)}}}else this.addMessage(i),this.setSyncTrackingData(r,n,a,o)},addMessage:function(t){var n=encodeURIComponent,i=n(e._enableErrorReporting?"---destpub-debug---":"---destpub---");this.messages.push((ie.POST_MESSAGE_ENABLED?"":i)+t)},setSyncTrackingData:function(t,n,i,r){t.push(n.id+"-"+(r+Math.ceil(n.ttl/60/24))),this.manageSyncsSize(t),e._setField(i,t.join("*"))},sendMessages:function(){var e,t=this,n="",i=encodeURIComponent;this.regionChanged&&(n=i("---destpub-clear-dextp---"),this.regionChanged=!1),this.messages.length?ie.POST_MESSAGE_ENABLED?(e=n+i("---destpub-combined---")+this.messages.join("%01"),this.postMessage(e),this.messages=[],this.sendingMessages=!1):(e=this.messages.shift(),this.postMessage(n+e),setTimeout(function(){t.sendMessages()},this.messageSendingInterval)):this.sendingMessages=!1},postMessage:function(e){ee.postMessage(e,this.url,this.iframe.contentWindow),this.messagesPosted.push(e)},receiveMessage:function(e){var t,n=/^---destpub-to-parent---/;"string"==typeof e&&n.test(e)&&(t=e.replace(n,"").split("|"),"canSetThirdPartyCookies"===t[0]&&(this.canSetThirdPartyCookies="true"===t[1],this.receivedThirdPartyCookiesNotification=!0,this.requestToProcess()),this.messagesReceived.push(e))},processIDCallData:function(i){(null==this.url||i.subdomain&&"nosubdomainreturned"===this.subdomain)&&("string"==typeof e._subdomain&&e._subdomain.length?this.subdomain=e._subdomain:this.subdomain=i.subdomain||"",this.url=this.getUrl()),i.ibs instanceof Array&&i.ibs.length&&(this.doAttachIframe=!0),this.readyToAttachIframe()&&(e.idSyncAttachIframeOnWindowLoad?(t.windowLoaded||"complete"===n.readyState||"loaded"===n.readyState)&&this.attachIframe():this.attachIframeASAP()),"function"==typeof e.idSyncIDCallResult?e.idSyncIDCallResult(i):this.requestToProcess(i),"function"==typeof e.idSyncAfterIDCallResult&&e.idSyncAfterIDCallResult(i)},canMakeSyncIDCall:function(t,n){return e._forceSyncIDCall||!t||n-t>ie.DAYS_BETWEEN_SYNC_ID_CALLS},attachIframeASAP:function(){function e(){t.startedAttachingIframe||(n.body?t.attachIframe():setTimeout(e,30))}var t=this;e()}}},ae={audienceManagerServer:{},audienceManagerServerSecure:{},cookieDomain:{},cookieLifetime:{},cookieName:{},doesOptInApply:{},disableThirdPartyCalls:{},discardTrackingServerECID:{},idSyncAfterIDCallResult:{},idSyncAttachIframeOnWindowLoad:{},idSyncContainerID:{},idSyncDisable3rdPartySyncing:{},disableThirdPartyCookies:{},idSyncDisableSyncs:{},disableIdSyncs:{},idSyncIDCallResult:{},idSyncSSLUseAkamai:{},isCoopSafe:{},isIabContext:{},isOptInStorageEnabled:{},loadSSL:{},loadTimeout:{},marketingCloudServer:{},marketingCloudServerSecure:{},optInCookieDomain:{},optInStorageExpiry:{},overwriteCrossDomainMCIDAndAID:{},preOptInApprovals:{},previousPermissions:{},resetBeforeVersion:{},sdidParamExpiry:{},serverState:{},sessionCookieName:{},secureCookie:{},takeTimeoutMetrics:{},trackingServer:{},trackingServerSecure:{},whitelistIframeDomains:{},whitelistParentDomain:{}},oe={getConfigNames:function(){return Object.keys(ae)},getConfigs:function(){return ae},normalizeConfig:function(e){return"function"!=typeof e?e:e()}},se=function(e){var t={};return e.on=function(e,n,i){if(!n||"function"!=typeof n)throw new Error("[ON] Callback should be a function.");t.hasOwnProperty(e)||(t[e]=[]);var r=t[e].push({callback:n,context:i})-1;return function(){t[e].splice(r,1),t[e].length||delete t[e]}},e.publish=function(e){if(t.hasOwnProperty(e)){var n=[].slice.call(arguments,1);t[e].slice(0).forEach(function(e){e.callback.apply(e.context,n)})}},e.publish},le={PENDING:"pending",CHANGED:"changed",COMPLETE:"complete"},ce={AAM:"aam",ADCLOUD:"adcloud",ANALYTICS:"aa",CAMPAIGN:"campaign",ECID:"ecid",LIVEFYRE:"livefyre",TARGET:"target",VIDEO_ANALYTICS:"videoaa"},ue=(C={},t(C,ce.AAM,565),t(C,ce.ECID,565),C),de=(I={},t(I,ce.AAM,[1,2,5]),t(I,ce.ECID,[1,2,5]),I),fe=function(e){return Object.keys(e).map(function(t){return e[t]})}(ce),ge=function(){var e={};return e.callbacks=Object.create(null),e.add=function(t,n){if(!l(n))throw new Error("[callbackRegistryFactory] Make sure callback is a function or an array of functions.");e.callbacks[t]=e.callbacks[t]||[];var i=e.callbacks[t].push(n)-1;return function(){e.callbacks[t].splice(i,1)}},e.execute=function(t,n){if(e.callbacks[t]){n=void 0===n?[]:n,n=n instanceof Array?n:[n];try{for(;e.callbacks[t].length;){var i=e.callbacks[t].shift();"function"==typeof i?i.apply(null,n):i instanceof Array&&i[1].apply(i[0],n)}delete e.callbacks[t]}catch(e){}}},e.executeAll=function(t,n){(n||t&&!s(t))&&Object.keys(e.callbacks).forEach(function(n){var i=void 0!==t[n]?t[n]:"";e.execute(n,i)},e)},e.hasCallbacks=function(){return Boolean(Object.keys(e.callbacks).length)},e},pe=function(){},me=function(e){var t=window,n=t.console;return!!n&&"function"==typeof n[e]},he=function(e,t,n){return n()?function(){if(me(e)){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];console[e].apply(console,[t].concat(i))}}:pe},_e=c,Ce=new _e("[ADOBE OPT-IN]"),Ie=function(t,n){return e(t)===n},ve=function(e,t){return e instanceof Array?e:Ie(e,"string")?[e]:t||[]},De=function(e){var t=Object.keys(e);return!!t.length&&t.every(function(t){return!0===e[t]})},Se=function(e){return!(!e||ye(e))&&ve(e).every(function(e){return fe.indexOf(e)>-1})},be=function(e,t){return e.reduce(function(e,n){return e[n]=t,e},{})},Ae=function(e){return JSON.parse(JSON.stringify(e))},ye=function(e){return"[object Array]"===Object.prototype.toString.call(e)&&!e.length},Oe=function(e){if(Ee(e))return e;try{return JSON.parse(e)}catch(e){return{}}},Me=function(e){return void 0===e||(Ee(e)?Se(Object.keys(e)):ke(e))},ke=function(e){try{var t=JSON.parse(e);return!!e&&Ie(e,"string")&&Se(Object.keys(t))}catch(e){return!1}},Ee=function(e){return null!==e&&Ie(e,"object")&&!1===Array.isArray(e)},Te=function(){},Le=function(e){return Ie(e,"function")?e():e},Pe=function(e,t){Me(e)||Ce.error("".concat(t))},we=function(e){return Object.keys(e).map(function(t){return e[t]})},Re=function(e){return we(e).filter(function(e,t,n){return n.indexOf(e)===t})},Fe=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.command,i=t.params,r=void 0===i?{}:i,a=t.callback,o=void 0===a?Te:a;if(!n||-1===n.indexOf("."))throw new Error("[OptIn.execute] Please provide a valid command.");try{var s=n.split("."),l=e[s[0]],c=s[1];if(!l||"function"!=typeof l[c])throw new Error("Make sure the plugin and API name exist.");var u=Object.assign(r,{callback:o});l[c].call(l,u)}catch(e){Ce.error("[execute] Something went wrong: "+e.message)}}};d.prototype=Object.create(Error.prototype),d.prototype.constructor=d;var Ne="fetchPermissions",xe="[OptIn#registerPlugin] Plugin is invalid.";f.Categories=ce,f.TimeoutError=d;var je=Object.freeze({OptIn:f,IabPlugin:m}),Ve={get:function(e){e=encodeURIComponent(e);var t=(";"+document.cookie).split(" ").join(";"),n=t.indexOf(";"+e+"="),i=n<0?n:t.indexOf(";",n+1);return n<0?"":decodeURIComponent(t.substring(n+2+e.length,i<0?t.length:i))},set:function(e,t,n){var i=h(n,"cookieLifetime"),r=h(n,"expires"),a=h(n,"domain"),o=h(n,"secure"),s=o?"Secure":"";if(r&&"SESSION"!==i&&"NONE"!==i){var l=""!==t?parseInt(i||0,10):-60;if(l)r=new Date,r.setTime(r.getTime()+1e3*l);else if(1===r){r=new Date;var c=r.getYear();r.setYear(c+2+(c<1900?1900:0))}}else r=0;return e&&"NONE"!==i?(document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+"; path=/;"+(r?" expires="+r.toGMTString()+";":"")+(a?" domain="+a+";":"")+s,this.get(e)===t):0},remove:function(e,t){var n=h(t,"domain")
;n=n?" domain="+n+";":"",document.cookie=encodeURIComponent(e)+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"+n}},Ue=function(e,t){e.publishDestinations=function(n){var i=arguments[1],r=arguments[2];try{r="function"==typeof r?r:n.callback}catch(e){r=function(){}}var a=t;if(!a.readyToAttachIframePreliminary())return void r({error:"The destination publishing iframe is disabled in the Visitor library."});if("string"==typeof n){if(!n.length)return void r({error:"subdomain is not a populated string."});if(!(i instanceof Array&&i.length))return void r({error:"messages is not a populated array."});var o=!1;if(i.forEach(function(e){"string"==typeof e&&e.length&&(a.addMessage(e),o=!0)}),!o)return void r({error:"None of the messages are populated strings."})}else{if(!j.isObject(n))return void r({error:"Invalid parameters passed."});var s=n;if("string"!=typeof(n=s.subdomain)||!n.length)return void r({error:"config.subdomain is not a populated string."});var l=s.urlDestinations;if(!(l instanceof Array&&l.length))return void r({error:"config.urlDestinations is not a populated array."});var c=[];l.forEach(function(e){j.isObject(e)&&(e.hideReferrer?e.message&&a.addMessage(e.message):c.push(e))});!function e(){c.length&&setTimeout(function(){var t=new Image,n=c.shift();t.src=n.url,a.onPageDestinationsFired.push(n),e()},100)}()}a.iframe?(r({message:"The destination publishing iframe is already attached and loaded."}),a.requestToProcess()):!e.subdomain&&e._getField("MCMID")?(a.subdomain=n,a.doAttachIframe=!0,a.url=a.getUrl(),a.readyToAttachIframe()?(a.iframeLoadedCallbacks.push(function(e){r({message:"Attempted to attach and load the destination publishing iframe through this API call. Result: "+(e.message||"no result")})}),a.attachIframe()):r({error:"Encountered a problem in attempting to attach and load the destination publishing iframe through this API call."})):a.iframeLoadedCallbacks.push(function(e){r({message:"Attempted to attach and load the destination publishing iframe through normal Visitor API processing. Result: "+(e.message||"no result")})})}},He=je.OptIn;j.defineGlobalNamespace(),window.adobe.OptInCategories=He.Categories;var Be=function(t,n,i){function r(e){var t=e;return function(e){var n=e||h.location.href;try{var i=d._extractParamFromUri(n,t);if(i)return L.parsePipeDelimetedKeyValues(i)}catch(e){}}}function a(e){function t(e,t,n){e&&e.match(ie.VALID_VISITOR_ID_REGEX)&&(n===v&&(m=!0),t(e))}t(e[v],d.setMarketingCloudVisitorID,v),d._setFieldExpire(y,-1),t(e[b],d.setAnalyticsVisitorID)}function o(e){e=e||{},d._supplementalDataIDCurrent=e.supplementalDataIDCurrent||"",d._supplementalDataIDCurrentConsumed=e.supplementalDataIDCurrentConsumed||{},d._supplementalDataIDLast=e.supplementalDataIDLast||"",d._supplementalDataIDLastConsumed=e.supplementalDataIDLastConsumed||{}}function s(e){function t(e,t,n){return n=n?n+="|":n,n+=e+"="+encodeURIComponent(t)}function n(e,n){var i=n[0],r=n[1];return null!=r&&r!==O&&(e=t(i,r,e)),e}var i=e.reduce(n,"");return function(e){var t=L.getTimestampInSeconds();return e=e?e+="|":e,e+="TS="+t}(i)}function l(e){var t=e.minutesToLive,n="";return(d.idSyncDisableSyncs||d.disableIdSyncs)&&(n=n||"Error: id syncs have been disabled"),"string"==typeof e.dpid&&e.dpid.length||(n=n||"Error: config.dpid is empty"),"string"==typeof e.url&&e.url.length||(n=n||"Error: config.url is empty"),void 0===t?t=20160:(t=parseInt(t,10),(isNaN(t)||t<=0)&&(n=n||"Error: config.minutesToLive needs to be a positive number")),{error:n,ttl:t}}function c(){return!!d.configs.doesOptInApply&&!(f.optIn.isComplete&&u())}function u(){return d.configs.isIabContext?f.optIn.isApproved(f.optIn.Categories.ECID)&&p:f.optIn.isApproved(f.optIn.Categories.ECID)}if(!i||i.split("").reverse().join("")!==t)throw new Error("Please use `Visitor.getInstance` to instantiate Visitor.");var d=this,f=window.adobe,g="",p=!1,m=!1;d.version="4.3.0";var h=_,C=h.Visitor;C.version=d.version,C.AuthState=E.AUTH_STATE,C.OptOut=E.OPT_OUT,h.s_c_in||(h.s_c_il=[],h.s_c_in=0),d._c="Visitor",d._il=h.s_c_il,d._in=h.s_c_in,d._il[d._in]=d,h.s_c_in++,d._instanceType="regular",d._log={requests:[]},d.marketingCloudOrgID=t,d.cookieName="AMCV_"+t,d.sessionCookieName="AMCVS_"+t,d.cookieDomain=Q(),d.cookieDomain===h.location.hostname&&(d.cookieDomain=""),d.loadSSL=h.location.protocol.toLowerCase().indexOf("https")>=0,d.loadTimeout=3e4,d.CORSErrors=[],d.marketingCloudServer=d.audienceManagerServer="dpm.demdex.net",d.sdidParamExpiry=30;var I=null,v="MCMID",D="MCIDTS",S="A",b="MCAID",A="AAM",y="MCAAMB",O="NONE",M=function(e){return!Object.prototype[e]},k=ne(d);d.FIELDS=E.FIELDS,d.cookieRead=function(e){return Ve.get(e)},d.cookieWrite=function(e,t,n){var i=d.cookieLifetime?(""+d.cookieLifetime).toUpperCase():"",r=!1;return d.configs&&d.configs.secureCookie&&"https:"===location.protocol&&(r=!0),Ve.set(e,""+t,{expires:n,domain:d.cookieDomain,cookieLifetime:i,secure:r})},d.resetState=function(e){e?d._mergeServerState(e):o()},d._isAllowedDone=!1,d._isAllowedFlag=!1,d.isAllowed=function(){return d._isAllowedDone||(d._isAllowedDone=!0,(d.cookieRead(d.cookieName)||d.cookieWrite(d.cookieName,"T",1))&&(d._isAllowedFlag=!0)),"T"===d.cookieRead(d.cookieName)&&d._helpers.removeCookie(d.cookieName),d._isAllowedFlag},d.setMarketingCloudVisitorID=function(e){d._setMarketingCloudFields(e)},d._use1stPartyMarketingCloudServer=!1,d.getMarketingCloudVisitorID=function(e,t){d.marketingCloudServer&&d.marketingCloudServer.indexOf(".demdex.net")<0&&(d._use1stPartyMarketingCloudServer=!0);var n=d._getAudienceManagerURLData("_setMarketingCloudFields"),i=n.url;return d._getRemoteField(v,i,e,t,n)},d.getVisitorValues=function(e,t){var n={MCMID:{fn:d.getMarketingCloudVisitorID,args:[!0],context:d},MCOPTOUT:{fn:d.isOptedOut,args:[void 0,!0],context:d},MCAID:{fn:d.getAnalyticsVisitorID,args:[!0],context:d},MCAAMLH:{fn:d.getAudienceManagerLocationHint,args:[!0],context:d},MCAAMB:{fn:d.getAudienceManagerBlob,args:[!0],context:d}},i=t&&t.length?j.pluck(n,t):n;K(i,e)},d._currentCustomerIDs={},d._customerIDsHashChanged=!1,d._newCustomerIDsHash="",d.setCustomerIDs=function(t){function n(){d._customerIDsHashChanged=!1}if(!d.isOptedOut()&&t){if(!j.isObject(t)||j.isObjectEmpty(t))return!1;d._readVisitor();var i,r;for(i in t)if(M(i)&&(r=t[i]))if("object"===e(r)){var a={};r.id&&(a.id=r.id),void 0!=r.authState&&(a.authState=r.authState),d._currentCustomerIDs[i]=a}else d._currentCustomerIDs[i]={id:r};var o=d.getCustomerIDs(),s=d._getField("MCCIDH"),l="";s||(s=0);for(i in o)M(i)&&(r=o[i],l+=(l?"|":"")+i+"|"+(r.id?r.id:"")+(r.authState?r.authState:""));d._newCustomerIDsHash=String(d._hash(l)),d._newCustomerIDsHash!==s&&(d._customerIDsHashChanged=!0,d._mapCustomerIDs(n))}},d.getCustomerIDs=function(){d._readVisitor();var e,t,n={};for(e in d._currentCustomerIDs)M(e)&&(t=d._currentCustomerIDs[e],n[e]||(n[e]={}),t.id&&(n[e].id=t.id),void 0!=t.authState?n[e].authState=t.authState:n[e].authState=C.AuthState.UNKNOWN);return n},d.setAnalyticsVisitorID=function(e){d._setAnalyticsFields(e)},d.getAnalyticsVisitorID=function(e,t,n){if(!L.isTrackingServerPopulated()&&!n)return d._callCallback(e,[""]),"";var i="";if(n||(i=d.getMarketingCloudVisitorID(function(t){d.getAnalyticsVisitorID(e,!0)})),i||n){var r=n?d.marketingCloudServer:d.trackingServer,a="";d.loadSSL&&(n?d.marketingCloudServerSecure&&(r=d.marketingCloudServerSecure):d.trackingServerSecure&&(r=d.trackingServerSecure));var o={};if(r){var s="http"+(d.loadSSL?"s":"")+"://"+r+"/id",l="d_visid_ver="+d.version+"&mcorgid="+encodeURIComponent(d.marketingCloudOrgID)+(i?"&mid="+encodeURIComponent(i):"")+(d.idSyncDisable3rdPartySyncing||d.disableThirdPartyCookies?"&d_coppa=true":""),c=["s_c_il",d._in,"_set"+(n?"MarketingCloud":"Analytics")+"Fields"];a=s+"?"+l+"&callback=s_c_il%5B"+d._in+"%5D._set"+(n?"MarketingCloud":"Analytics")+"Fields",o.corsUrl=s+"?"+l,o.callback=c}return o.url=a,d._getRemoteField(n?v:b,a,e,t,o)}return""},d.getAudienceManagerLocationHint=function(e,t){if(d.getMarketingCloudVisitorID(function(t){d.getAudienceManagerLocationHint(e,!0)})){var n=d._getField(b);if(!n&&L.isTrackingServerPopulated()&&(n=d.getAnalyticsVisitorID(function(t){d.getAudienceManagerLocationHint(e,!0)})),n||!L.isTrackingServerPopulated()){var i=d._getAudienceManagerURLData(),r=i.url;return d._getRemoteField("MCAAMLH",r,e,t,i)}}return""},d.getLocationHint=d.getAudienceManagerLocationHint,d.getAudienceManagerBlob=function(e,t){if(d.getMarketingCloudVisitorID(function(t){d.getAudienceManagerBlob(e,!0)})){var n=d._getField(b);if(!n&&L.isTrackingServerPopulated()&&(n=d.getAnalyticsVisitorID(function(t){d.getAudienceManagerBlob(e,!0)})),n||!L.isTrackingServerPopulated()){var i=d._getAudienceManagerURLData(),r=i.url;return d._customerIDsHashChanged&&d._setFieldExpire(y,-1),d._getRemoteField(y,r,e,t,i)}}return""},d._supplementalDataIDCurrent="",d._supplementalDataIDCurrentConsumed={},d._supplementalDataIDLast="",d._supplementalDataIDLastConsumed={},d.getSupplementalDataID=function(e,t){d._supplementalDataIDCurrent||t||(d._supplementalDataIDCurrent=d._generateID(1));var n=d._supplementalDataIDCurrent;return d._supplementalDataIDLast&&!d._supplementalDataIDLastConsumed[e]?(n=d._supplementalDataIDLast,d._supplementalDataIDLastConsumed[e]=!0):n&&(d._supplementalDataIDCurrentConsumed[e]&&(d._supplementalDataIDLast=d._supplementalDataIDCurrent,d._supplementalDataIDLastConsumed=d._supplementalDataIDCurrentConsumed,d._supplementalDataIDCurrent=n=t?"":d._generateID(1),d._supplementalDataIDCurrentConsumed={}),n&&(d._supplementalDataIDCurrentConsumed[e]=!0)),n};var T=!1;d._liberatedOptOut=null,d.getOptOut=function(e,t){var n=d._getAudienceManagerURLData("_setMarketingCloudFields"),i=n.url;if(u())return d._getRemoteField("MCOPTOUT",i,e,t,n);if(d._registerCallback("liberatedOptOut",e),null!==d._liberatedOptOut)return d._callAllCallbacks("liberatedOptOut",[d._liberatedOptOut]),T=!1,d._liberatedOptOut;if(T)return null;T=!0;var r="liberatedGetOptOut";return n.corsUrl=n.corsUrl.replace(/dpm\.demdex\.net\/id\?/,"dpm.demdex.net/optOutStatus?"),n.callback=[r],_[r]=function(e){if(e===Object(e)){var t,n,i=j.parseOptOut(e,t,O);t=i.optOut,n=1e3*i.d_ottl,d._liberatedOptOut=t,setTimeout(function(){d._liberatedOptOut=null},n)}d._callAllCallbacks("liberatedOptOut",[t]),T=!1},k.fireCORS(n),null},d.isOptedOut=function(e,t,n){t||(t=C.OptOut.GLOBAL);var i=d.getOptOut(function(n){var i=n===C.OptOut.GLOBAL||n.indexOf(t)>=0;d._callCallback(e,[i])},n);return i?i===C.OptOut.GLOBAL||i.indexOf(t)>=0:null},d._fields=null,d._fieldsExpired=null,d._hash=function(e){var t,n,i=0;if(e)for(t=0;t<e.length;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i},d._generateID=te,d._generateLocalMID=function(){var e=d._generateID(0);return w.isClientSideMarketingCloudVisitorID=!0,e},d._callbackList=null,d._callCallback=function(e,t){try{"function"==typeof e?e.apply(h,t):e[1].apply(e[0],t)}catch(e){}},d._registerCallback=function(e,t){t&&(null==d._callbackList&&(d._callbackList={}),void 0==d._callbackList[e]&&(d._callbackList[e]=[]),d._callbackList[e].push(t))},d._callAllCallbacks=function(e,t){if(null!=d._callbackList){var n=d._callbackList[e];if(n)for(;n.length>0;)d._callCallback(n.shift(),t)}},d._addQuerystringParam=function(e,t,n,i){var r=encodeURIComponent(t)+"="+encodeURIComponent(n),a=L.parseHash(e),o=L.hashlessUrl(e);if(-1===o.indexOf("?"))return o+"?"+r+a;var s=o.split("?"),l=s[0]+"?",c=s[1];return l+L.addQueryParamAtLocation(c,r,i)+a},d._extractParamFromUri=function(e,t){var n=new RegExp("[\\?&#]"+t+"=([^&#]*)"),i=n.exec(e);if(i&&i.length)return decodeURIComponent(i[1])},d._parseAdobeMcFromUrl=r(ie.ADOBE_MC),d._parseAdobeMcSdidFromUrl=r(ie.ADOBE_MC_SDID),d._attemptToPopulateSdidFromUrl=function(e){var n=d._parseAdobeMcSdidFromUrl(e),i=1e9;n&&n.TS&&(i=L.getTimestampInSeconds()-n.TS),n&&n.SDID&&n.MCORGID===t&&i<d.sdidParamExpiry&&(d._supplementalDataIDCurrent=n.SDID,d._supplementalDataIDCurrentConsumed.SDID_URL_PARAM=!0)},d._attemptToPopulateIdsFromUrl=function(){var e=d._parseAdobeMcFromUrl();if(e&&e.TS){var n=L.getTimestampInSeconds(),i=n-e.TS;if(Math.floor(i/60)>ie.ADOBE_MC_TTL_IN_MIN||e.MCORGID!==t)return;a(e)}},d._mergeServerState=function(e){if(e)try{if(e=function(e){return L.isObject(e)?e:JSON.parse(e)}(e),e[d.marketingCloudOrgID]){var t=e[d.marketingCloudOrgID];!function(e){L.isObject(e)&&d.setCustomerIDs(e)}(t.customerIDs),o(t.sdid)}}catch(e){throw new Error("`serverState` has an invalid format.")}},d._timeout=null,d._loadData=function(e,t,n,i){t=d._addQuerystringParam(t,"d_fieldgroup",e,1),i.url=d._addQuerystringParam(i.url,"d_fieldgroup",e,1),i.corsUrl=d._addQuerystringParam(i.corsUrl,"d_fieldgroup",e,1),w.fieldGroupObj[e]=!0,i===Object(i)&&i.corsUrl&&"XMLHttpRequest"===k.corsMetadata.corsType&&k.fireCORS(i,n,e)},d._clearTimeout=function(e){null!=d._timeout&&d._timeout[e]&&(clearTimeout(d._timeout[e]),d._timeout[e]=0)},d._settingsDigest=0,d._getSettingsDigest=function(){if(!d._settingsDigest){var e=d.version;d.audienceManagerServer&&(e+="|"+d.audienceManagerServer),d.audienceManagerServerSecure&&(e+="|"+d.audienceManagerServerSecure),d._settingsDigest=d._hash(e)}return d._settingsDigest},d._readVisitorDone=!1,d._readVisitor=function(){if(!d._readVisitorDone){d._readVisitorDone=!0;var e,t,n,i,r,a,o=d._getSettingsDigest(),s=!1,l=d.cookieRead(d.cookieName),c=new Date;if(l||m||d.discardTrackingServerECID||(l=d.cookieRead(ie.FIRST_PARTY_SERVER_COOKIE)),null==d._fields&&(d._fields={}),l&&"T"!==l)for(l=l.split("|"),l[0].match(/^[\-0-9]+$/)&&(parseInt(l[0],10)!==o&&(s=!0),l.shift()),l.length%2==1&&l.pop(),e=0;e<l.length;e+=2)t=l[e].split("-"),n=t[0],i=l[e+1],t.length>1?(r=parseInt(t[1],10),a=t[1].indexOf("s")>0):(r=0,a=!1),s&&("MCCIDH"===n&&(i=""),r>0&&(r=c.getTime()/1e3-60)),n&&i&&(d._setField(n,i,1),r>0&&(d._fields["expire"+n]=r+(a?"s":""),(c.getTime()>=1e3*r||a&&!d.cookieRead(d.sessionCookieName))&&(d._fieldsExpired||(d._fieldsExpired={}),d._fieldsExpired[n]=!0)));!d._getField(b)&&L.isTrackingServerPopulated()&&(l=d.cookieRead("s_vi"))&&(l=l.split("|"),l.length>1&&l[0].indexOf("v1")>=0&&(i=l[1],e=i.indexOf("["),e>=0&&(i=i.substring(0,e)),i&&i.match(ie.VALID_VISITOR_ID_REGEX)&&d._setField(b,i)))}},d._appendVersionTo=function(e){var t="vVersion|"+d.version,n=e?d._getCookieVersion(e):null;return n?$.areVersionsDifferent(n,d.version)&&(e=e.replace(ie.VERSION_REGEX,t)):e+=(e?"|":"")+t,e},d._writeVisitor=function(){var e,t,n=d._getSettingsDigest();for(e in d._fields)M(e)&&d._fields[e]&&"expire"!==e.substring(0,6)&&(t=d._fields[e],n+=(n?"|":"")+e+(d._fields["expire"+e]?"-"+d._fields["expire"+e]:"")+"|"+t);n=d._appendVersionTo(n),d.cookieWrite(d.cookieName,n,1)},d._getField=function(e,t){return null==d._fields||!t&&d._fieldsExpired&&d._fieldsExpired[e]?null:d._fields[e]},d._setField=function(e,t,n){null==d._fields&&(d._fields={}),d._fields[e]=t,n||d._writeVisitor()},d._getFieldList=function(e,t){var n=d._getField(e,t);return n?n.split("*"):null},d._setFieldList=function(e,t,n){d._setField(e,t?t.join("*"):"",n)},d._getFieldMap=function(e,t){var n=d._getFieldList(e,t);if(n){var i,r={};for(i=0;i<n.length;i+=2)r[n[i]]=n[i+1];return r}return null},d._setFieldMap=function(e,t,n){var i,r=null;if(t){r=[];for(i in t)M(i)&&(r.push(i),r.push(t[i]))}d._setFieldList(e,r,n)},d._setFieldExpire=function(e,t,n){var i=new Date;i.setTime(i.getTime()+1e3*t),null==d._fields&&(d._fields={}),d._fields["expire"+e]=Math.floor(i.getTime()/1e3)+(n?"s":""),t<0?(d._fieldsExpired||(d._fieldsExpired={}),d._fieldsExpired[e]=!0):d._fieldsExpired&&(d._fieldsExpired[e]=!1),n&&(d.cookieRead(d.sessionCookieName)||d.cookieWrite(d.sessionCookieName,"1"))},d._findVisitorID=function(t){return t&&("object"===e(t)&&(t=t.d_mid?t.d_mid:t.visitorID?t.visitorID:t.id?t.id:t.uuid?t.uuid:""+t),t&&"NOTARGET"===(t=t.toUpperCase())&&(t=O),t&&(t===O||t.match(ie.VALID_VISITOR_ID_REGEX))||(t="")),t},d._setFields=function(t,n){if(d._clearTimeout(t),null!=d._loading&&(d._loading[t]=!1),w.fieldGroupObj[t]&&w.setState(t,!1),"MC"===t){!0!==w.isClientSideMarketingCloudVisitorID&&(w.isClientSideMarketingCloudVisitorID=!1);var i=d._getField(v);if(!i||d.overwriteCrossDomainMCIDAndAID){if(!(i="object"===e(n)&&n.mid?n.mid:d._findVisitorID(n))){if(d._use1stPartyMarketingCloudServer&&!d.tried1stPartyMarketingCloudServer)return d.tried1stPartyMarketingCloudServer=!0,void d.getAnalyticsVisitorID(null,!1,!0);i=d._generateLocalMID()}d._setField(v,i)}i&&i!==O||(i=""),"object"===e(n)&&((n.d_region||n.dcs_region||n.d_blob||n.blob)&&d._setFields(A,n),d._use1stPartyMarketingCloudServer&&n.mid&&d._setFields(S,{id:n.id})),d._callAllCallbacks(v,[i])}if(t===A&&"object"===e(n)){var r=604800;void 0!=n.id_sync_ttl&&n.id_sync_ttl&&(r=parseInt(n.id_sync_ttl,10));var a=P.getRegionAndCheckIfChanged(n,r);d._callAllCallbacks("MCAAMLH",[a]);var o=d._getField(y);(n.d_blob||n.blob)&&(o=n.d_blob,o||(o=n.blob),d._setFieldExpire(y,r),d._setField(y,o)),o||(o=""),d._callAllCallbacks(y,[o]),!n.error_msg&&d._newCustomerIDsHash&&d._setField("MCCIDH",d._newCustomerIDsHash)}if(t===S){var s=d._getField(b);s&&!d.overwriteCrossDomainMCIDAndAID||(s=d._findVisitorID(n),s?s!==O&&d._setFieldExpire(y,-1):s=O,d._setField(b,s)),s&&s!==O||(s=""),d._callAllCallbacks(b,[s])}if(d.idSyncDisableSyncs||d.disableIdSyncs)P.idCallNotProcesssed=!0;else{P.idCallNotProcesssed=!1;var l={};l.ibs=n.ibs,l.subdomain=n.subdomain,P.processIDCallData(l)}if(n===Object(n)){var c,f;u()&&d.isAllowed()&&(c=d._getField("MCOPTOUT"));var g=j.parseOptOut(n,c,O);c=g.optOut,f=g.d_ottl,d._setFieldExpire("MCOPTOUT",f,!0),d._setField("MCOPTOUT",c),d._callAllCallbacks("MCOPTOUT",[c])}},d._loading=null,d._getRemoteField=function(e,t,n,i,r){var a,o="",s=L.isFirstPartyAnalyticsVisitorIDCall(e),l={MCAAMLH:!0,MCAAMB:!0};if(u()&&d.isAllowed()){d._readVisitor(),o=d._getField(e,!0===l[e]);if(function(){return(!o||d._fieldsExpired&&d._fieldsExpired[e])&&(!d.disableThirdPartyCalls||s)}()){if(e===v||"MCOPTOUT"===e?a="MC":"MCAAMLH"===e||e===y?a=A:e===b&&(a=S),a)return!t||null!=d._loading&&d._loading[a]||(null==d._loading&&(d._loading={}),d._loading[a]=!0,d._loadData(a,t,function(t){if(!d._getField(e)){t&&w.setState(a,!0);var n="";e===v?n=d._generateLocalMID():a===A&&(n={error_msg:"timeout"}),d._setFields(a,n)}},r)),d._registerCallback(e,n),o||(t||d._setFields(a,{id:O}),"")}else o||(e===v?(d._registerCallback(e,n),o=d._generateLocalMID(),d.setMarketingCloudVisitorID(o)):e===b?(d._registerCallback(e,n),o="",d.setAnalyticsVisitorID(o)):(o="",i=!0))}return e!==v&&e!==b||o!==O||(o="",i=!0),n&&i&&d._callCallback(n,[o]),o},d._setMarketingCloudFields=function(e){d._readVisitor(),d._setFields("MC",e)},d._mapCustomerIDs=function(e){d.getAudienceManagerBlob(e,!0)},d._setAnalyticsFields=function(e){d._readVisitor(),d._setFields(S,e)},d._setAudienceManagerFields=function(e){d._readVisitor(),d._setFields(A,e)},d._getAudienceManagerURLData=function(e){var t=d.audienceManagerServer,n="",i=d._getField(v),r=d._getField(y,!0),a=d._getField(b),o=a&&a!==O?"&d_cid_ic=AVID%01"+encodeURIComponent(a):"";if(d.loadSSL&&d.audienceManagerServerSecure&&(t=d.audienceManagerServerSecure),t){var s,l,c=d.getCustomerIDs();if(c)for(s in c)M(s)&&(l=c[s],o+="&d_cid_ic="+encodeURIComponent(s)+"%01"+encodeURIComponent(l.id?l.id:"")+(l.authState?"%01"+l.authState:""));e||(e="_setAudienceManagerFields");var u="http"+(d.loadSSL?"s":"")+"://"+t+"/id",f="d_visid_ver="+d.version+(g&&-1!==u.indexOf("demdex.net")?"&gdpr=1&gdpr_force=1&gdpr_consent="+g:"")+"&d_rtbd=json&d_ver=2"+(!i&&d._use1stPartyMarketingCloudServer?"&d_verify=1":"")+"&d_orgid="+encodeURIComponent(d.marketingCloudOrgID)+"&d_nsid="+(d.idSyncContainerID||0)+(i?"&d_mid="+encodeURIComponent(i):"")+(d.idSyncDisable3rdPartySyncing||d.disableThirdPartyCookies?"&d_coppa=true":"")+(!0===I?"&d_coop_safe=1":!1===I?"&d_coop_unsafe=1":"")+(r?"&d_blob="+encodeURIComponent(r):"")+o,p=["s_c_il",d._in,e];return n=u+"?"+f+"&d_cb=s_c_il%5B"+d._in+"%5D."+e,{url:n,corsUrl:u+"?"+f,callback:p}}return{url:n}},d.appendVisitorIDsTo=function(e){try{var t=[[v,d._getField(v)],[b,d._getField(b)],["MCORGID",d.marketingCloudOrgID]];return d._addQuerystringParam(e,ie.ADOBE_MC,s(t))}catch(t){return e}},d.appendSupplementalDataIDTo=function(e,t){if(!(t=t||d.getSupplementalDataID(L.generateRandomString(),!0)))return e;try{var n=s([["SDID",t],["MCORGID",d.marketingCloudOrgID]]);return d._addQuerystringParam(e,ie.ADOBE_MC_SDID,n)}catch(t){return e}};var L={parseHash:function(e){var t=e.indexOf("#");return t>0?e.substr(t):""},hashlessUrl:function(e){var t=e.indexOf("#");return t>0?e.substr(0,t):e},addQueryParamAtLocation:function(e,t,n){var i=e.split("&");return n=null!=n?n:i.length,i.splice(n,0,t),i.join("&")},isFirstPartyAnalyticsVisitorIDCall:function(e,t,n){if(e!==b)return!1;var i;return t||(t=d.trackingServer),n||(n=d.trackingServerSecure),!("string"!=typeof(i=d.loadSSL?n:t)||!i.length)&&(i.indexOf("2o7.net")<0&&i.indexOf("omtrdc.net")<0)},isObject:function(e){return Boolean(e&&e===Object(e))},removeCookie:function(e){Ve.remove(e,{domain:d.cookieDomain})},isTrackingServerPopulated:function(){return!!d.trackingServer||!!d.trackingServerSecure},getTimestampInSeconds:function(){return Math.round((new Date).getTime()/1e3)},parsePipeDelimetedKeyValues:function(e){return e.split("|").reduce(function(e,t){var n=t.split("=");return e[n[0]]=decodeURIComponent(n[1]),e},{})},generateRandomString:function(e){e=e||5;for(var t="",n="abcdefghijklmnopqrstuvwxyz0123456789";e--;)t+=n[Math.floor(Math.random()*n.length)];return t},normalizeBoolean:function(e){return"true"===e||"false"!==e&&e},parseBoolean:function(e){return"true"===e||"false"!==e&&null},replaceMethodsWithFunction:function(e,t){for(var n in e)e.hasOwnProperty(n)&&"function"==typeof e[n]&&(e[n]=t);return e}};d._helpers=L;var P=re(d,C);d._destinationPublishing=P,d.timeoutMetricsLog=[];var w={isClientSideMarketingCloudVisitorID:null,MCIDCallTimedOut:null,AnalyticsIDCallTimedOut:null,AAMIDCallTimedOut:null,fieldGroupObj:{},setState:function(e,t){switch(e){case"MC":!1===t?!0!==this.MCIDCallTimedOut&&(this.MCIDCallTimedOut=!1):this.MCIDCallTimedOut=t;break;case S:!1===t?!0!==this.AnalyticsIDCallTimedOut&&(this.AnalyticsIDCallTimedOut=!1):this.AnalyticsIDCallTimedOut=t;break;case A:!1===t?!0!==this.AAMIDCallTimedOut&&(this.AAMIDCallTimedOut=!1):this.AAMIDCallTimedOut=t}}};d.isClientSideMarketingCloudVisitorID=function(){return w.isClientSideMarketingCloudVisitorID},d.MCIDCallTimedOut=function(){return w.MCIDCallTimedOut},d.AnalyticsIDCallTimedOut=function(){return w.AnalyticsIDCallTimedOut},d.AAMIDCallTimedOut=function(){return w.AAMIDCallTimedOut},d.idSyncGetOnPageSyncInfo=function(){return d._readVisitor(),d._getField("MCSYNCSOP")},d.idSyncByURL=function(e){if(!d.isOptedOut()){var t=l(e||{});if(t.error)return t.error;var n,i,r=e.url,a=encodeURIComponent,o=P;return r=r.replace(/^https:/,"").replace(/^http:/,""),n=j.encodeAndBuildRequest(["",e.dpid,e.dpuuid||""],","),i=["ibs",a(e.dpid),"img",a(r),t.ttl,"",n],o.addMessage(i.join("|")),o.requestToProcess(),"Successfully queued"}},d.idSyncByDataSource=function(e){if(!d.isOptedOut())return e===Object(e)&&"string"==typeof e.dpuuid&&e.dpuuid.length?(e.url="//dpm.demdex.net/ibs:dpid="+e.dpid+"&dpuuid="+e.dpuuid,d.idSyncByURL(e)):"Error: config or config.dpuuid is empty"},Ue(d,P),d._getCookieVersion=function(e){e=e||d.cookieRead(d.cookieName);var t=ie.VERSION_REGEX.exec(e);return t&&t.length>1?t[1]:null},d._resetAmcvCookie=function(e){var t=d._getCookieVersion();t&&!$.isLessThan(t,e)||L.removeCookie(d.cookieName)},d.setAsCoopSafe=function(){I=!0},d.setAsCoopUnsafe=function(){I=!1},function(){if(d.configs=Object.create(null),L.isObject(n))for(var e in n)M(e)&&(d[e]=n[e],d.configs[e]=n[e])}(),function(){[["getMarketingCloudVisitorID"],["setCustomerIDs",void 0],["getAnalyticsVisitorID"],["getAudienceManagerLocationHint"],["getLocationHint"],["getAudienceManagerBlob"]].forEach(function(e){var t=e[0],n=2===e.length?e[1]:"",i=d[t];d[t]=function(e){return u()&&d.isAllowed()?i.apply(d,arguments):("function"==typeof e&&d._callCallback(e,[n]),n)}})}(),d.init=function(){if(c())var e=f.optIn.fetchPermissions(function(){f.optIn.isApproved(f.optIn.Categories.ECID)&&(d.configs.isIabContext?f.optIn.execute({command:"iabPlugin.fetchConsentData",callback:function(t,n){if(p=!0,t)throw new Error("[IAB plugin] : "+t);n.gdprApplies&&(g=n.consentString),d.init(),e()}}):(d.init(),e()))},!0);else!function(){if(L.isObject(n)){d.idSyncContainerID=d.idSyncContainerID||0,I="boolean"==typeof d.isCoopSafe?d.isCoopSafe:L.parseBoolean(d.isCoopSafe),d.resetBeforeVersion&&d._resetAmcvCookie(d.resetBeforeVersion),d._attemptToPopulateIdsFromUrl(),d._attemptToPopulateSdidFromUrl(),d._readVisitor();var e=d._getField(D),t=Math.ceil((new Date).getTime()/ie.MILLIS_PER_DAY);d.idSyncDisableSyncs||d.disableIdSyncs||!P.canMakeSyncIDCall(e,t)||(d._setFieldExpire(y,-1),d._setField(D,t)),d.getMarketingCloudVisitorID(),d.getAudienceManagerLocationHint(),d.getAudienceManagerBlob(),d._mergeServerState(d.serverState)}else d._attemptToPopulateIdsFromUrl(),d._attemptToPopulateSdidFromUrl()}(),function(){if(!d.idSyncDisableSyncs&&!d.disableIdSyncs){P.checkDPIframeSrc();var e=function(){var e=P;e.readyToAttachIframe()&&e.attachIframe()};h.addEventListener("load",function(){C.windowLoaded=!0,e()});try{ee.receiveMessage(function(e){P.receiveMessage(e.data)},P.iframeHost)}catch(e){}}}(),function(){d.whitelistIframeDomains&&ie.POST_MESSAGE_ENABLED&&(d.whitelistIframeDomains=d.whitelistIframeDomains instanceof Array?d.whitelistIframeDomains:[d.whitelistIframeDomains],d.whitelistIframeDomains.forEach(function(e){var n=new B(t,e),i=J(d,n);ee.receiveMessage(i,e)}))}()}};Be.config=oe,_.Visitor=Be;var Ge=Be,qe=je.OptIn,Ye=je.IabPlugin;return Ge.getInstance=function(e,t){if(!e)throw new Error("Visitor requires Adobe Marketing Cloud Org ID.");e.indexOf("@")<0&&(e+="@AdobeOrg");var n=function(){var t=_.s_c_il;if(t)for(var n=0;n<t.length;n++){var i=t[n];if(i&&"Visitor"===i._c&&i.marketingCloudOrgID===e)return i}}();if(n)return n;var i=function(){if(j.isObject(t))return Object.keys(t).reduce(function(e,n){var i="doesOptInApply"!==n?t[n]:oe.normalizeConfig(t[n]),r=j.normalizeBoolean(i);return e[n]=r,e},Object.create(null))}();!function(e){_.adobe.optIn=_.adobe.optIn||function(){var t=j.pluck(e,["doesOptInApply","previousPermissions","preOptInApprovals","isOptInStorageEnabled","optInStorageExpiry","isIabContext"]),n=e.optInCookieDomain||e.cookieDomain;n=n||Q(),n=n===window.location.hostname?"":n,t.optInCookieDomain=n;var i=new qe(t,{cookies:Ve});if(t.isIabContext){var r=new Ye(window.__cmp);i.registerPlugin(r)}return i}()}(i||{});var r=e,a=r.split("").reverse().join(""),o=new Ge(e,null,a);j.isObject(i)&&i.cookieDomain&&(o.cookieDomain=i.cookieDomain),function(){_.s_c_il.splice(--_.s_c_in,1)}();var s=j.getIeVersion();if("number"==typeof s&&s<10)return o._helpers.replaceMethodsWithFunction(o,function(){});var l=function(){try{return _.self!==_.parent}catch(e){return!0}}()&&!function(e){return e.cookieWrite("TEST_AMCV_COOKIE","T",1),"T"===e.cookieRead("TEST_AMCV_COOKIE")&&(e._helpers.removeCookie("TEST_AMCV_COOKIE"),!0)}(o)&&_.parent?new q(e,i,o,_.parent):new Ge(e,i,a);return o=null,l.init(),l},function(){function e(){Ge.windowLoaded=!0}_.addEventListener?_.addEventListener("load",e):_.attachEvent&&_.attachEvent("onload",e),Ge.codeLoadEnd=(new Date).getTime()}(),Ge}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment