(function(w){function z(){var a=this;this.implementThePolyfill=function(){var b=Element.prototype.setAttribute;Element.prototype.setAttribute=function(c,d){if("style"!==c.toLowerCase()&&b.apply(this,[c,d]),"style"!==c.toLowerCase()||d||this.removeAttribute("style"),"style"===c.toLowerCase()&&d){this.removeAttribute("style");var f;c=a.strToObj(d);for(f in c)this.style[f]=c[f]}}}}function r(){}function k(){var a=this;this.charset=this.crossOrigin=this.iabType=null;this.totalApi=1;this.requestedApiCount= 0;this.apiResult={domainData:null,preferences:null};this.grpsSynced=[];this.isAmp=this.isGacSyncRequired=this.isIabSyncRequired=!1;this.ampData={};this.isPreview=this.isReset=!1;this.nonce=this.geoFromUrl="";this.userHasProfile=this.prevUserWasAnon=this.forceCreateTrxLocalConsentIsGreater=this.checkLocalConsentForIabPurposes=this.carryOverAnonymousConsent=this.consentGiven=this.setAttributePolyfillIsActive=!1;this.addBannerSDKScript=function(b){var c=a.getRegionSet(b),d=("IAB2"===c.Type||"IAB2V2"=== c.Type?(a.iabType=c.Type,a.intializeIabStub()):a.removeTcf(),c.IsGPPEnabled?B.init():B.removeGppApi(),e.stubScrEl.cloneNode(!0)),f=e.storageBaseURL+"/scripttemplates/"+b.Version+"/"+e.sdkName;["charset","data-language","data-document-language","data-domain-script","crossorigin"].forEach(function(h){e.stubScrEl.getAttribute(h)&&d.setAttribute(h,e.stubScrEl.getAttribute(h))});a.crossOrigin=e.stubScrEl.getAttribute("crossorigin")||null;a.charset=e.stubScrEl.getAttribute("charset")||null;a.isAmp=!!e.stubScrEl.getAttribute("amp"); window.otStubData={domainData:b,stubElement:d,bannerBaseDataURL:e.domainBaseUrl,mobileOnlineURL:e.mobileOnlineURL,userLocation:e.userLocation,regionRule:c,crossOrigin:a.crossOrigin,isIabSynced:a.isIabSyncRequired,grpsSynced:a.grpsSynced,isGacSynced:a.isGacSyncRequired,preferences:a.apiResult.preferences,isAmp:a.isAmp,isV2Stub:!0,syncGrpId:e.syncGrpId,consentApi:e.apiUrl,tenantId:e.tenantId,isPreview:a.isPreview,isReset:a.isReset,geoFromUrl:a.geoFromUrl,domainId:e.domainId,urlParams:a.urlParams,otDataLayer:a.otDataLayer, charset:a.charset,gtmUpdated:a.gtmUpdated,setAttributePolyfillIsActive:a.setAttributePolyfillIsActive,nonce:a.nonce,identifierType:a.identifierType,userHasProfile:a.userHasProfile,prevUserWasAnon:a.prevUserWasAnon,consentGiven:a.consentGiven,serverLatestDateForCookies:a.serverLatestDateForCookies,checkLocalConsentForIabPurposes:a.checkLocalConsentForIabPurposes,forceCreateTrxLocalConsentIsGreater:a.forceCreateTrxLocalConsentIsGreater,landingPathValue:a.landingPath};a.jsonp(f,null)};this.intializeIabStub= function(){var b=window;void 0===b.__tcfapi&&(window.__tcfapi=a.executeTcfApi);a.addIabFrame();b.receiveOTMessage=a.receiveIabMessage;(b.attachEvent||window.addEventListener)("message",b.receiveOTMessage,!1)};this.addIabFrame=function(){var b=window;!b.frames.__tcfapiLocator&&(b.document.body?a.addLocator():setTimeout(a.addIabFrame,5))};this.addLocator=function(){var b=window,c=b.document.createElement("iframe");c.style.cssText="display:none";c.name="__tcfapiLocator";c.setAttribute("title","TCF Locator"); b.document.body.appendChild(c)};this.receiveIabMessage=function(b){var c,d,f,h="string"==typeof b.data,l={};try{l=h?JSON.parse(b.data):b.data}catch(q){}!l.__tcfapiCall||"IAB2"!==a.iabType&&"IAB2V2"!==a.iabType||(c=l.__tcfapiCall.callId,d=l.__tcfapiCall.command,f=l.__tcfapiCall.parameter,l=l.__tcfapiCall.version,a.executeTcfApi(d,f,function(q,t){q={__tcfapiReturn:{returnValue:q,success:t,callId:c,command:d}};b&&b.source&&b.source.postMessage&&b.source.postMessage(h?JSON.stringify(q):q,"*")},l))};this.executeTcfApi= function(){for(var b=[],c=0;cb[f].status&&b[f].responseText?q=JSON.parse(b[f].responseText):console.log("OT - Error in fetch URL : "+h.url+" Exception : "+JSON.stringify({message:"Error Loading Data",statusCode:b[f].status}));p.apiCallback(h.storageKey,q)};b[f].send()}})(d)};k.prototype.handleBulkDomainMgmt=function(a,b){a&& (b.Domain=window.location.hostname)};k.prototype.apiCallback=function(a,b){var c,d,f,h,l;p.apiResult[a]=b;p.requestedApiCount++;p.requestedApiCount===p.totalApi&&(a=this.apiResult.domainData.TenantFeatures,c=this.apiResult.domainData,b=window.location.hostname,d=c.Domain,f=c.BulkDomainCheckUrl,a&&a.CookieV2BulkDomainManagement&&b!==d&&c.ScriptType===E&&(window.sessionStorage&&window.sessionStorage.getItem("bulkDomainMgmtEnabled")?this.handleBulkDomainMgmt("true"===window.sessionStorage.getItem("bulkDomainMgmtEnabled"), c):(h=new XMLHttpRequest,l=this.handleBulkDomainMgmt,h.onload=function(){window.sessionStorage&&window.sessionStorage.setItem("bulkDomainMgmtEnabled",JSON.stringify(JSON.parse(h.response).isValid));l(JSON.parse(h.response).isValid,c)},h.open("GET",f,!1),h.withCredentials=!1,h.setRequestHeader("location",e.storageBaseURL.replace(/^https?:\/\//,"")),h.setRequestHeader("domainId",e.domainId),h.setRequestHeader("url",b),h.send())),p.setVariables(c),p.checkIfPrevUserIsAnon(),p.clearConsentIfDsIdChanged(), p.syncConsentProfile(p.apiResult.preferences),p.getLocation(p.apiResult.domainData))};k.prototype.checkIfPrevUserIsAnon=function(){var a=this.readCookieParam(e.optanonCookie,"consentId"),b=this.readCookieParam(e.optanonCookie,"isAnonUser"),c=this.readCookieParam(e.optanonCookie,"iType"),d=null==(d=window)?void 0:d.OneTrust;(d=d&&d.dataSubjectParams&&d.dataSubjectParams.id)&&d!==a&&(""!==b?this.prevUserWasAnon="1"===b:""!==c&&(this.prevUserWasAnon=!!c))};k.prototype.setVariables=function(a){this.carryOverAnonymousConsent= a.AuthenticatedConsent};k.prototype.clearConsentIfDsIdChanged=function(){var a=this.readCookieParam(e.optanonCookie,"consentId"),b=window?window.OneTrust:null;b=b&&b.dataSubjectParams&&b.dataSubjectParams.id;var c=this.readCookieParam(e.optanonCookie,"iType");this.landingPath=this.readCookieParam(e.optanonCookie,"landingPath");b===a||c||this.removeCookies()};k.prototype.getConsentValue=function(a){var b=null;switch(a){case n[n.ACTIVE]:case n[n.ALWAYS_ACTIVE]:b="1";break;case n[n.EXPIRED]:case n[n.OPT_OUT]:case n[n.PENDING]:case n[n.WITHDRAWN]:b= "0"}return b};k.prototype.syncConsentProfile=function(a){if(a){var b=this.readCookieParam(e.optanonCookie,"iType");if(this.userHasProfile=0<(null==(c=a.preferences)?void 0:c.length),a.preferences.length){var c=this.getCookie(e.alertBoxCookie),d=c,f=!1,h=this.deserialiseStringToArray(this.readCookieParam(e.optanonCookie,"groups"));this.checkIfConsentIsGiven(a);for(var l=0,q=a.preferences;lthis.serverLatestDateForCookies)&&(this.serverLatestDateForCookies= f),this.setGroupsConsentFromServerOrLocal({groupsConsent:c,grpId:b,consentVal:l}))),{syncOnlyDate:h,isLocalConsentDateGreaterThanServer:d}};k.prototype.setGroupsConsentFromServerOrLocal=function(a){var b=a.groupsConsent,c=a.grpId;a=a.consentVal;for(var d=c+":"+a,f=-1,h=0;h=h.length?"":h.slice(1).join("/");b=""+b+d+";path\x3d/";b="TEST"!==c.ScriptType&&"LOCAL_TEST"!==c.ScriptType||this.isPreview?""+b+l+";domain\x3d."+h[0]+";"+f:b+";"+f;document.cookie=a+"\x3d"+b};k.prototype.getCookie=function(a){if(this.isAmp&&(this.ampData=JSON.parse(window.localStorage.getItem(e.domainId))||{},this.ampData))return this.ampData[a]|| null;for(var b=a+"\x3d",c=document.cookie.split(";"),d=0;dnew Date);this.setGeoParam(this.geoFromUrl||d)};k.prototype.setGeoParam=function(a){var b;a&&((b=window).OneTrust||(b.OneTrust={}),a=a.split(","),b.OneTrust.geolocationResponse={countryCode:a[0],stateCode:a[1]})};k.prototype.captureNonce=function(){this.nonce=e.stubScrEl.nonce||e.stubScrEl.getAttribute("nonce")||null};var m=k,p=new m;return w.OtSDKStub=m,w.otSdkStub=p,Object.defineProperty(w,"__esModule",{value:!0}),w})({});