/*! permutive-javascript-sdk v19.120.0 (web) (built 2024-05-23T06:58:12.613Z) */(()=>{"use strict";var __webpack_modules__={2688:(t,e,n)=>{function r(t){return t instanceof Error?t:new Error("string"==typeof t?t:JSON.stringify(t))}n.d(e,{w:()=>r})},787:(t,e,n)=>{n.d(e,{A:()=>o});var r=n(3735),i=n(6567);function o(t){return(0,r.zG)((0,i.Y3)((()=>JSON.parse(t))),(0,i.fS)(r.gn))}},7183:(t,e,n)=>{n.d(e,{h:()=>r});const r=t=>new i(t);class i{constructor(t){const e=this;this._worker=t,this._callbacks={},this._id=0,t.addEventListener("message",(function(t){i.onMessage(e,t)}))}set id(t){this._id=t}get id(){return this._id}newId(){const t=this.id;return this.id=this.id+1,t}static onMessage(t,e){if(n=e.data,!(Array.isArray(n)&&n.length>=2))return;var n;const[r,i,o]=e.data,s=t._callbacks[r];s&&(delete t._callbacks[r],s(i,o))}static isServiceWorker(t){return void 0!==t.controller}postMessage(t){const e=this,n=this.newId(),r=[n,t];return new Promise((function(t,o){var s;if(e._callbacks[n]=function(e,n){if(e)return o(new Error(e.message));t(n)},i.isServiceWorker(e._worker)){const t=new MessageChannel;t.port1.onmessage=function(t){i.onMessage(e,t)},null===(s=e._worker.controller)||void 0===s||s.postMessage(r,[t.port2])}else e._worker.postMessage(r)}))}}},115:(t,e,n)=>{n.r(e),n.d(e,{CleanRoomAddon:()=>G,load:()=>q,segmentationService:()=>z});var r=n(7582),i=n(3735),o=n(9853),s=n(2688),a=n(1500),u=n(365),c=n(6567),d=n(4767),l=n(2851),f=n(2652),h=n(4730),p=n(7826);class g{putOrResetUnprocessed(t){return(0,r.mG)(this,void 0,void 0,(function*(){return(0,i.zG)(t,c.g_((()=>d.Y3((()=>this.unprocessedPrebidAuctions.reset()),s.w)),(t=>d.Y3((()=>this.unprocessedPrebidAuctions.put(t)),s.w))),d.vx((t=>(this.reportError(`Unprocessed auctions failed to put. Got ${t}`),d.F2((0,i.Q1)())))),(t=>t()))}))}get allAuctions(){return Object.assign(Object.assign({},this.stagedAuctions),this.trackableAuctions)}constructor(t){this.prefix="[clean_room]",this.debouncedPutOrResetUnprocessed=this.setupUnprocessedPrebidAuctions(),this.stagedAuctions={},this.trackableAuctions={},this.trackAuctionsInterval=null,this.permutive=t.permutive,this.api=t.api,this.logger=t.logger,this.unprocessedPrebidAuctions=t.unprocessedEvents.PrebidAuctions,this.sessionManager=t.sessionManager,this.clientContext=t.clientContext,this.viewId=t.viewId,(0,i.zG)(t.pbjs,l.UI(c.EQ((()=>{this.logInfo("Waiting for PrebidJS to start PrebidAuctions tracking...")}),(t=>this.startPrebidAuctions(t)))))}startPrebidAuctions(t){return(0,r.mG)(this,void 0,void 0,(function*(){yield this.trackUnprocessedPrebidAuctions(),this.logDebug("Starting PrebidAuctions tracking",{prebid:t});const e=(0,p.zi)(t),n=t=>0===t.bidsReceived.length&&0===t.noBids.length?null:(0,i.zG)(this.mapToStagedAuctions(t),u.tS((()=>u.Y3((()=>t.bidsReceived.forEach((t=>{var n;("rendered"===(n=t).status||"targetingSet"===n.status)&&this.setBidToWon(e,t)}))),(t=>{const e=`Failed to process auction. Got ${(0,s.w)(t)}`;return this.reportError(e),(0,s.w)(e)})))));t.onEvent("auctionEnd",(t=>{n(t),this.storeAuctionsAsUnprocessed(this.allAuctions)}));const o=n=>{const r=(0,f.qh)(n);this.logDebug("Processing setTargeting event",{adUnitCodes:r});const o=u.DT((t=>{let[e,n]=t;return!!e&&!!n.hb_adid}),(()=>new Error("Missing targeting data"))),s=(0,i.ls)(o,u.tS((e=>{let[n,{hb_adid:r}]=e;return(0,i.zG)(t.getAllPrebidWinningBids(),(0,a.Ew)((t=>t.adId===r&&t.adUnitCode===n)),u.Yo((()=>new Error("Prebid winning bid does not exist"))))})),u.UI((t=>{this.setBidToWon(e,t)})));return r.forEach(s)};t.onEvent("setTargeting",(t=>{o(t),this.storeAuctionsAsUnprocessed(this.allAuctions)})),t.onEvent("bidWon",(t=>{this.setBidToWon(e,t),this.storeAuctionsAsUnprocessed(this.allAuctions)}));const c=(t,n)=>{this.logDebug("Processing render event",{isRendered:t,props:n}),n.bid&&(t&&this.setBidToRendered(e,n.bid),this.promoteAuctionToTrackable(n.bid),this.storeAuctionsAsUnprocessed(this.allAuctions),this.trackEligibleAuctions())};t.onEvent("adRenderSucceeded",(t=>{c(!0,t)})),t.onEvent("adRenderFailed",(t=>{c(!1,t)})),t.getEvents().forEach((t=>"auctionEnd"===t.eventType?n(t.args):"setTargeting"===t.eventType?o(t.args):"bidWon"===t.eventType?this.setBidToWon(e,t.args):"adRenderSucceeded"===t.eventType?c(!0,t.args):"adRenderFailed"===t.eventType?c(!1,t.args):void 0)),this.storeAuctionsAsUnprocessed(this.allAuctions,{debounced:!1}),(0,f.aT)((()=>(0,r.mG)(this,void 0,void 0,(function*(){this.trackAuctionsInterval=null;const t=this.allAuctions;this.stagedAuctions={},this.trackableAuctions={},yield this.trackPrebidAuctions(t,{useBeacon:!0}),yield this.storeAuctionsAsUnprocessed(null,{debounced:!1})}))))}))}trackUnprocessedPrebidAuctions(){return(0,i.zG)(d.Y3((()=>(0,r.mG)(this,void 0,void 0,(function*(){return(0,i.zG)(yield this.unprocessedPrebidAuctions.getIfPresent(),c.g_((()=>this.logDebug("No unprocessed PrebidAuctions found")),(t=>{var{props:e}=t,n=(0,r._T)(t,["props"]);return this.logDebug("Found unprocessed PrebidAuctions",{props:e,unprocessedData:n}),Promise.all([this.permutive.track("PrebidAuctions",e,{unprocessedData:n}),this.unprocessedPrebidAuctions.reset()])})))}))),(t=>{const e=`Failed to track unprocessed PrebidAuctions. Got ${(0,s.w)(t)}`;return this.reportError(e),(0,s.w)(e)})),(t=>t()))}setupUnprocessedPrebidAuctions(){const t=new h.b(1e3,2500),e=this.putOrResetUnprocessed.bind(this);return t.schedule(e)}storeAuctionsAsUnprocessed(t){let{debounced:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.mG)(this,void 0,void 0,(function*(){this.logDebug("Store auctions as unprocessed",{auctionsToStore:t,debounced:e});const n=d.Y3((()=>(0,r.mG)(this,void 0,void 0,(function*(){const e=(0,f.qh)(null!=t?t:{}).map((t=>{let[e,n]=t;return Object.assign(Object.assign({},n),{auction_id:e})})),n=yield this.clientContext.getClient();return(0,i.zG)(e,c.DT((t=>t.length>0)),c.UI((t=>({client:n,props:this.makePrebidAuctionProperties({auctions:t}),viewId:this.viewId.get(),sessionId:this.sessionManager.getSessionId()}))))}))),s.w);return(0,i.zG)(n,d.EQ((t=>{this.reportError(`Failed to process auctions: ${t}`)}),(t=>{const n=this.debouncedPutOrResetUnprocessed(t);return e?n:Promise.all([this.putOrResetUnprocessed(t),n])})),(t=>t()))}))}mapBidProperties(t,e){var n;return{ad_id:e.adId,ad_unit_code:e.adUnitCode,advertiser_domains:(0,p.Cg)(e),advertiser_id:(t=>{var e,n;const r=t.rubicon&&"object"==typeof t.rubicon&&"advertiserId"in t.rubicon&&t.rubicon.advertiserId||(null===(e=null==t?void 0:t.meta)||void 0===e?void 0:e.buyerId)||(null===(n=null==t?void 0:t.meta)||void 0===n?void 0:n.advertiserId);return r?`${r}`:void 0})(e),advertiser_name:(t=>{var e,n,r;const i=(null===(e=t.meta)||void 0===e?void 0:e.clickUrl)||(null===(n=t.adomain)||void 0===n?void 0:n[0])||(null===(r=t.meta)||void 0===r?void 0:r.advertiserName);return i?`${i}`:void 0})(e),bid_available:"string"==typeof e.statusMessage&&e.statusMessage.indexOf("empty")<0,bidder:e.bidder,bidder_timeout:(0,f.rH)(t.bidderTimeout),brand_id:(t=>{var e;const n=null===(e=t.meta)||void 0===e?void 0:e.brandId;return n?`${n}`:void 0})(e),brand_name:(t=>{var e;return null===(e=t.meta)||void 0===e?void 0:e.brandName})(e),cpm:(0,p.Qd)(e),creative_id:`${e.creativeId}`,deal_id:(0,p.$7)(e),dsp_id:(0,p.cs)(e),hb_pb:null===(n=e.adserverTargeting)||void 0===n?void 0:n.hb_pb,height:(0,f.rH)(e.height),request_timestamp:e.requestTimestamp,response_timestamp:e.responseTimestamp,time_to_respond:e.timeToRespond,width:(0,f.rH)(e.width)}}collectAdUnitCodes(t){const e=new Set;return t.reduce(((t,n)=>{let{adUnitCode:r}=n;return!r||e.has(r)||(e.add(r),t.push({ad_unit_code:r})),t}),[])}mapToStagedAuctions(t){return u.Y3((()=>{const{auctionId:e,bidsReceived:n,noBids:r}=t,i=this.collectAdUnitCodes(n),o=this.collectAdUnitCodes(r);return this.stagedAuctions[e]={bids:i,no_bids:o},this.logDebug("Added auction",this.stagedAuctions[e]),this.stagedAuctions[e]}),(t=>{const e=`Failed to map auction. Got ${(0,s.w)(t)}`;return this.reportError(e),(0,s.w)(e)}))}findAuction(t){return(0,i.zG)(this.getStagedAuction(t.auctionId),u.vx((()=>this.getTrackableAuction(t.auctionId))),u.vx((()=>this.mapToStagedAuctions({auctionId:t.auctionId,bidsReceived:[t],bidderRequests:[],noBids:[]}))))}setBidByOperation(t,e,n){const r=t=>t.hasOwnProperty("ad_id"),o=(n,o)=>{const c=t=>t.ad_id===n.adId,d=t=>t.ad_unit_code===n.adUnitCode,[l,f]=(0,i.zG)(o,(0,a.uK)((t=>r(t)&&c(t)&&d(t))),(t=>[t.left,t.right]));this.logDebug(`Bids for ${e}`,{nonMatching:l,matching:f});const h=(0,i.ls)(u.DT((t=>1===t.length),(()=>new Error("No matching bids"))),u.UI((t=>{let[n]=t;return this.logDebug(`Found bid for ${e}`,{found:n}),{found:n,others:l}}))),p=u.DT((t=>t.length<=1),(()=>new Error("Ad ID is not unique"))),g=(0,i.ls)(h,u.vx((()=>u.Y3((()=>{const i=this.mapBidProperties(t,n),o=l.filter((t=>!(!d(t)||!r(t))||!d(t)));return this.logDebug(`Creating bid for ${e}`,{created:i,others:o}),{found:i,others:o}}),(t=>(0,s.w)(`Failed to create bid. Got ${(0,s.w)(t)}`))))));return(0,i.zG)(f,p,u.tS(g))};return(0,i.ls)((t=>(0,i.zG)(this.findAuction(t),u.tS((r=>(0,i.zG)(o(t,r.bids),u.tS((t=>{let{found:e,others:r}=t;return u.Y3((()=>({updated:n(e),others:r})),s.w)})),u.UI((t=>{let{updated:n,others:i}=t;const o=[n,...i];r.bids=o,this.logDebug(`Bid operation ${e} successful`,n,o)}))))))),u.Vn((t=>{const n=`Failed bid operation ${e}. Got ${(0,s.w)(t)}`;return this.reportError(n),(0,s.w)(n)})))}setBidToWon(t,e){return this.setBidByOperation(t,"setWon",(t=>Object.assign(Object.assign({},t),{winning_bid:!0})))(e)}setBidToRendered(t,e){return this.setBidByOperation(t,"setRendered",(t=>Object.assign(Object.assign({},t),{winning_bid:!0,is_rendered:!0,rendered_timestamp:(new Date).getTime()})))(e)}promoteAuctionToTrackable(t){let{auctionId:e}=t;const n=this.stagedAuctions[e];if(n){if(this.trackableAuctions[e])return this.logError("Auction is already promoted to trackable",{auction:this.trackableAuctions[e]});this.trackableAuctions[e]=n,delete this.stagedAuctions[e],this.logDebug("Auction promoted to trackable",{auctionId:e,trackableAuctions:this.trackableAuctions})}}trackEligibleAuctions(){if(this.trackAuctionsInterval)return;this.trackAuctionsInterval=(0,f.PQ)((()=>(0,r.mG)(this,void 0,void 0,(function*(){if(!this.trackAuctionsInterval)return;this.trackAuctionsInterval=null;const t=this.trackableAuctions;this.trackableAuctions={},yield this.trackPrebidAuctions(t),yield this.storeAuctionsAsUnprocessed(this.stagedAuctions,{debounced:!1})}))),{timeout:5e3})}trackPrebidAuctions(t,e){return(0,r.mG)(this,void 0,void 0,(function*(){const n=(0,f.qh)(t).map((t=>{let[e,n]=t;return Object.assign(Object.assign({},n),{auction_id:e})}));n.length&&(yield this.permutive.track("PrebidAuctions",this.makePrebidAuctionProperties({auctions:n}),e),this.logDebug("Tracked auctions",{auctions:n}))}))}makePrebidAuctionProperties(t){return{aggregations:t,isp_info:"$ip_isp_info",geo_info:"$ip_geo_info"}}getStagedAuction(t){return(0,i.zG)(this.stagedAuctions[t],u.DT(Boolean,(()=>new Error("Staged auction not found"))),u.Vn((e=>(this.logError(e,{auctionId:t}),e))))}getTrackableAuction(t){return(0,i.zG)(this.trackableAuctions[t],u.DT(Boolean,(()=>new Error("Trackable auction not found"))),u.Vn((e=>(this.logError(e,{auctionId:t}),e))))}reportError(t){return this.api.reportError(`${this.prefix} ${t}`)}logInfo(){for(var t=arguments.length,e=new Array(t),n=0;n_.dQ((n=>{let{previousState:o}=n;return(0,i.zG)(e,l.g_(I(o),P(t)),l.VS((t=>{var{lastSuccess:e}=t,n=(0,r._T)(t,["lastSuccess"]);return(0,i.zG)(e,l.UI((t=>Object.assign({lastSuccess:t},n))))})),(t=>({state:(0,i.zG)(t,l.UI((t=>{let{userId:e,lastSuccess:n}=t;return{userId:e,lastSuccess:c.FS(n)}}))),value:(0,i.zG)(t,l.UI((t=>{let{lastSuccess:e,view:[,n]}=t;return[(0,i.zG)(e,c.UI((t=>t.cohorts)),c.fS((()=>O)),u.F2),()=>n]})))})))})))))}const S=t=>(0,i.zG)(t,v.zh((t=>t),(t=>"dfp"===t.id?c.G((t=>t)):c.YP)),c.G),I=t=>(0,i.zG)(t,c.DT(x),c.fS((()=>T)),(t=>({userId:t.userId,lastSuccess:l.a9(c.ij(t.lastSuccess)),view:C,ctx:(0,i.zG)(c.ij(t.lastSuccess),c.EQ((()=>{}),(t=>t.ctx)),(t=>Promise.resolve(t)))}))),P=t=>(e,n)=>(0,i.zG)(e,c.DT((t=>{let{userId:e}=t;return e===n.userId})),c.fS((()=>M(n.userId))),(e=>{if(U(e)===n.viewId)return e;{const r=(0,i.zG)((0,y.gz)(k.Hi)(n.customCohorts,n.standardCohorts,(()=>e.ctx)),k.tS((e=>{let[r,i,o]=e;return t({fps:r,stds:i,userId:n.userId,ctx:o})})))(),o=r.then(u.UI((t=>t.cohorts))),s=(0,i.zG)(l.vP(e.lastSuccess,l.p4(r)),l.UI((t=>{let[e,n]=t;return(0,i.zG)(n,c.UI(u.um),c.tS(c.Uo),c.wp((()=>e)))}))),a=r.then(u.aD((()=>e.ctx),(t=>t.ctx)));return{userId:n.userId,lastSuccess:s,view:(0,i.bc)(n.viewId,o),ctx:a}}})),D=t=>d.it((e=>{var n=(0,r._T)(e,[]);return t.permutiveApi.req({url:t.permutiveUrls.getAdvertiserEndpointUrl("/segment",c.G("v3")),method:"POST",payload:n,contentType:"text/plain",dataType:"json",withCredentials:!1})}),(t=>`Failed to fetch advertiser cohorts: ${t}`)),O=b.cS,M=t=>({userId:t,lastSuccess:l.a9(c.YP),view:C,ctx:Promise.resolve(void 0)}),C=["",Promise.resolve(u.F2(O))],U=t=>t.view[0],x=t=>"object"==typeof t&&null!==t&&"userId"in t&&"lastSuccess"in t,T={userId:""},A="clean_room",q=t=>{(0,o.Hn)(A)("auto_init",!1)&&t.q.push({functionName:"addon",arguments:[A,{}]})};class G extends g{}function z(t,e){return(0,i.zG)(e,l.UI((t=>{var{initdAddons:e}=t,n=(0,r._T)(t,["initdAddons"]);return Object.assign(Object.assign({},n),{isInitd:e.has(A)})})),(e=>j(t,e)))}const j=function(t,e){return(0,i.zG)(e,_.KD([[t=>!t.consent||t.addonsLoaded&&!t.isInitd,_.K4((()=>w.of(O)))],E(t,e)]),_.UI(l.xH),_.UI(S))}},9557:(t,e,n)=>{n.r(e),n.d(e,{SspAddon:()=>k,load:()=>w,realService:()=>v,sspService:()=>m,stubService:()=>_});var r=n(7582),i=n(2851),o=n(9853),s=n(3735),a=n(3328),u=n(2116),c=n(1517),d=n(6567),l=n(4767),f=n(4307),h=n(2652),p=n(1828),g=n(2751);const m=v;function _(t,e,n,r,i){return u.K4((()=>(t.removeExternalData(E),d.YP)))}function v(t,e,n,m,_){const v=(0,o.Hn)(y),w=v("ssps",a.cS),k=v("all_cohort_mapping",{}),S=w.includes("google_pps"),I=v("affinity_enabled",!1)?l.Y3((()=>(0,r.mG)(this,void 0,void 0,(function*(){const t=(yield m.getClient()).url;return e.req({method:"GET",url:n.getEndpointUrl("/standard-audiences/v1/affinity",d.YP,[["url",t]]),withCredentials:!1,dataType:"json"})}))),String):l.F2({affinity_values:[]});return(0,s.zG)(i.vP({consent:_.consent}),u.KD([[t=>{let{consent:e}=t;return!e},u.K4((()=>(t.removeExternalData(E),f.of(a.cS))))],u.K4((e=>{let{onServiceStop:n}=e;return(0,s.zG)((0,p.gz)(f.G5)((0,s.zG)(_.cohorts,f.UI((0,s.ls)(a.hX((t=>t in k)),a.UI((t=>k[t])),a.xH))),(0,s.zG)(_.viewId,i.VS((()=>(0,s.zG)(I,l.UI((t=>t.affinity_values)),f.oF(a.bM())))))),f.UI(a.xH),f.UI((t=>[...new Set(t)])),(0,h.bw)((0,s.ls)(f.Vh((()=>a.bM())),i.UI(b),i.D8(a.Eh(g.Eq)),i.UI((t=>({ssps:w,cohorts:t}))),i.YP((e=>t.setExternalJsonData(E,e))),(t=>n(t)))))}))]),u.UI((0,s.ls)(i.xH,c.zh((t=>t),(t=>"dfp"===t.id&&S?d.G(b):d.YP)),d.G)))}const b=t=>[...new Set(t.map((t=>t.replace(/-ac$/,"").replace(/-aw$/,"").replace(/-c$/,""))))],y="ssp",w=t=>{(0,o.Hn)(y)("auto_init",!1)&&t.q.push({functionName:"addon",arguments:[y,{}]})};class k{constructor(t){}}const E="_pssps"},3992:(t,e,n)=>{n.d(e,{GL:()=>o,HJ:()=>s,N1:()=>c,SF:()=>d,UM:()=>a,ho:()=>f,iE:()=>l,t_:()=>u});let r=[],i=!1;const o=t=>function(){for(var e=arguments.length,n=new Array(e),r=0;rt(...n)))},s=(t,e)=>{if(!i){const n=window.setTimeout(t,e);return()=>window.clearTimeout(n)}let n;const o=()=>{void 0!==n&&i&&r.length<1e4&&r.push([n,performance.now()]),n=void 0},s=[window.setTimeout((()=>{n=performance.now(),window.requestAnimationFrame(o),t()}),e),window.setTimeout(o,e)];return()=>{void 0===n&&s.forEach((t=>window.clearTimeout(t)))}},a=(t,e)=>{if(!i){const n=window.setInterval(t,e);return()=>window.clearInterval(n)}let n=!1,r=()=>{};const o=window.setInterval((()=>{r=s((()=>{n||t()}))}),e);return()=>{n=!0,r(),window.clearInterval(o)}},u=t=>new Promise(((e,n)=>t.then(o(e),o(n)))),c=t=>()=>u(t()),d=t=>{const e=c(t);return()=>new Promise((t=>s((()=>t(e())))))},l=()=>{const t=r;return r=[],t},f=t=>{i=t}},3918:(t,e,n)=>{n.d(e,{S9:()=>d,of:()=>c});var r=n(6567),i=n(3735),o=n(856),s=n(365),a=n(2553),u=n(5151);const c=t=>a.of(s.F2(t)),d=(a.dO,a.G5,(t,e)=>n=>(0,i.zG)(n,a.S9(t),u.UI(r.pF((()=>s.t$(e))))))},2553:(t,e,n)=>{n.d(e,{G5:()=>g,OZ:()=>f,S3:()=>l,S9:()=>h,dO:()=>p,of:()=>c});var r=n(6567),i=n(5151),o=n(3735),s=n(3992),a=n(8377);const u="Eventual",c=t=>[t,i.of(t)],d=t=>a.Pd((e=>i.ap(t[1])(e)),(e=>e(t[0]))),l=a.li,f=a.Yg,h=t=>e=>(0,o.zG)(f(e),(e=>()=>new Promise((n=>{const i=e();i.then(r.G).then(n);const o=(0,s.HJ)((()=>n(r.YP)),t);i.then(o)})))),p={URI:u,map:(t,e)=>(t=>a.Pd(i.UI(t),t))(e)(t)},g={URI:u,map:p.map,ap:(t,e)=>d(e)(t)};p.map},4307:(t,e,n)=>{n.d(e,{G5:()=>y,UI:()=>h,UO:()=>_,Uj:()=>v,Vh:()=>m,oF:()=>g,of:()=>f});var r=n(1828),i=n(7341),o=n(3735),s=n(2851),a=n(3918),u=n(365),c=n(1124),d=n(2553);const l="RefEventualEither",f=t=>s.a9(a.of(t)),h=i.UI(c.dO,u.dO),p=r.ap(c.G5,u.G5),g=t=>c.fF(u.F2(t)),m=t=>s.UI((0,o.ls)(d.S3,u.fS(t))),_=t=>c.UI(u.F2)(t),v=t=>c.UI(u.fS(t)),b={URI:l,map:(t,e)=>h(e)(t)},y={URI:l,map:b.map,ap:(t,e)=>p(e)(t)}},1124:(t,e,n)=>{n.d(e,{G5:()=>_,UI:()=>l,Vh:()=>p,dO:()=>m,fF:()=>c,hM:()=>g,i5:()=>h,of:()=>d});var r=n(2851),i=n(2553),o=n(3735),s=n(5151),a=n(6567);const u="RefEventual",c=(i.of,t=>e=>{const n=e();return(0,o.zG)(r.fF((()=>n)),r.UI(a.fS((()=>t))),r.UI((t=>(0,o.bc)(t,(()=>n)))))}),d=t=>r.a9(i.of(t)),l=t=>e=>r.vP((0,o.zG)(e,r.UI(i.S3),r.UI(t)),(0,o.zG)(e,r.UI(i.OZ),r.UI(s.UI(t)))),f=t=>e=>r.vP((0,o.zG)(r.vP((0,o.zG)(t,r.UI(i.S3)),(0,o.zG)(e,r.UI(i.S3))),r.UI((t=>{let[e,n]=t;return n(e)}))),(0,o.zG)(r.vP((0,o.zG)(t,r.UI(i.OZ)),(0,o.zG)(e,r.UI(i.OZ))),r.UI((t=>{let[e,n]=t;return s.ap(e)(n)})))),h=t=>i.S3(t.current),p=r.UI(i.S3),g=r.UI(i.OZ),m={URI:u,map:(t,e)=>l(e)(t)},_={URI:u,map:m.map,ap:(t,e)=>f(e)(t)};m.map},2851:(t,e,n)=>{n.d(e,{YO:()=>y,oQ:()=>x,a9:()=>m,Ue:()=>p,gS:()=>g,D8:()=>C,BT:()=>U,VS:()=>k,xH:()=>E,g_:()=>I,p4:()=>M,fF:()=>O,Hr:()=>w,UI:()=>v,u4:()=>S,vP:()=>P,bw:()=>T,YP:()=>_});var r=n(2688),i=n(365),o=n(3735),s=n(6567),a=n(3328),u=n(2652);function c(t){let e=t,n=[],r=!1;return{addListener(t){if(r)return()=>{};let i=e;const o=()=>{Object.is(e,i)||(i=e,t(e))};n=[...n,o];return()=>{n=n.filter((t=>t!==o))}},notify(t){if(r)throw new Error("Ref bug: Attempted to notify a terminated notifier");Object.is(t,e)||(e=t,n.forEach((t=>t())))},terminate(){r=!0,n=[]}}}function d(t,e){let n=0;return function(){try{if(n++>0)throw new Error(t);return e(...arguments)}finally{n--}}}function l(t,e){let n=[...new Set(t)].filter((t=>"final"!==t.state));if(0===n.length)return{state:"final",onStateChange:()=>()=>{}};const r=()=>0===n.length?"final":n.some((t=>"might_change"===t.state))?"might_change":"nominal",[i,o]=f(r(),(t=>"might_change"!==t&&e())),s=()=>o(r());return n.forEach((e=>{e.onStateChange((e=>{switch(e){case"final":n=t.filter((t=>"final"!==t.state)),s();break;case"might_change":o("might_change");break;case"nominal":s();break;default:throw new Error(`Ref bug: Invalid state ${e}`)}}))})),i}function f(t,e){if("final"===t)return[{state:"final",onStateChange:()=>()=>{}},()=>{}];const{terminate:n,notify:r,addListener:i}=c(t),o={state:t,onStateChange:i},s=d("Disallowed recursion in Branch.",(t=>{if("final"===o.state){if("final"===t)return;throw new Error(`Attempted to change state of final branch to ${t}.`)}try{null==e||e(t),o.state=t,r(t)}finally{"final"===t&&n()}}));return[o,s]}var h=n(7341);function p(t){const[e,n,r]=function(){const[t,e]=f("nominal"),n=d("Disallowed recursion in Branch.",(n=>{if("final"===t.state)throw new Error("Attempted to mutate a finalized Ref.");const r=t.state;try{e("might_change"),n()}finally{e(r)}}));return[t,n,()=>e("final")]}(),[i,o]=A(e,t);return[i,t=>n((()=>o(t))),r]}function g(t){let e=t.empty;const n=()=>()=>{const n=e;return e=t.empty,n},[r,i,o]=p(n());return[r,r=>{e=t.concat(e,r),i(n())},o]}function m(t){return{get current(){return t},onChange:()=>()=>{},branch:{state:"final",onStateChange:()=>()=>{}}}}function _(t){return e=>{const n=e.onChange(t);return t(e.current),n}}function v(t,e){if(e){const[n,r]=A(e.branch,t(e.current));return e.onChange((e=>r(t(e)))),n}return e=>v(t,e)}const b={URI:"Ref",map:(t,e)=>v(e)(t)},y=h.YO(b),w=h.Hr(b);function k(t,e){return e?E(v(t,e)):e=>E(v(t,e))}function E(t){if("final"===t.branch.state)return t.current;const[e,n]=function(t,e){let n=e;const r=[t.state,n.state].includes("might_change")?"might_change":"nominal",[i,o]=f(r),s=t=>e=>{switch(e){case"final":o(t().state);break;case"might_change":o("might_change");break;case"nominal":"might_change"===t().state?o("might_change"):o("nominal");break;default:throw new Error(`Ref bug: Unexpected upstream state ${e}`)}};t.onStateChange(s((()=>n)));const a=s((()=>t));let u=n.onStateChange(a);return[i,t=>{n=t,u(),u=t.onStateChange(a),a(n.state)}]}(t.branch,t.current.branch),[r,i]=A(e,t.current.current);let o=t.current.onChange(i);return t.onChange((t=>{o(),o=t.onChange(i),n(t.branch),i(t.current)})),r}function S(t){return e=>{if("final"===e.branch.state)return e;let n=s.YP;return v((e=>{if(s.Wi(n))return n=s.G(e),e;const r=t(n.value,e);return n=s.G(r),r}),e)}}function I(t,e,n){if(!n)return n=>I(t,e,n);let r=t;return v((t=>(r=e(r,t),r)),n)}function P(){if(0===arguments.length||q(arguments.length<=0?void 0:arguments[0]))return D(...arguments);const t=arguments.length<=0?void 0:arguments[0],e=Object.keys(t);return(0,o.zG)(Object.values(t),(t=>D(...t)),v((0,o.ls)(a.Su(((t,n)=>[e[t],n])),Object.fromEntries)))}function D(){for(var t=arguments.length,e=new Array(t),n=0;n[t]))(e[0]);let r=!1;e.forEach((t=>t.onChange((()=>{if("might_change"!==t.branch.state)throw new Error("Ref bug: Received a change notification without a `might_change` state.");r=!0}))));const i=e.map((0,u.vg)("branch")),o=()=>{r&&(r=!1,c(e.map((t=>t.current))))},s=l(i,o),[a,c]=A(s,e.map((t=>t.current)));return a}function O(t){const[e,n,r]=p(s.YP);return t().then((0,o.ls)(s.G,n,r)),e}function M(t){const[e,n,a]=p(s.YP);return t.then(i.F2).catch((0,o.ls)(r.w,i.t$)).then((0,o.ls)(s.G,n,a)),e}function C(t){const e=t.hasOwnProperty("equals")?t.equals:t;return S(((t,n)=>e(t,n)?t:n))}function U(t){return e=>{const[n,r]=function(t){const[e,n]=f(t.state),r=t.onStateChange(n);return[e,()=>{r(),n("final")}]}(e.branch),[i,a]=A(n,e.current);let u=s.G(e.onChange(a));return t((()=>(0,o.zG)(u,s.UI((t=>{u=s.YP,t(),r()}))))),i}}function x(t){return q(t)?t:m(t)}function T(t){return e=>(_(t)(e),e)}function A(t,e){if("final"===t.state)return[m(e),()=>{}];const n=c(e);t.onStateChange((t=>{"final"===t&&n.terminate()}));let r=e;return[{get current(){return r},onChange:n.addListener,branch:t},d("Disallowed recursion in Ref.",(t=>{r=t,n.notify(r)}))]}function q(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&"function"==typeof t.onChange}},2116:(t,e,n)=>{n.d(e,{K4:()=>d,KD:()=>b,UI:()=>h,VS:()=>g,YO:()=>v,_i:()=>w,ak:()=>_,bw:()=>p,dQ:()=>l,of:()=>f,vP:()=>m});var r=n(7582),i=n(2851),o=n(3735),s=n(2652),a=n(4923),u=n(6567),c=n(8706);const d=t=>(0,o.ls)((e=>{var{previousState:n}=e,i=(0,r._T)(e,["previousState"]);return t(i)}),(t=>({value:t,state:i.a9(void 0)}))),l=o.yR,f=(0,o.ls)(o.a9,d),h=t=>e=>(0,o.ls)(e,(0,s.rO)({value:t})),p=t=>e=>(0,o.ls)(e,(0,s.rO)({value:(0,s.bw)(t)}));function g(t){return e=>n=>{var{previousState:o,onServiceStop:s}=n,a=(0,r._T)(n,["previousState","onServiceStop"]);const u=I(),c=e(Object.assign({previousState:Array.isArray(o)?o[0]:void 0,onServiceStop:u.onServiceStop},a)),d=I(),l=t(c.value)(Object.assign({previousState:Array.isArray(o)?o[1]:void 0,onServiceStop:d.onServiceStop},a));return s(u.stop),s(d.stop),{value:l.value,state:i.vP(c.state,l.state)}}}function m(t){return e=>{var{previousState:n}=e,s=(0,r._T)(e,["previousState"]);const u=S(n)?n:{},c=(0,o.zG)(t,a.Su(((t,e)=>e(Object.assign({previousState:u[t]},s)))));return{value:(0,o.zG)(c,a.UI((t=>t.value))),state:(0,o.zG)(c,a.UI((t=>t.state)),(t=>i.vP(t)))}}}function _(t,e){return n=>(0,o.ls)((0,s.rO)({previousState:E}),(s=>{var{onServiceStop:a}=s,u=(0,r._T)(s,["onServiceStop"]);const c=I(),d=n(Object.assign({onServiceStop:c.onServiceStop},u)),l=I(),f=e(d.value)(Object.assign(Object.assign({onServiceStop:l.onServiceStop},u),{previousState:u.previousState[t]}));return a(c.stop),a(l.stop),{value:(0,o.zG)([d.value,f.value],(e=>{let[n,r]=e;if(!S(n))throw new Error;return Object.assign(Object.assign({},n),{[t]:r})})),state:(0,o.zG)(i.vP(d.state,f.state),i.UI((e=>{let[n,r]=e;if(!S(n))throw new Error;return Object.assign(Object.assign({},n),{[t]:r})})))}}))}function v(t){return e=>(0,o.ls)((0,s.rO)({previousState:(0,o.ls)(E,(e=>e[t]))}),e,(0,s.rO)({value:e=>({[t]:e}),state:i.UI((e=>({[t]:e})))}))}const b=t=>{const e=t.slice(0,-1),n=t.slice(-1)[0],r=[...e.map((t=>{let[e,n]=t;return[e,(0,o.a9)(n)]})),(0,o.a9)(n)];return(0,o.ls)(i.UI((0,s.lo)(r)),y)};function y(t){return e=>{var{previousState:n,onServiceStop:a}=e,c=(0,r._T)(e,["previousState","onServiceStop"]);return(0,o.zG)(t,i.BT(a),i.g_({state:i.a9(n),stop:()=>{},value:u.YP},((t,e)=>{let{state:n,stop:r}=t;r();const{stop:i,onServiceStop:o}=I(),{state:s,value:a}=e(Object.assign({previousState:n.current,onServiceStop:o},c));return{state:s,stop:i,value:u.G(a)}})),(0,s.bw)((t=>a((()=>t.current.stop())))),(t=>({value:i.UI((0,o.ls)((t=>t.value),u.fS((()=>{throw new Error}))),t),state:i.VS((t=>t.state),t)})))}}const w=(t,e)=>n=>l((r=>{let{onServiceStop:a,previousState:d}=r;return(0,o.zG)(n,i.BT(a),i.g_((0,o.bc)(u.YP,(0,o.zG)((l=d,(0,s.El)(l)?l:u.YP),e)),((t,e)=>{let[,n]=t;return(0,o.zG)(e(n),(0,c.pL)(u.G))})),i.UI((0,c.pL)(u.pF(k))),(e=>({state:(0,o.zG)(e,i.UI(c.Yg),t,i.UI(u.G)),value:(0,o.zG)(e,i.UI(c.li))})));var l})),k=()=>{throw new Error("Developer error.")};function E(t){return S(t)?t:{}}function S(t){return"object"==typeof t&&null!==t}function I(){const t=[];return{stop:()=>{for(;t.length>0;)t.shift()()},onServiceStop:e=>t.push(e)}}},167:(t,e,n)=>{n.d(e,{Q:()=>d,n:()=>c});var r=n(6567),i=n(2851),o=n(3735),s=n(2652),a=n(2116),u=n(365);function c(t){return e=>(0,o.zG)(i.oQ(t),i.UI((0,s.rO)({backoffAfterErrorMs:t=>null!=t?t:0,backoffAfterSuccessMs:t=>null!=t?t:0})),(t=>a.dQ((n=>{let{previousState:a}=n;const[u,c]=i.Ue(function(t){if("object"!=typeof t||null===t)return{lastSuccess:0,lastError:0};return t}(a)),d=(0,o.zG)(i.vP(u,t),i.UI((t=>{let[e,n]=t;return Math.max(e.lastError+n.backoffAfterErrorMs,e.lastSuccess+n.backoffAfterSuccessMs)})));return{state:u,value:(0,o.ls)(r.DT((()=>Date.now()>=d.current)),r.UI(e),r.UI((0,s.bw)((t=>t.then((()=>c(Object.assign(Object.assign({},u.current),{lastSuccess:Date.now()}))),(()=>c(Object.assign(Object.assign({},u.current),{lastError:Date.now()}))))))))}}))))}const d=(t,e)=>n=>(0,o.zG)((t=>n(t)().then((t=>u.nM(t)?Promise.reject(t.left):t.right))),c(t),a.UI((t=>n=>()=>(0,o.zG)(n,t,r.EQ((()=>Promise.resolve(u.t$(e))),(t=>t.then(u.F2,u.t$)))))))},3306:(t,e,n)=>{n.d(e,{hX:()=>M,fF:()=>O,OQ:()=>U,TW:()=>C});var r=n(2851),i=n(2116),o=n(2553),s=n(6567),a=n(365),u=n(6862),c=n(3735),d=(n(7341),function(t){return function(e){return[void 0,t(e)]}}),l=function(t,e){return(0,c.zG)(t,p(e))},f=function(t,e){return(0,c.zG)(t,g(e))},h=function(t,e){return(0,c.zG)(t,m(e))},p=function(t){return function(e){return function(n){var r=e(n),i=r[0],o=r[1];return[t(i),o]}}},g=function(t){return function(e){return function(n){var r=e(n),i=r[0],o=r[1],s=t(o),a=s[0],u=s[1];return[i(a),u]}}},m=function(t){return function(e){return function(n){var r=e(n),i=r[0],o=r[1];return t(i)(o)}}},_="State",v={URI:_,map:l,ap:f,chain:h},b=(0,u.m)(v),y=(c.yR,(0,u.a)(v)),w=n(5151),k=n(7758),E=n(1828),S=n(2652),I=n(8377),P=n(4767),D=n(8706);const O=(t,e,n)=>r=>(0,c.zG)((0,S.HP)(r),(r=>i=>(0,c.bc)((0,c.bc)(t,(0,c.zG)(r,w.UI(e),S.HP),(0,c.zG)(r,w.tS(n),S.HP)),i))),M=t=>b((()=>d((0,S.rO)({previous:r.UI(a.UI(s.hX((e=>{let[n]=e;return t(n)})))),consistent:(0,c.ls)(k.hX((e=>{let[n]=e;return t(n)})),k.UI((0,D.H5)(P.UI(s.hX((e=>{let[n]=e;return t(n)}))))))})))),C=t=>b((e=>{let[,n]=e;return d((0,S.rO)({consistent:e=>(0,c.zG)((0,E.gz)(k.qA)(e,k.fF(n)),k.hX((e=>{let[[n],r]=e;return t(n,r)})),k.UI((e=>{let[n,r]=e;return(0,c.zG)(n,(0,D.H5)(P.UI(s.hX((e=>{let[n]=e;return t(n,r)})))))})))}))})),U=(t,e)=>(0,c.ls)(r.UI(q),r.UI(p((t=>{let[e]=t;return{zero:e}}))),r.UI(y("cache",(()=>function(t){return[t,t]}))),i._i((0,c.ls)(r.VS((t=>t.previous)),r.UI(s.Uo),r.UI(s.xH),r.D8(s.Eh(A()))),(0,c.ls)(s.hX(S.El),s.xH,s.hX(T(t,e)),(t=>({previous:r.a9(a.F2(t)),consistent:(0,c.zG)(k.Yo(t),k.UI((e=>{let[n]=e;return(0,c.bc)(n,P.F2(t))})))})))),i.UI(r.VS((t=>{let{cache:e,zero:n}=t;return(0,c.zG)(e.previous,r.UI(a.UI(s.EQ((()=>n),I.Yg))),r.YO("current"),r.Hr("consistent",(0,c.a9)((0,c.zG)(e.consistent,w.tS(s.EQ(G,I.Yg)),P.UI(s.pF(G)),P.UI(I.Yg)))),r.UI((t=>{let{current:e,consistent:n}=t;return[e,n]})))}))),i.UI(r.u4(((t,e)=>(0,c.zG)(e,(0,I.pL)(x(o.S3(t)))))))),x=t=>e=>a.nM(t)&&a.nM(e)?t.left===e.left?t:e:a.tO(t)&&a.tO(e)&&t.right===e.right?t:e,T=(t,e)=>n=>Array.isArray(n)&&2===n.length&&t(n[0])&&e(n[1]),A=()=>({equals:(t,e)=>{let[n,r]=t,[i,o]=e;return n===i&&r===o}}),q=t=>(0,c.zG)(t,b((t=>{let[,e,n]=t;return d((t=>{const i=(0,c.zG)(t.consistent,k.UI(I.Yg),k.tS(k.oF),w.UI(s.xH)),o=(0,c.zG)(i,k.UI(a.F2),k.fS((()=>(0,E.gz)(P.Hi)(P.fF(e),n))),P.UI(s.G),S.HP);return{previous:(0,c.zG)(r.vP(t.previous,r.fF(o)),r.UI((t=>{let[e,n]=t;return(0,c.zG)(n,s.EQ((()=>e),a.wp((()=>e))))}))),consistent:(0,c.zG)(e,w.UI((t=>(0,c.bc)(t,o))),k.fF)}}))}))),G=()=>{throw new Error("Developer error.")}},6967:(t,e,n)=>{n(2497),n(5165)},8612:(t,e,n)=>{n.d(e,{lg:()=>p,Bt:()=>m});var r=n(7582),i=n(1500),o=n(3735),s=n(6567),a=n(2751),u=n(2652);class c{constructor(t,e,n,r){this.userId=t,this.network=e,this.api=n,this.logger=r,this.tag="appnexus",this.ttlInSeconds=86400,this.usedForThirdPartyData=!0,this.url="https://ib.adnxs.com/getuidj",this.invalidAliases=["","0","-1"]}getId(){return this.logger.debug("identities[appnexus]: start HTTP request"),(0,u.G6)(navigator.userAgent)?Promise.resolve({type:"skipped"}):this.api.appnexus(this.url).then((t=>(this.logger.debug("identities[appnexus]: end HTTP request"),{type:"attempted",result:(0,o.zG)((0,s.DT)((t=>this.isValidAlias(t.uid)))(t),(0,s.UI)((t=>t.uid)))})),(t=>({type:"attempted",result:s.YP})))}reset(){return Promise.resolve()}isValidAlias(t){return!!t&&-1===this.invalidAliases.indexOf(t)}}var d=n(2851),l=n(4923),f=n(2197);const h=f.ff((t=>void 0===t));class p{constructor(t,e,n,r,i){this.metrics=t,this.trace=e,this.permutiveData=n,this.identityProviderEnv=r,this.logger=i,this.providers={};const s=this.getCachedIdentitiesAndMigrateIfRequired(),[c,f]=d.Ue(s);this.identityMapRef=c,this.setIdentityMap=f,c.onChange((0,o.ls)(l.z7((t=>!g.has(t))),(0,u.bw)((t=>{this.logger.debug("[identities] Persisting",t),this.permutiveData.setData("identities",t)})))),this.ref=(0,o.zG)(c,d.UI((0,o.ls)(l.UI((t=>t.value)),l.hX(h))),d.D8(l.Eh(a.Eq))),this.thirdParty=this.prepareThirdPartyIdentities()}get identities(){return this.identityMapRef.current}prepareThirdPartyIdentities(){this.logger.debug("[Identities]","loading 3rd party identities");const t=this.metrics.startTimer("sdk_get_third_party_identities_task_duration_seconds",{}),e=this.trace.startSpan("load_tpd_ids"),n=[{load:t=>(t.config,t.network,t.api,t.userId,t.logger,s.YP)},{load:t=>{return e=t.userId,n=t.network,r=t.api,i=t.logger,(0,s.G)(new c(e,n,r,i));var e,n,r,i}},{load:t=>(t.cookies,t.messages,s.YP)},{load:t=>(t.cookies,s.YP)},{load:t=>(t.metrics,t.permutiveData,t.permutive,t.messages,s.YP)}],r=(0,i.oA)(n.map((t=>t.load(this.identityProviderEnv)))).map((t=>this.shouldAskForNewIdentity(t)?this.retrieveIdentity(t):Promise.resolve((0,o.bc)(t,this.getCachedTPDIdentity(t.tag)))));return Promise.all(r).then((t=>t.map((t=>{let[e,n]=t;return this.providers[e.tag]=e,this.mapTPDIdentityIfPresent(e.tag,n,e.ttlInSeconds)})))).then((t=>this.setIdentities(t))).then((0,u.bw)((()=>{this.metrics.stopTimer("sdk_get_third_party_identities_task_duration_seconds",t),e.finish()})))}getPrioritizedIdentities(t){const e={default:0,appnexus:1},n=Object.entries(t).map((t=>{let[e,{id:n,expiry:r,priority:i}]=t;return Object.assign(Object.assign(Object.assign({tag:e},n?{id:n}:{}),r?{expiry:r}:{}),void 0!==i?{priority:i}:{})})),r=n.filter((t=>((t,e)=>!!t.id&&!(0,i.t9)(a.Eq)(t.tag,e))(t,Object.values(this.providers).map((t=>t.tag))))),o=n.filter((t=>((t,e)=>!!t.id&&!!(0,i.t9)(a.Eq)(t.tag,e))(t,Object.values(this.providers).map((t=>t.tag))))),u=(0,i.DZ)((t=>(0,s.ij)(t.priority)))(r),c=u.length>0?Math.max(...u):0,d=r.map((t=>void 0!==t.priority?Object.assign(Object.assign({},t),{priority:t.priority}):Object.assign(Object.assign({},t),{priority:c+1}))),l=o.map((t=>void 0===e[t.tag]?{tag:t.tag,id:t.id,priority:c+_}:{tag:t.tag,id:t.id,priority:c+v}));return d.concat(l)}getIdentitiesMap(){return this.getFilteredIdentities(((t,e)=>!!e.value))}parseCustomerDefinedIdentities(t){const e=`Identify must be passed a non-empty string or list of { tag, id, priority? } tuples, value passed was '${JSON.stringify(t)}'`,n=t=>{throw new Error(t)},r=t=>(t.forEach((t=>{(t=>"string"==typeof t.id&&"string"==typeof t.tag)(t)||n(e),(t=>"email_sha256"!==t.tag||p.emailSHA256Regex.test(t.id))(t)||n("Identify called with unsupported format of email_sha256 ID. The support format is hex-encoded 64 character long lowercase string.")})),t);return"string"==typeof t?(i=t).length>0?[{id:i,tag:"default"}]:n(e):Array.isArray(t)?r(t):n(e);var i}extractIdentifyFromQueue(t){let{global:e}=t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=()=>e.q.findIndex((t=>"identify"===t.functionName)),i=(t,n)=>{if(t<0)return n;const o=e.q.splice(t,1)[0],s=this.parseCustomerDefinedIdentities(o.arguments[0]);return i(r(),n.concat(s))};return i(r(),n)}setIdentities(t){const e=t.reduce(((t,e)=>{let{tag:n,id:r,expiry:i,priority:o}=e;return void 0===this.identities[n]&&this.logger.debug(`identities[${n}]: added`),t[n]=Object.assign(Object.assign(Object.assign({},r?{value:r}:{}),i?{expiry:i}:{}),void 0!==o?{priority:o}:{}),t}),{}),n=this.ref.current;this.setIdentityMap(Object.assign(Object.assign({},this.identities),e));const r=this.ref.current;return{identifyRequestRequired:()=>!l.xb(r)&&!l.Eh(a.Eq).equals(n,r)}}reset(){return(0,r.mG)(this,void 0,void 0,(function*(){this.setIdentityMap({}),yield Promise.all(Object.values(this.providers).map((t=>t.reset())))}))}getFilteredIdentities(t){return(0,u.m8)(...Object.entries(this.identities).filter((e=>{let[n,r]=e;return t(n,r)})).map((t=>{let[e,{value:n,expiry:r,priority:i}]=t;return(0,o.bc)(e,Object.assign(Object.assign({id:n},r?{expiry:r}:{}),void 0!==i?{priority:i}:{}))})))}shouldAskForNewIdentity(t){var e;const n=(0,s.ij)(null===(e=this.identities)||void 0===e?void 0:e[t.tag]);return(0,s.g_)((()=>!0),this.isIdentityExpired)(n)}getCachedTPDIdentity(t){return this.identities[t]?(0,s.ij)(this.identities[t].value):s.YP}mapTPDIdentityIfPresent(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:86400;const r=()=>Date.now()+Math.floor(1e3*n);return(0,s.g_)((()=>({tag:t,expiry:r()})),(e=>({tag:t,id:e,expiry:r()})))(e)}retrieveIdentity(t){return t.getId().then((e=>"skipped"===e.type?(0,o.bc)(t,s.YP):(0,o.zG)(e.result,(e=>this.metrics.track({name:(0,s.pC)(e)?"sdk_third_party_identity_present_count":"sdk_third_party_identity_missing_count",value:1,labels:{identity_tag:t.tag}})),(n=>(0,o.bc)(t,e.result)))))}isIdentityExpired(t){return"number"==typeof t.expiry&&Date.now()>=t.expiry}getCachedIdentitiesAndMigrateIfRequired(){return(t=>(0,u.m8)(...Object.entries(t).filter((t=>{let[e,n]=t;return!this.isIdentityExpired(n)&&!g.has(e)}))))(this.permutiveData.getData("identities")||{})}}p.emailSHA256Regex=/^[a-f0-9]{64}$/;const g=new Set(["public","email","email_md5","email_sha256","ip_address"]),m=(t,e,n,r,o)=>{const s=(t,e)=>{const n=["(null)"];return n.indexOf(t)>-1||!!y[t]||(0,i.jV)(a.Eq)(e,n).length>0},u=t=>"721d6d85-35f0-4e35-bb38-13eb0d465158"===t,c={"be668577-07f5-444d-98e0-222b990951b1":s,"e43c8a90-d17b-4790-bfda-81b069b3b8c2":(t,e,n)=>["thestudentroom.co.uk"].some((t=>n.indexOf(t)>-1))&&(0,i.jV)(a.Eq)(e,["tsr-"]).length>0,"5d79bce7-5d2b-427e-a6c4-b89b6c7bf048":s,"366ab8da-5efa-4355-ab00-84db3b68ded2":t=>"96539955-4d7e-40df-882b-7e2fbacedb1c"===t||"345600e7-fb5f-48b1-9aa6-cde5396419b0"===t,"f3a06674-ebb9-4b9d-ba8f-0052018c0687":u,"38dadd0d-257a-4641-b332-b8b0fd20a6cb":u,"10453011-272d-49cd-9043-1964fdb36fd8":t=>"936ba6ac-9a8b-454d-ba98-facebd7553fe"===t},d={"fe68d1f7-c9f4-45b3-8905-7cda73d3fd74":t=>!!b[t]},l=c[t]||d[e];return!!l&&l(o,n,r)},_=2,v=3,b={},y={}},7658:(t,e,n)=>{n.d(e,{z:()=>r});class r{ingestIfEligible(t){return Promise.resolve()}}},922:(t,e,n)=>{n.d(e,{CL:()=>d,D0:()=>i,ED:()=>o,EW:()=>l,MU:()=>p,PH:()=>c,Uy:()=>a,eV:()=>s,jH:()=>f,mL:()=>h,t2:()=>u});var r=n(9853);const i=(0,r.MU)("engagement_edge_only",!0),o=(0,r.MU)("segment_transition_edge_only",!0),s=(0,r.MU)("track_form_submission",!0),a=(0,r.MU)("track_pageview_complete",!0),u=(0,r.MU)("track_pageview_engagement",!0),c=((0,r.$S)("sync_segments_cookie",!1),(0,r.$S)("track_slot_clicked",!0)),d=(0,r.$S)("track_slot_rendered",!0),l=(0,r.$S)("track_slot_viewable",!1),f=(0,r.$S)("track_targeting_keys",!1),h="_psegs",p=6e5},4673:(t,e,n)=>{n.d(e,{U:()=>r});const r={$ip_address:"$ip_address",$ip_address_hash:"$ip_address_hash",$ip_geo_info_city:"$ip_geo_info_city",$ip_geo_info_continent:"$ip_geo_info_continent",$ip_geo_info_country:"$ip_geo_info_country",$ip_geo_info_postal_code:"$ip_geo_info_postal_code",$ip_geo_info_province:"$ip_geo_info_province",$ip_isp_info_autonomous_system_organization:"$ip_isp_info_autonomous_system_organization",$ip_isp_info_isp:"$ip_isp_info_isp",$ip_isp_info_organization:"$ip_isp_info_organization"}},8975:(t,e,n)=>{n.d(e,{v:()=>o});class r{constructor(t,e,n,r,i,o,s){this.logger=t,this.permutive=e,this.id=n,this.segmentCode=r,this.triggerType=i,this.config=o,this.workspaceLevelConfig=s,this.prefix="[Activation]"}getSegmentCode(){return this.segmentCode}getTriggerType(){return this.triggerType}getConfig(){return this.config}getWorkspaceLevelConfig(){return this.workspaceLevelConfig}trackImpression(t){return this.trackActivation("impression",t)}trackConversion(t){return this.trackActivation("conversion",t)}trackActivation(t,e){const n={reaction_id:this.id,type:t};this.permutive.track("Reaction",n,e),this.logger.log(this.prefix,n.type,n)}}var i=n(9853);class o{constructor(t,e,n){this.logger=t,this.permutive=e,this.clientContext=n,this.optimisedActivationsConfig={dfp:{dfp:[141494,130975,137422,132458,157369,164929,130974,165125,146697,137874,130976,114983,130972,143386,164675,145671,136104,147227,140449,147409,137871,130973,146626,143387,164674,143388,147353,165127,133974,133973,164931,165821,183194,184030,184031,184032],dfp_legacy:{}},eyeota_pixel:[],dbm:{omitted:0},appnexus:{},appnexus_adserver:[],nativo:[],rubicon_ssp:[],smart:[],freewheel:[]}}getSpecializedActivations(t){return this.optimisedActivationsConfig[t]}getActivations(t){return(0,i.Hn)(t)("activationConfigs",[]).filter((t=>this.areContextCriteriaSatisfied(t))).map((t=>new r(this.logger,this.permutive,t.id,t.sc,t.tt,t.c,t.wc)))}areContextCriteriaSatisfied(t){const e=t.cc,n=t=>{const e=this.clientContext.getContext()[t.key];switch(t.comparison){case"EQUALS":return e===t.value;case"NOT_EQUALS":return e!==t.value;case"CONTAINS":return"string"==typeof e&&e.indexOf(t.value)>=0;case"NOT_CONTAINS":return"string"==typeof e&&e.indexOf(t.value)<0}};return!e||("AND"===(r=e).operator?r.criteria.every(n):r.criteria.some(n));var r}}},9853:(t,e,n)=>{n.d(e,{$S:()=>s,Hn:()=>i,MU:()=>o});const r={standard_cohorts:{auto_init:!0,activationConfigs:[]},web:{auto_init:!1,track_pageview_engagement:!0,track_form_submission:!1,track_link_click:!0,track_pageview_complete:!0,add_alchemy_taxonomy:!1,add_alchemy_entities:!1,engagement_edge_only:!0,segment_transition_edge_only:!0,activationConfigs:[]},rubicon_ssp:{auto_init:!0,publisher_id:"9472",activationConfigs:[]},pubmatic:{auto_init:!0,dpid:"1065",activationConfigs:[]},clean_room:{auto_init:!0,activationConfigs:[]},dfp:{auto_init:!0,track_slot_rendered:!1,track_slot_viewable:!0,track_slot_clicked:!0,activationConfigs:[]},ssp:{auto_init:!0,ssps:["appnexus","pubmatic","openx","google_pps"],cohort_mapping:{1e7:"bgyz",10000001:"bhgp",10000002:"bhhc",10000003:"bhhg",10000004:"bhhk",10000005:"bhhp",10000006:"bhhv",10000007:"bhhy",10000008:"bhie",10000010:"bhis",10000011:"bhiz",10000012:"bhji",10000013:"bhjq",10000014:"bhka",10000015:"bhkl",10000016:"bhkr",10000017:"bhky",10000018:"bhlg",10000019:"bhli",10000020:"bhlo",10000021:"bhlp",10000022:"bhnd",10000023:"bhnl",10000024:"bhnp",10000025:"bhnw",10000026:"bhoj",10000035:"bgzb",10000036:"bhgq",10000037:"bhgs",10000038:"bhgw",10000039:"bhgy",10000040:"bhgz",10000041:"bhhe",10000042:"bhhh",10000043:"bhhw",10000044:"bhhx",10000045:"bhhz",10000046:"bhia",10000047:"bhif",10000048:"bhig",10000049:"bhii",10000050:"bhij",10000051:"bhik",10000052:"bhim",10000053:"bhip",10000054:"bhit",10000055:"bhiu",10000056:"bhiv",10000057:"bhiy",10000058:"bhjm",10000059:"bhjr",10000060:"bhjs",10000061:"bhjw",10000062:"bhjx",10000063:"bhkm",10000064:"bhir",10000065:"bhko",10000066:"bhkp",10000067:"bhkq",10000068:"bhkz",10000069:"bhla",10000070:"bhlb",10000071:"bhle",10000072:"bhlf",10000073:"bhlq",10000074:"bhlt",10000075:"bhlu",10000076:"bhlw",10000077:"bhlx",10000078:"bhly",10000079:"bhmb",10000080:"bhmi",10000081:"bhmj",10000082:"bhml",10000083:"bhmp",10000084:"bhmr",10000085:"bhmw",10000086:"bhmz",10000087:"bhne",10000088:"bhnf",10000089:"bhni",10000090:"bhnn",10000324:"bhhj",10000325:"bhhi",10000327:"bhku",10000328:"bhkt",10000329:"bhkw",10000330:"bhkv",10000687:"bgzc",10000688:"bgza",10000689:"bhha",10000690:"bhgt",10000691:"bhgx",10000692:"bhgv",10000693:"bhgr",10000694:"bhgu",10000695:"bhhb",10000696:"bhhd",10000697:"bhhf",10000698:"bhhl",10000699:"bhho",10000700:"bhhm",10000701:"bhhn",10000702:"bhhq",10000703:"bhht",10000704:"bhhu",10000705:"bhhs",10000706:"bhhr",10000707:"bhib",10000708:"bhid",10000709:"bhic",10000710:"bhio",10000711:"bhin",10000712:"bhil",10000713:"bhiq",10000714:"bhih",10000715:"bhiw",10000716:"bhix",10000717:"bhja",10000718:"bhjc",10000719:"bhjd",10000720:"bhje",10000721:"bhjf",10000722:"bhjb",10000723:"bhjg",10000724:"bhjh",10000725:"bhjo",10000726:"bhjk",10000727:"bhjn",10000728:"bhjj",10000729:"bhjl",10000730:"bhjy",10000731:"bhju",10000732:"bhjv",10000733:"bhjz",10000734:"bhjt",10000735:"bhkj",10000736:"bhkk",10000737:"bhki",10000738:"bhkd",10000739:"bhkc",10000740:"bhkf",10000741:"bhkh",10000742:"bhkb",10000743:"bhkg",10000744:"bhke",10000745:"bhjp",10000746:"bhkn",10000747:"bhkx",10000748:"bhks",10000749:"bhld",10000750:"bhlc",10000751:"bhlh",10000752:"bhlk",10000753:"bhlj",10000754:"bhll",10000755:"bhlm",10000756:"bhlv",10000757:"bhna",10000758:"bhmv",10000759:"bhmt",10000760:"bhmy",10000761:"bhmc",10000762:"bhmo",10000763:"bhls",10000764:"bhmq",10000765:"bhme",10000766:"bhmh",10000767:"bhlz",10000768:"bhlr",10000769:"bhnb",10000770:"bhmk",10000771:"bhmu",10000772:"bhmx",10000773:"bhmg",10000774:"bhmd",10000775:"bhmf",10000776:"bhnc",10000777:"bhmn",10000778:"bhmm",10000779:"bhma",10000780:"bhms",10000781:"bhng",10000782:"bhnj",10000783:"bhnh",10000784:"bhnk",10000785:"bhno",10000786:"bhnm",10000787:"bhnu",10000788:"bhnv",10000789:"bhns",10000790:"bhnt",10000791:"bhnq",10000792:"bhnr",10000793:"bhob",10000794:"bhny",10000795:"bhod",10000796:"bhoh",10000797:"bhog",10000798:"bhnz",10000799:"bhoa",10000800:"bhoe",10000801:"bhnx",10000802:"bhoc",10000803:"bhof"},all_cohort_mapping:{1e7:["bgyz"],10000001:["bhgp"],10000002:["bhhc"],10000003:["bhhg"],10000004:["bhhk"],10000005:["bhhp"],10000006:["bhhv"],10000007:["bhhy"],10000008:["bhie"],10000010:["bhis"],10000011:["bhiz"],10000012:["bhji"],10000013:["bhjq"],10000014:["bhka"],10000015:["bhkl"],10000016:["bhkr"],10000017:["bhky"],10000018:["bhlg"],10000019:["bhli"],10000020:["bhlo"],10000021:["bhlp"],10000022:["bhnd"],10000023:["bhnl"],10000024:["bhnp"],10000025:["bhnw"],10000026:["bhoj"],10000035:["bgzb"],10000036:["bhgq"],10000037:["bhgs"],10000038:["bhgw"],10000039:["bhgy"],10000040:["bhgz"],10000041:["bhhe"],10000042:["bhhh"],10000043:["bhhw"],10000044:["bhhx"],10000045:["bhhz"],10000046:["bhia"],10000047:["bhif"],10000048:["bhig"],10000049:["bhii"],10000050:["bhij"],10000051:["bhik"],10000052:["bhim"],10000053:["bhip"],10000054:["bhit"],10000055:["bhiu"],10000056:["bhiv"],10000057:["bhiy"],10000058:["bhjm"],10000059:["bhjr"],10000060:["bhjs"],10000061:["bhjw"],10000062:["bhjx"],10000063:["bhkm"],10000064:["bhir"],10000065:["bhko"],10000066:["bhkp"],10000067:["bhkq"],10000068:["bhkz"],10000069:["bhla"],10000070:["bhlb"],10000071:["bhle"],10000072:["bhlf"],10000073:["bhlq"],10000074:["bhlt"],10000075:["bhlu"],10000076:["bhlw"],10000077:["bhlx"],10000078:["bhly"],10000079:["bhmb"],10000080:["bhmi"],10000081:["bhmj"],10000082:["bhml"],10000083:["bhmp"],10000084:["bhmr"],10000085:["bhmw"],10000086:["bhmz"],10000087:["bhne"],10000088:["bhnf"],10000089:["bhni"],10000090:["bhnn"],10000324:["bhhj"],10000325:["bhhi"],10000327:["bhku"],10000328:["bhkt"],10000329:["bhkw"],10000330:["bhkv"],10000687:["bgzc"],10000688:["bgza"],10000689:["bhha"],10000690:["bhgt"],10000691:["bhgx"],10000692:["bhgv"],10000693:["bhgr"],10000694:["bhgu"],10000695:["bhhb"],10000696:["bhhd"],10000697:["bhhf"],10000698:["bhhl"],10000699:["bhho"],10000700:["bhhm"],10000701:["bhhn"],10000702:["bhhq"],10000703:["bhht"],10000704:["bhhu"],10000705:["bhhs"],10000706:["bhhr"],10000707:["bhib"],10000708:["bhid"],10000709:["bhic"],10000710:["bhio"],10000711:["bhin"],10000712:["bhil"],10000713:["bhiq"],10000714:["bhih"],10000715:["bhiw"],10000716:["bhix"],10000717:["bhja"],10000718:["bhjc"],10000719:["bhjd"],10000720:["bhje"],10000721:["bhjf"],10000722:["bhjb"],10000723:["bhjg"],10000724:["bhjh"],10000725:["bhjo"],10000726:["bhjk"],10000727:["bhjn"],10000728:["bhjj"],10000729:["bhjl"],10000730:["bhjy"],10000731:["bhju"],10000732:["bhjv"],10000733:["bhjz"],10000734:["bhjt"],10000735:["bhkj"],10000736:["bhkk"],10000737:["bhki"],10000738:["bhkd"],10000739:["bhkc"],10000740:["bhkf"],10000741:["bhkh"],10000742:["bhkb"],10000743:["bhkg"],10000744:["bhke"],10000745:["bhjp"],10000746:["bhkn"],10000747:["bhkx"],10000748:["bhks"],10000749:["bhld"],10000750:["bhlc"],10000751:["bhlh"],10000752:["bhlk"],10000753:["bhlj"],10000754:["bhll"],10000755:["bhlm"],10000756:["bhlv"],10000757:["bhna"],10000758:["bhmv"],10000759:["bhmt"],10000760:["bhmy"],10000761:["bhmc"],10000762:["bhmo"],10000763:["bhls"],10000764:["bhmq"],10000765:["bhme"],10000766:["bhmh"],10000767:["bhlz"],10000768:["bhlr"],10000769:["bhnb"],10000770:["bhmk"],10000771:["bhmu"],10000772:["bhmx"],10000773:["bhmg"],10000774:["bhmd"],10000775:["bhmf"],10000776:["bhnc"],10000777:["bhmn"],10000778:["bhmm"],10000779:["bhma"],10000780:["bhms"],10000781:["bhng"],10000782:["bhnj"],10000783:["bhnh"],10000784:["bhnk"],10000785:["bhno"],10000786:["bhnm"],10000787:["bhnu"],10000788:["bhnv"],10000789:["bhns"],10000790:["bhnt"],10000791:["bhnq"],10000792:["bhnr"],10000793:["bhob"],10000794:["bhny"],10000795:["bhod"],10000796:["bhoh"],10000797:["bhog"],10000798:["bhnz"],10000799:["bhoa"],10000800:["bhoe"],10000801:["bhnx"],10000802:["bhoc"],10000803:["bhof"]},affinity_enabled:!1,activationConfigs:[]},facebook_pixel_v2:{auto_init:!0,activationConfigs:[{id:"137d839d-fe47-43c5-866f-4a0f8bd62370",tt:"EveryTime",sc:114983,c:{},wc:{}}]}},i=t=>{const e=r[t];return(t,n)=>{var r;return null!==(r=null==e?void 0:e[t])&&void 0!==r?r:n}},o=i("web"),s=i("dfp");i("facebook_pixel_v2")},2836:(t,e,n)=>{n.d(e,{z:()=>o});var r=n(3030);class i{constructor(t){this.context=t}getContext(){return this.context}updateContext(){for(var t=arguments.length,e=new Array(t),n=0;n{let[e,n]=t;this.context[e]=n}))}}class o extends i{constructor(t){super(t)}getClient(){var t;const e=null!==(t=document.title)&&void 0!==t?t:"";return Promise.resolve({type:"web",user_agent:navigator.userAgent||"",url:(0,r.bk)(window.location.href),domain:window.location.hostname||"",title:e,referrer:(0,r.bk)(document.referrer)})}}},389:(t,e,n)=>{n.d(e,{p:()=>o});var r=n(3577);const i="permutive-pvc";class o extends((0,r.h)(i)){constructor(t){super(t)}}},5865:(t,e,n)=>{n.d(e,{J:()=>i});var r=n(3577);class i extends((0,r.h)("permutive-unprocessed-pba")){constructor(t){super(t)}}},3577:(t,e,n)=>{n.d(e,{h:()=>a});var r=n(3735),i=n(6567),o=n(7554);const s=t=>e=>class extends e{constructor(){super(...arguments),this.key=t}put(t){return this.db.then((e=>e.put(t,this.key))).then(r.Q1)}getIfPresent(){return this.db.then((t=>t.get(this.key))).then(i.ij)}reset(){return this.db.then((t=>t.delete(this.key)))}},a=t=>(0,r.zG)(class{constructor(t){this.db=Promise.resolve((0,o.E)(t.namespace,t.logger,t.consentTracking))}},s(t))},5700:(t,e,n)=>{n.d(e,{LP:()=>o,dG:()=>r,eP:()=>i});const r=4096,i=`Cookie exceeds maximum supported size of ${r} bytes for most browsers.`,o="Cookie is missing required parameters."},5461:(t,e,n)=>{n.d(e,{S:()=>u});var r=n(3735),i=n(5700);class o{constructor(t,e,n){this.namespace=t,this.config=e,this.logger=n}makeCookie(t,e,n){return[encodeURIComponent(this.namespace.getNamespacedStorageKey(t)),"=",e?encodeURIComponent(e):"","; expires=",n,"; domain=",this.config.cookieDomain,"; path=/; samesite=none; secure"].join("")}setCookie(t,e){var n;if(!(e&&t&&this.config.cookieExpiry&&this.config.cookieDomain)){const{cookieExpiry:r,cookieDomain:o}=null!==(n=this.config)&&void 0!==n?n:{};throw this.logger.warn(`Unable to set cookie. ${i.LP}`,{value:e,cookieName:t,cookieExpiry:r,cookieDomain:o}),new Error(i.LP)}const r=this.makeCookie(t,e,this.config.cookieExpiry);if(r.length>i.dG)throw this.logger.warn(`Unable to set cookie ${this.namespace.getNamespacedStorageKey(t)}. ${i.eP}`),new Error(i.eP);return this.logger.debug(`Setting cookie ${r}`),document.cookie=r,!0}getCookie(t){const e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t:this.namespace.getNamespacedStorageKey(t),n=new RegExp("\\b"+encodeURIComponent(e)+"=([^;]+)").exec(document.cookie);return null!==n?decodeURIComponent(n[1]):null}deleteCookie(t){if(!t||!this.config.cookieDomain)return!1;const e=this.makeCookie(t,void 0,"Thu, 01 Jan 1970 00:00:00 UTC");return this.logger.debug(`Deleting cookie ${e}`),document.cookie=e,!0}}var s=n(4769);const a=t=>{const{logger:e,consentTracking:n}=t,r=t=>(e.debug(`Cookie: Failed to set cookie ${t} as consent is revoked`),!1);return t=>class extends t{constructor(){super(...arguments),this.setCookie=(0,s.v)(super.setCookie.bind(this),r,n.isRevoked)}}},u=(t,e,n,i)=>new((0,r.zG)(o,a({consentTracking:i,logger:n})))(t,e,n)},9773:(t,e,n)=>{n.d(e,{S:()=>d});var r=n(3735),i=n(2688),o=n(787),s=n(365);class a{constructor(t){this.namespace=t}getExternalData(t){const e=this.namespace.getNamespacedStorageKey(t);return window.localStorage.getItem(e)}getExternalJsonData(t){const e=this.getExternalData(t);return null===e?null:(0,o.A)(e)}setExternalData(t,e){const n=this.namespace.getNamespacedStorageKey(t);try{window.localStorage.setItem(n,e)}catch(t){}}setExternalJsonData(t,e){return(0,r.zG)((n=e,(0,s.Y3)((function(){var t=JSON.stringify(n);if("string"!=typeof t)throw new Error("Converting unsupported structure to JSON");return t}),r.yR)),(0,s.UI)((e=>this.setExternalData(t,e))),(0,s.g_)((t=>{throw(0,i.w)(t)}),r.Q1));var n}removeExternalData(t){const e=this.namespace.getNamespacedStorageKey(t);window.localStorage.removeItem(e)}}var u=n(4769);const c=t=>{const{logger:e,consentTracking:n}=t,r=t=>{e.debug(`External Data: Failed to set key ${t} as consent is revoked`)},i=r,o=r;return t=>class extends t{constructor(){super(...arguments),this.setExternalData=(0,u.v)(super.setExternalData.bind(this),i,n.isRevoked),this.setExternalJsonData=(0,u.v)(super.setExternalJsonData.bind(this),o,n.isRevoked)}}},d=(t,e,n)=>new((0,r.zG)(a,c({consentTracking:n,logger:e})))(t)},342:(t,e,n)=>{n.d(e,{SX:()=>o});class r{constructor(){this.prefix="[Permutive]",this.debugStyle=["color: blue"].join(";")}log(){return console.log.bind(window.console,this.prefix)(...arguments)}debug(){return console.debug.bind(window.console,"%c%s",this.debugStyle,this.prefix)(...arguments)}warn(){return console.warn.bind(window.console,this.prefix)(...arguments)}error(){return console.error.bind(window.console,this.prefix)(...arguments)}}class i{log(){}debug(){}warn(){}error(){}}const o=t=>{var e;return t.loggingEnabled&&void 0!==(null===(e=window.console)||void 0===e?void 0:e.log)?new r:new i}},8491:(t,e,n)=>{n.d(e,{Q:()=>o});var r=n(3735);const i="[MESSAGES]";class o{constructor(t){this.logger=t,this.messageListenerMap={},this.replayQueue={},this.onceTracker={},this.defaultMessageOptions={withReplay:!1,once:!1}}on(t,e,n){const r=this.mergeMessageOptions(n);r.withReplay&&this.processReplayQueue(t,e);const i=s(t,this.messageListenerMap).push(e)-1;return r.once&&this.addToOnceTracker(t,i),i}once(t,e){return this.on(t,e,{once:!0})}off(t,e){if(null==e)return this.messageListenerMap[t]=[],void(this.replayQueue[t]=[]);e<0?this.logError('Index for "off" fell out of range',{index:e}):s(t,this.messageListenerMap)[e]=r.Q1}emit(t,e,n){const r=this.mergeMessageOptions(n);s(t,this.messageListenerMap).length>0?(this.logDebug(`Emitting Event: ${t}`),this.emitMessageWithPayload(t,e)):r.withReplay&&this.addToReplayQueue(t,e)}addToReplayQueue(t,e){s(t,this.replayQueue).push(e)}processReplayQueue(t,e){var n;null===(n=this.replayQueue[t])||void 0===n||n.forEach((t=>e(t)))}emitMessageWithPayload(t,e){var n;null===(n=this.messageListenerMap[t])||void 0===n||n.forEach(((n,r)=>{n(e),this.removeListenerIfSetToFireOnlyOnce(t,r)}))}addToOnceTracker(t,e){s(t,this.onceTracker).push(e)}removeListenerIfSetToFireOnlyOnce(t,e){var n;(null===(n=this.onceTracker[t])||void 0===n?void 0:n.includes(e))&&this.off(t,e)}mergeMessageOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({},this.defaultMessageOptions),t)}logError(){for(var t=arguments.length,e=new Array(t),n=0;n{var n;return null!==(n=e[t])&&void 0!==n?n:e[t]=[]}},5619:(t,e,n)=>{n.d(e,{Eq:()=>l,X:()=>f,b:()=>d});var r=n(2851),i=n(2116),o=n(4268),s=n(2751),a=n(4011),u=n(3735),c=n(6567);const d=()=>({environment:"",events_count:0,os:"",sample_rate:0,sdk_version:"",segments_count:0,session_count:0,session_init_count:0,session_view_count:0,user_agent:""}),l=o.n_({environment:s.Eq,events_count:a.Eq,os:s.Eq,sample_rate:a.Eq,sdk_version:s.Eq,segments_count:a.Eq,session_count:a.Eq,session_init_count:a.Eq,session_view_count:a.Eq,user_agent:s.Eq}),f=t=>{const e=p(t.userId),n=(0,u.zG)(r.vP(t.userId,t.sessionId),r.UI((t=>{let[e,n]=t;return`${e},${n}`})),p),o=String(Math.random()),s=(0,u.zG)(t.sdkVariant,c.UI((t=>`-${t}`)),c.fS((()=>""))),a={environment:"web",events_count:0,os:h(window.navigator.userAgent||""),sample_rate:t.sampleRate,sdk_version:"v19.120.0"+s,segments_count:0,user_agent:window.navigator.userAgent||""};return(0,u.zG)(i.vP({session_count:e(t.sessionId),session_init_count:n(r.a9(o)),session_view_count:n(t.viewId)}),i.UI((0,u.ls)((t=>r.vP(t)),r.UI((t=>Object.assign(Object.assign({},a),t))))))},h=t=>{const e=t.toLowerCase();return e.includes("windows")?"windows":e.includes("iphone")||e.includes("ipad")?"ios":e.includes("android")?"android":e.includes("macintosh")?"macos":e.includes("linux")?"linux":"unknown"},p=t=>e=>i.dQ((n=>{let{previousState:i}=n;const c=(0,u.zG)(r.vP(t,e),r.g_(function(t){if(null!==t&&"object"==typeof t&&"scope"in t&&"lastValue"in t&&"count"in t)return t;return{scope:"",lastValue:"",count:1}}(i),((t,e)=>{let[n,r]=e;return{scope:n,lastValue:r,count:n!==t.scope?1:r!==t.lastValue?t.count+1:t.count}})),r.D8(o.n_({scope:s.Eq,lastValue:s.Eq,count:a.Eq})));return{state:c,value:(0,u.zG)(c,r.UI((t=>t.count)))}}))},6478:(t,e,n)=>{n.d(e,{p:()=>g});var r=n(7582),i=n(2688),o=n(3735),s=n(7927),a=n(4673),u=n(2652),c=n(5619),d=n(2851),l=n(3328),f=n(4767),h=n(5151),p=n(3992);const g=t=>{let e=t.context.current;(0,o.zG)(t.context,d.D8(c.Eq)).onChange((t=>{m({beacon:!1}),e=t}));const n="[Metrics Reporter]";let g=!0;const m=u=>{let{beacon:c}=u;return(0,r.mG)(void 0,void 0,void 0,(function*(){const u=(e=>(0,o.zG)({},(0,o.ls)((0,s.dx)("continent",a.U.$ip_geo_info_continent),(e=>t.enrichers.enrich(e,!0).output)),(t=>Object.assign(Object.assign({},e),t))))(e),d=(0,o.zG)(f.of(t.metrics.consume()),f.Y$((()=>g),(()=>{})),f.tS(l.EQ((()=>f.of(void 0)),(e=>f.Y3((()=>((e,n)=>(0,r.mG)(void 0,void 0,void 0,(function*(){if(!e)return t.api.metrics(n);if(!t.api.metricsBeacon(n))throw new Error("Failed to send beacon.")})))(c,{context:u,items:e})),(r=>{g=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;im({beacon:!1})),5e3),(0,u.Bf)((()=>m({beacon:!0})),{capture:!1})}},4074:(t,e,n)=>{function r(t,e,n,r,s){var a;return(null!==(a=n.getData("metricsEnabled"))&&void 0!==a?a:(()=>{const t=Math.random()<=e.metricsSamplingPercentage/100;return n.setData("metricsEnabled",t),t})())?new i(t,r,s):new o}n.d(e,{g:()=>r});class i{constructor(t,e,n){this.sdkInitTimestamp=t,this.messages=e,this.logger=n,this.prefix="[Metrics]",this.pendingMetrics=[],this.pendingCounters={},this.pendingTimers={},this.track({name:"sdk_initialisation_start_time_seconds",value:t/1e3,labels:{}})}isEnabled(){return!0}consume(){const t=this.pendingMetrics.concat(Object.values(this.pendingCounters).flat());return this.pendingMetrics=[],this.pendingCounters={},t}track(t){this.logDebug(`Tracking ${t.name}`,{metric:t}),this.pendingMetrics.push(t)}trackCounter(t){if(this.logDebug(`Tracking ${t.name}`,{metric:t}),t.name in this.pendingCounters){const e=Object.keys(t.labels),n=this.pendingCounters[t.name].findIndex((n=>Object.keys(n.labels).length===e.length&&e.every((e=>n.labels[e]===t.labels[e]))));-1===n?this.pendingCounters[t.name].push(t):this.pendingCounters[t.name][n]=s(this.pendingCounters[t.name][n],t.value)}else this.pendingCounters[t.name]=[t]}trackTimeSinceInit(t,e){const n=(performance.now()-this.sdkInitTimestamp)/1e3;this.logDebug("timer stopped",t,n),this.track({name:t,value:n,labels:e})}startTimer(t,e){const n=performance.now(),r=this.generateRandomKey(t);return this.pendingTimers[r]={startTime:n,labels:e},r}stopTimer(t,e){const n=this.pendingTimers[e];if(n){const r=(performance.now()-n.startTime)/1e3;this.logDebug("timer stopped",t,r),this.track({name:t,value:r,labels:n.labels}),delete this.pendingTimers[e]}}generateRandomKey(t){return`${t}-${[...Array(24)].map((()=>Math.random().toString(36)[2])).join("")}`}logDebug(){for(var t=arguments.length,e=new Array(t),n=0;nObject.assign(Object.assign({},t),{value:t.value+e})},8317:(t,e,n)=>{n.d(e,{S:()=>s});var r=n(7582),i=n(3735),o=n(2652);class s{constructor(t,e){this.db=t,this.options=e}getSessionId(){return this.options.session_id}sessionHasChanged(){return this.options.hasChanged}static decodeSessionData(t){return t&&"object"==typeof t&&t.hasOwnProperty("session_id")&&t.hasOwnProperty("last_updated")?Object.assign(Object.assign({},t),{last_updated:new Date(t.last_updated)}):null}reset(){return this.db.delete(this.options.session_data_key)}persistSessionData(t){return(0,r.mG)(this,void 0,void 0,(function*(){const e=t.last_updated.toISOString();yield this.db.put(Object.assign(Object.assign({},t),{last_updated:e}),this.options.session_data_key)}))}static generateNewSession(t){return{session_id:(0,o.k$)(),last_updated:t}}static hasExpired(t,e,n){if(isNaN(e.getTime()))return!0;return t>new Date(e.getTime()+1e3*n)}static initialise(t,e,n){return(0,r.mG)(this,void 0,void 0,(function*(){const r={timeout_seconds:1800,session_data_key:"permutive-session",hasChanged:!1,logger:n};t.deleteCookie(r.session_data_key);const a=new Date,u=yield e.get(r.session_data_key).catch(i.gn),c=s.decodeSessionData(u),d=null===c||s.hasExpired(a,c.last_updated,r.timeout_seconds)?Object.assign(Object.assign({},s.generateNewSession(a)),{hasChanged:!0}):Object.assign(Object.assign({},c),{last_updated:a,hasChanged:!1}),l=new s(e,(0,o.PM)(r,d));return yield l.persistSessionData(d),l}))}}},4026:(t,e,n)=>{n.d(e,{S:()=>_});var r=n(3735),i=n(2688),o=n(787),s=n(365),a=n(2652),u=n(4730),c=n(926);class d{constructor(t,e,n){this.config=t,this.namespace=e,this.logger=n,this.prefix="[Data Store]",this.permutiveData={},this.permutiveDataSize=0,this.localStorageQueue=new Set,this.localStorageScheduler=new u.b(t.localStorageWriteDelay,t.localStorageWriteMaxDelay),this.debouncedFlush=this.localStorageScheduler.schedule(this.flushLocalStorageQueue.bind(this)),this.debouncedStorageKeys=new Set(t.localStorageDebouncedKeys),this.localStorageScheduler.scheduleForPageUnload(this.flushLocalStorageQueue.bind(this)),this.permutiveData=this.buildData()}reset(){this.permutiveData={}}getDataSize(){return this.permutiveDataSize}getData(t){return this.permutiveData[t]}setData(t,e){this.permutiveData[t]=e,this.requestWrite(t)}deleteKey(t){delete this.permutiveData[t],this.requestWrite(t)}requestWrite(t){this.debouncedStorageKeys.has(t)?(this.localStorageQueue.add(t),this.debouncedFlush()):this.writeData(t)}flushLocalStorageQueue(){for(let t of this.localStorageQueue)this.writeData(t);this.localStorageQueue.clear()}buildData(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.getDataChunk("misc")),this.getDataChunk("models")),this.getDataChunk("queries")),this.getDataChunk("enrichers"))}getDataChunk(t){const e=this.namespace.getNamespacedStorageKey(this.chunkKeyToStorageKey(t)),n=window.localStorage.getItem(e),r=null===n?null:(0,o.A)(n);return n&&r?(this.permutiveDataSize+=2*n.length,r):{}}chunkKeyToStorageKey(t){switch(t){case"models":return this.config.permutiveDataModelsKey;case"queries":return this.config.permutiveDataQueriesKey;case"enrichers":return this.config.permutiveDataEnrichersKey;case"misc":return this.config.permutiveDataMiscKey;default:throw new Error(`Unhandled chunk key "${t}"`)}}writeData(t){this.logger.debug(`Data Store: Writing ${t} to localStorage`);const[e,n]=this.dataKeyToChunkInfo(t);return s.Y3((()=>window.localStorage.setItem(this.namespace.getNamespacedStorageKey(e),JSON.stringify(n))),(e=>{const n=(0,i.w)(e);return this.logError(`Failed to set ${t}. Got ${n}`),n}))}dataKeyToChunkInfo(t){const e=t=>(0,a.eu)(this.permutiveData,t);switch(t){case"models_data":case"models_last_updated":return[this.chunkKeyToStorageKey("models"),e(l)];case"query_states":case"internal_query_states":case"external_query_states":case"state_offset":case"event-source-id":return[this.chunkKeyToStorageKey("queries"),e(f)];case"enricher:geoip":case"enricher:topics":return[this.chunkKeyToStorageKey("enrichers"),e(h)];case c.Kd:case"identities":case"amp_ready":case"metricsEnabled":case"addon:tradedesk":case"addon:tracking_pixel":case"addon:eyeota_pixel":case"addon:pinterest_pixel":case"addon:facebook_pixel_v2":case"addon:tiktok_pixel":case"addon:appnexus":case"addon:ddp":case"addon:gigya":case"addon:neustar_fabrick":case"pubmatic":case"lotame":return[this.chunkKeyToStorageKey("misc"),e(p)];default:throw new Error(`Unhandled data key "${t}"`)}}logError(){for(var t=arguments.length,e=new Array(t),n=0;n{const{logger:e,consentTracking:n}=t,r=t=>(e.debug(`Data Store: Failed to write ${t} as consent is revoked`),s.F2(void 0));return t=>class extends t{constructor(){super(...arguments),this.writeData=(0,g.v)(super.writeData.bind(this),r,n.isRevoked)}}},_=(t,e,n,i)=>new((0,r.zG)(d,m({consentTracking:i,logger:n})))(t,e,n)},569:(t,e,n)=>{n.d(e,{L:()=>r});class r{constructor(t){this.config=t}getNamespacedStorageKey(t){return`${this.config.stateNamespace}${t}`}}},7575:(t,e,n)=>{n.d(e,{u:()=>r});class r{constructor(t,e){this.metrics=t,this.messages=e,this._isRealtime=!1,this._isReady=!1}isRealtime(){return this._isRealtime}isReady(){return this._isReady}setAsRealtime(t){this._isRealtime=!0,this.messages.emit("permutive:realtime"),this.metrics.trackTimeSinceInit("sdk_realtime_targeting_set_task_duration_seconds",{}),this.metrics.track({name:"sdk_user_segments_count",value:t,labels:{}})}setAsReady(){this._isReady=!0,this.messages.emit("permutive:ready"),this.metrics.trackTimeSinceInit("sdk_initialisation_task_duration_seconds",{}),window.performance&&window.performance.memory&&(this.metrics.track({name:"sdk_heap_memory_bytes_used",value:window.performance.memory.usedJSHeapSize,labels:{}}),this.metrics.track({name:"sdk_heap_memory_limit_fraction_used",value:window.performance.memory.usedJSHeapSize/window.performance.memory.jsHeapSizeLimit,labels:{}}))}}},7256:(t,e,n)=>{n.d(e,{a:()=>s});var r=n(7582),i=n(3735),o=n(7927);class s{constructor(t,e,n,r,i,o,s){this.config=t,this.localStorage=e,this.logger=n,this.permutiveData=r,this.eventSourceId=i,this.cookies=o,this.externalData=s}reset(){return(0,r.mG)(this,void 0,void 0,(function*(){return this.logger.log("Resetting State"),(0,i.zG)(this.cookies.deleteCookie(this.config.cookieName),(t=>this.externalData.removeExternalData(this.config.cookieName)),(t=>(0,o.XP)({_paols:!0,_papns:!0,_pcrdbs:!0,_pcrprs:!0,_pdfps:!0,_pfws:!0,_pnativo:!0,_prps:!0,_prubicons:!0,_psegs:!0,_psmart:!0,"permutive-id":!0,"permutive-loaded":!0,"permutive-prebid-rtd":!0,"permutive-events-cache":!0,_pssps:!0,_ppsts:!0}).forEach((t=>this.externalData.removeExternalData(t)))),(t=>this.permutiveData.reset()),(t=>this.eventSourceId.generateAndSet()),(t=>Promise.all([this.localStorage.delete(this.config.permutiveDataModelsKey),this.localStorage.delete(this.config.permutiveDataQueriesKey),this.localStorage.delete(this.config.permutiveDataEnrichersKey),this.localStorage.delete(this.config.permutiveDataMiscKey)])),i.Q1)}))}}},7274:(t,e,n)=>{n.d(e,{u:()=>r});class r{constructor(t,e,n,r,i){this.permutiveData=t,this.permutiveReset=e,this.userId=n,this.viewId=r,this.eventCollection=i}getPermutiveData(t){return this.permutiveData.getData(t)}setPermutiveData(t,e){return this.permutiveData.setData(t,e)}getStateSizeInBytes(){return this.permutiveData.getDataSize()+this.eventCollection.getStateSizeInBytes()}reset(){return this.permutiveReset.reset()}}},9117:(t,e,n)=>{n.d(e,{M:()=>a});var r=n(3735),i=n(6567),o=n(2851),s=n(2652);class a{constructor(t,e,n,i){this.config=t,this.clientContext=e,this.cookies=n,this.externalData=i;const[s,a]=o.Ue(this.getOrGenerateUserId());this.ref=s,this.setUserId=a,(0,r.zG)(s,o.YP((t=>{this.cookies.setCookie(this.config.cookieName,t),this.externalData.setExternalData(this.config.cookieName,t),this.clientContext.updateContext(["user_id",t])})))}isEqual(t){return this.ref.current===t}get(){return this.ref.current}set(t){this.setUserId(t)}getOrGenerateUserId(){return(0,i.fS)((()=>(0,i.fS)(s.k$)(this.getUserIdFromLocalStorage())))(this.getUserIdFromCookie())}getUserIdFromCookie(){return this.getUserIdFromStorageIfValid("cookie")}getUserIdFromLocalStorage(){return this.getUserIdFromStorageIfValid("localStorage")}getUserIdFromStorageIfValid(t){const e=(0,i.DT)(s.Gz);return(0,r.zG)("cookie"===t?this.cookies.getCookie(this.config.cookieName):this.externalData.getExternalData(this.config.cookieName),i.ij,(0,i.tS)(e))}}},9880:(t,e,n)=>{n.d(e,{W:()=>o});var r=n(2851),i=n(2652);class o{constructor(t){this.config=t;const e=this.useIfValidOrGenerate(t.viewId),[n,i]=r.Ue(e);this.ref=n,this.set=i}get(){return this.ref.current}generateAndSet(t){const e=this.useIfValidOrGenerate(t);return this.set(e),e}useIfValidOrGenerate(t){return"string"==typeof t&&(0,i.Gz)(t)?t:(0,i.k$)()}}},7554:(t,e,n)=>{n.d(e,{E:()=>i});var r=n(8259);const i=(t,e,n)=>{const i=window.localStorage;return(0,r.rK)(i,"[Local Storage]",t,e,n)}},9332:(t,e,n)=>{n.d(e,{u:()=>i});n(2233);var r=n(8259);const i=(t,e,n)=>{const i=window.sessionStorage;return(0,r.rK)(i,"[Session Storage]",t,e,n)}},8259:(t,e,n)=>{n.d(e,{_z:()=>d,oP:()=>c,rK:()=>f});var r=n(7582),i=n(2688),o=n(787),s=n(365),a=n(3735),u=n(4769);class c{constructor(t,e){this.storage=t,this.namespace=e}put(t,e){return(0,r.mG)(this,void 0,void 0,(function*(){const n=this.namespace.getNamespacedStorageKey(e.toString());return this.storage.setItem(n,JSON.stringify(t)),e}))}get(t){return(0,r.mG)(this,void 0,void 0,(function*(){const e=this.namespace.getNamespacedStorageKey(t.toString()),n=this.storage.getItem(e);return null===n?null:(0,o.A)(n)}))}delete(t){return(0,r.mG)(this,void 0,void 0,(function*(){const e=this.namespace.getNamespacedStorageKey(t.toString());this.storage.removeItem(e)}))}deleteStore(){return(0,r.mG)(this,void 0,void 0,(function*(){}))}}const d=t=>{const{logger:e,consentTracking:n,prefix:r}=t,i=(t,n)=>(e.debug(`${r} Failed to write ${String(n)} as consent is revoked`),Promise.resolve(n));return t=>class extends t{constructor(){super(...arguments),this.put=(0,u.v)(super.put.bind(this),i,n.isRevoked)}}},l=t=>{const{logger:e,prefix:n,storage:o}=t;return t=>class extends t{constructor(){super(...arguments),this.isSupported=null}isStorageSupported(){return null!==this.isSupported||(this.isSupported=s.Y3((()=>{const t="_permutive_ls_test";return o.setItem(t,t),o.getItem(t),o.removeItem(t),!0}),i.w),(0,a.zG)(this.isSupported,s.EQ((t=>{e.warn(`${n} Is NOT supported`,t)}),(()=>{e.debug(`${n} Is supported`)})))),this.isSupported}put(t,e){const n=Object.create(null,{put:{get:()=>super.put}});return(0,r.mG)(this,void 0,void 0,(function*(){return(0,a.zG)(this.isStorageSupported(),s.EQ((t=>{throw t}),(()=>n.put.call(this,t,e))))}))}get(t){const e=Object.create(null,{get:{get:()=>super.get}});return(0,r.mG)(this,void 0,void 0,(function*(){return(0,a.zG)(this.isStorageSupported(),s.EQ((()=>null),(()=>e.get.call(this,t))))}))}delete(t){const e=Object.create(null,{delete:{get:()=>super.delete}});return(0,r.mG)(this,void 0,void 0,(function*(){return(0,a.zG)(this.isStorageSupported(),s.EQ(a.Q1,(()=>e.delete.call(this,t))))}))}deleteStore(){const t=Object.create(null,{deleteStore:{get:()=>super.deleteStore}});return(0,r.mG)(this,void 0,void 0,(function*(){return(0,a.zG)(this.isStorageSupported(),s.EQ(a.Q1,(()=>t.deleteStore.call(this))))}))}}},f=(t,e,n,r,i)=>new((0,a.zG)(c,l({logger:r,prefix:e,storage:t}),d({logger:r,consentTracking:i,prefix:e})))(t,n)},2497:(t,e,n)=>{n.d(e,{Ec:()=>s,_8:()=>o});var r=n(6567),i=n(2652);const o=t=>{const e=t.__tcfapi,n={type:"aborted"},o=["tcloaded","useractioncomplete"];return e?(0,i.a4)((()=>a(e,"getTCData")),(()=>a(e,"getTCData").then((t=>"loaded"===(null==t?void 0:t.cmpStatus)&&o.includes(null==t?void 0:t.eventStatus))))).then((0,r.g_)((()=>n),(t=>({type:"loaded",data:t})))):Promise.resolve({type:"missing"})},s=t=>t.gdprApplies?(0,r.G)(t.vendor.consents):r.YP,a=(t,e)=>new Promise((n=>{t(e,2,(t=>{n(t)}))}))},5165:(t,e,n)=>{n.d(e,{D:()=>r});const r={tradedesk:21,ddp:755,appnexus:32,pubmatic:76,neustar_fabrick:468}},6037:(t,e,n)=>{n.d(e,{C:()=>u});var r=n(7582),i=n(1500),o=n(3735);const s=(a=[[{name:"dfp",import:Promise.resolve().then(n.bind(n,4388))}],[],[],[],[],[],[{name:"clean_room",import:Promise.resolve().then(n.bind(n,115))}],[],[],[],[{name:"facebook_pixel_v2",import:Promise.resolve().then(n.bind(n,9278))}],[],[],[],[],[],[],[],[],[],[],[{name:"pubmatic",import:Promise.resolve().then(n.bind(n,1840))}],[],[{name:"rubicon_ssp",import:Promise.resolve().then(n.bind(n,8563))}],[],[],[],[],[{name:"web",import:Promise.resolve().then(n.bind(n,4400))}],[],[],[{name:"ssp",import:Promise.resolve().then(n.bind(n,9557))}],[]],(0,o.zG)((0,i.xH)(a),(0,i.u4)({},((t,e)=>Object.assign(Object.assign({},t),{[e.name]:e.import})))));var a;const u=t=>{const e=Object.entries(s).map((e=>{let[n,i]=e;return(0,r.mG)(void 0,void 0,void 0,(function*(){return t.logger.log(`Loading addon ${n}`),(yield i).load(t)}))}));return Promise.all(e)}},2721:(t,e,n)=>{n(9853),n(2652)},3248:(t,e,n)=>{n.d(e,{h:()=>r});const r=t=>{window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push((()=>{const e=googletag.pubads(),n=()=>{t.track("AdRequest",{ad_server_id:"dfp",cohorts:e.getTargeting("permutive")})},r=e.getSlots().filter((t=>t.getResponseInformation())).length;for(let t=0;t{n.d(e,{Y:()=>o});var r=n(3735),i=n(3328);const o=t=>{var e;const n=t.getSpecializedActivations("dfp"),o=(0,r.zG)(null!==(e=null==n?void 0:n.dfp)&&void 0!==e?e:[],i.UI(String),(t=>new Set(t)));return{id:"dfp",filterCohorts:i.hX((t=>o.has(t)))}}},9658:(t,e,n)=>{n.r(e),n.d(e,{createAddon:()=>S,getCachedDFPSegments:()=>k});var r=n(7582),i=n(2688),o=n(365),s=n(3735),a=n(6567),u=n(2851),c=n(9853),d=n(2652);const l="_pdfps";n(5700);var f=n(1500),h=n(2751);let p=!1;let g=null;const m=(t,e)=>{const{logger:n}=e;(0,s.zG)(t,a.UI((t=>{!0!==p&&t.pubadsReady&&(null!=g||(g=r=>{let{slot:i}=r;const{getContentUrl:o}=i;if(!o||"function"!=typeof o)return;(0,s.zG)(o(),(0,h.pn)("&trunc=1"))&&(n.debug("DFP content URL has been truncated!"),(t=>{let{metrics:e,logger:n}=t;p||(e.track({name:"sdk_targeting_size_limit_exceeded_count",value:1,labels:{target:"dfp"}}),p=!0,n.debug("DFP has exceeded targeting limit"))})(e),g&&t.pubads().removeEventListener("slotRenderEnded",g),g=null)}),t.pubads().addEventListener("slotRenderEnded",g))})))},_=(t,e,n,r)=>{const{logger:i}=e;m(t,e);(0,s.zG)(t,a.UI((t=>(t=>{t.cmd.push((()=>{const{getTargeting:e,setTargeting:o}=t.pubads(),s=e("permutive")||[],a=Object.values(n.eligibleSegments).map(String).concat(n.cloudCohorts).concat("rts"),u=(0,f.uK)((t=>a.includes(t))),{left:c}=u(s),d=r.concat(c).concat("rts");i.debug("DFP setting GPT targeting to",d),o("permutive",d)}))})(t))))};var v=n(4388),b=n(9624);const y={liveSegments:[],cloudCohorts:[],eligibleSegments:{}},w={segments:y,getGAMKeyValues:()=>({permutive:""})},k=t=>t.getExternalJsonData(l)||[],E=(t,e,n)=>{const{logger:r,externalData:o,api:s}=e;let a=n.map(String).concat(y.cloudCohorts);r.debug("DFP is updating with targeting values",a),_(t,e,y,a);try{o.setExternalJsonData(l,a)}catch(t){const e=(0,i.w)(t),n="DFP failed to set data. Got:";r.error(n,e),s.reportError(`${n} ${e.message}`)}return((t,e)=>{let{api:n,logger:r}=t;(0,c.$S)("sync_segments_cookie",!1)?(r.debug("DFP syncing segment cookie _pdfps"),n.segmentSync({key:l,value:e})):r.debug("DFP sync segments cookie not enabled, skipping sync")})(e,JSON.stringify(a)),r.debug("DFP live segments updated to",n),n},S=t=>(0,r.mG)(void 0,void 0,void 0,(function*(){const{api:e,logger:n,activationManager:r,messages:i,externalData:c,nextGenOutput:f,userId:h,cookies:p}=t,g=yield(0,d.a4)((()=>window.googletag),(()=>!!window.googletag),{waitTimeInMs:10,maxAttempts:200,exponentialBackOff:!1});a.Wi(g)&&n.error("[DFP]: unable to find google tag script on the page"),(0,s.zG)(g,a.UI((t=>(t=>t.cmd.push((()=>t.pubads().setTargeting("prmtvsdk","web"))))(t))));w.getGAMKeyValues=()=>Object.assign(Object.assign({},(0,s.zG)((0,v.generateProjectSpecificKVs)(t),o.Vn((t=>{var n;return n=t,e.reportError(`[DFP] ${n}`,h.get()),t})),o.fS((()=>({}))))),{permutive:w.segments.liveSegments.join(",")}),y.eligibleSegments=(t=>{const e=t.getSpecializedActivations("dfp"),n={};for(const t of e.dfp)n[t]=t;for(const t of Object.keys(e.dfp_legacy)){const r=Number(t);n[r]=e.dfp_legacy[r]}return n})(r);const m=(0,s.zG)(f.queryLanguageCohorts.all,u.UI((t=>(n.debug("DFP received QL segments",{qlSegments:t}),((t,e)=>t.filter((t=>t in e)).map((t=>e[t])))(t,y.eligibleSegments)))),u.D8(d.cO)),_=f.nonQLCohorts((0,b.Y)(r));return(0,s.zG)(u.vP(m,_),u.YP((0,d.Z_)(e,h,(e=>{let[r,i]=e;n.debug("DFP received updated cohorts",{filteredQlSegments:r,cloudCohorts:i}),y.cloudCohorts=i,y.liveSegments=E(g,t,r)})))),n.debug("DFP initialised with segments",y),i.on("permutive:reset",(0,d.Z_)(e,h,(()=>{n.debug("DFP received 'permutive:reset' event"),c.removeExternalData(l),p.deleteCookie(l)}))),i.emit("permutive:dfp:ready"),w}))},4388:(t,e,n)=>{n.r(e),n.d(e,{generateProjectSpecificKVs:()=>D,load:()=>f});var r=n(2688),i=n(365),o=n(6567),s=n(3735),a=n(922),u=n(9853),c=n(2652),d=n(9658);const l={},f=t=>{(0,u.Hn)("dfp")("auto_init",!1)&&t.q.push({functionName:"addon",arguments:["dfp",{}]}),window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],window.googletag.cmd.push((()=>h(t)))},h=t=>{t.permutive.ready((0,c.Z_)(t.api,t.userId,(()=>E(t.metrics))),"realtime");S(t.externalData);(0,s.zG)(D(t),i.tS((t=>i.Y3((()=>(0,c.qh)(t).forEach((t=>{let[e,n]=t;googletag.pubads().setTargeting(e,n)}))),r.w))),i.Vn((e=>t.api.reportError(`[DFP:load], ${e}`,t.userId.get())))),b(t.permutive),googletag.cmd.push((()=>{y(t.permutive),w(t.permutive)})),window.addEventListener("message",g(t.permutive),!1)},p=t=>{let{advertiserId:e,campaignId:n,lineItemId:r,creativeId:i}=t;return{advertiser_id:(0,c.rH)(e),campaign_id:(0,c.rH)(n),line_item_id:(0,c.rH)(r),creative_id:(0,c.rH)(i)}},g=t=>e=>{var n;try{const r=JSON.parse(e.data);if(!r.permutive_type||"google_ad_click"!==r.permutive_type)return;const{ad_unit_path:i,creative_id:o,advertiser_id:s,order_id:a,line_item_id:u}=null!==(n=null==r?void 0:r.data)&&void 0!==n?n:{},c=p({lineItemId:u,advertiserId:s,campaignId:a,creativeId:o});let d;Object.keys(l).some((t=>{const{slot:e,creative_id:n}=l[t];if((null==e?void 0:e.ad_unit_path)===i&&n===c.creative_id)return d=l[t],!0})),d=null!=d?d:Object.assign(Object.assign({},c),{is_empty:!1}),m(t,d)}catch(t){}},m=(t,e)=>{a.PH&&e&&t.track("SlotClicked",e)},_={},v=(t,e,n)=>{l[e]=n,k(t,n),_[e]&&_[e](),_[e]=P(t,e)},b=t=>{const e=googletag.pubadsReady&&googletag.pubads().getSlots();e&&e.forEach((e=>{const n=e.getResponseInformation();if(!n)return;const r=Object.assign(Object.assign({},p(n)),{is_empty:!1,service_name:"publisher_ads",slot:I(e)}),i=e.getSlotElementId();v(t,i,r)}))},y=t=>{googletag.pubads().addEventListener("slotRenderEnded",(e=>{const n=Object.assign(Object.assign({},p(e)),{is_empty:e.isEmpty,service_name:e.serviceName,slot:I(e.slot)});if(e.size){const[t,r]=e.size;"number"==typeof t&&"number"==typeof r&&(n.width=t,n.height=r)}const r=e.slot.getSlotElementId();v(t,r,n)}))},w=t=>{a.EW&&googletag.pubads().addEventListener("impressionViewable",(e=>{let{slot:n,serviceName:r}=e;const i=n.getResponseInformation();if(!i)return;const o=Object.assign(Object.assign({},p(i)),{service_name:r,slot:I(n)});t.track("SlotViewable",o)}))},k=(t,e)=>{if(!a.CL)return;var n;n=Object.assign(Object.assign({},e),{rendered_timestamp:Date.now()}),t.track("SlotRendered",n)},E=t=>{let e=0;const n=googletag.pubadsReady&&googletag.pubads().getSlots();n&&n.forEach((t=>t.getResponseInformation()&&e++));const r=0===e?"sdk_targeting_realtime_success_count":"sdk_targeting_realtime_fail_count";t.track({name:r,value:1,labels:{target:"dfp"}})},S=t=>{const e=(0,d.getCachedDFPSegments)(t);googletag.cmd.push((()=>{const{getTargeting:t,setTargeting:n}=googletag.pubads(),r=t("permutive")||[];n("permutive",[...new Set([...e.map(String),...r])])}))},I=t=>{const e={ad_unit_path:t.getAdUnitPath(),slot_element_id:t.getSlotElementId()};return a.jH?Object.assign(Object.assign({},e),(()=>{const e={},n=[];let r=[];const i=(t,i)=>{const o="slot"===t?t=>e[t]=1:()=>{},s=i.getTargetingKeys();r=s;for(let s=0;s0&&(o(a),n.push({key:a,value:u}))}};return i("slot",t),i("service",googletag.pubads()),{targeting_keys:n}})()):e},P=(t,e)=>{let n=[];const r=()=>(0,s.zG)((0,s.bc)((0,s.zG)(o.Y3((()=>document.getElementById(e))),o.tS(o.ij),o.tS(o.KQ((t=>t.querySelector("iframe"))))),o.ij(document.activeElement)),o.RD,o.UI((n=>{let[r,i]=n;"hidden"===document.visibilityState&&r===i&&m(t,l[e])})));return document.addEventListener("visibilitychange",r),n.push((()=>document.removeEventListener("visibilitychange",r))),()=>{n.forEach((t=>t())),n=[]}},D=t=>{let{userId:e,viewId:n}=t;return i.Y3((()=>({})),r.w)}},9278:(t,e,n)=>{n.r(e),n.d(e,{FacebookV2Pixel:()=>a,load:()=>u});var r=n(9853),i=n(2652);class o{constructor(t,e){this.isFirstRun=void 0===t.permutiveData.getData(e),this.cachedSegmentsMembership=new Set(t.nextGenOutput.queryLanguageCohorts.all.current),this.isFirstRun&&t.permutiveData.setData(e,!0),t.messages.on("permutive:reset",(()=>t.permutiveData.setData(e,!1)))}}class s extends o{constructor(t,e,n){super(t,n);t.activationManager.getActivations(e).forEach((e=>{const n=e.getSegmentCode(),r=this.cachedSegmentsMembership.has(n);this.isFirstRun&&r?this.fire(e,r):t.permutive.trigger(n,"",(t=>{this.fire(e,t.result)}))}))}}class a extends s{constructor(t){super(t,"facebook_pixel_v2","addon:facebook_pixel_v2")}fire(t,e){fbq("trackCustom",!0===e?"PermutiveSegmentEntry":"PermutiveSegmentExit",{segment_id:t.getSegmentCode()}),t.trackImpression()}}const u=t=>{(0,r.Hn)("facebook_pixel_v2")("auto_init",!1)&&(0,i.a4)((()=>t.permutive.addon("facebook_pixel_v2",{})),(()=>"undefined"!=typeof fbq),{waitTimeInMs:1e3,maxAttempts:3})}},1840:(t,e,n)=>{n.r(e),n.d(e,{PubMaticAddon:()=>s,load:()=>o});var r=n(9853),i=n(2652);const o=t=>{(0,r.Hn)("pubmatic")("auto_init",!1)&&t.q.push({functionName:"addon",arguments:["pubmatic",{}]})};class s{constructor(t){const e=this;this.options=t;const n=(0,r.Hn)("pubmatic");this.defaultDpid=n("dpid",""),this.eligibleSegments={},this.liveDpidsToSegments={},this.activations=this.options.activationManager.getActivations("pubmatic");for(let t=0;te.updateIfNecessary(t))))}updateIfNecessary(t){const e=this.dpidsToSegments(t);for(const t in e)e.hasOwnProperty(t)&&this.embedPixel(t,e[t]);this.options.state.setPermutiveData("pubmatic",(new Date).toISOString()),this.liveDpidsToSegments=e}embedPixel(t,e){if(!(0,i.cO)(e,this.liveDpidsToSegments[t])){const n="https:"===location.protocol?"https:":"http:",r=n+"//aud.pubmatic.com/AdServer/Artemis?uidtype=0&dpid="+t+"&segid="+e.join(",");(new Image).src=n+"//image6.pubmatic.com/AdServer/UCookieSetPug?rd="+encodeURIComponent(r)}}dpidsToSegments(t){const e={};for(let n=0;n{n.r(e),n.d(e,{RubiconSspAddon:()=>u,load:()=>a});var r=n(3735),i=n(2652),o=n(2851);const s="_prubicons",a=t=>{t.q.push({functionName:"addon",arguments:["rubicon_ssp",{}]})};class u{constructor(t){this.options=t,this.liveSegments=[],this.eligibleSegments={},this.liveSegments=t.externalData.getExternalJsonData(s)||[];const e=this.options.activationManager.getSpecializedActivations("rubicon_ssp");for(let t=0;tthis.updateIfNecessary(t))))}updateIfNecessary(t){const e=this.filterSegments(t);(0,i.cO)(e,this.liveSegments)||this.options.externalData.setExternalJsonData(s,e),this.liveSegments=e}filterSegments(t){return t.filter((t=>t in this.eligibleSegments))}}},4400:(t,e,n)=>{n.r(e),n.d(e,{WebAddon:()=>I,load:()=>S});var r=n(7582),i=n(2688),o=n(365),s=n(3735),a=n(4011),u=n(6567),c=n(7209),d=n(6341),l=n(922),f=n(9853),h=n(2652);const p=(0,f.MU)("add_alchemy_entities",!1),g=(0,f.MU)("add_alchemy_taxonomy",!1);function m(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.assign(Object.assign(Object.assign(Object.assign({},t&&g?{taxonomy_labels:"$alchemy_taxonomy_labels"}:{}),t&&p?{entity_names:"$alchemy_entity_names"}:{}),{classifications_watson:{taxonomy_labels:"$taxonomy_labels"}}),{})}function _(t,e,n,r){const i=Object.assign(Object.assign(Object.assign({isp_info:"$ip_isp_info",geo_info:"$ip_geo_info"},{}),t),e);n.track("Pageview",i).then((t=>{t&&r.emit("permutive:event:pageview",t)}))}function v(t,e,n,r,i,o){let s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:u.YP;const c=b(t,e,n,r,i),d=(0,u.fS)((()=>null))(a);let l={useBeacon:s};return null!==d&&(l=Object.assign(Object.assign({},l),{unprocessedData:d})),o.track("PageviewComplete",c,l)}function b(t,e,n,r,i){return Object.assign(Object.assign(Object.assign({isp_info:"$ip_isp_info",geo_info:"$ip_geo_info"},r),n),{aggregations:Object.assign({PageviewEngagement:Object.assign({engaged_time:t},{completion:e})},l.ED?{SegmentEntry:Array.from(i.segmentEntryQueryCodes),SegmentExit:Array.from(i.segmentExitQueryCodes),CohortEntry:Array.from(i.cohortEntryQueryCodes),CohortExit:Array.from(i.cohortExitQueryCodes)}:{})})}var y=n(3992);const w=["mousemove","click","scroll"],k=["email","tel","submit","reset","button","file","password","radio","checkbox"],E=["email","e-mail","password","tel","telephone","phone","name_first","name_last","sa_zip"],S=t=>{(0,f.Hn)("web")("auto_init",!1)&&t.q.push({functionName:"addon",arguments:["web",{auto_init:!0}]})};class I{constructor(t){this.dirtyState=!1,this.cancelEngagementTimer=()=>{},this.totalCompletion=0,this.totalEngagedTime=0,this.cancelPageviewCompleteTimer=()=>{},this.hasPageviewCompleteFired=!1,this.cleanupPageEngagementDetection=s.Q1,this.permutive=t.permutive,this.options=t,this.api=t.api,this.clientContext=t.clientContext,this.logger=t.logger,this.unprocessedPVC=t.unprocessedEvents.PageviewComplete,this.options.customProperties.overrideCustomProps(t.page||{});this.pageEngagementDetected=(()=>{this.dirtyState=!0,l.Uy&&this.resetTimeout()}).bind(this),_(m(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.permutive,this.options.messages),this.enablePageEngagementDetection(),"loading"!==document.readyState?this.attachListeners():window.addEventListener("DOMContentLoaded",this.attachListeners.bind(this),!1),l.t2&&(this.cancelEngagementTimer=this.registerEngagementInterval(this.getEventInterval())),l.Uy&&(this.setPageviewCompleteTimeout(l.MU),(0,h.aT)((()=>{this.hasPageviewCompleteFired||v(this.totalEngagedTime,this.totalCompletion,m(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.options.queryManager,this.permutive)})))}sendFormSubmissionEvent(t){{const e=t.currentTarget,n={form:Object.assign(Object.assign(Object.assign({method:e.method||"GET",properties:this.serializeForm(e)},"string"==typeof e.id?{id:e.id}:{}),e.name&&"string"==typeof e.name?{name:e.name}:{}),e.action&&"string"==typeof e.action?{action:e.action}:{})};this.permutive.track("FormSubmission",n)}}trackEngagementInterval(t){return(0,r.mG)(this,void 0,void 0,(function*(){const e=this.updateState(t);!function(t,e,n,r,i,o){const s=Object.assign(Object.assign({isp_info:"$ip_isp_info",geo_info:"$ip_geo_info",engaged_time:t,total_engaged_time:e},i),{completion:n,total_completion:r});o.track("PageviewEngagement",s)}(e.engaged_time,e.total_engaged_time,e.completion,e.total_completion,this.options.customProperties.getCustomProps(),this.permutive),this.hasPageviewCompleteFired||(yield function(t,e,n,r,i,o,s,a,u){const c=b(t,e,s,a,u);return i.then((t=>{const e={props:c,sessionId:n,viewId:r,client:t};o.put(e)}))}(this.totalEngagedTime,this.totalCompletion,this.options.sessionManager.getSessionId(),this.options.viewId.get(),this.clientContext.getClient(),this.unprocessedPVC,m(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.options.queryManager))}))}reset(t){var e,n;return(0,r.mG)(this,void 0,void 0,(function*(){if(this.disablePageEngagementDetection(),l.Uy){const t=yield this.unprocessedPVC.getIfPresent();this.hasPageviewCompleteFired=!1,yield v(this.totalEngagedTime,this.totalCompletion,m(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.options.queryManager,this.permutive,!1,t)}this.dirtyState=!1;const r=this.updateWebOptions(t);this.options.state.viewId.generateAndSet(null===(e=r.context)||void 0===e?void 0:e.view_id),this.totalCompletion=0,this.totalEngagedTime=0,this.options.customProperties.overrideCustomProps(this.options.page||{}),this.enablePageEngagementDetection();const i={logger:this.logger,config:Object.assign(Object.assign({},this.options.config),{watson:null!==(n=this.options.watson)&&void 0!==n?n:this.options.config.watson}),clientContext:this.clientContext,api:this.api,permutiveData:this.options.permutiveData,metrics:this.options.metrics,sessionManager:this.options.sessionManager,enrichers:this.options.enrichers,network:this.options.network,externalData:this.options.externalData};(0,d.H)(i)().then((()=>{_(m(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.permutive,this.options.messages),l.t2&&(this.cancelEngagementTimer(),this.cancelEngagementTimer=this.registerEngagementInterval(this.getEventInterval()))}))}))}serializeForm(t){return[...t.getElementsByTagName("input")].filter((t=>!(!t.type||!t.id||t.disabled||t.checked||"fieldset"===t.nodeName.toLowerCase()||-1!==k.indexOf(t.type.toLowerCase())||-1!==E.indexOf(t.name.toLowerCase())))).map((t=>({name:t.name||t.id,value:t.value}))).filter((t=>t.value.length<120))}registerEngagementInterval(t){return(0,y.UM)((()=>{this.dirtyState&&this.trackEngagementInterval(t)}),1e3*t)}attachListeners(){const t=t=>"a"===t.tagName.toLowerCase(),e=t=>t instanceof Element,n=e=>t(e)?(0,u.G)(e):e.parentElement?t(e.parentElement)?(0,u.G)(e.parentElement):n(e.parentElement):u.YP;l.eV&&[].slice.call(document.getElementsByTagName("form"),0).forEach((t=>t.addEventListener("submit",(0,s.ls)(u.DT(this.canTrackPermutiveEvent("FormSubmission")),u.UI((0,h.Z_)(this.options.api,this.options.userId,this.sendFormSubmissionEvent.bind(this)))))));(0,f.MU)("track_link_click",!0)&&document.body.addEventListener("click",(0,s.ls)(u.DT(this.canTrackPermutiveEvent("LinkClick")),u.UI((t=>({event:t,anchor:(0,s.zG)(t.target,u.ij,u.tS(u.DT(e)),u.tS(n))}))),u.DZ((t=>{let{event:e,anchor:n}=t;return u.pC(n)?u.G({event:e,anchor:n.value}):u.YP})),u.UI((t=>{let{event:e,anchor:n}=t;return P(this.permutive,n,(r=e,!("_blank"===n.target||r.metaKey||r.ctrlKey||r.shiftKey||2===r.which||3===r.which)));var r}))),{capture:!0})}updateState(t){const e=Math.max(this.totalCompletion,this.getCurrentCompletion()),n=e-this.totalCompletion;return this.totalEngagedTime+=t,this.totalCompletion=e,this.dirtyState=!1,{engaged_time:t,total_engaged_time:this.totalEngagedTime,completion:n,total_completion:this.totalCompletion}}getCurrentCompletion(){if("function"==typeof this.options.getPageCompletion)return(0,s.zG)((0,o.Y3)((0,s.ls)(this.options.getPageCompletion,Number,(t=>isNaN(t)?0:t),(0,c.uZ)(a.Df)(0,1)),i.w),(0,o.EQ)((t=>(this.logger.warn("Web: invoking getPageCompletion threw an error. Got",t),0)),(t=>(this.logger.debug("Web: invoking getPageCompletion returned",t),t))));return(()=>{const t=document.documentElement.scrollHeight,e=window.pageYOffset+window.innerHeight;return e<=0?0:e>=t?1:e/t})()}setPageviewCompleteTimeout(t){return(0,y.HJ)((()=>{this.hasPageviewCompleteFired||(v(this.totalEngagedTime,this.totalCompletion,m(this.clientContext.getContext().isArticle),this.options.customProperties.getCustomProps(),this.options.queryManager,this.permutive,!1),this.hasPageviewCompleteFired=!0)}),t)}resetTimeout(){this.cancelPageviewCompleteTimer(),this.cancelPageviewCompleteTimer=this.setPageviewCompleteTimeout(l.MU)}registerPageEngagementCleanup(t){"function"==typeof t?this.cleanupPageEngagementDetection=()=>(0,o.Y3)((()=>{t(),this.cleanupPageEngagementDetection=s.Q1}),(t=>this.logger.warn("Page detection cleanup threw an error",(0,i.w)(t)))):this.logger.warn("No page detection cleanup was registered")}enablePageEngagementDetection(){this.options.addPageEngagementDetection&&(0,s.zG)(this.options.addPageEngagementDetection(this.pageEngagementDetected),(t=>this.registerPageEngagementCleanup(t))),this.setDirtyEventListenersTo(!0,this.getDirtyEvents())}disablePageEngagementDetection(){this.cleanupPageEngagementDetection(),this.setDirtyEventListenersTo(!1,this.getDirtyEvents())}setDirtyEventListenersTo(t,e){const n=t?window.addEventListener:window.removeEventListener;return e.forEach((t=>n(t,this.pageEngagementDetected))),null}getDirtyEvents(){return this.options.dirtyEvents||w}getEventInterval(){return this.options.eventInterval||5}canTrackPermutiveEvent(t){return e=>{var n,r;return(0,s.zG)(null===(r=null===(n=this.options)||void 0===n?void 0:n.filterPermutiveEvent)||void 0===r?void 0:r[t],u.DT((t=>"function"==typeof t)),u.tS((0,s.ls)((t=>o.Y3((()=>t(e)),(t=>new Error(`Threw an unexpected error: ${(0,i.w)(t)}`)))),o.tS(o.DT((t=>"boolean"==typeof t),(()=>new Error("Did not return a boolean")))),(0,h.bw)(o.Vn((e=>this.logger.error(`Filter predicate for "${t}" event failed`,e)))),u.Uo)),u.fS((()=>!0)))}}updateWebOptions(t){(0,h.Kn)(t)||(t={}),t.watson&&"object"==typeof t.watson&&"enabled"in t.watson&&"boolean"==typeof t.watson.enabled||delete t.watson,"object"==typeof t.filterPermutiveEvent&&null!==t.filterPermutiveEvent||delete t.filterPermutiveEvent,"context"in t&&!(0,h.Kn)(t.context)&&delete t.context;const e={addPageEngagementDetection:void 0,context:void 0,dirtyEvents:void 0,eventInterval:void 0,filterPermutiveEvent:void 0,getPageCompletion:void 0,page:void 0,watson:void 0};return this.options=Object.assign(Object.assign(Object.assign({},this.options),e),t)}}const P=(t,e,n)=>{if(window.location.href&&e.href){const r=0===e.href.indexOf("data:")?"NOT_URL":e.href;t.track("LinkClick",{dest_url:r},{useBeacon:n})}}},9078:(t,e,n)=>{n.d(e,{a:()=>r});class r{constructor(t){var e;this.messages=t,this.handlers={},this.messageQueue={};null===(e=window.addEventListener)||void 0===e||e.call(window,"message",(t=>{var e;"permutive"===(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.origin)&&this.handle(t)}),!1),this.messages.once("permutive:api:ready",(function(){var t;null===(t=window.postMessage)||void 0===t||t.call(window,{origin:"permutive",type:"sdk-init"},"*")}))}listen(t,e){if(t in this.handlers||(this.handlers[t]=[]),this.handlers[t].push(e),t in this.messageQueue){const e=this.messageQueue[t];if(void 0===e)return;for(let t=0;t{e(t)}));else{(null!==(e=(n=this.messageQueue)[r=t.data.type])&&void 0!==e?e:n[r]=[]).push(t)}}}},533:(t,e,n)=>{n.d(e,{o:()=>r,s:()=>i});class r extends Error{constructor(){super(r.defaultMessage),this.name=r.errorName}static get defaultMessage(){return"Network request failed"}}r.errorName="NetworkRequestFailedError";class i extends Error{constructor(){super(i.defaultMessage),this.name=i.errorName}static get defaultMessage(){return"Network request timed out"}}i.errorName="NetworkRequestTimeoutError"},7423:(t,e,n)=>{n.d(e,{F:()=>d});var r=n(7582),i=n(2688),o=n(3735),s=n(6567),a=n(3328),u=n(3030),c=n(533);class d{constructor(t,e,n,r,i){this.urls=t,this.config=e,this.network=n,this.metricsCollector=r,this.logger=i,this.prefix="[API]"}identify(t,e,n){const r=()=>this.reqWithMetrics(t,"sdk_http_identify_seconds",{url:this.urls.getEndpointUrl("/identify",s.G(this.config.apiVersion)),method:"POST",payload:{user_id:e.get(),aliases:n},contentType:"text/plain",dataType:"json",withCredentials:!0});return this.identifyPromise?this.identifyPromise=this.identifyPromise.then(r):this.identifyPromise=r()}metrics(t){return this.network.req({url:this.urls.getEndpointUrl("/internal/metrics",s.G(this.config.apiVersion)),method:"POST",payload:t,contentType:"text/plain",dataType:"text",withCredentials:!1})}metricsBeacon(t){return this.network.reqWithBeacon({url:this.urls.getEndpointUrl("/internal/metrics",s.G(this.config.apiVersion)),payload:t})}track(t,e,n){const r=this.getTrackUrl(e,{isFullyEnriched:n,useBeacon:!1});return this.reqWithMetrics(t,"sdk_http_events_seconds",{url:r,method:"POST",payload:e,contentType:"text/plain",dataType:"json",withCredentials:!1})}trackBatch(t,e){const n=this.getTrackUrl(e,{isFullyEnriched:!0,useBeacon:!1});return this.reqWithMetrics(t,"sdk_http_events_seconds",{url:n,method:"POST",payload:e,contentType:"text/plain",dataType:"json",withCredentials:!1})}trackBeacon(t,e){const n=this.getTrackUrl(t,{isFullyEnriched:e,useBeacon:!0});return this.network.reqWithBeacon({url:n,payload:t})}trackBatchBeacon(t){const e=this.getTrackUrl(t,{isFullyEnriched:!0,useBeacon:!0});return this.network.reqWithBeacon({url:e,payload:t})}reset(t){return this.reqWithMetrics(t,"sdk_http_reset_seconds",{url:this.urls.getEndpointUrl("/reset",s.G(this.config.apiVersion)),method:"POST",payload:null,contentType:"text/plain",dataType:"json",withCredentials:!0})}segmentSync(t){return this.network.req({url:`https://${this.config.segmentSyncApiHost}/sync/${t.key}`,method:"POST",payload:`value=${encodeURIComponent(t.value)}`,contentType:"application/x-www-form-urlencoded",dataType:"json",withCredentials:!0})}modelsBinary(t){return this.reqWithMetrics(t,"sdk_http_models_seconds",{url:this.getModelsUrl("binary"),method:"GET",contentType:"text/plain",dataType:"binary",withCredentials:!1})}modelsJson(t){return this.reqWithMetrics(t,"sdk_http_models_seconds",{url:this.getModelsUrl("json"),method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!1})}state(t,e,n,r,i,o){return this.reqWithMetrics(t,"sdk_http_reset_seconds",{url:this.urls.getEndpointUrl("/state",s.G("v1.0"),[["fetch_unseen",JSON.stringify(o)]]),method:"POST",payload:{group_id:e,event_source_id:n,state:JSON.stringify(r),last_seen_offset:i},contentType:"text/plain",dataType:"json",withCredentials:!1})}appnexus(t){return this.network.req({url:t,method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!0,timeout:2e3})}pxid(t){return this.network.req({url:this.urls.makeAuthenticatedUrl(t),method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!0,timeout:2e3})}queries(){const t={addons:{dfp:{activations:{dfp:[],dfp_legacy:{}},auto_init:!0,track_slot_rendered:!1,track_slot_viewable:!1,track_slot_clicked:!1,track_targeting_keys:!1,sync_segments_cookie:!1},web:{auto_init:!1,track_pageview_engagement:!0,track_pageview_complete:!0,track_form_submission:!1,track_link_click:!1,engagement_edge_only:!0,segment_transition_edge_only:!1}},queries:{queries:{},eventSegments:{},eventsLookup:[],literalsLookup:[],subexpressionsLookup:[],stateSyncReplays:[],propertiesLookup:[]},queries_metadata:{}},e=`${this.config.cdnBaseUrl.startsWith("dev.local:")?"http":"https"}://${this.config.cdnBaseUrl}/queries/8230918b-a7dd-44fb-a85a-7ff990c4d151-amp.json`;return this.network.req({url:e,withCredentials:!1,dataType:"json",method:"GET"}).catch((()=>t))}pxidReset(t){return this.network.req({url:this.urls.makeAuthenticatedUrl(t),method:"POST",payload:null,contentType:"text/plain",dataType:"json",withCredentials:!0})}uploadCohortMemberships(t,e){return this.reqWithMetrics(t,"sdk_http_upload_cohort_memberships_seconds",{url:this.urls.getCCSCohortMembershipEndpointUrl("/amp/cohorts",s.G("alpha"),[["i",e.user_id]]),method:"POST",payload:e,contentType:"text/plain",dataType:"json",withCredentials:!1})}reqWithMetrics(t,e,n){const r=t.startTimer(e,{});return this.network.req(n).then((n=>(0,o.zG)(t.stopTimer(e,r),(t=>n))))}reportError(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date;return(0,r.mG)(this,void 0,void 0,(function*(){const d=(0,i.w)(t);if(this.logError("Reporting error:\n",d),!this.config.sendClientErrors)return void this.logDebug("Send errors not enabled. Skipping");const l=t=>this.network.req({url:this.urls.getSdkErrorsUrl("/errors",s.G(this.config.sdkErrorsApiVersion)),method:"POST",payload:[t],contentType:"text/plain",dataType:"text",withCredentials:!1}),f=t=>{this.metricsCollector.trackCounter({name:"sdk_http_generic_network_request_fail_count_total",value:1,labels:{network_error_type:t}})};yield(0,o.zG)([c.o,c.s],a.Ew((t=>d.name===t.errorName||d.message.indexOf(t.errorName)>=0||d.message.indexOf(t.defaultMessage)>=0)),s.g_((()=>{const t=(()=>{var t,r,i,o,s,a,c,l;const f={error_message:null!==(r=null===(t=null==d?void 0:d.message)||void 0===t?void 0:t.toString())&&void 0!==r?r:"",stack_trace:null===(i=null==d?void 0:d.stack)||void 0===i?void 0:i.split("\n")},h=e?{user_id:e}:{};return Object.assign({platform:"web",sdk_version:"v19.120.0",ql_runtime_version:"v10.0.2",timestamp:n,domain:null!==(s=null===(o=null===window||void 0===window?void 0:window.location)||void 0===o?void 0:o.hostname)&&void 0!==s?s:"",url:(0,u.bk)(null===(a=null===window||void 0===window?void 0:window.location)||void 0===a?void 0:a.href),referrer:(0,u.bk)(null===document||void 0===document?void 0:document.referrer),user_agent:null!==(c=null===navigator||void 0===navigator?void 0:navigator.userAgent)&&void 0!==c?c:"",error_message:null!==(l=f.error_message)&&void 0!==l?l:String(d),stack_trace:f.stack_trace},h)})();return l(t).catch((0,o.ls)(i.w,(t=>this.logError(t))))}),(t=>(0,r.mG)(this,void 0,void 0,(function*(){return f(t.errorName)})))))}))}getTrackUrl(t,e){const{isFullyEnriched:n,useBeacon:r}=e,i=Array.isArray(t),o=!n;return this.urls.getEndpointUrl(i?"/batch/events":"/events",s.G(this.config.apiVersion),[["enrich",JSON.stringify(o)],["sdkp",JSON.stringify(!r)]])}getModelsUrl(t){const e=`https://${this.config.cdnBaseUrl}`;switch(t){case"binary":return`${e}/models/v2/8230918b-a7dd-44fb-a85a-7ff990c4d151-models.bin`;case"json":return`${e}/models/8230918b-a7dd-44fb-a85a-7ff990c4d151-models.json`}}logDebug(){for(var t=arguments.length,e=new Array(t),n=0;n{n.d(e,{E:()=>b});var r=n(365),i=n(3735),o=n(533),s=n(3992),a=n(6567),u=n(9384),c=function(t){return"Left"===t._tag},d=function(t){return"Right"===t._tag};function l(t){return{_tag:"Left",left:t}}function f(t){return{_tag:"Right",right:t}}function h(t,e){return{_tag:"Both",left:t,right:e}}var p=function(t,e,n){return function(r){switch(r._tag){case"Left":return t(r.left);case"Right":return e(r.right);case"Both":return n(r.left,r.right)}}},g=p;g(f,l,(function(t,e){return h(e,t)}));var m=f,_="These",v=(i.yR,i.yR,u.Xl,n(2652));class b{constructor(t){this.metrics=t}req(t){return this.reqImpl(t).then((t=>(0,i.MZ)(t)))}reqWithBeacon(t){let{url:e,payload:n}=t;const r=JSON.stringify(n),i=null===navigator||void 0===navigator?void 0:navigator.sendBeacon(e,r);return this.trackRequestMetrics({is_beacon:!0,is_error:!i,request:{method:"POST",url:e,content_length:r.length}}),i}reqImpl(t){const e="arraybuffer",{url:n,dataType:c,contentType:d,method:l,withCredentials:p,timeout:g}=t;return new Promise(((m,_)=>{const b=new XMLHttpRequest,y="POST"===t.method?"string"==typeof(w=t.payload)?w:JSON.stringify(w):null;var w;const k=t=>{var e;return this.trackRequestMetrics({is_beacon:!1,request:{method:l,url:n,content_length:null!==(e=null==y?void 0:y.length)&&void 0!==e?e:0},response:t})};b.onload=(0,s.GL)((()=>{var t,n,o;return(0,i.zG)(b.status,r.DT((t=>t<400),(()=>{const t="text"===b.responseType||""===b.responseType?b.responseText:"Couldn't access response text";return`Failed ajax request. Status code was ${b.status}. ${t}`})),r.tS((()=>"json"===c?b.responseText?r.Y3((()=>JSON.parse(b.responseText)),(t=>`Failed to parse response as JSON. Response was ${JSON.stringify(b.responseText)}. Got ${t}`)):r.F2(null):"text"===c?r.F2(b.responseText):r.F2(b.response))),(0,v.bw)((0,i.ls)(a.IS,(o={content_length:"text"===b.responseType||""===b.responseType?null!==(n=null===(t=b.responseText)||void 0===t?void 0:t.length)&&void 0!==n?n:0:b.responseType===e?b.response.byteLength:0,response_time_ms:self.performance.now()-E,status_code:b.status},function(t){return u.Wi(t)?f(o):h(t.value,o)}),k)),r.EQ(_,m))})),b.onerror=(0,s.GL)((()=>{k(r.t$("network error")),_(new o.o)})),b.ontimeout=(0,s.GL)((()=>{k(r.t$("timeout")),_(new o.s)})),b.open(l,n,!0),d&&b.setRequestHeader("content-type",d),b.timeout=g||b.timeout,b.withCredentials=p||b.withCredentials,b.responseType="binary"===c?e:b.responseType;const E=self.performance.now();b.send(y)}))}trackRequestMetrics(t){var e;if(!(null===(e=this.metrics)||void 0===e?void 0:e.isEnabled()))return;const n=new URL(t.request.url).pathname;if(n.includes("metrics"))return;const r=e=>this.metrics.track({name:"sdk_http_request_count_total",value:1,labels:Object.assign({request_method:t.request.method,request_path:n,request_content_length:t.request.content_length},e)});var o;!0===t.is_beacon?r({is_beacon:!0,is_error:t.is_error}):(0,i.zG)((o=t.response,c(o)?u.YP:(d(o),u.G(o.right))),a.aD((()=>({})),(t=>({response_content_length:t.content_length,response_status:t.status_code,response_time_ms:t.response_time_ms}))),(e=>Object.assign({is_beacon:!1,is_error:!d(t.response)},e)),r)}}},310:(t,e,n)=>{n.d(e,{s:()=>i});var r=n(6567);class i{constructor(t){this.config=t,this.PATH_JOINER_Q="?",this.PATH_JOINER_A="&"}getBaseUrl(){return`${this.config.apiProtocol}://${this.config.apiHost}`}getEndpointUrl(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("base",t,e,n)}getSdkErrorsUrl(t,e){return this.getUrl("sdk-errors",t,e,[])}getAdvertiserEndpointUrl(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("adv",t,e,n)}getClassificationModelsEndpointUrl(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("clm",t,e,n)}getAudienceMatchingEndpointUrl(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const i=`${t}/${n}/audiences`;return this.getUrl("audience-matching",i,e,r)}getCCSCohortMembershipEndpointUrl(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.getUrl("ccs",t,e,n)}makeAuthenticatedUrl(t){return this.makeUrlWithQueryParams(t,[["k",this.config.apiKey]])}getUrlPrefix(t){switch(t){case"base":return"";case"adv":return"/adv";case"sdk-errors":return"/sdk-errors";case"clm":return"/clm";case"audience-matching":return"/audience-matching";case"ccs":return"/ccs"}}getUrl(t,e,n,i){const o=this.getUrlPrefix(t),s=(0,r.g_)((()=>""),(t=>`/${t}`))(n),a=`${this.getBaseUrl()}${o}${s}${e}`;return this.makeUrlWithQueryParams(a,i.concat([["k",this.config.apiKey]]))}makeUrlWithQueryParams(t,e){const n=e.map((t=>{let[e,n]=t;return`${e}=${n}`})).join(this.PATH_JOINER_A),r=t.includes(this.PATH_JOINER_Q)?this.PATH_JOINER_A:this.PATH_JOINER_Q;return`${t}${r}${n}`}}},4076:(t,e,n)=>{n.r(e),n.d(e,{nextGenWeb:()=>gn,runNextGenFeaturesWeb:()=>pn});var r=n(7582),i=n(2116);class o{constructor(){this.events=[],this.listeners=[]}newEvent(t,e){this.events.push([t,e]),[...this.listeners].forEach((n=>{this.handle(t,e,n)}))}addListener(t){this.listeners.push(t);const e={replay:()=>(this.replay(t),e),remove:()=>(this.remove(t),e)};return e}handle(t,e,n){const r="string"==typeof n.name&&t.name===n.name,i=n.name.test&&n.name.test(t.name),o=r||i;if(o)try{n.callback(t,e)}catch(t){window.console&&window.console.error&&window.console.error("callback error: ",t)}o&&n.once&&this.remove(n)}replay(t){let e=-1!==this.listeners.indexOf(t);for(let n=0;n({id:t.id,name:t.name,time:new Date(t.time),properties:t.properties||{},session_id:t.session_id,view_id:t.view_id}),c=t=>({id:t.id,name:t.name,time:(f(t.time)?t.time:new Date).toISOString(),properties:t.properties||{},session_id:t.session_id,view_id:t.view_id}),d=(t,e)=>({id:t.id,time:new Date(t.time),name:e.name,properties:e.properties,session_id:e.session_id,view_id:e.view_id}),l=t=>void 0!==t.request_id,f=t=>isFinite(t)&&t instanceof Date;var h=n(4730);class p{constructor(t,e,n,r,i){this.eventHandler=t,this.api=e,this.metrics=n,this.userId=r,this.eventsCache=i,this.DEBOUNCE_TIME=500,this.MAX_DEBOUNCE_TIME=5e3,this.batch={requestData:[],requestOptions:[],processingStrategies:[]},this.scheduler=new h.b(this.DEBOUNCE_TIME,this.MAX_DEBOUNCE_TIME),this.debouncedFlushIfNotEmpty=this.scheduler.schedule(this.flush.bind(this)),this.scheduler.scheduleForPageUnload((()=>this.flushWithBeacon.bind(this)(this.batch)))}add(t,e,n){return this.batch.requestData.push(t),this.batch.requestOptions.push(e),this.batch.processingStrategies.push(n),this.debouncedFlushIfNotEmpty(this.batch),Promise.resolve()}flush(t){return this.flushIfNotEmpty(t,!1)}flushWithBeacon(t){return this.flushIfNotEmpty(t,!0)}flushIfNotEmpty(t,e){const{requestData:n,requestOptions:i,processingStrategies:o}=t,u=t=>e=>(t.forEach((t=>{this.metrics.trackCounter({name:"sdk_event_upload_fail_count_total",value:1,labels:{event_name:t.name}})})),this.api.reportError(`Error sending events batch. Got ${(0,s.w)(e)}`,this.userId.get())),c=e?t=>(0,r.mG)(this,void 0,void 0,(function*(){const e=this.api.trackBatchBeacon(t);t.forEach((t=>{e?this.metrics.trackCounter({name:"sdk_event_beacon_success_count_total",value:1,labels:{event_name:t.name}}):this.metrics.trackCounter({name:"sdk_event_beacon_fail_count_total",value:1,labels:{event_name:t.name}})}))})):t=>this.api.trackBatch(this.metrics,t);return n.length>0?(0,a.zG)(this.resetBatch(),(t=>this.trackMetrics(n)),(t=>c(n).then((t=>this.isBatchResponse(t)?this.onBatchResponseSuccess(t,n,i,o):(0,a.Q1)())).catch(u(n)))):Promise.resolve()}onBatchResponseSuccess(t,e,n,r){const i=(t,e)=>{"never"!==e&&(this.eventHandler.newEvent(c(t),null),this.eventsCache.add(t,{persistOnDisk:!0}))},o=(t,e,n,r)=>{this.metrics.trackCounter({name:"sdk_event_upload_success_count_total",value:1,labels:{event_name:e.name}});const o=d(t,e);return r&&r(o),i(o,n)},s=(t,e,n)=>{this.metrics.trackCounter({name:"sdk_event_upload_fail_count_total",value:1,labels:{event_name:e.name}});const r={name:e.name,session_id:e.session_id,view_id:e.view_id,properties:e.properties,time:(new Date).toISOString()};n&&n(t.error.message),console.error(t),this.eventHandler.newEvent(r,t)};return t.forEach(((t,i)=>{let{body:a}=t;const u=e[i],c=n[i],d=r[i];return l(a)?s(a,u,c.error):o(a,u,d,c.success)}))}resetBatch(){this.batch={requestData:[],requestOptions:[],processingStrategies:[]}}trackMetrics(t){this.metrics.track({name:"sdk_events_batch_size_total",value:t.length,labels:{}}),this.metrics.track({name:"sdk_events_batch_size_bytes",value:2*JSON.stringify(t).length,labels:{}})}isBatchResponse(t){return!!t}}var g=n(6567),m=n(5151),_=n(1828),v=n(922),b=n(3328),y=n(2553),w=n(1124),k=(n(7341),n(9384)),E=function(t,e){return function(){return e(t())}},S=a.a9,I=(a.yR,a.yR,k.F4,k.Xl,n(2652));const P=(t,e,n)=>n?"deferred":D(t.name,e),D=(t,e)=>R.has(t)?"memoryOnly":j.has(t)?"never":e?"immediate":"response",O=t=>{let{event:e,requestData:n,requestOptions:r,queryManager:i,eventsBatch:o,stateSync:s,metrics:u,logger:c,segments:d,cohorts:l}=t;return(0,a.zG)((()=>new Promise((t=>G(e,u,i,c,(e=>{const n=(0,a.zG)(m.of(d.current),m.mU((()=>()=>e)),m.tS(y.S9(1e3)),m.UI(g.fS((()=>w.i5(d)))))(),r=(0,a.zG)(l.current,m.uU((t=>(0,a.zG)(m.of(t.current),m.mU((()=>()=>n)),m.tS(y.S9(1e3)),m.UI(g.fS((()=>w.i5(t))))))),m.UI(b.xH))();t(Promise.all([e,n,r]).then((t=>{let[e,n,r]=t;return{update:e,updatedSegments:n,updatedCohorts:r}})))}))()))),m.At((t=>{let{updatedCohorts:n,updatedSegments:r}=t;return()=>c.debug(`Batching ${e.name} with`,{segments:r,cohorts:n})})),m.Hr("requestData",(t=>{let{updatedSegments:e,updatedCohorts:r}=t;return Object.assign(Object.assign({},n),{segments:[...e],cohorts:[...r]})})),m.mU((t=>{let{update:[e],requestData:n}=t;return _.gz(m.Hi)((()=>o.add(n,r,"immediate")),(()=>s.sync(e)))})),m.UI((t=>t.requestData)))},M=t=>{let{event:e,metrics:n,queryManager:r,logger:i,eventHandler:o}=t;return(0,a.zG)(G(e,n,r,i),m.At((()=>()=>{"Reaction"===e.name&&z(o,e,g.YP)})),m.UI(a.Q1))},C=t=>{let{requestData:e,requestOptions:n,queryManager:r,eventsCache:i,eventHandler:o,api:s,metrics:u,logger:c}=t;return(0,a.zG)((()=>{const t=s.track(u,e,!1);return t.then((t=>!l(t)),(()=>!1)).then((t=>{t?u.trackCounter({name:"sdk_event_upload_success_count_total",value:1,labels:{event_name:e.name}}):u.trackCounter({name:"sdk_event_upload_fail_count_total",value:1,labels:{event_name:e.name}})})),t}),m.tS((t=>T(t,e,n,i,u,r,c))),m.UI((t=>z(o,t.event,t.error))))},U=t=>{let{event:e,isEventFullyEnriched:n,requestData:r,api:i,eventHandler:o,metrics:s}=t;return m.tD((()=>{(0,a.zG)(i.trackBeacon(r,n),(t=>{t?s.trackCounter({name:"sdk_event_beacon_success_count_total",value:1,labels:{event_name:r.name}}):s.trackCounter({name:"sdk_event_beacon_fail_count_total",value:1,labels:{event_name:r.name}})})),z(o,e,g.YP)}))},x=t=>{let{requestData:e,requestOptions:n,eventsBatch:r}=t;return()=>r.add(e,n,"never")},T=(t,e,n,r,i,o,s)=>l(t)?A(t,e,n):q(t,e,n,r,i,o,s),A=(t,e,n)=>{const r=new Date;return m.tD((()=>{const i={name:e.name,session_id:e.session_id,view_id:e.view_id,properties:e.properties,time:r};return"function"==typeof n.error&&n.error(t.error.message),{event:i,error:(0,g.G)(t)}}))},q=(t,e,n,r,i,o,s)=>(0,a.zG)(m.tD((()=>(t=>void 0!==t.properties)(t)?u(Object.assign(Object.assign({},t),{session_id:e.session_id,view_id:e.view_id})):d(t,e))),m.mU((t=>G(t,i,o,s))),m.At((t=>()=>{"function"==typeof n.success&&n.success(t)})),m.mU((t=>()=>r.add(t,{persistOnDisk:!0}))),m.UI((t=>({event:t,error:g.YP})))),G=(t,e,n,r,i)=>{const o=(0,a.zG)((()=>(0,a.bc)({},{segmentsEntered:new Set,segmentsExited:new Set,cohortsEntered:new Set,cohortsExited:new Set})),function(t){return function(e){return E(e,t)}}((0,I.bw)((t=>null==i?void 0:i(Promise.resolve(t))))),m.tD),s="sdk_events_querylanguage_seconds",u=(0,a.zG)(m.tD((()=>e.startTimer(s,{}))),m.YO("qlMetricKey"),m.ak("update",(()=>()=>{const e=n.process(t,!0)();return null==i||i(e),e})),m.UI((n=>{let{qlMetricKey:i,update:o}=n;return e.stopTimer(s,i),r.debug("[Processing]","Processing event",t,"caused the following update",o),o})));return B.has(t.name)?u:o},z=(t,e,n)=>{t.newEvent(c(e),(0,a.zG)(n,g.fS((()=>null))))},j=new Set(["ThirdPartySegments","SlotRendered","PrebidAuctions"]),R=new Set(["AdRequest","Reaction",...v.D0?["PageviewEngagement"]:[],...v.ED?["SegmentEntry","SegmentExit"]:[]]),L=new Set(["PageviewComplete"]),B=new Set(["!UpdateLookalikeModels","!UpdateThirdPartyData","LinkClick","Pageview","PageviewComplete","PageviewEngagement","PostEngagement","SlotClicked"]);function K(t,e,n){const{api:s,enrichers:u,logger:c,metrics:d,queryManager:l,stateSync:f,unprocessedPVC:h,userId:_}=t;return i.K4((()=>{const t=new o,i=new p(t,s,d,_,n);return{allEvents:()=>n.all(),getStateSizeInBytes:()=>n.getStateSizeInBytes(),on:(e,n)=>t.addListener({name:e,callback:n,once:!1}),once:(e,n)=>t.addListener({name:e,callback:n,once:!0}),reset:t=>n.reset(t),track:o=>{var{client:p,event:_,useBeacon:v}=o,y=(0,r._T)(o,["client","event","useBeacon"]);const{output:k,isFullyEnriched:E}=u.enrich(_.properties,R.has(_.name)),S=Object.assign(Object.assign({},k),{client:p});d.trackCounter({name:E?"sdk_event_enrichment_success_count":"sdk_event_enrichment_fail_count",value:1,labels:{}});const I={user_id:e.userId.current,name:_.name,cohorts:(0,a.zG)(e.cohorts.current,b.tS(w.i5)),segments:w.i5(e.segments),properties:S,session_id:_.session_id,view_id:_.view_id},D=Object.assign(Object.assign({},_),{properties:S});return(0,a.zG)(((t,e)=>(0,a.zG)(P(t.event,t.isEventFullyEnriched,e),(e=>{switch(e){case"immediate":return O(t);case"memoryOnly":return M(t);case"response":return C(t);case"deferred":return U(t);case"never":return x(t)}}),m.UI((t=>t?g.G(t):g.YP)),m.mU((()=>L.has(t.event.name)?()=>t.unprocessedPVC.reset():m.of(void 0)))))(Object.assign(Object.assign({},y),{api:s,event:D,eventsBatch:i,eventsCache:n,eventHandler:t,isEventFullyEnriched:E,logger:c,metrics:d,queryManager:l,requestData:I,stateSync:f,unprocessedPVC:h,segments:e.segments,cohorts:e.cohorts}),v),m.UI(g.UI(e.trackRequestProcessor)),m.UI(a.Q1))()},__deprecated_eventsCache:n}}))}var $=n(3992);class W{constructor(){this.crypto=window.crypto||window.msCrypto,this.ALG_NAME="AES-GCM"}isAvailable(){var t;return!!(null===(t=this.crypto)||void 0===t?void 0:t.subtle)}generateKey(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,$.t_)(this.crypto.subtle.generateKey({name:this.ALG_NAME,length:256},t,["encrypt","decrypt"]))}encrypt(t,e){const[n,r]=this._encrypt(t,this.str2bytes(e));return n.then((t=>{const e=new Uint8Array(16+t.byteLength);return e.set(r,0),e.set(new Uint8Array(Uint32Array.of(t.byteLength).buffer),12),e.set(new Uint8Array(t),16),e.buffer}))}decrypt(t,e){const n=new Uint8Array(e,0,12),r=new Uint32Array(e,12,1)[0],i=e.slice(16,16+r);return this._decrypt(t,n,i).then(this.bytes2str)}_encrypt(t,e){const n=this.crypto.getRandomValues(new Uint8Array(12));return[(0,$.t_)(this.crypto.subtle.encrypt({name:this.ALG_NAME,iv:n},t,e)),n]}_decrypt(t,e,n){return(0,$.t_)(this.crypto.subtle.decrypt({name:this.ALG_NAME,iv:e},t,n))}str2bytes(t){return(new TextEncoder).encode(t).buffer}bytes2str(t){return(new TextDecoder).decode(t)}}var N=n(365),F=n(4767);var Y=n(7554);class Q extends Error{constructor(t){super(t),this.name="StoreClosingError"}}class H{constructor(t,e,r,i,o,s,a,u,c,d){this.version=3;{const l=n(2546);this.db=l.make(t,e,r,i,o,s,a,u,this.version,c,d)().then((0,N.fS)((t=>(0,Y.E)(e,c,d))))}}shouldThrowStoreClosingError(t){return"NotFoundError"===t.name||"InvalidStateError"===t.name}makeStoreClosingDuringOpertationError(t){return new Q(`Attempted ${t} when the current store is closing.`)}put(t,e){return(0,F.Y3)((()=>this.db.then((n=>n.put(t,e)))),(t=>{const e=(0,s.w)(t);return this.shouldThrowStoreClosingError(e)?this.makeStoreClosingDuringOpertationError("put"):e}))}get(t){return(0,F.Y3)((()=>this.db.then((e=>e.get(t))).then(g.ij)),(t=>{const e=(0,s.w)(t);return this.shouldThrowStoreClosingError(e)?this.makeStoreClosingDuringOpertationError("get"):e}))}delete(t){return(0,F.Y3)((()=>this.db.then((e=>e.delete(t)))),(t=>String(t)))}deleteStore(){return(0,F.Y3)((()=>this.db.then((t=>t.deleteStore()))),(t=>String(t)))}}const V="permutive-events-cache",J="permutive-events-for-page",X="[EVENTSCACHE]",Z=t=>"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name;class tt{constructor(t,e,n,r,i,o,s,u){this.config=t,this.namespace=e,this.logger=n,this.api=r,this.trace=i,this.metrics=o,this.userId=s,this.makeEventsStore=u,this.eventsCache=this.makeEventsRepository(V),this.eventsForPage=this.makeEventsRepository(J),this.debouncedReportError=(()=>new h.b(5e3,5e3).schedule((t=>this.api.reportError(t.errorMessage,t.userId))))(),this.eventStore=u(),this.eventsTTLInMilliseconds=(0,a.zG)((0,g.ij)(this.config.eventsTTLInDays),(0,g.tS)((t=>"number"==typeof t&&t>0?(0,g.G)(24*t*3600):g.YP))),this.eventsCache.events=(0,I.HP)((()=>(0,I.PQ)((0,a.zG)(m.tD((()=>this.trace.startSpan("load_event_cache"))),m.tS((t=>(0,a.zG)(this.loadFromDisk(),m.At((e=>()=>{t.finish(),this.logDebug(`Event cache loaded, #e ${e.length}`)}))))))))),this.readiness=this.eventsCache.events().then((()=>this.migratePreviousPagesEvents()))}migratePreviousPagesEvents(){return(0,r.mG)(this,void 0,void 0,(function*(){const t=this.trace.startSpan("migrate_previous_for_page_events"),e=(0,m.pE)((t=>(0,F.Y3)((()=>t.flush()),s.w)));return(0,a.zG)([this.eventsForPage,this.eventsCache],e,(0,m.UI)((e=>{const n=b.bj(e);return n.length>0&&this.api.reportError(`Migrate previous events failed. Got:\n${n.join("\n ")}`,this.userId.get()),t.finish()})),(t=>t()))}))}all(){return Promise.all([this.eventsCache.events(),this.eventsForPage.events()]).then(b.xH)}add(t,e){let{persistOnDisk:n}=e;return(0,r.mG)(this,void 0,void 0,(function*(){return this.logDebug("Adding to cache",t),this.eventsForPage.events=(0,a.zG)(this.eventsForPage.events,m.UI((e=>[...e,t])),I.HP),n&&this.readiness.then((()=>this.eventsForPage.flush())),t}))}filterEventsByWorkspace(t){return t}pruneEventsToSizeLimit(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.config.eventsCacheLimitBytes;if(n<=0||e<=n)return this.logDebug(`Event size of ${e} less than limit of ${n}`),{events:t,sizeInBytes:e};this.logDebug("Events before pruning",{count:t.length,sizeInBytes:e,byteLimit:n});let r=1,i=[...t];for(;e>n;)i.splice(0,r),r*=2,e=2*JSON.stringify(i).length;return this.logDebug("Events after pruning",{count:i.length,sizeInBytes:e}),{events:i,sizeInBytes:e}}loadFromDisk(){const t=()=>[],e=(0,a.zG)(this.eventsTTLInMilliseconds,g.EQ((()=>a.yR),(t=>b.hX((e=>t>Date.now()-e.time.getTime())))));return(0,a.zG)(m.tD((()=>(this.logLog("Loading event cache..."),this.metrics.startTimer("sdk_load_events_cache_task_duration_seconds",{})))),m.YO("loadEventsCacheTask"),m.ak("eventsFromDisk",(()=>(0,a.zG)(b.nI([this.eventStore.get(V),this.eventStore.get(J)]),b.UI(F.LV((0,I.lo)([[t=>t instanceof Q,(0,a.ls)(t,m.of)],e=>(0,a.zG)((()=>this.api.reportError(`Error fetching data from store. Got ${e}`,this.userId.get())),m.tS((()=>()=>this.reset("historical"))),m.UI(t))]),(0,a.ls)(g.fS(t),m.of))),b.vP(m.qA)))),m.At((t=>{let{eventsFromDisk:e,loadEventsCacheTask:n}=t;return()=>{this.logDebug("Read events from store:",e),this.metrics.stopTimer("sdk_load_events_cache_task_duration_seconds",n)}})),m.UI((0,a.ls)((0,I.vg)("eventsFromDisk"),b.xH,this.filterEventsByWorkspace,(t=>this.pruneEventsToSizeLimit(t,2*JSON.stringify(t).length)),(t=>(this.eventsCache.sizeInBytes=t.sizeInBytes,this.eventsCache.sizeInBytesLastSuccessfulWrite=t.sizeInBytes,t.events.length>0&&(this.metrics.track({name:"sdk_events_cache_byte_total",value:t.sizeInBytes,labels:{}}),this.metrics.track({name:"sdk_events_cache_size_total",value:t.events.length,labels:{}})),t.events)),b.UI(u),e)))}reset(t){return(0,r.mG)(this,void 0,void 0,(function*(){return(0,a.zG)(m.tD((()=>this.logDebug("Resetting Events Cache"))),m.tS((()=>this.eventStore.deleteStore())),F.Zl((()=>(this.eventStore=this.makeEventsStore(),"historical"===t?_.gz(F.Ij)(this.eventsCache.reset,this.eventsForPage.flush):_.gz(F.Ij)(this.eventsCache.reset,this.eventsForPage.reset)))),F.wE((()=>()=>this.all())),F.fS((()=>m.of(et()))),(t=>t()))}))}getStateSizeInBytes(){return this.eventsForPage.sizeInBytes+this.eventsCache.sizeInBytes}makeEventsRepository(t){const e=(()=>{let t=Promise.resolve(N.F2((0,a.Q1)()));return e=>t=t.then(e)})(),n=t=>(0,a.zG)(m.tD((()=>this.logDebug(`Writing ${t.length} events to ${h.key}`))),m.tS((()=>this.eventStore.put(t.map(c),h.key))),F.UI(a.Q1)),r=(0,a.zG)(m.tD((()=>this.logDebug(`Deleting events for ${h.key}`))),m.tS((()=>this.eventStore.delete(h.key))),F.Vn(s.w)),i=(0,a.ls)(m.of,m.At((t=>()=>this.logError(`Events cache failed to put ${h.key}. Got ${t}`))),m.tS((0,I.lo)([[t=>Z(t)&&h.retryAttempts<9,()=>(0,a.zG)(m.tD((()=>{h.retryAttempts+=1,this.logDebug(`Attempt #${h.retryAttempts} to write ${h.key} to EventsStore`)})),m.tS((()=>f)),m.tS((()=>u)))],[t=>Z(t),t=>(0,a.zG)(m.tD((()=>this.logDebug(`Attempted ${h.retryAttempts} rewrite attempts and reached limit of 9 max writes.`,"Reporting QuotaExceededError to API"))),m.tS((()=>()=>this.debouncedReportError({errorMessage:`Events cache failed to put ${h.key}. Got ${t}`,userId:this.userId.get()}))),m.tS((()=>F.t$(t))))],F.t$]))),o=t=>F.tD((()=>{this.logDebug(`Successfully wrote events for ${h.key} after ${h.retryAttempts} attempts`),h.retryAttempts=0,h.sizeInBytes=2*JSON.stringify(t).length,h.sizeInBytesLastSuccessfulWrite=h.sizeInBytes})),u=(0,a.zG)((()=>h.events()),m.tS((t=>(0,a.zG)(n(t),m.mU(N.EQ(i,(()=>o(t)))))))),d=(t,e)=>(0,a.zG)(t.events,m.UI((n=>{const r=2*JSON.stringify(n).length,i=this.pruneEventsToSizeLimit(n,r,e);return t.events=m.of(i.events),t.sizeInBytes=i.sizeInBytes,e-t.sizeInBytes}))),l=(t,e)=>{let[n,...r]=t;return n&&0!==e?(0,a.zG)(d(n,e),m.tS((t=>(this.logDebug(`${t} left after pruning ${n.key}`),l(r,t))))):m.of((0,a.Q1)())},f=(0,a.zG)(F.tD((()=>this.eventsForPage.sizeInBytes-this.eventsForPage.sizeInBytesLastSuccessfulWrite)),F.fX(N.DT((t=>t>0),(t=>new Error(`${this.eventsForPage.key} failed to write the same or smaller events cache of size ${t}`)))),F.tS((t=>{const e=1.2*t,n=[this.eventsCache,this.eventsForPage];return this.logDebug(`Pruning ${e} bytes from`,n),(0,a.zG)(l(n,e),F.fF)}))),h={key:t,events:m.of([]),sizeInBytes:0,sizeInBytesLastSuccessfulWrite:0,retryAttempts:0,flush:()=>(0,a.zG)(m.tD((()=>this.trace.startSpan(`write_${h.key}`))),m.tS((t=>(0,a.zG)(u,m.At((()=>()=>t.finish()))))),e),reset:()=>(0,a.zG)(m.tD((()=>{h.events=m.of([]),h.sizeInBytes=0,h.sizeInBytesLastSuccessfulWrite=0})),m.tS((()=>r)),e)};return h}logDebug(){for(var t=arguments.length,e=new Array(t),n=0;n[];class nt extends tt{constructor(t,e,n,r,i,o,s,a){super(t,e,n,r,i,o,s,(()=>new H(t,e,o,new W,"8230918b-a7dd-44fb-a85a-7ff990c4d151",`events_${s.get()}`,`keys_${s.get()}`,"events",n,a)))}}function rt(t,e){return K(t,e,new nt(t.config,t.namespace,t.logger,t.api,t.trace,t.metrics,t.userId,t.consentTracking))}var it=n(7826),ot=n(2851),st=n(9853);const at="_pnativo",ut=function(t){let{externalData:e}=t;return i.K4((()=>{e.removeExternalData(at)}))};var ct=n(7927),dt=n(6017);function lt(t,e){const n=ft(t.queryManager.segments),r=ft(t.queryManager.pageviewSegments),o=function(t){let{messages:e,queryManager:n}=t;const[r,i]=ot.Ue(g.YP);return e.on("permutive:segments:updated",(()=>{i(g.G(n.stateMap.value))})),e.on("permutive:reset",(()=>i(g.YP))),ot.UI(g.UI(ht),r)}(t);return t.queryManager.setLalRef(e.lookalikeModels),t.queryManager.setTpdRef(e.thirdPartyData),i.K4((()=>({cohorts:n,pageviewCohorts:r,tpdUsage:o})))}function ft(t){return(0,a.zG)(t,w.UI((0,a.ls)(b.uK((t=>t<1e7)),(t=>{let{left:e,right:n}=t;return{custom:n,standard:e}}))),(e=>({all:t,custom:(0,a.zG)(e,w.UI((t=>{let{custom:e}=t;return e}))),standard:(0,a.zG)(e,w.UI((t=>{let{standard:e}=t;return e})))})))}const ht=(0,a.ls)(ct.UI((t=>{var e;return null!==(e=t.activations)&&void 0!==e?e:{}})),ct.hX((0,a.zG)(Boolean,(0,dt.xD)((0,dt.ff)(ct.xb)))));var pt,gt,mt,_t,vt,bt=-1,yt=function(t){addEventListener("pageshow",(function(e){e.persisted&&(bt=e.timeStamp,t(e))}),!0)},wt=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},kt=function(){var t=wt();return t&&t.activationStart||0},Et=function(t,e){var n=wt(),r="navigate";return bt>=0?r="back-forward-cache":n&&(document.prerendering||kt()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},St=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},It=function(t,e,n,r){var i,o;return function(s){e.value>=0&&(s||r)&&((o=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=o,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,n),t(e))}},Pt=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Dt=function(t){var e=function(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)};addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)},Ot=function(t){var e=!1;return function(n){e||(t(n),e=!0)}},Mt=-1,Ct=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ut=function(t){"hidden"===document.visibilityState&&Mt>-1&&(Mt="visibilitychange"===t.type?t.timeStamp:0,Tt())},xt=function(){addEventListener("visibilitychange",Ut,!0),addEventListener("prerenderingchange",Ut,!0)},Tt=function(){removeEventListener("visibilitychange",Ut,!0),removeEventListener("prerenderingchange",Ut,!0)},At=function(){return Mt<0&&(Mt=Ct(),xt(),yt((function(){setTimeout((function(){Mt=Ct(),xt()}),0)}))),{get firstHiddenTime(){return Mt}}},qt=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},Gt=[1800,3e3],zt=[.1,.25],jt=function(t,e){e=e||{},function(t,e){e=e||{},qt((function(){var n,r=At(),i=Et("FCP"),o=St("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(o.disconnect(),t.startTimer.value&&(r.value=i,r.entries=o,n())},a=St("layout-shift",s);a&&(n=It(t,r,zt,e.reportAllChanges),Dt((function(){s(a.takeRecords()),n(!0)})),yt((function(){i=0,r=Et("CLS",0),n=It(t,r,zt,e.reportAllChanges),Pt((function(){return n()}))})),setTimeout(n,0))})))},Rt={passive:!0,capture:!0},Lt=new Date,Bt=function(t,e){pt||(pt=e,gt=t,mt=new Date,Wt(removeEventListener),Kt())},Kt=function(){if(gt>=0&>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){Bt(t,e),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Rt),removeEventListener("pointercancel",r,Rt)};addEventListener("pointerup",n,Rt),addEventListener("pointercancel",r,Rt)}(e,t):Bt(e,t)}},Wt=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,$t,Rt)}))},Nt=[100,300],Ft=0,Yt=1/0,Qt=0,Ht=function(t){t.forEach((function(t){t.interactionId&&(Yt=Math.min(Yt,t.interactionId),Qt=Math.max(Qt,t.interactionId),Ft=Qt?(Qt-Yt)/7+1:0)}))},Vt=function(){return vt?Ft:performance.interactionCount||0},Jt=function(){"interactionCount"in performance||vt||(vt=St("event",Ht,{type:"event",buffered:!0,durationThreshold:0}))},Xt=[200,500],Zt=0,te=function(){return Vt()-Zt},ee=[],ne={},re=function(t){var e=ee[ee.length-1],n=ne[t.interactionId];if(n||ee.length<10||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};ne[r.id]=r,ee.push(r)}ee.sort((function(t,e){return e.latency-t.latency})),ee.splice(10).forEach((function(t){delete ne[t.id]}))}},ie=[2500,4e3],oe={};const se=function(t){let e=0;const n=n=>{if(0===e)return;const r=ae(n);r&&t.metrics.track({name:`sdk_web_vitals_${r.suffix}`,labels:{},value:r.value})},r=(0,I.HP)((()=>{jt(n),function(t,e){e=e||{},qt((function(){var n,r=At(),i=Et("LCP"),o=function(t){var e=t[t.length-1];e&&e.startTime0&&(r.value=0,r.entries=[]),n(!0)})),yt((function(){ee=[],Zt=Vt(),r=Et("INP"),n=It(t,r,Xt,e.reportAllChanges)})))}))}(n)}));return i.K4((n=>{let{onServiceStop:i}=n;e++,i((()=>{e--})),t.metrics.isEnabled()&&r()}))};const ae=t=>(t=>"CLS"===t.name)(t)?{value:t.value,suffix:`${t.name.toLowerCase()}_score`}:(t=>["INP","FID","LCP"].includes(t.name))(t)?{value:t.value/1e3,suffix:`${t.name.toLowerCase()}_seconds`}:void 0;var ue=n(926),ce=n(4923),de=n(4307),le=n(1517),fe=n(4870),he=n(3918);const pe=t=>{if(!t.metrics.isEnabled)return()=>{};const e=(0,a.zG)(t.adServers,b.UI((t=>(0,a.bc)(t.id,t))),ce.sq,ce.UI((e=>{const n=(0,a.zG)(t.cohortTypes,ot.UI(ce.DZ((t=>t.byAdServer(e)))),ot.VS((t=>ot.vP(t))),ot.UI(ce.UI(he.S9(5e3,"Timeout"))),ot.UI((0,_.Yt)(m.Hi)),ot.UI(m.UI((0,a.ls)(ce.oh,fe.Vn(ce.Su(((e,n)=>{t.logger.warn("[Targeting Metrics]",`[${e}]`,n)}))),fe.F2))),(t=>()=>t.current));return(0,a.ls)(b.of,b.UI((t=>t.cohorts)),me,b.UI((t=>{let[e,n]=t;return{allCohorts:new Set(e),cohortCountByType:ge(e),requestCount:n}})),(r=>(0,a.zG)(n(),m.UI(ce.Su(((e,n)=>(r,i)=>{(0,a.zG)(n,b.Hr("actualCohortCount",(t=>{let{cohortCountByType:e}=t;return(0,a.zG)(e,ce.P5(r))})),b.UI((n=>{const o={cohort_type:r,target:e},s=i.reduce(((t,e)=>n.allCohorts.has(e)?t+1:t),0),u=i.length-s;t.metrics.track({name:"sdk_ad_request_missed_cohorts",labels:o,value:n.requestCount*u}),t.metrics.track({name:"sdk_ad_request_successful_cohorts",labels:o,value:n.requestCount*s}),(0,a.zG)(n.actualCohortCount,g.UI((e=>{const r=e-s;t.metrics.track({name:"sdk_ad_request_superfluous_cohorts",labels:o,value:n.requestCount*r})})))})))})(e.id,r))))),(t=>t()))})));return t=>{if("AdRequest"===t.name)(n=t.properties).ad_server_id in e&&e[n.ad_server_id](n);var n}},ge=t=>({ql:(0,a.zG)(t,b.u4(0,((t,e)=>isNaN(parseInt(e))?t:t+1)))}),me=t=>(0,a.zG)(t,b.pO((t=>{const{init:e,rest:n}=(0,a.zG)(t,b.zT((e=>e===t[0])));return[e,n]})),b.UI((t=>[t[0],t.length]))),_e=(t,e)=>((t,e,n)=>{const{activationManager:o,externalData:s,metrics:u,permutiveData:c,queryManager:d,stateSync:l,trace:f}=t;let h=[];return(0,a.zG)(lt(t,{lookalikeModels:e.lookalikeModels,thirdPartyData:(0,a.zG)(e.thirdPartyData,ot.UI(g.UI(ce.UI((t=>{const e={};for(const n of t)e[n]=!0;return e})))))}),i.YO("queryLanguage"),i.ak("webVitals",(()=>se(t))),i.ak("onTrackRequest",(()=>i.of((t=>{h=[...h,t]})))),i.ak("eventCollection",(r=>{let{queryLanguage:o}=r;const s=(0,a.zG)(o.cohorts.all,w.UI(b.UI(String)),le.rb),c=(0,a.zG)(e.nonQlCohortTypes,ot.UI((t=>Object.assign(Object.assign({},t),{query_language:s})))),d=pe({adServers:e.adServers,cohortTypes:c,metrics:u,logger:t.logger});return(0,a.zG)(n(t,{cohorts:(0,a.zG)(c,ot.UI((t=>Object.values(t))),ot.UI(b.UI((t=>t.all))),ot.UI(b.UI(de.Uj((()=>b.bM()))))),segments:o.cohorts.all,trackRequestProcessor:t=>h.forEach((e=>e(t))),userId:e.userId}),i.UI((0,I.rO)({track:t=>(0,a.ls)((0,I.bw)((t=>d(t.event))),t)})))})),i.ak("nativo",(t=>{let{queryLanguage:n}=t;return ut(Object.assign({activationManager:o,externalData:s,metrics:u,queryLanguageCohorts:w.Vh(n.cohorts.all)},e))})),i.ak("twitterPixel",(t=>{let{queryLanguage:n}=t;return(0,ue.eJ)(Object.assign({activationManager:o,metrics:u,permutiveData:c,queryLanguageCohorts:w.Vh(n.cohorts.all)},e))})),i.ak("prebidJS",(()=>(0,it.dN)(t))),i.ak("reset",(t=>{let{eventCollection:e}=t;return i.of((t=>(0,r.mG)(void 0,void 0,void 0,(function*(){d.reset();const n=t.preserveEventsFromCurrentView?"historical":void 0,r=yield e.reset(n),i=f.startSpan("ss_reset_sync");t.downloadState?yield l.resetSync():l.reset(),yield d.bootstrap(r)(),i.finish()}))))})))})(t,e,rt);function ve(t){return"consentTracking"in t?t.consentTracking.consentRef:ot.a9(!0)}function be(t){let{messages:e}=t;const[n,r]=ot.Ue(new Set);return e.on("permutive:addon:preinit",(t=>r(new Set([...n.current,t])))),n}function ye(t){let{messages:e,realtime:n}=t;var r;const[i,o]=ot.Ue(null!==(r=n.isRealtime())&&void 0!==r&&r);return e.on("permutive:realtime",(()=>o(!0))),i}function we(){const t=()=>Math.floor(Date.now()/1e3),[e,n]=ot.Ue(t());return(0,$.UM)((()=>n(t())),1e3),e}function ke(t,e){const n=function(t){const{activationManager:e,api:n,clientContext:r,config:i,enrichers:o,externalData:s,logger:a,messages:u,metrics:c,permutiveData:d,namespace:l,network:f,queryManager:h,stateSync:p,trace:g,track:m,unprocessedPVC:_,urls:v,userId:b}=t,y="consentTracking"in t?t.consentTracking:{consentRef:ot.a9(!0),listenForConsent:()=>0,isRevoked:()=>!1,isGiven:()=>!0};return{activationManager:e,api:n,clientContext:r,config:i,consentTracking:y,enrichers:o,externalData:s,logger:a,messages:u,metrics:c,permutiveData:d,namespace:l,permutiveApi:f,permutiveUrls:v,queryManager:h,reportError:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.reportError(t,null==e?void 0:e.userId,null==e?void 0:e.timestamp)},stateSync:p,trace:g,track:m,unprocessedPVC:_,userId:b}}(t),i=function(t){return{addonsLoaded:t.addonsLoaded,adServers:t.adServers,consent:ve(t),currentTimestampSecs:we(),enabledAddons:be(t),identities:t.identities,metricSampleRate:t.config.metricsSamplingPercentage/100,realtime:ye(t),sdkVariant:g.ij(t.sdkVariant),sessionId:ot.a9(t.sessionManager.getSessionId()),userId:t.userId.ref,viewId:t.viewId.ref}}(t);return function(t,e,n){const i=5e3;return(0,a.zG)(t,(o=i,t=>e=>{var{onServiceStop:n}=e,i=(0,r._T)(e,["onServiceStop"]);let s=[];const{value:a,state:u}=t(Object.assign(Object.assign({},i),{onServiceStop:t=>s.push(t)})),[c,d]=ot.Ue(u.current),l=()=>d(u.current),f=(0,$.UM)(l,o);let h=!1;return(0,I.aT)((()=>!h&&l()),navigator.userAgent),n((()=>{h=!0,s.forEach((t=>t())),l(),f()})),{value:a,state:c}}),Ee,function(t){return e=>(0,a.ls)((0,I.rO)({previousState:e=>t.current?e:void 0}),e,(0,I.rO)({state:(0,a.ls)((e=>ot.vP(t,e)),ot.UI((t=>{let[e,n]=t;return e?n:void 0})))}))}(n),function(t){return e=>(0,a.ls)((0,I.rO)({previousState:()=>localStorage.getItem(t)}),e,(0,I.rO)({state:(0,I.bw)(ot.YP((e=>{switch(typeof e){case"string":localStorage.setItem(t,e);break;case"undefined":localStorage.removeItem(t);break;case"object":if(null===e){localStorage.removeItem(t);break}throw new Error("Permutive app raised an invalid state.");default:throw new Error("Permutive app raised an invalid state.")}})))}))}(e))({onServiceStop:a.Q1}).value;var o}(e(n,i),t.namespace.getNamespacedStorageKey("permutive-app"),i.consent)}function Ee(t){return(0,a.ls)((0,I.rO)({previousState:t=>{if("string"!=typeof t)return{};try{return JSON.parse(t)}catch(t){return{}}}}),t,(0,I.rO)({state:ot.UI(JSON.stringify)}))}var Se=n(115),Ie=n(7241),Pe=n(2197);const De="[Prebid Monitoring]",Oe=(t,e)=>{t.metrics.trackCounter({name:"sdk_prebid_monitoring_key_flag_count_total",labels:e,value:1})},Me=(t,e)=>{t.metrics.trackCounter({name:"sdk_prebid_monitoring_key_bidder_flag_count_total",labels:e,value:1})},Ce=function(t,e){const n=Ue(t);return i.K4((()=>(0,a.zG)(e,ot.UI((0,a.ls)(g.DT((t=>t.consent)),g.UI((t=>t.prebidJS)))),ot.D8(g.Eh((0,I.Or)())),ot.bw((0,a.ls)(g.tS((t=>t.completedChecks?t.mainPair:g.YP)),g.UI((e=>Oe(t,{flag:"prebid_main_key",prebid_key:e.windowPropertyKey}))))),ot.UI(g.UI((t=>(0,a.zG)(t.mainPair,g.UI((e=>[e,...t.otherPairs])),g.fS((()=>t.otherPairs)))))),ot.g_(new Set,((e,r)=>(0,a.zG)(r,g.UI(b.hX((t=>!e.has(t.windowPropertyKey)))),g.hX(b.Od),(0,I.bw)(g.EQ((()=>t.logger.debug(De,"Nothing to report")),(e=>t.logger.debug(De,"Reporting",e)))),g.fS((()=>[])),b.UI((e=>(0,a.zG)((e=>(0,a.zG)(N.Y3((function(){var n,r;const{pbjs:i,windowPropertyKey:o}=e;t.logger.log(De,`Reporting on "${o}"`,e);const s=xe(i);t.logger.debug(De,`Version ${i.version} parsed as`,s);const u=(0,it.zi)(i);t.logger.debug(De,"Read config",u);const c=(0,a.zG)(null!==(r=null===(n=u.realTimeData)||void 0===n?void 0:n.dataProviders)&&void 0!==r?r:[],b.Ew((t=>"permutive"===t.name)));return t.logger.debug(De,"Read data provider config",c),{pbjs:i,config:u,dataProviderConfig:c,installedModules:i.installedModules||[],version:s,windowPropertyKey:o}}),s.w),N.ak("bidders",(t=>n.acBidders(t))),N.ak("permutiveRTDProvider",(t=>n.permutiveRTDProvider(t))),N.ak("consent",(t=>n.consent(t))),N.ak("targeting",(t=>n.targeting(t)))))(e),N.Pd((n=>t.reportError(`[Prebid Monitoring] Failed to report pair "${e.windowPropertyKey}", ${n.message}`)),(()=>e.windowPropertyKey))))),b.hp,(t=>new Set([...e,...t]))))),(t=>({reportedKeys:t})))))};const Ue=t=>({acBidders:e=>N.Y3((()=>{(0,st.Hn)("prebid")("data_provider_config",{ac_bidders:[]});const n=[],r=(0,a.zG)(e.dataProviderConfig,g.UI((t=>{var e,n;return null!==(n=null===(e=null==t?void 0:t.params)||void 0===e?void 0:e.acBidders)&&void 0!==n?n:[]})),g.fS((()=>[]))),i=[...new Set([...n,...r])];return t.logger.debug(De,"Determined acBidders as",{acBidders:i,dynamicBidders:n,staticBidders:r}),i.forEach((n=>{Me(t,{flag:"prebid_ac_bidder",prebid_key:e.windowPropertyKey,prebid_bidder:n})})),{acBidders:i,dynamicBidders:n,readBidders:r}}),s.w),consent:e=>N.Y3((()=>{var n,r,i,o,s,a;const u=e.windowPropertyKey;e.config.consentManagement&&"object"==typeof e.config.consentManagement&&Oe(t,{prebid_key:u,flag:"prebid_has_consent_management"});const c=e.installedModules.includes("gdprEnforcement");c&&Oe(t,{prebid_key:u,flag:"prebid_gdpr_enforcement_module"});const d=(null===(a=null===(s=null===(o=null===(i=null===(r=null===(n=e.config)||void 0===n?void 0:n.consentManagement)||void 0===r?void 0:r.gdpr)||void 0===i?void 0:i.rules)||void 0===o?void 0:o.find((t=>"storage"===(null==t?void 0:t.purpose))))||void 0===s?void 0:s.vendorExceptions)||void 0===a?void 0:a.includes("permutive"))||!1;return d&&Oe(t,{prebid_key:u,flag:"prebid_storage_exception"}),{hasGDPREnforcementModule:c,addedAsStorageException:d}}),s.w),permutiveRTDProvider:e=>N.Y3((()=>{const n=e.installedModules.includes("permutiveRtdProvider");return n&&Oe(t,{prebid_key:e.windowPropertyKey,flag:"prebid_permutive_rtd"}),n}),s.w),targeting:e=>{const n=(0,a.ls)(b.UI((t=>[t,null])),ce.sq),r=(e,n)=>(0,a.zG)(e,(0,I.bw)((e=>t.logger.debug(De,`Processing ${e.length} bidder request(s)`,e))),b.hX((t=>n.hasOwnProperty(t.bidderCode)&&null===n[t.bidderCode])),Ie.vM((t=>t.bidderCode)),ce.DZ(b.f2((0,I.lo)([[t=>(t=>{var e,n,r;const i=null===(n=null===(e=null==t?void 0:t.user)||void 0===e?void 0:e.data)||void 0===n?void 0:n.find((t=>"permutive.com"===t.name));return!!(null===(r=null==i?void 0:i.segment)||void 0===r?void 0:r.length)})(t.ortb2),()=>g.G("ortb2")],[t=>{return e=t.params,["permutive","p_standard"].some((t=>{var n,r,i,o;return(null===(r=null===(n=null==e?void 0:e.visitor)||void 0===n?void 0:n[t])||void 0===r?void 0:r.length)||(null===(o=null===(i=null==e?void 0:e.keywords)||void 0===i?void 0:i[t])||void 0===o?void 0:o.length)}));var e},()=>g.G("params")],()=>g.YP]))),(0,I.bw)((e=>t.logger.debug(De,"Bidders targeting method's updated",e)))),i=i=>{t.logger.debug(De,"Bidders found with no targeting method",i);let o=n(i);const s=n=>(0,a.zG)(r([n],o),(0,I.bw)((t=>{o=Object.assign(Object.assign({},o),t)})),(0,I.bw)(ce.Su(((n,r)=>Me(t,{flag:`prebid_${r}_targeting_success`,prebid_key:e.windowPropertyKey,prebid_bidder:n})))),(0,I.bw)((()=>{Object.values(o).includes(null)||(t.logger.debug(De,`Cleaning up "bidRequested" listener for ${e.windowPropertyKey}`),e.pbjs.offEvent("bidRequested",s))})));e.pbjs.onEvent("bidRequested",s)};return N.Y3((()=>{const o=(0,a.zG)(e.pbjs.getEvents(),b.DZ((0,a.ls)(g.DT((t=>"bidRequested"===t.eventType)),g.UI((0,I.vg)("args")))));return(0,a.zG)(e.bidders.acBidders,g.DT(b.Od),g.EQ((()=>t.logger.debug(De,"No bidders for targeting")),(0,a.ls)(n,(t=>Object.assign(Object.assign({},t),r(o,t))),ce.uK(Pe.ff((t=>null===t))),fe.Pd((0,a.ls)(ce.XP,g.DT(b.Od),g.UI(i)),ce.Su(((n,r)=>Me(t,{prebid_bidder:n,prebid_key:e.windowPropertyKey,flag:`prebid_${r}_targeting_success`})))))))}),s.w)}}),xe=t=>{const[e,n,r]=t.version.split("-")[0].replace("v","").split(".").map((t=>parseInt(t)));return{major:e,minor:n,patch:r}};n(4673);const Te=i.K4((()=>{}));const Ae=(t,e)=>(0,a.zG)(Se.segmentationService(t,ot.vP({addonsLoaded:e.addonsLoaded,consent:e.consent,customCohorts:w.hM(e.customCohorts),demandPartnerCohorts:e.demandPartnerCohorts,initdAddons:e.initdAddons,realtime:e.realtime,sessionId:e.sessionId,standardCohorts:w.hM(e.standardCohorts),userId:e.userId,viewId:e.viewId})),i.YO("segmentation"),i.ak("ipIdentifier",(()=>Te)),i.ak("prebidMonitoring",(()=>Ce(t,ot.vP({consent:e.consent,prebidJS:e.prebidJS})))),i.UI((t=>({segments:t.segmentation}))));var qe=n(9557);const Ge=function(t,e){const n=(0,a.zG)(e.pbjs,ot.VS((0,a.ls)(g.tS(g.KQ((t=>{var e;return null===(e=t.getUserIdsAsync)||void 0===e?void 0:e.call(t).then((()=>{var e,n;return null!==(n=null===(e=t.getUserIdsAsEids)||void 0===e?void 0:e.call(t))&&void 0!==n?n:[]}))}))),g.UI(ot.p4),g.fS((()=>ot.a9(g.YP))))),ot.UI(g.tS(g.Uo)),ot.bw(g.mU((e=>(e.length>0?e.forEach((e=>{t.metrics.trackCounter({name:"sdk_prebid_alternative_identifiers_count_total",labels:{alternative_user_id_name:e.source},value:1})})):t.metrics.trackCounter({name:"sdk_prebid_alternative_identifiers_count_total",labels:{identifier:"NONE"},value:1}),g.YP))))),r=(0,a.zG)(e.pbjs,ot.UI(g.tS(g.KQ((t=>{var e;return null===(e=t.getUserIdsAsEids)||void 0===e?void 0:e.call(t)})))));return i.K4((()=>(0,a.zG)(ot.vP(n,r),ot.UI((t=>{let[e,n]=t;return(0,a.zG)(e,g.wp((()=>n)))})),ot.UI((0,a.ls)(g.UI(b.DZ((t=>{var e,n;return"string"==typeof(null===(n=null===(e=t.uids)||void 0===e?void 0:e[0])||void 0===n?void 0:n.id)?g.G((0,a.bc)(t.source,{id:t.uids[0].id})):g.YP}))),g.tS(Ie.c2),g.UI(ce.sq))),ot.bw((e=>{g.pC(e)&&t.logger.debug("[Prebid Identifiers]","Found identifiers",e.value)})))))};const ze=function(t){let{externalData:e}=t;return i.K4((()=>{e.removeExternalData(je)}))};const je="_pfws";var Re=n(167);n(3306);const Le=function(t,e){return i.of(g.YP)};const Be=(t,e,n,r)=>e+(n-e)*r/(Math.pow(2,t)-1),Ke=(t,e)=>{const n=(t,e)=>{const n=t.toString(16);return("0".repeat(e)+n).slice(Math.min(-e,-n.length))};return`${n(t.getUint32(e),8)}-${n(t.getUint16(e+4),4)}-${n(t.getUint16(e+6),4)}-${n(t.getUint16(e+8),4)}-${n(t.getUint32(e+10),8)}${n(t.getUint16(e+14),4)}`},$e=t=>{const e=[1,2],n=t.getInt8(0);if(1===n)return We(t);if(2===n)return Ne(t);{const r=(0,g.Y3)((()=>Ke(t,1))),i=(0,g.g_)((()=>"Couldn't decode model id"),(t=>`Model id was ${t}`))(r);throw new Error(`Decoding only supported for version(s): ${e}; Supplied version was ${n}; ${i}`)}},We=t=>Fe(t,1),Ne=t=>Fe(t,2),Fe=(t,e)=>{const n=Ke(t,1),r=((t,e)=>{switch(String.fromCharCode(t.getInt8(e))){case"1":return"1p";case"3":return"3p"}})(t,17),i=t.getInt8(18),o=t.getFloat32(19),s=t.getFloat32(23),[a,u]=((t,e,n,r,i,o)=>{const s={};let a=0;do{let n;1===o?(a=t.getUint16(e),n=t.getUint16(e+2),e+=4):(a=t.getUint32(e),n=t.getUint16(e+4),e+=6),s[0===a?"const":a]=n.toString(36)}while(0!==a);return[s,e]})(t,27,0,0,0,e);return[{version:e,id:n,data_preference:r,weights:a,precision:i,min:o,max:s},u]};var Ye=n(7758);class Qe{constructor(t,e,n,r,i){this.network=t,this.logger=e,this.api=n,this.metrics=r,this.permutiveData=i,this.MODELS_LAST_UPDATED_KEY="models_last_updated",this.MODELS_DATA_KEY="models_data",this.MODELS_SYNC_TIMEOUT_IN_SECONDS=86400;const o=r.startTimer("sdk_load_lookalike_models_task_duration_seconds",{}),s=(0,a.zG)(Ye.tD((()=>i.getData(this.MODELS_LAST_UPDATED_KEY))),Ye.hX((t=>!(!t||isNaN(t)||(new Date).getTime()>t+1e3*this.MODELS_SYNC_TIMEOUT_IN_SECONDS))),Ye.NG((()=>this.permutiveData.getData(this.MODELS_DATA_KEY)))),u=(0,a.zG)(this.fetchModels(),$.N1,m.At((t=>()=>{this.permutiveData.setData(this.MODELS_DATA_KEY,t),this.permutiveData.setData(this.MODELS_LAST_UPDATED_KEY,(new Date).getTime())}))),c=(0,a.zG)(s,$.N1,Ye.fS((()=>(0,$.N1)(u))),m.UI((t=>(t=>{const e=Object.keys(t);return e.length>0&&t[e[0]].hasOwnProperty("precision")})(t)?(t=>{const e={},n=Object.keys(t),r=t=>{const e={"1p":{}},{precision:n,min:r,max:i}=t,o=t["1p"],s=Object.keys(o);for(let t=0;t()=>{this.metrics.stopTimer("sdk_load_lookalike_models_task_duration_seconds",o)})));this.models=c()}getModels(){return this.models}extractModelsFromJsonArray(t){return e=>{const n={};for(let r=0;r{a["1p"][t]=s[t]})),n[o]=a}return n}}fetchModels(){return(0,a.zG)(F.Y3((()=>this.api.modelsBinary(this.metrics)),(t=>t.message)),$.N1,F.oU((t=>()=>function(t){const e=[];let n=0;for(;n{let{precision:e,max:n,min:r}=t;return{"1p":{},precision:e,min:r,max:n}}))),F.fS((t=>(this.logger.log("Failed fetching binary models, reverting to JSON.\nError: "+t),this.metrics.track({name:"sdk_binary_models_missing_count",value:1,labels:{}}),(0,a.zG)(F.Y3((()=>this.api.modelsJson(this.metrics)),(t=>t.message)),F.UI((t=>t.models)),F.UI(this.extractModelsFromJsonArray((()=>({"1p":{}})))),F.fS((t=>(this.api.reportError("Failed fetching json models.\nError: "+t),m.of({})))))))))}}const He=function(t){return i.K4((()=>{const e=new Qe(t.permutiveApi,t.logger,t.api,t.metrics,t.permutiveData);return(0,a.zG)(e.getModels(),ot.p4,ot.UI(g.tS(g.Uo)))}))};const Ve=(t,e)=>i.vP({classificationModels:Le(t,e)}),Je=t=>i.dQ((e=>{let{onServiceStop:n,previousState:r}=e;const i=function(t){if("object"!=typeof t||null===t)return{validityKey:"",inFlight:g.YP,lastSuccess:g.YP};return t}(r),o=(0,a.zG)(t,ot.BT(n),ot.UI((t=>"currentTimestampSecs"in t&&"freshness"in t&&"validity"in t?t:{currentTimestampSecs:0,validity:{key:t.validityKey,maxAge:Number.MAX_SAFE_INTEGER},freshness:{key:t.freshnessKey,maxAge:Number.MAX_SAFE_INTEGER},refresh:t.refresh})),ot.g_(ot.a9(i),((t,e)=>{const n=e.validity.key(),r=g.hX((t=>e.currentTimestampSecs-t.timestamp<=e.validity.maxAge)),i=(0,I.HP)(e.freshness.key),o=g.hX((t=>e.currentTimestampSecs-t.timestamp<=e.freshness.maxAge&&t.freshnessKey===i())),s=(0,a.zG)(t,ot.UI((0,a.ls)(g.DT((t=>t.validityKey===n)),g.EQ((()=>({validityKey:n,inFlight:g.YP,lastSuccess:g.YP})),(0,I.rO)({inFlight:r,lastSuccess:r})))),ot.D8(Xe));if((0,a.zG)(s.current,(t=>(0,a.zG)(t.inFlight,g.wp((()=>t.lastSuccess)),o,g.pC))))return s;const u=()=>({timestamp:e.currentTimestampSecs,freshnessKey:i(),output:g.YP});return(0,a.zG)(e.refresh(),g.EQ((()=>s),(0,a.ls)(ot.p4,ot.VS(g.EQ((()=>(0,a.zG)(s,ot.UI((t=>Object.assign(Object.assign({},t),{inFlight:g.G(u())}))))),N.EQ((t=>s),(t=>ot.a9({validityKey:n,inFlight:g.YP,lastSuccess:g.G(Object.assign(Object.assign({},u()),{output:g.G(t)}))}))))))))})),ot.xH,ot.D8(Xe));return{value:ot.UI((0,a.ls)((0,I.vg)("lastSuccess"),g.tS((0,I.vg)("output"))),o),state:ot.UI((t=>Object.assign(Object.assign({},t),{inFlight:g.YP})),o)}}));const Xe=(t,e)=>t.validityKey===e.validityKey&&t.inFlight===e.inFlight&&t.lastSuccess===e.lastSuccess,Ze=["pug"],tn=function(t,e){return(0,a.zG)(en(t),(0,Re.n)({backoffAfterErrorMs:6e5}),i.VS((t=>Je((0,a.zG)(e,ot.UI((0,I.rO)({tpdUsage:g.UI((0,a.ls)(ce.UI(ce.z7((t=>!Ze.includes(t)))),ce.hX((0,dt.ff)(ce.xb))))})),ot.UI((e=>{let{tpdUsage:n,userId:r}=e;return{validityKey:()=>r,freshnessKey:(0,a.ls)((()=>n),g.EQ((()=>0),(0,a.ls)(JSON.stringify,I.vp))),refresh:(0,a.ls)((()=>n),g.hX((t=>Object.keys(t).length>0)),g.tS((e=>t({user_id:r,time:new Date,tpd_segments:e}))))}})))))),i.UI(a.Q1))};const en=t=>e=>{const{config:n,metrics:r,permutiveApi:i,permutiveUrls:o}=t,s=r.startTimer("sdk_http_tpd_usage_seconds",{});return i.req({url:o.getEndpointUrl("/tpd/usage",g.G(n.apiVersion)),method:"POST",payload:e,contentType:"text/plain",dataType:"json",withCredentials:!1}).then((t=>(r.stopTimer("sdk_http_tpd_usage_seconds",s),t)))};function nn(t,e){const[n,r]=ot.Ue(0);let o=!1;const s=()=>{try{o=!0,r(n.current+1)}finally{o=!1}},u=["amp","gigya","pxid","sailthru"],c=(0,a.zG)(e.identities,ot.UI(ce.z7((t=>!u.includes(t)))));return(0,a.zG)(i.vP({fetchFromNewEndpoint:(0,a.zG)(rn(t),(0,Re.n)({backoffAfterErrorMs:6e5})),fetchFromLegacyEndpoint:(0,a.zG)(on(t),(0,Re.n)({backoffAfterErrorMs:6e5}))}),i.VS((r=>{let{fetchFromNewEndpoint:i,fetchFromLegacyEndpoint:s}=r;const u=e=>(0,a.zG)(i(e),g.UI((t=>t.catch((()=>(0,a.zG)(s(e.identities),g.fS((()=>t))))))),g.wp((()=>s(e.identities))),g.UI((0,I.bw)((e=>{const n=t.metrics.startTimer("sdk_get_third_party_data_task_duration_seconds",{});e.catch(a.Q1).then((()=>{t.metrics.stopTimer("sdk_get_third_party_data_task_duration_seconds",n)}))}))));return Je((0,a.zG)(ot.vP(n,e.userId,e.sessionId,c),ot.UI((t=>{let[e,n,r,i]=t;return{validityKey:()=>n,freshnessKey:()=>`${sn(i)},${r}`,refresh:()=>(0,a.zG)({userId:n,identities:i},g.DT((t=>{let{identities:e}=t;return o&&!ce.xb(e)})),g.tS(u))}}))))})),i.UI((t=>({refresh:s,data:t}))))}const rn=t=>e=>(0,r.mG)(void 0,void 0,void 0,(function*(){return(yield t.api.reqWithMetrics(t.metrics,"sdk_http_audience_matching_seconds",{url:t.permutiveUrls.getAudienceMatchingEndpointUrl("/id",g.G("v1"),e.userId),payload:{identities:(0,a.zG)(e.identities,ce.Yz,b.UI((t=>{let[e,n]=t;return{tag:e,id:n}})))},method:"POST",withCredentials:!1,dataType:"json"})).items})),on=t=>e=>t.api.reqWithMetrics(t.metrics,"sdk_http_tpd_seconds",{url:t.permutiveUrls.getEndpointUrl("/tpd",g.G(t.config.apiVersion)),method:"POST",payload:{user_id:e},contentType:"text/plain",dataType:"json",withCredentials:!1}),sn=(0,a.ls)(JSON.stringify,I.vp);const an=(t,e)=>(0,a.zG)(i.vP({data:nn(t,{identities:e.identities,sessionId:e.sessionId,userId:e.userId}),usageReporting:tn(t,ot.vP({tpdUsage:e.tpdUsage,userId:e.userId})),removeLegacyDataFromLocalStorage:i.dQ((e=>{let{previousState:n}=e;if(!n){const e=t.namespace.getNamespacedStorageKey("permutive-data-tpd");localStorage.removeItem(e)}return{value:null,state:ot.a9(!0)}}))}),i.ak("analytics",(n=>{let{data:{data:r}}=n;return function(t,e){return i.dQ((n=>{let{previousState:r}=n;var i;return{state:(0,a.zG)(ot.vP(e.userId,e.providerSegments),ot.g_(null!==(i=r)&&"object"==typeof i?i:{userId:"",providerHashes:{}},((e,n)=>{let[r,i]=n;const o=(0,a.zG)(i,g.fS((()=>({})))),s=(0,a.zG)(o,ce.UI((0,I.SL)(I.vp))),u=(0,a.zG)(e,g.DT((t=>t.userId===r)),g.UI((t=>t.providerHashes)),g.fS((()=>({}))));return(0,a.zG)(o,ce.z7((t=>s[t]!==(u[t]||0))),ce.Su(((e,n)=>{t("ThirdPartySegments",{data_provider:e,segments:[...n]})}))),{userId:r,providerHashes:s}}))),value:void 0}}))}(t.track,{providerSegments:r,userId:e.userId})})),i.UI((t=>{let{data:e}=t;return{data:e.data,refreshData:e.refresh}})));var un=n(5619);n(4564);const cn=function(t,e){return i.K4((()=>({addon:()=>({}),cohorts:g.YP})))};const dn=(t,e)=>i.vP({contextual:cn(t,e)});var ln=n(4467);const fn=t=>e=>(0,a.zG)(t,ce.UI((t=>e.reduce(((e,n)=>e+Number(t.has(n))),0))));ot.a9([]),ot.a9([]),ot.a9([]),ot.a9(un.b()),ot.a9(g.YP),ot.a9(g.YP);function hn(t,e,n){const{addonsLoaded:r,consent:o,currentTimestampSecs:s,enabledAddons:u,identities:c,realtime:d,sdkVariant:l,sessionId:f,userId:h,viewId:p}=e,[m,_]=ot.Ue({}),[v,y]=(0,a.zG)(ot.Ue(ot.a9(g.YP)),(t=>{let[e,n]=t;return[ot.xH(e),n]}));return(0,a.zG)(i.vP({lookalikeModels:He(t),metricContext:un.X({sampleRate:e.metricSampleRate,sdkVariant:l,sessionId:f,userId:h,viewId:p}),computeTimeMetrics:(k=t.metrics,i.K4((t=>{let{onServiceStop:e}=t;const n=(0,$.HJ)((()=>{(0,a.zG)((0,$.iE)(),(0,I.bw)((()=>(0,$.ho)(!1))),b.UI((t=>{let[e,n]=t;return(n-e)/1e3})),(t=>{k.track({name:"sdk_ui_thread_compute_first10s_total_seconds",value:t.reduce(((t,e)=>t+e),0),labels:{}}),k.track({name:"sdk_ui_thread_compute_first10s_total_task_overrun_seconds",value:(0,a.zG)(t,b.hX((t=>t>.05)),b.UI((t=>t-.05)),b.u4(0,((t,e)=>t+e))),labels:{}}),k.track({name:"sdk_ui_thread_compute_first10s_longest_task_seconds",value:Math.max(0,...t),labels:{}})}))}),1e4);e(n)}))),audiences:dn(t,e)}),i.ak("sdkql",(i=>{let{lookalikeModels:s}=i;return n(t,{addonsLoaded:r,adServers:e.adServers,consent:o,initdAddons:u,lookalikeModels:s,nonQlCohortTypes:m,thirdPartyData:v,userId:h,viewId:p})})),i.ak("strategicPartnerships",(e=>{let{sdkql:n}=e;return((t,e)=>i.vP({prebid_identifiers:Ge(t,e)}))(t,{pbjs:(0,a.zG)(n.prebidJS,ot.UI((t=>(0,a.zG)(t.mainPair,g.UI((t=>t.pbjs))))))})})),i.ak("demandPartners",(e=>{let{sdkql:{queryLanguage:n}}=e;return((t,e)=>i.vP({ssp:qe.sspService(t.externalData,t.permutiveApi,t.permutiveUrls,t.clientContext,e)}))(t,{consent:o,cohorts:de.UO(n.cohorts.all),viewId:p})})),i.ak("mediaAndEntertainment",(e=>{let{sdkql:{queryLanguage:n}}=e;return((t,e)=>(0,a.zG)(i.vP({freewheel:ze(Object.assign({activationManager:t.activationManager,externalData:t.externalData},e))}),i.UI((0,a.a9)({}))))(t,{addonsLoaded:r,consent:o,initdAddons:u,queryLanguageCohorts:w.Vh(n.cohorts.all)})})),i.ak("publishers",(e=>{let{sdkql:{queryLanguage:n}}=e;return((t,e)=>(0,a.zG)(i.vP({addressability:Ve(t,ot.vP({addonsLoaded:e.addonsLoaded,consent:e.consent,currentTimestampSecs:e.currentTimestampSecs,initdAddons:e.initdAddons,queryLanguageCohorts:w.hM(e.queryLanguageCohorts),realtime:e.realtime,userId:e.userId})),audienceMatching:an(t,{identities:e.identities,sessionId:e.sessionId,tpdUsage:e.tpdUsage,userId:e.userId})}),i.UI((t=>{let{addressability:e,audienceMatching:n}=t;return{classificationModels:e.classificationModels,refreshThirdPartyData:n.refreshData,thirdPartyData:n.data}}))))(t,{addonsLoaded:r,consent:o,currentTimestampSecs:s,identities:c,initdAddons:u,queryLanguageCohorts:n.pageviewCohorts.all,realtime:d,sessionId:f,tpdUsage:n.tpdUsage,userId:h})})),i.ak("advertisers",(e=>{let{demandPartners:n,sdkql:i}=e;return Ae(t,{addonsLoaded:r,consent:o,customCohorts:i.queryLanguage.pageviewCohorts.custom,demandPartnerCohorts:(0,a.zG)(n.ssp,g.UI((t=>t.all)),g.fS((()=>de.of(b.bM()))),de.Vh((()=>b.bM()))),initdAddons:u,prebidJS:i.prebidJS,realtime:d,sessionId:f,standardCohorts:i.queryLanguage.pageviewCohorts.standard,userId:h,viewId:p})})),i.bw((t=>{let{publishers:e}=t;return y(e.thirdPartyData)})),i.ak("nonQlCohortTypes",(t=>{let{advertisers:e,audiences:n,demandPartners:r,publishers:o}=t;return(0,a.zG)(i.of({advertiser:e.segments,classificationModel:o.classificationModels,contextual:n.contextual.cohorts,ssp:r.ssp}),i.UI(ce.oA),i.bw(_))})),i.ak("queryLanguageCohorts",(t=>{let{sdkql:e}=t;return i.of((0,a.zG)(e.queryLanguage.cohorts,ce.UI(w.Vh)))})),i.bw((e=>{let{nonQlCohortTypes:n,sdkql:r,queryLanguageCohorts:i}=e;const o=(t=>{if(!t.metrics.isEnabled())return t=>{};const e=(0,a.zG)(t.cohortsByType,ce.UI(ot.g_(new Set,((t,e)=>new Set([...t,...e])))),(t=>ot.vP(t)));return n=>{"Pageview"===n.name&&(0,$.HJ)((()=>(0,a.zG)(n.cohorts,fn(e.current),ce.Su(((e,n)=>t.metrics.track({name:"sdk_pageview_cohort_count",labels:{cohort_type:e},value:n}))))))}})({cohortsByType:(0,a.zG)(n,ce.UI(le.Vh),ce.dx("query_language",(0,a.zG)(i.all,ot.UI(b.UI(String))))),metrics:t.metrics});r.onTrackRequest(o)})),i.UI((t=>{let{audiences:e,metricContext:n,nonQlCohortTypes:r,publishers:i,queryLanguageCohorts:o,sdkql:s,strategicPartnerships:u}=t;return{addons:{contextual:e.contextual.addon},eventCollection:s.eventCollection,metricContext:n,nonQLCohorts:(0,a.zG)(Object.values(r),b.Lx(ln.WL)(le.e$),(t=>t.byAdServer),(t=>(0,a.ls)(t,g.UI(w.Vh),g.fS((()=>ot.a9(b.bM())))))),pbjsPair:ot.UI((t=>t.mainPair),s.prebidJS),prebidIdentifiers:u.prebid_identifiers,queryLanguageCohorts:o,refreshThirdPartyData:i.refreshThirdPartyData,resetQL:s.reset}})));var k}function pn(t){return ke(t,gn)}function gn(t,e){return hn(t,e,_e)}},2233:(t,e,n)=>{n.d(e,{iq:()=>l,B9:()=>p,ti:()=>m});var r=n(2688),i=n(787),o=n(365),s=n(6567),a=n(3735),u=n(2652);var c=n(3030);const d="__permutive.",l="__permutiveConfigQueryParams";const f={default:{windowKey:"permutive",environment:"default",apiHost:"api.permutive.com",apiKey:"",cdnBaseUrl:"cdn.permutive.com",pxidHost:"prmutv.co",apiVersion:"v2.0",sdkErrorsApiVersion:"v2",advertiserApiVersion:"v2",classificationModelsApiVersion:"v1",apiProtocol:"https",loggingEnabled:!1,tracingEnabled:!1,requestTimeout:5e3,cookieDomain:"."+(0,c._Y)(window.location.hostname),cookieName:"permutive-id",cookieExpiry:function(){const t=new Date;return t.setMonth(t.getMonth()+6),t.toUTCString()}(),eventsTTLInDays:null,permutiveDataMiscKey:"permutive-data-misc",permutiveDataModelsKey:"permutive-data-models",permutiveDataQueriesKey:"permutive-data-queries",permutiveDataEnrichersKey:"permutive-data-enrichers",stateNamespace:"",sendClientErrors:!0,metricsSamplingPercentage:20,eventsCacheLimitBytes:25e5,segmentSyncApiHost:"8230918b-a7dd-44fb-a85a-7ff990c4d151.partner.permutive.app",consentRequired:!1,sdkType:"stable",viewId:null,localStorageDebouncedKeys:["internal_query_states"],localStorageWriteDelay:1e3,localStorageWriteMaxDelay:1500,watson:{enabled:!0}},production:{},development:{apiProtocol:"http",loggingEnabled:!0,tracingEnabled:!0,sendClientErrors:!1}},h=t=>{const e={consentRequired:!0,loggingEnabled:!0,sendClientErrors:!0,tracingEnabled:!0},n={eventsTTLInDays:!0,eventsCacheLimitBytes:!0,metricsSamplingPercentage:!0,requestTimeout:!0,localStorageWriteDelay:!0,localStorageWriteMaxDelay:!0};return Object.keys(t).reduce(((r,i)=>{if(e.hasOwnProperty(i)){const e="true"===t[i];return Object.assign(Object.assign({},r),{[i]:e})}if(n.hasOwnProperty(i)){const e=Number(t[i]);return isNaN(e)?r:Object.assign(Object.assign({},r),{[i]:e})}return Object.assign(Object.assign({},r),{[i]:t[i]})}),{})},p=function(){let{getQueryParams:t=c.zM}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t=>Object.entries(t).reduce(((t,e)=>{let[n,r]=e;if(!(0===n.indexOf(d)))return t;const i=n.replace(d,"");return[...t,[i,r]]}),[]);return(0,a.zG)(o.Y3((()=>(0,a.zG)(t(),e,(t=>(0,u.m8)(...t)),h,(t=>g({queryConfig:t})))),(t=>`Failed to parse query params. Got ${(0,r.w)(t).message}`)))},g=t=>{let{queryConfig:e}=t;const n=(0,a.zG)(s.Y3((()=>window.sessionStorage.getItem(l))),s.tS(s.ij),s.tS((0,a.ls)(i.A,s.ij)),s.fS((()=>({}))));return(0,u.PM)(n,e)},m=(t,e)=>{var n;const r=null!==(n=t.environment&&f[t.environment])&&void 0!==n?n:{};return(0,u.PM)(f.default,r,t,e)}},4564:(t,e,n)=>{n.d(e,{NY:()=>m,vk:()=>h,qA:()=>f});var r=n(7582),i=n(2688),o=n(365),s=n(3735),a=n(4767),u=n(8259),c=n(1410),d=n(2851);var l=n(30);const f=()=>({opt_in:!0,token:c.L}),h=()=>({opt_in:!1,token:""}),p=t=>{return(0,s.ls)((e=t,t=>(0,s.zG)((0,l.J)(e.consentRequired,t),(t=>{let{consentData:n,isValid:r}=t;return e.consentDatabase.put(n,c.L),r}))),(t=>{let{logger:e,messages:n}=t;return t=>{const r=t?"given":"revoked";return e.log("Consent has been",r),n.emit(`permutive:consent:${r}`),t}})(t));var e},g=t=>(e,n)=>{t.on("permutive:consent:revoked",e),t.on("permutive:consent:given",n)},m=t=>(0,r.mG)(void 0,void 0,void 0,(function*(){const{logger:e,namespace:n,consentRequired:r,messages:f}=t,h=new u.oP(window.localStorage,n),m=(0,l.J)(r,yield h.get(c.L)),_=yield(0,s.zG)(a.Y3((()=>h.put(m.consentData,c.L)),(t=>new Error(`LocalStorage access is required. ${(0,i.w)(t).message}`))),(t=>t()));if(o.nM(_))return _;const{consentRef:v,giveConsent:b,revokeConsent:y,isRevoked:w,isGiven:k}=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const[e,n]=d.Ue(t),r=()=>!0===e.current;return{consentRef:e,revokeConsent:()=>(n(!1),e.current),giveConsent:()=>(n(!0),e.current),isRevoked:()=>!r(),isGiven:r}}(m.isValid),E={consentRef:v,isGiven:k,isRevoked:w,listenForConsent:g(f)};E.listenForConsent(y,b);const S=p({consentDatabase:h,consentRequired:r,logger:e,messages:f});return o.F2({consentTracking:E,consentValidation:S,consentDatabase:h})}))},1410:(t,e,n)=>{n.d(e,{L:()=>r});const r="permutive-consent"},7708:(t,e,n)=>{n.d(e,{D:()=>l});var r=n(1500),i=n(365),o=n(3735),s=n(6567),a=n(5151),u=n(4922),c=n(1410),d=n(30);const l=t=>{const{partialTagWithKey:e}=t,n=e.key;var l;window[n].consent=(l=t,(0,o.ls)(l.consentModule.consentValidation,s.DT(Boolean),s.UI((0,u.H)(l)),o.Q1));const f=(0,s.EQ)((()=>{return e={consentDatabase:t.consentModule.consentDatabase,consentRequired:t.tag.config.consentRequired},(0,o.zG)((0,o.a9)(e.consentDatabase.get(c.L)),(0,a.UI)((t=>(0,d.J)(e.consentRequired,t).isValid)));var e}),a.of);return(0,o.zG)((0,o.zG)((t=>{let{consentModule:e,tag:n}=t;const i=(0,r.Ew)((function(t){return"consent"===t.functionName}))(n.q);return(0,s.UI)((t=>e.consentValidation(t.arguments[0])))(i)})(t),f),(0,a.UI)((t=>t?(0,i.F2)(!0):(0,i.t$)("No consent to run on the page"))))}},4769:(t,e,n)=>{n.d(e,{v:()=>r});const r=(t,e,n)=>function(){const r=n()?e:t;return r(...arguments)}},30:(t,e,n)=>{n.d(e,{J:()=>s});var r=n(3735),i=n(6567),o=n(4564);const s=(t,e)=>(0,r.zG)((0,i.ij)(e),(e=>!1===t&&(0,i.Wi)(e)?{isValid:!0,consentData:(0,o.qA)()}:(t=>(0,i.pC)(t)&&(t=>null!==t&&"object"==typeof t)(t.value)&&(t=>{var e;return!0===t.opt_in&&"string"==typeof t.token&&(null===(e=t.token)||void 0===e?void 0:e.length)>0})(t.value))(e)?{isValid:!0,consentData:e.value}:{isValid:!1,consentData:(0,o.vk)()}))},3298:(t,e,n)=>{n.d(e,{S:()=>v});var r=n(3735),i=n(7582),o=n(6567),s=n(1500),a=n(2851),u=n(8612),c=n(2497),d=n(5165),l=n(3992);var f=n(2652);class h{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.wait_prev=e.wait_prev||!1,this.block_next=e.block_next||!1,this.started=!1,this.complete=!1,this.task=t}waits(){return this.wait_prev}blocks(){return this.block_next}execute(t){this.started=!0,this.task((()=>{this.complete=!0,t()}))}}var p=n(6315);class g{constructor(t,e,n,r,i,o,s,a,u,c,d,l,f,h,p,g,m,_,v,b,y,w,k,E,S,I,P,D){this.logger=t,this.api=e,this.activationManager=n,this.sessionManager=r,this.metrics=i,this.viewId=o,this.userId=s,this.network=a,this.enrichers=u,this.clientContext=c,this.unprocessedEvents=d,this.queryManager=l,this.taskQueue=f,this.identities=h,this.permutiveReset=p,this.messages=g,this.addons=m,this.trace=_,this.permutiveRealtime=v,this.state=b,this.customProperties=y,this.config=w,this.permutiveData=k,this.externalData=E,this.cookies=S,this.identitiesIngestor=I,this.global=P,this.nextGen=D,this.initialisedAddons=[],this.triggerListeners=[]}identify(t){const e="[Identify]";this.logger.debug(" identify",t);const n=(0,f.b2)(),a=this.identities.parseCustomerDefinedIdentities(t),c=Object.assign(Object.assign({},this.identities.getIdentitiesMap()),a.reduce(((t,e)=>{let{tag:n,id:r,priority:i,expiry:o}=e;return Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({id:r},void 0!==i?{priority:i}:{}),void 0!==o?{expiry:o}:{})})}),{})),d=(0,r.zG)(Object.values(c),s.DZ((t=>o.ij(t.id)))),l=this.identities.getPrioritizedIdentities(c);if("string"==typeof t&&(0,u.Bt)("8230918b-a7dd-44fb-a85a-7ff990c4d151","8230918b-a7dd-44fb-a85a-7ff990c4d151",d,window.location.hostname,this.userId.get()))return n.resolve(),n.promise;const g=()=>(0,i.mG)(this,void 0,void 0,(function*(){this.nextGen.refreshThirdPartyData()})),m=t=>(0,i.mG)(this,void 0,void 0,(function*(){yield(0,p.Yj)({clientContext:this.clientContext,global:this.global,identities:this.identities,logger:this.logger,nextGen:this.nextGen,reset:this.permutiveReset,userId:this.userId},t.user_id)}));return this.taskQueue.add(new h((t=>(0,i.mG)(this,void 0,void 0,(function*(){this.logger.debug(" identify",a);const r=()=>(0,i.mG)(this,void 0,void 0,(function*(){this.logger.log(e,"request identity");const t=yield this.api.identify(this.metrics,this.userId,l);this.userId.isEqual(t.user_id)?(this.metrics.track({name:"sdk_identity_remained_total",value:1,labels:{identify_reason:"identify_call"}}),yield g()):(this.metrics.track({name:"sdk_identity_changed_total",value:1,labels:{identify_reason:"identify_call"}}),yield m(t))}));this.identities.setIdentities(a).identifyRequestRequired()?yield r():this.logger.log(e,"skip request"),this.logger.debug(" identify",a),t(),n.resolve(),yield this.identitiesIngestor.ingestIfEligible(a).catch((t=>this.api.reportError(`Couldn't ingest identities, got ${t}`,this.userId.get())))}))),{wait_prev:!0,block_next:!0})),n.promise}on(t,e){return this.nextGen.eventCollection.on(t,e)}once(t,e){return this.nextGen.eventCollection.once(t,e)}track(){var t,e,n;const[r,i,o]=[arguments.length<=0?void 0:arguments[0],(arguments.length<=1?void 0:arguments[1])||{},(arguments.length<=2?void 0:arguments[2])||{}],s=this.trace.startSpan("track_event");this.logger.log(" track",r);const a=(0,f.b2)();this.metrics.trackCounter({name:"sdk_event_track_count_total",labels:{event_name:r},value:1}),a.promise.then((()=>this.metrics.trackCounter({name:"sdk_event_track_success_count_total",labels:{event_name:r},value:1})),(()=>this.metrics.trackCounter({name:"sdk_event_track_fail_count_total",labels:{event_name:r},value:1})));const u=null!==(t=o.unprocessedData)&&void 0!==t?t:{},c=null!==(e=u.sessionId)&&void 0!==e?e:this.sessionManager.getSessionId(),d=null!==(n=u.viewId)&&void 0!==n?n:this.viewId.get(),l={success:o.success||(t=>{}),error:o.error||((t,e)=>{})};return this.taskQueue.add(new h((t=>{this.logger.log(" track",r);return(u.client?Promise.resolve(u.client):this.clientContext.getClient()).then((e=>{var n;const u={name:r,properties:i,session_id:c,view_id:d,time:new Date};return this.nextGen.eventCollection.track({client:i.client?(0,f.PM)(e,i.client):e,event:u,requestOptions:l,useBeacon:null!==(n=o.useBeacon)&&void 0!==n&&n}).then((e=>{this.logger.log(" track",u.name),a.resolve(u),t(),s.finish()})).catch((t=>{var e;null===(e=l.error)||void 0===e||e.call(l,t),this.api.reportError(t,this.userId.get()),a.reject(t)}))}))}))),a.promise}trigger(t,e,n){const r=(0,f.b2)();this.logger.log(" trigger",t),this.triggerListeners=this.triggerListeners||[];return this.taskQueue.add(new h((e=>{this.logger.log(" trigger",t);const i=this.messages.on("permutive:query:changed",(function(e){e.queryCode===t&&(n(e.result),r.resolve(e.result))}));this.triggerListeners.push(i),this.logger.log(" trigger",t),e()}))),r.promise}query(){return Promise.resolve({result:!1})}segment(t,e){const n=(0,f.b2)();this.logger.log(" segment",t);return this.taskQueue.add(new h((r=>{var i;this.logger.log(" segment",t);const o=this.queryManager.stateMap.value[t];e((null===(i=null==o?void 0:o.result)||void 0===i?void 0:i.result)||!1),n.resolve(),this.logger.log(" segment",t),r()}))),n.promise}segments(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";const n=(0,f.b2)();this.logger.log(" segments");return this.taskQueue.add(new h((r=>{this.logger.log(" segments ("+e+")");const i=i=>{t(i),n.resolve(i),this.logger.log(" segments ("+e+")"),r()};"dfp"===e?this.messages.once("permutive:dfp:ready",(()=>{this.addons.dfp&&i([...this.addons.dfp.segments.liveSegments])})):i([...this.nextGen.queryLanguageCohorts.all.current])}))),n.promise}reset(){return Promise.all([this.api.reset(this.metrics),this.identities.reset(),this.permutiveReset.reset(),this.unprocessedEvents.PageviewComplete.reset(),this.nextGen.resetQL({downloadState:!1,preserveEventsFromCurrentView:!1})]).then((t=>{let[e]=t;this.userId.set(e.id)})).then((()=>{this.messages.emit("permutive:reset")})).catch((t=>{this.api.reportError(`Error resetting internals. Got ${t}`)}))}addon(t,e){const s=Object.assign(Object.assign({},e),{permutive:this,api:this.api,activationManager:this.activationManager,network:this.network,clientContext:this.clientContext,logger:this.logger,unprocessedEvents:this.unprocessedEvents,metrics:this.metrics,state:this.state,queryManager:this.queryManager,messages:this.messages,userId:this.userId,viewId:this.viewId,customProperties:this.customProperties,config:this.config,permutiveData:this.permutiveData,sessionManager:this.sessionManager,addons:this.addons,enrichers:this.enrichers,externalData:this.externalData,cookies:this.cookies,nextGenOutput:this.nextGen,identities:this.identities}),u=(0,r.zG)(this.nextGen.pbjsPair,a.UI(o.UI((0,f.vg)("pbjs")))),c=t=>{this.initialisedAddons.push(t),this.messages.emit("permutive:addon:preinit",t)};if(-1===this.initialisedAddons.indexOf(t))switch(c(t),t){case"web":Promise.resolve().then(n.bind(n,4400)).then((t=>this.addons.web=new t.WebAddon(s))).then((()=>this.messages.emit("permutive:web:ready")));break;case"publishers":case"overlays":case"scriptrunner":case"nativo":case"freewheel":case"tiktok_pixel":case"eyeota_pixel":case"rubicon":case"tracking_pixel":case"twitter_pixel":case"pinterest_pixel":case"local_storage":case"appnexus_adserver":case"prebid":case"classification_models":case"gam_log":case"smart":case"tradedesk":case"ddp":case"dbm":case"appnexus":case"ctv":0;break;case"dfp":Promise.resolve().then(n.bind(n,9658)).then((t=>(0,i.mG)(this,void 0,void 0,(function*(){return this.addons.dfp=yield t.createAddon(s)}))));break;case"facebook_pixel_v2":Promise.resolve().then(n.bind(n,9278)).then((t=>this.addons.facebook_pixel_v2=new t.FacebookV2Pixel(s)));break;case"rubicon_ssp":Promise.resolve().then(n.bind(n,8563)).then((t=>this.addons.rubicon_ssp=new t.RubiconSspAddon(s)));break;case"clean_room":Promise.resolve().then(n.bind(n,115)).then((t=>this.addons.clean_room=new t.CleanRoomAddon(Object.assign(Object.assign({},s),{pbjs:u,prebidIdentifiers:this.nextGen.prebidIdentifiers}))));break;case"pubmatic":Promise.resolve().then(n.bind(n,1840)).then((t=>this.addonIfTCFConsent({Addon:t.PubMaticAddon,key:"pubmatic"},s)));break;case"ssp":Promise.resolve().then(n.bind(n,9557)).then((t=>this.addons.ssp=new t.SspAddon(s)))}else"web"===t&&!0!==e.auto_init?((t,e,n,r)=>new Promise(((i,s)=>{var a;const u=(0,o.Y3)(t);if((0,o.pC)(u))return i(u.value);n.once(e,(()=>(0,o.g_)((()=>s(new Error(`Error after waiting for event ${e}`))),i)((0,o.Y3)(t))));const c=null!==(a=null==r?void 0:r.timeout)&&void 0!==a?a:1e4;(0,l.HJ)((()=>s(new Error(`Event ${e} was not received within the timeout period ${c}ms`))),c)})))((()=>{if(!this.addons.web)throw new Error('"web" addon not ready');return this.addons.web.reset(e)}),"permutive:web:ready",this.messages).catch((t=>{this.api.reportError(`Got error while trying to reset web. Got ${t.message}`,this.state.userId.get())})):"ctv"===t&&(null==e||e.auto_init)}addonIfTCFConsent(t,e){const n=()=>{switch(t.key){case"tradedesk":this.addons.tradedesk=new t.Addon(e);break;case"ddp":this.addons.ddp=new t.Addon(e);break;case"appnexus":this.addons.appnexus=new t.Addon(e);break;case"pubmatic":this.addons.pubmatic=new t.Addon(e)}},i=e=>e[d.D[t.key]]?n():(0,r.Q1)();return(0,c._8)(window).then((t=>{switch(t.type){case"missing":return n();case"aborted":return(0,r.Q1)();case"loaded":return(0,r.zG)((0,c.Ec)(t.data),(0,o.g_)(n,i))}}))}ready(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"initialised";const n=(0,f.b2)(),r=()=>{t(),n.resolve()};switch(e){case"initialised":this.permutiveRealtime.isReady()?r():this.messages.on("permutive:ready",r);break;case"realtime":this.permutiveRealtime.isRealtime()?r():this.messages.once("permutive:realtime",r)}return n.promise}}var m=n(4769);const _=t=>{const{logger:e,consentTracking:n}=t,o=function(){return e.debug("Methods[track]: Cannot track as consent is revoked"),Promise.resolve(null)};return t=>class extends t{constructor(){super(...arguments),this.track=(0,m.v)(super.track.bind(this),o,n.isRevoked),n.isRevoked()&&this.consentRevoked(),n.listenForConsent((()=>this.consentRevoked()),r.Q1)}consentRevoked(){return(0,i.mG)(this,void 0,void 0,(function*(){return yield this.sessionManager.reset(),this.reset()}))}}},v=(t,e,n,i,o,s,a,u,c,d,l,f,h,p,m,v,b,y,w,k,E,S,I,P,D,O,M,C,U)=>new((0,r.zG)(g,_({consentTracking:C,logger:t})))(t,e,n,i,o,s,a,u,c,d,l,f,h,p,m,v,b,y,w,k,E,S,I,P,D,O,M,U)},6416:(t,e,n)=>{n.d(e,{O:()=>u});var r=n(1828),i=n(365),o=n(3735);const s=t=>(0,o.zG)((t=>"function"==typeof t.Map?(0,i.F2)(new t.Map([["a",1]])):(0,i.t$)("Maps not supported"))(t),i.tS((t=>1===t.size?(0,i.F2)(null):(0,i.t$)("Iterable Maps not supported")))),a=t=>(0,o.zG)((t=>"function"==typeof t.Set?(0,i.F2)(new t.Set([1,2])):(0,i.t$)("Sets not supported"))(t),i.tS((t=>2===t.size?(0,i.F2)(null):(0,i.t$)("Iterable Sets not supported")))),u=t=>(0,o.zG)((0,r.gz)(i.G5)(s(t),a(t),(t=>t.Worker&&t.Blob?(0,i.F2)(null):(0,i.t$)("WebWorkers not supported"))(t)),(t=>(0,i.UI)(o.Q1)(t)))},6315:(t,e,n)=>{n.d(e,{Yj:()=>p,TZ:()=>f});var r=n(7582),i=n(2688),o=n(5151),s=n(7758),a=n(1828),u=n(3735),c=n(2652);var d=n(8612);const l=t=>(0,r.mG)(void 0,void 0,void 0,(function*(){yield t.identities.thirdParty,yield function(t,e){return(0,d.Bt)("8230918b-a7dd-44fb-a85a-7ff990c4d151","8230918b-a7dd-44fb-a85a-7ff990c4d151",t.identities.getPrioritizedIdentities(t.identities.getIdentitiesMap()).map((t=>t.id)),window.location.hostname,t.userId.get())?e.reset():Promise.resolve()}(t,t.permutiveMethods);const e=yield function(t){const e=t.trace.startSpan("identify");0;return(t=>(0,r.mG)(void 0,void 0,void 0,(function*(){const e="[Identify Init]",{logger:n,api:r,userId:i,identities:o,metrics:s,identitiesIngestor:a,messages:u,sessionManager:d}=t,l=yield o.thirdParty,f=o.extractIdentifyFromQueue(t),h=o.getIdentitiesMap(),p=f.reduce(((t,e)=>{let{tag:n,id:r,priority:i,expiry:o}=e;return Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({id:r},o?{expiry:o}:{}),void 0!==i?{priority:i}:{})})}),{}),g=Object.assign(Object.assign({},h),p),m=o.setIdentities(Object.entries(g).map((t=>{let[e,{id:n,priority:r,expiry:i}]=t;return Object.assign(Object.assign({tag:e,id:n},i?{expiry:i}:{}),void 0!==r?{priority:r}:{})}))),_=o.getPrioritizedIdentities(g);n.log("Begin identification");const v=t.sessionCount>1&&d.sessionHasChanged()||l.identifyRequestRequired()||m.identifyRequestRequired()?yield(n.debug(e,"request identity"),r.identify(s,i,_).then((t=>{const r=t.user_id;return i.isEqual(r)?{identityChanged:!1}:(n.debug(e,"fetch received new user id",r),{identityChanged:!0,userId:r})})).catch((t=>(r.reportError(`${e} Fetch failed. Got ${t}`,i.get()),{identityChanged:!1}))).then((0,c.bw)((e=>t.metrics.track({name:`sdk_identity_${e.identityChanged?"changed":"remained"}_total`,value:1,labels:{identify_reason:"sdk_init"}}))))):(n.debug(e,"skip request"),{identityChanged:!1});return a.ingestIfEligible(_).catch((t=>r.reportError(`Couldn't ingest identities, got ${t}`,v.identityChanged?v.userId:i.get()))),u.emit("permutive:user:ready"),n.debug(e,"result",v),v})))(t).catch((e=>(t.api.reportError(`Failed to identify. Got ${(0,i.w)(e)}`),{identityChanged:!1}))).then((t=>(e.finish(),t)))}(t);return e.identityChanged?yield p(t,e.userId):(t.logger.log("Identity has not changed"),t.nextGen.refreshThirdPartyData()),e})),f=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>{};return(0,r.mG)(void 0,void 0,void 0,(function*(){l(t).then(e),yield h(t.logger,t.trace,t.permutiveMethods,t.unprocessedEvents,t.queryManager,t.eventCollection,t.metrics)(),g(t.global,t.clientContext)}))};function h(t,e,n,i,d,l,f){t.log("Assuming identity hasn't changed");const h=d.hasNewOrModifiedQueries,p=h?(0,u.zG)((()=>l.allEvents()),o.tS((t=>d.bootstrap(t)))):d.bootstrap([]),g=(0,u.zG)((()=>i.PageviewComplete.getIfPresent()),(0,c.bw)(s.EQ((()=>t.debug("No unprocessed PVC data detected")),(e=>t.debug("Unprocessed PVC data detected",e)))),s.wE((t=>{var{props:e}=t,s=(0,r._T)(t,["props"]);return a.gz(o.oE)((()=>n.track("PageviewComplete",e,{unprocessedData:s})),(()=>i.PageviewComplete.reset()))})),o.UI((()=>{})));return(0,u.zG)(a.gz(o.oE)((()=>(0,r.mG)(this,void 0,void 0,(function*(){return e.startSpan(`qm_bootstrap_${h}`)}))),p,g),o.UI((t=>{let[e]=t;return e.finish()})))}function p(t,e){return(0,r.mG)(this,void 0,void 0,(function*(){t.logger.log("Identity has changed"),yield t.reset.reset(),t.userId.set(e),g(t.global,t.clientContext),t.nextGen.refreshThirdPartyData(),t.identities.setIdentities([]),yield t.nextGen.resetQL({downloadState:!0,preserveEventsFromCurrentView:!0})}))}function g(t,e){return t.context=e.getContext()}},5919:(t,e,n)=>{function r(t,e,n,r,i){i.debug("set SDK as ready"),t.setAsReady(),e.emit("permutive:api:ready"),n.track({name:"sdk_local_storage_byte_total",value:r.getStateSizeInBytes(),labels:{}}),n.track({name:"sdk_query_states_byte_total",value:t.getStateSizeInBytes(),labels:{}})}n.d(e,{R:()=>r})},7985:(t,e,n)=>{n.d(e,{$o:()=>s,je:()=>a});var r=n(365),i=n(3735),o=n(2233);const s=t=>{var e,n;const o="8230918b-a7dd-44fb-a85a-7ff990c4d151",s=void 0!==(null===(e=t[o])||void 0===e?void 0:e.q)&&void 0!==(null===(n=t[o])||void 0===n?void 0:n.config)?o:"permutive";return(0,i.zG)(t[s],(0,r.ij)("Can't find permutive tag on the page"),(0,r.UI)((t=>({tag:t,key:s}))))},a=(t,e)=>{let{tag:n,key:r}=t;return Object.assign(Object.assign({},n),{config:(0,o.ti)(Object.assign(Object.assign({},n.config),{windowKey:r}),e)})}},7078:(t,e,n)=>{n.d(e,{LA:()=>a});var r=n(1500),i=n(7209),o=n(2652);const s=(t,e,n)=>{let{api:r,state:i}=n;r.reportError(`Function "permutive.${e.functionName}" caused an error: ${t.message}`,i.userId.get())};function a(t,e,n,r,i,o){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:l;const c=u(t),d=o.startSpan("queued_methods"),f={api:i,state:e},h=t=>{if(t.functionName in n){n[t.functionName].apply(r,t.arguments)}else s(new Error("Does not exist."),t,f)},p=t=>!a.includes(t);c.forEach((t=>{try{p(t.functionName)&&h(t)}catch(e){const n=e instanceof Error?e:new Error("Unknown error.");s(n,t,f)}})),d.finish()}function u(t){const e=(0,r.uK)((t=>-1!==d.indexOf(t.functionName)))(t),n=e.right,s=e.left.filter((t=>"consent"!==t.functionName)),a=(0,i.Zt)(((t,e)=>c(t)&&c(e)?(0,o.lW)(f).compare(t.arguments[0],e.arguments[0]):(0,o.lW)(d).compare(t.functionName,e.functionName)));return(0,r.DY)(a)(n).concat(s)}const c=t=>"addon"===t.functionName,d=["identify","trigger","addon","track"],l=["identify"],f=["dfp","appnexus_adserver","web"]},4922:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{H:()=>initialiseWebSDK,f:()=>initialisationSequence});var tslib__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(7582),_permutive_permutive_utils_ts_error__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(2688),fp_ts_Either__WEBPACK_IMPORTED_MODULE_51__=__webpack_require__(365),fp_ts_function__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(3735),fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(4767),_framework_ref__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2851),_identity_legacy_NeustarFabrickIdentitiesIngestor__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(6967),_identity_legacy_PermutiveIdentities__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(8612),_identity_legacy_PermutiveIdentitiesIngestorNoOp__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__(7658),_sdkql_blockers__WEBPACK_IMPORTED_MODULE_52__=__webpack_require__(122),_sdkql_query_language_queryWorkerInit__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(8318),_core_activations_PermutiveActivationManagerWeb__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8975),_core_activations_PermutiveAddons__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(9853),_core_context_PermutiveClientContextWeb__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__(2836),_sdkql_event_collection_events_cache_store_crypto_HashcodeDigest__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(6197),_sdkql_event_collection_PermutiveEventCustomProps__WEBPACK_IMPORTED_MODULE_44__=__webpack_require__(7748),_core_events_unprocessed_UnprocessedPageviewComplete__WEBPACK_IMPORTED_MODULE_42__=__webpack_require__(389),_core_events_unprocessed_UnprocessedPrebidAuctions__WEBPACK_IMPORTED_MODULE_43__=__webpack_require__(5865),_core_internals_CookiesWeb__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(5461),_core_internals_ExternalDataWeb__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__(9773),_core_internals_PermutiveLogger__WEBPACK_IMPORTED_MODULE_58__=__webpack_require__(342),_core_internals_SDKMessages__WEBPACK_IMPORTED_MODULE_61__=__webpack_require__(8491),_core_metrics_MetricReporter__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(6478),_core_metrics_Metrics__WEBPACK_IMPORTED_MODULE_62__=__webpack_require__(4074),_sdkql_query_language_query_manager_QueryManagerWeb__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(1628),_core_session_SessionManager__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(8317),_core_state_PermutiveDataStoreWeb__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(4026),_sdkql_state_sync_PermutiveEventSourceId__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(3622),_core_state_PermutiveNamespace__WEBPACK_IMPORTED_MODULE_60__=__webpack_require__(569),_core_state_PermutiveRealtime__WEBPACK_IMPORTED_MODULE_41__=__webpack_require__(7575),_core_state_PermutiveReset__WEBPACK_IMPORTED_MODULE_45__=__webpack_require__(7256),_sdkql_state_sync_PermutiveStateSyncWeb__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(1229),_core_state_PermutiveStateWeb__WEBPACK_IMPORTED_MODULE_50__=__webpack_require__(7274),_core_state_PermutiveUserId__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(9117),_core_state_PermutiveViewId__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(9880),_core_store_LocalStorage__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(7554),_core_store_SessionStorage__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(9332),_core_tcf_TCF__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(2497),_dynamic_addons_LoadAddons__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(6037),_sdkql_event_collection_enrichment_Enrichers_GlobalEnricher__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__(3116),_sdkql_event_collection_enrichment_RegisterEnrichers__WEBPACK_IMPORTED_MODULE_54__=__webpack_require__(6341),_dynamic_messages_PermutiveMessages__WEBPACK_IMPORTED_MODULE_53__=__webpack_require__(9078),_http_PermutiveApi__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(7423),_http_PermutiveNetwork__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(7354),_http_PermutiveUrls__WEBPACK_IMPORTED_MODULE_59__=__webpack_require__(310),_utils_PermutiveUtils__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(2652),_utils_task_queue_PermutiveTaskQueue__WEBPACK_IMPORTED_MODULE_46__=__webpack_require__(4996),_utils_Trace__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(6574),_utils_urls_UrlHelpers__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(3030),_Config__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(2233),_Consent_Consent__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(4564),_Consent_InitialisationCheckWeb__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(7708),_initialisation_browserFeatures__WEBPACK_IMPORTED_MODULE_56__=__webpack_require__(6416),_initialisation_identity__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(6315),_initialisation_initialisationLifecycle__WEBPACK_IMPORTED_MODULE_55__=__webpack_require__(5919),_initialisation_permutiveTag__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(7985),_initialisation_queuedMethods__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(7078),_PermutiveMethodsWeb__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(3298),_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_47__=__webpack_require__(3992),fp_ts_Task__WEBPACK_IMPORTED_MODULE_48__=__webpack_require__(5151),main_dynamic_addons_dfp_ad_request__WEBPACK_IMPORTED_MODULE_57__=__webpack_require__(3248),main_dynamic_addons_dfp_ad_server__WEBPACK_IMPORTED_MODULE_49__=__webpack_require__(9624),main_dynamic_addons_appnexus_adserver__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(2721);const prefix="[Initialisation Web]",sdkInitTimestamp=window.performance.now(),initialiseWebSDK=_ref=>{let{consentModule,logger,messages,metrics,namespace,network,partialTagWithKey,permutiveData,queryWorker,queryWorkerEnableReporting,tag,sessionStorage,configFromQueryParams,urls}=_ref;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.Y3)((()=>(0,tslib__WEBPACK_IMPORTED_MODULE_31__.mG)(void 0,void 0,void 0,(function*(){const windowKey=partialTagWithKey.key,permutiveGlobal=window[windowKey],config=tag.config,viewId=new _core_state_PermutiveViewId__WEBPACK_IMPORTED_MODULE_15__.W(config),trace=new _utils_Trace__WEBPACK_IMPORTED_MODULE_32__.l(config),sdkReadySpan=trace.startSpan("sdk_ready"),{consentTracking,consentValidation}=consentModule;(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_33__.zG)(consentTracking.consentRef,_framework_ref__WEBPACK_IMPORTED_MODULE_0__.YP((t=>{t?sessionStorage.put(configFromQueryParams,_Config__WEBPACK_IMPORTED_MODULE_22__.iq).then(fp_ts_function__WEBPACK_IMPORTED_MODULE_33__.Q1,(t=>{logger.warn(prefix,`Failed to cache "${_Config__WEBPACK_IMPORTED_MODULE_22__.iq}".`,(0,_permutive_permutive_utils_ts_error__WEBPACK_IMPORTED_MODULE_34__.w)(t))})):sessionStorage.delete(_Config__WEBPACK_IMPORTED_MODULE_22__.iq)}))),window[windowKey].consent=consentValidation;const context=(0,_utils_PermutiveUtils__WEBPACK_IMPORTED_MODULE_21__.PM)(tag.context||{},{path:window.location.pathname,url:(0,_utils_urls_UrlHelpers__WEBPACK_IMPORTED_MODULE_35__.bk)(window.location.href),referrer:(0,_utils_urls_UrlHelpers__WEBPACK_IMPORTED_MODULE_35__.bk)(document.referrer),view_id:viewId.get()}),createInternalsSpan=trace.startSpan("internals"),cookieStore=(0,_core_internals_CookiesWeb__WEBPACK_IMPORTED_MODULE_7__.S)(namespace,config,logger,consentTracking),localStorage=(0,_core_store_LocalStorage__WEBPACK_IMPORTED_MODULE_36__.E)(namespace,logger,consentTracking),externalData=(0,_core_internals_ExternalDataWeb__WEBPACK_IMPORTED_MODULE_37__.S)(namespace,logger,consentTracking),clientContext=new _core_context_PermutiveClientContextWeb__WEBPACK_IMPORTED_MODULE_38__.z(context);(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_33__.zG)(viewId.ref,_framework_ref__WEBPACK_IMPORTED_MODULE_0__.YP((t=>clientContext.updateContext(["view_id",t]))));const userId=new _core_state_PermutiveUserId__WEBPACK_IMPORTED_MODULE_14__.M(config,clientContext,cookieStore,externalData),eventSourceId=new _sdkql_state_sync_PermutiveEventSourceId__WEBPACK_IMPORTED_MODULE_12__.$(permutiveData),enrichers=new _sdkql_event_collection_enrichment_Enrichers_GlobalEnricher__WEBPACK_IMPORTED_MODULE_39__.J,api=new _http_PermutiveApi__WEBPACK_IMPORTED_MODULE_19__.F(urls,config,network,metrics,logger);queryWorkerEnableReporting({reportError:t=>api.reportError(t,userId.get()),metrics});const identityProviderEnv={permutive:permutiveGlobal,network,api,userId,metrics,permutiveData,messages,config,cookies:cookieStore,logger},identities=new _identity_legacy_PermutiveIdentities__WEBPACK_IMPORTED_MODULE_2__.lg(metrics,trace,permutiveData,identityProviderEnv,logger),identitiesIngestor=new _identity_legacy_PermutiveIdentitiesIngestorNoOp__WEBPACK_IMPORTED_MODULE_40__.z,permutiveRealtime=new _core_state_PermutiveRealtime__WEBPACK_IMPORTED_MODULE_41__.u(metrics,messages),sessionManager=yield _core_session_SessionManager__WEBPACK_IMPORTED_MODULE_10__.S.initialise(cookieStore,localStorage,logger),unprocessedArgs={consentTracking,logger,namespace},unprocessedEvents={PageviewComplete:new _core_events_unprocessed_UnprocessedPageviewComplete__WEBPACK_IMPORTED_MODULE_42__.p(unprocessedArgs),PrebidAuctions:new _core_events_unprocessed_UnprocessedPrebidAuctions__WEBPACK_IMPORTED_MODULE_43__.J(unprocessedArgs)},customProperties=new _sdkql_event_collection_PermutiveEventCustomProps__WEBPACK_IMPORTED_MODULE_44__.X,queryManagerTransitionDebounceTime=1e3,queryManagerTransitionMaxDebounceTime=1e4,queryManager=new _sdkql_query_language_query_manager_QueryManagerWeb__WEBPACK_IMPORTED_MODULE_9__.c({customProperties,externalData,logger,messages,api,permutive:permutiveGlobal,permutiveData,queryWorker,realtime:permutiveRealtime,sessionManager,transitionDebounceMaxTime:queryManagerTransitionMaxDebounceTime,transitionDebounceTime:queryManagerTransitionDebounceTime,userId,viewId,metrics}),permutiveReset=new _core_state_PermutiveReset__WEBPACK_IMPORTED_MODULE_45__.a(config,localStorage,logger,permutiveData,eventSourceId,cookieStore,externalData),taskQueue=new _utils_task_queue_PermutiveTaskQueue__WEBPACK_IMPORTED_MODULE_46__.i(messages),stateSync=new _sdkql_state_sync_PermutiveStateSyncWeb__WEBPACK_IMPORTED_MODULE_13__.N(api,network,sessionManager,permutiveData,queryManager,metrics,userId,eventSourceId,(0,_sdkql_state_sync_PermutiveStateSyncWeb__WEBPACK_IMPORTED_MODULE_13__.e)()),activationManager=new _core_activations_PermutiveActivationManagerWeb__WEBPACK_IMPORTED_MODULE_4__.v(logger,permutiveGlobal,clientContext),[addonsLoadedRef,setAddonsLoaded]=_framework_ref__WEBPACK_IMPORTED_MODULE_0__.Ue(!1),nextGen=yield(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_33__.zG)((()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__,4076))),_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_47__.SF,fp_ts_Task__WEBPACK_IMPORTED_MODULE_48__.UI((t=>{let{runNextGenFeaturesWeb:e}=t;return e({activationManager,addonsLoaded:addonsLoadedRef,adServers:[(0,main_dynamic_addons_dfp_ad_server__WEBPACK_IMPORTED_MODULE_49__.Y)(activationManager)],api,clientContext,config,consentTracking,enrichers,externalData,identities:identities.ref,logger,messages,metrics,namespace,network,permutiveData,queryManager,realtime:permutiveRealtime,sessionManager,stateSync,trace,track:function(){return permutiveGlobal.track(...arguments)},unprocessedPVC:unprocessedEvents.PageviewComplete,urls,userId,viewId})})))();(0,_core_metrics_MetricReporter__WEBPACK_IMPORTED_MODULE_8__.p)({api,context:nextGen.metricContext,enrichers,logger,messages,metrics});const state=new _core_state_PermutiveStateWeb__WEBPACK_IMPORTED_MODULE_50__.u(permutiveData,permutiveReset,userId,viewId,nextGen.eventCollection),addons={},permutiveMethods=(0,_PermutiveMethodsWeb__WEBPACK_IMPORTED_MODULE_28__.S)(logger,api,activationManager,sessionManager,metrics,viewId,userId,network,enrichers,clientContext,unprocessedEvents,queryManager,taskQueue,identities,permutiveReset,messages,addons,trace,permutiveRealtime,state,customProperties,config,permutiveData,externalData,cookieStore,identitiesIngestor,permutiveGlobal,consentTracking,nextGen);createInternalsSpan.finish(),[].forEach((s=>{fp_ts_Either__WEBPACK_IMPORTED_MODULE_51__.Y3((()=>eval(s)),(t=>{api.reportError(Object.assign(Object.assign({},t),{message:`Error running custom script ${s}`}),userId.get())}))}));const blockers=(0,_sdkql_blockers__WEBPACK_IMPORTED_MODULE_52__.X)({logger,messages});blockers.addBlocker("permutive:queries:initialised"),messages.on("permutive:user:ready",(()=>{permutiveGlobal.identify=permutiveMethods.identify.bind(permutiveMethods);const t=identities.extractIdentifyFromQueue({global:permutiveGlobal});t.length>0&&permutiveGlobal.identify(t)})),messages.on("permutive:blockers:empty",(()=>{permutiveGlobal.on=permutiveMethods.on.bind(permutiveMethods),permutiveGlobal.once=permutiveMethods.once.bind(permutiveMethods),permutiveGlobal.track=permutiveMethods.track.bind(permutiveMethods),permutiveGlobal.trigger=permutiveMethods.trigger.bind(permutiveMethods),permutiveGlobal.query=permutiveMethods.query.bind(permutiveMethods),permutiveGlobal.segment=permutiveMethods.segment.bind(permutiveMethods),permutiveGlobal.segments=permutiveMethods.segments.bind(permutiveMethods),permutiveGlobal.reset=permutiveMethods.reset.bind(permutiveMethods),permutiveGlobal.ready=permutiveMethods.ready.bind(permutiveMethods),permutiveGlobal.addon=permutiveMethods.addon.bind(permutiveMethods),permutiveGlobal.context=clientContext.getContext(),permutiveGlobal.addons=addons,permutiveGlobal.config=config,permutiveRealtime.setAsReady(),(0,_initialisation_queuedMethods__WEBPACK_IMPORTED_MODULE_27__.LA)(permutiveGlobal.q,state,permutiveGlobal,permutiveMethods,api,trace),setAddonsLoaded(!0)}));const loadAddonsSpan=trace.startSpan("load_addons");(0,_dynamic_addons_LoadAddons__WEBPACK_IMPORTED_MODULE_18__.C)({extMessages:new _dynamic_messages_PermutiveMessages__WEBPACK_IMPORTED_MODULE_53__.a(messages),nextGen,messages,viewId,state,sessionManager,api,clientContext,externalData,logger,metrics,namespace,network,permutive:permutiveGlobal,q:permutiveGlobal.q,userId}),loadAddonsSpan.finish();const loadEnrichersSpan=trace.startSpan("load_enrichers"),enricherEnv={api,config,clientContext,logger,permutiveData,metrics,sessionManager,enrichers,network,externalData},loadEnrichersPromise=(0,_sdkql_event_collection_enrichment_RegisterEnrichers__WEBPACK_IMPORTED_MODULE_54__.H)(enricherEnv)();loadEnrichersPromise.then((()=>{loadEnrichersSpan.finish()})),yield(0,_initialisation_identity__WEBPACK_IMPORTED_MODULE_25__.TZ)({api,clientContext,eventCollection:nextGen.eventCollection,externalData,global:permutiveGlobal,identities,identitiesIngestor,logger,messages,metrics,network,nextGen,permutiveMethods,queryManager,reset:permutiveReset,stateSync,trace,unprocessedEvents,userId,sessionManager,sessionCount:nextGen.metricContext.current.session_count}),yield loadEnrichersPromise,(0,_initialisation_initialisationLifecycle__WEBPACK_IMPORTED_MODULE_55__.R)(queryManager,messages,metrics,state,logger),sdkReadySpan.finish()}))),(t=>`Exception during initialisation. Got ${t}`))},initialisationSequence=(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_33__.zG)(fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.Do,(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("support",(()=>(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.Uo)((0,_initialisation_browserFeatures__WEBPACK_IMPORTED_MODULE_56__.O)(self)))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("queryWorker",(()=>_sdkql_query_language_queryWorkerInit__WEBPACK_IMPORTED_MODULE_3__.F)),fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.UI((t=>Object.assign(Object.assign({},t),{queryWorker:t.queryWorker.worker,queryWorkerEnableReporting:t.queryWorker.enableReporting}))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("partialTagWithKey",(()=>(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.Uo)((0,_initialisation_permutiveTag__WEBPACK_IMPORTED_MODULE_26__.$o)(window)))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("configFromQueryParams",(()=>(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.Uo)((0,_Config__WEBPACK_IMPORTED_MODULE_22__.B9)()))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("tag",(t=>(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)((0,_initialisation_permutiveTag__WEBPACK_IMPORTED_MODULE_26__.je)(t.partialTagWithKey,t.configFromQueryParams)))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.UI)((t=>{{const e=t.partialTagWithKey.key,n=window[e];(0,main_dynamic_addons_dfp_ad_request__WEBPACK_IMPORTED_MODULE_57__.h)(n)}return t})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("logger",(t=>{let{tag:e}=t;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)((0,_core_internals_PermutiveLogger__WEBPACK_IMPORTED_MODULE_58__.SX)(e.config))})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("urls",(t=>{let{tag:e}=t;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)(new _http_PermutiveUrls__WEBPACK_IMPORTED_MODULE_59__.s(e.config))})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("namespace",(t=>{let{tag:e}=t;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)(new _core_state_PermutiveNamespace__WEBPACK_IMPORTED_MODULE_60__.L(e.config))})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("messages",(t=>{let{logger:e}=t;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)(new _core_internals_SDKMessages__WEBPACK_IMPORTED_MODULE_61__.Q(e))})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("consentModule",(t=>(0,fp_ts_function__WEBPACK_IMPORTED_MODULE_33__.zG)((()=>(0,_Consent_Consent__WEBPACK_IMPORTED_MODULE_23__.NY)(Object.assign(Object.assign({},t),{consentRequired:t.tag.config.consentRequired}))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.Vn)((t=>t.message))))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("sessionStorage",(t=>(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)((0,_core_store_SessionStorage__WEBPACK_IMPORTED_MODULE_16__.u)(t.namespace,t.logger,t.consentModule.consentTracking)))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("permutiveData",(t=>{let{tag:e,namespace:n,logger:r,consentModule:i}=t;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)((0,_core_state_PermutiveDataStoreWeb__WEBPACK_IMPORTED_MODULE_11__.S)(e.config,n,r,i.consentTracking))})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("metrics",(t=>{let{tag:e,messages:n,logger:r,permutiveData:i}=t;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)((0,_core_metrics_Metrics__WEBPACK_IMPORTED_MODULE_62__.g)(sdkInitTimestamp,e.config,i,n,r))})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("network",(t=>{let{metrics:e}=t;return(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.F2)(new _http_PermutiveNetwork__WEBPACK_IMPORTED_MODULE_20__.E(e))})),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.ak)("consent",(t=>(0,_Consent_InitialisationCheckWeb__WEBPACK_IMPORTED_MODULE_24__.D)(t))),(0,fp_ts_TaskEither__WEBPACK_IMPORTED_MODULE_30__.tS)((t=>initialiseWebSDK(t))))},1101:(t,e,n)=>{n.r(e);var r=n(365),i=n(3735),o=n(6341),s=n(7927),a=n(2197),u=n(6567),c=n(4673);n(2652);class d{constructor(t,e){this.config=t,this.logger=e,this.defaultReplacementMap=this.filterReplacementMap(this.config.defaultMap),this.replacementMap=this.setReplacementMap(this.config.replacementMap)}get getReplacementMap(){return this.replacementMap}setReplacementMap(t){return this.replacementMap=Object.assign(Object.assign({},this.defaultReplacementMap),this.filterReplacementMap(t)),this.logger.debug(`enrichers[${this.config.name}]: replacement map updated`,this.getReplacementMap),this.getReplacementMap}}class l extends d{filterReplacementMap(t){return t}}const f="geoip",h="enricher:geoip",p={include_geo:!0,include_isp:!0,include_ip_hash:!0,include_ip:!1},g=(t,e)=>{var n;const{$ip_geo_info_continent:r,$ip_address:o,$ip_address_hash:u}=c.U,d={$ip_geo_info_continent:r,$ip_address:o,$ip_geo_info:{city:c.U.$ip_geo_info_city,continent:c.U.$ip_geo_info_continent,country:c.U.$ip_geo_info_country,postal_code:c.U.$ip_geo_info_postal_code,province:c.U.$ip_geo_info_province},$ip_address_hash:u,$ip_isp_info:{autonomous_system_number:0,isp:c.U.$ip_isp_info_isp,autonomous_system_organization:c.U.$ip_isp_info_autonomous_system_organization,organization:c.U.$ip_isp_info_organization}},h=(0,i.zG)({$ip_geo_info:null==t?void 0:t.geo_info,$ip_geo_info_continent:null===(n=null==t?void 0:t.geo_info)||void 0===n?void 0:n.continent,$ip_isp_info:null==t?void 0:t.isp_info,$ip_address:null==t?void 0:t.ip,$ip_address_hash:null==t?void 0:t.ip_hash},s.hX(a.ff((t=>void 0===t))));return new l({name:f,defaultMap:d,replacementMap:h},e)},m=t=>{let{clientContext:e,api:n,permutiveData:r,metrics:i,sessionManager:o,enrichers:s,network:a,logger:u,config:c}=t;const d=t=>{t.isp_info&&e.updateContext(["isp",t.isp_info.isp],["organization",t.isp_info.organization],["autonomous_system_number",t.isp_info.autonomous_system_number],["autonomous_system_organization",t.isp_info.autonomous_system_organization]),t.geo_info&&e.updateContext(["continent",t.geo_info.continent],["country",t.geo_info.country],["city",t.geo_info.city],["province",t.geo_info.province],["postal_code",t.geo_info.postal_code])},l=r.getData(h);return l&&l.session_id===o.getSessionId()?(d(l.data),s.register(g(l.data,u)),Promise.resolve()):(u.debug("enrichers[geoip]: start HTTP request"),_(n,i,c,p).then((t=>(u.debug("enrichers[geoip]: end HTTP request"),d(t),r.setData(h,{session_id:o.getSessionId(),data:t}),t))).catch((t=>(n.reportError(`Error while registering the geoip enricher: got ${t}`),null))).then((t=>{s.register(g(t,u))})))},_=(t,e,n,r)=>{const i=[];return r.include_geo&&i.push(["include","geo"]),r.include_isp&&i.push(["include","isp"]),r.include_ip&&i.push(["include","ip"]),r.include_ip_hash&&i.push(["include","ip_hash"]),t.reqWithMetrics(e,"sdk_http_geoip_seconds",{url:t.urls.getEndpointUrl("/geoip",(0,u.G)(n.apiVersion),i),method:"GET",contentType:"text/plain",dataType:"json",withCredentials:!1})},v=()=>(0,o.B)({load:m});const b=()=>{},y=()=>{};var w,k=n(4922);w=k.f,v(),b(),y(),w().then((0,r.g_)((t=>console.warn(`Permutive was not initialized. ${t}`)),i.Q1))},2652:(t,e,n)=>{n.d(e,{Bf:()=>y,El:()=>B,G6:()=>D,Gz:()=>k,HP:()=>A,Kn:()=>d,Or:()=>C,PM:()=>f,PQ:()=>O,SL:()=>p,Z_:()=>x,a4:()=>m,aT:()=>b,b0:()=>E,b2:()=>g,bw:()=>z,cO:()=>M,eu:()=>_,fl:()=>I,k$:()=>w,lW:()=>U,lo:()=>j,m8:()=>S,mQ:()=>q,qh:()=>l,rH:()=>L,rO:()=>G,vg:()=>T,vp:()=>h});var r=n(1500),i=n(3735),o=n(6567),s=n(7209),a=n(6017),u=n(2751),c=n(3992);const d=t=>"object"==typeof t&&!Array.isArray(t)&&null!==t,l=t=>Object.entries(t);function f(){for(var t=arguments.length,e=new Array(t),n=0;nObject.assign(Object.assign({},t),e)),{})}function h(t){let e=0;for(let n=0;n{let n=0;for(let r of e){n=n+t(r)|0}return n}}a.ff(u.xb);function g(){let t,e;return{promise:new Promise(((n,r)=>{t=n,e=r})),reject:e,resolve:t}}function m(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={waitTimeInMs:50,exponentialBackOff:!1,maxAttempts:20},{waitTimeInMs:s,exponentialBackOff:a,maxAttempts:u}=f(r,n);let d=0;const l=n=>new Promise((r=>Promise.resolve(e()).then((e=>e?Promise.resolve(t()).then((t=>r((0,o.G)(t)))):(0,i.zG)(d++,(t=>tr(l(n*(a?2:1)))),n):r(o.YP)))))));return l(s)}function _(t,e){const n=Object.create(null);for(const r of e)n[r]=t[r];return n}let v=[];function b(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:navigator.userAgent;if(v.unshift(t),v.length>1)return;const n=["beforeunload","pagehide"],r=n.concat(["visibilitychange"]),i=t=>{if(!o&&t){o=!0;const t=v;v=[],t.forEach((t=>{try{t()}catch(t){}}))}};let o=!1;r.forEach((t=>{window.addEventListener(t,(()=>{const n=("visibilitychange"!==t||document.hidden)&&P(e);i(n)}))})),n.forEach((t=>{window.addEventListener(t,(()=>i(!0)))}))}function y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object.assign({capture:!0},e);const n=["visibilitychange","pagehide"];n.forEach((n=>window.addEventListener(n,(()=>o.Y3((()=>{"pagehide"!==n&&"hidden"!==document.visibilityState||t()}))),{capture:e.capture})))}function w(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(t=>(t^(self.crypto||self.msCrypto).getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)))}function k(t){return 36===t.length&&/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(t)}function E(t,e){const n=Object.keys(t),r=n.length,i={};for(let s=0;se(t)?(0,o.G)(n):o.YP))}function P(t){return/Mobi|Android/i.test(t)}function D(t){return/^((?!chrome|android).)*safari/i.test(t)}function O(t,e){return new Promise((n=>{var r;(0,c.HJ)((()=>{Promise.resolve(t()).then(n)}),null!==(r=null==e?void 0:e.timeout)&&void 0!==r?r:0)}))}function M(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(t.length!==e.length)return!1;for(let n=0;n({equals:(t,e)=>Object.is(t,e)});function U(t){return(0,s.Zt)(((e,n)=>{const r=t.indexOf(e),i=t.indexOf(n);switch(!0){case-1===r&&-1===i:return 0;case-1!==r&&-1===i:return-1;case-1===r&&-1!==i:return 1;default:return r<=i?-1:1}}))}function x(t,e,n){return function(){try{return n(...arguments)}catch(n){t.reportError(n,e.get())}}}function T(t){return e=>null!=e&&t in e?e[t]:void 0}function A(t){let e=o.YP;const n=(0,o.fS)((()=>{const n=t();return e=(0,o.G)(n),n}));return()=>n(e)}const q=t=>{const e=new Map;return n=>(e.has(n)||e.set(n,t(n)),e.get(n))},G=t=>e=>{var n;const r=Object.assign({},e);for(const i in t)r[i]=null===(n=t[i])||void 0===n?void 0:n.call(t,e[i]);return r};function z(t){return e=>(t(e),e)}const j=t=>e=>{const n=t.slice(0,-1),s=t.slice(-1)[0];return(0,i.zG)(n,r.f2((t=>{let[n,r]=t;return(0,i.zG)(e,o.DT(n),o.UI(r))})),o.fS((()=>s(e))))},R=t=>e=>{if("number"==typeof e)return e;if("string"==typeof e){const n=t(e);return Number.isNaN(n)?void 0:n}},L=R(parseInt);R(parseFloat);function B(t){return"object"==typeof t&&null!==t&&"_tag"in t&&["None","Some"].includes(t._tag)}},6574:(t,e,n)=>{n.d(e,{l:()=>r});class r{constructor(t){var e;this.config=t,this.shouldUsePerformanceMark=!1,this.placeholderSpan={spanId:null,finish:()=>({})},this.shouldUsePerformanceMark=(null===(e=null===window||void 0===window?void 0:window.performance)||void 0===e?void 0:e.mark)&&this.config.tracingEnabled}startSpan(t){var e;if(this.shouldUsePerformanceMark){const n=this.generateId(),r=`permutive_${t}`,i=`${r}${n}_start`;return null===(e=null===window||void 0===window?void 0:window.performance)||void 0===e||e.mark(i),{spanId:i,finish:()=>{var t,e;null===(e=null===(t=null===window||void 0===window?void 0:window.performance)||void 0===t?void 0:t.measure)||void 0===e||e.call(t,r,i)}}}return this.placeholderSpan}generateId(){return"_"+Math.random().toString(36).substr(2,9)}}},4730:(t,e,n)=>{n.d(e,{b:()=>o});var r=n(2652),i=n(3992);class o{constructor(t,e){this.timeoutDurationInMilliseconds=t,this.maxTimeOutDurationInMilliseconds=e}schedule(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.timeoutDurationInMilliseconds,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.maxTimeOutDurationInMilliseconds;return this.debounce(t,e,n)}scheduleAccumulated(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeoutDurationInMilliseconds,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.maxTimeOutDurationInMilliseconds;return this.debounce(t,n,r,e)}scheduleForPageUnload(t){return(0,r.aT)(t)}debounce(t,e,n,o){let s,a,u,c=[];return d=>{o&&(u=o.concat(null!=u?u:o.empty,d));const l=(0,r.b2)();c.push(l);return null==s||s(),s=(0,i.HJ)((()=>{null==a||a(),a=void 0;const e=t(u||d);c.forEach((t=>t.resolve(e))),u=null==o?void 0:o.empty,c=[]}),e),a||(a=(0,i.HJ)((()=>{null==s||s(),a=void 0;const e=t(u||d);c.forEach((t=>t.resolve(e))),u=null==o?void 0:o.empty,c=[]}),n)),l.promise}}}},4996:(t,e,n)=>{n.d(e,{i:()=>i});var r=n(3992);class i{constructor(t){this.messages=t,this.queue=[],this.nextNotify=null,t.on("permutive:taskQueue:update",(()=>{this.execute()}))}add(t){this.queue.push(t),this.notify()}notify(){const t=()=>{this.messages.emit("permutive:taskQueue:update")},e=(new Date).getTime();null===this.nextNotify||this.nextNotify{this.notify()})))}}this.queue.splice(0,n)}size(){return this.queue.length}}},3030:(t,e,n)=>{n.d(e,{_Y:()=>s,bk:()=>o,zM:()=>i});var r=n(3735);const i=()=>{var t,e;const n=null===(e=null===(t=window.location.href.split("?")[1])||void 0===t?void 0:t.split("#")[0])||void 0===e?void 0:e.split("&");return void 0===n?{}:n.reduce(((t,e)=>{const[n,r]=e.split("=");return Object.assign(Object.assign({},t),{[n]:r})}),{})},o=t=>{if(!t)return"";return(0,r.zG)(t,(t=>{const e=t.length-1;return"/"===t[e]?t.slice(0,e):t}))};function s(t){const e=t.match(/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/),n=t.match(/[a-z0-9][a-z0-9-]+\.[a-z.]{2,24}$/i),r=t.match(/localhost/);if(n&&n.length>0){const e=t.split(".").reverse();return e.length>=3&&e[1].match(/^(com|edu|gov|net|mil|org|nom|co|ac|name|info|biz)$/i)?e[2]+"."+e[1]+"."+e[0]:e[1]+"."+e[0]}return e&&(null==e?void 0:e.length)>0?e[0]:r&&(null==r?void 0:r.length)>0?"localhost":""}},7826:(t,e,n)=>{n.d(e,{$7:()=>m,Cg:()=>h,Qd:()=>g,cs:()=>p,dN:()=>l,zi:()=>f});var r=n(365),i=n(3735),o=n(6567),s=n(3328),a=n(2116),u=n(2851),c=n(2652);const d="[PrebidJS]";function l(t){const e=(()=>{const t=["pbjs",...window._pbjsGlobals||[]];return[...new Set(t)]})();t.logger.debug(d,"Found keys",e);return a.K4((()=>(0,i.zG)(e,s.UI((0,i.ls)((t=>(t=>{const e={maxAttempts:100,waitTimeInMs:50};let n;return{windowPropertyKey:t,pbjs:(0,c.a4)((()=>n),(()=>{const e=(0,i.zG)(window,(0,c.vg)(t));return!(!(null==e?void 0:e.que)||"function"!=typeof(null==e?void 0:e.getEvents)||(n=e,0))}),e)}})(t)),(e=>(0,i.zG)(u.p4(e.pbjs),u.UI((n=>{const s=r.pF((n=>(n.message=`Failed to resolve key "${e.windowPropertyKey}". ${n.message}`,t.reportError(`${d} ${n.toString()}`),o.YP)));return(0,i.zG)(n,(0,c.bw)(o.UI((n=>t.logger.debug(d,`Completed check for key "${e.windowPropertyKey}"`,{result:n})))),o.UI(s),o.UI(o.UI((t=>({windowPropertyKey:e.windowPropertyKey,pbjs:t})))))})))))),(t=>u.vP(...t)),u.UI((t=>({completedChecks:t.every(o.pC),pbjsKeyPairs:t.map(o.xH)}))),u.UI((t=>{let{pbjsKeyPairs:e,completedChecks:n}=t;const r=e.filter(o.pC),[a,...u]=r;return{completedChecks:n,mainPair:null!=a?a:o.YP,otherPairs:(0,i.zG)(u,s.DZ(i.yR))}})))))}const f=t=>"function"==typeof t.readConfig?t.readConfig():t.getConfig();function h(t){var e;const n=null===(e=t.meta)||void 0===e?void 0:e.advertiserDomains;if("string"==typeof n)return[n];if(Array.isArray(n)){const t=n.filter((t=>"string"==typeof t));return t.length>0?t:void 0}}const p=t=>{var e;const n=t.appnexus&&"object"==typeof t.appnexus&&"buyerMemberId"in t.appnexus&&t.appnexus.buyerMemberId,r=t.rubicon&&"object"==typeof t.rubicon&&"networkId"in t.rubicon&&t.rubicon.networkId,i=n||r||(null===(e=null==t?void 0:t.meta)||void 0===e?void 0:e.networkId);return i?`${i}`:void 0},g=t=>{var e;const n=t=>isNaN(t)?void 0:t;try{return"number"==typeof t.cpm?n(t.cpm):(0,i.zG)(null!==(e=t.cpm)&&void 0!==e?e:"",parseFloat,n)}catch(t){return}},m=t=>t.dealId?`${t.dealId}`:void 0},122:(t,e,n)=>{n.d(e,{X:()=>r});const r=t=>{let e=!0;const n=[];return{addBlocker:r=>{n.push(r),t.logger.log(" added blocker "+r),t.messages.on(r,(()=>{if(e){const i=n.indexOf(r);i>=0&&(n.splice(i,1),t.logger.log(" removed blocker "+r)),0===n.length&&(e=!1,t.messages.emit("permutive:blockers:empty"),t.logger.log(" complete"))}}))}}}},4467:(t,e,n)=>{n.d(e,{Vh:()=>d,WL:()=>l});var r=n(3735),i=n(1124),o=n(3328),s=n(7241),a=n(1828),u=n(2652),c=n(6567);const d=t=>i.Vh(t.all),l={empty:(()=>({byAdServer:(0,r.a9)(c.YP),all:i.of(o.cS)}))(),concat:(t,e)=>({all:(0,r.zG)((0,a.gz)(i.G5)(t.all,e.all),i.UI(o.xH)),byAdServer:(0,u.mQ)((n=>(0,r.zG)(o.oA([t.byAdServer(n),e.byAdServer(n)]),s.c2,c.UI((t=>t.reduce(((t,e)=>(0,r.zG)((0,a.gz)(i.G5)(t,e),i.UI(o.xH)))))))))})}},1517:(t,e,n)=>{n.d(e,{Vh:()=>p,e$:()=>h,rb:()=>f,zh:()=>l});var r=n(4307),i=n(6567),o=n(3735),s=n(1124),a=n(365),u=n(4467),c=n(3328),d=n(2652);const l=(t,e)=>n=>({all:(0,o.zG)(n,r.UI(t)),byAdServer:(0,d.mQ)((0,o.ls)(e,i.UI((t=>(0,o.zG)(n,r.UI(t))))))}),f=t=>(0,o.zG)(t,s.UI(a.F2),l(o.yR,(t=>i.G(t.filterCohorts)))),h=t=>({all:(0,o.zG)(t.all,r.Uj((()=>c.bM()))),byAdServer:(0,d.mQ)((0,o.ls)(t.byAdServer,i.UI(r.Uj((()=>c.bM())))))}),p=t=>(0,o.zG)(t,h,u.Vh)},7748:(t,e,n)=>{n.d(e,{X:()=>r});class r{constructor(){this.properties={}}overrideCustomProps(t){this.properties=t}getCustomProps(){return this.properties}}},3116:(t,e,n)=>{n.d(e,{J:()=>i});const r=t=>"string"==typeof t&&"$"===t[0];class i{constructor(){this.replacementMap={}}register(t){this.replacementMap=Object.assign(Object.assign({},this.replacementMap),t.getReplacementMap)}enrich(t,e){return this.enrichRecursive(t,e)}enrichRecursive(t,e){const n={output:{},isFullyEnriched:!0},i=Object.keys(t);for(let o=0;o{n.d(e,{B:()=>a,H:()=>u});var r=n(3735),i=n(5151),o=n(4767);const s=[],a=t=>{s.push(t)},u=t=>{const e=s.map((e=>(0,o.Y3)((()=>e.load(t)),(e=>{t.api.reportError(e)}))));return(0,r.zG)((0,i.RD)(e),(0,i.UI)(r.Q1))}},2546:(t,e,n)=>{n.r(e),n.d(e,{make:()=>A});var r=n(3735),i=n(7582);let o,s;const a=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,l=new WeakMap;let f={get(t,e,n){if(t instanceof IDBTransaction){if("done"===e)return u.get(t);if("objectStoreNames"===e)return t.objectStoreNames||c.get(t);if("store"===e)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(t[e])},set:(t,e,n)=>(t[e]=n,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function h(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(s||(s=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(m(this),e),g(a.get(this))}:function(...e){return g(t.apply(m(this),e))}:function(e,...n){const r=t.call(m(this),e,...n);return c.set(r,e.sort?e.sort():[e]),g(r)}}function p(t){return"function"==typeof t?h(t):(t instanceof IDBTransaction&&function(t){if(u.has(t))return;const e=new Promise(((e,n)=>{const r=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{e(),r()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),r()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)}));u.set(t,e)}(t),e=t,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((t=>e instanceof t))?new Proxy(t,f):t);var e}function g(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,n)=>{const r=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{e(g(t.result)),r()},o=()=>{n(t.error),r()};t.addEventListener("success",i),t.addEventListener("error",o)}));return e.then((e=>{e instanceof IDBCursor&&a.set(e,t)})).catch((()=>{})),l.set(e,t),e}(t);if(d.has(t))return d.get(t);const e=p(t);return e!==t&&(d.set(t,e),l.set(e,t)),e}const m=t=>l.get(t);const _=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],b=new Map;function y(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(b.get(e))return b.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!_.includes(n))return;const o=async function(t,...e){const o=this.transaction(t,i?"readwrite":"readonly");let s=o.store;return r&&(s=s.index(e.shift())),(await Promise.all([s[n](...e),i&&o.done]))[0]};return b.set(e,o),o}f=(t=>({...t,get:(e,n,r)=>y(e,n)||t.get(e,n,r),has:(e,n)=>!!y(e,n)||t.has(e,n)}))(f);var w=n(2688),k=n(365),E=n(5151),S=n(4767),I=n(2652);function P(t){return"development"===t.environment?window.isSecureContext:"https:"===window.location.protocol}var D=n(3992);const O="[IDB]",M=(t,e,n,o,s,a)=>(0,r.zG)((0,E.of)(t.getNamespacedStorageKey(s)),(0,E.tS)((t=>(0,S.Y3)((()=>(0,i.mG)(void 0,void 0,void 0,(function*(){return n.put(o,a,t)}))),w.w))),(0,E.UI)((0,k.g_)((t=>{throw e.error(O,`Failed to store crypto key to ${o} due to unexpected error,\n`,t),t}),(()=>a))),(t=>t()));class C{constructor(t,e,n,r,i,o,s,a){this.namespace=t,this.logger=e,this.cryptoAlg=n,this.idb=r,this.mainObjectStore=i,this.keyObjectStore=o,this.keyObjectKey=s,this.cryptoKey=a,this.MAX_CONSECUTIVE_PUTS=30,this.puts=1,this.hasForcedCompaction=!1,this.logDebug("Created",this.idb)}static initialise(t,e,n,o,s,a,u,c,d,l){const f=(0,I.G6)(navigator.userAgent)&&!1,h=[P(t),s.isAvailable(),!f].every((t=>!0===t)),p=(t,n,a)=>(0,i.mG)(this,void 0,void 0,(function*(){return(0,r.zG)(yield t.get(a,e.getNamespacedStorageKey(n)),(t=>(0,i.mG)(this,void 0,void 0,(function*(){return null!=t?t:s.generateKey(!1)}))),(n=>(0,i.mG)(this,void 0,void 0,(function*(){return M(e,o,t,c,d,yield n)})))).catch((t=>{const e=(0,w.w)(t);throw o.error(O,"Get crypto key failed. Got\n",e),e}))})),g=(t,e,n)=>e.includes(n)?(0,r.Q1)():t.createObjectStore(n),m=h?(0,k.Y3)((()=>function(t){if(!(0,I.G6)(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();let e=()=>{},n=0;return new Promise((t=>{const r=()=>(n++,indexedDB.databases().finally((0,D.GL)(t)));e=(0,D.UM)(r,100),r()})).finally((()=>{e(),t.track({name:"sdk_idb_conn_attempt_safari_count",value:n,labels:{}})}))}(n).then((()=>U(a,l,{upgrade:t=>{const e=[...t.objectStoreNames];g(t,e,u),g(t,e,c)}})))),String):(0,k.t$)("Connection not attempted. Default to localStorage");return(0,k.g_)((t=>(0,S.t$)(t)),(t=>(0,r.zG)((0,S.Y3)((()=>t.then((t=>(0,i.mG)(this,void 0,void 0,(function*(){return{db:t,cryptoKey:yield p(t,d,c)}}))))),String),(0,S.UI)((t=>{let{db:n,cryptoKey:r}=t;return new C(e,o,s,n,u,c,d,r)})))))(m)}put(t,e){return(0,i.mG)(this,void 0,void 0,(function*(){return(0,r.zG)((()=>(0,i.mG)(this,void 0,void 0,(function*(){return(0,r.bc)(JSON.stringify(t),this.cryptoKey)}))),(0,E.tS)((t=>{let[e,n]=t;return(0,E.of)(this.cryptoAlg.encrypt(n,e))})),(0,E.tS)((t=>()=>(0,i.mG)(this,void 0,void 0,(function*(){return yield this.resetIfRequired(this.puts++),t})))),(0,E.tS)((t=>(0,S.Y3)((()=>this.idb.put(this.mainObjectStore,t,this.namespace.getNamespacedStorageKey(String(e)))),w.w))),(0,E.UI)((0,k.g_)((n=>{throw this.logError(`Failed to put "${e.toString()}" value`,t,". Got \n",n),"QuotaExceededError"===n.name&&this.forceCompaction(),n}),(()=>e))),(t=>t()))}))}get(t){return(0,r.zG)(this.namespace.getNamespacedStorageKey(String(t)),(e=>this.idb.get(this.mainObjectStore,e).then((t=>(0,i.mG)(this,void 0,void 0,(function*(){return t?JSON.parse(yield this.cryptoAlg.decrypt(this.cryptoKey,t)):null})))).catch((e=>{const n=(0,w.w)(e);throw this.logError(`Get ${t.toString()} failed. Got`,n),n}))))}delete(t){return(0,r.zG)(this.namespace.getNamespacedStorageKey(String(t)),(t=>this.idb.delete(this.mainObjectStore,t)))}deleteStore(){return this.logDebug("Deleting",this.idb),this.idb.close(),x(this.idb.name)}forceCompaction(){if(this.hasForcedCompaction)return null;this.hasForcedCompaction=!0,this.logDebug("Attempting to force compaction");const t=`__${this.mainObjectStore}`;return U(t).then((e=>(e.close(),x(t))))}resetIfRequired(t){return(0,I.G6)(navigator.userAgent)&&t%this.MAX_CONSECUTIVE_PUTS==0?this.reset():Promise.resolve()}reset(){return(0,i.mG)(this,void 0,void 0,(function*(){const t=this.idb.name,e=this.idb.version;yield this.deleteStore(),this.idb=yield U(t,e),this.idb.createObjectStore(this.mainObjectStore),this.idb.createObjectStore(this.keyObjectStore),yield M(this.namespace,this.logger,this.idb,this.keyObjectStore,this.keyObjectKey,this.cryptoKey),this.logDebug("Reset to",this.idb)}))}logDebug(){for(var t=arguments.length,e=new Array(t),n=0;n{r(g(s.result),t.oldVersion,t.newVersion,g(s.transaction))})),n&&s.addEventListener("blocked",(()=>n())),a.then((t=>{o&&t.addEventListener("close",(()=>o())),i&&t.addEventListener("versionchange",(()=>i()))})).catch((()=>{})),a}),D.t_,(t=>t.then((t=>({close:t.close.bind(t),createObjectStore:(0,r.ls)(t.createObjectStore.bind(t),r.Q1),delete:(0,r.ls)(t.delete.bind(t),D.t_),get:(0,r.ls)(t.get.bind(t),D.t_),get name(){return t.name},put:(0,r.ls)(t.put.bind(t),D.t_),get version(){return t.version}}))))),x=(0,r.ls)((function(t,{blocked:e}={}){const n=indexedDB.deleteDatabase(t);return e&&n.addEventListener("blocked",(()=>e())),g(n).then((()=>{}))}),D.t_);var T=n(8259);const A=(t,e,n,i,o,s,a,u,c,d,l)=>(0,r.zG)(C,(0,T._z)({logger:d,consentTracking:l,prefix:O})).initialise(t,e,n,d,i,o,s,a,u,c)},6197:(t,e,n)=>{n(2652)},8036:(t,e,n)=>{n.d(e,{AG:()=>a,UC:()=>o,Yh:()=>s});var r=n(6567),i=n(2652);const o=(t,e,n)=>t in e||(()=>{const e="number"==typeof t?t:parseInt(t);return!1===isNaN(e)&&n.has(e)})(),s=t=>(0,i.b0)(t,((t,e)=>e.state?(0,r.G)({[e.checksum]:e.state}):r.YP));function a(t){var e;return["SegmentEntry","SegmentExit"].includes(t.name)&&void 0!==(null===(e=t.properties)||void 0===e?void 0:e.segment_number)}},1628:(t,e,n)=>{n.d(e,{c:()=>Wt,e:()=>Kt});var r=n(7183),i=n(2688),o=n(3735),s=n(4767);const a=()=>({kind:"null",value:null}),u=t=>({kind:"string",value:t}),c=t=>({kind:"number",value:t}),d=t=>({kind:"array",value:t}),l=t=>({kind:"object",value:t}),f=t=>t,h=()=>({kind:"bottom"}),p=t=>({kind:"inner",a:t}),g=t=>({kind:"top",error:t}),m=t=>({kind:"unbounded",group:t}),_=(t,e)=>({kind:"windowed",key:e,group:t}),v=(t,e,n)=>({kind:"countLimit",n,limit:e,group:t}),b=(t,e,n)=>({kind:"uniqueLimit",n,limit:e,group:t}),y=t=>({kind:"numberGroup",group:t}),w=t=>({kind:"stringGroup",group:t}),k=t=>({kind:"tuple",tuple:t}),E=t=>({state:t}),S=(t,e)=>({commands:t,payload:e});var I=n(7209),P=n(2751);const D=(t,e)=>{switch(t.kind){case"bottom":return{kind:"bottom"};case"inner":return p(e(t.a));case"top":return g(t.error)}},O=t=>(0,I.Zt)(((e,n)=>{if("bottom"===e.kind&&"bottom"===n.kind)return 0;if("bottom"===e.kind)return-1;if("bottom"===n.kind)return 1;if("top"===e.kind&&"top"===n.kind)return P.Df.compare(e.error,n.error);if("top"===e.kind)return 1;if("top"===n.kind)return-1;if("inner"===e.kind&&"inner"===n.kind)return t.compare(e.a,n.a);throw new Error("Non exhaustive match in extendedAlgebraOrd")}));var M=n(6567),C=n(1885),U=n(1500),x=n(365),T=function(t){return-1===t?1:1===t?-1:0};function A(t,e){return(0,U.oA)(t.map(e))}function q(t,e,n,r){const i=(t,e)=>{if(0===t.length)return(0,U.oA)(e.map((t=>(0,M.G)({1:t[1],2:n(M.YP,(0,M.G)(t[2]))}))));if(0===e.length)return(0,U.oA)(t.map((t=>(0,M.G)({1:t[1],2:n((0,M.G)(t[2]),M.YP)}))));if(t.length>0&&e.length>0&&(0,I.lt)(r)(t[0][1],e[0][1])){const[r,...o]=t,s=r[1],a=r[2];return(0,U.Ce)({1:s,2:n((0,M.G)(a),M.YP)})(i(o,e))}if(t.length>0&&e.length>0&&(0,I.gt)(r)(t[0][1],e[0][1])){const[r,...o]=e,s=r[1],a=r[2];return(0,U.Ce)({1:s,2:n(M.YP,(0,M.G)(a))})(i(t,o))}if(t.length>0&&e.length>0){const[r,...o]=t,[s,...a]=e,u=r[1],c=r[2],d=s[2];return(0,U.Ce)({1:u,2:n((0,M.G)(c),(0,M.G)(d))})(i(o,a))}throw new Error("Non exhaustive match in mapOption2")},o=(0,I.Uz)((t=>t[1]))(r),s=(t=>{const e=A(t,(t=>(0,M.pC)(t[2])?(0,M.G)({1:t[1],2:t[2].value}):M.YP));return 0===e.length?M.YP:(0,M.G)(e)})(i((0,U.DY)(o)([...t].map((t=>({1:t[0],2:t[1]})))),(0,U.DY)(o)([...e].map((t=>({1:t[0],2:t[1]}))))));return(0,M.UI)((t=>new Map(t.map((t=>[t[1],t[2]])))))(s)}function G(t,e,n,r){const i=(0,I.Uz)((t=>t[0]))(r),o=(0,U.DY)(i)([...e]).reduceRight(((t,e)=>{if((0,x.nM)(t)){const r=n(e[1],t.left);return(0,M.pC)(r)?(0,x.t$)(r.value):(0,x.F2)(e[0])}return t}),(0,x.t$)(t));return(0,M.Uo)(o)}function z(t,e){return new Map([...t].map(e))}function j(t,e){return new Map([...t].filter(e))}var R=n(4268),L=n(4011);function B(t){return JSON.stringify(K(t))}function K(t){switch(t.kind){case"null":return N.encode(t);case"string":return F.encode(t);case"number":return Y.encode(t);case"array":return Q.encode(t);case"object":return H.encode(t)}}function $(t){return null===t?N.decode(t):"number"==typeof t?Y.decode(t):"string"==typeof t?F.decode(t):Array.isArray(t)?Q.decode(t):H.decode(t)}const W=(t,e)=>(0,x.t$)(`Failed to decode. Input was ${JSON.stringify(t)}. Codec type was ${e}`),N={encode:t=>null,decode:t=>null===t?(0,x.F2)({kind:"null",value:null}):W(t,"SimpleNull")},F={encode:t=>t.value,decode:t=>"string"==typeof t?(0,x.F2)(u(t)):W(t,"SimpleString")},Y={encode:t=>t.value,decode:t=>"number"==typeof t?(0,x.F2)(c(t)):W(t,"SimpleNumber")},Q={encode:t=>t.value.map(K),decode:t=>{if(Array.isArray(t)){const e=(0,U.fw)(x.g1)($)(t);return(0,x.UI)(d)(e)}return W(t,"SimpleArray")}},H={encode:t=>{const e=[...t.value.entries()];return Object.assign({},...Array.from(e,(([t,e])=>({[t]:K(e)}))))},decode:t=>{if(t&&t.constructor===Object){const e=(0,U.fw)(x.g1)((([t,e])=>(0,o.zG)($(e),(0,x.UI)((e=>(0,o.bc)(t,e))))))(Object.entries(t));return(0,x.UI)((t=>l(new Map([...t]))))(e)}return W(t,"SimpleObject")}};function V(t){return(0,o.zG)(t,X,(0,M.UI)(B),(0,M.fS)((()=>"")))}function J(t){return(0,M.UI)(it)(function(t){switch(t.state.kind){case"top":return(0,M.G)(u(t.state.error));case"bottom":return M.YP;case"inner":return X(t.state.a)}}(t))}function X(t){return function(t){switch(t.kind){case"numberGroup":case"stringGroup":return Z(t.group);case"tuple":return t.tuple.length>0}}(t.payload)?(0,M.G)(d(function(t,e){const n=(0,M.UI)((t=>(0,U.Ce)(t)(e)))(t);return(0,M.fS)((()=>e))(n)}((0,M.UI)((t=>u(function(t){const e=t=>(0,M.EQ)((()=>""),(t=>"b"+JSON.stringify(t)))(t.bound),n=t=>{switch(t.operation){case"add":return"p";case"mul":return"m";case"max":return"v";case"min":return"n"}},r=t=>{const r=e(t[1])+n(t[1]);return 1===t[2]?r:r+JSON.stringify(t[2])};return t.map(r).join("")}(t))))(t.commands),function(t){const e=t=>{switch(t.kind){case"bottom":return{kind:"null",value:null};case"top":return u(t.error);case"inner":return c(t.a)}},n=t=>A([tt,et,t=>(0,o.zG)(t,rt,l,M.G)],(e=>e(t))),r=t=>A([tt,nt,t=>(0,o.zG)(t,rt,(t=>z(t,(([t,e])=>[JSON.stringify(t),e]))),l,M.G)],(e=>e(t)));switch(t.kind){case"tuple":return t.tuple.map(e);case"stringGroup":return n(t.group);case"numberGroup":return r(t.group)}}(t.payload)))):M.YP}function Z(t){switch(t.kind){case"unbounded":return t.group.size>0;case"windowed":return t.group.size>0||(0,M.pC)(t.key);case"countLimit":case"uniqueLimit":return t.group.size>0||(0,M.pC)(t.limit)}}function tt(t){switch(t.kind){case"unbounded":return M.YP;case"windowed":return(0,M.G)(u("w"));case"countLimit":return(0,M.G)(u(1===t.n?"x":`x${t.n}`));case"uniqueLimit":return(0,M.G)(u(1===t.n?"u":`u${t.n}`))}}function et(t){switch(t.kind){case"unbounded":return M.YP;case"windowed":return(0,M.G)(u((0,M.pC)(t.key)?t.key.value:""));case"countLimit":case"uniqueLimit":return(0,M.G)(u((0,M.pC)(t.limit)?t.limit.value:""))}}function nt(t){switch(t.kind){case"unbounded":return M.YP;case"windowed":return(0,M.pC)(t.key)?(0,M.G)(c(t.key.value)):(0,M.G)({kind:"null",value:null});case"countLimit":case"uniqueLimit":return(0,M.pC)(t.limit)?(0,M.G)(c(t.limit.value)):(0,M.G)({kind:"null",value:null})}}function rt(t){switch(t.kind){case"unbounded":case"windowed":case"countLimit":case"uniqueLimit":return t.group}}function it(t){switch(t.kind){case"array":return 0===t.value.length?{kind:"null",value:null}:1===t.value.length?it(t.value[0]):d(t.value.map(it));case"object":return(0,o.zG)(j(t.value,(([t,e])=>"null"!==e.kind)),(t=>z(t,(t=>[t[0],it(t[1])]))),l);default:return t}}function ot(t){const e=t=>{if(0===t.length)return{kind:"bottom"};const e=(t=>{if(4!==t.length)return M.YP;const[e,n,r,i]=t;if("string"===e.kind&&"string"===n.kind&&"object"===i.kind){const t=(0,M.DT)((t=>st(t[1].value)&&at(t[2].value)))({1:e,2:n});return(0,M.UI)((t=>({prim:t[1].value,grp:t[2].value,cutoff:r,m:i.value})))(t)}return M.YP})(t);if((0,M.pC)(e)){const{prim:t,grp:n,cutoff:r,m:i}=e.value,o=ut(r,i,ct(n));return"string"==typeof o?g(o):p(S(dt(t),o))}const n=(t=>{if(3!==t.length)return M.YP;const[e,n,r]=t;if("string"===e.kind&&"object"===r.kind){const t=(0,M.DT)((t=>at(t.value)))(e);return(0,M.UI)((t=>({grp:t.value,cutoff:n,m:r.value})))(t)}return M.YP})(t);if((0,M.pC)(n)){const{grp:t,cutoff:e,m:r}=n.value,i=ut(e,r,ct(t));return"string"==typeof i?g(i):p(S(M.YP,i))}const r=(t=>{if(2!==t.length)return M.YP;const[e,n]=t;if("string"===e.kind&&"object"===n.kind){const t=(0,M.DT)((t=>st(t.value)))(e);return(0,M.UI)((t=>({prim:t.value,m:n.value})))(t)}return M.YP})(t);if((0,M.pC)(r)){const{prim:t,m:e}=r.value;return p(S(dt(t),w(m(e))))}const i=(t=>{if(1!==t.length)return M.YP;const[e]=t;return"object"===e.kind?(0,M.G)({m:e.value}):M.YP})(t);if((0,M.pC)(i)){const{m:t}=i.value;return p(S(M.YP,w(m(t))))}const o=(t=>{if(t.length<1)return M.YP;const[e,...n]=t;if("string"===e.kind){const t=(0,M.DT)((t=>st(t.value)))(e);return(0,M.UI)((t=>({prim:t.value,rest:n})))(t)}return M.YP})(t);if((0,M.pC)(o)){const{prim:t,rest:e}=o.value;return p(S(dt(t),ft(e)))}return p(S(M.YP,ft(t)))},n=t=>"array"===t.kind?(0,U.tS)(n)(t.value):[t];return"null"===t.kind?E({kind:"bottom"}):E(e(n(t)))}function st(t){const e=t.split("");if(!0==(0===e.length))return!1;{const[t,...n]=e;return-1!=="bpmvn".indexOf(t)&&n.every((t=>-1!=="bpmvn0123456789.".indexOf(t)))}}function at(t){const e=t.split("");switch(!0){case 0===e.length:return!1;case"w"===e[0]&&void 0===e[1]:return!0;default:{const[t,...n]=e;return-1!=="ux".indexOf(t)&&-1===n.map((t=>!isNaN(parseInt(t)))).indexOf(!1)}}}function ut(t,e,n){switch(t.kind){case"string":return w(n({1:(0,M.G)(t.value),2:e}));case"number":case"null":return y(n({1:"null"===t.kind?M.YP:(0,M.G)(t.value),2:j(z(e,(([t,e])=>[Number(t),e])),(t=>!isNaN(t[0])))}));default:return"{bad cutoff}"}}function ct(t){const e=t=>e=>b(e[2],e[1],t),n=t=>e=>v(e[2],e[1],t),r=t.split("");switch(!0){case"w"===r[0]&&void 0===r[1]:return t=>_(t[2],t[1]);case"u"===r[0]&&void 0===r[1]:return e(1);case"u"===r[0]&&void 0!==r[1]:return e(parseInt(r.slice(1).join("")));case"x"===r[0]&&void 0===r[1]:return n(1);case"x"===r[0]&&void 0!==r[1]:return n(parseInt(r.slice(1).join("")));default:throw new Error("This should never happen if you use isGroupCommand")}}function dt(t){const e=t=>(0,M.Wi)(t.bound)||"add"===t.operation||"mul"===t.operation?(0,M.G)(t):M.YP,n=(t,n,r)=>{const i=((t,n)=>(0,o.zG)(t,(t=>{switch(t){case"p":return(0,M.G)("add");case"m":return(0,M.G)("mul");case"v":return(0,M.G)("max");case"n":return(0,M.G)("min");default:return M.YP}}),M.UI((t=>({operation:t,bound:n}))),M.tS(e)))(t,r);return(0,M.UI)((t=>{const{init:e,rest:r}=(0,U.zT)((t=>{return"number"==typeof(e=parseInt(t))&&isFinite(e)&&Math.floor(e)===e;var e}))(n);return{1:{1:t,2:0===e.length?1:parseInt(e.join(""))},2:r.join("")}}))(i)};return(0,M.UI)(f)((0,C.nI)(lt(t,(t=>{const e=t.split("");if(0===e.length)return M.YP;const[r,...i]=e;if("b"===r){const{init:t,rest:e}=(0,o.zG)(i,(0,U.zT)((t=>-1!=="1234567890.".indexOf(t))));if(0===t.length||0===e.length)return M.YP;const r=parseFloat(t.join("")),[s,...a]=e;return n(s,a,(0,M.G)(r))}return n(r,i,M.YP)}))))}function lt(t,e){const n=e(t);return(0,M.fS)((()=>[]))((0,M.UI)((t=>[t[1]].concat(lt(t[2],e))))(n))}function ft(t){return k(t.map(ht))}function ht(t){switch(t.kind){case"number":return p(t.value);case"string":return g(t.value);case"null":return{kind:"bottom"};case"object":return g("{object}");case"array":return g("{array}")}}var pt=n(1828);const gt={strategy:(t,e,n)=>r=>{if((0,M.Wi)(n))return e;if("delta"===t&&(0,M.Wi)(e))return M.YP;if((0,M.Wi)(e))return n;if((0,M.pC)(e)&&(0,M.pC)(n))return r(e.value,n.value);throw new Error("Non exhaustive match in combineCommand.strategy")},operation:(t,e,n,r,i,s)=>{const a=(0,U.pR)(O(s)),u=(0,o.zG)(e.bound,M.EQ((()=>o.yR),(t=>e=>(0,I.VV)(s)(i.fromNumber(t),e))));if("append"===t&&"add"===e.operation)return(0,U.yL)(n,r,kt("append",(0,o.ls)(i.plus,u)));if("append"===t&&"mul"===e.operation)return(0,U.yL)(n,r,kt("append",(0,o.ls)(i.times,u)));if("append"===t&&"max"===e.operation)return(0,I.Fp)(a)(n,r);if("join"===t&&"add"===e.operation)return(0,U.yL)(n,r,kt("join",(0,I.Fp)(s)));if("join"===t&&"mul"===e.operation)return(0,U.yL)(n,r,kt("join",(0,I.Fp)(s)));if("join"===t&&"max"===e.operation)return(0,I.Fp)(a)(n,r);if("min"===e.operation)return gt.operation(t,{operation:"max",bound:e.bound},n,r,i,function(t){return(0,I.Zt)(((e,n)=>T(t.compare(e,n))))}(s));if("delta"===t&&"max"===e.operation)return(0,I.gt)(a)(n,r)?n:r.map(h);if("delta"===t)return(0,U.yL)(n,r,((t,e)=>(0,I.gt)(O(s))(t,e)?D(t,u):{kind:"bottom"}));throw new Error("Non exhaustive match in combineCommand.operation")},extend:(t,e,n,r)=>{if("delta"===t&&"top"===n.kind&&"top"===r.kind)return(0,I.gt)(P.Df)(n.error,r.error)?g(n.error):{kind:"bottom"};if("delta"===t&&"bottom"===r.kind)return n;if("delta"===t&&"bottom"===n.kind)return{kind:"bottom"};if("top"===n.kind&&"top"===r.kind)return g((0,I.Fp)(P.Df)(n.error,r.error));if("top"===n.kind)return n;if("top"===r.kind)return r;if("inner"===n.kind&&"inner"===r.kind)return e(n.a,r.a);if("bottom"===n.kind)return r;if("bottom"===r.kind)return n;throw new Error("Non exhaustive match in extend")}},mt={fromNumber:o.yR,plus:(t,e)=>t+e,times:(t,e)=>t*e};function _t(t,e,n,r){if("unbounded"===t.kind&&"unbounded"===e.kind){const i=t.group,o=e.group;return(0,M.fS)(h)((0,M.UI)((t=>p(m(t))))(q(i,o,n,r)))}if("windowed"===t.kind&&"windowed"===e.kind){const i=t.key,o=t.group,s=e.key,a=e.group,u=(0,I.Fp)((0,M.pR)(r))(i,s);return(0,M.fS)(h)((0,M.UI)((t=>p(_(t,u))))(q(o,a,n,r)))}if("countLimit"===t.kind&&"countLimit"===e.kind){const i=t.n,o=e.n;if(i===o){const o=t.limit,s=t.group,a=e.limit,u=e.group,c=(0,I.Fp)((0,M.pR)(r))(o,a);return(0,M.fS)(h)((0,M.UI)((t=>p(v(t,c,i))))(q(s,u,n,r)))}return g("Non matching counts")}if("uniqueLimit"===t.kind&&"uniqueLimit"===e.kind){const i=t.n,o=e.n;if(i===o){const o=t.limit,s=t.group,a=e.limit,u=e.group,c=(0,I.Fp)((0,M.pR)(r))(o,a);return(0,M.fS)(h)((0,M.UI)((t=>p(b(t,c,i))))(q(s,u,n,r)))}return g("Non matching counts")}return g("Non matching group types")}function vt(t,e,n){return(0,M.fS)(a)(bt(t,M.YP)(e,n))}function bt(t,e){const n=e=>(n,r)=>gt.strategy(t,n,r)(bt(t,e)),r=(e,r,i)=>{if("stringGroup"===r.kind&&"stringGroup"===i.kind){const t=_t(r.group,i.group,n(e),P.Df);return D(t,(t=>w(wt(t,P.Df))))}if("numberGroup"===r.kind&&"numberGroup"===i.kind){const t=_t(r.group,i.group,n(e),L.Df);return D(t,(t=>y(wt(t,L.Df))))}if("tuple"===r.kind&&"tuple"===i.kind){const n=(0,M.pC)(e)?e.value:[];return p(k(function(t,e,n,r,i,o){const s=(t,e)=>({1:(0,U.ke)(t)(e).concat((0,U.KB)(Math.max(0,t-e.length),h)),2:(0,U.md)(t)(e)}),a=(e,n,r)=>{if(0===e.length)return gt.operation(t,{operation:"max",bound:M.YP},n,r,i,o);if(e.length>0){const[u,...c]=e,d=s(u[2],n),l=d[1],f=d[2],h=s(u[2],r),p=h[1],g=h[2];return gt.operation(t,u[1],l,p,i,o).concat(a(c,f,g))}throw new Error("Non exhaustive match in recurse")};return(0,U.GY)((0,U.Qp)((t=>"bottom"===t.kind))((0,U.GY)(a(e,n,r))))}(t,n,r.tuple,i.tuple,mt,L.Df)))}throw new Error(`Non matching payload. Got ${r.kind} and ${i.kind}`)},i=(t,n)=>{if((0,M.Eh)((0,C.Eh)((0,R.n_)({1:(0,R.n_)({operation:P.Eq,bound:(0,M.Eh)(L.Eq)}),2:L.Eq}))).equals(t.commands,n.commands)){const i=(0,M.Wi)(t.commands)?e:t.commands,o=r(i,t.payload,n.payload);return D(o,(e=>S(t.commands,e)))}if(i=t.commands,s=n.commands,(0,M.Eh)((0,C.Eh)((0,R.n_)({1:(0,R.n_)({operation:P.Eq}),2:L.Eq}))).equals(i,s)){const i=(0,o.zG)(((t,e)=>(0,o.zG)((0,pt.gz)(M.G5)(t,e),(0,M.UI)((([t,e])=>C.yL(t,e,((t,e)=>({1:{operation:t[1].operation,bound:(0,o.zG)((0,pt.gz)(M.G5)(t[1].bound,e[1].bound),M.UI((([t,e])=>Math.min(t,e))),M.wp((()=>t[1].bound)),M.wp((()=>e[1].bound)))},2:t[2]})))))))(t.commands,n.commands),M.wp((()=>e))),s=r(i,t.payload,n.payload);return D(s,(t=>S(i,t)))}throw new Error(`Non matching primitive strings. Got ${V(t)} and ${V(n)}`);var i,s};return(e,n)=>J(E(gt.extend(t,i,ot(e).state,ot(n).state)))}function yt(t,e,n){const r=(0,M.UI)((e=>j(t,(([t,r])=>(0,I.gf)(n)(t,e)))))(e);return(0,M.fS)((()=>t))(r)}function wt(t,e){switch(t.kind){case"unbounded":return t;case"windowed":return(0,M.Wi)(t.key)?t:_(yt(t.group,t.key,e),t.key);case"countLimit":{const n=t.limit,r=t.n,i=t.group,o=G(r,i,((t,e)=>e<=1?M.YP:(0,M.G)(e-1)),e),s=(0,I.Fp)((0,M.pR)(e))(n,o);return v(yt(i,s,e),s,r)}case"uniqueLimit":{const n=t.limit,r=t.n,i=t.group,o=(t,e)=>{if("object"===t.kind){const n=[...t.value.keys(),...e.keys()],i=new Set(n);return i.size>=r?M.YP:(0,M.G)(i)}return M.YP},s=G(new Set,i,o,e),a=(0,I.Fp)((0,M.pR)(e))(n,s);return b(yt(i,a,e),a,r)}}}function kt(t,e){return(n,r)=>gt.extend(t,((t,n)=>p(e(t,n))),n,r)}var Et=n(5151),St=n(922),It=n(2652),Pt=n(4730),Dt=n(8036);class Ot{constructor(t,e,n){this.externalData=t,this.localQueries=e,this.externalQueries=n,this.queryCodesAsList=[],this.queryCodesAsMap={};const r=this.externalData.getExternalJsonData(St.mL)||[],i=(0,o.zG)((0,M.Y3)((()=>r.filter((t=>(0,Dt.UC)(t,this.localQueries,this.externalQueries))))),(0,M.fS)((()=>[])));this.add(i)}add(t){return(0,o.zG)(t.forEach((t=>this.queryCodesAsMap[t]=!0)),(t=>this.updateSegmentsList()))}remove(t){return(0,o.zG)(t.forEach((t=>delete this.queryCodesAsMap[t])),(t=>this.updateSegmentsList()))}getAllAsList(){return this.queryCodesAsList}getAllAsMap(){return this.queryCodesAsMap}getUpdates(t){const e=[],n=[];return Object.entries(t).forEach((t=>{let[r,i]=t;const o=parseInt(r),s=(null==i?void 0:i.result)||{result:!1},a=!0===(null==s?void 0:s.result)&&!(o in this.queryCodesAsMap),u=!1===(null==s?void 0:s.result)&&o in this.queryCodesAsMap;a?e.push(o):u&&n.push(o)})),{entered:e,exited:n}}flush(){this.externalData.setExternalJsonData(St.mL,this.getAllAsList())}reset(){this.externalData.removeExternalData(St.mL),this.queryCodesAsList=[],this.queryCodesAsMap={}}updateSegmentsList(){this.queryCodesAsList=Object.keys(this.queryCodesAsMap).map((t=>parseInt(t)))}}const Mt="bootstrap",Ct="process",Ut="processTransitions",xt="updateExternalState",Tt="updateLAL",At="updateTPD";var qt=n(2851),Gt=n(3328);const zt="permutive:query:changed",jt="internal_query_states",Rt="external_query_states",Lt=t=>class extends t{constructor(){super(...arguments),this.prefix="[Query Manager]",this.isWorkerReady=!1,this.stateMap={value:{},promise:Promise.resolve({})},this.extStateMap={},this.userSegments=new Ot(this.externalData,this.queryMetadata,this.externalQueries),this.segmentEntryQueryCodes=new Set,this.segmentExitQueryCodes=new Set,this.cohortEntryQueryCodes=new Set,this.cohortExitQueryCodes=new Set,this.hasNewOrModifiedQueries=!1,this.queriesNoStateCount=0,this.scheduler=new Pt.b(this.transitionDebounceTime,this.transitionDebounceMaxTime),this.debouncedProcessTransitions=this.makeDebouncedProcessTransitions(),this.registerListenersOnlyOnce=(0,It.HP)((()=>{this.lalRef.onChange(M.UI((t=>this.postMessage(Tt,[t])()))),this.tpdRef.onChange(M.UI((t=>this.postMessage(At,[t])())))}));const[t,e]=qt.Ue(this.userSegments.getAllAsList());this.queryCodesRef=(0,o.zG)(t,qt.D8(Gt.Eh(L.Eq))),this.queryCodesRefUpdate=e;const[n,r]=qt.Ue(Promise.resolve(M.YP));this.processingStatus=n,this.setProcessingStatus=r,this.segments=(0,o.zG)(n,qt.UI((t=>t.then((()=>this.queryCodesRef.current)))),qt.UI((t=>()=>t)),(t=>qt.vP(this.queryCodesRef,t)),qt.UI((t=>{let[e,n]=t;return[e,n]})));const i=(0,o.zG)(this.viewId.ref,qt.UI((t=>new Promise((e=>{const n=this.processingStatus.onChange((r=>r.then((0,o.ls)(M.hX((t=>"Pageview"===t.name)),M.hX((e=>e.view_id===t)),M.UI((()=>{n(),e()}))))))})))));this.pageviewSegments=(0,o.zG)(i,qt.UI((t=>t.then((()=>this.queryCodesRef.current)))),qt.UI((t=>()=>t)),(t=>qt.vP(this.queryCodesRef,t)),qt.UI((t=>{let[e,n]=t;return[e,n]})));const[s,a]=qt.Ue(qt.a9(M.YP));this.setLalRef=a,this.lalRef=qt.xH(s);const[u,c]=qt.Ue(qt.a9(M.YP));this.setTpdRef=c,this.tpdRef=qt.xH(u)}get queryCodesAsRef(){return this.queryCodesRef}makeStateMaps(){const t=this.permutiveData.getData(jt)||{},e=this.permutiveData.getData(Rt)||{};for(const e in t)if("activations"in t[e]){const n=t[e].activations;for(const t in n)n[t]=[...new Set(n[t])]}this.logDebug("Cached state maps",{internal:t,external:e});const n=Object.keys(this.queryMetadata),r=Object.keys(t);this.hasNewOrModifiedQueries=n.length!==r.length||n.filter((e=>{var n;return this.queryMetadata[e]!==(null===(n=t[e])||void 0===n?void 0:n.checksum)})).length>0,this.logDebug("has new or modified queries",this.hasNewOrModifiedQueries);const i=this.hasNewOrModifiedQueries?(0,It.fl)(t,(e=>{var n;const r=null===(n=t[e])||void 0===n?void 0:n.checksum,i=r===this.queryMetadata[e];return i||this.logDebug(`Dropping state for query ${e}, mismatched checksum`,{cachedChecksum:r,checksum:this.queryMetadata[e]}),i})):t;this.queriesNoStateCount=n.filter((t=>!i[t])).length,this.logDebug(`has no state for ${this.queriesNoStateCount} queries`),this.extStateMap=this.hasNewOrModifiedQueries?this.dropExternalStateMissingFromStateMap(e,i):e,this.stateMap={value:i,promise:Promise.resolve(i)},this.logDebug("Initialised state maps",{internal:this.stateMap.value,external:this.extStateMap,metadata:this.queryMetadata});this.permutiveData.getData("query_states")&&this.permutiveData.deleteKey("query_states")}dropExternalStateMissingFromStateMap(t,e){const n=(0,It.fl)(t,(t=>t in e));return this.permutiveData.setData(Rt,n),n}makeDebouncedProcessTransitions(){return this.scheduler.scheduleAccumulated((t=>this.processTransitions(t)()),{concat:(t,e)=>t.concat(e),empty:[]})}makeMessage(t,e,n){return{type:t,payload:(0,o.bc)(this.queryMetadata,this.extStateMap,...e),stateMap:n,userId:this.userId.get()}}trackTransition(t,e){const n=St.ED?this.customProperties.getCustomProps():{},r=Object.assign(Object.assign(Object.assign({},n),{segment_number:e}),{});t?(this.segmentEntryQueryCodes.add(e),this.cohortEntryQueryCodes.add(e.toString())):(this.segmentExitQueryCodes.add(e),this.cohortExitQueryCodes.add(e.toString())),this.permutive.track(t?"SegmentEntry":"SegmentExit",r)}trackSegmentsTransition(t,e){t.forEach((t=>{this.trackTransition(!0,t),this.messages.emit(zt,{queryCode:t,result:{result:!0}})})),e.forEach((t=>{this.trackTransition(!1,t),this.messages.emit(zt,{queryCode:t,result:{result:!1}})}))}updateUserSegments(t,e){t.length>0&&this.userSegments.add(t),e.length>0&&this.userSegments.remove(e),(t.length>0||e.length>0)&&(this.userSegments.flush(),this.queryCodesRefUpdate(this.userSegments.getAllAsList()))}onStateChangeReady(t){const{entered:e,exited:n}=this.userSegments.getUpdates(t);this.trackSegmentsTransition(e,n),this.updateUserSegments(e,n),this.logDebug("Updating query state",{updatedStateMap:t}),this.permutiveData.setData(jt,t);return(e.length>0||n.length>0)&&(this.logDebug("Updated cohorts",{entered:e,exited:n}),this.messages.emit("permutive:segments:updated")),{segmentsEntered:new Set(e),segmentsExited:new Set(n),cohortsEntered:new Set(e.map(String)),cohortsExited:new Set(n.map(String))}}postMessage(t,e){const n=()=>({segmentsEntered:new Set,segmentsExited:new Set,cohortsEntered:new Set,cohortsExited:new Set});return(0,o.ls)((()=>(0,o.a9)(this.stateMap.promise)),Et.UI((n=>this.makeMessage(t,e,n))),Et.tS((t=>this.processMessage(t))),s.UI((t=>this.userId.get()===t.userId?t:{diff:{},errors:[]})),s.UI((0,It.bw)((t=>{t.errors.length>0&&this.api.reportError(`QL error(s). Got ${t.errors.join("; ")}`,this.userId.get())}))),s.UI((t=>{let{diff:e,externalStateToDrop:r}=t;if(r){const t=(0,It.fl)(this.stateMap.value,(t=>!(t in r)));this.extStateMap=this.dropExternalStateMissingFromStateMap(this.extStateMap,t)}this.stateMap.value=Object.assign(Object.assign({},this.stateMap.value),e);const i=this.isWorkerReady?this.onStateChangeReady(this.stateMap.value):n();return{updatedStateMap:this.stateMap.value,result:(0,o.bc)(e,i)}})),s.fS((t=>(this.api.reportError(`Error during query execution. Got ${t}`,this.userId.get()),Et.of({updatedStateMap:this.stateMap.value,result:(0,o.bc)({},n())})))),(t=>t()),(t=>(this.stateMap.promise=t.then((t=>t.updatedStateMap)),t.then((t=>t.result)))))}processTransitions(t){return this.postMessage(Ut,[t])}bootstrap(t){return(0,o.zG)(pt.gz(Et.oE)(this.postMessage(Mt,[{segments:{"1p":this.userSegments.getAllAsMap()},sessionId:this.sessionManager.getSessionId(),viewId:this.viewId.get(),lookalikeModels:this.lalRef.current,thirdPartydata:this.tpdRef.current},t]),(()=>Promise.resolve(this.registerListenersOnlyOnce()))),Et.UI((t=>{let[e]=t;return e})),Et.At((()=>()=>{this.hasNewOrModifiedQueries&&this.metrics.track({name:"sdk_queries_to_replay_count",value:t.length>0?this.queriesNoStateCount:0,labels:{}})})))}process(t,e){return(0,o.zG)((0,Dt.AG)(t)?()=>this.debouncedProcessTransitions([t]):this.processStandard([t],e),(e=>()=>{const n=e();return this.setProcessingStatus(this.processingStatus.current.then((()=>n.then((()=>M.G(t)),(()=>M.G(t)))))),n}))}processStandard(t,e){return(0,o.zG)(this.postMessage(Ct,[t]),Et.UI((0,It.bw)((()=>{e&&this.setAsRealTimeifNeeded(t)}))))}updateExternalState(t){return(0,o.zG)((()=>{const e=(0,It.b0)(t,((t,e)=>{const n=this.queryMetadata[t];return n&&e[n]?(0,M.Uo)($(e[n])):M.YP})),n=(0,It.b0)(this.extStateMap,((t,e)=>(0,M.Uo)($(e)))),r=(t,e,n)=>(0,o.zG)((0,M.Y3)((()=>(this.logDebug("Joining external state",{newExtState:t,currentExtState:e}),vt("join",t,e)))),(0,M.fS)((()=>(this.api.reportError(`Failed to join external state for query: ${n}. Had ${B(e)}, received ${B(t)}}`,this.userId.get()),t)))),i=(0,It.b0)(Object.assign(Object.assign({},n),e),((t,e)=>n[t]?(0,M.G)(K(r(e,n[t],t))):(0,M.G)(K(e))));return this.permutiveData.setData(Rt,i),this.extStateMap=i,Promise.resolve()}),Et.tS((()=>this.postMessage(xt,[]))))}reset(){this.userSegments.reset(),this.setProcessingStatus(Promise.resolve(M.YP)),this.queryCodesRefUpdate(this.userSegments.getAllAsList()),this.permutiveData.setData(jt,{}),this.permutiveData.setData(Rt,{}),this.stateMap={value:{},promise:Promise.resolve({})},this.extStateMap={}}setAsReady(){this.isWorkerReady=!0,this.onStateChangeReady(this.stateMap.value),this.messages.emit("permutive:queries:initialised")}getStateSizeInBytes(){return 2*JSON.stringify(this.stateMap.value).length}setAsRealTimeifNeeded(t){return!this.realtime.isRealtime()&&t.filter((t=>"Pageview"===t.name)).length>0?this.realtime.setAsRealtime(this.userSegments.getAllAsList().length):void 0}logDebug(){for(var t=arguments.length,e=new Array(t),n=0;n(0,Bt.t_)(this.queryWorker.postMessage(Object.assign({engine:"QLE"},t)))),i.w)}}class Wt extends((()=>(0,o.zG)($t,Lt))()){constructor(t){super(t),this.makeStateMaps()}}},8318:(t,e,n)=>{n.d(e,{F:()=>f});var r=n(3735),i=n(365),o=n(6567),s=n(4767),a=n(1628),u=n(3992),c=n(2851),d=n(3328),l=n(2652);const f=(0,r.zG)(i.Y3((()=>(0,a.e)()),(t=>`Failed to create worker. Got ${t}`)),i.YO("workers"),i.Hr("errors",(t=>{let{workers:[e]}=t;const[n,r]=c.gS(d.uZ());return e.addEventListener("error",(t=>r([`Underlying worker emitted error: ${t.message}`]))),n})),i.Hr("initialMessage",(0,r.ls)(s.it((t=>{let{workers:[,e]}=t;return new Promise(((t,n)=>{const r=new Date;(0,u.t_)(e.postMessage(Object.assign({engine:"QLE",type:"noop",userId:""},{}))).then((()=>t(o.G({responseMs:(new Date).getTime()-r.getTime()})))).catch(n);setTimeout((()=>t(o.YP)),1e4)}))}),(t=>`Failed to send initial message to worker. Got ${t}`)),(t=>t()))),i.Hr("enableReporting",(t=>function(e){(0,r.zG)((()=>t.initialMessage),s.aD((t=>e.reportError(t)),(0,r.ls)((0,l.bw)((0,r.ls)(o.EQ((()=>"timeout"),(()=>"success")),(t=>e.metrics.track({name:`sdk_web_worker_initial_response_${t}_count_total`,value:1,labels:{}})))),(0,l.bw)(o.UI((t=>{let{responseMs:n}=t;return e.metrics.track({name:"sdk_web_worker_initial_response_seconds",value:n/1e3,labels:{}})}))))),(t=>t())),(0,r.zG)(t.errors,c.YP((0,r.ls)((t=>t()),d.UI((t=>e.reportError(t))))))})),i.UI((t=>{let{workers:[,e],enableReporting:n}=t;return{worker:e,enableReporting:n}})),s.Uo)},3622:(t,e,n)=>{n.d(e,{$:()=>i});var r=n(2652);class i{constructor(t){this.permutiveData=t,this.eventSourceId=t.getData("event-source-id")||this.generateAndStoreEventSourceId()}get(){return this.eventSourceId}generateAndSet(){this.eventSourceId=this.generateAndStoreEventSourceId()}generateAndStoreEventSourceId(){const t=(0,r.k$)();return this.permutiveData.setData("event-source-id",t),t}}},1229:(t,e,n)=>{n.d(e,{N:()=>h,e:()=>l});var r=n(7582),i=n(2688),o=n(7183),s=n(365),a=n(3735),u=n(4730),c=n(8036),d=n(3992);function l(){{const t=n(4386).Z;return(0,o.h)(new t)}}const f={concat:(t,e)=>Object.assign(Object.assign({},t),e),empty:{}};class h{constructor(t,e,n,r,i,o,s,a,l){this.api=t,this.network=e,this.sessionManager=n,this.permutiveData=r,this.queryManager=i,this.metrics=o,this.userId=s,this.eventSourceId=a,this.stateWorker=l,this.DEBOUNCE_TIME=1e3,this.MAX_DEBOUNCE_TIME=5e3,this.fetchUnseenState=!0,this.scheduler=new u.b(this.DEBOUNCE_TIME,this.MAX_DEBOUNCE_TIME),this.debouncedSyncIfNotEmpty=this.scheduler.scheduleAccumulated((t=>this.syncIfNotEmpty.bind(this)("standard",t)),f),this.fetchUnseenState=!!p.includes("8230918b-a7dd-44fb-a85a-7ff990c4d151")||this.sessionManager.sessionHasChanged(),this.stateOffset=this.permutiveData.getData("state_offset")||0,this.lastSentStateMapWithChecksum=(0,c.Yh)(this.permutiveData.getData("internal_query_states")||{}),(0,d.t_)(this.stateWorker.postMessage({engine:"SSE",type:"noop"}))}sync(t){return(0,a.zG)(this.debouncedSyncIfNotEmpty(t),(t=>Promise.resolve()))}syncWithUnseen(){return this.syncIfNotEmpty("unseen",{}).then(a.Q1)}syncIfNotEmpty(t,e){const[n,r,o]="standard"===t?[this.stateOffset,e,this.fetchUnseenState]:"unseen"===t?[this.stateOffset,this.queryManager.stateMap.value,!0]:[0,{},!0],s=this.metrics.startTimer("sdk_compute_delta_seconds",{}),u={type:"delta",stateMap:r,lastSentStateMapWithChecksum:this.lastSentStateMapWithChecksum},c=(0,a.zG)(this.stateWorker.postMessage(Object.assign({engine:"SSE"},u)),d.t_,(t=>t.then((t=>(this.metrics.stopTimer("sdk_compute_delta_seconds",s),t))))),l=t=>{this.fetchUnseenState=!1;const e=(0,a.ls)((t=>this.api.reportError(`Error sending state delta. Got ${(0,i.w)(t)}`,this.userId.get())),(t=>({})));return this.api.state(this.metrics,this.userId.get(),this.eventSourceId.get(),t,n,o).then((t=>function(t){return!!t}(t)?this.onStateResponse(t):{})).then((e=>(this.lastSentStateMapWithChecksum=t,e))).catch(e)};return c.then((t=>o||Object.keys(t).length>0?l(t):Promise.resolve({})))}resetSync(){return(0,r.mG)(this,void 0,void 0,(function*(){this.reset(),yield this.syncIfNotEmpty("reset",{})}))}reset(){this.lastSentStateMapWithChecksum={}}onStateResponse(t){const e=(0,s.Y3)((()=>JSON.parse(t.state)),(t=>this.api.reportError(`Failed to parse State API response, got ${t}`,this.userId.get()))),n=t=>t?this.queryManager.updateExternalState(t)():(0,a.Q1)();return(0,s.tO)(e)?(0,a.zG)(t.state_offset,(t=>this.stateOffset=t),(t=>this.permutiveData.setData("state_offset",t)),(t=>n(e.right)),(t=>e.right)):{}}}const p=["fe68d1f7-c9f4-45b3-8905-7cda73d3fd74"]},926:(t,e,n)=>{n.d(e,{Kd:()=>i,eJ:()=>o});n(9853);var r=n(2116);n(2851),n(2652);const i="addon:twitter_pixel",o=function(t){return r.K4((()=>{}))}},1828:(t,e,n)=>{n.d(e,{Yt:()=>d,ap:()=>o,gz:()=>c});var r=n(3735),i=n(9384);function o(t,e){return function(n){return function(r){return t.ap(t.map(r,(function(t){return function(n){return e.ap(t,n)}})),n)}}}function s(t,e,n){return function(r){for(var i=Array(n.length+1),o=0;o{n.d(e,{Ce:()=>d,DY:()=>E,DZ:()=>x,Ew:()=>b,GY:()=>k,KB:()=>f,Qp:()=>v,f2:()=>y,fw:()=>j,jV:()=>D,ke:()=>p,md:()=>_,oA:()=>T,pR:()=>L,t9:()=>I,tS:()=>M,u4:()=>G,uK:()=>A,xH:()=>C,yL:()=>S,zT:()=>m});var r=n(3735),i=(n(7341),n(9384)),o=n(1885),s=n(3328),a=n(4870),u=(n(5605),function(t){return 0===t.length}),c=o.Od,d=o.Ce,l=(o.ws,o.R3),f=(o.Im,function(t,e){return t<=0?[]:o.KB(e)(t)});var h=o.dC,p=(s.P5,s.YM,s.Z$,function(t){return function(e){return h(t,e)?w(e):e.slice(0,t)}});var g=function(t,e){for(var n=t.length,r=0;r=e.length?[]:e.slice(t,e.length)}};function v(t){return function(e){return e.slice(g(e,t))}}s.cx;function b(t){return s.Ew(t)}var y=s.f2;s.JO,s.qr;var w=function(t){return t.slice()},k=function(t){return u(t)?[]:t.slice().reverse()},E=function(t){return function(e){return e.length<=1?w(e):e.slice().sort(t.compare)}},S=function(t,e,n){for(var r=[],i=Math.min(t.length,e.length),o=0;o=1&&c(e)?o.lx(t)(e):u(e)?[w(e),[]]:[[],w(e)]}};function D(t){var e=I(t);return function(n,r){if(void 0===r){var i=D(t);return function(t){return i(t,n)}}return n.filter((function(t){return e(t,r)}))}}s.kp,s.Eq;var O=o.of,M=function(t){return function(e){return(0,r.zG)(e,function(t){return function(e){for(var n=[],r=0;r{function r(t){return function(e){return function(n){return t.chain(n,(function(n){return t.map(e(n),(function(){return n}))}))}}}function i(t){return function(e,n){return function(r){return t.chain(r,(function(r){return t.map(n(r),(function(t){var n;return Object.assign({},r,((n={})[e]=t,n))}))}))}}}n.d(e,{a:()=>i,m:()=>r})},365:(t,e,n)=>{n.d(e,{g1:()=>b,G5:()=>v,dO:()=>g,wp:()=>I,Pd:()=>E,ak:()=>N,YO:()=>$,tS:()=>w,um:()=>z,g_:()=>A,ij:()=>L,Yo:()=>O,DT:()=>D,fS:()=>G,pF:()=>q,nM:()=>M,tO:()=>C,t$:()=>u,Hr:()=>W,UI:()=>p,Vn:()=>S,EQ:()=>T,aD:()=>U,vx:()=>R,F2:()=>c,LF:()=>j,i$:()=>K,Y3:()=>B});var r=n(6862),i=n(2690),o=n(3735),s=n(7341),a=n(9384),u=a.t$,c=a.F2,d=function(t,e){return(0,o.zG)(t,p(e))},l=function(t,e){return(0,o.zG)(t,_(e))},f=function(t,e){return(0,o.zG)(t,w(e))},h="Either",p=function(t){return function(e){return M(e)?e:c(t(e.right))}},g={URI:h,map:d},m=c,_=function(t){return function(e){return M(e)?e:M(t)?t:c(e.right(t.right))}},v={URI:h,map:d,ap:l},b={URI:h,map:d,ap:l,of:m},y=function(t){return function(e){return M(e)?e:t(e.right)}},w=y,k={URI:h,map:d,ap:l,chain:f},E=function(t,e){return function(n){return M(n)?u(t(n.left)):c(e(n.right))}},S=function(t){return function(e){return M(e)?u(t(e.left)):e}},I=function(t){return function(e){return M(e)?t():e}},P={URI:h,fromEither:o.yR},D=(0,i.DT)(P),O=(0,i.Yo)(P),M=a.nM,C=a.tO,U=function(t,e){return function(n){return M(n)?t(n.left):e(n.right)}},x=U,T=U,A=T,q=function(t){return function(e){return M(e)?t(e.left):e.right}},G=q,z=y(o.yR),j=function(t){return M(t)?c(t.left):u(t.right)},R=function(t){return function(e){return M(e)?t(e.left):e}},L=function(t){return function(e){return null==e?u(t):c(e)}},B=function(t,e){try{return c(t())}catch(t){return u(e(t))}},K=x(o.yR,o.yR);a.F4;var $=(0,s.YO)(g),W=(0,s.Hr)(g),N=(0,r.a)(k);a.Xl},856:(t,e,n)=>{n.d(e,{EQ:()=>y,F2:()=>a,KQ:()=>f,LF:()=>P,LU:()=>I,LV:()=>w,NG:()=>h,Pd:()=>v,UI:()=>p,Vn:()=>b,ap:()=>g,dQ:()=>S,fS:()=>k,i$:()=>D,ij:()=>l,m8:()=>c,pk:()=>d,t$:()=>u,tS:()=>m,vx:()=>E,wp:()=>_});var r=n(1828),i=n(365),o=n(3735),s=n(7341);function a(t){return(0,o.ls)(i.F2,t.of)}function u(t){return(0,o.ls)(i.t$,t.of)}function c(t){return function(e){return t.map(e,i.F2)}}function d(t){return function(e){return t.map(e,i.t$)}}function l(t){return function(e){return(0,o.ls)(i.ij(e),t.of)}}function f(t){var e=l(t);return function(t){var n=e(t);return function(t){return(0,o.ls)(t,n)}}}function h(t){var e=m(t),n=f(t);return function(t){var r=n(t);return function(t){return e(r(t))}}}function p(t){return(0,s.UI)(t,i.dO)}function g(t){return(0,r.ap)(t,i.G5)}function m(t){return function(e){return function(n){return t.chain(n,(function(n){return i.nM(n)?t.of(n):e(n.right)}))}}}function _(t){return function(e){return function(n){return t.chain(n,(function(n){return i.nM(n)?e():t.of(n)}))}}}function v(t){return function(e,n){return function(r){return t.map(r,i.Pd(e,n))}}}function b(t){return function(e){return function(n){return t.map(n,i.Vn(e))}}}function y(t){return function(e,n){return function(r){return t.map(r,i.EQ(e,n))}}}function w(t){return function(e,n){return function(r){return t.chain(r,i.EQ(e,n))}}}function k(t){return function(e){return function(n){return t.chain(n,i.EQ(e,t.of))}}}function E(t){return function(e){return function(n){return t.chain(n,(function(n){return i.nM(n)?e(n.left):t.of(n)}))}}}function S(t){var e=E(t);return function(n){return e((function(e){return t.map(n(e),(function(t){return i.nM(t)?t:i.t$(e)}))}))}}function I(t){return function(e){return function(n){return t.chain(n,i.EQ((function(n){return t.map(e(n),i.t$)}),(function(e){return t.of(i.F2(e))})))}}}function P(t){return function(e){return t.map(e,i.LF)}}function D(t){return function(e){return t.map(e,i.i$)}}},4268:(t,e,n)=>{n.d(e,{f7:()=>r,n_:()=>i,w4:()=>o});n(3735);var r=function(t){return{equals:function(e,n){return e===n||t(e,n)}}},i=function(t){return r((function(e,n){for(var r in t)if(!t[r].equals(e[r],n[r]))return!1;return!0}))},o={equals:function(t,e){return t===e}};o.equals},2690:(t,e,n)=>{n.d(e,{DT:()=>s,Y$:()=>c,Yo:()=>o,fX:()=>u});var r=n(3735),i=n(9384);function o(t){return function(e){return function(n){return t.fromEither(i.Wi(n)?i.t$(e()):i.F2(n.value))}}}function s(t){return function(e,n){return function(r){return t.fromEither(e(r)?i.F2(r):i.t$(n(r)))}}}function a(t){return function(e){return(0,r.ls)(e,t.fromEither)}}function u(t,e){var n=a(t);return function(t){return function(r){return e.chain(r,n(t))}}}function c(t,e){return function(n,r){return function(o){return e.chain(o,(function(e){return t.fromEither(n(e)?i.F2(e):i.t$(r(e)))}))}}}},1130:(t,e,n)=>{n.d(e,{At:()=>s,oU:()=>o});var r=n(6862),i=n(3735);function o(t,e){return function(n){var r=(0,i.ls)(n,t.fromIO);return function(t){return e.chain(t,r)}}}function s(t,e){var n=(0,r.m)(e);return function(e){return n((0,i.ls)(e,t.fromIO))}}},9679:(t,e,n)=>{n.d(e,{oU:()=>i});var r=n(3735);function i(t,e){return function(n){var i=(0,r.ls)(n,t.fromTask);return function(t){return e.chain(t,i)}}}},7341:(t,e,n)=>{function r(t,e){return function(n){return function(r){return t.map(r,(function(t){return e.map(t,n)}))}}}function i(t){return function(e){return function(n){return t.map(n,(function(t){var n;return(n={})[e]=t,n}))}}}function o(t){return function(e,n){return function(r){return t.map(r,(function(t){var r;return Object.assign({},t,((r={})[e]=n(t),r))}))}}}n.d(e,{Hr:()=>o,UI:()=>r,YO:()=>i})},1885:(t,e,n)=>{n.d(e,{Ce:()=>d,Eh:()=>k,Im:()=>l,KB:()=>m,Od:()=>a,QI:()=>S,R3:()=>f,Ss:()=>I,dC:()=>u,lx:()=>w,nI:()=>g,of:()=>b,oo:()=>h,w6:()=>_,ws:()=>c,yL:()=>y});var r=n(3735),i=(n(7341),n(9384)),o=n(7241),s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i0},u=function(t,e){return t<0||t>=e.length},c=function(t){return function(e){return s([t],e,!0)}},d=c,l=function(t){return function(e){return s(s([],e,!0),[t],!1)}},f=l,h=function(t,e,n){if(a(n)){var r=p(n);return r.splice(t,0,e),r}return[e]},p=i.r1,g=function(t){return a(t)?i.G(t):i.YP},m=function(t){return function(e){for(var n=Math.max(0,Math.floor(e)),r=[t(0)],i=1;i=e.length?[v(e),[]]:[(0,r.zG)(e.slice(1,n),d(E(e))),e.slice(n)]}},k=(o.u4,o.OE,o.nq,o.iw,o.YM,o.ZN,o.Eh),E=(i.F4,o.YM);o.Z$,o.VV,o.Fp,o.j0;function S(t,e){return void 0===e?d(t):(0,r.zG)(e,d(t))}var I=function(t,e){return(0,r.zG)(t,f(e))};o.ur},6567:(t,e,n)=>{n.d(e,{DT:()=>d,DZ:()=>G,EK:()=>f,EQ:()=>W,Eh:()=>w,FS:()=>Z,G:()=>c,G5:()=>D,IS:()=>l,KQ:()=>X,RD:()=>nt,Ri:()=>A,UI:()=>E,Uo:()=>L,Wi:()=>K,Y3:()=>J,YP:()=>u,aD:()=>$,dO:()=>S,fS:()=>Y,g_:()=>N,hX:()=>q,ij:()=>V,mU:()=>H,pC:()=>B,pF:()=>F,pR:()=>k,tS:()=>O,wp:()=>C,xH:()=>Q,xu:()=>R});var r=n(6862),i=n(3735),o=(n(7341),n(9384)),s=n(6017),a=n(4870),u=(n(5605),o.YP),c=o.G;function d(t){return function(e){return t(e)?c(e):u}}var l=function(t){return"Right"===t._tag?u:c(t.left)},f=function(t){return"Left"===t._tag?u:c(t.right)},h=function(t,e){return(0,i.zG)(t,E(e))},p=function(t,e){return(0,i.zG)(t,P(e))},g=function(t,e){return(0,i.zG)(t,O(e))},m=function(t,e){return(0,i.zG)(t,q(e))},_=function(t,e){return(0,i.zG)(t,G(e))},v=function(t,e){return(0,i.zG)(t,z(e))},b=function(t,e){return(0,i.zG)(t,j(e))},y="Option",w=function(t){return{equals:function(e,n){return e===n||(K(e)?K(n):!K(n)&&t.equals(e.value,n.value))}}},k=function(t){return{equals:w(t).equals,compare:function(e,n){return e===n?0:B(e)?B(n)?t.compare(e.value,n.value):1:-1}}},E=function(t){return function(e){return K(e)?u:c(t(e.value))}},S={URI:y,map:h},I=c,P=function(t){return function(e){return K(e)||K(t)?u:c(e.value(t.value))}},D={URI:y,map:h,ap:p},O=function(t){return function(e){return K(e)?u:t(e.value)}},M={URI:y,map:h,ap:p,chain:g},C=function(t){return function(e){return K(e)?t():e}},U=O(i.yR),x=(0,a.s4)(u,u),T=function(t){return K(t)?x:(0,a.s4)(l(t.value),f(t.value))},A={URI:y,compact:U,separate:T},q=function(t){return function(e){return K(e)?u:t(e.value)?e:u}},G=function(t){return function(e){return K(e)?u:t(e.value)}},z=function(t){return function(e){return(0,a.s4)(m(e,(0,s.ff)(t)),m(e,t))}},j=function(t){return(0,i.ls)(E(t),T)},R={URI:y,map:h,compact:U,separate:T,filter:m,filterMap:_,partition:v,partitionMap:b},L=f,B=o.pC,K=function(t){return"None"===t._tag},$=function(t,e){return function(n){return K(n)?t():e(n.value)}},W=$,N=W,F=function(t){return function(e){return K(e)?t():e.value}},Y=F,Q=U,H=(0,r.m)(M),V=function(t){return null==t?u:c(t)},J=function(t){try{return c(t())}catch(t){return u}},X=function(t){return(0,i.ls)(t,V)},Z=W(i.r5,i.yR);o.F4;var tt=I(o.Xl),et=function(t){var e=function(t){return function(e){var n=t(0,o.YM(e));if(K(n))return u;for(var r=[n.value],i=1;i{n.d(e,{Fp:()=>f,Uz:()=>a,VV:()=>l,Zt:()=>s,gf:()=>d,gt:()=>c,lt:()=>u,uZ:()=>h});var r=n(4268),i=n(3735),o=function(t){return function(e,n){return e===n||0===t(e,n)}},s=function(t){return{equals:o(t),compare:function(e,n){return e===n?0:t(e,n)}}},a=function(t){return function(e){return s((function(n,r){return e.compare(t(n),t(r))}))}},u=(i.W8,function(t){return function(e,n){return-1===t.compare(e,n)}}),c=function(t){return function(e,n){return 1===t.compare(e,n)}},d=function(t){return function(e,n){return-1!==t.compare(e,n)}},l=function(t){return function(e,n){return e===n||t.compare(e,n)<1?e:n}},f=function(t){return function(e,n){return e===n||t.compare(e,n)>-1?e:n}},h=function(t){var e=l(t),n=f(t);return function(t,r){return function(i){return n(e(i,r),t)}}};r.w4.equals},6017:(t,e,n)=>{n.d(e,{ff:()=>r,xD:()=>i});n(3735);var r=function(t){return function(e){return!t(e)}},i=function(t){return function(e){return function(n){return e(n)&&t(n)}}}},3328:(t,e,n)=>{n.d(e,{DZ:()=>W,EQ:()=>g,Eh:()=>it,Eq:()=>q,Ew:()=>E,Hr:()=>ht,JO:()=>I,Lx:()=>V,OE:()=>J,Od:()=>h,P5:()=>_,Su:()=>B,UI:()=>L,YM:()=>v,Z$:()=>b,ZN:()=>nt,bM:()=>z,bj:()=>O,cS:()=>dt,cx:()=>k,f2:()=>S,hX:()=>K,hp:()=>D,iw:()=>Z,j0:()=>ft,kp:()=>A,nI:()=>ct,nq:()=>X,oA:()=>N,oR:()=>ut,of:()=>G,pJ:()=>at,pO:()=>C,pR:()=>ot,qr:()=>P,t9:()=>M,tS:()=>j,u4:()=>H,uK:()=>F,uZ:()=>rt,vP:()=>tt,xH:()=>R,xP:()=>Q,yW:()=>lt,zT:()=>w});var r=n(4268),i=n(3735),o=n(7341),s=n(9384),a=n(4011),u=n(7209),c=n(7241),d=n(4870),l=(n(5605),function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i=0;n--){var r=t(e[n]);if(s.pC(r))return r}return s.YP}},P=function(t){return function(e){for(var n=e.length-1;n>=0;n--)if(t(e[n]))return s.G(n);return s.YP}},D=function(t){for(var e=[],n=0;n=1&&h(e)?c.lx(t)(e):f(e)?[e,dt]:[dt,e]}};var x=function(t,e){return(0,i.zG)(t,L(e))},T=function(t,e,n){return(0,i.zG)(t,H(e,n))},A=function(t,e){return(0,i.zG)(t,at(e))},q=function(t,e){return(0,i.zG)(t,ut(e))},G=c.of,z=function(){return dt},j=function(t){return function(e){return(0,i.zG)(e,function(t){return function(e){if(f(e))return dt;for(var n=[],r=0;r0;){var i=n.shift();s.nM(i)?n.unshift.apply(n,t(i.left)):r.push(i.right)}return r}},ut=function(t){return function(e){var n=t(e),r=[],i=[];function o(e){s.nM(e)?t(e.left).forEach((function(t){return r.push(t)})):i.push(e.right)}for(var a=0,u=n;a0;)o(r.shift());return i}},ct=(c.oo,function(t){return f(t)?dt:t.slice()}),dt=c.cS;function lt(t){return function(e){return e.every(t)}}var ft=function(t){var e=c.j0(t);return function(n){return g((function(){return t.empty}),e(n))}},ht=(s.F4,(0,o.Hr)(st));c.w6,c.QI,c.Ss},7241:(t,e,n)=>{n.d(e,{R3:()=>_,Im:()=>m,pO:()=>I,ur:()=>K,QI:()=>W,cS:()=>l,Lx:()=>M,xP:()=>x,c2:()=>b,Eh:()=>G,ZN:()=>q,vM:()=>E,YM:()=>z,j0:()=>$,Od:()=>f,dC:()=>h,Z$:()=>R,Fp:()=>B,VV:()=>L,of:()=>D,Ce:()=>g,ws:()=>p,w6:()=>w,u4:()=>O,nq:()=>C,iw:()=>T,OE:()=>U,Ss:()=>N,lx:()=>P,oo:()=>v});var r,i=n(4268),o=n(3735),s=(n(7341),n(9384)),a=n(7209),u=function(t){return{concat:a.VV(t)}},c=function(t){return{concat:a.Fp(t)}};r=void 0;var d=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i=e.length},p=function(t){return function(e){return d([t],e,!0)}},g=p,m=function(t){return function(e){return d(d([],e,!0),[t],!1)}},_=m,v=function(t,e,n){if(f(n)){var r=s.r1(n);return r.splice(t,0,e),r}return[e]},b=function(t){return f(t)?s.G(t):s.YP},y=function(t){return function(e){for(var n=Math.max(0,Math.floor(e)),r=[t(0)],i=1;i=e.length?[e,l]:[(0,o.zG)(e.slice(1,n),g(z(e))),e.slice(n)]}},D=s.ri,O=function(t,e){return U(t,(function(t,n,r){return e(n,r)}))},M=function(t){return function(e){return function(n){return n.slice(1).reduce((function(n,r){return t.concat(n,e(r))}),e(n[0]))}}},C=function(t,e){return T(t,(function(t,n,r){return e(n,r)}))},U=function(t,e){return function(n){return n.reduce((function(t,n,r){return e(r,t,n)}),t)}},x=function(t){return function(e){return function(n){return n.slice(1).reduce((function(n,r,i){return t.concat(n,e(i+1,r))}),e(0,n[0]))}}},T=function(t,e){return function(n){return n.reduceRight((function(t,n,r){return e(r,n,t)}),t)}},A=s.YM,q=function(t){return{show:function(e){return"[".concat(e.map(t.show).join(", "),"]")}}},G=function(t){return(0,i.f7)((function(e,n){return e.length===n.length&&e.every((function(e,r){return t.equals(e,n[r])}))}))},z=(s.F4,A),j=s.Gb,R=function(t){return t[t.length-1]},L=function(t){var e=u(t);return function(t){return t.reduce(e.concat)}},B=function(t){var e=c(t);return function(t){return t.reduce(e.concat)}},K=function(t){return function(e){return e.reduce(t.concat)}},$=function(t){var e=K(t);return function(t){return(0,o.ls)(function(t){return function(e){var n=j(e);return f(n)?(0,o.zG)(n,S(t),g(z(e))):e}}(t),e)}};function W(t,e){return void 0===e?g(t):(0,o.zG)(e,g(t))}var N=function(t,e){return(0,o.zG)(t,k([e]))}},4923:(t,e,n)=>{n.d(e,{Bu:()=>m,CC:()=>j,DZ:()=>et,EW:()=>N,Eh:()=>dt,G:()=>T,HA:()=>q,I8:()=>L,P5:()=>_,RF:()=>R,RJ:()=>K,SW:()=>Y,Su:()=>b,UI:()=>y,Ub:()=>H,V_:()=>W,XP:()=>l,Yz:()=>C,_Y:()=>$,_r:()=>P,dp:()=>u,dx:()=>p,e$:()=>g,hX:()=>tt,jt:()=>O,kp:()=>z,mK:()=>X,mS:()=>B,nn:()=>G,nr:()=>ft,nu:()=>F,oA:()=>at,oh:()=>ut,qS:()=>J,ri:()=>S,sq:()=>U,t9:()=>A,tV:()=>rt,uK:()=>nt,uZ:()=>lt,vA:()=>V,vP:()=>I,xb:()=>c,yW:()=>x,z7:()=>M,zV:()=>Q});var r=n(4268),i=n(3735),o=n(9384),s=n(4870),a=n(2751),u=(n(5605),function(t){return Object.keys(t).length}),c=function(t){for(var e in t)if(o.e$.call(t,e))return!1;return!0},d=function(t){return function(e){return Object.keys(e).sort(t.compare)}},l=d(a.Df);function f(t){if("function"==typeof t)return f(a.Df)(t);var e=d(t);return function(t){return function(n){for(var r=[],i=0,o=e(n);i=0;s--){var a=o[s];i=e(a,r[a],i)}return i}}}var S=function(t,e){var n;return(n={})[t]=e,n};function I(t){return X(a.Df)(t)}function P(t){return function(e){var n={},r={};for(var i in e)if(o.e$.call(e,i)){var a=t(i,e[i]);switch(a._tag){case"Left":n[i]=a.left;break;case"Right":r[i]=a.right}}return(0,s.s4)(n,r)}}function D(t){return function(e){var n={},r={};for(var i in e)if(o.e$.call(e,i)){var a=e[i];t(i,a)?r[i]=a:n[i]=a}return(0,s.s4)(n,r)}}function O(t){return function(e){var n={};for(var r in e)if(o.e$.call(e,r)){var i=t(r,e[r]);o.pC(i)&&(n[r]=i.value)}return n}}function M(t){return function(e){var n={},r=!1;for(var i in e)if(o.e$.call(e,i)){var s=e[i];t(i,s)?n[i]=s:r=!0}return r?n:e}}var C=h,U=function(t){for(var e={},n=0,r=t;n{n.d(e,{Kl:()=>a,Lx:()=>c,Pd:()=>o,Yg:()=>i,li:()=>r,nq:()=>d,pL:()=>s,u4:()=>u});n(3735);function r(t){return t[0]}function i(t){return t[1]}var o=function(t,e){return function(n){return[e(r(n)),t(i(n))]}},s=function(t){return function(e){return[t(r(e)),i(e)]}},a=r,u=function(t,e){return function(n){return e(t,r(n))}},c=function(){return function(t){return function(e){return t(r(e))}}},d=function(t,e){return function(n){return e(r(n),t)}}},7927:(t,e,n)=>{n.d(e,{UI:()=>c,XP:()=>a,dx:()=>u,hX:()=>y,xb:()=>o});var r=n(4923),i=n(2751),o=(n(5605),r.dp,r.xb),s=function(t){return function(e){return Object.keys(e).sort(t.compare)}},a=s(i.Df);var u=r.dx;r.e$;r.Bu,r.P5,r.Su;var c=r.UI;r.ri;function d(t){return r.vP(t)}r._r;r.jt;r.yW,r.G,r.t9;var l=r.HA,f=(r.nn,r.kp),h=r.CC,p=r.RF,g=(r.I8,r.mS,r.RJ,r._Y,r.V_),m=r.EW,_=r.nu,v=(r.SW,r.zV,r.Ub,r.vA,r.qS),b=(r.mK,function(t){return function(e){var n=s(t);return function(t,r){var i=n(t);if(0===i.length)return e.of({});for(var o=e.of({}),s=function(n){o=e.ap(e.map(o,(function(t){return function(e){return t[n]=e,t}})),r(n,t[n]))},a=0,u=i;a{n.d(e,{ff:()=>r});var r=function(t){return function(e){return!t(e)}}},4870:(t,e,n)=>{n.d(e,{F2:()=>a,Pd:()=>o,Vn:()=>i,s4:()=>r});n(3735);var r=function(t,e){return{left:t,right:e}},i=function(t){return function(e){return r(t(s(e)),a(e))}},o=function(t,e){return function(n){return r(t(s(n)),e(a(n)))}},s=function(t){return t.left},a=function(t){return t.right}},5151:(t,e,n)=>{n.d(e,{At:()=>P,Hi:()=>b,Hr:()=>O,PM:()=>v,RD:()=>A,UA:()=>k,UI:()=>f,YO:()=>D,ak:()=>M,ap:()=>h,dO:()=>_,mU:()=>S,oE:()=>G,of:()=>p,pE:()=>q,qA:()=>y,qo:()=>w,tD:()=>u,tS:()=>g,uU:()=>T});var r=n(6862),i=n(1130),o=n(3735),s=n(7341),a=n(9384),u=function(t){return function(){return Promise.resolve().then(t)}};var c=function(t,e){return(0,o.zG)(t,f(e))},d=function(t,e){return(0,o.zG)(t,h(e))},l=function(t,e){return(0,o.zG)(t,g(e))},f=function(t){return function(e){return function(){return Promise.resolve().then(e).then(t)}}},h=function(t){return function(e){return function(){return Promise.all([Promise.resolve().then(e),Promise.resolve().then(t)]).then((function(t){return(0,t[0])(t[1])}))}}},p=function(t){return function(){return Promise.resolve(t)}},g=function(t){return function(e){return function(){return Promise.resolve().then(e).then((function(e){return t(e)()}))}}},m="Task";var _={URI:m,map:c},v={URI:m,of:p},b={URI:m,map:c,ap:d},y={URI:m,map:c,ap:d,of:p},w={URI:m,map:c,ap:d,chain:l},k={URI:m,map:c,of:p,ap:d,chain:l},E=o.yR,S=(0,r.m)(w),I={URI:m,fromIO:u},P=(0,i.At)(I,w),D=(a.F4,(0,s.YO)(_)),O=(0,s.Hr)(_),M=(0,r.a)(w),C=p(a.Xl),U=function(t){var e=function(t){return function(e){return function(){return Promise.all(e.map((function(e,n){return Promise.resolve().then((function(){return t(n,e)()}))})))}}}(t);return function(t){return a.Od(t)?e(t):C}},x=function(t){var e=function(t){return function(e){return function(){return a.Gb(e).reduce((function(e,n,r){return e.then((function(e){return Promise.resolve().then(t(r+1,n)).then((function(t){return e.push(t),e}))}))}),Promise.resolve().then(t(0,a.YM(e))).then(a.ri))}}}(t);return function(t){return a.Od(t)?e(t):C}},T=function(t){return U((function(e,n){return t(n)}))},A=T(o.yR),q=function(t){return x((function(e,n){return t(n)}))},G={URI:m,map:c,of:p,ap:d,chain:l,fromIO:u,fromTask:E}},4767:(t,e,n)=>{n.d(e,{DT:()=>Q,Do:()=>tt,EQ:()=>w,F2:()=>p,Hi:()=>W,Ij:()=>nt,LV:()=>E,UI:()=>A,Uo:()=>y,Vn:()=>G,Y$:()=>H,Y3:()=>I,Zl:()=>R,aD:()=>k,ak:()=>et,fF:()=>b,fS:()=>S,fX:()=>Y,it:()=>P,oU:()=>J,of:()=>B,t$:()=>h,tD:()=>v,tS:()=>j,vx:()=>D,wE:()=>Z});var r=n(6862),i=n(856),o=n(2690),s=n(1130),a=n(9679),u=n(3735),c=(n(7341),n(9384)),d=n(5151),l=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},f=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{n.d(e,{qA:()=>X,tS:()=>F,NG:()=>K,wE:()=>et,hX:()=>Y,tD:()=>z,Yo:()=>G,fF:()=>j,oF:()=>R,fS:()=>B,UI:()=>$,EQ:()=>L});var r=n(3735),i=n(7341),o=n(6567),s=n(4870);function a(t,e){return function(n){return t.map(n,e.compact)}}function u(t,e,n){var u=a(t,e),c=(0,i.UI)(t,n);return function(t){return s.s4(u((0,r.zG)(t,c(o.IS))),u((0,r.zG)(t,c(o.EK))))}}var c=n(6017);function d(t,e){return function(n){return function(r){return t.map(r,(function(t){return e.filter(t,n)}))}}}function l(t,e){return function(n){return function(r){return t.map(r,(function(t){return e.filterMap(t,n)}))}}}function f(t,e){var n=d(t,e);return function(t){var e=n((0,c.ff)(t)),r=n(t);return function(t){return(0,s.s4)(e(t),r(t))}}}function h(t,e){var n=l(t,e);return function(t){return function(e){return(0,s.s4)((0,r.zG)(e,n((function(e){return(0,o.IS)(t(e))}))),(0,r.zG)(e,n((function(e){return(0,o.EK)(t(e))}))))}}}var p=n(9679),g=n(9384),m=n(1828);function _(t){return(0,r.ls)(o.G,t.of)}function v(t){return(0,r.a9)(t.of(o.YP))}function b(t){return function(e){return t.map(e,o.G)}}function y(t){return(0,r.ls)(o.ij,t.of)}function w(t){var e=y(t);return function(t){return(0,r.ls)(t,e)}}function k(t){var e=x(t),n=w(t);return function(t){return e(n(t))}}function E(t){return function(e){return(0,r.ls)(e,t.of)}}function S(t){var e=x(t),n=E(t);return function(t){return e(n(t))}}function I(t){return function(e){return function(n){return t.of(o.DT(e)(n))}}}function P(t){return(0,r.ls)(o.Uo,t.of)}function D(t){return function(e,n){return function(r){return t.map(r,o.EQ(e,n))}}}function O(t){return function(e,n){return function(r){return t.chain(r,o.EQ(e,n))}}}function M(t){return function(e){return function(n){return t.chain(n,o.EQ(e,t.of))}}}function C(t){return(0,i.UI)(t,o.dO)}function U(t){return(0,m.ap)(t,o.G5)}function x(t){var e=v(t);return function(n){return function(r){return t.chain(r,o.EQ((function(){return e()}),n))}}}function T(t){var e=_(t);return function(n){return function(r){return t.chain(r,o.EQ(n,e))}}}var A=n(5151),q=_(A.PM),G=(A.PM,A.of),z=(A.PM,function(t){return j(A.tD(t))}),j=b(A.dO),R=A.UI(o.Uo),L=D(A.dO),B=(A.qo,M(A.UA)),K=(A.PM,A.PM,k(A.UA)),$=(A.PM,A.UA,C(A.dO)),W=U(A.Hi),N=q,F=x(A.UA),Y=(A.UA,A.PM,A.dO,o.Ri,A.dO,o.Ri,o.dO,d(A.dO,o.xu)),Q=(A.dO,o.xu,A.dO,o.xu,A.dO,o.xu,function(t,e){return(0,r.zG)(t,$(e))}),H=function(t,e){return(0,r.zG)(t,W(e))},V=function(t,e){return(0,r.zG)(t,F(e))},J="TaskOption",X={URI:J,map:Q,ap:H,of:N},Z={URI:J,map:Q,ap:H,chain:V},tt={URI:J,fromIO:z,fromTask:j},et=(0,p.oU)(tt,Z);g.F4,g.Xl},8706:(t,e,n)=>{n.d(e,{H5:()=>a,Yg:()=>o,li:()=>i,pL:()=>s});var r=n(8377),i=(n(3735),r.li),o=r.Yg;var s=function(t){return function(e){return[t(i(e)),o(e)]}},a=function(t){return function(e){return[i(e),t(o(e))]}};r.Kl,r.Lx,r.u4,r.nq},5605:(t,e,n)=>{function r(t,e){return function(n){var r=t.traverse(n);return function(t,i){return n.map(r(t,i),e.separate)}}}function i(t,e){return function(n){var r=t.traverse(n);return function(t,i){return n.map(r(t,i),e.compact)}}}n.d(e,{BL:()=>i,Fj:()=>r})},3735:(t,e,n)=>{n.d(e,{MZ:()=>i,Q1:()=>c,SK:()=>h,W8:()=>s,a9:()=>o,bc:()=>l,gn:()=>a,ls:()=>d,r5:()=>u,yR:()=>r,zG:()=>f});function r(t){return t}var i=r;function o(t){return function(){return t}}var s=o(!0),a=o(null),u=o(void 0),c=u;function d(t,e,n,r,i,o,s,a,u){switch(arguments.length){case 1:return t;case 2:return function(){return e(t.apply(this,arguments))};case 3:return function(){return n(e(t.apply(this,arguments)))};case 4:return function(){return r(n(e(t.apply(this,arguments))))};case 5:return function(){return i(r(n(e(t.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(e(t.apply(this,arguments))))))};case 7:return function(){return s(o(i(r(n(e(t.apply(this,arguments)))))))};case 8:return function(){return a(s(o(i(r(n(e(t.apply(this,arguments))))))))};case 9:return function(){return u(a(s(o(i(r(n(e(t.apply(this,arguments)))))))))}}}function l(){for(var t=[],e=0;e{n.d(e,{F2:()=>l,F4:()=>_,G:()=>a,Gb:()=>g,Od:()=>h,Wi:()=>i,Xl:()=>m,YM:()=>p,YP:()=>s,e$:()=>v,nM:()=>u,pC:()=>o,r1:()=>b,ri:()=>f,t$:()=>d,tO:()=>c});var r=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i0},p=function(t){return t[0]},g=function(t){return t.slice(1)},m=[],_={},v=Object.prototype.hasOwnProperty,b=function(t){return r([t[0]],t.slice(1),!0)}},4011:(t,e,n)=>{n.d(e,{Df:()=>i,Eq:()=>r});var r={equals:function(t,e){return t===e}},i={equals:r.equals,compare:function(t,e){return te?1:0}};r.equals,i.compare},2751:(t,e,n)=>{n.d(e,{Df:()=>i,Eq:()=>r,pn:()=>s,xb:()=>o});var r={equals:function(t,e){return t===e}},i={equals:r.equals,compare:function(t,e){return te?1:0}},o=function(t){return 0===t.length},s=function(t,e){return function(n){return n.endsWith(t,e)}}},4386:(t,e,n)=>{n.d(e,{Z:()=>o});var r=n(477),i=n.n(r);function o(){return i()('/*! permutive-javascript-sdk v19.120.0 (web) (built 2024-05-23T06:58:12.613Z) */(()=>{"use strict";function t(t){return t}function n(t){return function(){return t}}var e=n(void 0);function r(t,n,e,r,i,o,u,a,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return e(n(t.apply(this,arguments)))};case 4:return function(){return r(e(n(t.apply(this,arguments))))};case 5:return function(){return i(r(e(n(t.apply(this,arguments)))))};case 6:return function(){return o(i(r(e(n(t.apply(this,arguments))))))};case 7:return function(){return u(o(i(r(e(n(t.apply(this,arguments)))))))};case 8:return function(){return a(u(o(i(r(e(n(t.apply(this,arguments))))))))};case 9:return function(){return c(a(u(o(i(r(e(n(t.apply(this,arguments)))))))))}}}function i(){for(var t=[],n=0;n({kind:"null",value:null}),I=t=>({kind:"string",value:t}),B=t=>({kind:"number",value:t}),F=t=>({kind:"array",value:t}),G=t=>({kind:"object",value:t}),D=t=>t,U=()=>({kind:"bottom"}),H=t=>({kind:"inner",a:t}),R=t=>({kind:"top",error:t}),V=t=>({kind:"unbounded",group:t}),$=(t,n)=>({kind:"windowed",key:n,group:t}),J=(t,n,e)=>({kind:"countLimit",n:e,limit:n,group:t}),W=(t,n,e)=>({kind:"uniqueLimit",n:e,limit:n,group:t}),Y=t=>({kind:"numberGroup",group:t}),K=t=>({kind:"stringGroup",group:t}),Q=t=>({kind:"tuple",tuple:t}),X=t=>({state:t}),Z=(t,n)=>({commands:t,payload:n});var tt=function(t){return{equals:function(n,e){return n===e||t(n,e)}}},nt=function(t){return tt((function(n,e){for(var r in t)if(!t[r].equals(n[r],e[r]))return!1;return!0}))},et=function(t){return function(n,e){return n===e||0===t(n,e)}},rt=function(t){return{equals:et(t),compare:function(n,e){return n===e?0:t(n,e)}}},it=function(t){return function(n){return rt((function(e,r){return n.compare(t(e),t(r))}))}},ot=function(t){return function(n,e){return-1===t.compare(n,e)}},ut=function(t){return function(n,e){return 1===t.compare(n,e)}},at=function(t){return function(n,e){return n===e||t.compare(n,e)<1?n:e}},ct=function(t){return function(n,e){return n===e||t.compare(n,e)>-1?n:e}};var st={equals:function(t,n){return t===n}},ft={equals:st.equals,compare:function(t,n){return tn?1:0}};const lt=(t,n)=>{switch(t.kind){case"bottom":return{kind:"bottom"};case"inner":return H(n(t.a));case"top":return R(t.error)}},dt=t=>rt(((n,e)=>{if("bottom"===n.kind&&"bottom"===e.kind)return 0;if("bottom"===n.kind)return-1;if("bottom"===e.kind)return 1;if("top"===n.kind&&"top"===e.kind)return ft.compare(n.error,e.error);if("top"===n.kind)return 1;if("top"===e.kind)return-1;if("inner"===n.kind&&"inner"===e.kind)return t.compare(n.a,e.a);throw new Error("Non exhaustive match in extendedAlgebraOrd")}));var gt;gt=void 0;var pt=function(t){return t[0]},mt=pt;var ht=function(t,n,e){if(e||2===arguments.length)for(var r,i=0,o=n.length;i0},wt=function(t,n){return t<0||t>=n.length},yt=function(t){return function(n){return ht([t],n,!0)}},bt=yt,kt=function(t){return function(n){return ht(ht([],n,!0),[t],!1)}},_t=kt,qt=d,xt=function(t){return vt(t)?s(t):c},At=function(t){return function(n){for(var e=Math.max(0,Math.floor(n)),r=[t(0)],i=1;i=n.length?[jt(n),[]]:[o(n.slice(1,e),bt(Mt(n))),n.slice(e)]}},zt=function(t){return tt((function(n,e){return n.length===e.length&&n.every((function(n,r){return t.equals(n,e[r])}))}))},Mt=mt;var Ct={equals:function(t,n){return t===n}},Nt={equals:Ct.equals,compare:function(t,n){return tn?1:0}};function Et(t){return function(n,e){if(void 0===e){var r=Et(t);return function(t){return r(n,t)}}for(var i,o=0;o=n.length?[]:n.slice(t,n.length)}};var Vt=function(t){return t.slice()},$t=function(t){return Pt(t)?[]:t.slice().reverse()},Jt=function(t){return function(n){return n.length<=1?Vt(n):n.slice().sort(t.compare)}},Wt=function(t,n,e){for(var r=[],i=Math.min(t.length,n.length),o=0;o=1&&Tt(n)?Ot(t)(n):Pt(n)?[Vt(n),[]]:[[],Vt(n)]}};function Qt(t){var n=Yt(t);return function(e,r){if(void 0===r){var i=Qt(t);return function(t){return i(t,e)}}return e.filter((function(t){return!n(t,r)}))}}var Xt=function(t){return function(n){return o(n,function(t){return function(n){for(var e=[],r=0;r{if(0===t.length)return nn(n.map((t=>m({1:t[1],2:e(p,m(t[2]))}))));if(0===n.length)return nn(t.map((t=>m({1:t[1],2:e(m(t[2]),p)}))));if(t.length>0&&n.length>0&&ot(r)(t[0][1],n[0][1])){const[r,...o]=t,u=r[1],a=r[2];return It({1:u,2:e(m(a),p)})(i(o,n))}if(t.length>0&&n.length>0&&ut(r)(t[0][1],n[0][1])){const[r,...o]=n,u=r[1],a=r[2];return It({1:u,2:e(p,m(a))})(i(t,o))}if(t.length>0&&n.length>0){const[r,...o]=t,[u,...a]=n,c=r[1],s=r[2],f=u[2];return It({1:c,2:e(m(s),m(f))})(i(o,a))}throw new Error("Non exhaustive match in mapOption2")},o=it((t=>t[1]))(r),u=(t=>{const n=kn(t,(t=>z(t[2])?m({1:t[1],2:t[2].value}):p));return 0===n.length?p:m(n)})(i(Jt(o)([...t].map((t=>({1:t[0],2:t[1]})))),Jt(o)([...n].map((t=>({1:t[0],2:t[1]}))))));return q((t=>new Map(t.map((t=>[t[1],t[2]])))))(u)}function qn(t,n,e,r){const i=it((t=>t[0]))(r),o=Jt(i)([...n]).reduceRight(((t,n)=>{if(hn(t)){const r=e(n[1],t.left);return z(r)?an(r.value):cn(n[0])}return t}),an(t));return O(o)}function xn(t,n){return new Map([...t].map(n))}function An(t,n){return new Map([...t].filter(n))}function jn(t){return JSON.stringify(Sn(t))}function Sn(t){switch(t.kind){case"null":return Mn.encode(t);case"string":return Cn.encode(t);case"number":return Nn.encode(t);case"array":return En.encode(t);case"object":return Ln.encode(t)}}function On(t){return null===t?Mn.decode(t):"number"==typeof t?Nn.decode(t):"string"==typeof t?Cn.decode(t):Array.isArray(t)?En.decode(t):Ln.decode(t)}const zn=(t,n)=>an(`Failed to decode. Input was ${JSON.stringify(t)}. Codec type was ${n}`),Mn={encode:t=>null,decode:t=>null===t?cn({kind:"null",value:null}):zn(t,"SimpleNull")},Cn={encode:t=>t.value,decode:t=>"string"==typeof t?cn(I(t)):zn(t,"SimpleString")},Nn={encode:t=>t.value,decode:t=>"number"==typeof t?cn(B(t)):zn(t,"SimpleNumber")},En={encode:t=>t.value.map(Sn),decode:t=>{if(Array.isArray(t)){const n=rn(mn)(On)(t);return dn(F)(n)}return zn(t,"SimpleArray")}},Ln={encode:t=>{const n=[...t.value.entries()];return Object.assign({},...Array.from(n,(([t,n])=>({[t]:Sn(n)}))))},decode:t=>{if(t&&t.constructor===Object){const n=rn(mn)((([t,n])=>o(On(n),dn((n=>i(t,n))))))(Object.entries(t));return dn((t=>G(new Map([...t]))))(n)}return zn(t,"SimpleObject")}};function Pn(t){return o(t,In,q(jn),L((()=>"")))}function Tn(t){return q(Hn)(function(t){switch(t.state.kind){case"top":return m(I(t.state.error));case"bottom":return p;case"inner":return In(t.state.a)}}(t))}function In(t){return function(t){switch(t.kind){case"numberGroup":case"stringGroup":return Bn(t.group);case"tuple":return t.tuple.length>0}}(t.payload)?m(F(function(t,n){const e=q((t=>It(t)(n)))(t);return L((()=>n))(e)}(q((t=>I(function(t){const n=t=>N((()=>""),(t=>"b"+JSON.stringify(t)))(t.bound),e=t=>{switch(t.operation){case"add":return"p";case"mul":return"m";case"max":return"v";case"min":return"n"}},r=t=>{const r=n(t[1])+e(t[1]);return 1===t[2]?r:r+JSON.stringify(t[2])};return t.map(r).join("")}(t))))(t.commands),function(t){const n=t=>{switch(t.kind){case"bottom":return{kind:"null",value:null};case"top":return I(t.error);case"inner":return B(t.a)}},e=t=>kn([Fn,Gn,t=>o(t,Un,G,m)],(n=>n(t))),r=t=>kn([Fn,Dn,t=>o(t,Un,(t=>xn(t,(([t,n])=>[JSON.stringify(t),n]))),G,m)],(n=>n(t)));switch(t.kind){case"tuple":return t.tuple.map(n);case"stringGroup":return e(t.group);case"numberGroup":return r(t.group)}}(t.payload)))):p}function Bn(t){switch(t.kind){case"unbounded":return t.group.size>0;case"windowed":return t.group.size>0||z(t.key);case"countLimit":case"uniqueLimit":return t.group.size>0||z(t.limit)}}function Fn(t){switch(t.kind){case"unbounded":return p;case"windowed":return m(I("w"));case"countLimit":return m(I(1===t.n?"x":`x${t.n}`));case"uniqueLimit":return m(I(1===t.n?"u":`u${t.n}`))}}function Gn(t){switch(t.kind){case"unbounded":return p;case"windowed":return m(I(z(t.key)?t.key.value:""));case"countLimit":case"uniqueLimit":return m(I(z(t.limit)?t.limit.value:""))}}function Dn(t){switch(t.kind){case"unbounded":return p;case"windowed":return z(t.key)?m(B(t.key.value)):m({kind:"null",value:null});case"countLimit":case"uniqueLimit":return z(t.limit)?m(B(t.limit.value)):m({kind:"null",value:null})}}function Un(t){switch(t.kind){case"unbounded":case"windowed":case"countLimit":case"uniqueLimit":return t.group}}function Hn(t){switch(t.kind){case"array":return 0===t.value.length?{kind:"null",value:null}:1===t.value.length?Hn(t.value[0]):F(t.value.map(Hn));case"object":return o(An(t.value,(([t,n])=>"null"!==n.kind)),(t=>xn(t,(t=>[t[0],Hn(t[1])]))),G);default:return t}}function Rn(t){const n=t=>{if(0===t.length)return{kind:"bottom"};const n=(t=>{if(4!==t.length)return p;const[n,e,r,i]=t;if("string"===n.kind&&"string"===e.kind&&"object"===i.kind){const t=h((t=>Vn(t[1].value)&&$n(t[2].value)))({1:n,2:e});return q((t=>({prim:t[1].value,grp:t[2].value,cutoff:r,m:i.value})))(t)}return p})(t);if(z(n)){const{prim:t,grp:e,cutoff:r,m:i}=n.value,o=Jn(r,i,Wn(e));return"string"==typeof o?R(o):H(Z(Yn(t),o))}const e=(t=>{if(3!==t.length)return p;const[n,e,r]=t;if("string"===n.kind&&"object"===r.kind){const t=h((t=>$n(t.value)))(n);return q((t=>({grp:t.value,cutoff:e,m:r.value})))(t)}return p})(t);if(z(e)){const{grp:t,cutoff:n,m:r}=e.value,i=Jn(n,r,Wn(t));return"string"==typeof i?R(i):H(Z(p,i))}const r=(t=>{if(2!==t.length)return p;const[n,e]=t;if("string"===n.kind&&"object"===e.kind){const t=h((t=>Vn(t.value)))(n);return q((t=>({prim:t.value,m:e.value})))(t)}return p})(t);if(z(r)){const{prim:t,m:n}=r.value;return H(Z(Yn(t),K(V(n))))}const i=(t=>{if(1!==t.length)return p;const[n]=t;return"object"===n.kind?m({m:n.value}):p})(t);if(z(i)){const{m:t}=i.value;return H(Z(p,K(V(t))))}const o=(t=>{if(t.length<1)return p;const[n,...e]=t;if("string"===n.kind){const t=h((t=>Vn(t.value)))(n);return q((t=>({prim:t.value,rest:e})))(t)}return p})(t);if(z(o)){const{prim:t,rest:n}=o.value;return H(Z(Yn(t),Qn(n)))}return H(Z(p,Qn(t)))},e=t=>"array"===t.kind?Xt(e)(t.value):[t];return"null"===t.kind?X({kind:"bottom"}):X(n(e(t)))}function Vn(t){const n=t.split("");if(!0==(0===n.length))return!1;{const[t,...e]=n;return-1!=="bpmvn".indexOf(t)&&e.every((t=>-1!=="bpmvn0123456789.".indexOf(t)))}}function $n(t){const n=t.split("");switch(!0){case 0===n.length:return!1;case"w"===n[0]&&void 0===n[1]:return!0;default:{const[t,...e]=n;return-1!=="ux".indexOf(t)&&-1===e.map((t=>!isNaN(parseInt(t)))).indexOf(!1)}}}function Jn(t,n,e){switch(t.kind){case"string":return K(e({1:m(t.value),2:n}));case"number":case"null":return Y(e({1:"null"===t.kind?p:m(t.value),2:An(xn(n,(([t,n])=>[Number(t),n])),(t=>!isNaN(t[0])))}));default:return"{bad cutoff}"}}function Wn(t){const n=t=>n=>W(n[2],n[1],t),e=t=>n=>J(n[2],n[1],t),r=t.split("");switch(!0){case"w"===r[0]&&void 0===r[1]:return t=>$(t[2],t[1]);case"u"===r[0]&&void 0===r[1]:return n(1);case"u"===r[0]&&void 0!==r[1]:return n(parseInt(r.slice(1).join("")));case"x"===r[0]&&void 0===r[1]:return e(1);case"x"===r[0]&&void 0!==r[1]:return e(parseInt(r.slice(1).join("")));default:throw new Error("This should never happen if you use isGroupCommand")}}function Yn(t){const n=t=>M(t.bound)||"add"===t.operation||"mul"===t.operation?m(t):p,e=(t,e,r)=>{const i=((t,e)=>o(t,(t=>{switch(t){case"p":return m("add");case"m":return m("mul");case"v":return m("max");case"n":return m("min");default:return p}}),q((t=>({operation:t,bound:e}))),j(n)))(t,r);return q((t=>{const{init:n,rest:r}=Ht((t=>{return"number"==typeof(n=parseInt(t))&&isFinite(n)&&Math.floor(n)===n;var n}))(e);return{1:{1:t,2:0===n.length?1:parseInt(n.join(""))},2:r.join("")}}))(i)};return q(D)(xt(Kn(t,(t=>{const n=t.split("");if(0===n.length)return p;const[r,...i]=n;if("b"===r){const{init:t,rest:n}=o(i,Ht((t=>-1!=="1234567890.".indexOf(t))));if(0===t.length||0===n.length)return p;const r=parseFloat(t.join("")),[u,...a]=n;return e(u,a,m(r))}return e(r,i,p)}))))}function Kn(t,n){const e=n(t);return L((()=>[]))(q((t=>[t[1]].concat(Kn(t[2],n))))(e))}function Qn(t){return Q(t.map(Xn))}function Xn(t){switch(t.kind){case"number":return H(t.value);case"string":return R(t.value);case"null":return{kind:"bottom"};case"object":return R("{object}");case"array":return R("{array}")}}function Zn(t,n,e){return function(r){for(var i=Array(e.length+1),o=0;or=>{if(M(e))return n;if("delta"===t&&M(n))return p;if(M(n))return e;if(z(n)&&z(e))return r(n.value,e.value);throw new Error("Non exhaustive match in combineCommand.strategy")},operation:(n,e,i,u,a,c)=>{const s=un(dt(c)),f=o(e.bound,N((()=>t),(t=>n=>at(c)(a.fromNumber(t),n))));if("append"===n&&"add"===e.operation)return Wt(i,u,le("append",r(a.plus,f)));if("append"===n&&"mul"===e.operation)return Wt(i,u,le("append",r(a.times,f)));if("append"===n&&"max"===e.operation)return ct(s)(i,u);if("join"===n&&"add"===e.operation)return Wt(i,u,le("join",ct(c)));if("join"===n&&"mul"===e.operation)return Wt(i,u,le("join",ct(c)));if("join"===n&&"max"===e.operation)return ct(s)(i,u);if("min"===e.operation)return re.operation(n,{operation:"max",bound:e.bound},i,u,a,function(t){return rt(((n,e)=>bn(t.compare(n,e))))}(c));if("delta"===n&&"max"===e.operation)return ut(s)(i,u)?i:u.map(U);if("delta"===n)return Wt(i,u,((t,n)=>ut(dt(c))(t,n)?lt(t,f):{kind:"bottom"}));throw new Error("Non exhaustive match in combineCommand.operation")},extend:(t,n,e,r)=>{if("delta"===t&&"top"===e.kind&&"top"===r.kind)return ut(ft)(e.error,r.error)?R(e.error):{kind:"bottom"};if("delta"===t&&"bottom"===r.kind)return e;if("delta"===t&&"bottom"===e.kind)return{kind:"bottom"};if("top"===e.kind&&"top"===r.kind)return R(ct(ft)(e.error,r.error));if("top"===e.kind)return e;if("top"===r.kind)return r;if("inner"===e.kind&&"inner"===r.kind)return n(e.a,r.a);if("bottom"===e.kind)return r;if("bottom"===r.kind)return e;throw new Error("Non exhaustive match in extend")}},ie={fromNumber:t,plus:(t,n)=>t+n,times:(t,n)=>t*n};function oe(t,n,e,r){if("unbounded"===t.kind&&"unbounded"===n.kind){const i=t.group,o=n.group;return L(U)(q((t=>H(V(t))))(_n(i,o,e,r)))}if("windowed"===t.kind&&"windowed"===n.kind){const i=t.key,o=t.group,u=n.key,a=n.group,c=ct(_(r))(i,u);return L(U)(q((t=>H($(t,c))))(_n(o,a,e,r)))}if("countLimit"===t.kind&&"countLimit"===n.kind){const i=t.n,o=n.n;if(i===o){const o=t.limit,u=t.group,a=n.limit,c=n.group,s=ct(_(r))(o,a);return L(U)(q((t=>H(J(t,s,i))))(_n(u,c,e,r)))}return R("Non matching counts")}if("uniqueLimit"===t.kind&&"uniqueLimit"===n.kind){const i=t.n,o=n.n;if(i===o){const o=t.limit,u=t.group,a=n.limit,c=n.group,s=ct(_(r))(o,a);return L(U)(q((t=>H(W(t,s,i))))(_n(u,c,e,r)))}return R("Non matching counts")}return R("Non matching group types")}function ue(t,n,e,r,i,o){const u=(t,n)=>({1:Dt(t)(n).concat(Ft(Math.max(0,t-n.length),U)),2:Rt(t)(n)}),a=(n,e,r)=>{if(0===n.length)return re.operation(t,{operation:"max",bound:p},e,r,i,o);if(n.length>0){const[c,...s]=n,f=u(c[2],e),l=f[1],d=f[2],g=u(c[2],r),p=g[1],m=g[2];return re.operation(t,c[1],l,p,i,o).concat(a(s,d,m))}throw new Error("Non exhaustive match in recurse")};return $t((c=t=>"bottom"===t.kind,function(t){return t.slice(Ut(t,c))})($t(a(n,e,r))));var c}function ae(t,n,e){return L(T)(ce(t,p)(n,e))}function ce(t,n){const e=n=>(e,r)=>re.strategy(t,e,r)(ce(t,n)),r=(n,r,i)=>{if("stringGroup"===r.kind&&"stringGroup"===i.kind){const t=oe(r.group,i.group,e(n),ft);return lt(t,(t=>K(fe(t,ft))))}if("numberGroup"===r.kind&&"numberGroup"===i.kind){const t=oe(r.group,i.group,e(n),Nt);return lt(t,(t=>Y(fe(t,Nt))))}if("tuple"===r.kind&&"tuple"===i.kind){const e=z(n)?n.value:[];return H(Q(ue(t,e,r.tuple,i.tuple,ie,Nt)))}throw new Error(`Non matching payload. Got ${r.kind} and ${i.kind}`)},i=(t,e)=>{if(k(zt(nt({1:nt({operation:st,bound:k(Ct)}),2:Ct}))).equals(t.commands,e.commands)){const i=M(t.commands)?n:t.commands,o=r(i,t.payload,e.payload);return lt(o,(n=>Z(t.commands,n)))}if(i=t.commands,u=e.commands,k(zt(nt({1:nt({operation:st}),2:Ct}))).equals(i,u)){const i=o(((t,n)=>o(ee(A)(t,n),q((([t,n])=>St(t,n,((t,n)=>({1:{operation:t[1].operation,bound:o(ee(A)(t[1].bound,n[1].bound),q((([t,n])=>Math.min(t,n))),S((()=>t[1].bound)),S((()=>n[1].bound)))},2:t[2]})))))))(t.commands,e.commands),S((()=>n))),u=r(i,t.payload,e.payload);return lt(u,(t=>Z(i,t)))}throw new Error(`Non matching primitive strings. Got ${Pn(t)} and ${Pn(e)}`);var i,u};return(n,e)=>Tn(X(re.extend(t,i,Rn(n).state,Rn(e).state)))}function se(t,n,e){const r=q((n=>An(t,(([t,r])=>function(t){return function(n,e){return-1!==t.compare(n,e)}}(e)(t,n)))))(n);return L((()=>t))(r)}function fe(t,n){switch(t.kind){case"unbounded":return t;case"windowed":return M(t.key)?t:$(se(t.group,t.key,n),t.key);case"countLimit":{const e=t.limit,r=t.n,i=t.group,o=(t,n)=>n<=1?p:m(n-1),u=qn(r,i,o,n),a=ct(_(n))(e,u);return J(se(i,a,n),a,r)}case"uniqueLimit":{const e=t.limit,r=t.n,i=t.group,o=(t,n)=>{if("object"===t.kind){const e=[...t.value.keys(),...n.keys()],i=new Set(e);return i.size>=r?p:m(i)}return p},u=qn(new Set,i,o,n),a=ct(_(n))(e,u);return W(se(i,a,n),a,r)}}}function le(t,n){return(e,r)=>re.extend(t,((t,e)=>H(n(t,e))),e,r)}function de(t,n){return ae("append",t,n)}function ge(){for(var t=arguments.length,n=new Array(t),e=0;eObject.assign(Object.assign({},t),n)),{})}g((function(t){return 0===t.length}));function pe(t,n){const e=Object.keys(t),r=e.length,i={};for(let o=0;on=>{if("number"==typeof n)return n;if("string"==typeof n){const e=t(n);return Number.isNaN(e)?void 0:e}};me(parseInt),me(parseFloat);function he(t){var n;return["SegmentEntry","SegmentExit"].includes(t.name)&&void 0!==(null===(n=t.properties)||void 0===n?void 0:n.segment_number)}const ve="process";let we=!1,ye=[],be=!1;const ke={};let _e={getCurrentTime:()=>new Date,getCurrentSession:()=>"",getCurrentView:()=>"",getSegments:()=>({}),get1PSegments:()=>({}),get3PSegments:()=>({}),getSegmentsArray:()=>({}),getLookalikeModels:()=>({}),setSegmentActivation:()=>{}};const qe=()=>{const t=Me.concat(_e.get1PSegments(),_e.get3PSegments()),n=ze(t);_e.getSegments=()=>t,_e.getSegmentsArray=()=>n};function xe(t,n,e,r,i,u,a){we=!1,ye=[],be=!1;const c=o(r.thirdPartydata,N((()=>r.segments),(t=>Me.concat(r.segments,t)))),s=ze(c);_e={getCurrentTime:()=>new Date,getCurrentSession:()=>r.sessionId,getCurrentView:()=>r.viewId,get1PSegments:()=>r.segments,get3PSegments:()=>o(r.thirdPartydata,L((()=>({})))),getSegments:()=>c,getSegmentsArray:()=>s,getLookalikeModels:()=>o(r.lookalikeModels,L((()=>({})))),setSegmentActivation:(t,n)=>{}},be=z(r.lookalikeModels),we=z(r.thirdPartydata);const f=pe(n,((n,e)=>{var r;return(null===(r=t[n])||void 0===r?void 0:r.checksum)===e?p:m(((t,n)=>{const e=u[t].interpret(null,_e);return Object.assign({checksum:n},!1===e.result?{}:{result:e})})(n,e))}));if(0===i.length)return{diff:Object.assign(Object.assign({},t),f),errors:[]};if(0===Object.keys(f).length)return{diff:t,errors:[]};{const r=je(f,n,e,i,"bootstrap",u,a);return{diff:Object.assign(Object.assign({},t),r.diff),errors:r.errors}}}function Ae(t,n,e,r,i,o){(t=>{const n=Object.assign({},t);delete n["1p"],_e.get3PSegments=()=>n})(r),qe(),_e.setSegmentActivation=Oe(t,n),we=!0;const u=je(t,n,e,ye.length>0?ye:[ke],"updateTPD",i,o);return ye=[],u}function je(t,n,e,r,i,o,u){let a={diff:{},errors:[]};const c=r.length,s=()=>r.filter((t=>{return n=u["!UpdateLookalikeModels"]||[],he(e=t)&&n.includes(e.properties.segment_number.toString());var n,e})).length===r.length?"lookalikeTransition":"transition",f=(t,n,e)=>"transition"===t?e===n-1?s():"event":t;for(let s=0;s{const c=s[t],f=c.lift(a,_e),l=r(On,wn(d)),g=l(n.state||null),p=l(f),m=o(yn((()=>de(g,p)),P),vn((t=>{throw P(`Failed to append lifted event ${jn(p)} to internal state ${jn(g)}. Got ${t}`)}))),v=o(u[t],h(Boolean),q(l)),[w,y]=o(v,E((()=>i(m,!1)),(t=>o(yn((()=>i(de(m,t),!1)),e),wn((()=>i(m,!0))))))),b=Sn(m),k=c.interpret(Sn(w),_e),_=n.activations||{};return Object.assign(Object.assign(Object.assign(Object.assign({checksum:n.checksum},null===b?{}:{state:b}),!1===k.result?{}:{result:k}),0===Object.keys(_).length?{}:{activations:_}),!1===y?{}:{dropExternalState:y})},p={diff:{},errors:[]},m=function(t,n,e,r,i){switch(t){case"event":const t=(null==i?void 0:i[r.name])||[];if(we)return t;{ye.push(r);const n=[...i["!UpdateSecondPartyData"]||[],...i["!UpdateThirdPartyData"]||[]];return Qt(st)(t,n)}case"lookalikeTransition":return(null==i?void 0:i[r.name])||[];case"transition":const o=(null==i?void 0:i[r.name])||[];if(be){const t=i["!UpdateLookalikeModels"]||[];return o.concat(t)}return o;case"bootstrap":const u=((null==i?void 0:i[r.name])||[]).filter((t=>void 0!==n[t]));return Qt(st)(u,[...we?[]:(i["!UpdateSecondPartyData"]||[]).concat(i["!UpdateThirdPartyData"]||[]),...be?[]:i["!UpdateLookalikeModels"]||[]]);case"updateExternalState":return Object.keys(e);case"updateLAL":return i["!UpdateLookalikeModels"]||[];case"updateTPD":return[...i["!UpdateSecondPartyData"]||[],...i["!UpdateThirdPartyData"]||[]];default:return[]}}(c,t,u,a,f),v=m.length;!function(t){he(t)&&((t=>{const n=_e.get1PSegments(),e={"1p":Object.assign(Object.assign({},n["1p"]),t["1p"])};_e.get1PSegments=()=>e})({"1p":{[t.properties.segment_number]:"SegmentEntry"===t.name}}),qe())}(a);for(let e=0;e{if(!(i in t)){const e=n[i];if(void 0===e)throw new Error("Checksum not in internalStateMap");t[i]={checksum:e}}"activations"in t[i]||(t[i].activations={});const o=t[i].activations;e in o||(o[e]=[]);const u=o[e];u.includes(r)||(o[e]=[...u,r])}}function ze(t){return Object.keys(t).reduce(((n,e)=>{const r=Object.keys(t[e]),i=[];return r.forEach((n=>{!0===t[e][n]&&i.push(n)})),n[e]=i,n}),{})}const Me={empty:{},concat:(t,n)=>{const e=Object.assign({},t);for(const[t,r]of Object.entries(n))e[t]?e[t]=ge(e[t],r):e[t]=r;return e}};const Ce=(t,n)=>{const e=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;ir,be=!0,Se(t,n,e,ke,"updateLAL",i,o)}(...e(t)):"updateTPD"===t.type?Ae(...e(t)):"updateExternalState"===t.type?function(t,n,e,r,i){return Se(t,n,e,ke,"updateExternalState",r,i)}(...e(t)):t.type===ve?je(...e(t,"event")):"processTransitions"===t.type?function(t,n,e,r,i,o){return je(t,n,e,r,"transition",i,o)}(...e(t)):{diff:{},errors:[]}};var Ne;Ne="bun",self["_____"+"sourceCodeRuntime"]=Ne;const Ee=function(t){let n=p;const e=L((()=>{const e=t();return n=m(e),e}));return()=>e(n)}((function(){var t;(()=>{var n={234:function(t,n,c){var s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var n,e=1,r=arguments.length;e=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},l=this&&this.__read||function(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,i,o=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return u},d=this&&this.__spreadArray||function(t,n,e){if(e||2===arguments.length)for(var r,i=0,o=n.length;i=t&&e<=n}},j=function(t){return new Date(t).getTime()},S=function(t){return h(t,["time"],j)},O=function(t,n){return h(n,t,j)},z=function(t,n,e,r,i,o){return function(u){var a=h(u,t,(function(t){return t.filter(r).map((function(t){return h(t,n)})).reduce(i,o)}));return e(null===a?o:a)}};function M(t,n,e,r){var i,o;try{for(var u=f(t),a=u.next();!a.done;a=u.next()){var c=a.value;if(e(c)&&n(c)===r)return r}}catch(t){i={error:t}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return!r}var C=function(t){return function(e){return("string"==typeof t||"number"==typeof t)&&"string"==typeof e&&e.toLowerCase().indexOf(n(t).toLowerCase())>-1}},N=function(t){return function(n){return null!=n&&Array.isArray(n)&&n.indexOf(t)>=0}};function E(t,n,e,r,i){var o=h(t.getSegments(),[n,e])||!1;return i&&(r||o)&&t.setSegmentActivation(n,e,i),o}function L(t,n,e){return h(t.getSegments(),[n,e])||!1}function P(t,n,e){return void 0===e&&(e=18e5),function(r){return{a:{m:function(t,n){return[n[0],r.a.m(null!=t[0]&&t[0][0]===n[0][0]?t[1]:r.a.z,n[1])]},z:[[],r.a.z]},p:function(e,i){return[[t(e)],h(i,n)===t(e)?r.p(e,i):r.a.z]},r:function(n,e){return r.r(n,0!==e[0].length&&e[0][0]===t(n)?e[1]:r.a.z)},d:r.d.sq||{l:function(i,o){var u=h(i,n),a=t(o);if(u!==a)return null;var c=r.d.l(i,o);if(!(Array.isArray(c)&&c.length>1))return null;var s=l(c),f=s[0],d=s.slice(1),g=+(S(i)||o.getCurrentTime()),p=Math.floor(g/e),m={};return m[p]={},m[p][a]=1===d.length?d[0]:d,[f,"u",null,m]},i:function(n,e){if(!Array.isArray(n)||"object"!=typeof n[3])return[[],r.a.z];var i=t(e),o=n[3];return[[i],Object.keys(o).map((function(t){return o[t][i]})).filter((function(t){return t})).map((function(t){return r.d.i([n[0]].concat(t))})).reduce(r.a.m,r.a.z)]}}}}}var T=P((function(t){return t.getCurrentSession()}),["session_id"],18e5),I=P((function(t){return t.getCurrentView()}),["view_id"],3e5);function B(n,e,r,i){return void 0===i&&(i=1),{a:{m:function(t,n){return t.concat(n).slice(-r)},z:[]},p:function(r,i){return h(i,["name"])===t(e)?[n.p(r,i)]:[]},r:function(t,e){return n.r(t,e.reduce((function(t,e){return n.a.m(t,e)}),n.a.z))},d:n.d.ftn||{l:function(t,e){var o,u=n.d.l(t,e),a=h(t,["time"],j)*i;return u&&[u[0],"x"+r,null,(o={},o[a]=2==u.length?u[1]:u.slice(1),o)]},i:function(t,e){return t?Object.keys(t[3]||{}).sort().reverse().map((function(n){return Array.isArray(n)?d([t[0]],l(t[3][n]),!1):[t[0],t[3][n]]})).map((function(t){return n.d.i(t,e)})):[]}}}}var F=function(t,n){return null===t?null==n?null:{b:n}:null==n?{a:t}:{a:t,b:n}},G=function(t,n){return t&&n?t(n):null},D=function(t,n,e){if(e&&e.result&&Array.isArray(e.result)){var r=G(t.d&&t.d.m,{result:e.result[0]}),i=G(n.d&&n.d.m,{result:e.result[1]});return F(r,i)}return null};var U=function(t){return function(n){function e(t){for(var n=t[0],e=1;e0;i--)r[i]=e[1],e=e[0];return r[0]=e,r}return{p:function(t,r){return e(n.map((function(n){return n.p(t,r)})))},r:function(e,i){var o=r(i);return t(n.map((function(t,n){return function(){return t.r(e,o[n])}})))({})},a:{z:e(n.map((function(t){return t.a.z}))),m:function(t,i){var o=r(t),u=r(i);var a=n.map((function(t,n){return function(t,n,e){return null===n?e:null===e?n:t.a.m(n,e)}(t,o[n],u[n])}));return e(a)}},d:{l:function(t,e){return function(t){for(var n=t[0],e=1;e0&&i;a--)i.b&&(o[a]=u(a,i.b)),i.a&&1===a&&(o[0]=u(0,i.a)),i=i.a;return e(o)}(t,r)}}}}},H=U(_),R=U(q);function V(t,n){var e=o[t];if(!n||!e)return!1;if(!e.length)return!0;for(var r=0,i=!1,u=function(t){for(var n=[],e=0;e=55296&&r<=56319){var i=t.charCodeAt(e+1);if(i>=56320&&i<=57343){n.push(t.slice(e,e+2)),++e;continue}}n.push(t.charAt(e))}return n}(n.toLowerCase()),a=0;a0&&!e[r][c];)r=e[r].su?e[r].su:0;if(e[r][c]&&(i=!!e[r=e[r][c]].te))break}return i}var $=function(t){return(0,p.default)(t).toString(m.default).slice(0,8)},J=function(t,n){var e,r,i=$(t);if(0===n.length)return!1;if(n[0]===i)return!0;for(var o=0,u=n.length,a=!1;(a=(e=n[r=o+(u-o>>1)])!==i)&&(e=u-1)););return!a},W=function(t,n){return function(e){return J(h(e,t),n)}},Y=function(t,n){return function(e){return J(w(e,t),n)}};return{q:function(t){return{lift:function(n,e){return t.d.l(n,e)},interpret:function(n,e){return function(n,e){return{result:t.r(n,e)}}(e,t.d.i(n,e))},migrate:function(n){return n&&t.d.m?t.d.m(n):null},m:t.a.m,z:t.a.z,p:t.p,r:t.r,i:t.d.i}},a:q,acq:function(t,n){return{p:function(e,r){return[t.p(e,r),n.p(e,r)]},r:function(e,r){return t.r(e,r[0])&&n.r(e,r[1])},a:{z:[t.a.z,n.a.z],m:function(e,r){return[t.a.m(e[0],r[0]),n.a.m(e[1],r[1])]}},d:{l:function(e,r){return F(t.d.l(e,r),n.d.l(e,r))},i:function(e,r){return e?[t.d.i(e.a||null,r),n.d.i(e.b||null,r)]:[t.a.z,n.a.z]},m:function(e){return D(t,n,e)}}}},acqs:R,acs:V,acs_:function(t,n){return function(e){return V(n,h(e,t))}},af_i:function(t,n,e){return void 0===e&&(e=b),function(r){return h(r,t,(function(t){return M(t,n,e,!1)}))&&!0}},af_l:function(t,n,e){return void 0===e&&(e=b),function(r){var i=h(r,t,(function(t){return t.filter(e).length}));return n(null===i?0:i)}},af_m:function(t,n,e,r){return void 0===r&&(r=b),function(i){var o=h(i,t,(function(t){return t.filter(r)}));return null===o||0===o.length?e(0):e(o.map((function(t){return h(t,n)})).reduce((function(t,n){return t+n}),0)/o.length)}},af_n:function(t,n,e,r){return void 0===r&&(r=b),z(t,n,e,r,(function(t,n){return Math.min(t,n)}),Number.POSITIVE_INFINITY)},af_p:function(t,n,e,r){return void 0===r&&(r=b),z(t,n,e,r,(function(t,n){return t*n}),1)},af_s:function(t,n,e,r){return void 0===r&&(r=b),z(t,n,e,r,(function(t,n){return t+n}),0)},af_u:function(t,n,e){return void 0===e&&(e=b),function(r){return h(r,t,(function(t){return M(t,n,e,!0)}))||!1}},af_x:function(t,n,e,r){return void 0===r&&(r=b),z(t,n,e,r,(function(t,n){return Math.max(t,n)}),Number.NEGATIVE_INFINITY)},as:function(t,n,e){var r=v("properties",n);return function(n){for(var i=h(n,r),o=e.length,u=!0,a=0;at}},g_:function(t,n){return function(e){return h(e,t)>n}},gb:function(t,n,e){return{a:{m:function(e,r){var i=Object.keys(e).concat(Object.keys(r)).filter((function(t,n,e){return e.indexOf(t)===n})).sort((function(t,n){return Math.max(h(e,[n,1]),h(r,[n,1]))-Math.max(h(e,[t,1]),h(r,[t,1]))})).slice(0,n).reduce((function(n,i){var o=t.a.m(h(e,[i,0])||t.a.z,h(r,[i,0])||t.a.z);return n[i]=[o,Math.max(h(e,[i,1]),h(r,[i,1]))],n}),{});return i},z:{}},p:function(n,r){var i,o,u=h(r,v("properties",e)),a=t.p(n,r);return null==u||(null==(o=a)||"object"==typeof o&&0===Object.keys(o).length||o===t.a.z)?{}:((i={})[u]=[a,h(r,["time"],j)],i)},r:function(n,e){var r={};return Object.keys(e).forEach((function(i){return r[i]=t.r(n,e[i][0])})),r},d:{l:function(){return null},i:function(){return{}}}}},ge:function(t){return function(n){return n>=t}},ge_:function(t,n){return function(e){return h(e,t)>=n}},bse:function(t,n){return function(e){var r=h(e,t);return $(r)===n}},bsne:function(t,n){return function(e){var r=h(e,t);return $(r)!==n}},bsc:W,bsnc:function(t,n){return x(W(t,n))},bsc_:Y,bsnc_:function(t,n){return x(Y(t,n))},i_:y,ifp:function(t){return{a:{m:function(t,n){return n},z:null},p:function(t){return null},r:function(n,e){return function(n){return L(n,"1p",t)}(n)},d:{l:function(t,n){return null},i:function(t){return null}}}},isp:function(t,n,e,r){return{a:{m:function(t,n){return n},z:!1},p:function(e,r){return L(e,t,n)},r:function(i,o){return E(i,t,n,e,r)},d:{l:function(t,n){return null},i:function(t){return Array.isArray(t)&&(!!+t[2]||!1)}}}},itp:function(t,n,e,r){return{a:{m:function(t,n){return n},z:!1},p:function(e,r){return L(e,t,n)},r:function(i,o){return E(i,t,n,e,r)},d:{l:function(t,n){return null},i:function(t){return Array.isArray(t)&&(!!+t[2]||!1)}}}},k:h,l:function(t){return function(n){return nn?t:n},z:o},p:function(i,u){return h(u,["name"])===t(n)&&e(u)?h(u,r):o},r:function(t,n){return i(n)},d:{l:function(i){return h(i,["name"])===t(n)&&e(i)?["v",h(i,r)]:null},i:function(t){return t?Array.isArray(t)?t.slice(-1)[0]:t:o}}}},n0:x(y),n:function(t){return function(n){return n!==t}},nt:x,n_:function(t,n){return function(e){return h(e,t)!==n}},o:_,ocq:function(t,n){return{p:function(e,r){return[t.p(e,r),n.p(e,r)]},r:function(e,r){return t.r(e,r[0])||n.r(e,r[1])},a:{z:[t.a.z,n.a.z],m:function(e,r){return[t.a.m(e[0],r[0]),n.a.m(e[1],r[1])]}},d:{l:function(e,r){return F(t.d.l(e,r),n.d.l(e,r))},i:function(e,r){return e?[t.d.i(e.a||null,r),n.d.i(e.b||null,r)]:[t.a.z,n.a.z]},m:function(e){return D(t,n,e)}}}},ocqs:H,oe:function(t){for(var n=Object.keys(t),e=n.length,r=new Array(e);e--;)r[e]=[n[e],t[n[e]]];return r},os:function(t,n,e){var r=v("properties",n);return function(n){for(var i=h(n,r),o=e.length,u=!1,a=0;a=0}},pc_:function(t,e){return function(r){var i=w(r,t),o=n(e);return null!=i&&Array.isArray(i)&&i.indexOf(o)>=0}},pe:function(t,n){return function(e){return w(e,t)===n}},pg:function(t,n){return function(e){return w(e,t)>n}},pge:function(t,n){return function(e){return w(e,t)>=n}},pl:function(t,n){return function(e){var r=w(e,t);return null!==r&&r=1?["m2p",o]:o>0?["m2p",null,1/o]:0==o?["m2p",0]:o>-1?["m2p",null,1/o,1]:["m2p",o,null,1]:null;var o},i:function(t){return t?Array.isArray(t)?0===(n=t.slice(1))[0]?0:Math.pow(-1,n[2]||0)*(n[0]||1)/(n[1]||1):t:1;var n}}}},r:function(t){for(var n=[],e=1;et}},tg_:function(t,n){return function(e){return O(t,e)>n}},tge:function(t){return function(n){return S(n)>=t}},tge_:function(t,n){return function(e){return O(t,e)>=n}},ti:j,tl:function(t){return function(n){return S(n)=r})).concat(Object.keys(e[1]).filter((function(t){return t>=r}))).filter((function(t,n,e){return e.indexOf(t)===n})).reduce((function(r,i){var o=t.a.m(n[1][i]||t.a.z,e[1][i]||t.a.z);return o!==t.a.z&&(r[i]=o),r}),{});return[r,i]},c=[Number.NEGATIVE_INFINITY,{}],s=function(t){var n=function(n){return n.map((function(n){var e=l(n,3),r=e[0],i=(e[1],e[2]);return u(t.t,i,r)})).reduce(a,c)};return a(n(t.in),n(t.out))},f=function(n){if(void 0!==n.result)return f(n.result);if(void 0!==n.w)return f(s(n));var e=l(n,2),r=(e[0],e[1]),i=null,o={};for(var u in r){var a=t.d.m({result:r[u]});a&&Array.isArray(a)&&(i=a[0],o[u]=g(a.slice(1)))}return i&&[i,"w",n[0],o]};return{a:{m:function(t,n){var e=t.w?s(t):t;return a(e,n)},z:c},p:function(n,e){return u(n.getCurrentTime(),h(e,["time"],j),t.p(n,e))},r:function(n,e){var r=(e.w?s(e):e)[1];return t.r(n,Object.keys(r).reduce((function(n,e){return t.a.m(n,r[e])}),t.a.z))},d:t.d.tw||{l:function(n,e){var r=t.d.l(n,e),i=t.d.i(r,e);return r&&d([r[0],"w"],l(u(e.getCurrentTime(),h(n,["time"],j),i)),!1)},i:function(t,e){var r=Array.isArray(t)?t:[],i=e.getCurrentTime(),u=o(i.getTime()-n);return[r[2]||null,Object.keys(r[3]||{}).map((function(t){var n;return(n={})[t]=r[3][t],n})).reduce((function(t,n){return Object.keys(n).filter((function(t){return parseInt(t)>=u})).forEach((function(e){return t[e]=n[e]})),t}),{})]},m:t.d.m&&f}}},vgw:function(n,e,r,i){void 0===i&&(i=y);var o={v:0,k:0};return{a:{m:function(t,n){var e=t.k+n.k;return{v:e?t.v+n.k*(n.v-t.v)/e:0,k:e}},z:o},p:function(i,u){return h(u,["name"])===t(n)&&e(u)?{v:h(u,r),k:1}:o},r:function(t,n){return i(n.v)},d:{l:function(i){return h(i,["name"])===t(n)&&e(i)?0==(o=h(i,r))?["p3",1]:o<0?["p3",1,null,-o]:["p3",1,o]:null;var o},i:function(t){return t?Array.isArray(t)?{v:(((n=t.slice(1))[1]||0)-(n[2]||0))/(n[0]||1),k:n[0]||0}:void 0:o;var n}}}},vq:I,w:function(t){return function(e){return e===n(t)}},x:function(t){return function(e){return e!==n(t)}},y:function(t,n){return function(e){return w(e,t)===r[n]}},y_:function(t,n){return function(e){return h(e,t)===r[n]}},z:function(t,n){return function(e){return w(e,t)!==r[n]}},z_:function(t,n){return function(e){return h(e,t)!==r[n]}}}}()},249:function(t,n,e){var r;t.exports=(r=r||function(t,n){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==e.g&&e.g.crypto&&(r=e.g.crypto),!r)try{r=e(480)}catch(t){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(n){var e;return t.prototype=n,e=new t,t.prototype=null,e}}(),u={},a=u.lib={},c=a.Base={extend:function(t){var n=o(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=a.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=e!=n?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var n=this.words,e=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;n[r+o>>>2]|=u<<24-(r+o)%4*8}else for(var a=0;a>>2]=e[a>>>2];return this.sigBytes+=i,this},clamp:function(){var n=this.words,e=this.sigBytes;n[e>>>2]&=4294967295<<32-e%4*8,n.length=t.ceil(e/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var n=[],e=0;e>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var n=t.length,e=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new s.init(e,n/2)}},d=f.Latin1={stringify:function(t){for(var n=t.words,e=t.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var n=t.length,e=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new s.init(e,n)}},g=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=g.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(n){var e,r=this._data,i=r.words,o=r.sigBytes,u=this.blockSize,a=o/(4*u),c=(a=n?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*u,f=t.min(4*c,o);if(c){for(var l=0;l>>6-u%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return n.create(i,o)}t.enc.Base64={stringify:function(t){var n=t.words,e=t.sigBytes,r=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(n[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|n[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(t){var n=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>31}var l=(r<<5|r>>>27)+a+c[s];l+=s<20?1518500249+(i&o|~i&u):s<40?1859775393+(i^o^u):s<60?(i&o|i&u|o&u)-1894007588:(i^o^u)-899497514,a=u,u=o,o=i<<30|i>>>2,i=r,r=l}e[0]=e[0]+r|0,e[1]=e[1]+i|0,e[2]=e[2]+o|0,e[3]=e[3]+u|0,e[4]=e[4]+a|0},_doFinalize:function(){var t=this._data,n=t.words,e=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=Math.floor(e/4294967296),n[15+(r+64>>>9<<4)]=e,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}}),r.SHA1=u._createHelper(s),r.HmacSHA1=u._createHmacHelper(s),f.SHA1)},480:()=>{}},c={};function s(t){var e=c[t];if(void 0!==e)return e.exports;var r=c[t]={exports:{}};return n[t].call(r.exports,r,r.exports,s),r.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var f=s(234);t=f.env})();var n={"!UpdateLookalikeModels":["141494","143386","146626","146697","147227","147353","147409"],"!UpdateThirdPartyData":["184817"],LinkClick:["164840"],Pageview:["10000000","10000001","10000002","10000003","10000004","10000005","10000006","10000007","10000008","10000010","10000011","10000012","10000013","10000014","10000015","10000016","10000017","10000018","10000019","10000020","10000021","10000022","10000023","10000024","10000025","10000026","10000035","10000036","10000037","10000038","10000039","10000040","10000041","10000042","10000043","10000044","10000045","10000046","10000047","10000048","10000049","10000050","10000051","10000052","10000053","10000054","10000055","10000056","10000057","10000058","10000059","10000060","10000061","10000062","10000063","10000064","10000065","10000066","10000067","10000068","10000069","10000070","10000071","10000072","10000073","10000074","10000075","10000076","10000077","10000078","10000079","10000080","10000081","10000082","10000083","10000084","10000085","10000086","10000087","10000088","10000089","10000090","10000324","10000325","10000327","10000328","10000329","10000330","10000687","10000688","10000689","10000690","10000691","10000692","10000693","10000694","10000695","10000696","10000697","10000698","10000699","10000700","10000701","10000702","10000703","10000704","10000705","10000706","10000707","10000708","10000709","10000710","10000711","10000712","10000713","10000714","10000715","10000716","10000717","10000718","10000719","10000720","10000721","10000722","10000723","10000724","10000725","10000726","10000727","10000728","10000729","10000730","10000731","10000732","10000733","10000734","10000735","10000736","10000737","10000738","10000739","10000740","10000741","10000742","10000743","10000744","10000745","10000746","10000747","10000748","10000749","10000750","10000751","10000752","10000753","10000754","10000755","10000756","10000757","10000758","10000759","10000760","10000761","10000762","10000763","10000764","10000765","10000766","10000767","10000768","10000769","10000770","10000771","10000772","10000773","10000774","10000775","10000776","10000777","10000778","10000779","10000780","10000781","10000782","10000783","10000784","10000785","10000786","10000787","10000788","10000789","10000790","10000791","10000792","10000793","10000794","10000795","10000796","10000797","10000798","10000799","10000800","10000801","10000802","10000803","114983","128069","130974","130975","130976","130977","130978","132458","133973","133974","136104","137422","140449","143388","145671","157061","157062","157063","157064","157065","157066","157369","162759","162760","162761","162769","162876","162877","162979","162980","162981","162982","163786","164432","164675","164929","164930","164931","164939","165128","165129","165130","165131","165132","165133","165134","165135","165136","165137","165138","165139","165140","165141","165142","165143","165144","165145","165146","165147","165426","165427","165428","165497","172125","173933","173934","175726","184817","187302"],PageviewComplete:["130974","143387","143388","145671","164674","164675","164676","164683","165543","165821","172125","181515","181516","183194","184030","184031","184032","189696"],PageviewEngagement:["130974","143387","143388","145671","164674","164675","164676","164683","165543","165821","172125","181515","181516","183194","184030","184031","184032","189696"],PostEngagement:["130972","130973","130974","130975","130976","130977","130978","132458","137422","137871","137874","140449","143388","145671","157067","163786","164674","164675","165125","165543","165821","165834","172125","172126","172230","172231","172232","181515","181516","183194","184030","184031","184032","184817","189696"],SegmentEntry:[],SegmentExit:[],SlotClicked:["140452","141495","146817","164433","165127"]},e=["Pageview","PostEngagement","PageviewComplete","PageviewEngagement","SlotClicked"],r=t.frontDecode("/art and entertainment/books and literature\\t43\\t/poetry\\t23\\tcomics and animation\\t23\\tdance\\t23\\tmovies and tv\\t36\\t/animated\\t37\\tchildren\'s\\t38\\tomedies\\t37\\tdocumentaries\\t37\\treality\\t38\\tomantic comedies\\t37\\ttelevision\\t24\\tusic/music genres/classical music\\t42\\topera\\t42\\tpop music\\t42\\tsoundtracks\\t23\\tshows and events/classical concert\\t23\\ttheatre\\t2\\tutomotive and vehicles/cars/luxury\\t25\\tmotorcycles\\t1\\tbusiness and industrial\\t24\\t/fashion industry\\t1\\teducation/adult education\\t11\\tlanguage learning\\t1\\tfamily and parenting\\t2\\tinance/accounting and auditing/tax preparation and planning\\t9\\tfinancial news\\t2\\tood and drink/dining out\\t16\\tfood/fruits and vegetables\\t21\\tsalads\\t16\\thealthy eating\\t16\\tvegan\\t19\\tetarian\\t1\\thealth and fitness\\t2\\tobbies and interests/arts and crafts/photography\\t23\\tbirdwatching\\t3\\tme and garden/gardening and landscaping\\t17\\thome improvement and repair\\t1\\tpets/birds\\t6\\tlarge animals\\t1\\tsociety/crime\\t9\\tdating\\t2\\tports/diving\\t8\\thorse racing\\t13\\ts\\t8\\tolympics/paralympic games\\t8\\tskiing\\t8\\tvolleyball/beach volleyball\\t2\\ttyle and fashion/beauty/cosmetics\\t1\\ttechnology and computing/consumer electronics/tv and video equipment\\t\\tAdrian Chase / Vigilante\\t1\\tnime\\t5\\t Expo\\t6\\tNYC\\t6\\tart\\t6\\tfan\\t6\\tmusic video\\t6\\tstyle\\t\\tBitcoin\\t1\\tlackjack\\t\\tCasino\\t6\\ts\\t1\\tomic Girls\\t6\\tbook\\t5\\ts\\t6\\t M\\t1\\tryptocurrency\\t\\tDC\\t2\\t Comics\\t1\\teadshot\\t\\tEthereum\\t\\tF\\t1\\t1\\t1\\tood\\t\\tGambling\\t\\tJohn Cena\\t\\tLeota Adebayo\\t\\tM\\t1\\tK1\\t1\\tanga\\t3\\thwa\\t1\\tovie\\t5\\ts\\t\\tNSFW\\t\\tPS4\\t2\\t5\\t1\\toker\\t\\tSeinen manga\\t1\\thojo manga\\t3\\tnen manga\\t1\\tlots\\t1\\tports\\t\\tadrian chase / vigilante\\t1\\tndroid\\t2\\timal\\t6\\ts\\t4\\te\\t5\\t-and-manga\\t15\\t-section\\t6\\tfight\\t6\\tgirl\\t6\\tmanga\\t6\\twaifu\\t8\\tllpaper\\t5\\tgirl\\t5\\ts\\t1\\tpex legends\\t4\\t-legends\\t1\\tquaman\\t1\\tsk\\t2\\tus\\t1\\tttack on titan\\t6\\t-on-titan\\t\\tbaldur gate\\t2\\tsketball\\t2\\ttman\\t1\\teauty\\t2\\tt\\t3\\t365\\t3\\tting\\t3\\tway\\t1\\tinance\\t2\\ttcoin\\t1\\tlackjack\\t2\\teach\\t2\\tizzard\\t2\\tockchain\\t2\\tue archive\\t1\\tmw\\t1\\toruto\\t2\\txing\\t1\\turger\\t\\tcar\\t3\\ts\\t2\\tsino\\t6\\ts\\t2\\tt\\t1\\thainsawman\\t2\\tocolate\\t1\\tomic\\t5\\t-and-webtoon\\t7\\trt\\t6\\tgirls\\t6\\twebtoon\\t5\\ts\\t3\\tputer\\t2\\tnsole\\t2\\tokies\\t5\\tng\\t4\\ts\\t2\\trsair\\t2\\tunter-strike\\t1\\trypto\\t6\\tcurrency\\t\\tdc\\t1\\teadshot\\t2\\tmon slayer\\t1\\tiablo\\t1\\tog\\t3\\tecoin\\t1\\traftkings\\t3\\tgon ball\\t\\telden-ring\\t1\\tth\\t3\\tereum\\t\\tf1\\t1\\tashion\\t3\\ttfood\\t1\\terrari\\t1\\tifa\\t2\\tght\\t2\\tsh\\t1\\tlash\\t1\\tood\\t4\\t delivery\\t3\\ttball\\t1\\ttx\\t\\tgadget\\t2\\tmble\\t5\\ting\\t3\\te\\t4\\tr\\t4\\ts\\t5\\tcom\\t3\\ting\\t1\\tenshin\\t7\\t impact\\t7\\t-impact\\t1\\tirlsfw\\t1\\toku\\t2\\tlf\\t2\\togle pixel\\t1\\tta\\t1\\tundam\\t\\tharley-quinn\\t1\\togwarts-legacy\\t1\\tttps://9gag.com/fresh\\t17\\ttag/anime\\t22\\tpex-legends\\t21\\tcall-of-duty\\t22\\tounter-strike\\t28\\tstrike\\t22\\tyberpunk-2077\\t21\\tdiablo\\t21\\telden-ring\\t21\\tfgo\\t22\\tortnite\\t21\\tgaming\\t22\\tenshin-impact\\t21\\thalf-life\\t24\\to\\t22\\togwarts-legacy\\t23\\tnkai-impact-3rd\\t21\\tleague-of-legends\\t21\\tmovie-tv\\t21\\tnier-automata\\t23\\tkke\\t21\\toverwatch\\t21\\tpubg\\t21\\tsport/hot\\t22\\tteam\\t21\\ttank\\t22\\team-fortress-2\\t21\\tworld-of-warcraft\\t21\\tzelda\\t18\\top\\t18\\trending\\t1\\tumor\\t\\tios\\t1\\tpad\\t2\\thone\\t\\tjdm\\t1\\tohn cena\\t1\\tujutsu kaisen\\t\\tknockout\\t\\tlady\\t1\\teota adebayo\\t2\\txus\\t1\\tifestyle\\t\\tmaple\\t5\\tstory\\t2\\trvel\\t1\\teme\\t1\\tk1\\t1\\tma\\t1\\totorvehicles\\t2\\tvie\\t5\\t-tv\\t5\\ts\\t\\tnani\\t2\\truto\\t1\\tetflix\\t2\\tws\\t1\\tft\\t1\\tissan\\t1\\tsfw\\t1\\tvidia\\t\\tone piece\\t1\\tpm\\t1\\tverwatch\\t\\tpc\\t2\\tmr\\t1\\teacemaker\\t2\\tt\\t1\\thone\\t3\\ttography\\t1\\tizza\\t1\\tlaystation\\t1\\tokemon\\t4\\tr\\t5\\tstars\\t2\\trsche\\t1\\ts4\\t2\\t5\\t1\\tubg\\t\\trandom\\t1\\telationship\\t1\\tugby\\t\\tsamsung\\t1\\tcience\\t1\\tlot\\t4\\t machine\\t4\\ts\\t1\\tmartliving\\t5\\tphone\\t1\\toccer\\t2\\tny\\t1\\tport\\t5\\ts\\t2\\ty-x-family\\t1\\tteam\\t1\\tuicide squad\\t2\\tperhero\\t5\\tman\\t1\\twim\\t\\ttaco\\t2\\tsty\\t1\\tennis\\t2\\tsla\\t1\\toyota\\t1\\travel\\t1\\tv show\\t\\tubisoft\\t1\\tfc\\t\\tvegas\\t\\twarhammer\\t1\\tebcomic\\t1\\tholesome\\t1\\titcher\\t1\\toah\\t2\\tmen\\t2\\tnder woman\\t2\\trld cup\\t1\\ttf\\t\\txbox\\t\\tyakuza\\t\\tzelda"),i=[["classifications_watson","taxonomy_labels"],["client","url"],["post","tags"],["post","annotation_tags"],["post","title"],["user","tags_favorited"],["user","gender"],["user","age"],["geo_info","country"],["aggregations","PageviewEngagement","engaged_time"],["post","interests"],["client","title"],["client","type"],["advertiser_id"]],o=[],u=[t.o([t.ref(3),t.os(t.cx,2,[117,179,269,304,281,280,134,178]),t.ref(21)]),t.os(t.s,1,[242]),t.os(t.s,1,[276]),t.os(t.cx,3,[117,179,269,304,281,280,134,178]),t.os(t.s,1,[307]),t.os(t.s,1,[214,248]),t.bsc_(1,["KLSlK1iN","tFWBcmbt","vbnCAcsT"]),t.os(t.s,1,[204,205,208,211,212,215,216,217,224]),t.os(t.s,1,[219,288]),t.os(t.cx,3,[78,75,50,76,262]),t.os(t.s,1,[96]),t.o([t.ref(49),t.os(t.cx,2,[302,169,259,181,125,290,314,267,106,113,308,315,184,182,305,157]),t.os(t.s,4,[106,113,125,157,169,181,182,184,259,267,290,302,305,308,314,315])]),t.os(t.cx,2,[187,186]),t.os(t.s,1,[136]),t.os(t.s,1,[279]),t.os(t.s,1,[173]),t.os(t.s,1,[252]),t.os(t.s,1,[227]),t.os(t.s,1,[292]),t.os(t.cx,5,[83,255]),t.o([t.os(t.cx,3,[67,291,292,68,69,194,108,172,311,115,293]),t.os(t.cx,2,[67,291,292,68,155,194,108,172,311,115,293]),t.ref(28)]),t.os(t.s,4,[117,134,178,179,269,280,304]),t.os(t.s,4,[146,267,272,273,286,314]),t.os(t.cx,3,[239,240]),t.os(t.cx,2,[239,240]),t.os(t.s,1,[309]),t.os(t.s,1,[95]),t.os(t.s,1,[198,200,202,203,204,207,211,213,217,218,223]),t.os(t.s,4,[108,115,154,155,172,194,291,292,293,311]),t.os(t.s,1,[197]),t.os(t.s,1,[139]),t.os(t.s,1,[199,201,206,209,210,217,218,220,221,222]),t.bsc_(8,["doaFylgq"]),t.o([t.os(t.cx,3,[146,286,85,84,267,314]),t.os(t.cx,2,[146,286,85,84,267,314]),t.ref(22)]),t.os(t.cx,10,[235,310,238,166,116]),t.os(t.s,1,[255]),t.os(t.s,1,[245]),t.os(t.s,4,[92,232,236,243,262]),t.os(t.s,1,[96,139]),t.o([t.os(t.cx,3,[126,253,152,164,122,117,179,269,304,281,280,134,178]),t.os(t.cx,2,[126,253,152,164,122,117,179,269,304,281,280,134,178]),t.os(t.s,4,[117,122,126,134,152,164,178,179,253,269,280,304])]),t.os(t.cx,3,[80,87,89,88,62,63,65,64,56,57,52,53,55,54,79,51]),t.os(t.cx,2,[112,289,137,249,306,140,143,142,141,144,139,97,98,103,99,101,102,100,104,105,96]),t.o([t.ref(9),t.os(t.cx,2,[78,75,50,76,262]),t.ref(37)]),t.os(t.s,1,[275]),t.nt(t.ref(35)),t.o([t.ref(23),t.ref(24),t.ref(46)]),t.os(t.s,4,[239]),t.os(t.s,1,[182,207]),t.os(t.s,1,[109]),t.os(t.cx,3,[302,169,259,181,125,290,314,267,106,113,308,315,184,182,305,157]),t.o([t.pc_(3,127),t.pc_(2,127),t.ps(4,127)]),t.os(t.s,1,[313]),t.os(t.s,1,[188]),t.o([t.pc_(3,72),t.pc_(2,72),t.ps(4,72)])],a=[(n,e)=>t.q(t.acqs([t.ocqs(n),t.cw(0,e,t.ge(1))])),(n,e)=>t.q(t.cw(n,e,t.ge(1))),(n,e,r)=>t.q(t.cw(0,t.a([t.y(6,n),t.pge(7,e),t.ple(7,r)]),t.ge(1))),n=>t.q(t.cw(0,t.a([t.y(6,n),t.pge(7,18)]),t.ge(1))),(n,e)=>t.q(t.cw(0,t.a([t.pge(7,n),t.ple(7,e)]),t.ge(1))),n=>t.q(t.cw(0,t.os(t.s,8,n),t.ge(1))),n=>t.q(t.cw(0,t.bsc_(8,n),t.ge(1))),(n,e)=>t.q(t.cw(0,t.y(n,e),t.ge(1))),n=>t.q(t.cw(0,t.pe(8,n),t.ge(1))),(n,e)=>t.q(t.cw(0,t.ps(n,e),t.ge(1))),n=>t.q(t.cw(4,t.pe(13,n),t.ge(1))),n=>t.q(t.ocqs(n)),(n,e,r,i)=>t.q(t.ocqs([n,e,r,i])),(n,e,r,i,o,u,a,c,s,f,l)=>t.q(t.ocqs([t.cw(n,e,t.ge(r)),t.cw(1,t.os(i,o,u),t.ge(a)),t.cw(1,t.os(c,s,f),t.ge(l))])),(n,e,r,i,o,u,a,c,s)=>t.q(t.ocqs([t.cw(n,e,t.ge(s)),t.cw(r,i,o),t.cw(u,a,c)])),(n,e,r,i,o,u,a)=>t.q(t.ocqs([t.cw(n,t.os(o,u,a),t.ge(3)),t.cw(1,t.os(e,r,i),t.ge(3))])),n=>t.q(t.ocqs([t.lm("36bcff11-0fc3-4c0c-aaf2-5483ed3e0c0f",t.ge(n)),t.ifp("141495")])),n=>t.q(t.ocqs([t.lm("bdbf96d9-3894-4fcb-a898-f4a624b62341",t.ge(n)),t.ifp("146817")])),(n,e,r,i,o,u,a)=>t.q(t.ocqs([t.tw(t.cw(o,u,a),e),t.tw(r,i),n])),(n,e,r)=>t.q(t.ocqs([t.tw(t.cw(0,t.os(t.s,1,n),t.ge(3)),24192e5),t.sq(t.cw(0,t.o([t.os(t.cx,5,e),t.os(t.s,1,r)]),t.ge(1)))])),(n,e,r)=>t.q(t.ocqs([t.tw(t.cw(0,t.ref(n),t.ge(3)),24192e5),t.sq(t.cw(0,t.o([t.os(t.cx,5,r),t.ref(e)]),t.ge(1)))])),(n,e,r)=>t.q(t.ocqs([t.tw(t.cw(0,t.ref(n),t.ge(3)),24192e5),t.sq(t.cw(0,t.o([t.pc_(5,r),t.ref(e)]),t.ge(1)))])),(n,e)=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,e),t.ge(1)),2592e6)])),(n,e,r)=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,e),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,r),t.ge(1)),2592e6)])),(n,e,r,i)=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,e),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,r),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,i),t.ge(1)),2592e6)])),(n,e,r,i,o)=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,e),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,r),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,i),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,o),t.ge(1)),2592e6)])),(n,e,r,i,o,u,a)=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,e),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,r),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,i),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,o),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,u),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,a),t.ge(1)),2592e6)])),(n,e,r,i,o,u,a,c)=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,e),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,r),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,i),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,o),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,u),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,a),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,c),t.ge(1)),2592e6)])),(n,e,r,i,o,u,a,c,s,f,l,d,g)=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,e),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,r),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,i),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,o),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,u),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,a),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,c),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,s),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,f),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,l),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,d),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,g),t.ge(1)),2592e6)])),n=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,0),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6)])),n=>t.q(t.ocqs([t.tw(t.cw(0,t.pc_(0,7),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6)])),(n,e)=>t.q(t.ocqs([t.tw(t.cw(0,t.y(1,e),t.ge(3)),24192e5),t.sq(t.cw(0,t.y(1,n),t.ge(1)))])),(n,e,r,i,o,u)=>t.q(t.ocqs([t.tw(t.cw(1,t.o([n,t.pc_(10,u),e,r]),t.ge(1)),217728e6),t.scq(t.cw(2,t.a([t.pg(9,1),t.ref(o)])),t.vq(t.sw(3,t.ref(i),["properties","engaged_time"],t.g(1))),t.ge(1))])),(n,e,r,i,o,u)=>t.q(t.ocqs([t.tw(t.cw(1,t.o([t.os(t.cx,3,o),t.os(t.cx,10,r),t.os(t.cx,2,i),t.ref(u)]),t.ge(1)),7776e6),t.scq(t.cw(2,t.a([t.pg(9,30),t.ref(e)])),t.vq(t.sw(3,t.ref(n),["properties","engaged_time"],t.g(30))),t.ge(2))])),(n,e,r,i,o,u)=>t.q(t.ocqs([t.tw(t.cw(1,t.o([t.ref(u),t.os(t.cx,10,i),t.os(t.cx,2,o),n]),t.ge(1)),7776e6),t.scq(t.cw(2,t.a([t.pg(9,30),t.ref(r)])),t.vq(t.sw(3,t.ref(e),["properties","engaged_time"],t.g(30))),t.ge(2))])),(n,e,r,i)=>t.q(t.scq(t.tw(t.sw(2,r,["properties","aggregations","PageviewEngagement","engaged_time"]),n),t.vq(t.sw(3,i,["properties","engaged_time"])),t.g(e))),(n,e,r,i)=>t.q(t.tw(t.cw(e,r,t.ge(i)),n)),n=>t.q(t.tw(t.cw(0,t.pc_(0,n),t.ge(1)),2592e6)),()=>t.q(t.tw(t.cw(0,t.pc_(0,15),t.ge(1)),2592e6)),()=>t.q(t.tw(t.cw(0,t.pc_(0,36),t.ge(1)),2592e6)),(n,e,r,i)=>t.q(t.tw(t.cw(1,t.o([t.os(t.cx,3,n),t.os(t.cx,2,e),t.os(t.s,r,i)]),t.ge(1)),7776e6))];return{rawQueries:{1e7:t.r(22,"/education/graduate school","/science"),10000001:t.r(37,"/automotive and vehicles"),10000002:t.r(29,2),10000003:t.r(22,20,"/finance"),10000004:t.r(22,"/careers",22),10000005:t.r(37,"/education"),10000006:t.r(23,24,41,"/society/social institution/marriage"),10000007:t.r(28,1,3,12,13,16,17,"/art and entertainment/visual art and design/art museums and galleries","/art and entertainment/visual art and design/arts education","/art and entertainment/visual art and design/performance art","/art and entertainment/visual art and design/restoration","/art and entertainment/visual art and design/sculpture","/education/art history",34),10000008:t.r(23,"/business and industrial/food industry","/food and drink","/food and drink/food and grocery retailers"),10000010:t.r(22,30,33),10000011:t.r(37,"/hobbies and interests"),10000012:t.r(37,"/home and garden"),10000013:t.r(22,"/art and entertainment/movies",4),10000014:t.r(37,"/art and entertainment/music"),10000015:t.r(26,"/business and industrial/business news",26,"/law, govt and politics","/news",40,"/sports/sports news","/technology and computing/tech news"),10000016:t.r(23,"/finance/bank",26,"/finance/personal finance"),10000017:t.r(37,"/pets"),10000018:t.r(24,"/art and entertainment/celebrity fan and gossip",9,11,14),10000019:t.r(37,"/real estate"),10000020:t.r(37,"/shopping"),10000021:t.r(22,33,"/sports"),10000022:t.r(22,21,"/style and fashion"),10000023:t.r(23,"/business and industrial/automation","/science/computer science","/technology and computing"),10000024:t.r(24,"/art and entertainment/movies and tv/movies/reviews",11,"/art and entertainment/tv",49),10000025:t.r(37,"/travel"),10000026:t.r(22,"/hobbies and interests/games/video and computer games","/technology and computing/consumer electronics/game systems and consoles"),10000035:t.r(22,"/science/engineering","/science/physics"),10000036:t.r(37,"/automotive and vehicles/buying and selling cars"),10000037:t.r(37,"/automotive and vehicles/motor shows"),10000038:t.r(22,"/automotive and vehicles/cars/hybrid","/automotive and vehicles/electric vehicles"),10000039:t.r(37,19),10000040:t.r(37,"/automotive and vehicles/cars/performance vehicles"),10000041:t.r(22,2,"/art and entertainment/comics and animation/comics"),10000042:t.r(37,"/business and industrial/business operations"),10000043:t.r(37,41),10000044:t.r(37,24),10000045:t.r(37,3),10000046:t.r(37,"/art and entertainment/visual art and design"),10000047:t.r(37,"/food and drink/beverages/alcoholic beverages"),10000048:t.r(37,"/food and drink/barbecues and grilling"),10000049:t.r(22,"/food and drink/desserts and baking","/food and drink/food and grocery retailers/bakeries"),10000050:t.r(22,27,"/food and drink/food/fast food"),10000051:t.r(37,"/food and drink/food allergies"),10000052:t.r(24,28,29,"/food and drink/health and lowfat cooking",30),10000053:t.r(37,32),10000054:t.r(22,"/health and fitness/exercise","/health and fitness/sports medicine"),10000055:t.r(37,"/health and fitness/men\'s health"),10000056:t.r(37,"/health and fitness/nutrition"),10000057:t.r(37,"/health and fitness/women\'s health"),10000058:t.r(39),10000059:t.r(37,"/art and entertainment/movies and tv/action"),10000060:t.r(37,5),10000061:t.r(37,6),10000062:t.r(37,"/art and entertainment/movies and tv/horror"),10000063:t.r(37,40),10000064:t.r(22,"/law, govt and politics/law enforcement","/law, govt and politics/legal issues"),10000065:t.r(37,"/news/national news"),10000066:t.r(22,"/law, govt and politics/government","/law, govt and politics/politics"),10000067:t.r(37,"/science/weather"),10000068:t.r(37,38),10000069:t.r(37,"/pets/cats"),10000070:t.r(37,"/pets/dogs"),10000071:t.r(37,39),10000072:t.r(37,"/pets/reptiles"),10000073:t.r(37,"/sports/football"),10000074:t.r(37,"/sports/baseball"),10000075:t.r(37,"/sports/basketball"),10000076:t.r(37,"/sports/bodybuilding"),10000077:t.r(37,"/sports/bowling"),10000078:t.r(37,"/sports/boxing"),10000079:t.r(37,"/sports/bicycling"),10000080:t.r(37,"/sports/fishing"),10000081:t.r(37,"/sports/golf"),10000082:t.r(37,"/sports/hunting and shooting"),10000083:t.r(37,"/sports/rugby"),10000084:t.r(37,46),10000085:t.r(37,"/sports/tennis"),10000086:t.r(37,"/sports/walking"),10000087:t.r(24,"/business and industrial/tanning","/style and fashion/beauty",48,"/style and fashion/beauty/cosmetology and beauty professionals"),10000088:t.r(22,"/style and fashion/beauty/tattoos","/style and fashion/body art"),10000089:t.r(37,"/style and fashion/men \'s fashion"),10000090:t.r(37,"/technology and computing/consumer electronics"),10000324:t.r(37,20),10000325:t.r(25,"/business and industrial/company/annual report","/business and industrial/company/bankruptcy","/business and industrial/company/earnings","/business and industrial/company/joint venture","/business and industrial/company/merger and acquisition"),10000327:t.r(37,"/finance/personal finance/debt management"),10000328:t.r(37,"/finance/personal finance/insurance"),10000329:t.r(23,"/finance/accounting and auditing/billing and invoicing","/finance/accounting and auditing/bookkeeping",25),10000330:t.r(37,"/finance/investing"),10000687:t.r(37,"/science/social science"),10000688:t.r(37,23),10000689:t.r(22,19,"/automotive and vehicles/scooters and mopeds"),10000690:t.r(27,"/automotive and vehicles/vehicle brands/fiat","/automotive and vehicles/vehicle brands/ford","/automotive and vehicles/vehicle brands/honda","/automotive and vehicles/vehicle brands/hyundai","/automotive and vehicles/vehicle brands/nissan","/automotive and vehicles/vehicle brands/peugeot","/automotive and vehicles/vehicle brands/subaru","/automotive and vehicles/vehicle brands/suzuki"),10000691:t.r(28,18,"/automotive and vehicles/vehicle brands/audi","/automotive and vehicles/vehicle brands/bentley","/automotive and vehicles/vehicle brands/ferrari","/automotive and vehicles/vehicle brands/lamborghini","/automotive and vehicles/vehicle brands/land rover","/automotive and vehicles/vehicle brands/maserati","/automotive and vehicles/vehicle brands/mercedes-benz","/automotive and vehicles/vehicle brands/porsche","/automotive and vehicles/vehicle brands/rolls-royce","/automotive and vehicles/vehicle brands/toyota","/automotive and vehicles/vehicle brands/volkswagen","/automotive and vehicles/vehicle brands/volvo"),10000692:t.r(37,"/automotive and vehicles/cars/coupe"),10000693:t.r(22,"/automotive and vehicles/auto parts","/automotive and vehicles/auto repair"),10000694:t.r(37,"/automotive and vehicles/cars"),10000695:t.r(37,"/automotive and vehicles/cars/sedan"),10000696:t.r(37,"/art and entertainment/books and literature/children\'s books"),10000697:t.r(37,1),10000698:t.r(22,"/careers/career advice","/careers/resume writing and advice"),10000699:t.r(37,"/careers/telecommuting"),10000700:t.r(37,"/careers/career planning"),10000701:t.r(22,"/careers/job fairs","/careers/job search"),10000702:t.r(37,22),10000703:t.r(37,"/education/distance learning"),10000704:t.r(37,"/education/special education"),10000705:t.r(29,23),10000706:t.r(23,"/education/homework and study tips","/education/teaching and classroom resources/lesson plans","/education/teaching and classroom resources/school supplies"),10000707:t.r(37,34),10000708:t.r(37,17),10000709:t.r(37,13),10000710:t.r(24,30,31,32,"/pets/animal welfare"),10000711:t.r(37,"/food and drink/beverages/non alcoholic beverages"),10000712:t.r(23,"/food and drink/kosher food",31,32),10000713:t.r(37,"/food and drink/cuisines"),10000714:t.r(27,"/food and drink/food/condiments and dressings","/food and drink/food/frozen food",28,"/food and drink/food/grains and pasta","/food and drink/food/herbs and spices",29,"/food and drink/food/snack foods","/food and drink/gastronomy/slow food"),10000715:t.r(37,"/health and fitness/aging"),10000716:t.r(37,"/health and fitness/weight loss"),10000717:t.r(37,"/hobbies and interests/arts and crafts"),10000718:t.r(22,"/hobbies and interests/collecting","/hobbies and interests/collecting/stamps and coins"),10000719:t.r(37,"/hobbies and interests/games/board games and puzzles"),10000720:t.r(37,"/hobbies and interests/magic and illusion"),10000721:t.r(37,"/art and entertainment/music/musical instruments"),10000722:t.r(22,35,38),10000723:t.r(22,"/art and entertainment/radio","/technology and computing/consumer electronics/radios"),10000724:t.r(22,"/art and entertainment/books and literature/fan fiction","/art and entertainment/books and literature/science fiction"),10000725:t.r(37,"/home and garden/appliances"),10000726:t.r(37,37),10000727:t.r(11,[t.tw(t.cw(0,t.pc_(0,"/art and entertainment/visual art and design/design/interior design"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/art and entertainment/visual art and design/drawing"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/art and entertainment/visual art and design/painting"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/hobbies and interests/arts and crafts/woodworking"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,37),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/home and garden/remodeling and construction"),t.ge(1)),2592e6)]),10000728:t.r(39),10000729:t.r(25,"/home and garden/bed and bath/bathroom","/home and garden/bed and bath/bedroom","/home and garden/home furnishings","/home and garden/home furnishings/lamps and lighting","/home and garden/interior decorating"),10000730:t.r(37,"/art and entertainment/movies and tv/independent"),10000731:t.r(37,8),10000732:t.r(37,"/art and entertainment/movies and tv/dramas"),10000733:t.r(37,10),10000734:t.r(30,10),10000735:t.r(38),10000736:t.r(38),10000737:t.r(37,"/art and entertainment/music/music genres/jazz"),10000738:t.r(37,12),10000739:t.r(37,"/art and entertainment/music/music genres/blues"),10000740:t.r(37,"/art and entertainment/music/music genres/country music"),10000741:t.r(37,"/art and entertainment/music/music genres/hip hop"),10000742:t.r(37,14),10000743:t.r(22,"/art and entertainment/music/music genres/electronic music",14),10000744:t.r(23,12,13,16),10000745:t.r(37,"/news/local news"),10000746:t.r(37,"/news/international news"),10000747:t.r(37,"/finance/personal finance/financial planning/retirement and pension"),10000748:t.r(22,25,"/finance/personal finance/financial planning"),10000749:t.r(22,43,44),10000750:t.r(37,"/pets/aquariums"),10000751:t.r(30,10),10000752:t.r(37,"/real estate/architects"),10000753:t.r(37,"/real estate/apartments"),10000754:t.r(24,"/business and industrial/agriculture and forestry","/business and industrial/agriculture and forestry/organic farming",35,39),10000755:t.r(37,"/real estate/buying and selling homes"),10000756:t.r(37,47),10000757:t.r(37,"/sports/water polo"),10000758:t.r(37,"/sports/table tennis and ping-pong"),10000759:t.r(37,"/sports/softball"),10000760:t.r(22,"/sports/volleyball",47),10000761:t.r(37,45),10000762:t.r(37,"/sports/rowing"),10000763:t.r(37,"/sports/badminton"),10000764:t.r(37,"/sports/sailing"),10000765:t.r(23,43,44,"/sports/polo"),10000766:t.r(37,"/sports/skating/figure skating"),10000767:t.r(37,"/sports/cheerleading"),10000768:t.r(37,"/sports/auto racing"),10000769:t.r(37,"/sports/weightlifting"),10000770:t.r(37,"/sports/gymnastics"),10000771:t.r(37,"/sports/swimming"),10000772:t.r(37,"/sports/running and jogging"),10000773:t.r(22,"/sports/hockey","/sports/hockey/field hockey"),10000774:t.r(37,42),10000775:t.r(11,[t.tw(t.cw(0,t.pc_(0,"/sports/bicycling/mountain biking"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/canoeing and kayaking"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/climbing"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,42),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/go kart"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/parachuting"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/scuba diving"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/skating"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,46),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/skiing/waterskiing"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/snowboarding"),t.ge(1)),2592e6),t.tw(t.cw(0,t.pc_(0,"/sports/surfing and bodyboarding"),t.ge(1)),2592e6)]),10000776:t.r(37,"/sports/wrestling"),10000777:t.r(22,"/sports/olympics",45),10000778:t.r(37,"/sports/martial arts"),10000779:t.r(37,"/sports/cricket"),10000780:t.r(37,"/sports/soccer"),10000781:t.r(26,"/art and entertainment/shows and events",18,21,27,"/home and garden/luxury homes","/style and fashion/fashion designers","/style and fashion/luxury goods"),10000782:t.r(37,"/style and fashion/beauty/hair care"),10000783:t.r(23,"/style and fashion/accessories",48,"/style and fashion/jewelry"),10000784:t.r(37,"/style and fashion/clothing"),10000785:t.r(37,"/business and industrial/automation/robotics"),10000786:t.r(37,"/science/computer science/artificial intelligence"),10000787:t.r(22,8,49),10000788:t.r(22,9,49),10000789:t.r(30,49),10000790:t.r(22,4,49),10000791:t.r(22,5,49),10000792:t.r(22,6,49),10000793:t.r(37,"/travel/tourist destinations/seaside resort"),10000794:t.r(37,"/travel/tourist destinations/africa"),10000795:t.r(37,"/travel/tourist facilities/camping"),10000796:t.r(37,"/travel/tourist destinations/south america"),10000797:t.r(37,"/travel/transports/road travel/road accident"),10000798:t.r(37,"/travel/tourist destinations/japan"),10000799:t.r(37,"/travel/tourist destinations/australia and new zealand"),10000800:t.r(25,"/travel/tourist destinations/eastern europe","/travel/tourist destinations/europe","/travel/tourist destinations/france","/travel/tourist destinations/greece","/travel/tourist destinations/italy"),10000801:t.r(37,"/travel/specialty travel/adventure travel"),10000802:t.r(37,"/travel/business travel"),10000803:t.r(37,"/travel/traveling with kids"),114983:t.r(1,0,t.t),128069:t.r(7,6,77),130972:t.r(13,1,t.os(t.cx,2,[67,154,"meme-marvel","marvel-and-dc",241,"netflix-adaptation","NETFLIX","Netflix",251,"tv-series","tv-shows",301,"tv-show","movie-recommendation","movies-and-series","movies-tv","Movie TV","movie tv",247,82,248,81,246]),4,t.s,4,["disney","hbo","last of us",241,246,251,"roku",301],4,t.cx,3,[293,115,"spiderman","hulk","ironman",154,241,251,301,247,82,248,81,246],4),130973:t.r(14,1,t.os(t.cx,2,[296,138,295,147,148,149,131,266,174,"food-delivery","junk food","junk-food",167,73,173]),1,t.bsc_(1,["1y/eSYhr","2XLDpCak","KDm6A4Au"]),t.ge(3),1,t.os(t.cx,3,[296,138,295,147,148,149,131,266,"Convenience food","Street food","Seafood","Fast food","deliveroo",174,"Junk food","junkfood",167,73,173]),t.ge(3),3),130974:t.q(t.ocqs([t.tw(t.cw(0,t.o([t.pc_(5,184),t.ref(27)]),t.ge(1)),24192e6),t.scq(t.tw(t.cw(2,t.a([t.pg(9,30),t.ref(27)])),24192e5),t.vq(t.sw(3,t.ref(27),["properties","engaged_time"],t.g(30))),t.ge(2)),t.cw(1,t.o([t.os(t.cx,2,[157,"world-of-warcraft",151,162,107,274,259,"league-of-legends","cyberpunk-2077",195,184,180]),t.ps(12,184)]),t.ge(1))])),130975:t.r(12,t.cw(1,t.os(t.cx,2,[159,163,"bitcoins","bitcoin fixes this","bitcoin-fixes-this",58,176,121,164,122,"crypto-currency",153,152]),t.ge(3)),t.cw(1,t.os(t.w,11,[70,58,"Crypto",66,159,176,121,163,164,122,153,152]),t.ge(1)),t.cw(0,t.bsc_(1,["/S6ZUo4Q","Gl75mJyx","eNFrTmtK","kVuCe6wT"]),t.ge(3)),t.cw(1,t.os(t.cx,3,["Binance",70,58,"cryptocurrency mining",66]),t.ge(3))),130976:t.q(t.ocqs([t.cw(0,t.bsc_(1,["9a7jtdaV","DFVshILC","OR5PCeih","QhueG7Yc","RHYYfm+r","l9C4e1F7","x1w3xxdr"]),t.ge(3)),t.cw(1,t.os(t.cx,2,["Animals",95,"Animal",94,"pets",263,"Dogs","dogs",158,"Cats","cats","Cat",136]),t.ge(5))])),130977:t.r(14,0,t.bsc_(1,["7TLfquq+","nLkS6BeO"]),0,t.pc_(5,175),t.ge(3),1,t.os(t.cx,2,[130,244,297,114,"soccer-player",285,"Football",175,288,"Sport",287]),t.ge(3),3),130978:t.r(13,0,t.bsc_(1,["+leF/4ig"]),3,t.cx,2,[256,145,"iPhone","Asus ROG","asus-rog","Asus",110,"technology",284,278,"graphics-card",150,"pc master race","pc-master-race","pcmasterrace","pc gaming","pc-gaming","PCMR",261,260],3,t.s,4,["1080",110,145,150,"cpu","geforce","gpu","gtx",230,"laptop",256,260,278,284],3),132458:t.r(0,[t.cw(1,t.os(t.s,11,[114,118,119,120,123,134,160,175,179,190,269,282,285,288,297]),t.ge(3)),t.cw(1,t.os(t.cx,3,[118,160,270,120,"Sports betting","Betting",119,"online gambling","Online gambling","Online Gambling","Online Casino","Online casino","online casino",135,61,282,90,123,59,269,86,60,134,114,297,285,175,190,288,91,74,179]),t.ge(3)),t.cw(1,t.os(t.cx,2,[118,160,270,120,119,"sports betting",61,135,282,90,123,59,86,269,60,134,114,297,285,175,190,288,91,74,179]),t.ge(3))],t.pg(7,18)),133973:t.r(4,18,100),133974:t.r(4,13,99),136104:t.r(4,25,99),137422:t.r(15,0,t.cx,2,["Knockout",234,"Fight",170,303,"UFC",130,"Boxing",244,"MMA"],t.s,11,[130,170,234,244,303]),137871:t.q(t.ocqs([t.tw(t.cw(1,t.os(t.s,11,[128,132,"drifting",168,231,237,"mazda",254,271,298,299]),t.ge(4)),48384e5),t.tw(t.cw(1,t.os(t.cx,2,[298,128,"lamborghini",168,237,"Toyota",299,271,254,"jdm car","jdm-car",231,"Cars","Car",133,132]),t.ge(4)),48384e5)])),137874:t.r(15,1,t.s,11,["airbnb","flight","hotel",265,300],t.cx,2,[265,"Travel",300]),140449:t.q(t.ocqs([t.tw(t.cw(1,t.ref(41),t.ge(4)),6048e5),t.tw(t.cw(0,t.ref(6),t.ge(4)),6048e5),t.tw(t.cw(1,t.ref(40),t.ge(4)),6048e5),t.sq(t.cw(0,t.y(1,197),t.ge(1)))])),140452:t.q(t.cw(4,t.pe(["campaign_id"],3151370783),t.ge(1))),141494:t.q(t.ocqs([t.lm("06346a1e-7c50-4f7f-b474-41c5b81727dc",t.ge(.9210234)),t.ifp("140452")])),141495:t.r(10,5207006830),143386:t.r(16,.80598366),143387:t.q(t.scq(t.cw(2,t.a([t.pg(9,30),t.ref(29)])),t.vq(t.sw(3,t.ref(29),["properties","engaged_time"],t.g(30))),t.ge(2))),143388:t.q(t.ocqs([t.scq(t.cw(2,t.a([t.pg(9,30),t.ref(7)])),t.vq(t.sw(3,t.ref(7),["properties","engaged_time"],t.g(30))),t.ge(2)),t.tw(t.cw(1,t.os(t.cx,2,[195,162,"the-legend-of-zelda",316,"Genshin Impact",186,"nier automata","nier-automata",259,"waifu",187,"honkai-impact-3rd","honkai","nikke",185]),t.ge(2)),48384e5),t.sq(t.cw(0,t.os(t.s,1,[204,205,208,211,212,216]),t.ge(1)))])),145671:t.r(12,t.scq(t.cw(2,t.a([t.pg(9,30),t.ref(31)])),t.vq(t.sw(3,t.ref(31),["properties","engaged_time"],t.g(30))),t.ge(2)),t.cw(1,t.os(t.cx,2,[274,259,"fortnite",290,"half-life-2","tf2","halo-reach","Halo","csgo","counter strike",151,"half-life","team-fortress-2","halo","counterstrike","call-of-duty","tank"]),t.ge(2)),t.scq(t.tw(t.cw(2,t.a([t.pg(9,30),t.ps(1,207)])),24192e5),t.vq(t.sw(3,t.ps(1,207),["properties","engaged_time"],t.g(30))),t.ge(4)),t.sq(t.cw(0,t.bsc_(1,["+Uwo0GX9","4ue3w7+G","ElWO9mQe","LbjwPKbn","Me87qrRb","f3hPUScG","hQLk9e9N","oCmUD2Y5","tAFoHkOm","yP7oKfrm"]),t.ge(1)))),146626:t.r(16,.86964345),146697:t.r(16,.8358427),146817:t.r(10,5223744478),147227:t.r(17,.8902886),147353:t.r(17,.8743028),147409:t.r(17,.8263079),157061:t.r(3,71),157062:t.r(2,71,18,34),157063:t.r(2,71,25,54),157064:t.r(3,77),157065:t.r(2,77,18,34),157066:t.r(2,77,25,54),157067:t.r(36,48384e5,1,t.os(t.cx,2,["economy","startup","business","banks","finance"]),2),157369:t.q(t.ocqs([t.cw(0,t.bsc_(1,["JJOnWTcX","k1Z6yHqA"]),t.ge(2)),t.cw(0,t.y(6,71),t.ge(1))])),162759:t.r(1,0,t.ref(32)),162760:t.r(8,"Germany"),162761:t.r(6,["L0iP/ILM"]),162769:t.r(6,["zq+1HisH"]),162876:t.r(6,["IMC3vatw"]),162877:t.r(6,["0RW41ay4"]),162979:t.r(8,"Canada"),162980:t.r(6,["l2kSHxD3"]),162981:t.r(5,["austria","belgium","denmark","finland","france","germany","hungary","netherlands","norway","poland","romania","spain","sweden","switzerland","united kingdom"]),162982:t.r(5,["indonesia","malaysia","philippines","singapore","thailand","vietnam"]),163786:t.r(0,[t.tw(t.cw(1,t.ref(41),t.ge(2)),72576e5),t.tw(t.cw(0,t.ref(6),t.ge(2)),72576e5),t.tw(t.cw(1,t.ref(40),t.ge(1)),72576e5),t.ltn(t.cw(0,t.y(1,197),t.ge(1)),0,10)],t.ref(32)),164432:t.r(9,1,152),164433:t.r(36,12096e5,4,t.t,3),164674:t.r(18,t.scq(t.tw(t.sw(2,t.ref(47),["properties","aggregations","PageviewEngagement","engaged_time"]),6048e5),t.vq(t.sw(3,t.ref(47),["properties","engaged_time"])),t.g(180)),24192e5,t.cw(1,t.os(t.cx,2,[183,192,"skyrim",261,"baldurs gate","Brutal Legend",305,"diablo 4",181,184,182,180]),t.ge(2)),24192e5,1,t.ref(47),t.ge(2)),164675:t.r(18,t.scq(t.tw(t.sw(2,t.ref(38),["properties","aggregations","PageviewEngagement","engaged_time"]),12096e5),t.vq(t.sw(3,t.ref(38),["properties","engaged_time"])),t.g(180)),6048e5,t.cw(1,t.os(t.cx,2,[139,51,96]),t.ge(2)),6048e5,0,t.ref(38),t.ge(4)),164676:t.r(35,6048e5,180,t.ps(1,96),t.ps(1,96)),164683:t.r(35,864e5,300,t.t,t.t),164840:t.r(36,6048e5,"LinkClick",t.ps(["dest_url"],"top"),2),164929:t.r(21,10,10,96),164930:t.r(21,16,16,252),164931:t.r(19,[182],[180,184,182],[182,184]),164939:t.r(20,51,51,["WTF",313]),165125:t.r(36,24192e5,1,t.os(t.cx,2,[268,"switch","XBOX",85,84,"nintendo",125,305,316,"bloodborne","elden ring","Baldurs Gate",314,261,157,315,"final-fantasy",183,182,180,"tears-of-the-kingdom","Tears of the Kingdom",184]),1),165127:t.q(t.cw(4,t.os(t.e,13,[5342668775,5207006830]),t.ge(1))),165128:t.r(21,17,17,227),165129:t.r(20,1,1,[242,"memes"]),165130:t.q(t.ocqs([t.tw(t.cw(0,t.ref(35),t.ge(1)),72576e5),t.sq(t.cw(0,t.o([t.ref(19),t.ref(35)]),t.ge(1)))])),165131:t.r(21,52,52,188),165132:t.r(21,2,2,276),165133:t.r(20,36,36,[133,245]),165134:t.r(21,26,26,95),165135:t.r(21,14,14,279),165136:t.r(21,30,30,139),165137:t.r(21,4,4,307),165138:t.r(21,8,8,288),165139:t.r(21,48,48,109),165140:t.r(21,5,5,248),165141:t.r(21,13,13,136),165142:t.r(21,15,15,173),165143:t.q(t.ocqs([t.tw(t.cw(0,t.os(t.s,1,[238]),t.ge(3)),24192e5),t.sq(t.cw(0,t.o([t.pc_(5,238),t.ps(1,238)]),t.ge(1)))])),165144:t.r(20,18,18,[292,293]),165145:t.r(19,["https://9gag.com/interest/crypto","https://9gag.com/tag/cryptocurrency"],[153,152],[152]),165146:t.r(21,43,43,275),165147:t.r(21,25,25,309),165426:t.r(31,225,225),165427:t.r(31,226,226),165428:t.r(31,196,196),165497:t.r(1,0,t.pc_(5,"latest-news")),165543:t.q(t.ocqs([t.tw(t.cw(1,t.o([t.ref(3),t.pc_(10,178),t.os(t.cx,2,[304,117,179,269,281,280,134,178]),t.ref(21)]),t.ge(1)),7776e6),t.scq(t.cw(2,t.a([t.pg(9,30),t.ref(0)])),t.vq(t.sw(3,t.ref(0),["properties","engaged_time"],t.g(30))),t.ge(3))])),165821:t.r(34,t.os(t.s,4,[106,113,125,157,169,181,182,184,192,259,267,290,302,305,308,314,315]),11,11,[184,182],[302,"FIFA","GTA",259,181,125,290,314,267,107,113,308,315,184,182,305,157],49),165834:t.q(t.tw(t.cw(1,t.o([t.pe(["post","sensitive"],!0),t.os(t.cx,2,[83,255])]),t.ge(2)),7776e6)),172125:t.q(t.ocqs([t.cw(0,t.ref(12),t.ge(1)),t.cw(1,t.ref(12),t.ge(1)),t.scq(t.sw(2,t.ref(12),["properties","aggregations","PageviewEngagement","engaged_time"]),t.vq(t.sw(3,t.ref(12),["properties","engaged_time"])),t.g(60))])),172126:t.r(40,[258,"One Punch Man",233,111,268,156,129,124,185,"dundam",161,139,96,189,250,257],[258,"One punch man","Jujutsu Kaisen","Attack on Titan","Pokémon","Demon Slayer","Boruto",124,185,193,161,139,96,189,257,250],11,[96,111,124,129,139,156,161,185,189,193,233,250,257,"one punch man",268]),172230:t.r(40,[278,191,283,228,229,177,284,230,264,"Android"],[278,191,283,228,229,177,284,264,93,230],4,[93,177,228,229,264,278,283]),172231:t.r(40,[263,171,136,158,94],[263,171,136,158,94],4,[94,136,158,171,263]),172232:t.r(40,[287,277,312,114,72,294,297,175,285],[287,277,312,114,72,294,297,175,285],4,[114,165,175,277,285,287,294,297,312]),173933:t.r(9,12,228),173934:t.r(7,12,93),175726:t.r(8,"Belgium"),181515:t.r(32,t.ref(23),t.ref(24),t.ref(46),45,45,239),181516:t.r(32,t.pc_(3,127),t.pc_(2,127),t.ps(4,127),50,50,127),183194:t.q(t.ocqs([t.tw(t.cw(1,t.o([t.os(t.cx,3,[126,253,164,122,152,66,117,179,269,304,281,280,134,178]),t.os(t.cx,10,[126,253,164,122,152,178]),t.os(t.cx,2,[126,253,164,122,152,304,117,179,269,281,280,134,178]),t.os(t.s,4,[117,122,126,134,"crypto (general)",164,178,179,253,269,280,304])]),t.ge(1)),7776e6),t.scq(t.cw(2,t.a([t.pg(9,30),t.ref(39)])),t.vq(t.sw(3,t.ref(39),["properties","engaged_time"],t.g(30))),t.ge(3))])),184030:t.r(33,33,33,[146,286,85,84,314,"playstations"],[146,286,85,84,314,267],[146,286,85,84,314,"PlayStation"],22),184031:t.r(33,20,20,[67,291,292,68,155,194,108,172,311,115,293],[291,292,"dc-comics",155,194,108,172,311,115,293],[67,291,292,68,155,194,108,172,311,115,293],28),184032:t.r(34,t.ref(37),42,42,[78,75,50,76,262],[78,75,262,76],9),184817:t.q(t.acqs([t.cw(0,t.z(6,77),t.ge(1)),t.ocqs([t.cw(1,t.o([t.os(t.cx,3,[235,310,166,238,116]),t.ref(34),t.os(t.cx,2,[235,310,116,238,166]),t.os(t.s,["client","domain"],[116,166,235,238,310]),t.os(t.s,4,[116,166,235,310])]),t.ge(1)),t.itp("eyeota","35382",!1,"184817"),t.itp("eyeota","1634",!1,"184817"),t.itp("eyeota","35382",!1,"184817"),t.itp("eyeota","1522",!1,"184817"),t.cw(0,t.a([t.ref(34),t.os(t.s,4,[116,166,235,238,310]),t.os(t.cx,2,[235,310,238,166,116])]),t.ge(2)),t.itp("eyeota","1505",!1,"184817"),t.itp("eyeota","1659",!1,"184817")])])),187302:t.q(t.ocqs([t.tw(t.cw(0,t.ref(44),t.ge(3)),24192e5),t.sq(t.cw(0,t.o([t.ref(44),t.nt(t.ref(19))]),t.ge(1)))])),189696:t.q(t.ocqs([t.tw(t.cw(1,t.o([t.os(t.cx,3,["motorsports",72]),t.os(t.cx,10,[72,165]),t.pc_(2,72),t.ps(4,72)]),t.ge(1)),217728e6),t.scq(t.cw(2,t.a([t.pg(9,1),t.ref(53)])),t.vq(t.sw(3,t.ref(53),["properties","engaged_time"],t.g(1))),t.ge(1))]))}||{},queriesByEvent:n||{}}}));function Le(t){return((t,n)=>o(Ce(t,n),(n=>Object.assign(Object.assign({},n),{userId:t.userId}))))(t,Ee())}function Pe(t,n){const e=o((t=>pe(t,((t,n)=>n.state?m({[n.checksum]:n.state}):p)))(t),On,wn((t=>G(new Map)))),r=o(On(n),wn((t=>G(new Map))));return o(function(t,n){return ae("delta",t,n)}(e,r),(t=>Sn(t)))||{}}!function(t){const n=self;function e(t,e,r,i){function o(e){if("function"!=typeof n.postMessage)return t.ports[0].postMessage(e);n.postMessage(e)}if(!r)return o([e,null,i]);"undefined"!=typeof console&&"error"in console&&console.error("Worker caught an error:",r),o([e,r])}n.addEventListener("message",(function(n){if(r=n,!Array.isArray(r.data)||2!==r.data.length)return;var r;const i=n.data,[o,u]=i;if("function"==typeof t)return function(t,n,r,i){const o=function(t,n){try{return{res:t(n)}}catch(t){return{err:t}}}(n,i);return Boolean(null===(u=o)||void 0===u?void 0:u.err)?e(t,r,o.err):!(a=o.res)||"object"!=typeof a&&"function"!=typeof a||"function"!=typeof a.then?e(t,r,null,o.res):void o.res.then((function(n){e(t,r,null,n)}),(function(n){e(t,r,n)}));var u,a}(n,t,o,u);e(n,o,new Error("Please pass a function into register()."))}))}((t=>"QLE"===t.engine?Le(t):function(t){switch(t.type){case"delta":return Pe(t.stateMap,t.lastSentStateMapWithChecksum);case"noop":return{}}}(t)))})();',"Worker",void 0,void 0)}},477:t=>{t.exports=function(t,e,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([t])}catch(e){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(t),o=o.getBlob()}var s=i.URL||i.webkitURL,a=s.createObjectURL(o),u=new i[e](a,n);return s.revokeObjectURL(a),u}catch(r){return new i[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error("Inline worker is not supported");return new i[e](r,n)}}},7582:(t,e,n)=>{n.d(e,{_T:()=>r,mG:()=>i});function r(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={},_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__;_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3992),(0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__.ho)(!0),(0,_framework_compute_time_measurement__WEBPACK_IMPORTED_MODULE_0__.HJ)((()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__,1101))))})();